From b3a2814ea68d8760244b0797ddb4d229cdac215b Mon Sep 17 00:00:00 2001 From: inventivetalent Date: Mon, 1 Feb 2021 17:31:43 +0100 Subject: [PATCH] 1.4.7 --- dist/all.js | 47 ++++++++++++++++++++++++++++++++++------- dist/all.min.js | 18 ++++++++-------- dist/entity.js | 47 ++++++++++++++++++++++++++++++++++------- dist/entity.min.js | 18 ++++++++-------- dist/gui.js | 47 ++++++++++++++++++++++++++++++++++------- dist/gui.min.js | 18 ++++++++-------- dist/model.js | 47 ++++++++++++++++++++++++++++++++++------- dist/model.min.js | 18 ++++++++-------- dist/skin.js | 52 ++++++++++++++++++++++++++++++++++++++++++---- dist/skin.min.js | 8 +++---- package.json | 2 +- 11 files changed, 249 insertions(+), 73 deletions(-) diff --git a/dist/all.js b/dist/all.js index ca6d5f73..4fa741d2 100644 --- a/dist/all.js +++ b/dist/all.js @@ -1,8 +1,8 @@ /*! - * MineRender 1.4.6 + * MineRender 1.4.7 * (c) 2018, Haylee Schäfer (inventivetalent) / MIT License * https://minerender.org - * Build #1612195849082 / Mon Feb 01 2021 17:10:49 GMT+0100 (GMT+01:00) + * Build #1612197069607 / Mon Feb 01 2021 17:31:09 GMT+0100 (GMT+01:00) */ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache @@ -317,6 +317,28 @@ eval("(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefg /***/ }), +/***/ "./node_modules/debug/src/browser.js": +/*!*******************************************!*\ + !*** ./node_modules/debug/src/browser.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(/*! ./debug */ \"./node_modules/debug/src/debug.js\");\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/process/browser.js */ \"./node_modules/node-libs-browser/node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/debug/src/browser.js?"); + +/***/ }), + +/***/ "./node_modules/debug/src/debug.js": +/*!*****************************************!*\ + !*** ./node_modules/debug/src/debug.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n\n//# sourceURL=webpack:///./node_modules/debug/src/debug.js?"); + +/***/ }), + /***/ "./node_modules/deepmerge/dist/cjs.js": /*!********************************************!*\ !*** ./node_modules/deepmerge/dist/cjs.js ***! @@ -442,6 +464,17 @@ eval("(function(){\r\n var crypt = __webpack_require__(/*! crypt */ \"./node_mo /***/ }), +/***/ "./node_modules/ms/index.js": +/*!**********************************!*\ + !*** ./node_modules/ms/index.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n\n//# sourceURL=webpack:///./node_modules/ms/index.js?"); + +/***/ }), + /***/ "./node_modules/node-libs-browser/node_modules/process/browser.js": /*!************************************************************************!*\ !*** ./node_modules/node-libs-browser/node_modules/process/browser.js ***! @@ -2061,7 +2094,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(f /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_ROOT\", function() { return DEFAULT_ROOT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureAsBase64\", function() { return loadTextureAsBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadBlockState\", function() { return loadBlockState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureMeta\", function() { return loadTextureMeta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath\", function() { return loadJsonFromPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath_\", function() { return loadJsonFromPath_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleUv\", function() { return scaleUv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trimCanvas\", function() { return trimCanvas; });\n/**\r\n * Default asset root\r\n * @type {string}\r\n */\r\nconst DEFAULT_ROOT = \"https://assets.mcasset.cloud/1.13\";\r\n/**\r\n * Texture cache\r\n * @type {Object.}\r\n */\r\nconst textureCache = {};\r\n/**\r\n * Texture callbacks\r\n * @type {Object.}\r\n */\r\nconst textureCallbacks = {};\r\n\r\n/**\r\n * Model cache\r\n * @type {Object.}\r\n */\r\nconst modelCache = {};\r\n/**\r\n * Model callbacks\r\n * @type {Object.}\r\n */\r\nconst modelCallbacks = {};\r\n\r\n\r\n/**\r\n * Loads a Mincraft texture an returns it as Base64\r\n *\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} namespace Namespace, usually 'minecraft'\r\n * @param {string} dir Directory of the texture\r\n * @param {string} name Name of the texture\r\n * @returns {Promise}\r\n */\r\nfunction loadTextureAsBase64(root, namespace, dir, name) {\r\n return new Promise((resolve, reject) => {\r\n loadTexture(root, namespace, dir, name, resolve, reject);\r\n })\r\n};\r\n\r\n/**\r\n * Load a texture as base64 - shouldn't be used directly\r\n * @see loadTextureAsBase64\r\n * @ignore\r\n */\r\nfunction loadTexture(root, namespace, dir, name, resolve, reject, forceLoad) {\r\n let path = \"/assets/\" + namespace + \"/textures\" + dir + name + \".png\";\r\n\r\n if (textureCache.hasOwnProperty(path)) {\r\n if (textureCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(textureCache[path]);\r\n return;\r\n }\r\n\r\n if (!textureCallbacks.hasOwnProperty(path) || textureCallbacks[path].length === 0 || forceLoad) {\r\n // https://gist.github.com/oliyh/db3d1a582aefe6d8fee9 / https://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', root + path, true);\r\n xhr.responseType = 'arraybuffer';\r\n xhr.onloadend = function () {\r\n if (xhr.status === 200) {\r\n let arr = new Uint8Array(xhr.response || xhr.responseText);\r\n let raw = String.fromCharCode.apply(null, arr);\r\n let b64 = btoa(raw);\r\n let dataURL = \"data:image/png;base64,\" + b64;\r\n\r\n textureCache[path] = dataURL;\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[0](dataURL);\r\n }\r\n }\r\n } else {\r\n if (DEFAULT_ROOT === root) {\r\n textureCache[path] = \"__invalid\";\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n loadTexture(DEFAULT_ROOT, namespace, dir, name, resolve, reject, true)\r\n }\r\n }\r\n };\r\n xhr.send();\r\n\r\n // init array\r\n if (!textureCallbacks.hasOwnProperty(path))\r\n textureCallbacks[path] = [];\r\n }\r\n\r\n // add the promise callback\r\n textureCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n\r\n/**\r\n * Loads a blockstate file and returns the contained JSON\r\n * @param {string} state Name of the blockstate\r\n * @param {string} assetRoot Asset root, see {@link DEFAULT_ROOT}\r\n * @returns {Promise}\r\n */\r\nfunction loadBlockState(state, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/blockstates/\" + state + \".json\")\r\n};\r\n\r\nfunction loadTextureMeta(texture, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/textures/block/\" + texture + \".png.mcmeta\")\r\n}\r\n\r\n/**\r\n * Loads a model file and returns the contained JSON\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} path Path to the model file\r\n * @returns {Promise}\r\n */\r\nfunction loadJsonFromPath(root, path) {\r\n return new Promise((resolve, reject) => {\r\n loadJsonFromPath_(root, path, resolve, reject);\r\n })\r\n}\r\n\r\n/**\r\n * Load a model - shouldn't used directly\r\n * @see loadJsonFromPath\r\n * @ignore\r\n */\r\nfunction loadJsonFromPath_(root, path, resolve, reject, forceLoad) {\r\n if (modelCache.hasOwnProperty(path)) {\r\n if (modelCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(Object.assign({}, modelCache[path]));\r\n return;\r\n }\r\n\r\n if (!modelCallbacks.hasOwnProperty(path) || modelCallbacks[path].length === 0 || forceLoad) {\r\n console.log(root + path)\r\n fetch(root + path, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"json data:\", data);\r\n modelCache[path] = data;\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let dataCopy = Object.assign({}, data);\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[0](dataCopy);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n console.warn(err);\r\n if (DEFAULT_ROOT === root) {\r\n modelCache[path] = \"__invalid\";\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n // Try again with default root\r\n loadJsonFromPath_(DEFAULT_ROOT, path, resolve, reject, true);\r\n }\r\n });\r\n\r\n if (!modelCallbacks.hasOwnProperty(path))\r\n modelCallbacks[path] = [];\r\n }\r\n\r\n modelCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n/**\r\n * Scales UV values\r\n * @param {number} uv UV value\r\n * @param {number} size\r\n * @param {number} [scale=16]\r\n * @returns {number}\r\n */\r\nfunction scaleUv(uv, size, scale) {\r\n if (uv === 0) return 0;\r\n return size / (scale || 16) * uv;\r\n}\r\n\r\n\r\n// https://gist.github.com/remy/784508\r\nfunction trimCanvas(c) {\r\n let ctx = c.getContext('2d'),\r\n copy = document.createElement('canvas').getContext('2d'),\r\n pixels = ctx.getImageData(0, 0, c.width, c.height),\r\n l = pixels.data.length,\r\n i,\r\n bound = {\r\n top: null,\r\n left: null,\r\n right: null,\r\n bottom: null\r\n },\r\n x, y;\r\n\r\n for (i = 0; i < l; i += 4) {\r\n if (pixels.data[i + 3] !== 0) {\r\n x = (i / 4) % c.width;\r\n y = ~~((i / 4) / c.width);\r\n\r\n if (bound.top === null) {\r\n bound.top = y;\r\n }\r\n\r\n if (bound.left === null) {\r\n bound.left = x;\r\n } else if (x < bound.left) {\r\n bound.left = x;\r\n }\r\n\r\n if (bound.right === null) {\r\n bound.right = x;\r\n } else if (bound.right < x) {\r\n bound.right = x;\r\n }\r\n\r\n if (bound.bottom === null) {\r\n bound.bottom = y;\r\n } else if (bound.bottom < y) {\r\n bound.bottom = y;\r\n }\r\n }\r\n }\r\n\r\n let trimHeight = bound.bottom - bound.top,\r\n trimWidth = bound.right - bound.left,\r\n trimmed = ctx.getImageData(bound.left, bound.top, trimWidth, trimHeight);\r\n\r\n copy.canvas.width = trimWidth;\r\n copy.canvas.height = trimHeight;\r\n copy.putImageData(trimmed, 0, 0);\r\n\r\n // open new window with trimmed image:\r\n return copy.canvas;\r\n}\n\n//# sourceURL=webpack:///./src/functions.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_ROOT\", function() { return DEFAULT_ROOT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureAsBase64\", function() { return loadTextureAsBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadBlockState\", function() { return loadBlockState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureMeta\", function() { return loadTextureMeta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath\", function() { return loadJsonFromPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath_\", function() { return loadJsonFromPath_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleUv\", function() { return scaleUv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trimCanvas\", function() { return trimCanvas; });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_0__);\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__(\"minerender\");\r\n\r\n/**\r\n * Default asset root\r\n * @type {string}\r\n */\r\nconst DEFAULT_ROOT = \"https://assets.mcasset.cloud/1.13\";\r\n/**\r\n * Texture cache\r\n * @type {Object.}\r\n */\r\nconst textureCache = {};\r\n/**\r\n * Texture callbacks\r\n * @type {Object.}\r\n */\r\nconst textureCallbacks = {};\r\n\r\n/**\r\n * Model cache\r\n * @type {Object.}\r\n */\r\nconst modelCache = {};\r\n/**\r\n * Model callbacks\r\n * @type {Object.}\r\n */\r\nconst modelCallbacks = {};\r\n\r\n\r\n/**\r\n * Loads a Mincraft texture an returns it as Base64\r\n *\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} namespace Namespace, usually 'minecraft'\r\n * @param {string} dir Directory of the texture\r\n * @param {string} name Name of the texture\r\n * @returns {Promise}\r\n */\r\nfunction loadTextureAsBase64(root, namespace, dir, name) {\r\n return new Promise((resolve, reject) => {\r\n loadTexture(root, namespace, dir, name, resolve, reject);\r\n })\r\n};\r\n\r\n/**\r\n * Load a texture as base64 - shouldn't be used directly\r\n * @see loadTextureAsBase64\r\n * @ignore\r\n */\r\nfunction loadTexture(root, namespace, dir, name, resolve, reject, forceLoad) {\r\n let path = \"/assets/\" + namespace + \"/textures\" + dir + name + \".png\";\r\n\r\n if (textureCache.hasOwnProperty(path)) {\r\n if (textureCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(textureCache[path]);\r\n return;\r\n }\r\n\r\n if (!textureCallbacks.hasOwnProperty(path) || textureCallbacks[path].length === 0 || forceLoad) {\r\n // https://gist.github.com/oliyh/db3d1a582aefe6d8fee9 / https://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', root + path, true);\r\n xhr.responseType = 'arraybuffer';\r\n xhr.onloadend = function () {\r\n if (xhr.status === 200) {\r\n let arr = new Uint8Array(xhr.response || xhr.responseText);\r\n let raw = String.fromCharCode.apply(null, arr);\r\n let b64 = btoa(raw);\r\n let dataURL = \"data:image/png;base64,\" + b64;\r\n\r\n textureCache[path] = dataURL;\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[0](dataURL);\r\n }\r\n }\r\n } else {\r\n if (DEFAULT_ROOT === root) {\r\n textureCache[path] = \"__invalid\";\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n loadTexture(DEFAULT_ROOT, namespace, dir, name, resolve, reject, true)\r\n }\r\n }\r\n };\r\n xhr.send();\r\n\r\n // init array\r\n if (!textureCallbacks.hasOwnProperty(path))\r\n textureCallbacks[path] = [];\r\n }\r\n\r\n // add the promise callback\r\n textureCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n\r\n/**\r\n * Loads a blockstate file and returns the contained JSON\r\n * @param {string} state Name of the blockstate\r\n * @param {string} assetRoot Asset root, see {@link DEFAULT_ROOT}\r\n * @returns {Promise}\r\n */\r\nfunction loadBlockState(state, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/blockstates/\" + state + \".json\")\r\n};\r\n\r\nfunction loadTextureMeta(texture, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/textures/block/\" + texture + \".png.mcmeta\")\r\n}\r\n\r\n/**\r\n * Loads a model file and returns the contained JSON\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} path Path to the model file\r\n * @returns {Promise}\r\n */\r\nfunction loadJsonFromPath(root, path) {\r\n return new Promise((resolve, reject) => {\r\n loadJsonFromPath_(root, path, resolve, reject);\r\n })\r\n}\r\n\r\n/**\r\n * Load a model - shouldn't used directly\r\n * @see loadJsonFromPath\r\n * @ignore\r\n */\r\nfunction loadJsonFromPath_(root, path, resolve, reject, forceLoad) {\r\n if (modelCache.hasOwnProperty(path)) {\r\n if (modelCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(Object.assign({}, modelCache[path]));\r\n return;\r\n }\r\n\r\n if (!modelCallbacks.hasOwnProperty(path) || modelCallbacks[path].length === 0 || forceLoad) {\r\n debug(root + path)\r\n fetch(root + path, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n debug(\"json data:\", data);\r\n modelCache[path] = data;\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let dataCopy = Object.assign({}, data);\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[0](dataCopy);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n console.warn(err);\r\n if (DEFAULT_ROOT === root) {\r\n modelCache[path] = \"__invalid\";\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n // Try again with default root\r\n loadJsonFromPath_(DEFAULT_ROOT, path, resolve, reject, true);\r\n }\r\n });\r\n\r\n if (!modelCallbacks.hasOwnProperty(path))\r\n modelCallbacks[path] = [];\r\n }\r\n\r\n modelCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n/**\r\n * Scales UV values\r\n * @param {number} uv UV value\r\n * @param {number} size\r\n * @param {number} [scale=16]\r\n * @returns {number}\r\n */\r\nfunction scaleUv(uv, size, scale) {\r\n if (uv === 0) return 0;\r\n return size / (scale || 16) * uv;\r\n}\r\n\r\n\r\n// https://gist.github.com/remy/784508\r\nfunction trimCanvas(c) {\r\n let ctx = c.getContext('2d'),\r\n copy = document.createElement('canvas').getContext('2d'),\r\n pixels = ctx.getImageData(0, 0, c.width, c.height),\r\n l = pixels.data.length,\r\n i,\r\n bound = {\r\n top: null,\r\n left: null,\r\n right: null,\r\n bottom: null\r\n },\r\n x, y;\r\n\r\n for (i = 0; i < l; i += 4) {\r\n if (pixels.data[i + 3] !== 0) {\r\n x = (i / 4) % c.width;\r\n y = ~~((i / 4) / c.width);\r\n\r\n if (bound.top === null) {\r\n bound.top = y;\r\n }\r\n\r\n if (bound.left === null) {\r\n bound.left = x;\r\n } else if (x < bound.left) {\r\n bound.left = x;\r\n }\r\n\r\n if (bound.right === null) {\r\n bound.right = x;\r\n } else if (bound.right < x) {\r\n bound.right = x;\r\n }\r\n\r\n if (bound.bottom === null) {\r\n bound.bottom = y;\r\n } else if (bound.bottom < y) {\r\n bound.bottom = y;\r\n }\r\n }\r\n }\r\n\r\n let trimHeight = bound.bottom - bound.top,\r\n trimWidth = bound.right - bound.left,\r\n trimmed = ctx.getImageData(bound.left, bound.top, trimWidth, trimHeight);\r\n\r\n copy.canvas.width = trimWidth;\r\n copy.canvas.height = trimHeight;\r\n copy.putImageData(trimmed, 0, 0);\r\n\r\n // open new window with trimmed image:\r\n return copy.canvas;\r\n}\r\n\n\n//# sourceURL=webpack:///./src/functions.js?"); /***/ }), @@ -2121,7 +2154,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return worker; });\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n\r\n\r\nfunction worker(self) {\r\n console.debug(\"New Worker!\")\r\n self.addEventListener(\"message\", event => {\r\n let msg = event.data;\r\n\r\n if (msg.func === \"parseModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"parseModel\"])(msg.model, msg.modelOptions, [], msg.assetRoot).then((parsedModelList) => {\r\n self.postMessage({msg: \"done\",parsedModelList:parsedModelList})\r\n close();\r\n })\r\n } else if (msg.func === \"loadAndMergeModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadAndMergeModel\"])(msg.model, msg.assetRoot).then((mergedModel) => {\r\n self.postMessage({msg: \"done\",mergedModel:mergedModel});\r\n close();\r\n })\r\n } else if (msg.func === \"loadTextures\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextures\"])(msg.textures, msg.assetRoot).then((textures) => {\r\n self.postMessage({msg: \"done\",textures:textures});\r\n close();\r\n })\r\n } else {\r\n console.warn(\"Unknown function '\" + msg.func + \"' for ModelWorker\");\r\n console.warn(msg);\r\n close();\r\n }\r\n })\r\n};\r\n\n\n//# sourceURL=webpack:///./src/model/ModelWorker.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return worker; });\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_1__(\"minerender\");\r\n\r\nfunction worker(self) {\r\n debug(\"New Worker!\")\r\n self.addEventListener(\"message\", event => {\r\n let msg = event.data;\r\n\r\n if (msg.func === \"parseModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"parseModel\"])(msg.model, msg.modelOptions, [], msg.assetRoot).then((parsedModelList) => {\r\n self.postMessage({msg: \"done\",parsedModelList:parsedModelList})\r\n close();\r\n })\r\n } else if (msg.func === \"loadAndMergeModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadAndMergeModel\"])(msg.model, msg.assetRoot).then((mergedModel) => {\r\n self.postMessage({msg: \"done\",mergedModel:mergedModel});\r\n close();\r\n })\r\n } else if (msg.func === \"loadTextures\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextures\"])(msg.textures, msg.assetRoot).then((textures) => {\r\n self.postMessage({msg: \"done\",textures:textures});\r\n close();\r\n })\r\n } else {\r\n console.warn(\"Unknown function '\" + msg.func + \"' for ModelWorker\");\r\n console.warn(msg);\r\n close();\r\n }\r\n })\r\n};\r\n\n\n//# sourceURL=webpack:///./src/model/ModelWorker.js?"); /***/ }), @@ -2133,7 +2166,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _renderBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../renderBase */ \"./src/renderBase.js\");\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var _modelConverter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modelConverter */ \"./src/model/modelConverter.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! md5 */ \"./node_modules/md5/md5.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! webworkify-webpack */ \"./node_modules/webworkify-webpack/index.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _skin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../skin */ \"./src/skin/index.js\");\n/* harmony import */ var onscreen_lib_methods_off__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! onscreen/lib/methods/off */ \"./node_modules/onscreen/lib/methods/off.js\");\n\r\n\r\n__webpack_require__(/*! three-instanced-mesh */ \"./node_modules/three-instanced-mesh/index.js\")(three__WEBPACK_IMPORTED_MODULE_0__);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst ModelWorker = /*require.resolve*/(/*! ./ModelWorker.js */ \"./src/model/ModelWorker.js\");\r\n\r\n\r\nString.prototype.replaceAll = function (search, replacement) {\r\n let target = this;\r\n return target.replace(new RegExp(search, 'g'), replacement);\r\n};\r\n\r\nconst colors = [\r\n 0xFF0000,\r\n 0x00FFFF,\r\n 0x0000FF,\r\n 0x000080,\r\n 0xFF00FF,\r\n 0x800080,\r\n 0x808000,\r\n 0x00FF00,\r\n 0x008000,\r\n 0xFFFF00,\r\n 0x800000,\r\n 0x008080,\r\n];\r\n\r\nconst FACE_ORDER = [\"east\", \"west\", \"up\", \"down\", \"south\", \"north\"];\r\nconst TINTS = [\"lightgreen\"];\r\n\r\nconst mergedModelCache = {};\r\nconst loadedTextureCache = {};\r\nconst modelInstances = {};\r\n\r\nconst textureCache = {};\r\nconst canvasCache = {};\r\nconst materialCache = {};\r\nconst geometryCache = {};\r\nconst instanceCache = {};\r\n\r\nconst animatedTextures = [];\r\n\r\n/**\r\n * @see defaultOptions\r\n * @property {string} type alternative way to specify the model type (block/item)\r\n * @property {boolean} [centerCubes=false] center the cube's rotation point\r\n * @property {string} [assetRoot=DEFAULT_ROOT] root to get asset files from\r\n */\r\nlet defOptions = {\r\n camera: {\r\n type: \"perspective\",\r\n x: 35,\r\n y: 25,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n type: \"block\",\r\n centerCubes: false,\r\n assetRoot: _functions__WEBPACK_IMPORTED_MODULE_4__[\"DEFAULT_ROOT\"],\r\n useWebWorkers: false\r\n};\r\n\r\n/**\r\n * A renderer for Minecraft models, i.e. blocks & items\r\n */\r\nclass ModelRender extends _renderBase__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\r\n\r\n /**\r\n * @param {Object} [options] The options for this renderer, see {@link defaultOptions}\r\n * @param {string} [options.assetRoot=DEFAULT_ROOT] root to get asset files from\r\n *\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, element) {\r\n super(options, defOptions, element);\r\n\r\n this.renderType = \"ModelRender\";\r\n\r\n this.models = [];\r\n this.instancePositionMap = {};\r\n this.attached = false;\r\n }\r\n\r\n /**\r\n * Does the actual rendering\r\n * @param {(string[]|Object[])} models Array of models to render - Either strings in the format / or objects\r\n * @param {string} [models[].type=block] either 'block' or 'item'\r\n * @param {string} models[].model if 'type' is given, just the block/item name otherwise '/'\r\n * @param {number[]} [models[].offset] [x,y,z] array of the offset\r\n * @param {number[]} [models[].rotation] [x,y,z] array of the rotation\r\n * @param {string} [models[].blockstate] name of a blockstate to be used to determine the models (only for blocks)\r\n * @param {string} [models[].variant=normal] if 'blockstate' is given, the block variant to use\r\n * @param {function} [cb] Callback when rendering finished\r\n */\r\n render(models, cb) {\r\n let modelRender = this;\r\n\r\n if (!modelRender.attached && !modelRender._scene) {// Don't init scene if attached, since we already have an available scene\r\n super.initScene(function () {\r\n // Animate textures\r\n for (let i = 0; i < animatedTextures.length; i++) {\r\n animatedTextures[i]();\r\n }\r\n\r\n modelRender.element.dispatchEvent(new CustomEvent(\"modelRender\", {detail: {models: modelRender.models}}));\r\n });\r\n } else {\r\n console.log(\"[ModelRender] is attached - skipping scene init\");\r\n }\r\n\r\n let parsedModelList = [];\r\n\r\n parseModels(modelRender, models, parsedModelList)\r\n .then(() => loadAndMergeModels(modelRender, parsedModelList))\r\n .then(() => loadModelTextures(modelRender, parsedModelList))\r\n .then(() => doModelRender(modelRender, parsedModelList))\r\n .then((renderedModels) => {\r\n console.timeEnd(\"doModelRender\");\r\n console.debug(renderedModels)\r\n if (typeof cb === \"function\") cb();\r\n })\r\n\r\n }\r\n\r\n}\r\n\r\n\r\nfunction parseModels(modelRender, models, parsedModelList) {\r\n console.time(\"parseModels\");\r\n console.log(\"Parsing Models...\");\r\n let parsePromises = [];\r\n for (let i = 0; i < models.length; i++) {\r\n let model = models[i];\r\n\r\n // parsePromises.push(parseModel(model, model, parsedModelList, modelRender.options.assetRoot))\r\n parsePromises.push(new Promise(resolve => {\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n parsedModelList.push(...event.data.parsedModelList);\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"parseModel\",\r\n model: model,\r\n modelOptions: model,\r\n parsedModelList: parsedModelList,\r\n assetRoot: modelRender.options.assetRoot\r\n })\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"parseModel\"])(model, model, parsedModelList, modelRender.options.assetRoot).then(() => {\r\n resolve();\r\n })\r\n }\r\n }))\r\n\r\n }\r\n\r\n return Promise.all(parsePromises);\r\n}\r\n\r\n\r\nfunction loadAndMergeModels(modelRender, parsedModelList) {\r\n console.timeEnd(\"parseModels\");\r\n console.time(\"loadAndMergeModels\");\r\n\r\n let jsonPromises = [];\r\n\r\n console.log(\"Loading Model JSON data & merging...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i]);\r\n modelInstances[cacheKey] = (modelInstances[cacheKey] || 0) + 1;\r\n uniqueModels[cacheKey] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n console.debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n jsonPromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n console.debug(\"loadAndMerge \" + cacheKey);\r\n\r\n\r\n if (mergedModelCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n mergedModelCache[cacheKey] = event.data.mergedModel;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadAndMergeModel\",\r\n model: model,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadAndMergeModel\"])(model, modelRender.options.assetRoot).then((mergedModel) => {\r\n mergedModelCache[cacheKey] = mergedModel;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n return Promise.all(jsonPromises);\r\n}\r\n\r\nfunction loadModelTextures(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadAndMergeModels\");\r\n console.time(\"loadModelTextures\");\r\n\r\n let texturePromises = [];\r\n\r\n console.log(\"Loading Textures...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n uniqueModels[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i])] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n console.debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n texturePromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n console.debug(\"loadTexture \" + cacheKey);\r\n let mergedModel = mergedModelCache[cacheKey];\r\n\r\n if (loadedTextureCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel) {\r\n console.warn(\"Missing merged model\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel.textures) {\r\n console.warn(\"The model doesn't have any textures!\");\r\n console.warn(\"Please make sure you're using the proper file.\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n loadedTextureCache[cacheKey] = event.data.textures;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadTextures\",\r\n textures: mergedModel.textures,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadTextures\"])(mergedModel.textures, modelRender.options.assetRoot).then((textures) => {\r\n loadedTextureCache[cacheKey] = textures;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n\r\n return Promise.all(texturePromises);\r\n}\r\n\r\nfunction doModelRender(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadModelTextures\");\r\n console.time(\"doModelRender\");\r\n\r\n console.log(\"Rendering Models...\");\r\n\r\n let renderPromises = [];\r\n\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n renderPromises.push(new Promise(resolve => {\r\n let model = parsedModelList[i];\r\n\r\n let mergedModel = mergedModelCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n let textures = loadedTextureCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n\r\n let offset = model.offset || [0, 0, 0];\r\n let rotation = model.rotation || [0, 0, 0];\r\n let scale = model.scale || [1, 1, 1];\r\n\r\n if (model.options.hasOwnProperty(\"display\")) {\r\n if (mergedModel.hasOwnProperty(\"display\")) {\r\n if (mergedModel.display.hasOwnProperty(model.options.display)) {\r\n let displayData = mergedModel.display[model.options.display];\r\n\r\n if (displayData.hasOwnProperty(\"translation\")) {\r\n offset = [offset[0] + displayData.translation[0], offset[1] + displayData.translation[1], offset[2] + displayData.translation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"rotation\")) {\r\n rotation = [rotation[0] + displayData.rotation[0], rotation[1] + displayData.rotation[1], rotation[2] + displayData.rotation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"scale\")) {\r\n scale = [displayData.scale[0], displayData.scale[1], displayData.scale[2]];\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n\r\n renderModel(modelRender, mergedModel, textures, mergedModel.textures, model.type, model.name, model.variant, offset, rotation, scale).then((renderedModel) => {\r\n\r\n if (renderedModel.firstInstance) {\r\n let container = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\r\n container.add(renderedModel.mesh);\r\n\r\n modelRender.models.push(container);\r\n modelRender.addToScene(container);\r\n }\r\n\r\n resolve(renderedModel);\r\n })\r\n }))\r\n }\r\n\r\n return Promise.all(renderPromises);\r\n}\r\n\r\n\r\nlet renderModel = function (modelRender, model, textures, textureNames, type, name, variant, offset, rotation, scale) {\r\n return new Promise((resolve) => {\r\n if (model.hasOwnProperty(\"elements\")) {// block OR item with block parent\r\n let modelKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant});\r\n let instanceCount = modelInstances[modelKey];\r\n\r\n let applyModelTransforms = function (mesh, instanceIndex) {\r\n mesh.userData.modelType = type;\r\n mesh.userData.modelName = name;\r\n\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n let instanceInfo = {\r\n key: modelKey,\r\n index: instanceIndex,\r\n offset: offset,\r\n scale: scale,\r\n rotation: rotation\r\n };\r\n\r\n if (rotation) {\r\n mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new three__WEBPACK_IMPORTED_MODULE_0__[\"Euler\"](Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]))));\r\n }\r\n if (offset) {\r\n mesh.setPositionAt(instanceIndex, _v3o.set(offset[0], offset[1], offset[2]));\r\n modelRender.instancePositionMap[offset[0] + \"_\" + offset[1] + \"_\" + offset[2]] = instanceInfo;\r\n }\r\n if (scale) {\r\n mesh.setScaleAt(instanceIndex, _v3s.set(scale[0], scale[1], scale[2]));\r\n }\r\n\r\n mesh.needsUpdate();\r\n\r\n // mesh.position = _v3o;\r\n // Object.defineProperty(mesh.position,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(x, this.y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, this.y, z));\r\n // }\r\n // })\r\n //\r\n // mesh.rotation = new THREE.Euler(toRadians(rotation[0]), toRadians(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), toRadians(rotation[2]));\r\n // Object.defineProperty(mesh.rotation,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(x), toRadians(this.y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(this.y), toRadians(z))));\r\n // }\r\n // });\r\n //\r\n // mesh.scale = _v3s;\r\n\r\n resolve({\r\n mesh: mesh,\r\n firstInstance: instanceIndex === 0\r\n });\r\n };\r\n\r\n let finalizeCubeModel = function (geometry, materials) {\r\n geometry.translate(-8, -8, -8);\r\n\r\n\r\n let cachedInstance;\r\n\r\n if (!instanceCache.hasOwnProperty(modelKey)) {\r\n console.debug(\"Caching new model instance \" + modelKey + \" (with \" + instanceCount + \" instances)\");\r\n let newInstance = new three__WEBPACK_IMPORTED_MODULE_0__[\"InstancedMesh\"](\r\n geometry,\r\n materials,\r\n instanceCount,\r\n false,\r\n false,\r\n false);\r\n cachedInstance = {\r\n instance: newInstance,\r\n index: 0\r\n };\r\n instanceCache[modelKey] = cachedInstance;\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](1, 1, 1);\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n for (let i = 0; i < instanceCount; i++) {\r\n\r\n newInstance.setQuaternionAt(i, _q);\r\n newInstance.setPositionAt(i, _v3o);\r\n newInstance.setScaleAt(i, _v3s);\r\n\r\n }\r\n } else {\r\n console.debug(\"Using cached instance (\" + modelKey + \")\");\r\n cachedInstance = instanceCache[modelKey];\r\n\r\n }\r\n\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n };\r\n\r\n if (instanceCache.hasOwnProperty(modelKey)) {\r\n console.debug(\"Using cached model instance (\" + modelKey + \")\");\r\n let cachedInstance = instanceCache[modelKey];\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n return;\r\n }\r\n\r\n // Render the elements\r\n let promises = [];\r\n for (let i = 0; i < model.elements.length; i++) {\r\n let element = model.elements[i];\r\n\r\n // // From net.minecraft.client.renderer.block.model.BlockPart.java#47 - https://yeleha.co/2JcqSr4\r\n let fallbackFaces = {\r\n down: {\r\n uv: [element.from[0], 16 - element.to[2], element.to[0], 16 - element.from[2]],\r\n texture: \"#down\"\r\n },\r\n up: {\r\n uv: [element.from[0], element.from[2], element.to[0], element.to[2]],\r\n texture: \"#up\"\r\n },\r\n north: {\r\n uv: [16 - element.to[0], 16 - element.to[1], 16 - element.from[0], 16 - element.from[1]],\r\n texture: \"#north\"\r\n },\r\n south: {\r\n uv: [element.from[0], 16 - element.to[1], element.to[0], 16 - element.from[1]],\r\n texture: \"#south\"\r\n },\r\n west: {\r\n uv: [element.from[2], 16 - element.to[1], element.to[2], 16 - element.from[2]],\r\n texture: \"#west\"\r\n },\r\n east: {\r\n uv: [16 - element.to[2], 16 - element.to[1], 16 - element.from[2], 16 - element.from[1]],\r\n texture: \"#east\"\r\n }\r\n };\r\n\r\n promises.push(new Promise((resolve) => {\r\n let baseName = name.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" + (element.__comment ? element.__comment.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" : \"\");\r\n createCube(element.to[0] - element.from[0], element.to[1] - element.from[1], element.to[2] - element.from[2],\r\n baseName + Date.now(),\r\n element.faces, fallbackFaces, textures, textureNames, modelRender.options.assetRoot, baseName)\r\n .then((cube) => {\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation((element.to[0] - element.from[0]) / 2, (element.to[1] - element.from[1]) / 2, (element.to[2] - element.from[2]) / 2));\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(element.from[0], element.from[1], element.from[2]));\r\n\r\n if (element.rotation) {\r\n rotateAboutPoint(cube,\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.origin[0], element.rotation.origin[1], element.rotation.origin[2]),\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.axis === \"x\" ? 1 : 0, element.rotation.axis === \"y\" ? 1 : 0, element.rotation.axis === \"z\" ? 1 : 0),\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(element.rotation.angle));\r\n }\r\n\r\n resolve(cube);\r\n })\r\n }));\r\n\r\n\r\n }\r\n\r\n Promise.all(promises).then((cubes) => {\r\n let mergedCubes = Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"mergeCubeMeshes\"])(cubes, true);\r\n mergedCubes.sourceSize = cubes.length;\r\n finalizeCubeModel(mergedCubes.geometry, mergedCubes.materials, cubes.length);\r\n for (let i = 0; i < cubes.length; i++) {\r\n Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"deepDisposeMesh\"])(cubes[i], true);\r\n }\r\n })\r\n } else {// 2d item\r\n createPlane(name + \"_\" + Date.now(), textures).then((plane) => {\r\n if (offset) {\r\n plane.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(offset[0], offset[1], offset[2]))\r\n }\r\n if (rotation) {\r\n plane.rotation.set(Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]));\r\n }\r\n if (scale) {\r\n plane.scale.set(scale[0], scale[1], scale[2]);\r\n }\r\n\r\n resolve({\r\n mesh: plane,\r\n firstInstance: true\r\n });\r\n })\r\n }\r\n })\r\n};\r\n\r\nfunction setVisibilityOfInstance(meshKey, visibleScale, instanceIndex, visible) {\r\n let instance = instanceCache[meshKey];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n let newScale;\r\n if (visible) {\r\n if (visibleScale) {\r\n newScale = visibleScale;\r\n } else {\r\n newScale = [1, 1, 1];\r\n }\r\n } else {\r\n newScale = [0, 0, 0];\r\n }\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n mesh.setScaleAt(instanceIndex, _v3s.set(newScale[0], newScale[1], newScale[2]));\r\n return mesh;\r\n }\r\n}\r\n\r\nfunction setVisibilityAtMulti(positions, visible) {\r\n let updatedMeshes = {};\r\n for (let pos of positions) {\r\n let info = this.instancePositionMap[pos[0] + \"_\" + pos[1] + \"_\" + pos[2]];\r\n if (info) {\r\n let mesh = setVisibilityOfInstance(info.key, info.scale, info.index, visible);\r\n if (mesh) {\r\n updatedMeshes[info.key] = mesh;\r\n }\r\n }\r\n }\r\n for (let mesh of Object.values(updatedMeshes)) {\r\n mesh.needsUpdate();\r\n }\r\n}\r\n\r\nfunction setVisibilityAt(x, y, z, visible) {\r\n setVisibilityAtMulti([[x, y, z]], visible);\r\n}\r\n\r\nModelRender.prototype.setVisibilityAtMulti = setVisibilityAtMulti;\r\nModelRender.prototype.setVisibilityAt = setVisibilityAt;\r\n\r\nfunction setVisibilityOfType(type, name, variant, visible) {\r\n let instance = instanceCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant})];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n mesh.visible = visible;\r\n }\r\n}\r\n\r\nModelRender.prototype.setVisibilityOfType = setVisibilityOfType;\r\n\r\nlet createDot = function (c) {\r\n let dotGeometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"Geometry\"]();\r\n dotGeometry.vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]());\r\n let dotMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"PointsMaterial\"]({size: 5, sizeAttenuation: false, color: c});\r\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Points\"](dotGeometry, dotMaterial);\r\n};\r\n\r\nlet createPlane = function (name, textures) {\r\n return new Promise((resolve) => {\r\n\r\n let materialLoaded = function (material, width, height) {\r\n let geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"PlaneGeometry\"](width, height);\r\n let plane = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, material);\r\n plane.name = name;\r\n plane.receiveShadow = true;\r\n\r\n resolve(plane);\r\n };\r\n\r\n if (textures) {\r\n let w = 0, h = 0;\r\n let promises = [];\r\n for (let t in textures) {\r\n if (textures.hasOwnProperty(t)) {\r\n promises.push(new Promise((resolve) => {\r\n let img = new Image();\r\n img.onload = function () {\r\n if (img.width > w) w = img.width;\r\n if (img.height > h) h = img.height;\r\n resolve(img);\r\n };\r\n img.src = textures[t];\r\n }))\r\n }\r\n }\r\n Promise.all(promises).then((images) => {\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = w;\r\n canvas.height = h;\r\n let context = canvas.getContext(\"2d\");\r\n\r\n for (let i = 0; i < images.length; i++) {\r\n let img = images[i];\r\n context.drawImage(img, 0, 0);\r\n }\r\n\r\n let data = canvas.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \")\");\r\n materialLoaded(materialCache[hash], w, h);\r\n return;\r\n }\r\n\r\n let textureLoaded = function (texture) {\r\n let material = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: texture,\r\n transparent: true,\r\n side: three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"],\r\n alphaTest: 0.5,\r\n name: name\r\n });\r\n\r\n // Add material to cache\r\n console.debug(\"Caching Material \" + hash);\r\n materialCache[hash] = material;\r\n\r\n materialLoaded(material, w, h);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n console.debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n });\r\n }\r\n\r\n })\r\n};\r\n\r\n\r\n/// From https://github.com/InventivetalentDev/SkinRender/blob/master/js/render/skin.js#L353\r\nlet createCube = function (width, height, depth, name, faces, fallbackFaces, textures, textureNames, assetRoot, baseName) {\r\n return new Promise((resolve) => {\r\n let geometryKey = width + \"_\" + height + \"_\" + depth;\r\n let geometry;\r\n if (geometryCache.hasOwnProperty(geometryKey)) {\r\n console.debug(\"Using cached Geometry (\" + geometryKey + \")\");\r\n geometry = geometryCache[geometryKey];\r\n } else {\r\n geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BoxGeometry\"](width, height, depth);\r\n console.debug(\"Caching Geometry \" + geometryKey);\r\n geometryCache[geometryKey] = geometry;\r\n }\r\n\r\n let materialsLoaded = function (materials) {\r\n let cube = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, materials);\r\n cube.name = name;\r\n cube.receiveShadow = true;\r\n\r\n resolve(cube);\r\n };\r\n if (textures) {\r\n let promises = [];\r\n for (let i = 0; i < 6; i++) {\r\n promises.push(new Promise((resolve) => {\r\n let f = FACE_ORDER[i];\r\n if (!faces.hasOwnProperty(f)) {\r\n // console.warn(\"Missing face: \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n let face = faces[f];\r\n let textureRef = face.texture.substr(1);\r\n if (!textures.hasOwnProperty(textureRef) || !textures[textureRef]) {\r\n console.warn(\"Missing texture '\" + textureRef + \"' for face \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let canvasKey = textureRef + \"_\" + f + \"_\" + baseName;\r\n\r\n let processImgToCanvasData = (img) => {\r\n let uv = face.uv;\r\n if (!uv) {\r\n // console.warn(\"Missing UV mapping for face \" + f + \" in model \" + name + \". Using defaults\");\r\n uv = fallbackFaces[f].uv;\r\n }\r\n\r\n // Scale the uv values to match the image width, so we can support resource packs with higher-resolution textures\r\n uv = [\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[0], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[1], img.height),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[2], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[3], img.height)\r\n ];\r\n\r\n\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = Math.abs(uv[2] - uv[0]);\r\n canvas.height = Math.abs(uv[3] - uv[1]);\r\n\r\n let context = canvas.getContext(\"2d\");\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n let tintColor;\r\n if (face.hasOwnProperty(\"tintindex\")) {\r\n tintColor = TINTS[face.tintindex];\r\n } else if (baseName.startsWith(\"water_\")) {\r\n tintColor = \"blue\";\r\n }\r\n\r\n if (tintColor) {\r\n context.fillStyle = tintColor;\r\n context.globalCompositeOperation = 'multiply';\r\n context.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n context.globalAlpha = 1;\r\n context.globalCompositeOperation = 'destination-in';\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n // context.globalAlpha = 0.5;\r\n // context.beginPath();\r\n // context.fillStyle = \"green\";\r\n // context.rect(0, 0, uv[2] - uv[0], uv[3] - uv[1]);\r\n // context.fill();\r\n // context.globalAlpha = 1.0;\r\n }\r\n\r\n let canvasData = context.getImageData(0, 0, canvas.width, canvas.height).data;\r\n let hasTransparency = false;\r\n for (let i = 3; i < (canvas.width * canvas.height); i += 4) {\r\n if (canvasData[i] < 255) {\r\n hasTransparency = true;\r\n break;\r\n }\r\n }\r\n\r\n let dataUrl = canvas.toDataURL(\"image/png\");\r\n let dataHash = md5__WEBPACK_IMPORTED_MODULE_6__(dataUrl);\r\n\r\n let d = {\r\n canvas: canvas,\r\n data: canvasData,\r\n dataUrl: dataUrl,\r\n dataUrlHash: dataHash,\r\n hasTransparency: hasTransparency,\r\n width: canvas.width,\r\n height: canvas.height\r\n };\r\n console.debug(\"Caching new canvas (\" + canvasKey + \"/\" + dataHash + \")\")\r\n canvasCache[canvasKey] = d;\r\n return d;\r\n };\r\n\r\n let loadTextureFromCanvas = (canvas) => {\r\n\r\n\r\n let loadTextureDefault = function (canvas) {\r\n let data = canvas.dataUrl;\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \", without meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n let n = textureNames[textureRef];\r\n if (n.startsWith(\"#\")) {\r\n n = textureNames[name.substr(1)];\r\n }\r\n console.debug(\"Pre-Caching Material \" + hash + \", without meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5,\r\n name: f + \"_\" + textureRef + \"_\" + n\r\n });\r\n\r\n let textureLoaded = function (texture) {\r\n // Add material to cache\r\n console.debug(\"Finalizing Cached Material \" + hash + \", without meta\");\r\n materialCache[hash].map = texture;\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture from cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n if (face.hasOwnProperty(\"rotation\")) {\r\n texture.center.x = .5;\r\n texture.center.y = .5;\r\n texture.rotation = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(face.rotation);\r\n }\r\n\r\n console.debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n };\r\n\r\n let loadTextureWithMeta = function (canvas, meta) {\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \", with meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Material \" + hash + \", with meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5\r\n });\r\n\r\n let frametime = 1;\r\n if (meta.hasOwnProperty(\"animation\")) {\r\n if (meta.animation.hasOwnProperty(\"frametime\")) {\r\n frametime = meta.animation.frametime;\r\n }\r\n }\r\n\r\n let parts = Math.floor(canvas.height / canvas.width);\r\n\r\n console.log(\"Generating animated texture...\");\r\n\r\n let promises1 = [];\r\n for (let i = 0; i < parts; i++) {\r\n promises1.push(new Promise((resolve) => {\r\n let canvas1 = document.createElement(\"canvas\");\r\n canvas1.width = canvas.width;\r\n canvas1.height = canvas.width;\r\n let context1 = canvas1.getContext(\"2d\");\r\n context1.drawImage(canvas.canvas, 0, i * canvas.width, canvas.width, canvas.width, 0, 0, canvas.width, canvas.width);\r\n\r\n let data = canvas1.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n resolve(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n console.debug(\"Caching Texture \" + hash + \", without meta\");\r\n // add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n resolve(texture);\r\n });\r\n }));\r\n }\r\n\r\n Promise.all(promises1).then((textures) => {\r\n\r\n let frameCounter = 0;\r\n let textureIndex = 0;\r\n animatedTextures.push(() => {// called on render\r\n if (frameCounter >= frametime) {\r\n frameCounter = 0;\r\n\r\n // Set new texture\r\n materialCache[hash].map = textures[textureIndex];\r\n\r\n textureIndex++;\r\n }\r\n if (textureIndex >= textures.length) {\r\n textureIndex = 0;\r\n }\r\n frameCounter += 0.1;// game ticks TODO: figure out the proper value for this\r\n })\r\n\r\n // Add material to cache\r\n console.debug(\"Finalizing Cached Material \" + hash + \", with meta\");\r\n materialCache[hash].map = textures[0];\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n });\r\n };\r\n\r\n if ((canvas.height > canvas.width) && (canvas.height % canvas.width === 0)) {// Taking a guess that this is an animated texture\r\n let name = textureNames[textureRef];\r\n if (name.startsWith(\"#\")) {\r\n name = textureNames[name.substr(1)];\r\n }\r\n if (name.indexOf(\"/\") !== -1) {\r\n name = name.substr(name.indexOf(\"/\") + 1);\r\n }\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"loadTextureMeta\"])(name, assetRoot).then((meta) => {\r\n loadTextureWithMeta(canvas, meta);\r\n }).catch(() => {// Guessed wrong :shrug:\r\n loadTextureDefault(canvas);\r\n })\r\n } else {\r\n loadTextureDefault(canvas);\r\n }\r\n };\r\n\r\n\r\n if (canvasCache.hasOwnProperty(canvasKey)) {\r\n let cachedCanvas = canvasCache[canvasKey];\r\n\r\n if (cachedCanvas.hasOwnProperty(\"img\")) {\r\n console.debug(\"Waiting for canvas image that's already loading (\" + canvasKey + \")\")\r\n let img = cachedCanvas.img;\r\n img.waitingForCanvas.push(function (canvas) {\r\n loadTextureFromCanvas(canvas);\r\n });\r\n } else {\r\n console.debug(\"Using cached canvas (\" + canvasKey + \")\")\r\n loadTextureFromCanvas(canvasCache[canvasKey]);\r\n }\r\n } else {\r\n let img = new Image();\r\n img.onerror = function (err) {\r\n console.warn(err);\r\n resolve(null);\r\n };\r\n img.waitingForCanvas = [];\r\n img.onload = function () {\r\n let canvasData = processImgToCanvasData(img);\r\n loadTextureFromCanvas(canvasData);\r\n\r\n for (let c = 0; c < img.waitingForCanvas.length; c++) {\r\n img.waitingForCanvas[c](canvasData);\r\n }\r\n };\r\n console.debug(\"Pre-caching canvas (\" + canvasKey + \")\");\r\n canvasCache[canvasKey] = {\r\n img: img\r\n };\r\n img.src = textures[textureRef];\r\n }\r\n }));\r\n }\r\n Promise.all(promises).then(materials => materialsLoaded(materials))\r\n } else {\r\n let materials = [];\r\n for (let i = 0; i < 6; i++) {\r\n materials.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n color: colors[i + 2],\r\n wireframe: true\r\n }))\r\n }\r\n materialsLoaded(materials);\r\n }\r\n\r\n // if (textures) {\r\n // applyCubeTextureToGeometry(geometry, texture, uv, width, height, depth);\r\n // }\r\n\r\n\r\n })\r\n};\r\n\r\n/// https://stackoverflow.com/questions/42812861/three-js-pivot-point/42866733#42866733\r\n// obj - your object (THREE.Object3D or derived)\r\n// point - the point of rotation (THREE.Vector3)\r\n// axis - the axis of rotation (normalized THREE.Vector3)\r\n// theta - radian value of rotation\r\nfunction rotateAboutPoint(obj, point, axis, theta) {\r\n obj.position.sub(point); // remove the offset\r\n obj.position.applyAxisAngle(axis, theta); // rotate the POSITION\r\n obj.position.add(point); // re-add the offset\r\n\r\n obj.rotateOnAxis(axis, theta); // rotate the OBJECT\r\n}\r\n\r\nModelRender.cache = {\r\n loadedTextures: loadedTextureCache,\r\n mergedModels: mergedModelCache,\r\n instanceCount: modelInstances,\r\n\r\n texture: textureCache,\r\n canvas: canvasCache,\r\n material: materialCache,\r\n geometry: geometryCache,\r\n instances: instanceCache,\r\n\r\n animated: animatedTextures,\r\n\r\n\r\n resetInstances: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n },\r\n clearAll: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(loadedTextureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(mergedModelCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(textureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(canvasCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(materialCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(geometryCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n animatedTextures.splice(0, animatedTextures.length);\r\n }\r\n};\r\nModelRender.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n\r\nif (typeof window !== \"undefined\") {\r\n window.ModelRender = ModelRender;\r\n window.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n}\r\nif (typeof global !== \"undefined\")\r\n global.ModelRender = ModelRender;\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (ModelRender);\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./src/model/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _renderBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../renderBase */ \"./src/renderBase.js\");\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var _modelConverter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modelConverter */ \"./src/model/modelConverter.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! md5 */ \"./node_modules/md5/md5.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! webworkify-webpack */ \"./node_modules/webworkify-webpack/index.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _skin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../skin */ \"./src/skin/index.js\");\n/* harmony import */ var onscreen_lib_methods_off__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! onscreen/lib/methods/off */ \"./node_modules/onscreen/lib/methods/off.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_11__);\n\r\n\r\n__webpack_require__(/*! three-instanced-mesh */ \"./node_modules/three-instanced-mesh/index.js\")(three__WEBPACK_IMPORTED_MODULE_0__);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_11__(\"minerender\");\r\n\r\nconst ModelWorker = /*require.resolve*/(/*! ./ModelWorker.js */ \"./src/model/ModelWorker.js\");\r\n\r\n\r\nString.prototype.replaceAll = function (search, replacement) {\r\n let target = this;\r\n return target.replace(new RegExp(search, 'g'), replacement);\r\n};\r\n\r\nconst colors = [\r\n 0xFF0000,\r\n 0x00FFFF,\r\n 0x0000FF,\r\n 0x000080,\r\n 0xFF00FF,\r\n 0x800080,\r\n 0x808000,\r\n 0x00FF00,\r\n 0x008000,\r\n 0xFFFF00,\r\n 0x800000,\r\n 0x008080,\r\n];\r\n\r\nconst FACE_ORDER = [\"east\", \"west\", \"up\", \"down\", \"south\", \"north\"];\r\nconst TINTS = [\"lightgreen\"];\r\n\r\nconst mergedModelCache = {};\r\nconst loadedTextureCache = {};\r\nconst modelInstances = {};\r\n\r\nconst textureCache = {};\r\nconst canvasCache = {};\r\nconst materialCache = {};\r\nconst geometryCache = {};\r\nconst instanceCache = {};\r\n\r\nconst animatedTextures = [];\r\n\r\n/**\r\n * @see defaultOptions\r\n * @property {string} type alternative way to specify the model type (block/item)\r\n * @property {boolean} [centerCubes=false] center the cube's rotation point\r\n * @property {string} [assetRoot=DEFAULT_ROOT] root to get asset files from\r\n */\r\nlet defOptions = {\r\n camera: {\r\n type: \"perspective\",\r\n x: 35,\r\n y: 25,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n type: \"block\",\r\n centerCubes: false,\r\n assetRoot: _functions__WEBPACK_IMPORTED_MODULE_4__[\"DEFAULT_ROOT\"],\r\n useWebWorkers: false\r\n};\r\n\r\n/**\r\n * A renderer for Minecraft models, i.e. blocks & items\r\n */\r\nclass ModelRender extends _renderBase__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\r\n\r\n /**\r\n * @param {Object} [options] The options for this renderer, see {@link defaultOptions}\r\n * @param {string} [options.assetRoot=DEFAULT_ROOT] root to get asset files from\r\n *\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, element) {\r\n super(options, defOptions, element);\r\n\r\n this.renderType = \"ModelRender\";\r\n\r\n this.models = [];\r\n this.instancePositionMap = {};\r\n this.attached = false;\r\n }\r\n\r\n /**\r\n * Does the actual rendering\r\n * @param {(string[]|Object[])} models Array of models to render - Either strings in the format / or objects\r\n * @param {string} [models[].type=block] either 'block' or 'item'\r\n * @param {string} models[].model if 'type' is given, just the block/item name otherwise '/'\r\n * @param {number[]} [models[].offset] [x,y,z] array of the offset\r\n * @param {number[]} [models[].rotation] [x,y,z] array of the rotation\r\n * @param {string} [models[].blockstate] name of a blockstate to be used to determine the models (only for blocks)\r\n * @param {string} [models[].variant=normal] if 'blockstate' is given, the block variant to use\r\n * @param {function} [cb] Callback when rendering finished\r\n */\r\n render(models, cb) {\r\n let modelRender = this;\r\n\r\n if (!modelRender.attached && !modelRender._scene) {// Don't init scene if attached, since we already have an available scene\r\n super.initScene(function () {\r\n // Animate textures\r\n for (let i = 0; i < animatedTextures.length; i++) {\r\n animatedTextures[i]();\r\n }\r\n\r\n modelRender.element.dispatchEvent(new CustomEvent(\"modelRender\", {detail: {models: modelRender.models}}));\r\n });\r\n } else {\r\n console.log(\"[ModelRender] is attached - skipping scene init\");\r\n }\r\n\r\n let parsedModelList = [];\r\n\r\n parseModels(modelRender, models, parsedModelList)\r\n .then(() => loadAndMergeModels(modelRender, parsedModelList))\r\n .then(() => loadModelTextures(modelRender, parsedModelList))\r\n .then(() => doModelRender(modelRender, parsedModelList))\r\n .then((renderedModels) => {\r\n console.timeEnd(\"doModelRender\");\r\n debug(renderedModels)\r\n if (typeof cb === \"function\") cb();\r\n })\r\n\r\n }\r\n\r\n}\r\n\r\n\r\nfunction parseModels(modelRender, models, parsedModelList) {\r\n console.time(\"parseModels\");\r\n console.log(\"Parsing Models...\");\r\n let parsePromises = [];\r\n for (let i = 0; i < models.length; i++) {\r\n let model = models[i];\r\n\r\n // parsePromises.push(parseModel(model, model, parsedModelList, modelRender.options.assetRoot))\r\n parsePromises.push(new Promise(resolve => {\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n parsedModelList.push(...event.data.parsedModelList);\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"parseModel\",\r\n model: model,\r\n modelOptions: model,\r\n parsedModelList: parsedModelList,\r\n assetRoot: modelRender.options.assetRoot\r\n })\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"parseModel\"])(model, model, parsedModelList, modelRender.options.assetRoot).then(() => {\r\n resolve();\r\n })\r\n }\r\n }))\r\n\r\n }\r\n\r\n return Promise.all(parsePromises);\r\n}\r\n\r\n\r\nfunction loadAndMergeModels(modelRender, parsedModelList) {\r\n console.timeEnd(\"parseModels\");\r\n console.time(\"loadAndMergeModels\");\r\n\r\n let jsonPromises = [];\r\n\r\n console.log(\"Loading Model JSON data & merging...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i]);\r\n modelInstances[cacheKey] = (modelInstances[cacheKey] || 0) + 1;\r\n uniqueModels[cacheKey] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n jsonPromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n debug(\"loadAndMerge \" + cacheKey);\r\n\r\n\r\n if (mergedModelCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n mergedModelCache[cacheKey] = event.data.mergedModel;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadAndMergeModel\",\r\n model: model,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadAndMergeModel\"])(model, modelRender.options.assetRoot).then((mergedModel) => {\r\n mergedModelCache[cacheKey] = mergedModel;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n return Promise.all(jsonPromises);\r\n}\r\n\r\nfunction loadModelTextures(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadAndMergeModels\");\r\n console.time(\"loadModelTextures\");\r\n\r\n let texturePromises = [];\r\n\r\n console.log(\"Loading Textures...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n uniqueModels[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i])] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n texturePromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n debug(\"loadTexture \" + cacheKey);\r\n let mergedModel = mergedModelCache[cacheKey];\r\n\r\n if (loadedTextureCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel) {\r\n console.warn(\"Missing merged model\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel.textures) {\r\n console.warn(\"The model doesn't have any textures!\");\r\n console.warn(\"Please make sure you're using the proper file.\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n loadedTextureCache[cacheKey] = event.data.textures;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadTextures\",\r\n textures: mergedModel.textures,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadTextures\"])(mergedModel.textures, modelRender.options.assetRoot).then((textures) => {\r\n loadedTextureCache[cacheKey] = textures;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n\r\n return Promise.all(texturePromises);\r\n}\r\n\r\nfunction doModelRender(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadModelTextures\");\r\n console.time(\"doModelRender\");\r\n\r\n console.log(\"Rendering Models...\");\r\n\r\n let renderPromises = [];\r\n\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n renderPromises.push(new Promise(resolve => {\r\n let model = parsedModelList[i];\r\n\r\n let mergedModel = mergedModelCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n let textures = loadedTextureCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n\r\n let offset = model.offset || [0, 0, 0];\r\n let rotation = model.rotation || [0, 0, 0];\r\n let scale = model.scale || [1, 1, 1];\r\n\r\n if (model.options.hasOwnProperty(\"display\")) {\r\n if (mergedModel.hasOwnProperty(\"display\")) {\r\n if (mergedModel.display.hasOwnProperty(model.options.display)) {\r\n let displayData = mergedModel.display[model.options.display];\r\n\r\n if (displayData.hasOwnProperty(\"translation\")) {\r\n offset = [offset[0] + displayData.translation[0], offset[1] + displayData.translation[1], offset[2] + displayData.translation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"rotation\")) {\r\n rotation = [rotation[0] + displayData.rotation[0], rotation[1] + displayData.rotation[1], rotation[2] + displayData.rotation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"scale\")) {\r\n scale = [displayData.scale[0], displayData.scale[1], displayData.scale[2]];\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n\r\n renderModel(modelRender, mergedModel, textures, mergedModel.textures, model.type, model.name, model.variant, offset, rotation, scale).then((renderedModel) => {\r\n\r\n if (renderedModel.firstInstance) {\r\n let container = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\r\n container.add(renderedModel.mesh);\r\n\r\n modelRender.models.push(container);\r\n modelRender.addToScene(container);\r\n }\r\n\r\n resolve(renderedModel);\r\n })\r\n }))\r\n }\r\n\r\n return Promise.all(renderPromises);\r\n}\r\n\r\n\r\nlet renderModel = function (modelRender, model, textures, textureNames, type, name, variant, offset, rotation, scale) {\r\n return new Promise((resolve) => {\r\n if (model.hasOwnProperty(\"elements\")) {// block OR item with block parent\r\n let modelKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant});\r\n let instanceCount = modelInstances[modelKey];\r\n\r\n let applyModelTransforms = function (mesh, instanceIndex) {\r\n mesh.userData.modelType = type;\r\n mesh.userData.modelName = name;\r\n\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n let instanceInfo = {\r\n key: modelKey,\r\n index: instanceIndex,\r\n offset: offset,\r\n scale: scale,\r\n rotation: rotation\r\n };\r\n\r\n if (rotation) {\r\n mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new three__WEBPACK_IMPORTED_MODULE_0__[\"Euler\"](Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]))));\r\n }\r\n if (offset) {\r\n mesh.setPositionAt(instanceIndex, _v3o.set(offset[0], offset[1], offset[2]));\r\n modelRender.instancePositionMap[offset[0] + \"_\" + offset[1] + \"_\" + offset[2]] = instanceInfo;\r\n }\r\n if (scale) {\r\n mesh.setScaleAt(instanceIndex, _v3s.set(scale[0], scale[1], scale[2]));\r\n }\r\n\r\n mesh.needsUpdate();\r\n\r\n // mesh.position = _v3o;\r\n // Object.defineProperty(mesh.position,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(x, this.y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, this.y, z));\r\n // }\r\n // })\r\n //\r\n // mesh.rotation = new THREE.Euler(toRadians(rotation[0]), toRadians(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), toRadians(rotation[2]));\r\n // Object.defineProperty(mesh.rotation,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(x), toRadians(this.y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(this.y), toRadians(z))));\r\n // }\r\n // });\r\n //\r\n // mesh.scale = _v3s;\r\n\r\n resolve({\r\n mesh: mesh,\r\n firstInstance: instanceIndex === 0\r\n });\r\n };\r\n\r\n let finalizeCubeModel = function (geometry, materials) {\r\n geometry.translate(-8, -8, -8);\r\n\r\n\r\n let cachedInstance;\r\n\r\n if (!instanceCache.hasOwnProperty(modelKey)) {\r\n debug(\"Caching new model instance \" + modelKey + \" (with \" + instanceCount + \" instances)\");\r\n let newInstance = new three__WEBPACK_IMPORTED_MODULE_0__[\"InstancedMesh\"](\r\n geometry,\r\n materials,\r\n instanceCount,\r\n false,\r\n false,\r\n false);\r\n cachedInstance = {\r\n instance: newInstance,\r\n index: 0\r\n };\r\n instanceCache[modelKey] = cachedInstance;\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](1, 1, 1);\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n for (let i = 0; i < instanceCount; i++) {\r\n\r\n newInstance.setQuaternionAt(i, _q);\r\n newInstance.setPositionAt(i, _v3o);\r\n newInstance.setScaleAt(i, _v3s);\r\n\r\n }\r\n } else {\r\n debug(\"Using cached instance (\" + modelKey + \")\");\r\n cachedInstance = instanceCache[modelKey];\r\n\r\n }\r\n\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n };\r\n\r\n if (instanceCache.hasOwnProperty(modelKey)) {\r\n debug(\"Using cached model instance (\" + modelKey + \")\");\r\n let cachedInstance = instanceCache[modelKey];\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n return;\r\n }\r\n\r\n // Render the elements\r\n let promises = [];\r\n for (let i = 0; i < model.elements.length; i++) {\r\n let element = model.elements[i];\r\n\r\n // // From net.minecraft.client.renderer.block.model.BlockPart.java#47 - https://yeleha.co/2JcqSr4\r\n let fallbackFaces = {\r\n down: {\r\n uv: [element.from[0], 16 - element.to[2], element.to[0], 16 - element.from[2]],\r\n texture: \"#down\"\r\n },\r\n up: {\r\n uv: [element.from[0], element.from[2], element.to[0], element.to[2]],\r\n texture: \"#up\"\r\n },\r\n north: {\r\n uv: [16 - element.to[0], 16 - element.to[1], 16 - element.from[0], 16 - element.from[1]],\r\n texture: \"#north\"\r\n },\r\n south: {\r\n uv: [element.from[0], 16 - element.to[1], element.to[0], 16 - element.from[1]],\r\n texture: \"#south\"\r\n },\r\n west: {\r\n uv: [element.from[2], 16 - element.to[1], element.to[2], 16 - element.from[2]],\r\n texture: \"#west\"\r\n },\r\n east: {\r\n uv: [16 - element.to[2], 16 - element.to[1], 16 - element.from[2], 16 - element.from[1]],\r\n texture: \"#east\"\r\n }\r\n };\r\n\r\n promises.push(new Promise((resolve) => {\r\n let baseName = name.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" + (element.__comment ? element.__comment.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" : \"\");\r\n createCube(element.to[0] - element.from[0], element.to[1] - element.from[1], element.to[2] - element.from[2],\r\n baseName + Date.now(),\r\n element.faces, fallbackFaces, textures, textureNames, modelRender.options.assetRoot, baseName)\r\n .then((cube) => {\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation((element.to[0] - element.from[0]) / 2, (element.to[1] - element.from[1]) / 2, (element.to[2] - element.from[2]) / 2));\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(element.from[0], element.from[1], element.from[2]));\r\n\r\n if (element.rotation) {\r\n rotateAboutPoint(cube,\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.origin[0], element.rotation.origin[1], element.rotation.origin[2]),\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.axis === \"x\" ? 1 : 0, element.rotation.axis === \"y\" ? 1 : 0, element.rotation.axis === \"z\" ? 1 : 0),\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(element.rotation.angle));\r\n }\r\n\r\n resolve(cube);\r\n })\r\n }));\r\n\r\n\r\n }\r\n\r\n Promise.all(promises).then((cubes) => {\r\n let mergedCubes = Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"mergeCubeMeshes\"])(cubes, true);\r\n mergedCubes.sourceSize = cubes.length;\r\n finalizeCubeModel(mergedCubes.geometry, mergedCubes.materials, cubes.length);\r\n for (let i = 0; i < cubes.length; i++) {\r\n Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"deepDisposeMesh\"])(cubes[i], true);\r\n }\r\n })\r\n } else {// 2d item\r\n createPlane(name + \"_\" + Date.now(), textures).then((plane) => {\r\n if (offset) {\r\n plane.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(offset[0], offset[1], offset[2]))\r\n }\r\n if (rotation) {\r\n plane.rotation.set(Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]));\r\n }\r\n if (scale) {\r\n plane.scale.set(scale[0], scale[1], scale[2]);\r\n }\r\n\r\n resolve({\r\n mesh: plane,\r\n firstInstance: true\r\n });\r\n })\r\n }\r\n })\r\n};\r\n\r\nfunction setVisibilityOfInstance(meshKey, visibleScale, instanceIndex, visible) {\r\n let instance = instanceCache[meshKey];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n let newScale;\r\n if (visible) {\r\n if (visibleScale) {\r\n newScale = visibleScale;\r\n } else {\r\n newScale = [1, 1, 1];\r\n }\r\n } else {\r\n newScale = [0, 0, 0];\r\n }\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n mesh.setScaleAt(instanceIndex, _v3s.set(newScale[0], newScale[1], newScale[2]));\r\n return mesh;\r\n }\r\n}\r\n\r\nfunction setVisibilityAtMulti(positions, visible) {\r\n let updatedMeshes = {};\r\n for (let pos of positions) {\r\n let info = this.instancePositionMap[pos[0] + \"_\" + pos[1] + \"_\" + pos[2]];\r\n if (info) {\r\n let mesh = setVisibilityOfInstance(info.key, info.scale, info.index, visible);\r\n if (mesh) {\r\n updatedMeshes[info.key] = mesh;\r\n }\r\n }\r\n }\r\n for (let mesh of Object.values(updatedMeshes)) {\r\n mesh.needsUpdate();\r\n }\r\n}\r\n\r\nfunction setVisibilityAt(x, y, z, visible) {\r\n setVisibilityAtMulti([[x, y, z]], visible);\r\n}\r\n\r\nModelRender.prototype.setVisibilityAtMulti = setVisibilityAtMulti;\r\nModelRender.prototype.setVisibilityAt = setVisibilityAt;\r\n\r\nfunction setVisibilityOfType(type, name, variant, visible) {\r\n let instance = instanceCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant})];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n mesh.visible = visible;\r\n }\r\n}\r\n\r\nModelRender.prototype.setVisibilityOfType = setVisibilityOfType;\r\n\r\nlet createDot = function (c) {\r\n let dotGeometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"Geometry\"]();\r\n dotGeometry.vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]());\r\n let dotMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"PointsMaterial\"]({size: 5, sizeAttenuation: false, color: c});\r\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Points\"](dotGeometry, dotMaterial);\r\n};\r\n\r\nlet createPlane = function (name, textures) {\r\n return new Promise((resolve) => {\r\n\r\n let materialLoaded = function (material, width, height) {\r\n let geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"PlaneGeometry\"](width, height);\r\n let plane = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, material);\r\n plane.name = name;\r\n plane.receiveShadow = true;\r\n\r\n resolve(plane);\r\n };\r\n\r\n if (textures) {\r\n let w = 0, h = 0;\r\n let promises = [];\r\n for (let t in textures) {\r\n if (textures.hasOwnProperty(t)) {\r\n promises.push(new Promise((resolve) => {\r\n let img = new Image();\r\n img.onload = function () {\r\n if (img.width > w) w = img.width;\r\n if (img.height > h) h = img.height;\r\n resolve(img);\r\n };\r\n img.src = textures[t];\r\n }))\r\n }\r\n }\r\n Promise.all(promises).then((images) => {\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = w;\r\n canvas.height = h;\r\n let context = canvas.getContext(\"2d\");\r\n\r\n for (let i = 0; i < images.length; i++) {\r\n let img = images[i];\r\n context.drawImage(img, 0, 0);\r\n }\r\n\r\n let data = canvas.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \")\");\r\n materialLoaded(materialCache[hash], w, h);\r\n return;\r\n }\r\n\r\n let textureLoaded = function (texture) {\r\n let material = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: texture,\r\n transparent: true,\r\n side: three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"],\r\n alphaTest: 0.5,\r\n name: name\r\n });\r\n\r\n // Add material to cache\r\n debug(\"Caching Material \" + hash);\r\n materialCache[hash] = material;\r\n\r\n materialLoaded(material, w, h);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n });\r\n }\r\n\r\n })\r\n};\r\n\r\n\r\n/// From https://github.com/InventivetalentDev/SkinRender/blob/master/js/render/skin.js#L353\r\nlet createCube = function (width, height, depth, name, faces, fallbackFaces, textures, textureNames, assetRoot, baseName) {\r\n return new Promise((resolve) => {\r\n let geometryKey = width + \"_\" + height + \"_\" + depth;\r\n let geometry;\r\n if (geometryCache.hasOwnProperty(geometryKey)) {\r\n debug(\"Using cached Geometry (\" + geometryKey + \")\");\r\n geometry = geometryCache[geometryKey];\r\n } else {\r\n geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BoxGeometry\"](width, height, depth);\r\n debug(\"Caching Geometry \" + geometryKey);\r\n geometryCache[geometryKey] = geometry;\r\n }\r\n\r\n let materialsLoaded = function (materials) {\r\n let cube = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, materials);\r\n cube.name = name;\r\n cube.receiveShadow = true;\r\n\r\n resolve(cube);\r\n };\r\n if (textures) {\r\n let promises = [];\r\n for (let i = 0; i < 6; i++) {\r\n promises.push(new Promise((resolve) => {\r\n let f = FACE_ORDER[i];\r\n if (!faces.hasOwnProperty(f)) {\r\n // console.warn(\"Missing face: \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n let face = faces[f];\r\n let textureRef = face.texture.substr(1);\r\n if (!textures.hasOwnProperty(textureRef) || !textures[textureRef]) {\r\n console.warn(\"Missing texture '\" + textureRef + \"' for face \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let canvasKey = textureRef + \"_\" + f + \"_\" + baseName;\r\n\r\n let processImgToCanvasData = (img) => {\r\n let uv = face.uv;\r\n if (!uv) {\r\n // console.warn(\"Missing UV mapping for face \" + f + \" in model \" + name + \". Using defaults\");\r\n uv = fallbackFaces[f].uv;\r\n }\r\n\r\n // Scale the uv values to match the image width, so we can support resource packs with higher-resolution textures\r\n uv = [\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[0], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[1], img.height),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[2], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[3], img.height)\r\n ];\r\n\r\n\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = Math.abs(uv[2] - uv[0]);\r\n canvas.height = Math.abs(uv[3] - uv[1]);\r\n\r\n let context = canvas.getContext(\"2d\");\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n let tintColor;\r\n if (face.hasOwnProperty(\"tintindex\")) {\r\n tintColor = TINTS[face.tintindex];\r\n } else if (baseName.startsWith(\"water_\")) {\r\n tintColor = \"blue\";\r\n }\r\n\r\n if (tintColor) {\r\n context.fillStyle = tintColor;\r\n context.globalCompositeOperation = 'multiply';\r\n context.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n context.globalAlpha = 1;\r\n context.globalCompositeOperation = 'destination-in';\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n // context.globalAlpha = 0.5;\r\n // context.beginPath();\r\n // context.fillStyle = \"green\";\r\n // context.rect(0, 0, uv[2] - uv[0], uv[3] - uv[1]);\r\n // context.fill();\r\n // context.globalAlpha = 1.0;\r\n }\r\n\r\n let canvasData = context.getImageData(0, 0, canvas.width, canvas.height).data;\r\n let hasTransparency = false;\r\n for (let i = 3; i < (canvas.width * canvas.height); i += 4) {\r\n if (canvasData[i] < 255) {\r\n hasTransparency = true;\r\n break;\r\n }\r\n }\r\n\r\n let dataUrl = canvas.toDataURL(\"image/png\");\r\n let dataHash = md5__WEBPACK_IMPORTED_MODULE_6__(dataUrl);\r\n\r\n let d = {\r\n canvas: canvas,\r\n data: canvasData,\r\n dataUrl: dataUrl,\r\n dataUrlHash: dataHash,\r\n hasTransparency: hasTransparency,\r\n width: canvas.width,\r\n height: canvas.height\r\n };\r\n debug(\"Caching new canvas (\" + canvasKey + \"/\" + dataHash + \")\")\r\n canvasCache[canvasKey] = d;\r\n return d;\r\n };\r\n\r\n let loadTextureFromCanvas = (canvas) => {\r\n\r\n\r\n let loadTextureDefault = function (canvas) {\r\n let data = canvas.dataUrl;\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \", without meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n let n = textureNames[textureRef];\r\n if (n.startsWith(\"#\")) {\r\n n = textureNames[name.substr(1)];\r\n }\r\n debug(\"Pre-Caching Material \" + hash + \", without meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5,\r\n name: f + \"_\" + textureRef + \"_\" + n\r\n });\r\n\r\n let textureLoaded = function (texture) {\r\n // Add material to cache\r\n debug(\"Finalizing Cached Material \" + hash + \", without meta\");\r\n materialCache[hash].map = texture;\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture from cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n if (face.hasOwnProperty(\"rotation\")) {\r\n texture.center.x = .5;\r\n texture.center.y = .5;\r\n texture.rotation = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(face.rotation);\r\n }\r\n\r\n debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n };\r\n\r\n let loadTextureWithMeta = function (canvas, meta) {\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \", with meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Material \" + hash + \", with meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5\r\n });\r\n\r\n let frametime = 1;\r\n if (meta.hasOwnProperty(\"animation\")) {\r\n if (meta.animation.hasOwnProperty(\"frametime\")) {\r\n frametime = meta.animation.frametime;\r\n }\r\n }\r\n\r\n let parts = Math.floor(canvas.height / canvas.width);\r\n\r\n console.log(\"Generating animated texture...\");\r\n\r\n let promises1 = [];\r\n for (let i = 0; i < parts; i++) {\r\n promises1.push(new Promise((resolve) => {\r\n let canvas1 = document.createElement(\"canvas\");\r\n canvas1.width = canvas.width;\r\n canvas1.height = canvas.width;\r\n let context1 = canvas1.getContext(\"2d\");\r\n context1.drawImage(canvas.canvas, 0, i * canvas.width, canvas.width, canvas.width, 0, 0, canvas.width, canvas.width);\r\n\r\n let data = canvas1.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n resolve(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n debug(\"Caching Texture \" + hash + \", without meta\");\r\n // add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n resolve(texture);\r\n });\r\n }));\r\n }\r\n\r\n Promise.all(promises1).then((textures) => {\r\n\r\n let frameCounter = 0;\r\n let textureIndex = 0;\r\n animatedTextures.push(() => {// called on render\r\n if (frameCounter >= frametime) {\r\n frameCounter = 0;\r\n\r\n // Set new texture\r\n materialCache[hash].map = textures[textureIndex];\r\n\r\n textureIndex++;\r\n }\r\n if (textureIndex >= textures.length) {\r\n textureIndex = 0;\r\n }\r\n frameCounter += 0.1;// game ticks TODO: figure out the proper value for this\r\n })\r\n\r\n // Add material to cache\r\n debug(\"Finalizing Cached Material \" + hash + \", with meta\");\r\n materialCache[hash].map = textures[0];\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n });\r\n };\r\n\r\n if ((canvas.height > canvas.width) && (canvas.height % canvas.width === 0)) {// Taking a guess that this is an animated texture\r\n let name = textureNames[textureRef];\r\n if (name.startsWith(\"#\")) {\r\n name = textureNames[name.substr(1)];\r\n }\r\n if (name.indexOf(\"/\") !== -1) {\r\n name = name.substr(name.indexOf(\"/\") + 1);\r\n }\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"loadTextureMeta\"])(name, assetRoot).then((meta) => {\r\n loadTextureWithMeta(canvas, meta);\r\n }).catch(() => {// Guessed wrong :shrug:\r\n loadTextureDefault(canvas);\r\n })\r\n } else {\r\n loadTextureDefault(canvas);\r\n }\r\n };\r\n\r\n\r\n if (canvasCache.hasOwnProperty(canvasKey)) {\r\n let cachedCanvas = canvasCache[canvasKey];\r\n\r\n if (cachedCanvas.hasOwnProperty(\"img\")) {\r\n debug(\"Waiting for canvas image that's already loading (\" + canvasKey + \")\")\r\n let img = cachedCanvas.img;\r\n img.waitingForCanvas.push(function (canvas) {\r\n loadTextureFromCanvas(canvas);\r\n });\r\n } else {\r\n debug(\"Using cached canvas (\" + canvasKey + \")\")\r\n loadTextureFromCanvas(canvasCache[canvasKey]);\r\n }\r\n } else {\r\n let img = new Image();\r\n img.onerror = function (err) {\r\n console.warn(err);\r\n resolve(null);\r\n };\r\n img.waitingForCanvas = [];\r\n img.onload = function () {\r\n let canvasData = processImgToCanvasData(img);\r\n loadTextureFromCanvas(canvasData);\r\n\r\n for (let c = 0; c < img.waitingForCanvas.length; c++) {\r\n img.waitingForCanvas[c](canvasData);\r\n }\r\n };\r\n debug(\"Pre-caching canvas (\" + canvasKey + \")\");\r\n canvasCache[canvasKey] = {\r\n img: img\r\n };\r\n img.src = textures[textureRef];\r\n }\r\n }));\r\n }\r\n Promise.all(promises).then(materials => materialsLoaded(materials))\r\n } else {\r\n let materials = [];\r\n for (let i = 0; i < 6; i++) {\r\n materials.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n color: colors[i + 2],\r\n wireframe: true\r\n }))\r\n }\r\n materialsLoaded(materials);\r\n }\r\n\r\n // if (textures) {\r\n // applyCubeTextureToGeometry(geometry, texture, uv, width, height, depth);\r\n // }\r\n\r\n\r\n })\r\n};\r\n\r\n/// https://stackoverflow.com/questions/42812861/three-js-pivot-point/42866733#42866733\r\n// obj - your object (THREE.Object3D or derived)\r\n// point - the point of rotation (THREE.Vector3)\r\n// axis - the axis of rotation (normalized THREE.Vector3)\r\n// theta - radian value of rotation\r\nfunction rotateAboutPoint(obj, point, axis, theta) {\r\n obj.position.sub(point); // remove the offset\r\n obj.position.applyAxisAngle(axis, theta); // rotate the POSITION\r\n obj.position.add(point); // re-add the offset\r\n\r\n obj.rotateOnAxis(axis, theta); // rotate the OBJECT\r\n}\r\n\r\nModelRender.cache = {\r\n loadedTextures: loadedTextureCache,\r\n mergedModels: mergedModelCache,\r\n instanceCount: modelInstances,\r\n\r\n texture: textureCache,\r\n canvas: canvasCache,\r\n material: materialCache,\r\n geometry: geometryCache,\r\n instances: instanceCache,\r\n\r\n animated: animatedTextures,\r\n\r\n\r\n resetInstances: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n },\r\n clearAll: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(loadedTextureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(mergedModelCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(textureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(canvasCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(materialCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(geometryCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n animatedTextures.splice(0, animatedTextures.length);\r\n }\r\n};\r\nModelRender.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n\r\nif (typeof window !== \"undefined\") {\r\n window.ModelRender = ModelRender;\r\n window.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n}\r\nif (typeof global !== \"undefined\")\r\n global.ModelRender = ModelRender;\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (ModelRender);\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./src/model/index.js?"); /***/ }), @@ -2157,7 +2190,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var pako /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModel\", function() { return parseModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadAndMergeModel\", function() { return loadAndMergeModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modelCacheKey\", function() { return modelCacheKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findMatchingVariant\", function() { return findMatchingVariant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"variantStringToObject\", function() { return variantStringToObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModelType\", function() { return parseModelType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadModel\", function() { return loadModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextures\", function() { return loadTextures; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeParents\", function() { return mergeParents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadians\", function() { return toRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deleteObjectProperties\", function() { return deleteObjectProperties; });\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\n\r\nfunction parseModel(model, modelOptions, parsedModelList, assetRoot) {\r\n return new Promise(resolve => {\r\n let type = \"block\";\r\n let offset;\r\n let rotation;\r\n let scale;\r\n\r\n if (typeof model === \"string\") {\r\n let parsed = parseModelType(model);\r\n model = parsed.model;\r\n type = parsed.type;\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (typeof model === \"object\") {\r\n if (model.hasOwnProperty(\"offset\")) {\r\n offset = model[\"offset\"];\r\n }\r\n if (model.hasOwnProperty(\"rotation\")) {\r\n rotation = model[\"rotation\"];\r\n }\r\n if (model.hasOwnProperty(\"scale\")) {\r\n scale = model[\"scale\"];\r\n }\r\n\r\n if (model.hasOwnProperty(\"model\")) {\r\n if (model.hasOwnProperty(\"type\")) {\r\n type = model[\"type\"];\r\n model = model[\"model\"];\r\n } else {\r\n let parsed = parseModelType(model[\"model\"]);\r\n model = parsed.model;\r\n type = parsed.type;\r\n }\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (model.hasOwnProperty(\"blockstate\")) {\r\n type = \"block\";\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadBlockState\"])(model.blockstate, assetRoot).then((blockstate) => {\r\n if (blockstate.hasOwnProperty(\"variants\")) {\r\n\r\n if (model.hasOwnProperty(\"variant\")) {\r\n let variantKey = findMatchingVariant(blockstate.variants, model.variant);\r\n if (variantKey === null) {\r\n console.warn(\"Missing variant key for \" + model.blockstate + \": \" + model.variant);\r\n console.warn(blockstate.variants);\r\n resolve(null);\r\n return;\r\n }\r\n let variant = blockstate.variants[variantKey];\r\n if (!variant) {\r\n console.warn(\"Missing variant for \" + model.blockstate + \": \" + model.variant);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else {\r\n let variant;\r\n if (blockstate.variants.hasOwnProperty(\"normal\")) {\r\n variant = blockstate.variants.normal;\r\n } else if (blockstate.variants.hasOwnProperty(\"\")) {\r\n variant = blockstate.variants[\"\"];\r\n } else {\r\n variant = blockstate.variants[Object.keys(blockstate.variants)[0]]\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n resolve(parsedModelList);\r\n }\r\n } else if (blockstate.hasOwnProperty(\"multipart\")) {\r\n for (let j = 0; j < blockstate.multipart.length; j++) {\r\n let cond = blockstate.multipart[j];\r\n let apply = cond.apply;\r\n let when = cond.when;\r\n\r\n rotation = [0, 0, 0];\r\n\r\n if (!when) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n } else if (model.hasOwnProperty(\"multipart\")) {\r\n let multipartConditions = model.multipart;\r\n\r\n let applies = false;\r\n if (when.hasOwnProperty(\"OR\")) {\r\n for (let k = 0; k < when.OR.length; k++) {\r\n if (applies) break;\r\n for (let c in when.OR[k]) {\r\n if (applies) break;\r\n if (when.OR[k].hasOwnProperty(c)) {\r\n let expected = when.OR[k][c];\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n for (let c in when) {// this SHOULD be a single case, but iterating makes it a bit easier\r\n if (applies) break;\r\n if (when.hasOwnProperty(c)) {\r\n let expected = String(when[c]);\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (applies) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n }\r\n }\r\n }\r\n\r\n resolve(parsedModelList);\r\n }\r\n }).catch(()=>{\r\n resolve(parsedModelList);\r\n })\r\n }\r\n\r\n }\r\n })\r\n}\r\n\r\nfunction loadAndMergeModel(model, assetRoot) {\r\n return loadModel(model.name, model.type, assetRoot)\r\n .then(modelData => mergeParents(modelData, model.name, assetRoot))\r\n .then(merged => {\r\n console.debug(model.name + \" merged:\");\r\n console.debug(merged);\r\n if (!merged.hasOwnProperty(\"elements\")) {\r\n if (model.name === \"lava\" || model.name === \"water\") {\r\n merged.elements = [\r\n {\r\n \"from\": [0, 0, 0],\r\n \"to\": [16, 16, 16],\r\n \"faces\": {\r\n \"down\": {\"texture\": \"#particle\", \"cullface\": \"down\"},\r\n \"up\": {\"texture\": \"#particle\", \"cullface\": \"up\"},\r\n \"north\": {\"texture\": \"#particle\", \"cullface\": \"north\"},\r\n \"south\": {\"texture\": \"#particle\", \"cullface\": \"south\"},\r\n \"west\": {\"texture\": \"#particle\", \"cullface\": \"west\"},\r\n \"east\": {\"texture\": \"#particle\", \"cullface\": \"east\"}\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n return merged;\r\n })\r\n}\r\n\r\n\r\n\r\n// Utils\r\n\r\nfunction modelCacheKey(model) {\r\n return model.type + \"__\" + model.name /*+ \"[\" + (model.variant || \"default\") + \"]\"*/;\r\n}\r\n\r\nfunction findMatchingVariant(variants, selector) {\r\n if (!Array.isArray(variants)) variants = Object.keys(variants);\r\n\r\n if (!selector || selector === \"\" || selector.length === 0) return \"\";\r\n let selectorObj = variantStringToObject(selector);\r\n for (let i = 0; i < variants.length; i++) {\r\n let variantObj = variantStringToObject(variants[i]);\r\n\r\n let matches = true;\r\n for (let k in selectorObj) {\r\n if (selectorObj.hasOwnProperty(k)) {\r\n if (variantObj.hasOwnProperty(k)) {\r\n if (selectorObj[k] !== variantObj[k]) {\r\n matches = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (matches) return variants[i];\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction variantStringToObject(str) {\r\n let split = str.split(\",\");\r\n let obj = {};\r\n for (let i = 0; i < split.length; i++) {\r\n let spl = split[i];\r\n let split1 = spl.split(\"=\");\r\n obj[split1[0]] = split1[1];\r\n }\r\n return obj;\r\n}\r\n\r\nfunction parseModelType(string) {\r\n if (string.startsWith(\"block/\")) {\r\n // if (type === \"item\") {\r\n // throw new Error(\"Tried to mix block/item models\");\r\n // }\r\n return {\r\n type: \"block\",\r\n model: string.substr(\"block/\".length)\r\n }\r\n } else if (string.startsWith(\"item/\")) {\r\n // if (type === \"block\") {\r\n // throw new Error(\"Tried to mix item/block models\");\r\n // }\r\n return {\r\n type: \"item\",\r\n model: string.substr(\"item/\".length)\r\n }\r\n }\r\n return {\r\n type: \"block\",\r\n model: \"string\"\r\n }\r\n}\r\n\r\nfunction loadModel(model, type/* block OR item */, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n if (typeof model === \"string\") {\r\n if (model.startsWith(\"{\") && model.endsWith(\"}\")) {// JSON string\r\n resolve(JSON.parse(model));\r\n } else if (model.startsWith(\"http\")) {// URL\r\n fetch(model, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"model data:\", data);\r\n resolve(data);\r\n })\r\n } else {// model name -> use local data\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + (type || \"block\") + \"/\" + model + \".json\").then((data) => {\r\n resolve(data);\r\n })\r\n }\r\n } else if (typeof model === \"object\") {// JSON object\r\n resolve(model);\r\n } else {\r\n console.warn(\"Invalid model\");\r\n reject();\r\n }\r\n });\r\n};\r\n\r\nfunction loadTextures(textureNames, assetRoot) {\r\n return new Promise((resolve) => {\r\n let promises = [];\r\n let filteredNames = [];\r\n\r\n let names = Object.keys(textureNames);\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n let texture = textureNames[name];\r\n if (texture.startsWith(\"#\")) {// reference to another texture, no need to load\r\n continue;\r\n }\r\n filteredNames.push(name);\r\n promises.push(Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextureAsBase64\"])(assetRoot, \"minecraft\", \"/\", texture));\r\n }\r\n Promise.all(promises).then((textures) => {\r\n let mappedTextures = {};\r\n for (let i = 0; i < textures.length; i++) {\r\n mappedTextures[filteredNames[i]] = textures[i];\r\n }\r\n\r\n // Fill in the referenced textures\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n if (!mappedTextures.hasOwnProperty(name) && textureNames.hasOwnProperty(name)) {\r\n let ref = textureNames[name].substr(1);\r\n mappedTextures[name] = mappedTextures[ref];\r\n }\r\n }\r\n\r\n resolve(mappedTextures);\r\n });\r\n })\r\n};\r\n\r\n\r\nfunction mergeParents(model, modelName, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n mergeParents_(model, modelName, [], [], assetRoot, resolve, reject);\r\n });\r\n};\r\nlet mergeParents_ = function (model, name, stack, hierarchy, assetRoot, resolve, reject) {\r\n stack.push(model);\r\n\r\n if (!model.hasOwnProperty(\"parent\") || model[\"parent\"] === \"builtin/generated\" || model[\"parent\"] === \"builtin/entity\") {// already at the highest parent OR we reach the builtin parent which seems to be the hardcoded stuff that's not in the json files\r\n let merged = {};\r\n for (let i = stack.length - 1; i >= 0; i--) {\r\n merged = deepmerge__WEBPACK_IMPORTED_MODULE_1___default()(merged, stack[i]);\r\n }\r\n\r\n hierarchy.unshift(name);\r\n merged.hierarchy = hierarchy;\r\n resolve(merged);\r\n return;\r\n }\r\n\r\n let parent = model[\"parent\"];\r\n delete model[\"parent\"];// remove the child's parent so it will be replaced by the parent's parent\r\n hierarchy.push(parent);\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + parent + \".json\").then((parentData) => {\r\n let mergedModel = Object.assign({}, model, parentData);\r\n mergeParents_(mergedModel, name, stack, hierarchy, assetRoot, resolve, reject);\r\n }).catch(reject);\r\n\r\n};\r\n\r\nfunction toRadians(angle) {\r\n return angle * (Math.PI / 180);\r\n}\r\n\r\nfunction deleteObjectProperties(obj) {\r\n Object.keys(obj).forEach(function (key) {\r\n delete obj[key];\r\n });\r\n}\r\n\n\n//# sourceURL=webpack:///./src/model/modelFunctions.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModel\", function() { return parseModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadAndMergeModel\", function() { return loadAndMergeModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modelCacheKey\", function() { return modelCacheKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findMatchingVariant\", function() { return findMatchingVariant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"variantStringToObject\", function() { return variantStringToObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModelType\", function() { return parseModelType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadModel\", function() { return loadModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextures\", function() { return loadTextures; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeParents\", function() { return mergeParents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadians\", function() { return toRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deleteObjectProperties\", function() { return deleteObjectProperties; });\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_2__);\n\r\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_2__(\"minerender\");\r\n\r\nfunction parseModel(model, modelOptions, parsedModelList, assetRoot) {\r\n return new Promise(resolve => {\r\n let type = \"block\";\r\n let offset;\r\n let rotation;\r\n let scale;\r\n\r\n if (typeof model === \"string\") {\r\n let parsed = parseModelType(model);\r\n model = parsed.model;\r\n type = parsed.type;\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (typeof model === \"object\") {\r\n if (model.hasOwnProperty(\"offset\")) {\r\n offset = model[\"offset\"];\r\n }\r\n if (model.hasOwnProperty(\"rotation\")) {\r\n rotation = model[\"rotation\"];\r\n }\r\n if (model.hasOwnProperty(\"scale\")) {\r\n scale = model[\"scale\"];\r\n }\r\n\r\n if (model.hasOwnProperty(\"model\")) {\r\n if (model.hasOwnProperty(\"type\")) {\r\n type = model[\"type\"];\r\n model = model[\"model\"];\r\n } else {\r\n let parsed = parseModelType(model[\"model\"]);\r\n model = parsed.model;\r\n type = parsed.type;\r\n }\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (model.hasOwnProperty(\"blockstate\")) {\r\n type = \"block\";\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadBlockState\"])(model.blockstate, assetRoot).then((blockstate) => {\r\n if (blockstate.hasOwnProperty(\"variants\")) {\r\n\r\n if (model.hasOwnProperty(\"variant\")) {\r\n let variantKey = findMatchingVariant(blockstate.variants, model.variant);\r\n if (variantKey === null) {\r\n console.warn(\"Missing variant key for \" + model.blockstate + \": \" + model.variant);\r\n console.warn(blockstate.variants);\r\n resolve(null);\r\n return;\r\n }\r\n let variant = blockstate.variants[variantKey];\r\n if (!variant) {\r\n console.warn(\"Missing variant for \" + model.blockstate + \": \" + model.variant);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else {\r\n let variant;\r\n if (blockstate.variants.hasOwnProperty(\"normal\")) {\r\n variant = blockstate.variants.normal;\r\n } else if (blockstate.variants.hasOwnProperty(\"\")) {\r\n variant = blockstate.variants[\"\"];\r\n } else {\r\n variant = blockstate.variants[Object.keys(blockstate.variants)[0]]\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n resolve(parsedModelList);\r\n }\r\n } else if (blockstate.hasOwnProperty(\"multipart\")) {\r\n for (let j = 0; j < blockstate.multipart.length; j++) {\r\n let cond = blockstate.multipart[j];\r\n let apply = cond.apply;\r\n let when = cond.when;\r\n\r\n rotation = [0, 0, 0];\r\n\r\n if (!when) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n } else if (model.hasOwnProperty(\"multipart\")) {\r\n let multipartConditions = model.multipart;\r\n\r\n let applies = false;\r\n if (when.hasOwnProperty(\"OR\")) {\r\n for (let k = 0; k < when.OR.length; k++) {\r\n if (applies) break;\r\n for (let c in when.OR[k]) {\r\n if (applies) break;\r\n if (when.OR[k].hasOwnProperty(c)) {\r\n let expected = when.OR[k][c];\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n for (let c in when) {// this SHOULD be a single case, but iterating makes it a bit easier\r\n if (applies) break;\r\n if (when.hasOwnProperty(c)) {\r\n let expected = String(when[c]);\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (applies) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n }\r\n }\r\n }\r\n\r\n resolve(parsedModelList);\r\n }\r\n }).catch(()=>{\r\n resolve(parsedModelList);\r\n })\r\n }\r\n\r\n }\r\n })\r\n}\r\n\r\nfunction loadAndMergeModel(model, assetRoot) {\r\n return loadModel(model.name, model.type, assetRoot)\r\n .then(modelData => mergeParents(modelData, model.name, assetRoot))\r\n .then(merged => {\r\n debug(model.name + \" merged:\");\r\n debug(merged);\r\n if (!merged.hasOwnProperty(\"elements\")) {\r\n if (model.name === \"lava\" || model.name === \"water\") {\r\n merged.elements = [\r\n {\r\n \"from\": [0, 0, 0],\r\n \"to\": [16, 16, 16],\r\n \"faces\": {\r\n \"down\": {\"texture\": \"#particle\", \"cullface\": \"down\"},\r\n \"up\": {\"texture\": \"#particle\", \"cullface\": \"up\"},\r\n \"north\": {\"texture\": \"#particle\", \"cullface\": \"north\"},\r\n \"south\": {\"texture\": \"#particle\", \"cullface\": \"south\"},\r\n \"west\": {\"texture\": \"#particle\", \"cullface\": \"west\"},\r\n \"east\": {\"texture\": \"#particle\", \"cullface\": \"east\"}\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n return merged;\r\n })\r\n}\r\n\r\n\r\n\r\n// Utils\r\n\r\nfunction modelCacheKey(model) {\r\n return model.type + \"__\" + model.name /*+ \"[\" + (model.variant || \"default\") + \"]\"*/;\r\n}\r\n\r\nfunction findMatchingVariant(variants, selector) {\r\n if (!Array.isArray(variants)) variants = Object.keys(variants);\r\n\r\n if (!selector || selector === \"\" || selector.length === 0) return \"\";\r\n let selectorObj = variantStringToObject(selector);\r\n for (let i = 0; i < variants.length; i++) {\r\n let variantObj = variantStringToObject(variants[i]);\r\n\r\n let matches = true;\r\n for (let k in selectorObj) {\r\n if (selectorObj.hasOwnProperty(k)) {\r\n if (variantObj.hasOwnProperty(k)) {\r\n if (selectorObj[k] !== variantObj[k]) {\r\n matches = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (matches) return variants[i];\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction variantStringToObject(str) {\r\n let split = str.split(\",\");\r\n let obj = {};\r\n for (let i = 0; i < split.length; i++) {\r\n let spl = split[i];\r\n let split1 = spl.split(\"=\");\r\n obj[split1[0]] = split1[1];\r\n }\r\n return obj;\r\n}\r\n\r\nfunction parseModelType(string) {\r\n if (string.startsWith(\"block/\")) {\r\n // if (type === \"item\") {\r\n // throw new Error(\"Tried to mix block/item models\");\r\n // }\r\n return {\r\n type: \"block\",\r\n model: string.substr(\"block/\".length)\r\n }\r\n } else if (string.startsWith(\"item/\")) {\r\n // if (type === \"block\") {\r\n // throw new Error(\"Tried to mix item/block models\");\r\n // }\r\n return {\r\n type: \"item\",\r\n model: string.substr(\"item/\".length)\r\n }\r\n }\r\n return {\r\n type: \"block\",\r\n model: \"string\"\r\n }\r\n}\r\n\r\nfunction loadModel(model, type/* block OR item */, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n if (typeof model === \"string\") {\r\n if (model.startsWith(\"{\") && model.endsWith(\"}\")) {// JSON string\r\n resolve(JSON.parse(model));\r\n } else if (model.startsWith(\"http\")) {// URL\r\n fetch(model, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"model data:\", data);\r\n resolve(data);\r\n })\r\n } else {// model name -> use local data\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + (type || \"block\") + \"/\" + model + \".json\").then((data) => {\r\n resolve(data);\r\n })\r\n }\r\n } else if (typeof model === \"object\") {// JSON object\r\n resolve(model);\r\n } else {\r\n console.warn(\"Invalid model\");\r\n reject();\r\n }\r\n });\r\n};\r\n\r\nfunction loadTextures(textureNames, assetRoot) {\r\n return new Promise((resolve) => {\r\n let promises = [];\r\n let filteredNames = [];\r\n\r\n let names = Object.keys(textureNames);\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n let texture = textureNames[name];\r\n if (texture.startsWith(\"#\")) {// reference to another texture, no need to load\r\n continue;\r\n }\r\n filteredNames.push(name);\r\n promises.push(Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextureAsBase64\"])(assetRoot, \"minecraft\", \"/\", texture));\r\n }\r\n Promise.all(promises).then((textures) => {\r\n let mappedTextures = {};\r\n for (let i = 0; i < textures.length; i++) {\r\n mappedTextures[filteredNames[i]] = textures[i];\r\n }\r\n\r\n // Fill in the referenced textures\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n if (!mappedTextures.hasOwnProperty(name) && textureNames.hasOwnProperty(name)) {\r\n let ref = textureNames[name].substr(1);\r\n mappedTextures[name] = mappedTextures[ref];\r\n }\r\n }\r\n\r\n resolve(mappedTextures);\r\n });\r\n })\r\n};\r\n\r\n\r\nfunction mergeParents(model, modelName, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n mergeParents_(model, modelName, [], [], assetRoot, resolve, reject);\r\n });\r\n};\r\nlet mergeParents_ = function (model, name, stack, hierarchy, assetRoot, resolve, reject) {\r\n stack.push(model);\r\n\r\n if (!model.hasOwnProperty(\"parent\") || model[\"parent\"] === \"builtin/generated\" || model[\"parent\"] === \"builtin/entity\") {// already at the highest parent OR we reach the builtin parent which seems to be the hardcoded stuff that's not in the json files\r\n let merged = {};\r\n for (let i = stack.length - 1; i >= 0; i--) {\r\n merged = deepmerge__WEBPACK_IMPORTED_MODULE_1___default()(merged, stack[i]);\r\n }\r\n\r\n hierarchy.unshift(name);\r\n merged.hierarchy = hierarchy;\r\n resolve(merged);\r\n return;\r\n }\r\n\r\n let parent = model[\"parent\"];\r\n delete model[\"parent\"];// remove the child's parent so it will be replaced by the parent's parent\r\n hierarchy.push(parent);\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + parent + \".json\").then((parentData) => {\r\n let mergedModel = Object.assign({}, model, parentData);\r\n mergeParents_(mergedModel, name, stack, hierarchy, assetRoot, resolve, reject);\r\n }).catch(reject);\r\n\r\n};\r\n\r\nfunction toRadians(angle) {\r\n return angle * (Math.PI / 180);\r\n}\r\n\r\nfunction deleteObjectProperties(obj) {\r\n Object.keys(obj).forEach(function (key) {\r\n delete obj[key];\r\n });\r\n}\r\n\n\n//# sourceURL=webpack:///./src/model/modelFunctions.js?"); /***/ }), @@ -2169,7 +2202,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultOptions\", function() { return defaultOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepDisposeMesh\", function() { return deepDisposeMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeMeshes__\", function() { return mergeMeshes__; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeCubeMeshes\", function() { return mergeCubeMeshes; });\n/* harmony import */ var _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/OrbitControls */ \"./src/lib/OrbitControls.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! threejs-ext */ \"./node_modules/threejs-ext/dist/index.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(threejs_ext__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @johh/three-effectcomposer */ \"./node_modules/@johh/three-effectcomposer/dist/index.js\");\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! onscreen */ \"./node_modules/onscreen/dist/on-screen.umd.js\");\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(onscreen__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions */ \"./src/functions.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @property {boolean} showAxes Debugging - Show the scene's axes\r\n * @property {boolean} showOutlines Debugging - Show bounding boxes\r\n * @property {boolean} showGrid Debugging - Show coordinate grid\r\n *\r\n * @property {object} controls Controls settings\r\n * @property {boolean} [controls.enabled=true] Toggle controls\r\n * @property {boolean} [controls.zoom=true] Toggle zoom\r\n * @property {boolean} [controls.rotate=true] Toggle rotation\r\n * @property {boolean} [controls.pan=true] Toggle panning\r\n *\r\n * @property {object} camera Camera settings\r\n * @property {string} [camera.type=perspective] Camera type\r\n * @property {number} camera.x Camera X-position\r\n * @property {number} camera.y Camera Y-Position\r\n * @property {number} camera.z Camera Z-Position\r\n * @property {number[]} camera.target [x,y,z] array where the camera should look\r\n */\r\nconst defaultOptions = {\r\n showAxes: false,\r\n showGrid: false,\r\n autoResize: false,\r\n controls: {\r\n enabled: true,\r\n zoom: true,\r\n rotate: true,\r\n pan: true,\r\n keys: true\r\n },\r\n camera: {\r\n type: \"perspective\",\r\n x: 20,\r\n y: 35,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n canvas: {\r\n width: undefined,\r\n height: undefined\r\n },\r\n pauseHidden: true,\r\n forceContext: false,\r\n sendStats: true\r\n};\r\n\r\n/**\r\n * Base class for all Renders\r\n */\r\nclass Render {\r\n\r\n /**\r\n * @param {object} options The options for this renderer, see {@link defaultOptions}\r\n * @param {object} defOptions Additional default options, provided by the individual renders\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, defOptions, element) {\r\n /**\r\n * DOM Element to attach the renderer to\r\n * @type {HTMLElement}\r\n */\r\n this.element = element || document.body;\r\n /**\r\n * Combined options\r\n * @type {{} & defaultOptions & defOptions & options}\r\n */\r\n this.options = Object.assign({}, defaultOptions, defOptions, options);\r\n\r\n this.renderType = \"_Base_\";\r\n }\r\n\r\n /**\r\n * @param {boolean} [trim=false] whether to trim transparent pixels\r\n * @param {string} [mime=image/png] mime type of the image\r\n * @returns {string} The content of the renderer's canvas as a Base64 encoded image\r\n */\r\n toImage(trim, mime) {\r\n if (!mime) mime = \"image/png\";\r\n if (this._renderer) {\r\n if (!trim) {\r\n return this._renderer.domElement.toDataURL(mime);\r\n } else {\r\n // Clone the canvas onto a 2d context, so we can trim it properly\r\n let newCanvas = document.createElement('canvas');\r\n let context = newCanvas.getContext('2d');\r\n\r\n newCanvas.width = this._renderer.domElement.width;\r\n newCanvas.height = this._renderer.domElement.height;\r\n\r\n context.drawImage(this._renderer.domElement, 0, 0);\r\n\r\n let trimmed = Object(_functions__WEBPACK_IMPORTED_MODULE_6__[\"trimCanvas\"])(newCanvas);\r\n return trimmed.toDataURL(mime);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Export the current scene content in the .obj format (only geometries, no textures)\r\n * @returns {string} the .obj file content\r\n */\r\n toObj() {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"OBJExporter\"]();\r\n return exporter.parse(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Export the current scene content in the .gltf format (geometries + textures)\r\n * @returns {Promise} a promise which resolves with the .gltf file content\r\n */\r\n toGLTF(exportOptions) {\r\n return new Promise((resolve, reject) => {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"GLTFExporter\"]();\r\n exporter.parse(this._scene, (gltf) => {\r\n resolve(gltf);\r\n }, exportOptions)\r\n } else {\r\n reject();\r\n }\r\n })\r\n }\r\n\r\n toPLY(exportOptions) {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"PLYExporter\"]();\r\n return exporter.parse(this._scene, exportOptions);\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the scene\r\n * @param renderCb\r\n * @param doNotAnimate\r\n * @protected\r\n */\r\n initScene(renderCb, doNotAnimate) {\r\n let renderObj = this;\r\n\r\n console.log(\" \");\r\n console.log('%c ', 'font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;');\r\n console.log(\"MineRender/\" + (renderObj.renderType || renderObj.constructor.name) + \"/\" + \"1.4.6\");\r\n console.log(( false ? undefined : \"DEVELOPMENT\") + \" build\");\r\n console.log(\"Built @ \" + \"2021-02-01T16:10:49.094Z\");\r\n console.log(\" \");\r\n\r\n if (renderObj.options.sendStats) {\r\n // Send stats\r\n\r\n let iframe = false;\r\n try {\r\n iframe = window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n let hostname;\r\n try{\r\n hostname = new URL(iframe ? document.referrer : window.location).hostname;\r\n }catch (e) {\r\n console.warn(\"Failed to get hostname\");\r\n }\r\n\r\n jquery__WEBPACK_IMPORTED_MODULE_5__[\"post\"]({\r\n url: \"https://minerender.org/stats.php\",\r\n data: {\r\n action: \"init\",\r\n type: renderObj.renderType,\r\n host: hostname,\r\n source: (iframe ? \"iframe\" : \"javascript\")\r\n }\r\n });\r\n }\r\n\r\n // Scene INIT\r\n let scene = new three__WEBPACK_IMPORTED_MODULE_3__[\"Scene\"]();\r\n renderObj._scene = scene;\r\n let camera;\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"OrthographicCamera\"]((renderObj.options.canvas.width || window.innerWidth) / -2, (renderObj.options.canvas.width || window.innerWidth) / 2, (renderObj.options.canvas.height || window.innerHeight) / 2, (renderObj.options.canvas.height || window.innerHeight) / -2, 1, 1000);\r\n } else {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"PerspectiveCamera\"](75, (renderObj.options.canvas.width || window.innerWidth) / (renderObj.options.canvas.height || window.innerHeight), 5, 1000);\r\n }\r\n renderObj._camera = camera;\r\n\r\n if (renderObj.options.camera.zoom) {\r\n camera.zoom = renderObj.options.camera.zoom;\r\n }\r\n\r\n let renderer = new three__WEBPACK_IMPORTED_MODULE_3__[\"WebGLRenderer\"]({alpha: true, antialias: true, preserveDrawingBuffer: true});\r\n renderObj._renderer = renderer;\r\n renderer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderer.setClearColor(0x000000, 0);\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.shadowMap.enabled = true;\r\n renderer.shadowMap.type = three__WEBPACK_IMPORTED_MODULE_3__[\"PCFSoftShadowMap\"];\r\n renderObj.element.appendChild(renderObj._canvas = renderer.domElement);\r\n\r\n let composer = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default.a(renderer);\r\n composer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderObj._composer = composer;\r\n let ssaaRenderPass = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"SSAARenderPass\"](scene, camera);\r\n ssaaRenderPass.unbiased = true;\r\n composer.addPass(ssaaRenderPass);\r\n // let renderPass = new RenderPass(scene, camera);\r\n // renderPass.enabled = false;\r\n // composer.addPass(renderPass);\r\n let copyPass = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"ShaderPass\"](_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"CopyShader\"]);\r\n copyPass.renderToScreen = true;\r\n composer.addPass(copyPass);\r\n\r\n if (renderObj.options.autoResize) {\r\n renderObj._resizeListener = function () {\r\n let width = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetWidth : window.innerWidth;\r\n let height = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetHeight : window.innerHeight;\r\n\r\n renderObj._resize(width, height);\r\n };\r\n window.addEventListener(\"resize\", renderObj._resizeListener);\r\n }\r\n renderObj._resize = function (width, height) {\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera.left = width / -2;\r\n camera.right = width / 2;\r\n camera.top = height / 2;\r\n camera.bottom = height / -2;\r\n } else {\r\n camera.aspect = width / height;\r\n }\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(width, height);\r\n composer.setSize(width, height);\r\n };\r\n\r\n // Helpers\r\n if (renderObj.options.showAxes) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"AxesHelper\"](50));\r\n }\r\n if (renderObj.options.showGrid) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"GridHelper\"](100, 100));\r\n }\r\n\r\n let light = new three__WEBPACK_IMPORTED_MODULE_3__[\"AmbientLight\"](0xFFFFFF); // soft white light\r\n scene.add(light);\r\n\r\n // Init controls\r\n let controls = new _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__[\"default\"](camera, renderer.domElement);\r\n renderObj._controls = controls;\r\n controls.enableZoom = renderObj.options.controls.zoom;\r\n controls.enableRotate = renderObj.options.controls.rotate;\r\n controls.enablePan = renderObj.options.controls.pan;\r\n controls.enableKeys = renderObj.options.controls.keys;\r\n controls.target.set(renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]);\r\n\r\n // Set camera location & target\r\n camera.position.x = renderObj.options.camera.x;\r\n camera.position.y = renderObj.options.camera.y;\r\n camera.position.z = renderObj.options.camera.z;\r\n camera.lookAt(new three__WEBPACK_IMPORTED_MODULE_3__[\"Vector3\"](renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]));\r\n\r\n // Do the render!\r\n let animate = function () {\r\n renderObj._animId = requestAnimationFrame(animate);\r\n\r\n if (renderObj.onScreen) {\r\n if (typeof renderCb === \"function\") renderCb();\r\n\r\n composer.render();\r\n }\r\n };\r\n renderObj._animate = animate;\r\n\r\n if (!doNotAnimate) {\r\n animate();\r\n }\r\n\r\n renderObj.onScreen = true;// default to true, in case the checking is disabled\r\n let id = \"minerender-canvas-\" + renderObj._scene.uuid + \"-\" + Date.now();\r\n renderObj._canvas.id = id;\r\n if (renderObj.options.pauseHidden) {\r\n renderObj.onScreen = false;// set to false if the check is enabled\r\n let os = new onscreen__WEBPACK_IMPORTED_MODULE_4___default.a();\r\n renderObj._onScreenObserver = os;\r\n\r\n os.on(\"enter\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = true;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextRestore();\r\n }\r\n })\r\n os.on(\"leave\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = false;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextLoss();\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Adds an object to the scene & sets userData.renderType to this renderer's type\r\n * @param toAdd object to add\r\n */\r\n addToScene(toAdd) {\r\n let renderObj = this;\r\n if (renderObj._scene && toAdd) {\r\n toAdd.userData.renderType = renderObj.renderType;\r\n renderObj._scene.add(toAdd);\r\n }\r\n }\r\n\r\n /**\r\n * Clears the scene\r\n * @param onlySelfType whether to remove only objects whose type is equal to this renderer's type (useful for combined render)\r\n * @param filterFn Filter function to check which children of the scene to remove\r\n */\r\n clearScene(onlySelfType, filterFn) {\r\n if (onlySelfType || filterFn) {\r\n for (let i = this._scene.children.length - 1; i >= 0; i--) {\r\n let child = this._scene.children[i];\r\n if (filterFn) {\r\n let shouldKeep = filterFn(child);\r\n if (shouldKeep) {\r\n continue;\r\n }\r\n }\r\n if (onlySelfType) {\r\n if (child.userData.renderType !== this.renderType) {\r\n continue;\r\n }\r\n }\r\n deepDisposeMesh(child, true);\r\n this._scene.remove(child);\r\n }\r\n } else {\r\n while (this._scene.children.length > 0) {\r\n this._scene.remove(this._scene.children[0]);\r\n }\r\n }\r\n };\r\n\r\n dispose() {\r\n cancelAnimationFrame(this._animId);\r\n if (this._onScreenObserver) {\r\n this._onScreenObserver.destroy();\r\n }\r\n\r\n this.clearScene();\r\n\r\n this._canvas.remove();\r\n let el = this.element;\r\n while (el.firstChild) {\r\n el.removeChild(el.firstChild);\r\n }\r\n\r\n if (this.options.autoResize) {\r\n window.removeEventListener(\"resize\", this._resizeListener);\r\n }\r\n };\r\n\r\n}\r\n\r\n// https://stackoverflow.com/questions/27217388/use-multiple-materials-for-merged-geometries-in-three-js/44485364#44485364\r\nfunction deepDisposeMesh(obj, removeChildren) {\r\n if (!obj) return;\r\n if (obj.geometry && obj.geometry.dispose) obj.geometry.dispose();\r\n if (obj.material && obj.material.dispose) obj.material.dispose();\r\n if (obj.texture && obj.texture.dispose) obj.texture.dispose();\r\n if (obj.children) {\r\n let children = obj.children;\r\n for (let i = 0; i < children.length; i++) {\r\n deepDisposeMesh(children[i], removeChildren);\r\n }\r\n\r\n if (removeChildren) {\r\n for (let i = obj.children.length - 1; i >= 0; i--) {\r\n obj.remove(children[i]);\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction mergeMeshes__(meshes, toBufferGeometry) {\r\n let finalGeometry,\r\n materials = [],\r\n mergedGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"](),\r\n mergedMesh;\r\n\r\n meshes.forEach(function (mesh, index) {\r\n mesh.updateMatrix();\r\n mesh.geometry.faces.forEach(function (face) {\r\n face.materialIndex = 0;\r\n });\r\n mergedGeometry.merge(mesh.geometry, mesh.matrix, index);\r\n materials.push(mesh.material);\r\n });\r\n\r\n mergedGeometry.groupsNeedUpdate = true;\r\n\r\n if (toBufferGeometry) {\r\n finalGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedGeometry);\r\n } else {\r\n finalGeometry = mergedGeometry;\r\n }\r\n\r\n mergedMesh = new three__WEBPACK_IMPORTED_MODULE_3__[\"Mesh\"](finalGeometry, materials);\r\n mergedMesh.geometry.computeFaceNormals();\r\n mergedMesh.geometry.computeVertexNormals();\r\n\r\n return mergedMesh;\r\n\r\n}\r\n\r\nfunction mergeCubeMeshes(cubes, toBuffer) {\r\n cubes = cubes.filter(c => !!c);\r\n\r\n let mergedCubes = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"]();\r\n let mergedMaterials = [];\r\n for (let i = 0; i < cubes.length; i++) {\r\n let offset = i * Math.max(cubes[i].material.length, 1);\r\n mergedCubes.merge(cubes[i].geometry, cubes[i].matrix, offset);\r\n for (let j = 0; j < cubes[i].material.length; j++) {\r\n mergedMaterials.push(cubes[i].material[j]);\r\n }\r\n // for (let j = 0; j < cubes[i].geometry.faces.length; j++) {\r\n // cubes[i].geometry.faces[j].materialIndex=offset-1+j;\r\n // }\r\n\r\n deepDisposeMesh(cubes[i], true);\r\n }\r\n mergedCubes.mergeVertices();\r\n return {\r\n geometry: toBuffer ? new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedCubes) : mergedCubes,\r\n materials: mergedMaterials\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./src/renderBase.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultOptions\", function() { return defaultOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepDisposeMesh\", function() { return deepDisposeMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeMeshes__\", function() { return mergeMeshes__; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeCubeMeshes\", function() { return mergeCubeMeshes; });\n/* harmony import */ var _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/OrbitControls */ \"./src/lib/OrbitControls.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! threejs-ext */ \"./node_modules/threejs-ext/dist/index.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(threejs_ext__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @johh/three-effectcomposer */ \"./node_modules/@johh/three-effectcomposer/dist/index.js\");\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! onscreen */ \"./node_modules/onscreen/dist/on-screen.umd.js\");\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(onscreen__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions */ \"./src/functions.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @property {boolean} showAxes Debugging - Show the scene's axes\r\n * @property {boolean} showOutlines Debugging - Show bounding boxes\r\n * @property {boolean} showGrid Debugging - Show coordinate grid\r\n *\r\n * @property {object} controls Controls settings\r\n * @property {boolean} [controls.enabled=true] Toggle controls\r\n * @property {boolean} [controls.zoom=true] Toggle zoom\r\n * @property {boolean} [controls.rotate=true] Toggle rotation\r\n * @property {boolean} [controls.pan=true] Toggle panning\r\n *\r\n * @property {object} camera Camera settings\r\n * @property {string} [camera.type=perspective] Camera type\r\n * @property {number} camera.x Camera X-position\r\n * @property {number} camera.y Camera Y-Position\r\n * @property {number} camera.z Camera Z-Position\r\n * @property {number[]} camera.target [x,y,z] array where the camera should look\r\n */\r\nconst defaultOptions = {\r\n showAxes: false,\r\n showGrid: false,\r\n autoResize: false,\r\n controls: {\r\n enabled: true,\r\n zoom: true,\r\n rotate: true,\r\n pan: true,\r\n keys: true\r\n },\r\n camera: {\r\n type: \"perspective\",\r\n x: 20,\r\n y: 35,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n canvas: {\r\n width: undefined,\r\n height: undefined\r\n },\r\n pauseHidden: true,\r\n forceContext: false,\r\n sendStats: true\r\n};\r\n\r\n/**\r\n * Base class for all Renders\r\n */\r\nclass Render {\r\n\r\n /**\r\n * @param {object} options The options for this renderer, see {@link defaultOptions}\r\n * @param {object} defOptions Additional default options, provided by the individual renders\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, defOptions, element) {\r\n /**\r\n * DOM Element to attach the renderer to\r\n * @type {HTMLElement}\r\n */\r\n this.element = element || document.body;\r\n /**\r\n * Combined options\r\n * @type {{} & defaultOptions & defOptions & options}\r\n */\r\n this.options = Object.assign({}, defaultOptions, defOptions, options);\r\n\r\n this.renderType = \"_Base_\";\r\n }\r\n\r\n /**\r\n * @param {boolean} [trim=false] whether to trim transparent pixels\r\n * @param {string} [mime=image/png] mime type of the image\r\n * @returns {string} The content of the renderer's canvas as a Base64 encoded image\r\n */\r\n toImage(trim, mime) {\r\n if (!mime) mime = \"image/png\";\r\n if (this._renderer) {\r\n if (!trim) {\r\n return this._renderer.domElement.toDataURL(mime);\r\n } else {\r\n // Clone the canvas onto a 2d context, so we can trim it properly\r\n let newCanvas = document.createElement('canvas');\r\n let context = newCanvas.getContext('2d');\r\n\r\n newCanvas.width = this._renderer.domElement.width;\r\n newCanvas.height = this._renderer.domElement.height;\r\n\r\n context.drawImage(this._renderer.domElement, 0, 0);\r\n\r\n let trimmed = Object(_functions__WEBPACK_IMPORTED_MODULE_6__[\"trimCanvas\"])(newCanvas);\r\n return trimmed.toDataURL(mime);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Export the current scene content in the .obj format (only geometries, no textures)\r\n * @returns {string} the .obj file content\r\n */\r\n toObj() {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"OBJExporter\"]();\r\n return exporter.parse(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Export the current scene content in the .gltf format (geometries + textures)\r\n * @returns {Promise} a promise which resolves with the .gltf file content\r\n */\r\n toGLTF(exportOptions) {\r\n return new Promise((resolve, reject) => {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"GLTFExporter\"]();\r\n exporter.parse(this._scene, (gltf) => {\r\n resolve(gltf);\r\n }, exportOptions)\r\n } else {\r\n reject();\r\n }\r\n })\r\n }\r\n\r\n toPLY(exportOptions) {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"PLYExporter\"]();\r\n return exporter.parse(this._scene, exportOptions);\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the scene\r\n * @param renderCb\r\n * @param doNotAnimate\r\n * @protected\r\n */\r\n initScene(renderCb, doNotAnimate) {\r\n let renderObj = this;\r\n\r\n console.log(\" \");\r\n console.log('%c ', 'font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;');\r\n console.log(\"MineRender/\" + (renderObj.renderType || renderObj.constructor.name) + \"/\" + \"1.4.7\");\r\n console.log(( false ? undefined : \"DEVELOPMENT\") + \" build\");\r\n console.log(\"Built @ \" + \"2021-02-01T16:31:09.608Z\");\r\n console.log(\" \");\r\n\r\n if (renderObj.options.sendStats) {\r\n // Send stats\r\n\r\n let iframe = false;\r\n try {\r\n iframe = window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n let hostname;\r\n try{\r\n hostname = new URL(iframe ? document.referrer : window.location).hostname;\r\n }catch (e) {\r\n console.warn(\"Failed to get hostname\");\r\n }\r\n\r\n jquery__WEBPACK_IMPORTED_MODULE_5__[\"post\"]({\r\n url: \"https://minerender.org/stats.php\",\r\n data: {\r\n action: \"init\",\r\n type: renderObj.renderType,\r\n host: hostname,\r\n source: (iframe ? \"iframe\" : \"javascript\")\r\n }\r\n });\r\n }\r\n\r\n // Scene INIT\r\n let scene = new three__WEBPACK_IMPORTED_MODULE_3__[\"Scene\"]();\r\n renderObj._scene = scene;\r\n let camera;\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"OrthographicCamera\"]((renderObj.options.canvas.width || window.innerWidth) / -2, (renderObj.options.canvas.width || window.innerWidth) / 2, (renderObj.options.canvas.height || window.innerHeight) / 2, (renderObj.options.canvas.height || window.innerHeight) / -2, 1, 1000);\r\n } else {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"PerspectiveCamera\"](75, (renderObj.options.canvas.width || window.innerWidth) / (renderObj.options.canvas.height || window.innerHeight), 5, 1000);\r\n }\r\n renderObj._camera = camera;\r\n\r\n if (renderObj.options.camera.zoom) {\r\n camera.zoom = renderObj.options.camera.zoom;\r\n }\r\n\r\n let renderer = new three__WEBPACK_IMPORTED_MODULE_3__[\"WebGLRenderer\"]({alpha: true, antialias: true, preserveDrawingBuffer: true});\r\n renderObj._renderer = renderer;\r\n renderer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderer.setClearColor(0x000000, 0);\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.shadowMap.enabled = true;\r\n renderer.shadowMap.type = three__WEBPACK_IMPORTED_MODULE_3__[\"PCFSoftShadowMap\"];\r\n renderObj.element.appendChild(renderObj._canvas = renderer.domElement);\r\n\r\n let composer = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default.a(renderer);\r\n composer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderObj._composer = composer;\r\n let ssaaRenderPass = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"SSAARenderPass\"](scene, camera);\r\n ssaaRenderPass.unbiased = true;\r\n composer.addPass(ssaaRenderPass);\r\n // let renderPass = new RenderPass(scene, camera);\r\n // renderPass.enabled = false;\r\n // composer.addPass(renderPass);\r\n let copyPass = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"ShaderPass\"](_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"CopyShader\"]);\r\n copyPass.renderToScreen = true;\r\n composer.addPass(copyPass);\r\n\r\n if (renderObj.options.autoResize) {\r\n renderObj._resizeListener = function () {\r\n let width = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetWidth : window.innerWidth;\r\n let height = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetHeight : window.innerHeight;\r\n\r\n renderObj._resize(width, height);\r\n };\r\n window.addEventListener(\"resize\", renderObj._resizeListener);\r\n }\r\n renderObj._resize = function (width, height) {\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera.left = width / -2;\r\n camera.right = width / 2;\r\n camera.top = height / 2;\r\n camera.bottom = height / -2;\r\n } else {\r\n camera.aspect = width / height;\r\n }\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(width, height);\r\n composer.setSize(width, height);\r\n };\r\n\r\n // Helpers\r\n if (renderObj.options.showAxes) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"AxesHelper\"](50));\r\n }\r\n if (renderObj.options.showGrid) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"GridHelper\"](100, 100));\r\n }\r\n\r\n let light = new three__WEBPACK_IMPORTED_MODULE_3__[\"AmbientLight\"](0xFFFFFF); // soft white light\r\n scene.add(light);\r\n\r\n // Init controls\r\n let controls = new _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__[\"default\"](camera, renderer.domElement);\r\n renderObj._controls = controls;\r\n controls.enableZoom = renderObj.options.controls.zoom;\r\n controls.enableRotate = renderObj.options.controls.rotate;\r\n controls.enablePan = renderObj.options.controls.pan;\r\n controls.enableKeys = renderObj.options.controls.keys;\r\n controls.target.set(renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]);\r\n\r\n // Set camera location & target\r\n camera.position.x = renderObj.options.camera.x;\r\n camera.position.y = renderObj.options.camera.y;\r\n camera.position.z = renderObj.options.camera.z;\r\n camera.lookAt(new three__WEBPACK_IMPORTED_MODULE_3__[\"Vector3\"](renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]));\r\n\r\n // Do the render!\r\n let animate = function () {\r\n renderObj._animId = requestAnimationFrame(animate);\r\n\r\n if (renderObj.onScreen) {\r\n if (typeof renderCb === \"function\") renderCb();\r\n\r\n composer.render();\r\n }\r\n };\r\n renderObj._animate = animate;\r\n\r\n if (!doNotAnimate) {\r\n animate();\r\n }\r\n\r\n renderObj.onScreen = true;// default to true, in case the checking is disabled\r\n let id = \"minerender-canvas-\" + renderObj._scene.uuid + \"-\" + Date.now();\r\n renderObj._canvas.id = id;\r\n if (renderObj.options.pauseHidden) {\r\n renderObj.onScreen = false;// set to false if the check is enabled\r\n let os = new onscreen__WEBPACK_IMPORTED_MODULE_4___default.a();\r\n renderObj._onScreenObserver = os;\r\n\r\n os.on(\"enter\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = true;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextRestore();\r\n }\r\n })\r\n os.on(\"leave\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = false;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextLoss();\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Adds an object to the scene & sets userData.renderType to this renderer's type\r\n * @param toAdd object to add\r\n */\r\n addToScene(toAdd) {\r\n let renderObj = this;\r\n if (renderObj._scene && toAdd) {\r\n toAdd.userData.renderType = renderObj.renderType;\r\n renderObj._scene.add(toAdd);\r\n }\r\n }\r\n\r\n /**\r\n * Clears the scene\r\n * @param onlySelfType whether to remove only objects whose type is equal to this renderer's type (useful for combined render)\r\n * @param filterFn Filter function to check which children of the scene to remove\r\n */\r\n clearScene(onlySelfType, filterFn) {\r\n if (onlySelfType || filterFn) {\r\n for (let i = this._scene.children.length - 1; i >= 0; i--) {\r\n let child = this._scene.children[i];\r\n if (filterFn) {\r\n let shouldKeep = filterFn(child);\r\n if (shouldKeep) {\r\n continue;\r\n }\r\n }\r\n if (onlySelfType) {\r\n if (child.userData.renderType !== this.renderType) {\r\n continue;\r\n }\r\n }\r\n deepDisposeMesh(child, true);\r\n this._scene.remove(child);\r\n }\r\n } else {\r\n while (this._scene.children.length > 0) {\r\n this._scene.remove(this._scene.children[0]);\r\n }\r\n }\r\n };\r\n\r\n dispose() {\r\n cancelAnimationFrame(this._animId);\r\n if (this._onScreenObserver) {\r\n this._onScreenObserver.destroy();\r\n }\r\n\r\n this.clearScene();\r\n\r\n this._canvas.remove();\r\n let el = this.element;\r\n while (el.firstChild) {\r\n el.removeChild(el.firstChild);\r\n }\r\n\r\n if (this.options.autoResize) {\r\n window.removeEventListener(\"resize\", this._resizeListener);\r\n }\r\n };\r\n\r\n}\r\n\r\n// https://stackoverflow.com/questions/27217388/use-multiple-materials-for-merged-geometries-in-three-js/44485364#44485364\r\nfunction deepDisposeMesh(obj, removeChildren) {\r\n if (!obj) return;\r\n if (obj.geometry && obj.geometry.dispose) obj.geometry.dispose();\r\n if (obj.material && obj.material.dispose) obj.material.dispose();\r\n if (obj.texture && obj.texture.dispose) obj.texture.dispose();\r\n if (obj.children) {\r\n let children = obj.children;\r\n for (let i = 0; i < children.length; i++) {\r\n deepDisposeMesh(children[i], removeChildren);\r\n }\r\n\r\n if (removeChildren) {\r\n for (let i = obj.children.length - 1; i >= 0; i--) {\r\n obj.remove(children[i]);\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction mergeMeshes__(meshes, toBufferGeometry) {\r\n let finalGeometry,\r\n materials = [],\r\n mergedGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"](),\r\n mergedMesh;\r\n\r\n meshes.forEach(function (mesh, index) {\r\n mesh.updateMatrix();\r\n mesh.geometry.faces.forEach(function (face) {\r\n face.materialIndex = 0;\r\n });\r\n mergedGeometry.merge(mesh.geometry, mesh.matrix, index);\r\n materials.push(mesh.material);\r\n });\r\n\r\n mergedGeometry.groupsNeedUpdate = true;\r\n\r\n if (toBufferGeometry) {\r\n finalGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedGeometry);\r\n } else {\r\n finalGeometry = mergedGeometry;\r\n }\r\n\r\n mergedMesh = new three__WEBPACK_IMPORTED_MODULE_3__[\"Mesh\"](finalGeometry, materials);\r\n mergedMesh.geometry.computeFaceNormals();\r\n mergedMesh.geometry.computeVertexNormals();\r\n\r\n return mergedMesh;\r\n\r\n}\r\n\r\nfunction mergeCubeMeshes(cubes, toBuffer) {\r\n cubes = cubes.filter(c => !!c);\r\n\r\n let mergedCubes = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"]();\r\n let mergedMaterials = [];\r\n for (let i = 0; i < cubes.length; i++) {\r\n let offset = i * Math.max(cubes[i].material.length, 1);\r\n mergedCubes.merge(cubes[i].geometry, cubes[i].matrix, offset);\r\n for (let j = 0; j < cubes[i].material.length; j++) {\r\n mergedMaterials.push(cubes[i].material[j]);\r\n }\r\n // for (let j = 0; j < cubes[i].geometry.faces.length; j++) {\r\n // cubes[i].geometry.faces[j].materialIndex=offset-1+j;\r\n // }\r\n\r\n deepDisposeMesh(cubes[i], true);\r\n }\r\n mergedCubes.mergeVertices();\r\n return {\r\n geometry: toBuffer ? new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedCubes) : mergedCubes,\r\n materials: mergedMaterials\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./src/renderBase.js?"); /***/ }), diff --git a/dist/all.min.js b/dist/all.min.js index b5fa661f..36504320 100644 --- a/dist/all.min.js +++ b/dist/all.min.js @@ -1,16 +1,16 @@ /*! - * MineRender 1.4.6 + * MineRender 1.4.7 * (c) 2018, Haylee Schäfer (inventivetalent) / MIT License * https://minerender.org - * Build #1612195849082 / Mon Feb 01 2021 17:10:49 GMT+0100 (GMT+01:00) - */!function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=81)}([function(e,t){e.exports=THREE},function(e,t,r){"use strict";r.d(t,"e",(function(){return o})),r.d(t,"b",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"c",(function(){return f})),r.d(t,"f",(function(){return h})),r.d(t,"a",(function(){return p}));var a=r(2),n=r(23),i=r.n(n);function o(e,t,r,n){return new Promise(i=>{let o,s,l,f="block";if("string"==typeof e){let a=c(e);e=a.model,f=a.type,r.push({name:e,type:f,options:t}),i(r)}else if("object"==typeof e)if(e.hasOwnProperty("offset")&&(o=e.offset),e.hasOwnProperty("rotation")&&(s=e.rotation),e.hasOwnProperty("scale")&&(l=e.scale),e.hasOwnProperty("model")){if(e.hasOwnProperty("type"))f=e.type,e=e.model;else{let t=c(e.model);e=t.model,f=t.type}r.push({name:e,type:f,offset:o,rotation:s,scale:l,options:t}),i(r)}else e.hasOwnProperty("blockstate")&&(f="block",Object(a.b)(e.blockstate,n).then(a=>{if(a.hasOwnProperty("variants"))if(e.hasOwnProperty("variant")){let n=function(e,t){Array.isArray(e)||(e=Object.keys(e));if(!t||""===t||0===t.length)return"";let r=u(t);for(let t=0;t{i(r)}))})}function s(e,t){return function(e,t,r){return new Promise((n,i)=>{"string"==typeof e?e.startsWith("{")&&e.endsWith("}")?n(JSON.parse(e)):e.startsWith("http")?fetch(e,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{console.log("model data:",e),n(e)}):Object(a.c)(r,"/assets/minecraft/models/"+(t||"block")+"/"+e+".json").then(e=>{n(e)}):"object"==typeof e?n(e):(console.warn("Invalid model"),i())})}(e.name,e.type,t).then(r=>(function(e,t,r){return new Promise((a,n)=>{d(e,t,[],[],r,a,n)})})(r,e.name,t)).then(t=>(console.debug(e.name+" merged:"),console.debug(t),t.hasOwnProperty("elements")||"lava"!==e.name&&"water"!==e.name||(t.elements=[{from:[0,0,0],to:[16,16,16],faces:{down:{texture:"#particle",cullface:"down"},up:{texture:"#particle",cullface:"up"},north:{texture:"#particle",cullface:"north"},south:{texture:"#particle",cullface:"south"},west:{texture:"#particle",cullface:"west"},east:{texture:"#particle",cullface:"east"}}}]),t))}function l(e){return e.type+"__"+e.name}function u(e){let t=e.split(","),r={};for(let e=0;e{let n=[],i=[],o=Object.keys(e);for(let r=0;r{let a={};for(let e=0;e=0;t--)e=i()(e,r[t]);return n.unshift(t),e.hierarchy=n,void s(e)}let u=e.parent;delete e.parent,n.push(u),Object(a.c)(o,"/assets/minecraft/models/"+u+".json").then(a=>{let i=Object.assign({},e,a);d(i,t,r,n,o,s,l)}).catch(l)};function h(e){return e*(Math.PI/180)}function p(e){Object.keys(e).forEach((function(t){delete e[t]}))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return u})),r.d(t,"e",(function(){return c})),r.d(t,"c",(function(){return f})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return h}));const a="https://assets.mcasset.cloud/1.13",n={},i={},o={},s={};function l(e,t,r,o){return new Promise((s,l)=>{!function e(t,r,o,s,l,u,c){let f="/assets/"+r+"/textures"+o+s+".png";if(n.hasOwnProperty(f))return"__invalid"===n[f]?void u():void l(n[f]);if(!i.hasOwnProperty(f)||0===i[f].length||c){let c=new XMLHttpRequest;c.open("GET",t+f,!0),c.responseType="arraybuffer",c.onloadend=function(){if(200===c.status){let e=new Uint8Array(c.response||c.responseText),t=String.fromCharCode.apply(null,e),r="data:image/png;base64,"+btoa(t);if(n[f]=r,i.hasOwnProperty(f))for(;i[f].length>0;){i[f].shift(0)[0](r)}}else if(a===t){if(n[f]="__invalid",i.hasOwnProperty(f))for(;i[f].length>0;){i[f].shift(0)[1]()}}else e(a,r,o,s,l,u,!0)},c.send(),i.hasOwnProperty(f)||(i[f]=[])}i[f].push([l,u])}(e,t,r,o,s,l)})}function u(e,t){return f(t,"/assets/minecraft/blockstates/"+e+".json")}function c(e,t){return f(t,"/assets/minecraft/textures/block/"+e+".png.mcmeta")}function f(e,t){return new Promise((r,n)=>{!function e(t,r,n,i,l){if(o.hasOwnProperty(r))return"__invalid"===o[r]?void i():void n(Object.assign({},o[r]));s.hasOwnProperty(r)&&0!==s[r].length&&!l||(console.log(t+r),fetch(t+r,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{if(console.log("json data:",e),o[r]=e,s.hasOwnProperty(r))for(;s[r].length>0;){let t=Object.assign({},e);s[r].shift(0)[0](t)}}).catch(l=>{if(console.warn(l),a===t){if(o[r]="__invalid",s.hasOwnProperty(r))for(;s[r].length>0;){s[r].shift(0)[1]()}}else e(a,r,n,i,!0)}),s.hasOwnProperty(r)||(s[r]=[]));s[r].push([n,i])}(e,t,r,n)})}function d(e,t,r){return 0===e?0:t/(r||16)*e}function h(e){let t,r,a,n=e.getContext("2d"),i=document.createElement("canvas").getContext("2d"),o=n.getImageData(0,0,e.width,e.height),s=o.data.length,l={top:null,left:null,right:null,bottom:null};for(t=0;t1)for(var r=1;rp||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,R=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),k=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,1),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var n=l.domElement===document?l.domElement.body:l.domElement;if(l.object instanceof a.PerspectiveCamera){var i=l.object.position;e.copy(i).sub(l.target);var o=e.length();o*=Math.tan(l.object.fov/2*Math.PI/180),R(2*t*o/n.clientHeight,l.object.matrix),k(2*r*o/n.clientHeight,l.object.matrix)}else l.object instanceof a.OrthographicCamera?(R(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),k(r*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object instanceof a.PerspectiveCamera?g/=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object instanceof a.PerspectiveCamera?g*=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(c),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}(e),h=d.TOUCH_DOLLY;break;case 3:if(!1===l.enablePan)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom)return;if(h!==d.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.subVectors(T,M),P.y>0?D(F()):P.y<0&&N(F()),M.copy(T),l.update()}(e);break;case 3:if(!1===l.enablePan)return;if(h!==d.TOUCH_PAN)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()}n.prototype=Object.create(a.EventDispatcher.prototype),n.prototype.constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var i=r(26),o=r(31),s=r.n(o),l=r(79),u=r.n(l),c=r(22),f=r(2);r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return m}));const d={showAxes:!1,showGrid:!1,autoResize:!1,controls:{enabled:!0,zoom:!0,rotate:!0,pan:!0,keys:!0},camera:{type:"perspective",x:20,y:35,z:20,target:[0,0,0]},canvas:{width:void 0,height:void 0},pauseHidden:!0,forceContext:!1,sendStats:!0};class h{constructor(e,t,r){this.element=r||document.body,this.options=Object.assign({},d,t,e),this.renderType="_Base_"}toImage(e,t){if(t||(t="image/png"),this._renderer){if(e){let e=document.createElement("canvas"),r=e.getContext("2d");return e.width=this._renderer.domElement.width,e.height=this._renderer.domElement.height,r.drawImage(this._renderer.domElement,0,0),Object(f.g)(e).toDataURL(t)}return this._renderer.domElement.toDataURL(t)}}toObj(){if(this._scene){return(new i.OBJExporter).parse(this._scene)}}toGLTF(e){return new Promise((t,r)=>{if(this._scene){(new i.GLTFExporter).parse(this._scene,e=>{t(e)},e)}else r()})}toPLY(e){if(this._scene){return(new i.PLYExporter).parse(this._scene,e)}}initScene(e,t){let r=this;if(console.log(" "),console.log("%c ","font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;"),console.log("MineRender/"+(r.renderType||r.constructor.name)+"/1.4.6"),console.log("PRODUCTION build"),console.log("Built @ 2021-02-01T16:10:49.105Z"),console.log(" "),r.options.sendStats){let e,t=!1;try{t=window.self!==window.top}catch(e){return!0}try{e=new URL(t?document.referrer:window.location).hostname}catch(e){console.warn("Failed to get hostname")}c.post({url:"https://minerender.org/stats.php",data:{action:"init",type:r.renderType,host:e,source:t?"iframe":"javascript"}})}let l,f=new a.Scene;r._scene=f,l="orthographic"===r.options.camera.type?new a.OrthographicCamera((r.options.canvas.width||window.innerWidth)/-2,(r.options.canvas.width||window.innerWidth)/2,(r.options.canvas.height||window.innerHeight)/2,(r.options.canvas.height||window.innerHeight)/-2,1,1e3):new a.PerspectiveCamera(75,(r.options.canvas.width||window.innerWidth)/(r.options.canvas.height||window.innerHeight),5,1e3),r._camera=l,r.options.camera.zoom&&(l.zoom=r.options.camera.zoom);let d=new a.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});r._renderer=d,d.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),d.setClearColor(0,0),d.setPixelRatio(window.devicePixelRatio),d.shadowMap.enabled=!0,d.shadowMap.type=a.PCFSoftShadowMap,r.element.appendChild(r._canvas=d.domElement);let h=new s.a(d);h.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),r._composer=h;let p=new i.SSAARenderPass(f,l);p.unbiased=!0,h.addPass(p);let m=new o.ShaderPass(o.CopyShader);m.renderToScreen=!0,h.addPass(m),r.options.autoResize&&(r._resizeListener=function(){let e=r.element&&r.element!==document.body?r.element.offsetWidth:window.innerWidth,t=r.element&&r.element!==document.body?r.element.offsetHeight:window.innerHeight;r._resize(e,t)},window.addEventListener("resize",r._resizeListener)),r._resize=function(e,t){"orthographic"===r.options.camera.type?(l.left=e/-2,l.right=e/2,l.top=t/2,l.bottom=t/-2):l.aspect=e/t,l.updateProjectionMatrix(),d.setSize(e,t),h.setSize(e,t)},r.options.showAxes&&f.add(new a.AxesHelper(50)),r.options.showGrid&&f.add(new a.GridHelper(100,100));let v=new a.AmbientLight(16777215);f.add(v);let g=new n(l,d.domElement);r._controls=g,g.enableZoom=r.options.controls.zoom,g.enableRotate=r.options.controls.rotate,g.enablePan=r.options.controls.pan,g.enableKeys=r.options.controls.keys,g.target.set(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]),l.position.x=r.options.camera.x,l.position.y=r.options.camera.y,l.position.z=r.options.camera.z,l.lookAt(new a.Vector3(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]));let y=function(){r._animId=requestAnimationFrame(y),r.onScreen&&("function"==typeof e&&e(),h.render())};r._animate=y,t||y(),r.onScreen=!0;let b="minerender-canvas-"+r._scene.uuid+"-"+Date.now();if(r._canvas.id=b,r.options.pauseHidden){r.onScreen=!1;let e=new u.a;r._onScreenObserver=e,e.on("enter","#"+b,(e,t)=>{r.onScreen=!0,r.options.forceContext&&r._renderer.forceContextRestore()}),e.on("leave","#"+b,(e,t)=>{r.onScreen=!1,r.options.forceContext&&r._renderer.forceContextLoss()})}}addToScene(e){let t=this;t._scene&&e&&(e.userData.renderType=t.renderType,t._scene.add(e))}clearScene(e,t){if(e||t)for(let r=this._scene.children.length-1;r>=0;r--){let a=this._scene.children[r];if(t){if(t(a))continue}e&&a.userData.renderType!==this.renderType||(p(a,!0),this._scene.remove(a))}else for(;this._scene.children.length>0;)this._scene.remove(this._scene.children[0])}dispose(){cancelAnimationFrame(this._animId),this._onScreenObserver&&this._onScreenObserver.destroy(),this.clearScene(),this._canvas.remove();let e=this.element;for(;e.firstChild;)e.removeChild(e.firstChild);this.options.autoResize&&window.removeEventListener("resize",this._resizeListener)}}function p(e,t){if(e&&(e.geometry&&e.geometry.dispose&&e.geometry.dispose(),e.material&&e.material.dispose&&e.material.dispose(),e.texture&&e.texture.dispose&&e.texture.dispose(),e.children)){let r=e.children;for(let e=0;e=0;t--)e.remove(r[t])}}function m(e,t){e=e.filter(e=>!!e);let r=new a.Geometry,n=[];for(let t=0;t{let o,s,l,u="block";if("string"==typeof e){let a=d(e);e=a.model,u=a.type,r.push({name:e,type:u,options:t}),i(r)}else if("object"==typeof e)if(e.hasOwnProperty("offset")&&(o=e.offset),e.hasOwnProperty("rotation")&&(s=e.rotation),e.hasOwnProperty("scale")&&(l=e.scale),e.hasOwnProperty("model")){if(e.hasOwnProperty("type"))u=e.type,e=e.model;else{let t=d(e.model);e=t.model,u=t.type}r.push({name:e,type:u,offset:o,rotation:s,scale:l,options:t}),i(r)}else e.hasOwnProperty("blockstate")&&(u="block",Object(a.b)(e.blockstate,n).then(a=>{if(a.hasOwnProperty("variants"))if(e.hasOwnProperty("variant")){let n=function(e,t){Array.isArray(e)||(e=Object.keys(e));if(!t||""===t||0===t.length)return"";let r=f(t);for(let t=0;t{i(r)}))})}function u(e,t){return function(e,t,r){return new Promise((n,i)=>{"string"==typeof e?e.startsWith("{")&&e.endsWith("}")?n(JSON.parse(e)):e.startsWith("http")?fetch(e,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{console.log("model data:",e),n(e)}):Object(a.c)(r,"/assets/minecraft/models/"+(t||"block")+"/"+e+".json").then(e=>{n(e)}):"object"==typeof e?n(e):(console.warn("Invalid model"),i())})}(e.name,e.type,t).then(r=>(function(e,t,r){return new Promise((a,n)=>{p(e,t,[],[],r,a,n)})})(r,e.name,t)).then(t=>(s(e.name+" merged:"),s(t),t.hasOwnProperty("elements")||"lava"!==e.name&&"water"!==e.name||(t.elements=[{from:[0,0,0],to:[16,16,16],faces:{down:{texture:"#particle",cullface:"down"},up:{texture:"#particle",cullface:"up"},north:{texture:"#particle",cullface:"north"},south:{texture:"#particle",cullface:"south"},west:{texture:"#particle",cullface:"west"},east:{texture:"#particle",cullface:"east"}}}]),t))}function c(e){return e.type+"__"+e.name}function f(e){let t=e.split(","),r={};for(let e=0;e{let n=[],i=[],o=Object.keys(e);for(let r=0;r{let a={};for(let e=0;e=0;t--)e=i()(e,r[t]);return n.unshift(t),e.hierarchy=n,void s(e)}let u=e.parent;delete e.parent,n.push(u),Object(a.c)(o,"/assets/minecraft/models/"+u+".json").then(a=>{let i=Object.assign({},e,a);p(i,t,r,n,o,s,l)}).catch(l)};function m(e){return e*(Math.PI/180)}function v(e){Object.keys(e).forEach((function(t){delete e[t]}))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"d",(function(){return c})),r.d(t,"b",(function(){return f})),r.d(t,"e",(function(){return d})),r.d(t,"c",(function(){return h})),r.d(t,"f",(function(){return p})),r.d(t,"g",(function(){return m}));var a=r(13);const n=a("minerender"),i="https://assets.mcasset.cloud/1.13",o={},s={},l={},u={};function c(e,t,r,a){return new Promise((n,l)=>{!function e(t,r,a,n,l,u,c){let f="/assets/"+r+"/textures"+a+n+".png";if(o.hasOwnProperty(f))return"__invalid"===o[f]?void u():void l(o[f]);if(!s.hasOwnProperty(f)||0===s[f].length||c){let c=new XMLHttpRequest;c.open("GET",t+f,!0),c.responseType="arraybuffer",c.onloadend=function(){if(200===c.status){let e=new Uint8Array(c.response||c.responseText),t=String.fromCharCode.apply(null,e),r="data:image/png;base64,"+btoa(t);if(o[f]=r,s.hasOwnProperty(f))for(;s[f].length>0;){s[f].shift(0)[0](r)}}else if(i===t){if(o[f]="__invalid",s.hasOwnProperty(f))for(;s[f].length>0;){s[f].shift(0)[1]()}}else e(i,r,a,n,l,u,!0)},c.send(),s.hasOwnProperty(f)||(s[f]=[])}s[f].push([l,u])}(e,t,r,a,n,l)})}function f(e,t){return h(t,"/assets/minecraft/blockstates/"+e+".json")}function d(e,t){return h(t,"/assets/minecraft/textures/block/"+e+".png.mcmeta")}function h(e,t){return new Promise((r,a)=>{!function e(t,r,a,o,s){if(l.hasOwnProperty(r))return"__invalid"===l[r]?void o():void a(Object.assign({},l[r]));u.hasOwnProperty(r)&&0!==u[r].length&&!s||(n(t+r),fetch(t+r,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{if(n("json data:",e),l[r]=e,u.hasOwnProperty(r))for(;u[r].length>0;){let t=Object.assign({},e);u[r].shift(0)[0](t)}}).catch(n=>{if(console.warn(n),i===t){if(l[r]="__invalid",u.hasOwnProperty(r))for(;u[r].length>0;){u[r].shift(0)[1]()}}else e(i,r,a,o,!0)}),u.hasOwnProperty(r)||(u[r]=[]));u[r].push([a,o])}(e,t,r,a)})}function p(e,t,r){return 0===e?0:t/(r||16)*e}function m(e){let t,r,a,n=e.getContext("2d"),i=document.createElement("canvas").getContext("2d"),o=n.getImageData(0,0,e.width,e.height),s=o.data.length,l={top:null,left:null,right:null,bottom:null};for(t=0;t1)for(var r=1;rp||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,R=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),k=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,1),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var n=l.domElement===document?l.domElement.body:l.domElement;if(l.object instanceof a.PerspectiveCamera){var i=l.object.position;e.copy(i).sub(l.target);var o=e.length();o*=Math.tan(l.object.fov/2*Math.PI/180),R(2*t*o/n.clientHeight,l.object.matrix),k(2*r*o/n.clientHeight,l.object.matrix)}else l.object instanceof a.OrthographicCamera?(R(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),k(r*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object instanceof a.PerspectiveCamera?g/=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object instanceof a.PerspectiveCamera?g*=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(c),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}(e),h=d.TOUCH_DOLLY;break;case 3:if(!1===l.enablePan)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom)return;if(h!==d.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.subVectors(T,M),P.y>0?D(F()):P.y<0&&N(F()),M.copy(T),l.update()}(e);break;case 3:if(!1===l.enablePan)return;if(h!==d.TOUCH_PAN)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()}n.prototype=Object.create(a.EventDispatcher.prototype),n.prototype.constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var i=r(27),o=r(32),s=r.n(o),l=r(80),u=r.n(l),c=r(23),f=r(2);r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return m}));const d={showAxes:!1,showGrid:!1,autoResize:!1,controls:{enabled:!0,zoom:!0,rotate:!0,pan:!0,keys:!0},camera:{type:"perspective",x:20,y:35,z:20,target:[0,0,0]},canvas:{width:void 0,height:void 0},pauseHidden:!0,forceContext:!1,sendStats:!0};class h{constructor(e,t,r){this.element=r||document.body,this.options=Object.assign({},d,t,e),this.renderType="_Base_"}toImage(e,t){if(t||(t="image/png"),this._renderer){if(e){let e=document.createElement("canvas"),r=e.getContext("2d");return e.width=this._renderer.domElement.width,e.height=this._renderer.domElement.height,r.drawImage(this._renderer.domElement,0,0),Object(f.g)(e).toDataURL(t)}return this._renderer.domElement.toDataURL(t)}}toObj(){if(this._scene){return(new i.OBJExporter).parse(this._scene)}}toGLTF(e){return new Promise((t,r)=>{if(this._scene){(new i.GLTFExporter).parse(this._scene,e=>{t(e)},e)}else r()})}toPLY(e){if(this._scene){return(new i.PLYExporter).parse(this._scene,e)}}initScene(e,t){let r=this;if(console.log(" "),console.log("%c ","font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;"),console.log("MineRender/"+(r.renderType||r.constructor.name)+"/1.4.7"),console.log("PRODUCTION build"),console.log("Built @ 2021-02-01T16:31:09.617Z"),console.log(" "),r.options.sendStats){let e,t=!1;try{t=window.self!==window.top}catch(e){return!0}try{e=new URL(t?document.referrer:window.location).hostname}catch(e){console.warn("Failed to get hostname")}c.post({url:"https://minerender.org/stats.php",data:{action:"init",type:r.renderType,host:e,source:t?"iframe":"javascript"}})}let l,f=new a.Scene;r._scene=f,l="orthographic"===r.options.camera.type?new a.OrthographicCamera((r.options.canvas.width||window.innerWidth)/-2,(r.options.canvas.width||window.innerWidth)/2,(r.options.canvas.height||window.innerHeight)/2,(r.options.canvas.height||window.innerHeight)/-2,1,1e3):new a.PerspectiveCamera(75,(r.options.canvas.width||window.innerWidth)/(r.options.canvas.height||window.innerHeight),5,1e3),r._camera=l,r.options.camera.zoom&&(l.zoom=r.options.camera.zoom);let d=new a.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});r._renderer=d,d.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),d.setClearColor(0,0),d.setPixelRatio(window.devicePixelRatio),d.shadowMap.enabled=!0,d.shadowMap.type=a.PCFSoftShadowMap,r.element.appendChild(r._canvas=d.domElement);let h=new s.a(d);h.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),r._composer=h;let p=new i.SSAARenderPass(f,l);p.unbiased=!0,h.addPass(p);let m=new o.ShaderPass(o.CopyShader);m.renderToScreen=!0,h.addPass(m),r.options.autoResize&&(r._resizeListener=function(){let e=r.element&&r.element!==document.body?r.element.offsetWidth:window.innerWidth,t=r.element&&r.element!==document.body?r.element.offsetHeight:window.innerHeight;r._resize(e,t)},window.addEventListener("resize",r._resizeListener)),r._resize=function(e,t){"orthographic"===r.options.camera.type?(l.left=e/-2,l.right=e/2,l.top=t/2,l.bottom=t/-2):l.aspect=e/t,l.updateProjectionMatrix(),d.setSize(e,t),h.setSize(e,t)},r.options.showAxes&&f.add(new a.AxesHelper(50)),r.options.showGrid&&f.add(new a.GridHelper(100,100));let v=new a.AmbientLight(16777215);f.add(v);let g=new n(l,d.domElement);r._controls=g,g.enableZoom=r.options.controls.zoom,g.enableRotate=r.options.controls.rotate,g.enablePan=r.options.controls.pan,g.enableKeys=r.options.controls.keys,g.target.set(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]),l.position.x=r.options.camera.x,l.position.y=r.options.camera.y,l.position.z=r.options.camera.z,l.lookAt(new a.Vector3(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]));let y=function(){r._animId=requestAnimationFrame(y),r.onScreen&&("function"==typeof e&&e(),h.render())};r._animate=y,t||y(),r.onScreen=!0;let b="minerender-canvas-"+r._scene.uuid+"-"+Date.now();if(r._canvas.id=b,r.options.pauseHidden){r.onScreen=!1;let e=new u.a;r._onScreenObserver=e,e.on("enter","#"+b,(e,t)=>{r.onScreen=!0,r.options.forceContext&&r._renderer.forceContextRestore()}),e.on("leave","#"+b,(e,t)=>{r.onScreen=!1,r.options.forceContext&&r._renderer.forceContextLoss()})}}addToScene(e){let t=this;t._scene&&e&&(e.userData.renderType=t.renderType,t._scene.add(e))}clearScene(e,t){if(e||t)for(let r=this._scene.children.length-1;r>=0;r--){let a=this._scene.children[r];if(t){if(t(a))continue}e&&a.userData.renderType!==this.renderType||(p(a,!0),this._scene.remove(a))}else for(;this._scene.children.length>0;)this._scene.remove(this._scene.children[0])}dispose(){cancelAnimationFrame(this._animId),this._onScreenObserver&&this._onScreenObserver.destroy(),this.clearScene(),this._canvas.remove();let e=this.element;for(;e.firstChild;)e.removeChild(e.firstChild);this.options.autoResize&&window.removeEventListener("resize",this._resizeListener)}}function p(e,t){if(e&&(e.geometry&&e.geometry.dispose&&e.geometry.dispose(),e.material&&e.material.dispose&&e.material.dispose(),e.texture&&e.texture.dispose&&e.texture.dispose(),e.children)){let r=e.children;for(let e=0;e=0;t--)e.remove(r[t])}}function m(e,t){e=e.filter(e=>!!e);let r=new a.Geometry,n=[];for(let t=0;t * @license MIT */ -var a=r(104),n=r(105),i=r(56);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(a)return V(e).length;t=(""+t).toLowerCase(),a=!0}}function m(e,t,r){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function v(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function g(e,t,r,a,n){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,a)),l.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,n);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,a,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,a,n){var i,o=1,s=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,d=0;dn&&(a=n):a=n;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");a>i/2&&(a=i/2);for(var o=0;o>8,n=r%256,i.push(n),i.push(a);return i}(t,e.length-r),e,r,a)}function S(e,t,r){return 0===t&&r===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[n+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[n+1],o=e[n+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[n+1],o=e[n+2],s=e[n+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),n+=f}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var r="",a=0;for(;a0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,a,n){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(a>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(i,o),u=this.slice(a,n),c=e.slice(t,r),f=0;fn)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;na)&&(r=a);for(var n="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,a,n,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function k(e,t,r,a){t<0&&(t=65535+t+1);for(var n=0,i=Math.min(e.length-r,2);n>>8*(a?n:1-n)}function I(e,t,r,a){t<0&&(t=4294967295+t+1);for(var n=0,i=Math.min(e.length-r,4);n>>8*(a?n:3-n)&255}function N(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,a,i){return i||N(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function U(e,t,r,a,i){return i||N(e,0,r,8),n.write(e,t,r,a,52,8),r+8}l.prototype.slice=function(e,t){var r,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t0&&(n*=256);)a+=this[e+--t]*n;return a},l.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=this[e],n=1,i=0;++i=(n*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=t,n=1,i=this[e+--a];a>0&&(n*=256);)i+=this[e+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,a){(e=+e,t|=0,r|=0,a)||R(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+n]=e/i&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,a){if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return a.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,a){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,r(4))},function(e,t,r){"use strict";t.a={bars:{pink_empty:{uv:[0,0,182,5]},pink_full:{uv:[0,5,182,10]},cyan_empty:{uv:[0,10,182,15]},cyan_full:{uv:[0,15,182,20]},orange_empty:{uv:[0,20,182,25]},orange_full:{uv:[0,25,182,30]},green_empty:{uv:[0,30,182,35]},green_full:{uv:[0,35,182,40]},yellow_empty:{uv:[0,40,182,45]},yellow_full:{uv:[0,45,182,50]},purple_empty:{uv:[0,50,182,55]},purple_full:{uv:[0,55,182,60]},white_empty:{uv:[0,60,182,65]},white_full:{uv:[0,65,182,70]}},book:{base:{uv:[0,0,192,192]},button_next:{uv:[0,192,23,205],pos:[120,156]},button_next_hover:{uv:[23,192,46,205],pos:[120,156]},button_prev:{uv:[0,205,23,218],pos:[38,156]},button_prev_hover:{uv:[23,205,46,218],pos:[38,156]}},container:{generic_54:{uv:[0,0,176,222],top_origin:[8,18],item_offset:[18,18]},crafting_table:{uv:[0,0,176,166],left_origin:[30,17],right_origin:[124,35],item_offset:[18,18]}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;rn(e,t))}class s extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e,Error.captureStackTrace(this,this.constructor.name)}}e.exports={getField:r,getFieldInfo:a,addErrorField:n,getCount:function(e,t,{count:n,countType:i},s){let l=0,u=0;return"number"==typeof n?l=n:void 0!==n?l=r(n,s):void 0!==i?({size:u,value:l}=o(()=>this.read(e,t,a(i),s),"$count")):l=0,{count:l,size:u}},sendCount:function(e,t,r,{count:n,countType:i},o){return void 0!==n&&e!==n||void 0!==i&&(r=this.write(e,t,r,a(i),o)),r},calcCount:function(e,{count:t,countType:r},n){return void 0===t&&void 0!==r?o(()=>this.sizeOf(e,a(r),n),"$count"):0},tryCatch:i,tryDoc:o,PartialReadError:class extends s{constructor(e){super(e),this.partialReadError=!0}}}},function(e,t,r){"use strict";function a(e,t,r){var a=r?" !== ":" === ",n=r?" || ":" && ",i=r?"!":"",o=r?"":"!";switch(e){case"null":return t+a+"null";case"array":return i+"Array.isArray("+t+")";case"object":return"("+i+t+n+"typeof "+t+a+'"object"'+n+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+a+'"number"'+n+o+"("+t+" % 1)"+n+t+a+t+")";default:return"typeof "+t+a+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:a,checkDataTypes:function(e,t){switch(e.length){case 1:return a(e[0],t,!0);default:var r="",n=i(e);for(var o in n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)r+=(r?" && ":"")+a(o,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],a=0;a=t)throw new Error("Cannot access property/index "+a+" levels up, current level is "+t);return r[t-a]}if(a>t)throw new Error("Cannot access data "+a+" levels up, current level is "+t);if(i="data"+(t-a||""),!n)return i}for(var s=i,u=n.split("/"),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,n,o,s;if("string"==typeof t&&(n="not ",t.substr(!o||o<0?0:+o,n.length)===n)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(a," ").concat(i(t,"type"));else{var l=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(a," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var n=r(72),i=r(76);r(6)(u,n);for(var o=a(i.prototype),s=0;s{i=!0,o.needsUpdate=!0,s&&(s.needsUpdate=!0);let c=-1;32===o.image.height?c=0:64===o.image.height?c=1:console.error("Couldn't detect texture version. Invalid dimensions: "+o.image.width+"x"+o.image.height),console.log("Skin Texture Version: "+c),o.magFilter=a.NearestFilter,o.minFilter=a.NearestFilter,o.anisotropy=0,s&&(s.magFilter=a.NearestFilter,s.minFilter=a.NearestFilter,s.anisotropy=0,s.format=a.RGBFormat),32===o.image.height&&(o.format=a.RGBFormat),r.attached||r._scene?console.log("[SkinRender] is attached - skipping scene init"):super.initScene((function(){r.element.dispatchEvent(new CustomEvent("skinRender",{detail:{playerModel:r.playerModel}}))})),console.log("Slim: "+f);let d=function(e,t,r,i,o){console.log("capeType: "+o);let s=new a.Object3D;s.name="headGroup",s.position.x=0,s.position.y=28,s.position.z=0,s.translateOnAxis(new a.Vector3(0,1,0),-4);let c=l(e,8,8,8,n.a.head[r],i,"head");if(c.translateOnAxis(new a.Vector3(0,1,0),4),s.add(c),r>=1){let t=l(e,8.504,8.504,8.504,n.a.hat,i,"hat",!0);t.translateOnAxis(new a.Vector3(0,1,0),4),s.add(t)}let f=new a.Object3D;f.name="bodyGroup",f.position.x=0,f.position.y=18,f.position.z=0;let d=l(e,8,12,4,n.a.body[r],i,"body");if(f.add(d),r>=1){let t=l(e,8.504,12.504,4.504,n.a.jacket,i,"jacket",!0);f.add(t)}let h=new a.Object3D;h.name="leftArmGroup",h.position.x=i?-5.5:-6,h.position.y=18,h.position.z=0,h.translateOnAxis(new a.Vector3(0,1,0),4);let p=l(e,i?3:4,12,4,n.a.leftArm[r],i,"leftArm");if(p.translateOnAxis(new a.Vector3(0,1,0),-4),h.add(p),r>=1){let t=l(e,i?3.504:4.504,12.504,4.504,n.a.leftSleeve,i,"leftSleeve",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),h.add(t)}let m=new a.Object3D;m.name="rightArmGroup",m.position.x=i?5.5:6,m.position.y=18,m.position.z=0,m.translateOnAxis(new a.Vector3(0,1,0),4);let v=l(e,i?3:4,12,4,n.a.rightArm[r],i,"rightArm");if(v.translateOnAxis(new a.Vector3(0,1,0),-4),m.add(v),r>=1){let t=l(e,i?3.504:4.504,12.504,4.504,n.a.rightSleeve,i,"rightSleeve",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),m.add(t)}let g=new a.Object3D;g.name="leftLegGroup",g.position.x=-2,g.position.y=6,g.position.z=0,g.translateOnAxis(new a.Vector3(0,1,0),4);let y=l(e,4,12,4,n.a.leftLeg[r],i,"leftLeg");if(y.translateOnAxis(new a.Vector3(0,1,0),-4),g.add(y),r>=1){let t=l(e,4.504,12.504,4.504,n.a.leftTrousers,i,"leftTrousers",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),g.add(t)}let b=new a.Object3D;b.name="rightLegGroup",b.position.x=2,b.position.y=6,b.position.z=0,b.translateOnAxis(new a.Vector3(0,1,0),4);let w=l(e,4,12,4,n.a.rightLeg[r],i,"rightLeg");if(w.translateOnAxis(new a.Vector3(0,1,0),-4),b.add(w),r>=1){let t=l(e,4.504,12.504,4.504,n.a.rightTrousers,i,"rightTrousers",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),b.add(t)}let x=new a.Object3D;if(x.add(s),x.add(f),x.add(h),x.add(m),x.add(g),x.add(b),t){console.log(n.a);let e=n.a.capeRelative;"optifine"===o&&(e=n.a.capeOptifineRelative),"labymod"===o&&(e=n.a.capeLabymodRelative),e=JSON.parse(JSON.stringify(e)),console.log(e);for(let r in e)e[r].x*=t.image.width,e[r].w*=t.image.width,e[r].y*=t.image.height,e[r].h*=t.image.height;console.log(e);let r=new a.Object3D;r.name="capeGroup",r.position.x=0,r.position.y=16,r.position.z=-2.5,r.translateOnAxis(new a.Vector3(0,1,0),8),r.translateOnAxis(new a.Vector3(0,0,1),.5);let i=l(t,10,16,1,e,!1,"cape");i.rotation.x=u(10),i.translateOnAxis(new a.Vector3(0,1,0),-8),i.translateOnAxis(new a.Vector3(0,0,1),-.5),i.rotation.y=u(180),r.add(i),x.add(r)}return x}(o,s,c,f,e._capeType?e._capeType:e.optifine?"optifine":"minecraft");r.addToScene(d),r.playerModel=d,"function"==typeof t&&t()};r._skinImage=new Image,r._skinImage.crossOrigin="anonymous",r._capeImage=new Image,r._capeImage.crossOrigin="anonymous";let s=void 0!==e.cape||void 0!==e.capeUrl||void 0!==e.capeData||void 0!==e.mineskin,f=!1,d=!1,h=!1,p=new a.Texture,m=new a.Texture;if(p.image=r._skinImage,r._skinImage.onload=function(){if(r._skinImage){if(d=!0,console.log("Skin Image Loaded"),void 0===e.slim&&32!==r._skinImage.height){let e=document.createElement("canvas"),t=e.getContext("2d");e.width=r._skinImage.width,e.height=r._skinImage.height,t.drawImage(r._skinImage,0,0),console.log("Slim Detection:");let a=t.getImageData(46,52,1,12).data,n=t.getImageData(54,20,1,12).data,i=!0;for(let e=3;e<48;e+=4){if(255===a[e]){i=!1;break}if(255===n[e]){i=!1;break}}console.log(i),i&&(f=!0)}if(r.options.makeNonTransparentOpaque&&32!==r._skinImage.height){let e=document.createElement("canvas"),n=e.getContext("2d");e.width=r._skinImage.width,e.height=r._skinImage.height,n.drawImage(r._skinImage,0,0);let i=document.createElement("canvas"),o=i.getContext("2d");i.width=r._skinImage.width,i.height=r._skinImage.height;let s=n.getImageData(0,0,e.width,e.height),l=s.data;function t(e,t){return e>0&&t>0&&e<32&&t<32||(e>32&&t>16&&e<64&&t<32||e>16&&t>48&&e<48&&t<64)}for(let r=0;r178||t(n,i))&&(l[r+3]=255)}o.putImageData(s,0,0),console.log(i.toDataURL()),p=new a.CanvasTexture(i)}!d||!h&&s||i||o(p,m)}},r._skinImage.onerror=function(e){console.warn("Skin Image Error"),console.warn(e)},console.log("Has Cape: "+s),s?(m.image=r._capeImage,r._capeImage.onload=function(){r._capeImage&&(h=!0,console.log("Cape Image Loaded"),h&&d&&(i||o(p,m)))},r._capeImage.onerror=function(e){console.warn("Cape Image Error"),console.warn(e),h=!0,d&&(i||o(p))}):(m=null,r._capeImage=null),"string"==typeof e)0===e.indexOf("http")?r._skinImage.src=e:e.length<=16?c("https://minerender.org/nameToUuid.php?name="+e,(function(t,a){if(t)return console.log(t);console.log(a),r._skinImage.src="https://crafatar.com/skins/"+(a.id?a.id:e)})):e.length<=36?image.src="https://crafatar.com/skins/"+e+"?overlay":r._skinImage.src=e;else{if("object"!=typeof e)throw new Error("Invalid texture value");if(e.url?r._skinImage.src=e.url:e.data?r._skinImage.src=e.data:e.username?c("https://minerender.org/nameToUuid.php?name="+e.username,(function(t,a){if(t)return console.log(t);r._skinImage.src="https://crafatar.com/skins/"+(a.id?a.id:e.username)+"?overlay"})):e.uuid?r._skinImage.src="https://crafatar.com/skins/"+e.uuid+"?overlay":e.mineskin&&(r._skinImage.src="https://api.mineskin.org/render/texture/"+e.mineskin),e.cape)if(e.cape.length>36){c(e.cape.startsWith("http")?e.cape:"https://api.capes.dev/get/"+e.cape,(function(t,a){if(t)return console.log(t);a.exists&&(e._capeType=a.type,r._capeImage.src=a.imageUrls.base.full)}))}else{let t="https://api.capes.dev/load/";e.capeUser?t+=e.capeUser:e.username?t+=e.username:e.uuid?t+=e.uuid:console.warn("Couldn't find a user to get a cape from"),c(t+="/"+e.cape,(function(t,a){if(t)return console.log(t);a.exists&&(e._capeType=a.type,r._capeImage.src=a.imageUrls.base.full)}))}else e.capeUrl?r._capeImage.src=e.capeUrl:e.capeData?r._capeImage.src=e.capeData:e.mineskin&&(r._capeImage.src="https://api.mineskin.org/render/texture/"+e.mineskin+"/cape");f=e.slim}}resize(e,t){return this._resize(e,t)}reset(){this._skinImage=null,this._capeImage=null,this._animId&&cancelAnimationFrame(this._animId),this._canvas&&this._canvas.remove()}getPlayerModel(){return this.playerModel}getModelByName(e){return this._scene.getObjectByName(e,!0)}toggleSkinPart(e,t){this._scene.getObjectByName(e,!0).visible=t}}function l(e,t,r,n,i,o,s,l){let u=e.image.width,c=e.image.height,f=new a.BoxGeometry(t,r,n),d=new a.MeshBasicMaterial({map:e,transparent:l||!1,alphaTest:.1,side:l?a.DoubleSide:a.FrontSide});f.computeBoundingBox(),f.faceVertexUvs[0]=[];let h=["right","left","top","bottom","front","back"],p=[];for(let e=0;e0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function f(){for(var e=[],t=0;t0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=n[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=m(l,u);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;a--)this.removeListener(e,t[a]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(8).Buffer)},function(e){e.exports=JSON.parse('{"i8":{"enum":["i8"]},"u8":{"enum":["u8"]},"i16":{"enum":["i16"]},"u16":{"enum":["u16"]},"i32":{"enum":["i32"]},"u32":{"enum":["u32"]},"f32":{"enum":["f32"]},"f64":{"enum":["f64"]},"li8":{"enum":["li8"]},"lu8":{"enum":["lu8"]},"li16":{"enum":["li16"]},"lu16":{"enum":["lu16"]},"li32":{"enum":["li32"]},"lu32":{"enum":["lu32"]},"lf32":{"enum":["lf32"]},"lf64":{"enum":["lf64"]},"i64":{"enum":["i64"]},"li64":{"enum":["li64"]},"u64":{"enum":["u64"]},"lu64":{"enum":["lu64"]}}')},function(e,t){e.exports=jQuery},function(e,t,r){"use strict";var a=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?c((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function o(e,t,r){return e.concat(t).map((function(e){return i(e,r)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function l(e,t){try{return t in e}catch(e){return!1}}function u(e,t,r){var a={};return r.isMergeableObject(e)&&s(e).forEach((function(t){a[t]=i(e[t],r)})),s(t).forEach((function(n){(function(e,t){return l(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,n)||(l(e,n)&&r.isMergeableObject(t[n])?a[n]=function(e,t){if(!t.customMerge)return c;var r=t.customMerge(e);return"function"==typeof r?r:c}(n,r)(e[n],t[n],r):a[n]=i(t[n],r))})),a}function c(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||a,r.cloneUnlessOtherwiseSpecified=i;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):u(e,t,r):i(t,r)}c.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return c(e,r,t)}),{})};var f=c;e.exports=f},function(e,t,r){"use strict";(function(e){var a=r(0),n=r(7),i=r(2),o=r(9),s=r(80);r(25);let l={controls:{enabled:!0,zoom:!0,rotate:!1,pan:!0},camera:{type:"perspective",x:0,y:0,z:50,target:[0,0,0]},assetRoot:i.a};class u extends n.b{constructor(e,t){super(e,l,t),this.renderType="GuiRender",this.gui=null,this.attached=!1}render(e,t){let r=this;r.attached||r._scene?console.log("[GuiRender] is attached - skipping scene init"):(super.initScene((function(){r.element.dispatchEvent(new CustomEvent("guiRender",{detail:{gui:r.gui}}))})),r._controls.target.set(0,0,0),r._camera.lookAt(new a.Vector3(0,0,0)));let n=[];for(let t=0;t{let s=e[t];"string"==typeof s&&(s={texture:s}),s.textureScale||(s.textureScale=1),Object(i.d)(r.options.assetRoot,"minecraft","",s.texture).then(e=>{let t=function(e){let t=(new a.TextureLoader).load(e,(function(){t.magFilter=a.NearestFilter,t.minFilter=a.NearestFilter,t.anisotropy=0,t.needsUpdate=!0;let e=new a.MeshBasicMaterial({map:t,transparent:!0,side:a.DoubleSide,alphaTest:.5});e.userData.layer=s,n(e)}))};if(s.uv){s.uv=[s.uv[0]*s.textureScale,s.uv[1]*s.textureScale,s.uv[2]*s.textureScale,s.uv[3]*s.textureScale];let r=new Image;r.onload=function(){let e=document.createElement("canvas");e.width=s.uv[2]-s.uv[0],e.height=s.uv[3]-s.uv[1],e.getContext("2d").drawImage(r,s.uv[0],s.uv[1],s.uv[2]-s.uv[0],s.uv[3]-s.uv[1],0,0,s.uv[2]-s.uv[0],s.uv[3]-s.uv[1]),t(e.toDataURL("image/png"))},r.crossOrigin="anonymous",r.src=e}else t(e)})}));Promise.all(n).then(e=>{let n=new a.Object3D,i=0,o=0;for(let t=0;ti&&(i=f),d>o&&(o=d);let h=new a.PlaneGeometry(f,d),p=new a.Mesh(h,s);if(p.name=s.userData.layer.texture.toLowerCase()+(s.userData.layer.name?"_"+s.userData.layer.name.toLowerCase():""),p.position.set(0,0,0),p.applyMatrix((new a.Matrix4).makeTranslation(f/2,d/2,0)),s.userData.layer.pos?p.applyMatrix((new a.Matrix4).makeTranslation(s.userData.layer.pos[0],-d-s.userData.layer.pos[1],0)):p.applyMatrix((new a.Matrix4).makeTranslation(0,-d,0)),s.userData.layer.layer&&(p.layers.set(s.userData.layer.layer),r._camera.layers.enable(s.userData.layer.layer)),n.add(p),r.options.showOutlines){let e=new a.BoxHelper(p,16711680);n.add(e),s.userData.layer.layer&&e.layers.set(s.userData.layer.layer)}}n.applyMatrix((new a.Matrix4).makeTranslation(-i/2,o/2,0)),r.addToScene(n),r.gui=n,r.attached||(r._camera.position.set(0,0,Math.max(i,o)),r._camera.fov=2*Math.atan(Math.max(i,o)/(2*Math.max(i,o)))*(180/Math.PI),r._camera.updateProjectionMatrix()),"function"==typeof t&&t()})}}u.Positions=o.a,u.Helper=s.a,"undefined"!=typeof window&&(window.GuiRender=u),void 0!==e&&(e.GuiRender=u),t.a=u}).call(this,r(4))},function(e,t,r){"use strict";(function(e){var a=r(0),n=(r(22),r(23),r(7)),i=r(2),o=r(46),s=r(32),l=r(1),u=r(33),c=r.n(u);r(18),r(183);r(87)(a);const f=184;String.prototype.replaceAll=function(e,t){return this.replace(new RegExp(e,"g"),t)};const d=[16711680,65535,255,128,16711935,8388736,8421376,65280,32768,16776960,8388608,32896],h=["east","west","up","down","south","north"],p=["lightgreen"],m={},v={},g={},y={},b={},w={},x={},_={},A=[];let E={camera:{type:"perspective",x:35,y:25,z:20,target:[0,0,0]},type:"block",centerCubes:!1,assetRoot:i.a,useWebWorkers:!1};class S extends n.b{constructor(e,t){super(e,E,t),this.renderType="ModelRender",this.models=[],this.instancePositionMap={},this.attached=!1}render(e,t){let r=this;r.attached||r._scene?console.log("[ModelRender] is attached - skipping scene init"):super.initScene((function(){for(let e=0;e{if(e.options.useWebWorkers){let a=c()(f);a.addEventListener("message",e=>{r.push(...e.data.parsedModelList),t()}),a.postMessage({func:"parseModel",model:i,modelOptions:i,parsedModelList:r,assetRoot:e.options.assetRoot})}else Object(l.e)(i,i,r,e.options.assetRoot).then(()=>{t()})}))}return Promise.all(a)})(r,e,n).then(()=>(function(e,t){console.timeEnd("parseModels"),console.time("loadAndMergeModels");let r=[];console.log("Loading Model JSON data & merging...");let a={};for(let e=0;e{let a=n[t],i=Object(l.d)(a);if(console.debug("loadAndMerge "+i),m.hasOwnProperty(i))r();else if(e.options.useWebWorkers){let t=c()(f);t.addEventListener("message",e=>{m[i]=e.data.mergedModel,r()}),t.postMessage({func:"loadAndMergeModel",model:a,assetRoot:e.options.assetRoot})}else Object(l.b)(a,e.options.assetRoot).then(e=>{m[i]=e,r()})}));return Promise.all(r)})(r,n)).then(()=>(function(e,t){console.timeEnd("loadAndMergeModels"),console.time("loadModelTextures");let r=[];console.log("Loading Textures...");let a={};for(let e=0;e{let a=n[t],i=Object(l.d)(a);console.debug("loadTexture "+i);let o=m[i];if(v.hasOwnProperty(i))r();else{if(!o)return console.warn("Missing merged model"),console.warn(a.name),void r();if(!o.textures)return console.warn("The model doesn't have any textures!"),console.warn("Please make sure you're using the proper file."),console.warn(a.name),void r();if(e.options.useWebWorkers){let t=c()(f);t.addEventListener("message",e=>{v[i]=e.data.textures,r()}),t.postMessage({func:"loadTextures",textures:o.textures,assetRoot:e.options.assetRoot})}else Object(l.c)(o.textures,e.options.assetRoot).then(e=>{v[i]=e,r()})}}));return Promise.all(r)})(r,n)).then(()=>(function(e,t){console.timeEnd("loadModelTextures"),console.time("doModelRender"),console.log("Rendering Models...");let r=[];for(let n=0;n{let i=t[n],o=m[Object(l.d)(i)],s=v[Object(l.d)(i)],u=i.offset||[0,0,0],c=i.rotation||[0,0,0],f=i.scale||[1,1,1];if(i.options.hasOwnProperty("display")&&o.hasOwnProperty("display")&&o.display.hasOwnProperty(i.options.display)){let e=o.display[i.options.display];e.hasOwnProperty("translation")&&(u=[u[0]+e.translation[0],u[1]+e.translation[1],u[2]+e.translation[2]]),e.hasOwnProperty("rotation")&&(c=[c[0]+e.rotation[0],c[1]+e.rotation[1],c[2]+e.rotation[2]]),e.hasOwnProperty("scale")&&(f=[e.scale[0],e.scale[1],e.scale[2]])}M(e,o,s,o.textures,i.type,i.name,i.variant,u,c,f).then(t=>{if(t.firstInstance){let r=new a.Object3D;r.add(t.mesh),e.models.push(r),e.addToScene(r)}r(t)})}));return Promise.all(r)})(r,n)).then(e=>{console.timeEnd("doModelRender"),console.debug(e),"function"==typeof t&&t()})}}let M=function(e,t,r,i,o,s,u,c,f,d){return new Promise(h=>{if(t.hasOwnProperty("elements")){let p=Object(l.d)({type:o,name:s,variant:u}),m=g[p],v=function(t,r){t.userData.modelType=o,t.userData.modelName=s;let n=new a.Vector3,i=new a.Vector3,u=new a.Quaternion,m={key:p,index:r,offset:c,scale:d,rotation:f};f&&t.setQuaternionAt(r,u.setFromEuler(new a.Euler(Object(l.f)(f[0]),Object(l.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(l.f)(f[2])))),c&&(t.setPositionAt(r,n.set(c[0],c[1],c[2])),e.instancePositionMap[c[0]+"_"+c[1]+"_"+c[2]]=m),d&&t.setScaleAt(r,i.set(d[0],d[1],d[2])),t.needsUpdate(),h({mesh:t,firstInstance:0===r})},y=function(e,t){let r;if(e.translate(-8,-8,-8),_.hasOwnProperty(p))console.debug("Using cached instance ("+p+")"),r=_[p];else{console.debug("Caching new model instance "+p+" (with "+m+" instances)");let n=new a.InstancedMesh(e,t,m,!1,!1,!1);r={instance:n,index:0},_[p]=r;let i=new a.Vector3,o=new a.Vector3(1,1,1),s=new a.Quaternion;for(let e=0;e{let n=s.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_"+(o.__comment?o.__comment.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_":"");O(o.to[0]-o.from[0],o.to[1]-o.from[1],o.to[2]-o.from[2],n+Date.now(),o.faces,u,r,i,e.options.assetRoot,n).then(e=>{e.applyMatrix((new a.Matrix4).makeTranslation((o.to[0]-o.from[0])/2,(o.to[1]-o.from[1])/2,(o.to[2]-o.from[2])/2)),e.applyMatrix((new a.Matrix4).makeTranslation(o.from[0],o.from[1],o.from[2])),o.rotation&&L(e,new a.Vector3(o.rotation.origin[0],o.rotation.origin[1],o.rotation.origin[2]),new a.Vector3("x"===o.rotation.axis?1:0,"y"===o.rotation.axis?1:0,"z"===o.rotation.axis?1:0),Object(l.f)(o.rotation.angle)),t(e)})}))}Promise.all(b).then(e=>{let t=Object(n.c)(e,!0);t.sourceSize=e.length,y(t.geometry,t.materials,e.length);for(let t=0;t{c&&e.applyMatrix((new a.Matrix4).makeTranslation(c[0],c[1],c[2])),f&&e.rotation.set(Object(l.f)(f[0]),Object(l.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(l.f)(f[2])),d&&e.scale.set(d[0],d[1],d[2]),h({mesh:e,firstInstance:!0})})})};function T(e,t,r,n){let i=_[e];if(i&&i.instance){let e,o=i.instance;e=n?t||[1,1,1]:[0,0,0];let s=new a.Vector3;return o.setScaleAt(r,s.set(e[0],e[1],e[2])),o}}function P(e,t){let r={};for(let a of e){let e=this.instancePositionMap[a[0]+"_"+a[1]+"_"+a[2]];if(e){let a=T(e.key,e.scale,e.index,t);a&&(r[e.key]=a)}}for(let e of Object.values(r))e.needsUpdate()}S.prototype.setVisibilityAtMulti=P,S.prototype.setVisibilityAt=function(e,t,r,a){P([[e,t,r]],a)},S.prototype.setVisibilityOfType=function(e,t,r,a){let n=_[Object(l.d)({type:e,name:t,variant:r})];if(n&&n.instance){n.instance.visible=a}};let F=function(e,t){return new Promise(r=>{let n=function(t,n,i){let o=new a.PlaneGeometry(n,i),s=new a.Mesh(o,t);s.name=e,s.receiveShadow=!0,r(s)};if(t){let r=0,i=0,o=[];for(let e in t)t.hasOwnProperty(e)&&o.push(new Promise(a=>{let n=new Image;n.onload=function(){n.width>r&&(r=n.width),n.height>i&&(i=n.height),a(n)},n.src=t[e]}));Promise.all(o).then(t=>{let o=document.createElement("canvas");o.width=r,o.height=i;let l=o.getContext("2d");for(let e=0;e{let _,E=e+"_"+t+"_"+r;x.hasOwnProperty(E)?(console.debug("Using cached Geometry ("+E+")"),_=x[E]):(_=new a.BoxGeometry(e,t,r),console.debug("Caching Geometry "+E),x[E]=_);let S=function(e){let t=new a.Mesh(_,e);t.name=n,t.receiveShadow=!0,g(t)};if(c){let e=[];for(let t=0;t<6;t++)e.push(new Promise(e=>{let r=h[t];if(!o.hasOwnProperty(r))return void e(null);let d=o[r],g=d.texture.substr(1);if(!c.hasOwnProperty(g)||!c[g])return console.warn("Missing texture '"+g+"' for face "+r+" in model "+n),void e(null);let x=g+"_"+r+"_"+v,_=t=>{let o=function(t){let i=t.dataUrl,o=t.dataUrlHash,s=t.hasTransparency;if(w.hasOwnProperty(o))return console.debug("Using cached Material ("+o+", without meta)"),void e(w[o]);let u=f[g];u.startsWith("#")&&(u=f[n.substr(1)]),console.debug("Pre-Caching Material "+o+", without meta"),w[o]=new a.MeshBasicMaterial({map:null,transparent:s,side:s?a.DoubleSide:a.FrontSide,alphaTest:.5,name:r+"_"+g+"_"+u});let c=function(t){console.debug("Finalizing Cached Material "+o+", without meta"),w[o].map=t,w[o].needsUpdate=!0,e(w[o])};if(y.hasOwnProperty(o))return console.debug("Using cached Texture ("+o+")"),void c(y[o]);console.debug("Pre-Caching Texture "+o),y[o]=(new a.TextureLoader).load(i,(function(e){e.magFilter=a.NearestFilter,e.minFilter=a.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,d.hasOwnProperty("rotation")&&(e.center.x=.5,e.center.y=.5,e.rotation=Object(l.f)(d.rotation)),console.debug("Caching Texture "+o),y[o]=e,c(e)}))};if(t.height>t.width&&t.height%t.width==0){let r=f[g];r.startsWith("#")&&(r=f[r.substr(1)]),-1!==r.indexOf("/")&&(r=r.substr(r.indexOf("/")+1)),Object(i.e)(r,m).then(r=>{!function(t,r){let n=t.dataUrlHash,i=t.hasTransparency;if(w.hasOwnProperty(n))return console.debug("Using cached Material ("+n+", with meta)"),void e(w[n]);console.debug("Pre-Caching Material "+n+", with meta"),w[n]=new a.MeshBasicMaterial({map:null,transparent:i,side:i?a.DoubleSide:a.FrontSide,alphaTest:.5});let o=1;r.hasOwnProperty("animation")&&r.animation.hasOwnProperty("frametime")&&(o=r.animation.frametime);let l=Math.floor(t.height/t.width);console.log("Generating animated texture...");let u=[];for(let e=0;e{let n=document.createElement("canvas");n.width=t.width,n.height=t.width,n.getContext("2d").drawImage(t.canvas,0,e*t.width,t.width,t.width,0,0,t.width,t.width);let i=n.toDataURL("image/png"),o=s(i);if(y.hasOwnProperty(o))return console.debug("Using cached Texture ("+o+")"),void r(y[o]);console.debug("Pre-Caching Texture "+o),y[o]=(new a.TextureLoader).load(i,(function(e){e.magFilter=a.NearestFilter,e.minFilter=a.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,console.debug("Caching Texture "+o+", without meta"),y[o]=e,r(e)}))}));Promise.all(u).then(t=>{let r=0,a=0;A.push(()=>{r>=o&&(r=0,w[n].map=t[a],a++),a>=t.length&&(a=0),r+=.1}),console.debug("Finalizing Cached Material "+n+", with meta"),w[n].map=t[0],w[n].needsUpdate=!0,e(w[n])})}(t,r)}).catch(()=>{o(t)})}else o(t)};if(b.hasOwnProperty(x)){let e=b[x];if(e.hasOwnProperty("img")){console.debug("Waiting for canvas image that's already loading ("+x+")"),e.img.waitingForCanvas.push((function(e){_(e)}))}else console.debug("Using cached canvas ("+x+")"),_(b[x])}else{let t=new Image;t.onerror=function(t){console.warn(t),e(null)},t.waitingForCanvas=[],t.onload=function(){let e=(e=>{let t=d.uv;t||(t=u[r].uv),t=[Object(i.f)(t[0],e.width),Object(i.f)(t[1],e.height),Object(i.f)(t[2],e.width),Object(i.f)(t[3],e.height)];let a=document.createElement("canvas");a.width=Math.abs(t[2]-t[0]),a.height=Math.abs(t[3]-t[1]);let n,o=a.getContext("2d");o.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),a.width,a.height,0,0,a.width,a.height),d.hasOwnProperty("tintindex")?n=p[d.tintindex]:v.startsWith("water_")&&(n="blue"),n&&(o.fillStyle=n,o.globalCompositeOperation="multiply",o.fillRect(0,0,a.width,a.height),o.globalAlpha=1,o.globalCompositeOperation="destination-in",o.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),a.width,a.height,0,0,a.width,a.height));let l=o.getImageData(0,0,a.width,a.height).data,c=!1;for(let e=3;eS(e))}else{let e=[];for(let t=0;t<6;t++)e.push(new a.MeshBasicMaterial({color:d[t+2],wireframe:!0}));S(e)}})};function L(e,t,r,a){e.position.sub(t),e.position.applyAxisAngle(r,a),e.position.add(t),e.rotateOnAxis(r,a)}S.cache={loadedTextures:v,mergedModels:m,instanceCount:g,texture:y,canvas:b,material:w,geometry:x,instances:_,animated:A,resetInstances:function(){Object(l.a)(g),Object(l.a)(_)},clearAll:function(){Object(l.a)(v),Object(l.a)(m),Object(l.a)(g),Object(l.a)(y),Object(l.a)(b),Object(l.a)(w),Object(l.a)(x),Object(l.a)(_),A.splice(0,A.length)}},S.ModelConverter=o.a,"undefined"!=typeof window&&(window.ModelRender=S,window.ModelConverter=o.a),void 0!==e&&(e.ModelRender=S),t.a=S}).call(this,r(4))},function(module,exports,__webpack_require__){ +var a=r(107),n=r(108),i=r(57);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(a)return V(e).length;t=(""+t).toLowerCase(),a=!0}}function m(e,t,r){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function v(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function g(e,t,r,a,n){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,a)),l.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,n);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,a,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,a,n){var i,o=1,s=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,d=0;dn&&(a=n):a=n;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");a>i/2&&(a=i/2);for(var o=0;o>8,n=r%256,i.push(n),i.push(a);return i}(t,e.length-r),e,r,a)}function S(e,t,r){return 0===t&&r===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[n+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[n+1],o=e[n+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[n+1],o=e[n+2],s=e[n+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),n+=f}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var r="",a=0;for(;a0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,a,n){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(a>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(i,o),u=this.slice(a,n),c=e.slice(t,r),f=0;fn)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;na)&&(r=a);for(var n="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,a,n,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function k(e,t,r,a){t<0&&(t=65535+t+1);for(var n=0,i=Math.min(e.length-r,2);n>>8*(a?n:1-n)}function I(e,t,r,a){t<0&&(t=4294967295+t+1);for(var n=0,i=Math.min(e.length-r,4);n>>8*(a?n:3-n)&255}function N(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,a,i){return i||N(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function U(e,t,r,a,i){return i||N(e,0,r,8),n.write(e,t,r,a,52,8),r+8}l.prototype.slice=function(e,t){var r,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t0&&(n*=256);)a+=this[e+--t]*n;return a},l.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=this[e],n=1,i=0;++i=(n*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=t,n=1,i=this[e+--a];a>0&&(n*=256);)i+=this[e+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,a){(e=+e,t|=0,r|=0,a)||R(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+n]=e/i&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,a){if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return a.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,a){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,r(4))},function(e,t,r){"use strict";t.a={bars:{pink_empty:{uv:[0,0,182,5]},pink_full:{uv:[0,5,182,10]},cyan_empty:{uv:[0,10,182,15]},cyan_full:{uv:[0,15,182,20]},orange_empty:{uv:[0,20,182,25]},orange_full:{uv:[0,25,182,30]},green_empty:{uv:[0,30,182,35]},green_full:{uv:[0,35,182,40]},yellow_empty:{uv:[0,40,182,45]},yellow_full:{uv:[0,45,182,50]},purple_empty:{uv:[0,50,182,55]},purple_full:{uv:[0,55,182,60]},white_empty:{uv:[0,60,182,65]},white_full:{uv:[0,65,182,70]}},book:{base:{uv:[0,0,192,192]},button_next:{uv:[0,192,23,205],pos:[120,156]},button_next_hover:{uv:[23,192,46,205],pos:[120,156]},button_prev:{uv:[0,205,23,218],pos:[38,156]},button_prev_hover:{uv:[23,205,46,218],pos:[38,156]}},container:{generic_54:{uv:[0,0,176,222],top_origin:[8,18],item_offset:[18,18]},crafting_table:{uv:[0,0,176,166],left_origin:[30,17],right_origin:[124,35],item_offset:[18,18]}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}).call(this,r(5))},function(e,t,r){"use strict";var a=r(28),n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var i=r(21);i.inherits=r(6);var o=r(58),s=r(40);i.inherits(f,o);for(var l=n(s.prototype),u=0;un(e,t))}class s extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e,Error.captureStackTrace(this,this.constructor.name)}}e.exports={getField:r,getFieldInfo:a,addErrorField:n,getCount:function(e,t,{count:n,countType:i},s){let l=0,u=0;return"number"==typeof n?l=n:void 0!==n?l=r(n,s):void 0!==i?({size:u,value:l}=o(()=>this.read(e,t,a(i),s),"$count")):l=0,{count:l,size:u}},sendCount:function(e,t,r,{count:n,countType:i},o){return void 0!==n&&e!==n||void 0!==i&&(r=this.write(e,t,r,a(i),o)),r},calcCount:function(e,{count:t,countType:r},n){return void 0===t&&void 0!==r?o(()=>this.sizeOf(e,a(r),n),"$count"):0},tryCatch:i,tryDoc:o,PartialReadError:class extends s{constructor(e){super(e),this.partialReadError=!0}}}},function(e,t,r){"use strict";function a(e,t,r){var a=r?" !== ":" === ",n=r?" || ":" && ",i=r?"!":"",o=r?"":"!";switch(e){case"null":return t+a+"null";case"array":return i+"Array.isArray("+t+")";case"object":return"("+i+t+n+"typeof "+t+a+'"object"'+n+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+a+'"number"'+n+o+"("+t+" % 1)"+n+t+a+t+")";default:return"typeof "+t+a+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:a,checkDataTypes:function(e,t){switch(e.length){case 1:return a(e[0],t,!0);default:var r="",n=i(e);for(var o in n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)r+=(r?" && ":"")+a(o,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],a=0;a=t)throw new Error("Cannot access property/index "+a+" levels up, current level is "+t);return r[t-a]}if(a>t)throw new Error("Cannot access data "+a+" levels up, current level is "+t);if(i="data"+(t-a||""),!n)return i}for(var s=i,u=n.split("/"),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,n,o,s;if("string"==typeof t&&(n="not ",t.substr(!o||o<0?0:+o,n.length)===n)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(a," ").concat(i(t,"type"));else{var l=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(a," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var n=r(73),i=r(77);r(6)(u,n);for(var o=a(i.prototype),s=0;s{i=!0,o.needsUpdate=!0,s&&(s.needsUpdate=!0);let c=-1;32===o.image.height?c=0:64===o.image.height?c=1:console.error("Couldn't detect texture version. Invalid dimensions: "+o.image.width+"x"+o.image.height),console.log("Skin Texture Version: "+c),o.magFilter=a.NearestFilter,o.minFilter=a.NearestFilter,o.anisotropy=0,s&&(s.magFilter=a.NearestFilter,s.minFilter=a.NearestFilter,s.anisotropy=0,s.format=a.RGBFormat),32===o.image.height&&(o.format=a.RGBFormat),r.attached||r._scene?console.log("[SkinRender] is attached - skipping scene init"):super.initScene((function(){r.element.dispatchEvent(new CustomEvent("skinRender",{detail:{playerModel:r.playerModel}}))})),console.log("Slim: "+f);let d=function(e,t,r,i,o){console.log("capeType: "+o);let s=new a.Object3D;s.name="headGroup",s.position.x=0,s.position.y=28,s.position.z=0,s.translateOnAxis(new a.Vector3(0,1,0),-4);let c=l(e,8,8,8,n.a.head[r],i,"head");if(c.translateOnAxis(new a.Vector3(0,1,0),4),s.add(c),r>=1){let t=l(e,8.504,8.504,8.504,n.a.hat,i,"hat",!0);t.translateOnAxis(new a.Vector3(0,1,0),4),s.add(t)}let f=new a.Object3D;f.name="bodyGroup",f.position.x=0,f.position.y=18,f.position.z=0;let d=l(e,8,12,4,n.a.body[r],i,"body");if(f.add(d),r>=1){let t=l(e,8.504,12.504,4.504,n.a.jacket,i,"jacket",!0);f.add(t)}let h=new a.Object3D;h.name="leftArmGroup",h.position.x=i?-5.5:-6,h.position.y=18,h.position.z=0,h.translateOnAxis(new a.Vector3(0,1,0),4);let p=l(e,i?3:4,12,4,n.a.leftArm[r],i,"leftArm");if(p.translateOnAxis(new a.Vector3(0,1,0),-4),h.add(p),r>=1){let t=l(e,i?3.504:4.504,12.504,4.504,n.a.leftSleeve,i,"leftSleeve",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),h.add(t)}let m=new a.Object3D;m.name="rightArmGroup",m.position.x=i?5.5:6,m.position.y=18,m.position.z=0,m.translateOnAxis(new a.Vector3(0,1,0),4);let v=l(e,i?3:4,12,4,n.a.rightArm[r],i,"rightArm");if(v.translateOnAxis(new a.Vector3(0,1,0),-4),m.add(v),r>=1){let t=l(e,i?3.504:4.504,12.504,4.504,n.a.rightSleeve,i,"rightSleeve",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),m.add(t)}let g=new a.Object3D;g.name="leftLegGroup",g.position.x=-2,g.position.y=6,g.position.z=0,g.translateOnAxis(new a.Vector3(0,1,0),4);let y=l(e,4,12,4,n.a.leftLeg[r],i,"leftLeg");if(y.translateOnAxis(new a.Vector3(0,1,0),-4),g.add(y),r>=1){let t=l(e,4.504,12.504,4.504,n.a.leftTrousers,i,"leftTrousers",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),g.add(t)}let b=new a.Object3D;b.name="rightLegGroup",b.position.x=2,b.position.y=6,b.position.z=0,b.translateOnAxis(new a.Vector3(0,1,0),4);let w=l(e,4,12,4,n.a.rightLeg[r],i,"rightLeg");if(w.translateOnAxis(new a.Vector3(0,1,0),-4),b.add(w),r>=1){let t=l(e,4.504,12.504,4.504,n.a.rightTrousers,i,"rightTrousers",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),b.add(t)}let x=new a.Object3D;if(x.add(s),x.add(f),x.add(h),x.add(m),x.add(g),x.add(b),t){console.log(n.a);let e=n.a.capeRelative;"optifine"===o&&(e=n.a.capeOptifineRelative),"labymod"===o&&(e=n.a.capeLabymodRelative),e=JSON.parse(JSON.stringify(e)),console.log(e);for(let r in e)e[r].x*=t.image.width,e[r].w*=t.image.width,e[r].y*=t.image.height,e[r].h*=t.image.height;console.log(e);let r=new a.Object3D;r.name="capeGroup",r.position.x=0,r.position.y=16,r.position.z=-2.5,r.translateOnAxis(new a.Vector3(0,1,0),8),r.translateOnAxis(new a.Vector3(0,0,1),.5);let i=l(t,10,16,1,e,!1,"cape");i.rotation.x=u(10),i.translateOnAxis(new a.Vector3(0,1,0),-8),i.translateOnAxis(new a.Vector3(0,0,1),-.5),i.rotation.y=u(180),r.add(i),x.add(r)}return x}(o,s,c,f,e._capeType?e._capeType:e.optifine?"optifine":"minecraft");r.addToScene(d),r.playerModel=d,"function"==typeof t&&t()};r._skinImage=new Image,r._skinImage.crossOrigin="anonymous",r._capeImage=new Image,r._capeImage.crossOrigin="anonymous";let s=void 0!==e.cape||void 0!==e.capeUrl||void 0!==e.capeData||void 0!==e.mineskin,f=!1,d=!1,h=!1,p=new a.Texture,m=new a.Texture;if(p.image=r._skinImage,r._skinImage.onload=function(){if(r._skinImage){if(d=!0,console.log("Skin Image Loaded"),void 0===e.slim&&32!==r._skinImage.height){let e=document.createElement("canvas"),t=e.getContext("2d");e.width=r._skinImage.width,e.height=r._skinImage.height,t.drawImage(r._skinImage,0,0),console.log("Slim Detection:");let a=t.getImageData(46,52,1,12).data,n=t.getImageData(54,20,1,12).data,i=!0;for(let e=3;e<48;e+=4){if(255===a[e]){i=!1;break}if(255===n[e]){i=!1;break}}console.log(i),i&&(f=!0)}if(r.options.makeNonTransparentOpaque&&32!==r._skinImage.height){let e=document.createElement("canvas"),n=e.getContext("2d");e.width=r._skinImage.width,e.height=r._skinImage.height,n.drawImage(r._skinImage,0,0);let i=document.createElement("canvas"),o=i.getContext("2d");i.width=r._skinImage.width,i.height=r._skinImage.height;let s=n.getImageData(0,0,e.width,e.height),l=s.data;function t(e,t){return e>0&&t>0&&e<32&&t<32||(e>32&&t>16&&e<64&&t<32||e>16&&t>48&&e<48&&t<64)}for(let r=0;r178||t(n,i))&&(l[r+3]=255)}o.putImageData(s,0,0),console.log(i.toDataURL()),p=new a.CanvasTexture(i)}!d||!h&&s||i||o(p,m)}},r._skinImage.onerror=function(e){console.warn("Skin Image Error"),console.warn(e)},console.log("Has Cape: "+s),s?(m.image=r._capeImage,r._capeImage.onload=function(){r._capeImage&&(h=!0,console.log("Cape Image Loaded"),h&&d&&(i||o(p,m)))},r._capeImage.onerror=function(e){console.warn("Cape Image Error"),console.warn(e),h=!0,d&&(i||o(p))}):(m=null,r._capeImage=null),"string"==typeof e)0===e.indexOf("http")?r._skinImage.src=e:e.length<=16?c("https://minerender.org/nameToUuid.php?name="+e,(function(t,a){if(t)return console.log(t);console.log(a),r._skinImage.src="https://crafatar.com/skins/"+(a.id?a.id:e)})):e.length<=36?image.src="https://crafatar.com/skins/"+e+"?overlay":r._skinImage.src=e;else{if("object"!=typeof e)throw new Error("Invalid texture value");if(e.url?r._skinImage.src=e.url:e.data?r._skinImage.src=e.data:e.username?c("https://minerender.org/nameToUuid.php?name="+e.username,(function(t,a){if(t)return console.log(t);r._skinImage.src="https://crafatar.com/skins/"+(a.id?a.id:e.username)+"?overlay"})):e.uuid?r._skinImage.src="https://crafatar.com/skins/"+e.uuid+"?overlay":e.mineskin&&(r._skinImage.src="https://api.mineskin.org/render/texture/"+e.mineskin),e.cape)if(e.cape.length>36){c(e.cape.startsWith("http")?e.cape:"https://api.capes.dev/get/"+e.cape,(function(t,a){if(t)return console.log(t);a.exists&&(e._capeType=a.type,r._capeImage.src=a.imageUrls.base.full)}))}else{let t="https://api.capes.dev/load/";e.capeUser?t+=e.capeUser:e.username?t+=e.username:e.uuid?t+=e.uuid:console.warn("Couldn't find a user to get a cape from"),c(t+="/"+e.cape,(function(t,a){if(t)return console.log(t);a.exists&&(e._capeType=a.type,r._capeImage.src=a.imageUrls.base.full)}))}else e.capeUrl?r._capeImage.src=e.capeUrl:e.capeData?r._capeImage.src=e.capeData:e.mineskin&&(r._capeImage.src="https://api.mineskin.org/render/texture/"+e.mineskin+"/cape");f=e.slim}}resize(e,t){return this._resize(e,t)}reset(){this._skinImage=null,this._capeImage=null,this._animId&&cancelAnimationFrame(this._animId),this._canvas&&this._canvas.remove()}getPlayerModel(){return this.playerModel}getModelByName(e){return this._scene.getObjectByName(e,!0)}toggleSkinPart(e,t){this._scene.getObjectByName(e,!0).visible=t}}function l(e,t,r,n,i,o,s,l){let u=e.image.width,c=e.image.height,f=new a.BoxGeometry(t,r,n),d=new a.MeshBasicMaterial({map:e,transparent:l||!1,alphaTest:.1,side:l?a.DoubleSide:a.FrontSide});f.computeBoundingBox(),f.faceVertexUvs[0]=[];let h=["right","left","top","bottom","front","back"],p=[];for(let e=0;e0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function f(){for(var e=[],t=0;t0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=n[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=m(l,u);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;a--)this.removeListener(e,t[a]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(8).Buffer)},function(e){e.exports=JSON.parse('{"i8":{"enum":["i8"]},"u8":{"enum":["u8"]},"i16":{"enum":["i16"]},"u16":{"enum":["u16"]},"i32":{"enum":["i32"]},"u32":{"enum":["u32"]},"f32":{"enum":["f32"]},"f64":{"enum":["f64"]},"li8":{"enum":["li8"]},"lu8":{"enum":["lu8"]},"li16":{"enum":["li16"]},"lu16":{"enum":["lu16"]},"li32":{"enum":["li32"]},"lu32":{"enum":["lu32"]},"lf32":{"enum":["lf32"]},"lf64":{"enum":["lf64"]},"i64":{"enum":["i64"]},"li64":{"enum":["li64"]},"u64":{"enum":["u64"]},"lu64":{"enum":["lu64"]}}')},function(e,t){e.exports=jQuery},function(e,t,r){"use strict";var a=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?c((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function o(e,t,r){return e.concat(t).map((function(e){return i(e,r)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function l(e,t){try{return t in e}catch(e){return!1}}function u(e,t,r){var a={};return r.isMergeableObject(e)&&s(e).forEach((function(t){a[t]=i(e[t],r)})),s(t).forEach((function(n){(function(e,t){return l(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,n)||(l(e,n)&&r.isMergeableObject(t[n])?a[n]=function(e,t){if(!t.customMerge)return c;var r=t.customMerge(e);return"function"==typeof r?r:c}(n,r)(e[n],t[n],r):a[n]=i(t[n],r))})),a}function c(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||a,r.cloneUnlessOtherwiseSpecified=i;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):u(e,t,r):i(t,r)}c.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return c(e,r,t)}),{})};var f=c;e.exports=f},function(e,t,r){"use strict";(function(e){var a=r(0),n=r(7),i=r(2),o=r(9),s=r(81);r(26);let l={controls:{enabled:!0,zoom:!0,rotate:!1,pan:!0},camera:{type:"perspective",x:0,y:0,z:50,target:[0,0,0]},assetRoot:i.a};class u extends n.b{constructor(e,t){super(e,l,t),this.renderType="GuiRender",this.gui=null,this.attached=!1}render(e,t){let r=this;r.attached||r._scene?console.log("[GuiRender] is attached - skipping scene init"):(super.initScene((function(){r.element.dispatchEvent(new CustomEvent("guiRender",{detail:{gui:r.gui}}))})),r._controls.target.set(0,0,0),r._camera.lookAt(new a.Vector3(0,0,0)));let n=[];for(let t=0;t{let s=e[t];"string"==typeof s&&(s={texture:s}),s.textureScale||(s.textureScale=1),Object(i.d)(r.options.assetRoot,"minecraft","",s.texture).then(e=>{let t=function(e){let t=(new a.TextureLoader).load(e,(function(){t.magFilter=a.NearestFilter,t.minFilter=a.NearestFilter,t.anisotropy=0,t.needsUpdate=!0;let e=new a.MeshBasicMaterial({map:t,transparent:!0,side:a.DoubleSide,alphaTest:.5});e.userData.layer=s,n(e)}))};if(s.uv){s.uv=[s.uv[0]*s.textureScale,s.uv[1]*s.textureScale,s.uv[2]*s.textureScale,s.uv[3]*s.textureScale];let r=new Image;r.onload=function(){let e=document.createElement("canvas");e.width=s.uv[2]-s.uv[0],e.height=s.uv[3]-s.uv[1],e.getContext("2d").drawImage(r,s.uv[0],s.uv[1],s.uv[2]-s.uv[0],s.uv[3]-s.uv[1],0,0,s.uv[2]-s.uv[0],s.uv[3]-s.uv[1]),t(e.toDataURL("image/png"))},r.crossOrigin="anonymous",r.src=e}else t(e)})}));Promise.all(n).then(e=>{let n=new a.Object3D,i=0,o=0;for(let t=0;ti&&(i=f),d>o&&(o=d);let h=new a.PlaneGeometry(f,d),p=new a.Mesh(h,s);if(p.name=s.userData.layer.texture.toLowerCase()+(s.userData.layer.name?"_"+s.userData.layer.name.toLowerCase():""),p.position.set(0,0,0),p.applyMatrix((new a.Matrix4).makeTranslation(f/2,d/2,0)),s.userData.layer.pos?p.applyMatrix((new a.Matrix4).makeTranslation(s.userData.layer.pos[0],-d-s.userData.layer.pos[1],0)):p.applyMatrix((new a.Matrix4).makeTranslation(0,-d,0)),s.userData.layer.layer&&(p.layers.set(s.userData.layer.layer),r._camera.layers.enable(s.userData.layer.layer)),n.add(p),r.options.showOutlines){let e=new a.BoxHelper(p,16711680);n.add(e),s.userData.layer.layer&&e.layers.set(s.userData.layer.layer)}}n.applyMatrix((new a.Matrix4).makeTranslation(-i/2,o/2,0)),r.addToScene(n),r.gui=n,r.attached||(r._camera.position.set(0,0,Math.max(i,o)),r._camera.fov=2*Math.atan(Math.max(i,o)/(2*Math.max(i,o)))*(180/Math.PI),r._camera.updateProjectionMatrix()),"function"==typeof t&&t()})}}u.Positions=o.a,u.Helper=s.a,"undefined"!=typeof window&&(window.GuiRender=u),void 0!==e&&(e.GuiRender=u),t.a=u}).call(this,r(4))},function(e,t,r){"use strict";(function(e){var a=r(0),n=(r(23),r(24),r(7)),i=r(2),o=r(47),s=r(33),l=r(1),u=r(34),c=r.n(u),f=(r(19),r(186),r(13));r(90)(a);const d=f("minerender"),h=187;String.prototype.replaceAll=function(e,t){return this.replace(new RegExp(e,"g"),t)};const p=[16711680,65535,255,128,16711935,8388736,8421376,65280,32768,16776960,8388608,32896],m=["east","west","up","down","south","north"],v=["lightgreen"],g={},y={},b={},w={},x={},_={},A={},E={},S=[];let M={camera:{type:"perspective",x:35,y:25,z:20,target:[0,0,0]},type:"block",centerCubes:!1,assetRoot:i.a,useWebWorkers:!1};class T extends n.b{constructor(e,t){super(e,M,t),this.renderType="ModelRender",this.models=[],this.instancePositionMap={},this.attached=!1}render(e,t){let r=this;r.attached||r._scene?console.log("[ModelRender] is attached - skipping scene init"):super.initScene((function(){for(let e=0;e{if(e.options.useWebWorkers){let a=c()(h);a.addEventListener("message",e=>{r.push(...e.data.parsedModelList),t()}),a.postMessage({func:"parseModel",model:i,modelOptions:i,parsedModelList:r,assetRoot:e.options.assetRoot})}else Object(l.e)(i,i,r,e.options.assetRoot).then(()=>{t()})}))}return Promise.all(a)})(r,e,n).then(()=>(function(e,t){console.timeEnd("parseModels"),console.time("loadAndMergeModels");let r=[];console.log("Loading Model JSON data & merging...");let a={};for(let e=0;e{let a=n[t],i=Object(l.d)(a);if(d("loadAndMerge "+i),g.hasOwnProperty(i))r();else if(e.options.useWebWorkers){let t=c()(h);t.addEventListener("message",e=>{g[i]=e.data.mergedModel,r()}),t.postMessage({func:"loadAndMergeModel",model:a,assetRoot:e.options.assetRoot})}else Object(l.b)(a,e.options.assetRoot).then(e=>{g[i]=e,r()})}));return Promise.all(r)})(r,n)).then(()=>(function(e,t){console.timeEnd("loadAndMergeModels"),console.time("loadModelTextures");let r=[];console.log("Loading Textures...");let a={};for(let e=0;e{let a=n[t],i=Object(l.d)(a);d("loadTexture "+i);let o=g[i];if(y.hasOwnProperty(i))r();else{if(!o)return console.warn("Missing merged model"),console.warn(a.name),void r();if(!o.textures)return console.warn("The model doesn't have any textures!"),console.warn("Please make sure you're using the proper file."),console.warn(a.name),void r();if(e.options.useWebWorkers){let t=c()(h);t.addEventListener("message",e=>{y[i]=e.data.textures,r()}),t.postMessage({func:"loadTextures",textures:o.textures,assetRoot:e.options.assetRoot})}else Object(l.c)(o.textures,e.options.assetRoot).then(e=>{y[i]=e,r()})}}));return Promise.all(r)})(r,n)).then(()=>(function(e,t){console.timeEnd("loadModelTextures"),console.time("doModelRender"),console.log("Rendering Models...");let r=[];for(let n=0;n{let i=t[n],o=g[Object(l.d)(i)],s=y[Object(l.d)(i)],u=i.offset||[0,0,0],c=i.rotation||[0,0,0],f=i.scale||[1,1,1];if(i.options.hasOwnProperty("display")&&o.hasOwnProperty("display")&&o.display.hasOwnProperty(i.options.display)){let e=o.display[i.options.display];e.hasOwnProperty("translation")&&(u=[u[0]+e.translation[0],u[1]+e.translation[1],u[2]+e.translation[2]]),e.hasOwnProperty("rotation")&&(c=[c[0]+e.rotation[0],c[1]+e.rotation[1],c[2]+e.rotation[2]]),e.hasOwnProperty("scale")&&(f=[e.scale[0],e.scale[1],e.scale[2]])}P(e,o,s,o.textures,i.type,i.name,i.variant,u,c,f).then(t=>{if(t.firstInstance){let r=new a.Object3D;r.add(t.mesh),e.models.push(r),e.addToScene(r)}r(t)})}));return Promise.all(r)})(r,n)).then(e=>{console.timeEnd("doModelRender"),d(e),"function"==typeof t&&t()})}}let P=function(e,t,r,i,o,s,u,c,f,h){return new Promise(p=>{if(t.hasOwnProperty("elements")){let m=Object(l.d)({type:o,name:s,variant:u}),v=b[m],g=function(t,r){t.userData.modelType=o,t.userData.modelName=s;let n=new a.Vector3,i=new a.Vector3,u=new a.Quaternion,d={key:m,index:r,offset:c,scale:h,rotation:f};f&&t.setQuaternionAt(r,u.setFromEuler(new a.Euler(Object(l.f)(f[0]),Object(l.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(l.f)(f[2])))),c&&(t.setPositionAt(r,n.set(c[0],c[1],c[2])),e.instancePositionMap[c[0]+"_"+c[1]+"_"+c[2]]=d),h&&t.setScaleAt(r,i.set(h[0],h[1],h[2])),t.needsUpdate(),p({mesh:t,firstInstance:0===r})},y=function(e,t){let r;if(e.translate(-8,-8,-8),E.hasOwnProperty(m))d("Using cached instance ("+m+")"),r=E[m];else{d("Caching new model instance "+m+" (with "+v+" instances)");let n=new a.InstancedMesh(e,t,v,!1,!1,!1);r={instance:n,index:0},E[m]=r;let i=new a.Vector3,o=new a.Vector3(1,1,1),s=new a.Quaternion;for(let e=0;e{let n=s.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_"+(o.__comment?o.__comment.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_":"");C(o.to[0]-o.from[0],o.to[1]-o.from[1],o.to[2]-o.from[2],n+Date.now(),o.faces,u,r,i,e.options.assetRoot,n).then(e=>{e.applyMatrix((new a.Matrix4).makeTranslation((o.to[0]-o.from[0])/2,(o.to[1]-o.from[1])/2,(o.to[2]-o.from[2])/2)),e.applyMatrix((new a.Matrix4).makeTranslation(o.from[0],o.from[1],o.from[2])),o.rotation&&R(e,new a.Vector3(o.rotation.origin[0],o.rotation.origin[1],o.rotation.origin[2]),new a.Vector3("x"===o.rotation.axis?1:0,"y"===o.rotation.axis?1:0,"z"===o.rotation.axis?1:0),Object(l.f)(o.rotation.angle)),t(e)})}))}Promise.all(w).then(e=>{let t=Object(n.c)(e,!0);t.sourceSize=e.length,y(t.geometry,t.materials,e.length);for(let t=0;t{c&&e.applyMatrix((new a.Matrix4).makeTranslation(c[0],c[1],c[2])),f&&e.rotation.set(Object(l.f)(f[0]),Object(l.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(l.f)(f[2])),h&&e.scale.set(h[0],h[1],h[2]),p({mesh:e,firstInstance:!0})})})};function F(e,t,r,n){let i=E[e];if(i&&i.instance){let e,o=i.instance;e=n?t||[1,1,1]:[0,0,0];let s=new a.Vector3;return o.setScaleAt(r,s.set(e[0],e[1],e[2])),o}}function O(e,t){let r={};for(let a of e){let e=this.instancePositionMap[a[0]+"_"+a[1]+"_"+a[2]];if(e){let a=F(e.key,e.scale,e.index,t);a&&(r[e.key]=a)}}for(let e of Object.values(r))e.needsUpdate()}T.prototype.setVisibilityAtMulti=O,T.prototype.setVisibilityAt=function(e,t,r,a){O([[e,t,r]],a)},T.prototype.setVisibilityOfType=function(e,t,r,a){let n=E[Object(l.d)({type:e,name:t,variant:r})];if(n&&n.instance){n.instance.visible=a}};let L=function(e,t){return new Promise(r=>{let n=function(t,n,i){let o=new a.PlaneGeometry(n,i),s=new a.Mesh(o,t);s.name=e,s.receiveShadow=!0,r(s)};if(t){let r=0,i=0,o=[];for(let e in t)t.hasOwnProperty(e)&&o.push(new Promise(a=>{let n=new Image;n.onload=function(){n.width>r&&(r=n.width),n.height>i&&(i=n.height),a(n)},n.src=t[e]}));Promise.all(o).then(t=>{let o=document.createElement("canvas");o.width=r,o.height=i;let l=o.getContext("2d");for(let e=0;e{let b,E=e+"_"+t+"_"+r;A.hasOwnProperty(E)?(d("Using cached Geometry ("+E+")"),b=A[E]):(b=new a.BoxGeometry(e,t,r),d("Caching Geometry "+E),A[E]=b);let M=function(e){let t=new a.Mesh(b,e);t.name=n,t.receiveShadow=!0,y(t)};if(c){let e=[];for(let t=0;t<6;t++)e.push(new Promise(e=>{let r=m[t];if(!o.hasOwnProperty(r))return void e(null);let p=o[r],y=p.texture.substr(1);if(!c.hasOwnProperty(y)||!c[y])return console.warn("Missing texture '"+y+"' for face "+r+" in model "+n),void e(null);let b=y+"_"+r+"_"+g,A=t=>{let o=function(t){let i=t.dataUrl,o=t.dataUrlHash,s=t.hasTransparency;if(_.hasOwnProperty(o))return d("Using cached Material ("+o+", without meta)"),void e(_[o]);let u=f[y];u.startsWith("#")&&(u=f[n.substr(1)]),d("Pre-Caching Material "+o+", without meta"),_[o]=new a.MeshBasicMaterial({map:null,transparent:s,side:s?a.DoubleSide:a.FrontSide,alphaTest:.5,name:r+"_"+y+"_"+u});let c=function(t){d("Finalizing Cached Material "+o+", without meta"),_[o].map=t,_[o].needsUpdate=!0,e(_[o])};if(w.hasOwnProperty(o))return d("Using cached Texture ("+o+")"),void c(w[o]);d("Pre-Caching Texture "+o),w[o]=(new a.TextureLoader).load(i,(function(e){e.magFilter=a.NearestFilter,e.minFilter=a.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,p.hasOwnProperty("rotation")&&(e.center.x=.5,e.center.y=.5,e.rotation=Object(l.f)(p.rotation)),d("Caching Texture "+o),w[o]=e,c(e)}))};if(t.height>t.width&&t.height%t.width==0){let r=f[y];r.startsWith("#")&&(r=f[r.substr(1)]),-1!==r.indexOf("/")&&(r=r.substr(r.indexOf("/")+1)),Object(i.e)(r,h).then(r=>{!function(t,r){let n=t.dataUrlHash,i=t.hasTransparency;if(_.hasOwnProperty(n))return d("Using cached Material ("+n+", with meta)"),void e(_[n]);d("Pre-Caching Material "+n+", with meta"),_[n]=new a.MeshBasicMaterial({map:null,transparent:i,side:i?a.DoubleSide:a.FrontSide,alphaTest:.5});let o=1;r.hasOwnProperty("animation")&&r.animation.hasOwnProperty("frametime")&&(o=r.animation.frametime);let l=Math.floor(t.height/t.width);console.log("Generating animated texture...");let u=[];for(let e=0;e{let n=document.createElement("canvas");n.width=t.width,n.height=t.width,n.getContext("2d").drawImage(t.canvas,0,e*t.width,t.width,t.width,0,0,t.width,t.width);let i=n.toDataURL("image/png"),o=s(i);if(w.hasOwnProperty(o))return d("Using cached Texture ("+o+")"),void r(w[o]);d("Pre-Caching Texture "+o),w[o]=(new a.TextureLoader).load(i,(function(e){e.magFilter=a.NearestFilter,e.minFilter=a.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,d("Caching Texture "+o+", without meta"),w[o]=e,r(e)}))}));Promise.all(u).then(t=>{let r=0,a=0;S.push(()=>{r>=o&&(r=0,_[n].map=t[a],a++),a>=t.length&&(a=0),r+=.1}),d("Finalizing Cached Material "+n+", with meta"),_[n].map=t[0],_[n].needsUpdate=!0,e(_[n])})}(t,r)}).catch(()=>{o(t)})}else o(t)};if(x.hasOwnProperty(b)){let e=x[b];if(e.hasOwnProperty("img")){d("Waiting for canvas image that's already loading ("+b+")"),e.img.waitingForCanvas.push((function(e){A(e)}))}else d("Using cached canvas ("+b+")"),A(x[b])}else{let t=new Image;t.onerror=function(t){console.warn(t),e(null)},t.waitingForCanvas=[],t.onload=function(){let e=(e=>{let t=p.uv;t||(t=u[r].uv),t=[Object(i.f)(t[0],e.width),Object(i.f)(t[1],e.height),Object(i.f)(t[2],e.width),Object(i.f)(t[3],e.height)];let a=document.createElement("canvas");a.width=Math.abs(t[2]-t[0]),a.height=Math.abs(t[3]-t[1]);let n,o=a.getContext("2d");o.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),a.width,a.height,0,0,a.width,a.height),p.hasOwnProperty("tintindex")?n=v[p.tintindex]:g.startsWith("water_")&&(n="blue"),n&&(o.fillStyle=n,o.globalCompositeOperation="multiply",o.fillRect(0,0,a.width,a.height),o.globalAlpha=1,o.globalCompositeOperation="destination-in",o.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),a.width,a.height,0,0,a.width,a.height));let l=o.getImageData(0,0,a.width,a.height).data,c=!1;for(let e=3;eM(e))}else{let e=[];for(let t=0;t<6;t++)e.push(new a.MeshBasicMaterial({color:p[t+2],wireframe:!0}));M(e)}})};function R(e,t,r,a){e.position.sub(t),e.position.applyAxisAngle(r,a),e.position.add(t),e.rotateOnAxis(r,a)}T.cache={loadedTextures:y,mergedModels:g,instanceCount:b,texture:w,canvas:x,material:_,geometry:A,instances:E,animated:S,resetInstances:function(){Object(l.a)(b),Object(l.a)(E)},clearAll:function(){Object(l.a)(y),Object(l.a)(g),Object(l.a)(b),Object(l.a)(w),Object(l.a)(x),Object(l.a)(_),Object(l.a)(A),Object(l.a)(E),S.splice(0,S.length)}},T.ModelConverter=o.a,"undefined"!=typeof window&&(window.ModelRender=T,window.ModelConverter=o.a),void 0!==e&&(e.ModelRender=T),t.a=T}).call(this,r(4))},function(module,exports,__webpack_require__){ /*! * The three.js expansion library v0.92.0 * Collected by Jusfoun Visualization Department @@ -28,24 +28,24 @@ var a=r(104),n=r(105),i=r(56);function o(){return l.TYPED_ARRAY_SUPPORT?21474836 * The three.js LICENSE * http://threejs.org/license */ -!function(e,t){for(var r in t)e[r]=t[r]}(exports,function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){e.exports=__webpack_require__(0)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1};Object.assign(a.prototype,{setSize:function(e,t){},render:function(e,t,r,a,n){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(1),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t){o.default.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof n.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=n.UniformsUtils.clone(e.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new n.Scene,this.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)}}),t.default=s},function(e,t,r){!function(e){"use strict";function t(){}function r(e,r){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===r||r,this.encoder=new t}function a(){}function n(){}t.prototype.s2u=function(e){for(var t=this.s2uTable,r="",a=0;a=0&&n<=126||n>=161&&n<=223)&&a0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},a.prototype={constructor:a,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],a=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=a}},n.prototype.parsePmd=function(e,t){var a,n={},i=new r(e);return n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left",function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),function(){var e,t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r0&&(a.englishModelName=i.getSjisStringsAsUnicode(20),a.englishComment=i.getSjisStringsAsUnicode(256)),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneNames=[];for(var t=0;t=2.0 are supported. Use LegacyGLTFLoader instead.")):(m.extensionsUsed&&(m.extensionsUsed.indexOf(r.KHR_LIGHTS)>=0&&(p[r.KHR_LIGHTS]=new i(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_UNLIT)>=0&&(p[r.KHR_MATERIALS_UNLIT]=new o(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(p[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new d),m.extensionsUsed.indexOf(r.KHR_DRACO_MESH_COMPRESSION)>=0&&(p[r.KHR_DRACO_MESH_COMPRESSION]=new f(this.dracoLoader)),m.extensionsUsed.indexOf(r.MSFT_TEXTURE_DDS)>=0&&(p[r.MSFT_TEXTURE_DDS]=new n)),new U(m,p,{path:t||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse((function(e,t,r,a,n){l({scene:e,scenes:t,cameras:r,animations:a,asset:n})}),u))}};var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(){if(!a.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=new a.DDSLoader}function i(e){this.name=r.KHR_LIGHTS,this.lights={};var t=(e.extensions&&e.extensions[r.KHR_LIGHTS]||{}).lights||{};for(var n in t){var i,o=t[n],s=(new a.Color).fromArray(o.color);switch(o.type){case"directional":(i=new a.DirectionalLight(s)).target.position.set(0,0,1),i.add(i.target);break;case"point":i=new a.PointLight(s);break;case"spot":i=new a.SpotLight(s),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;case"ambient":i=new a.AmbientLight(s)}i&&(i.decay=2,void 0!==o.intensity&&(i.intensity=o.intensity),i.name=o.name||"light_"+n,this.lights[n]=i)}}function o(e){this.name=r.KHR_MATERIALS_UNLIT}o.prototype.getMaterialType=function(e){return a.MeshBasicMaterial},o.prototype.extendParams=function(e,t,r){var n=[];e.color=new a.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var o=i.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture.index))}return Promise.all(n)};var s="glTF",l=12,u={JSON:1313821514,BIN:5130562};function c(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,l);if(this.header={magic:a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,l),i=0;i",s).replace("#include ",l).replace("#include ",u).replace("#include ",c).replace("#include ",f);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new a.Color).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=d,e.uniforms=o,e.defines={STANDARD:""},e.color=new a.Color(1,1,1),e.opacity=1;var h=[];if(Array.isArray(n.diffuseFactor)){var p=n.diffuseFactor;e.color.fromArray(p),e.opacity=p[3]}if(void 0!==n.diffuseTexture&&h.push(r.assignTexture(e,"map",n.diffuseTexture.index)),e.emissive=new a.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new a.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var m=n.specularGlossinessTexture.index;h.push(r.assignTexture(e,"glossinessMap",m)),h.push(r.assignTexture(e,"specularMap",m))}return Promise.all(h)},createMaterial:function(e){var t=new a.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var r=this.specularGlossinessParams,a=0,n=r.length;a=2&&(n[i+1]=e.getY(i)),r>=3&&(n[i+2]=e.getZ(i)),r>=4&&(n[i+3]=e.getW(i));return new a.BufferAttribute(n,r,e.normalized)}return e.clone()}function U(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new t,this.primitiveCache=[],this.textureLoader=new a.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function j(e,t,r){var a=t.attributes;for(var n in a){var i=T[n],o=r[a[n]];i&&(i in e.attributes||e.addAttribute(i,o))}void 0===t.indices||e.index||e.setIndex(r[t.indices])}return U.prototype.parse=function(e,t){var r=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then((function(t){var a=t.scenes||[],n=a[r.scene||0],i=t.animations||[],o=r.asset,s=t.cameras||[];e(n,a,s,i,o)})).catch(t)},U.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},i=0,o=t.length;i=2&&o.setY(T,A[E*l+1]),l>=3&&o.setZ(T,A[E*l+2]),l>=4&&o.setW(T,A[E*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},U.prototype.loadTexture=function(e){var t,n=this,i=this.json,o=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=i.textures[e],c=u.extensions||{},f=(t=c[r.MSFT_TEXTURE_DDS]?i.images[c[r.MSFT_TEXTURE_DDS].source]:i.images[u.source]).uri,d=!1;return void 0!==t.bufferView&&(f=n.getDependency("bufferView",t.bufferView).then((function(e){d=!0;var r=new Blob([e],{type:t.mimeType});return f=l.createObjectURL(r)}))),Promise.resolve(f).then((function(e){var t=a.Loader.Handlers.get(e);return t||(t=c[r.MSFT_TEXTURE_DDS]?n.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(r,a){t.load(R(e,o.path),r,void 0,a)}))})).then((function(e){!0===d&&l.revokeObjectURL(f),e.flipY=!1,void 0!==u.name&&(e.name=u.name),c[r.MSFT_TEXTURE_DDS]||(e.format=void 0!==u.format?E[u.format]:a.RGBAFormat),void 0!==u.internalFormat&&e.format!==E[u.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==u.type?S[u.type]:a.UnsignedByteType;var t=(i.samplers||{})[u.sampler]||{};return e.magFilter=_[t.magFilter]||a.LinearFilter,e.minFilter=_[t.minFilter]||a.LinearMipMapLinearFilter,e.wrapS=A[t.wrapS]||a.RepeatWrapping,e.wrapT=A[t.wrapT]||a.RepeatWrapping,e}))},U.prototype.assignTexture=function(e,t,r){return this.getDependency("texture",r).then((function(r){e[t]=r}))},U.prototype.loadMaterial=function(e){this.json;var t,n=this.extensions,i=this.json.materials[e],o={},s=i.extensions||{},l=[];if(s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(i),l.push(u.extendParams(o,i,this))}else if(s[r.KHR_MATERIALS_UNLIT]){var c=n[r.KHR_MATERIALS_UNLIT];t=c.getMaterialType(i),l.push(c.extendParams(o,i,this))}else{t=a.MeshStandardMaterial;var f=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(f.baseColorFactor)){var d=f.baseColorFactor;o.color.fromArray(d),o.opacity=d[3]}if(void 0!==f.baseColorTexture&&l.push(this.assignTexture(o,"map",f.baseColorTexture.index)),o.metalness=void 0!==f.metallicFactor?f.metallicFactor:1,o.roughness=void 0!==f.roughnessFactor?f.roughnessFactor:1,void 0!==f.metallicRoughnessTexture){var h=f.metallicRoughnessTexture.index;l.push(this.assignTexture(o,"metalnessMap",h)),l.push(this.assignTexture(o,"roughnessMap",h))}}!0===i.doubleSided&&(o.side=a.DoubleSide);var p=i.alphaMode||O;return p===C?o.transparent=!0:(o.transparent=!1,p===L&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"normalMap",i.normalTexture.index)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale&&o.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"aoMap",i.occlusionTexture.index)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==a.MeshBasicMaterial&&l.push(this.assignTexture(o,"emissiveMap",i.emissiveTexture.index)),Promise.all(l).then((function(){var e;return e=t===a.ShaderMaterial?n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==i.name&&(e.name=i.name),e.normalScale&&(e.normalScale.y=-e.normalScale.y),e.map&&(e.map.encoding=a.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=a.sRGBEncoding),i.extras&&(e.userData=i.extras),e}))},U.prototype.loadGeometries=function(e){var t=this,n=this.extensions,i=this.primitiveCache;return this.getDependencies("accessor").then((function(o){for(var s=[],l=0,u=e.length;l1))return _;_.name+="_"+c,s.add(_)}return s}))}))},U.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new a.PerspectiveCamera(a.Math.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new a.OrthographicCamera(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar)),void 0!==r.name&&(t.name=r.name),r.extras&&(t.userData=r.extras),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},U.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},U.prototype.loadAnimation=function(e){this.json;var t=this.json.animations[e];return this.getMultiDependencies(["accessor","node"]).then((function(r){for(var n=[],i=0,o=t.channels.length;i1&&(s.name+="_instance_"+i[o.mesh]++)}else if(void 0!==o.camera)s=e.cameras[o.camera];else if(o.extensions&&o.extensions[r.KHR_LIGHTS]&&void 0!==o.extensions[r.KHR_LIGHTS].light){s=t[r.KHR_LIGHTS].lights[o.extensions[r.KHR_LIGHTS].light]}else s=new a.Object3D;if(void 0!==o.name&&(s.name=a.PropertyBinding.sanitizeNodeName(o.name)),o.extras&&(s.userData=o.extras),void 0!==o.matrix){var d=new a.Matrix4;d.fromArray(o.matrix),s.applyMatrix(d)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return s}))},U.prototype.loadScene=function(){function e(t,r,n,i,o){var s=i[t],l=n.nodes[t];if(void 0!==l.skin)for(var u=!0===s.isGroup?s.children:[s],c=0,f=u.length;c(n=s.indexOf("\n"))&&i=e.byteLength||!(a=r(e)))return t(1,"no header found");if(!(n=a.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(u.valid|=1,u.programtype=n[1],u.string+=a+"\n";!1!==(a=r(e));)if(u.string+=a+"\n","#"!==a.charAt(0)){if((n=a.match(i))&&(u.gamma=parseFloat(n[1],10)),(n=a.match(o))&&(u.exposure=parseFloat(n[1],10)),(n=a.match(s))&&(u.valid|=2,u.format=n[1]),(n=a.match(l))&&(u.valid|=4,u.height=parseInt(n[1],10),u.width=parseInt(n[2],10)),2&u.valid&&4&u.valid)break}else u.comments+=a+"\n";return 2&u.valid?4&u.valid?u:t(3,"missing image size specifier"):t(3,"missing format specifier")}(n);if(-1!==i){var o=i.width,s=i.height,l=function(e,r,a){var n,i,o,s,l,u,c,f,d,h,p,m,v,g=r,y=a;if(g<8||g>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(g!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(n=new Uint8Array(4*r*a))||!n.length)return t(4,"unable to allocate buffer space");for(i=0,o=0,f=4*g,v=new Uint8Array(4),u=new Uint8Array(f);y>0&&oe.byteLength)return t(1);if(v[0]=e[o++],v[1]=e[o++],v[2]=e[o++],v[3]=e[o++],2!=v[0]||2!=v[1]||(v[2]<<8|v[3])!=g)return t(3,"bad rgbe scanline format");for(c=0;c128)&&(s-=128),0===s||c+s>f)return t(3,"bad scanline data");if(m)for(l=e[o++],d=0;d0){var x=[];for(var w in v)h=v[w],x[w]=h.name;m="Adding mesh(es) ("+x.length+": "+x+") from input mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)"}else m="Not adding mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)";var _=this.callbacks.onProgress;t.isValid(_)&&_(new CustomEvent("MeshBuilderEvent",{detail:{type:"progress",modelName:e.params.meshName,text:m,numericalValue:e.progress.numericalValue}}));return v},r.prototype.updateMaterials=function(e){var r,a,i=e.materials.materialCloneInstructions;if(t.isValid(i)){var o=i.materialNameOrg,s=this.materials[o];if(t.isValid(o)){r=s.clone(),a=i.materialName,r.name=a;var l=i.materialProperties;for(var u in l)r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&(r[u]=l[u]);this.materials[a]=r}else console.warn('Requested material "'+o+'" is not available!')}var c=e.materials.serializedMaterials;if(t.isValid(c)&&Object.keys(c).length>0){var f,d=new n.MaterialLoader;for(a in c)f=c[a],t.isValid(f)&&(r=d.parse(f),this.logging.enabled&&console.info('De-serialized material with name "'+a+'" will be added.'),this.materials[a]=r)}if(c=e.materials.runtimeMaterials,t.isValid(c)&&Object.keys(c).length>0)for(a in c)r=c[a],this.logging.enabled&&console.info('Material with name "'+a+'" will be added.'),this.materials[a]=r},r.prototype.getMaterialsJSON=function(){var e,t={};for(var r in this.materials)e=this.materials[r],t[r]=e.toJSON();return t},r.prototype.getMaterials=function(){return this.materials},r}(),s.WorkerRunnerRefImpl=function(){function e(){var e=this;self.addEventListener("message",(function(t){e.processMessage(t.data)}),!1)}return e.prototype.applyProperties=function(e,t){var r,a,n;for(r in t)a="set"+r.substring(0,1).toLocaleUpperCase()+r.substring(1),n=t[r],"function"==typeof e[a]?e[a](n):e.hasOwnProperty(r)&&(e[r]=n)},e.prototype.processMessage=function(e){if("run"===e.cmd){var t={callbackMeshBuilder:function(e){self.postMessage(e)},callbackProgress:function(t){e.logging.enabled&&e.logging.debug&&console.debug("WorkerRunner: progress: "+t)}},r=new Parser;"function"==typeof r.setLogging&&r.setLogging(e.logging.enabled,e.logging.debug),this.applyProperties(r,e.params),this.applyProperties(r,e.materials),this.applyProperties(r,t),r.workerScope=self,r.parse(e.data.input,e.data.options),e.logging.enabled&&console.log("WorkerRunner: Run complete!"),t.callbackMeshBuilder({cmd:"complete",msg:"WorkerRunner completed run."})}else console.error("WorkerRunner: Received unknown command: "+e.cmd)},e}(),s.WorkerSupport=function(){var e="2.2.0",t=s.Validator,r=function(){function e(){this._reset()}return e.prototype._reset=function(){this.logging={enabled:!0,debug:!1},this.worker=null,this.runnerImplName=null,this.callbacks={meshBuilder:null,onLoad:null},this.terminateRequested=!1,this.queuedMessage=null,this.started=!1,this.forceCopy=!1},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.setForceCopy=function(e){this.forceCopy=!0===e},e.prototype.initWorker=function(e,t){this.runnerImplName=t;var r=new Blob([e],{type:"application/javascript"});this.worker=new Worker(o.URL.createObjectURL(r)),this.worker.onmessage=this._receiveWorkerMessage,this.worker.runtimeRef=this,this._postMessage()},e.prototype._receiveWorkerMessage=function(e){var t=e.data;switch(t.cmd){case"meshData":case"materialData":case"imageData":this.runtimeRef.callbacks.meshBuilder(t);break;case"complete":this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run is complete. Terminating application on request!"),this.runtimeRef._terminate());break;case"error":console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Reported error: "+t.msg),this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run reported error. Terminating application on request!"),this.runtimeRef._terminate());break;default:console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Received unknown command: "+t.cmd)}},e.prototype.setCallbacks=function(e,r){this.callbacks.meshBuilder=t.verifyInput(e,this.callbacks.meshBuilder),this.callbacks.onLoad=t.verifyInput(r,this.callbacks.onLoad)},e.prototype.run=function(e){if(t.isValid(this.queuedMessage))console.warn("Already processing message. Rejecting new run instruction");else{if(this.queuedMessage=e,this.started=!0,!t.isValid(this.callbacks.meshBuilder))throw'Unable to run as no "MeshBuilder" callback is set.';if(!t.isValid(this.callbacks.onLoad))throw'Unable to run as no "onLoad" callback is set.';"run"!==e.cmd&&(e.cmd="run"),t.isValid(e.logging)?(e.logging.enabled=!0===e.logging.enabled,e.logging.debug=!0===e.logging.debug):e.logging={enabled:!0,debug:!1},this._postMessage()}},e.prototype._postMessage=function(){var e;t.isValid(this.queuedMessage)&&t.isValid(this.worker)&&(this.queuedMessage.data.input instanceof ArrayBuffer?(e=this.forceCopy?this.queuedMessage.data.input.slice(0):this.queuedMessage.data.input,this.worker.postMessage(this.queuedMessage,[e])):this.worker.postMessage(this.queuedMessage))},e.prototype.setTerminateRequested=function(e){this.terminateRequested=!0===e,this.terminateRequested&&t.isValid(this.worker)&&!t.isValid(this.queuedMessage)&&this.started&&(this.logging.enabled&&console.info("Worker is terminated immediately as it is not running!"),this._terminate())},e.prototype._terminate=function(){this.worker.terminate(),this._reset()},e}();function a(){if(console.info("Using THREE.LoaderSupport.WorkerSupport version: "+e),this.logging={enabled:!0,debug:!1},void 0===o.Worker)throw"This browser does not support web workers!";if(void 0===o.Blob)throw"This browser does not support Blob!";if("function"!=typeof o.URL.createObjectURL)throw"This browser does not support Object creation from URL!";this.loaderWorker=new r}a.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t,this.loaderWorker.setLogging(this.logging.enabled,this.logging.debug)},a.prototype.setForceWorkerDataCopy=function(e){this.loaderWorker.setForceCopy(e)},a.prototype.validate=function(e,r,a,o,u){if(!t.isValid(this.loaderWorker.worker)){this.logging.enabled&&(console.info("WorkerSupport: Building worker code..."),console.time("buildWebWorkerCode")),t.isValid(u)?this.logging.enabled&&console.info('WorkerSupport: Using "'+u.name+'" as Runner class for worker.'):(u=s.WorkerRunnerRefImpl,this.logging.enabled&&console.info('WorkerSupport: Using DEFAULT "THREE.LoaderSupport.WorkerRunnerRefImpl" as Runner class for worker.'));var c=e(i,l);c+="var Parser = "+r+";\n\n",c+=l(u.name,u),c+="new "+u.name+"();\n\n";var f=this;if(t.isValid(a)&&a.length>0){var d="";!function e(t,r){if(0===r.length)f.loaderWorker.initWorker(d+c,u.name),f.logging.enabled&&console.timeEnd("buildWebWorkerCode");else{var a=new n.FileLoader;a.setPath(t),a.setResponseType("text"),a.load(r[0],(function(a){d+=a,e(t,r)})),r.shift()}}(o,a)}else this.loaderWorker.initWorker(c,u.name),this.logging.enabled&&console.timeEnd("buildWebWorkerCode")}},a.prototype.setCallbacks=function(e,t){this.loaderWorker.setCallbacks(e,t)},a.prototype.run=function(e){this.loaderWorker.run(e)},a.prototype.setTerminateRequested=function(e){this.loaderWorker.setTerminateRequested(e)};var i=function(e,t){var r,a=e+" = {\n";for(var n in t)"string"==typeof(r=t[n])||r instanceof String?a+="\t"+n+': "'+(r=(r=r.replace("\n","\\n")).replace("\r","\\r"))+'",\n':r instanceof Array?a+="\t"+n+": ["+r+"],\n":Number.isInteger(r)?a+="\t"+n+": "+r+",\n":"function"==typeof r&&(a+="\t"+n+": "+r+",\n");return a+="}\n\n"},l=function(e,r,a,n,i){var o,s,l="",u=t.isValid(a)?a:r.name;for(var c in i=t.verifyInput(i,[]),r.prototype)o=r.prototype[c],"constructor"===c?s="\tfunction "+u+o.toString().replace("function","")+";\n\n":"function"==typeof o&&i.indexOf(c)<0&&(l+="\t"+u+".prototype."+c+" = "+o.toString()+";\n\n");l+="\treturn "+u+";\n",l+="})();\n\n";var f="";return t.isValid(n)&&(f+="\n",f+=u+".prototype = Object.create( "+n+".prototype );\n",f+=u+".constructor = "+u+";\n",f+="\n"),t.isValid(s)?l=e+" = (function () {\n\n"+f+s+l:(s=e+" = (function () {\n\n",l=(s+=f+"\t"+r.prototype.constructor.toString()+"\n\n")+l),l};return a}(),s.WorkerDirector=function(){var e="2.2.0",t=s.Validator,r=16,a=8192;function i(n){if(console.info("Using THREE.LoaderSupport.WorkerDirector version: "+e),this.logging={enabled:!0,debug:!1},this.maxQueueSize=a,this.maxWebWorkers=r,this.crossOrigin=null,!t.isValid(n))throw"Provided invalid classDef: "+n;this.workerDescription={classDef:n,globalCallbacks:{},workerSupports:{},forceWorkerDataCopy:!0},this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0,this.callbackOnFinishedProcessing=null}return i.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},i.prototype.getMaxQueueSize=function(){return this.maxQueueSize},i.prototype.getMaxWebWorkers=function(){return this.maxWebWorkers},i.prototype.setCrossOrigin=function(e){this.crossOrigin=e},i.prototype.setForceWorkerDataCopy=function(e){this.workerDescription.forceWorkerDataCopy=!0===e},i.prototype.prepareWorkers=function(e,i,o){t.isValid(e)&&(this.workerDescription.globalCallbacks=e),this.maxQueueSize=Math.min(i,a),this.maxWebWorkers=Math.min(o,r),this.maxWebWorkers=Math.min(this.maxWebWorkers,this.maxQueueSize),this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0;for(var s=0;s0&&this.instructionQueuePointer0},i.prototype.processQueue=function(){var e,t;for(var r in this.workerDescription.workerSupports)(t=this.workerDescription.workerSupports[r]).inUse||(this.instructionQueuePointer=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},i[c]=r;else if(r)if("ka"===u||"kd"===u||"ks"===u){var f=c.split(a,3);r[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else r[u]=c}}var d=new n.MaterialCreator(this.texturePath||this.path,this.materialOptions);return d.setCrossOrigin(this.crossOrigin),d.setManager(this.manager),d.setMaterials(i),d}},(n.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:a.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:a.RepeatWrapping}).prototype={constructor:n.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var r in e){var a=e[r],n={};for(var i in t[r]=n,a){var o=!0,s=a[i],l=i.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(n[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,r=this.materialsInfo[e],n={name:e,side:this.side};function i(e,r){if(!n[e]){var a,i,o=t.getTextureParams(r,n),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(i=o.url)||""===i?"":/^https?:\/\//i.test(i)?i:a+i));s.repeat.copy(o.scale),s.offset.copy(o.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,n[e]=s}}for(var o in r){var s,l=r[o];if(""!==l)switch(o.toLowerCase()){case"kd":n.color=(new a.Color).fromArray(l);break;case"ks":n.specular=(new a.Color).fromArray(l);break;case"map_kd":i("map",l);break;case"map_ks":i("specularMap",l);break;case"norm":i("normalMap",l);break;case"map_bump":case"bump":i("bumpMap",l);break;case"ns":n.shininess=parseFloat(l);break;case"d":(s=parseFloat(l))<1&&(n.opacity=s,n.transparent=!0);break;case"tr":s=parseFloat(l),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var r,n={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},i=e.split(/\s+/);return(r=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),(r=i.indexOf("-s"))>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),(r=i.indexOf("-o"))>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n},loadTexture:function(e,t,r,n,i){var o,s=a.Loader.Handlers.get(e),l=void 0!==this.manager?this.manager:a.DefaultLoadingManager;return null===s&&(s=new a.TextureLoader(l)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,r,n,i),void 0!==t&&(o.mapping=t),o}},t.default=n},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _three=__webpack_require__(0),THREE=_interopRequireWildcard(_three);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var Volume=function(e,t,r,a,n){if(arguments.length>0){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,a){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(n);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(n);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(n);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(n);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(n);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(n);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw"Error in THREE.Volume constructor : this type is not supported in JavaScript";case"Float32":case"float32":case"float":this.data=new Float32Array(n);break;case"Float64":case"float64":case"double":this.data=new Float64Array(n);break;default:this.data=new Uint8Array(n)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw"Error in THREE.Volume constructor, lengths are not matching arrayBuffer size"}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new THREE.Matrix3,this.matrix.identity();var i=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return i},set:function(e){i=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});var o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[]};Volume.prototype={constructor:Volume,getData:function(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]},access:function(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e},reverseAccess:function(e){var t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]},map:function(e,t){var r=this.data.length;t=t||this;for(var a=0;a.9})),jDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[1]))>.9})),kDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[2]))>.9})),argumentsWithInversion=["volume.xLength-1-","volume.yLength-1-","volume.zLength-1-"],argArray=[iDirection,jDirection,kDirection].map((function(e,t){return(e.dot(base[t])>0?"":argumentsWithInversion[t])+(e===axisInIJK?"IJKIndex":e.argVar)})),argString=argArray.join(",");return sliceAccess=eval("(function sliceAccess (i,j) {return volume.access( "+argString+");})"),{iLength:iLength,jLength:jLength,sliceAccess:sliceAccess,matrix:planeMatrix,planeWidth:planeWidth,planeHeight:planeHeight}},extractSlice:function(e,t){var r=new THREE.VolumeSlice(this,t,e);return this.sliceList.push(r),r},repaintAllSlices:function(){return this.sliceList.forEach((function(e){e.repaint()})),this},computeMinMax:function(){var e=1/0,t=-1/0,r=this.data.length,a=0;for(a=0;a","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","float l = linearToRelativeLuminance( texel.rgb );","gl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","uniform sampler2D luminanceMap;","#else","uniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","#ifdef ADAPTED_LUMINANCE","float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","#else","float fLumAvg = averageLuminance;","#endif","float fLumPixel = linearToRelativeLuminance( vColor );","float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","return fLumCompressed * vColor;","}","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-e*e/(2*t*t))}var r,a,n,i,o=2*Math.ceil(3*e)+1;for(o>25&&(o=25),i=.5*(o-1),a=new Array(o),n=0,r=0;r","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","vec2 aspectcorrect = vec2( 1.0, aspect );","float viewZ = getViewZ( getDepth( vUv ) );","float factor = ( focus + viewZ );","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},tSize:{value:new a.Vector2(256,256)},center:{value:new a.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float dx = rand( vUv + time );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","if(byp<1) {","vec2 p = vUv;","float xs = floor(gl_FragCoord.x / 0.5);","float ys = floor(gl_FragCoord.y / 0.5);","vec4 normal = texture2D (tDisp, p*seed*seed);","if(p.ydistortion_x-col_s*seed) {","if(seed_x>0.){","p.y = 1. - (p.y + distortion_y);","}","else {","p.y = distortion_y;","}","}","if(p.xdistortion_y-col_s*seed) {","if(seed_y>0.){","p.x=distortion_x;","}","else {","p.x = 1. - (p.x + distortion_x);","}","}","p.x+=normal.x*seed_x*(seed/5.);","p.y+=normal.y*seed_y*(seed/5.);","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, p + offset);","vec4 cga = texture2D(tDiffuse, p);","vec4 cb = texture2D(tDiffuse, p - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","gl_FragColor = gl_FragColor+ snow;","}","else {","gl_FragColor=texture2D (tDiffuse, vUv);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","vUV = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","return a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","return sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","float dist = hypot( coord.x - p.x, coord.y - p.y );","float rad = channel;","if ( shape == SHAPE_DOT ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","} else if ( shape == SHAPE_ELLIPSE ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","if ( dist != 0.0 ) {","float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","}","} else if ( shape == SHAPE_LINE ) {","rad = pow( abs( rad ), 1.5) * rad_max;","float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","dist = hypot( normal.x * dot_p, normal.y * dot_p );","} else if ( shape == SHAPE_SQUARE ) {","float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","float sin_t = abs( sin( theta ) );","float cos_t = abs( cos( theta ) );","rad = pow( abs( rad ), 1.4 );","rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","}","return rad - dist;","}","struct Cell {","vec2 normal;","vec2 p1;","vec2 p2;","vec2 p3;","vec2 p4;","float samp2;","float samp1;","float samp3;","float samp4;","};","vec4 getSample( vec2 point ) {","vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","float step = PI2 / float( samples );","float dist = radius * 0.66;","for ( int i = 0; i < samples; ++i ) {","float r = base + step * float( i );","vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","}","tex /= float( samples ) + 1.0;","return tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","if ( channel == 0 ) {","c.samp1 = getSample( c.p1 ).r;","c.samp2 = getSample( c.p2 ).r;","c.samp3 = getSample( c.p3 ).r;","c.samp4 = getSample( c.p4 ).r;","} else if (channel == 1) {","c.samp1 = getSample( c.p1 ).g;","c.samp2 = getSample( c.p2 ).g;","c.samp3 = getSample( c.p3 ).g;","c.samp4 = getSample( c.p4 ).g;","} else {","c.samp1 = getSample( c.p1 ).b;","c.samp3 = getSample( c.p3 ).b;","c.samp2 = getSample( c.p2 ).b;","c.samp4 = getSample( c.p4 ).b;","}","dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","res = clamp( res, 0.0, 1.0 );","return res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","Cell c;","vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","float threshold = step * 0.5;","float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","float offset_normal = mod( hypot( offset.x, offset.y ), step );","float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","c.normal = n;","c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","if ( scatter != 0.0 ) {","float off_mag = scatter * threshold * 0.5;","float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","c.p1.x += cos( off_angle ) * off_mag;","c.p1.y += sin( off_angle ) * off_mag;","}","float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","c.p2.x = c.p1.x - n.x * normal_step;","c.p2.y = c.p1.y - n.y * normal_step;","c.p3.x = c.p1.x + n.y * line_step;","c.p3.y = c.p1.y - n.x * line_step;","c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","return c;","}","float blendColour( float a, float b, float t ) {","if ( blendingMode == BLENDING_LINEAR ) {","return blend( a, b, 1.0 - t );","} else if ( blendingMode == BLENDING_ADD ) {","return blend( a, min( 1.0, a + b ), t );","} else if ( blendingMode == BLENDING_MULTIPLY ) {","return blend( a, max( 0.0, a * b ), t );","} else if ( blendingMode == BLENDING_LIGHTER ) {","return blend( a, max( a, b ), t );","} else if ( blendingMode == BLENDING_DARKER ) {","return blend( a, min( a, b ), t );","} else {","return blend( a, b, 1.0 - t );","}","}","void main() {","if ( ! disable ) {","vec2 p = vec2( vUV.x * width, vUV.y * height );","vec2 origin = vec2( 0, 0 );","float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","Cell cell_r = getReferenceCell( p, origin, rotateR, radius );","Cell cell_g = getReferenceCell( p, origin, rotateG, radius );","Cell cell_b = getReferenceCell( p, origin, rotateB, radius );","float r = getDotColour( cell_r, p, 0, rotateR, aa );","float g = getDotColour( cell_g, p, 1, rotateG, aa );","float b = getDotColour( cell_b, p, 2, rotateB, aa );","vec4 colour = texture2D( tDiffuse, vUV );","r = blendColour( r, colour.r, blending );","g = blendColour( g, colour.g, blending );","b = blendColour( b, colour.b, blending );","if ( greyscale ) {","r = g = b = (r + b + g) / 3.0;","}","gl_FragColor = vec4( r, g, b, 1.0 );","} else {","gl_FragColor = texture2D( tDiffuse, vUV );","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{type:"t",value:null},tDiffuse:{type:"t",value:null},tNormal:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},cameraProjectionMatrix:{type:"m4",value:new a.Matrix4},cameraInverseProjectionMatrix:{type:"m4",value:new a.Matrix4},scale:{type:"f",value:1},intensity:{type:"f",value:.1},bias:{type:"f",value:.5},minResolution:{type:"f",value:0},kernelRadius:{type:"f",value:100},randomSeed:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},sampleUvOffsets:{type:"v2v",value:[new a.Vector2(0,0)]},sampleWeights:{type:"1fv",value:[1]},tDepth:{type:"t",value:null},cameraNear:{type:"f",value:10},cameraFar:{type:"f",value:1e3},depthCutoff:{type:"f",value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","float depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={createSampleWeights:function(e,t){for(var r=function(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)},a=[],n=0;n<=e;n++)a.push(r(n,t));return a},createSampleOffsets:function(e,t){for(var r=[],a=0;a<=e;a++)r.push(t.clone().multiplyScalar(a));return r},configure:function(e,t,r,n){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=a.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=a.createSampleWeights(t,r),e.needsUpdate=!0}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","t = abs( C - Ctop );","delta.y = max( max( t.r, t.g ), t.b );","vec2 edges = step( threshold, delta.xy );","if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){n.default.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==o?o:0,void 0===i.default&&console.error("THREE.SSAARenderPass relies on THREE.CopyShader");var s=i.default;this.copyUniforms=a.UniformsUtils.clone(s.uniforms),this.copyMaterial=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.camera2=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene2=new a.Scene,this.quad2=new a.Mesh(new a.PlaneBufferGeometry(2,2),this.copyMaterial),this.quad2.frustumCulled=!1,this.scene2.add(this.quad2)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var n=s.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1;var o=e.getClearColor().getHex(),l=e.getClearAlpha(),u=1/n.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;for(var c=r.width,f=r.height,d=0;d","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );","float gg = fract( coord.t * ( size.y / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float readDepth( const in vec2 coord ) {","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","#ifdef USE_LOGDEPTHBUF","float logz = unpackRGBAToDepth( texture2D( tDepth, coord ) );","float w = pow(2.0, (logz / logDepthBufFC)) - 1.0;","float z = (logz / w) + 1.0;","#else","float z = unpackRGBAToDepth( texture2D( tDepth, coord ) );","#endif","return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 8.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + radius * vv;","vec2 coord2 = vUv - radius * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float ao = 0.0;","float dz = 1.0 / float( samples );","float l = 0.0;","float z = 1.0 - dz / 2.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","float pw = cos( l ) * r;","float ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{type:"t",value:null},luminosityThreshold:{type:"f",value:1},smoothWidth:{type:"f",value:1},defaultColor:{type:"c",value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(0)},defaultOpacity:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","gl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var n=r(40);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}));var i=r(48);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}));var o=r(90);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}));var s=r(112);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})}));var l=r(144);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VRControls=t.TransformControls=t.TrackballControls=t.PointerLockControls=t.OrthographicTrackballControls=t.OrbitControls=t.FlyControls=t.FirstPersonControls=t.EditorControls=t.DragControls=t.DeviceOrientationControls=void 0;var a=p(r(29)),n=p(r(30)),i=p(r(31)),o=p(r(32)),s=p(r(33)),l=p(r(34)),u=p(r(35)),c=p(r(36)),f=p(r(37)),d=p(r(38)),h=p(r(39));function p(e){return e&&e.__esModule?e:{default:e}}t.DeviceOrientationControls=a.default,t.DragControls=n.default,t.EditorControls=i.default,t.FirstPersonControls=o.default,t.FlyControls=s.default,t.OrbitControls=l.default,t.OrthographicTrackballControls=u.default,t.PointerLockControls=c.default,t.TrackballControls=f.default,t.TransformControls=d.default,t.VRControls=h.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r,n,i,o,s=function(e){t.deviceOrientation=e},l=function(){t.screenOrientation=window.orientation||0},u=(r=new a.Vector3(0,0,1),n=new a.Euler,i=new a.Quaternion,o=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),function(e,t,a,s,l){n.set(a,t,-s,"YXZ"),e.setFromEuler(n),e.multiply(o),e.multiply(i.setFromAxisAngle(r,-l))});this.connect=function(){l(),window.addEventListener("orientationchange",l,!1),window.addEventListener("deviceorientation",s,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",l,!1),window.removeEventListener("deviceorientation",s,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var r=e.alpha?a.Math.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?a.Math.degToRad(e.beta):0,i=e.gamma?a.Math.degToRad(e.gamma):0,o=t.screenOrientation?a.Math.degToRad(t.screenOrientation):0;u(t.object.quaternion,r,n,i,o)}}},this.dispose=function(){t.disconnect()},this.connect()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t,r){if(e instanceof a.Camera){console.warn("THREE.DragControls: Constructor now expects ( objects, camera, domElement )");var n=e;e=t,t=n}var i=new a.Plane,o=new a.Raycaster,s=new a.Vector2,l=new a.Vector3,u=new a.Vector3,c=null,f=null,d=this;function h(){r.addEventListener("mousemove",m,!1),r.addEventListener("mousedown",v,!1),r.addEventListener("mouseup",g,!1),r.addEventListener("mouseleave",g,!1),r.addEventListener("touchmove",y,!1),r.addEventListener("touchstart",b,!1),r.addEventListener("touchend",w,!1)}function p(){r.removeEventListener("mousemove",m,!1),r.removeEventListener("mousedown",v,!1),r.removeEventListener("mouseup",g,!1),r.removeEventListener("mouseleave",g,!1),r.removeEventListener("touchmove",y,!1),r.removeEventListener("touchstart",b,!1),r.removeEventListener("touchend",w,!1)}function m(a){a.preventDefault();var n=r.getBoundingClientRect();if(s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c});o.setFromCamera(s,t);var h=o.intersectObjects(e);if(h.length>0){var p=h[0].object;i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),p.position),f!==p&&(d.dispatchEvent({type:"hoveron",object:p}),r.style.cursor="pointer",f=p)}else null!==f&&(d.dispatchEvent({type:"hoveroff",object:f}),r.style.cursor="auto",f=null)}function v(a){a.preventDefault(),o.setFromCamera(s,t);var n=o.intersectObjects(e);n.length>0&&(c=n[0].object,o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function g(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}function y(e){e.preventDefault(),e=e.changedTouches[0];var a=r.getBoundingClientRect();if(s.x=(e.clientX-a.left)/a.width*2-1,s.y=-(e.clientY-a.top)/a.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c})}function b(a){a.preventDefault(),a=a.changedTouches[0];var n=r.getBoundingClientRect();s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t);var f=o.intersectObjects(e);f.length>0&&(c=f[0].object,i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),c.position),o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function w(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}h(),this.enabled=!0,this.activate=h,this.deactivate=p,this.dispose=function(){p()},this.setObjects=function(){console.error("THREE.DragControls: setObjects() has been removed.")},this.on=function(e,t){console.warn("THREE.DragControls: on() has been deprecated. Use addEventListener() instead."),d.addEventListener(e,t)},this.off=function(e,t){console.warn("THREE.DragControls: off() has been deprecated. Use removeEventListener() instead."),d.removeEventListener(e,t)},this.notify=function(e){console.error("THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead."),d.dispatchEvent({type:e})}};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){t=void 0!==t?t:document,this.enabled=!0,this.center=new a.Vector3,this.panSpeed=.001,this.zoomSpeed=.001,this.rotationSpeed=.005;var r=this,n=new a.Vector3,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2},o=i.NONE,s=this.center,l=new a.Matrix3,u=new a.Vector2,c=new a.Vector2,f=new a.Spherical,d={type:"change"};function h(e){!1!==r.enabled&&(0===e.button?o=i.ROTATE:1===e.button?o=i.ZOOM:2===e.button&&(o=i.PAN),c.set(e.clientX,e.clientY),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",m,!1),t.addEventListener("mouseout",m,!1),t.addEventListener("dblclick",m,!1))}function p(e){if(!1!==r.enabled){u.set(e.clientX,e.clientY);var t=u.x-c.x,n=u.y-c.y;o===i.ROTATE?r.rotate(new a.Vector3(-t*r.rotationSpeed,-n*r.rotationSpeed,0)):o===i.ZOOM?r.zoom(new a.Vector3(0,0,n)):o===i.PAN&&r.pan(new a.Vector3(-t,n,0)),c.set(e.clientX,e.clientY)}}function m(e){t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),o=i.NONE}function v(e){e.preventDefault(),r.zoom(new a.Vector3(0,0,e.deltaY))}function g(e){e.preventDefault()}this.focus=function(t){var n,i=(new a.Box3).setFromObject(t);!1===i.isEmpty()?(s.copy(i.getCenter()),n=i.getBoundingSphere().radius):(s.setFromMatrixPosition(t.matrixWorld),n=.1);var o=new a.Vector3(0,0,1);o.applyQuaternion(e.quaternion),o.multiplyScalar(4*n),e.position.copy(s).add(o),r.dispatchEvent(d)},this.pan=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.panSpeed),t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),s.add(t),r.dispatchEvent(d)},this.zoom=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.zoomSpeed),t.length()>a||(t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),r.dispatchEvent(d))},this.rotate=function(t){n.copy(e.position).sub(s),f.setFromVector3(n),f.theta+=t.x,f.phi+=t.y,f.makeSafe(),n.setFromSpherical(f),e.position.copy(s).add(n),e.lookAt(s),r.dispatchEvent(d)},this.dispose=function(){t.removeEventListener("contextmenu",g,!1),t.removeEventListener("mousedown",h,!1),t.removeEventListener("wheel",v,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),t.removeEventListener("touchstart",x,!1),t.removeEventListener("touchmove",_,!1)},t.addEventListener("contextmenu",g,!1),t.addEventListener("mousedown",h,!1),t.addEventListener("wheel",v,!1);var y=[new a.Vector3,new a.Vector3,new a.Vector3],b=[new a.Vector3,new a.Vector3,new a.Vector3],w=null;function x(e){if(!1!==r.enabled){switch(e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0);break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0),w=y[0].distanceTo(y[1])}b[0].copy(y[0]),b[1].copy(y[1])}}function _(e){if(!1!==r.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0),r.rotate(y[0].sub(o(y[0],b)).multiplyScalar(-r.rotationSpeed));break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0);var t=y[0].distanceTo(y[1]);r.zoom(new a.Vector3(0,0,w-t)),w=t;var n=y[0].clone().sub(o(y[0],b)),i=y[1].clone().sub(o(y[1],b));n.x=-n.x,i.x=-i.x,r.pan(n.add(i).multiplyScalar(.5))}b[0].copy(y[0]),b[1].copy(y[1])}function o(e,t){var r=t[0];for(var a in t)r.distanceTo(e)>t[a].distanceTo(e)&&(r=t[a]);return r}}t.addEventListener("touchstart",x,!1),t.addEventListener("touchmove",_,!1)};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e){e.preventDefault()}this.object=e,this.target=new a.Vector3(0,0,0),this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.lookSpeed=.005,this.lookVertical=!0,this.autoForward=!1,this.activeLook=!0,this.heightSpeed=!1,this.heightCoef=1,this.heightMin=0,this.heightMax=1,this.constrainVertical=!1,this.verticalMin=0,this.verticalMax=Math.PI,this.autoSpeedFactor=0,this.mouseX=0,this.mouseY=0,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.moveForward=!1,this.moveBackward=!1,this.moveLeft=!1,this.moveRight=!1,this.mouseDragOn=!1,this.viewHalfX=0,this.viewHalfY=0,this.domElement!==document&&this.domElement.setAttribute("tabindex",-1),this.handleResize=function(){this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)},this.onMouseDown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0},this.onMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1},this.onMouseMove=function(e){this.domElement===document?(this.mouseX=e.pageX-this.viewHalfX,this.mouseY=e.pageY-this.viewHalfY):(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)},this.onKeyDown=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0}},this.onKeyUp=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}},this.update=function(e){if(!1!==this.enabled){if(this.heightSpeed){var t=a.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;var r=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(r+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(r),this.moveLeft&&this.object.translateX(-r),this.moveRight&&this.object.translateX(r),this.moveUp&&this.object.translateY(r),this.moveDown&&this.object.translateY(-r);var n=e*this.lookSpeed;this.activeLook||(n=0);var i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon+=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*i),this.lat=Math.max(-85,Math.min(85,this.lat)),this.phi=a.Math.degToRad(90-this.lat),this.theta=a.Math.degToRad(this.lon),this.constrainVertical&&(this.phi=a.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax));var o=this.target,s=this.object.position;o.x=s.x+100*Math.sin(this.phi)*Math.cos(this.theta),o.y=s.y+100*Math.cos(this.phi),o.z=s.z+100*Math.sin(this.phi)*Math.sin(this.theta),this.object.lookAt(o)}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",r,!1),this.domElement.removeEventListener("mousedown",i,!1),this.domElement.removeEventListener("mousemove",n,!1),this.domElement.removeEventListener("mouseup",o,!1),window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",l,!1)};var n=u(this,this.onMouseMove),i=u(this,this.onMouseDown),o=u(this,this.onMouseUp),s=u(this,this.onKeyDown),l=u(this,this.onKeyUp);function u(e,t){return function(){t.apply(e,arguments)}}this.domElement.addEventListener("contextmenu",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mouseup",o,!1),window.addEventListener("keydown",s,!1),window.addEventListener("keyup",l,!1),this.handleResize()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e,t){return function(){t.apply(e,arguments)}}function n(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this.tmpQuaternion=new a.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new a.Vector3(0,0,0),this.rotationVector=new a.Vector3(0,0,0),this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)},this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),r=t.size[0]/2,a=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-a)/a,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){var t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order)},this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",n,!1),this.domElement.removeEventListener("mousedown",o,!1),this.domElement.removeEventListener("mousemove",i,!1),this.domElement.removeEventListener("mouseup",s,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",u,!1)};var i=r(this,this.mousemove),o=r(this,this.mousedown),s=r(this,this.mouseup),l=r(this,this.keydown),u=r(this,this.keyup);this.domElement.addEventListener("contextmenu",n,!1),this.domElement.addEventListener("mousemove",i,!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mouseup",s,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",u,!1),this.updateMovementVector(),this.updateRotationVector()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),h=d.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&h===d.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),y.set(0,0,0)),g=1,!!(b||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,R=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),k=function(){var e=new a.Vector3;return function(t,r){!0===l.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var a=l.domElement===document?l.domElement.body:l.domElement;if(l.object.isPerspectiveCamera){var n=l.object.position;e.copy(n).sub(l.target);var i=e.length();i*=Math.tan(l.object.fov/2*Math.PI/180),R(2*t*i/a.clientHeight,l.object.matrix),k(2*r*i/a.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(R(t*(l.object.right-l.object.left)/l.object.zoom/a.clientWidth,l.object.matrix),k(r*(l.object.top-l.object.bottom)/l.object.zoom/a.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object.isPerspectiveCamera?g/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object.isPerspectiveCamera?g*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(c),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);A.set(n,i)}}(e),h=d.TOUCH_DOLLY_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;if(h!==d.TOUCH_DOLLY_PAN)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.set(0,Math.pow(T.y/M.y,l.zoomSpeed)),N(P.y),M.copy(T)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);E.set(n,i),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E)}l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.radius=0,this.rotateSpeed=1,this.zoomSpeed=1.2,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.keys=[65,83,68],this.target=new a.Vector3;var i=!0,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector3,c=new a.Vector3,f=new a.Vector2,d=new a.Vector2,h=0,p=0,m=new a.Vector2,v=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom;var g={type:"change"},y={type:"start"},b={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}this.radius=.5*Math.min(this.screen.width,this.screen.height),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var w,x,_,A,E,S,M=(w=new a.Vector2,function(e,t){return w.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),w}),T=function(){var e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(a,i){n.set((a-.5*r.screen.width-r.screen.left)/r.radius,(.5*r.screen.height+r.screen.top-i)/r.radius,0);var o=n.length();return r.noRoll?o1?n.normalize():n.z=Math.sqrt(1-o*o),l.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(n.y),e.add(t.copy(r.object.up).cross(l).setLength(n.x)),e.add(l.setLength(n.z)),e}}();function P(e){!1!==r.enabled&&(window.removeEventListener("keydown",P),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function F(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",P,!1))}function O(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(m.copy(M(e.pageX,e.pageY)),v.copy(m)):(f.copy(M(e.pageX,e.pageY)),d.copy(f)):(u.copy(T(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",L,!1),document.addEventListener("mouseup",C,!1),r.dispatchEvent(y))}function L(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||v.copy(M(e.pageX,e.pageY)):d.copy(M(e.pageX,e.pageY)):c.copy(T(e.pageX,e.pageY)))}function C(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",C),r.dispatchEvent(b))}function R(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),f.y+=.01*e.deltaY,r.dispatchEvent(y),r.dispatchEvent(b))}function k(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,u.copy(T(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;case 2:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=h=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(M(i,s)),v.copy(m);break;default:o=n.NONE}r.dispatchEvent(y)}}function I(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(i,s));break;default:o=n.NONE}}function N(e){if(!1!==r.enabled){switch(e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;case 2:h=p=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,a=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(t,a)),m.copy(v)}o=n.NONE,r.dispatchEvent(b)}}function D(e){e.preventDefault()}this.rotateCamera=(x=new a.Vector3,_=new a.Quaternion,function(){var e=Math.acos(u.dot(c)/u.length()/c.length());e&&(x.crossVectors(u,c).normalize(),e*=r.rotateSpeed,_.setFromAxisAngle(x,-e),l.applyQuaternion(_),r.object.up.applyQuaternion(_),c.applyQuaternion(_),r.staticMoving?u.copy(c):(_.setFromAxisAngle(x,e*(r.dynamicDampingFactor-1)),u.applyQuaternion(_)),i=!0)}),this.zoomCamera=function(){if(o===n.TOUCH_ZOOM_PAN){var e=p/h;h=p,r.object.zoom*=e,i=!0}else{e=1+(d.y-f.y)*r.zoomSpeed;Math.abs(e-1)>1e-6&&e>0&&(r.object.zoom/=e,r.staticMoving?f.copy(d):f.y+=(d.y-f.y)*this.dynamicDampingFactor,i=!0)}},this.panCamera=(A=new a.Vector2,E=new a.Vector3,S=new a.Vector3,function(){if(A.copy(v).sub(m),A.lengthSq()){var e=(r.object.right-r.object.left)/r.object.zoom,t=(r.object.top-r.object.bottom)/r.object.zoom;A.x*=e,A.y*=t,S.copy(l).cross(r.object.up).setLength(A.x),S.add(E.copy(r.object.up).setLength(A.y)),r.object.position.add(S),r.target.add(S),r.staticMoving?m.copy(v):m.add(A.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)),i=!0}}),this.update=function(){l.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||(r.zoomCamera(),i&&r.object.updateProjectionMatrix()),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,l),r.object.lookAt(r.target),i&&(r.dispatchEvent(g),i=!1)},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.left=r.left0,r.object.right=r.right0,r.object.top=r.top0,r.object.bottom=r.bottom0,r.object.lookAt(r.target),r.dispatchEvent(g),i=!1},this.dispose=function(){this.domElement.removeEventListener("contextmenu",D,!1),this.domElement.removeEventListener("mousedown",O,!1),this.domElement.removeEventListener("wheel",R,!1),this.domElement.removeEventListener("touchstart",k,!1),this.domElement.removeEventListener("touchend",N,!1),this.domElement.removeEventListener("touchmove",I,!1),document.removeEventListener("mousemove",L,!1),document.removeEventListener("mouseup",C,!1),window.removeEventListener("keydown",P,!1),window.removeEventListener("keyup",F,!1)},this.domElement.addEventListener("contextmenu",D,!1),this.domElement.addEventListener("mousedown",O,!1),this.domElement.addEventListener("wheel",R,!1),this.domElement.addEventListener("touchstart",k,!1),this.domElement.addEventListener("touchend",N,!1),this.domElement.addEventListener("touchmove",I,!1),window.addEventListener("keydown",P,!1),window.addEventListener("keyup",F,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;e.rotation.set(0,0,0);var r=new a.Object3D;r.add(e);var n=new a.Object3D;n.position.y=10,n.add(r);var i,o,s=Math.PI/2,l=function(e){if(!1!==t.enabled){var a=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;n.rotation.y-=.002*a,r.rotation.x-=.002*i,r.rotation.x=Math.max(-s,Math.min(s,r.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",l,!1)},document.addEventListener("mousemove",l,!1),this.enabled=!1,this.getObject=function(){return n},this.getDirection=(i=new a.Vector3(0,0,-1),o=new a.Euler(0,0,0,"YXZ"),function(e){return o.set(r.rotation.x,n.rotation.y,0),e.copy(i).applyEuler(o),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new a.Vector3;var i=new a.Vector3,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector2,c=new a.Vector2,f=new a.Vector3,d=0,h=new a.Vector2,p=new a.Vector2,m=0,v=0,g=new a.Vector2,y=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var b={type:"change"},w={type:"start"},x={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var _,A,E,S,M,T,P,F,O,L,C,R=(_=new a.Vector2,function(e,t){return _.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),_}),k=function(){var e=new a.Vector2;return function(t,a){return e.set((t-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-a))/r.screen.width),e}}();function I(e){!1!==r.enabled&&(window.removeEventListener("keydown",I),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function N(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",I,!1))}function D(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(g.copy(R(e.pageX,e.pageY)),y.copy(g)):(h.copy(R(e.pageX,e.pageY)),p.copy(h)):(c.copy(k(e.pageX,e.pageY)),u.copy(c)),document.addEventListener("mousemove",U,!1),document.addEventListener("mouseup",j,!1),r.dispatchEvent(w))}function U(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||y.copy(R(e.pageX,e.pageY)):p.copy(R(e.pageX,e.pageY)):(u.copy(c),c.copy(k(e.pageX,e.pageY))))}function j(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",j),r.dispatchEvent(x))}function B(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:h.y-=.025*e.deltaY;break;case 1:h.y-=.01*e.deltaY;break;default:h.y-=25e-5*e.deltaY}r.dispatchEvent(w),r.dispatchEvent(x)}}function V(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,c.copy(k(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;default:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=m=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;g.copy(R(i,s)),y.copy(g)}r.dispatchEvent(w)}}function z(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:u.copy(c),c.copy(k(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=Math.sqrt(t*t+a*a);var n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;y.copy(R(n,i))}}function G(e){if(!1!==r.enabled){switch(e.touches.length){case 0:o=n.NONE;break;case 1:o=n.TOUCH_ROTATE,c.copy(k(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c)}r.dispatchEvent(x)}}function H(e){!1!==r.enabled&&e.preventDefault()}this.rotateCamera=(E=new a.Vector3,S=new a.Quaternion,M=new a.Vector3,T=new a.Vector3,P=new a.Vector3,F=new a.Vector3,function(){F.set(c.x-u.x,c.y-u.y,0),(A=F.length())?(l.copy(r.object.position).sub(r.target),M.copy(l).normalize(),T.copy(r.object.up).normalize(),P.crossVectors(T,M).normalize(),T.setLength(c.y-u.y),P.setLength(c.x-u.x),F.copy(T.add(P)),E.crossVectors(F,l).normalize(),A*=r.rotateSpeed,S.setFromAxisAngle(E,A),l.applyQuaternion(S),r.object.up.applyQuaternion(S),f.copy(E),d=A):!r.staticMoving&&d&&(d*=Math.sqrt(1-r.dynamicDampingFactor),l.copy(r.object.position).sub(r.target),S.setFromAxisAngle(f,d),l.applyQuaternion(S),r.object.up.applyQuaternion(S)),u.copy(c)}),this.zoomCamera=function(){var e;o===n.TOUCH_ZOOM_PAN?(e=m/v,m=v,l.multiplyScalar(e)):(1!==(e=1+(p.y-h.y)*r.zoomSpeed)&&e>0&&l.multiplyScalar(e),r.staticMoving?h.copy(p):h.y+=(p.y-h.y)*this.dynamicDampingFactor)},this.panCamera=(O=new a.Vector2,L=new a.Vector3,C=new a.Vector3,function(){O.copy(y).sub(g),O.lengthSq()&&(O.multiplyScalar(l.length()*r.panSpeed),C.copy(l).cross(r.object.up).setLength(O.x),C.add(L.copy(r.object.up).setLength(O.y)),r.object.position.add(C),r.target.add(C),r.staticMoving?g.copy(y):g.add(O.subVectors(y,g).multiplyScalar(r.dynamicDampingFactor)))}),this.checkDistances=function(){r.noZoom&&r.noPan||(l.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,l.setLength(r.maxDistance)),h.copy(p)),l.lengthSq()1e-6&&(r.dispatchEvent(b),i.copy(r.object.position))},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(b),i.copy(r.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",H,!1),this.domElement.removeEventListener("mousedown",D,!1),this.domElement.removeEventListener("wheel",B,!1),this.domElement.removeEventListener("touchstart",V,!1),this.domElement.removeEventListener("touchend",G,!1),this.domElement.removeEventListener("touchmove",z,!1),document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",I,!1),window.removeEventListener("keyup",N,!1)},this.domElement.addEventListener("contextmenu",H,!1),this.domElement.addEventListener("mousedown",D,!1),this.domElement.addEventListener("wheel",B,!1),this.domElement.addEventListener("touchstart",V,!1),this.domElement.addEventListener("touchend",G,!1),this.domElement.addEventListener("touchmove",z,!1),window.addEventListener("keydown",I,!1),window.addEventListener("keyup",N,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){var e=function(e){a.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.side=a.FrontSide,this.transparent=!0,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(e.prototype=Object.create(a.MeshBasicMaterial.prototype)).constructor=e;var t=function(e){a.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.transparent=!0,this.linewidth=1,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(t.prototype=Object.create(a.LineBasicMaterial.prototype)).constructor=t;var r=new e({visible:!1,transparent:!1}),n=function(){this.init=function(){a.Object3D.call(this),this.handles=new a.Object3D,this.pickers=new a.Object3D,this.planes=new a.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new a.PlaneBufferGeometry(50,50,2,2),t=new a.MeshBasicMaterial({visible:!1,side:a.DoubleSide}),r={XY:new a.Mesh(e,t),YZ:new a.Mesh(e,t),XZ:new a.Mesh(e,t),XYZE:new a.Mesh(e,t)};for(var n in this.activePlane=r.XYZE,r.YZ.rotation.set(0,Math.PI/2,0),r.XZ.rotation.set(-Math.PI/2,0,0),r)r[n].name=n,this.planes.add(r[n]),this.planes[n]=r[n];var i=function(e,t){for(var r in e)for(n=e[r].length;n--;){var a=e[r][n][0],i=e[r][n][1],o=e[r][n][2];a.name=r,a.renderOrder=1/0,i&&a.position.set(i[0],i[1],i[2]),o&&a.rotation.set(o[0],o[1],o[2]),t.add(a)}};i(this.handleGizmos,this.handles),i(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof a.Mesh){e.updateMatrix();var t=e.geometry.clone();t.applyMatrix(e.matrix),e.geometry=t,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))},this.highlight=function(e){this.traverse((function(t){t.material&&t.material.highlight&&(t.name===e?t.material.highlight(!0):t.material.highlight(!1))}))}};(n.prototype=Object.create(a.Object3D.prototype)).constructor=n,n.prototype.update=function(e,t){var r=new a.Vector3(0,0,0),n=new a.Vector3(0,1,0),i=new a.Matrix4;this.traverse((function(a){-1!==a.name.search("E")?a.quaternion.setFromRotationMatrix(i.lookAt(t,r,n)):-1===a.name.search("X")&&-1===a.name.search("Y")&&-1===a.name.search("Z")||a.quaternion.setFromEuler(e)}))};var i=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.CylinderGeometry(0,.05,.2,12,1,!1));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),new e({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),r)]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()};(i.prototype=Object.create(n.prototype)).constructor=i;var o=function(){n.call(this);var e=function(e,t,r){var n=new a.BufferGeometry,i=[];r=r||1;for(var o=0;o<=64*r;++o)"x"===t&&i.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&i.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&i.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return n.addAttribute("position",new a.Float32BufferAttribute(i,3)),n};this.handleGizmos={X:[[new a.Line(new e(1,"x",.5),new t({color:16711680}))]],Y:[[new a.Line(new e(1,"y",.5),new t({color:65280}))]],Z:[[new a.Line(new e(1,"z",.5),new t({color:255}))]],E:[[new a.Line(new e(1.25,"z",1),new t({color:13421568}))]],XYZE:[[new a.Line(new e(1,"z",1),new t({color:7895160}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusBufferGeometry(1.25,.12,2,24),r)]],XYZE:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,2,24),r)]]},this.pickerGizmos.XYZE[0][0].visible=!1,this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){n.prototype.update.apply(this,arguments);var r=new a.Matrix4,i=new a.Euler(0,0,1),o=new a.Quaternion,s=new a.Vector3(1,0,0),l=new a.Vector3(0,1,0),u=new a.Vector3(0,0,1),c=new a.Quaternion,f=new a.Quaternion,d=new a.Quaternion,h=t.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),r.makeRotationFromQuaternion(o).getInverse(r),h.applyMatrix4(r),this.traverse((function(e){o.setFromEuler(i),"X"===e.name&&(c.setFromAxisAngle(s,Math.atan2(-h.y,h.z)),o.multiplyQuaternions(o,c),e.quaternion.copy(o)),"Y"===e.name&&(f.setFromAxisAngle(l,Math.atan2(h.x,h.z)),o.multiplyQuaternions(o,f),e.quaternion.copy(o)),"Z"===e.name&&(d.setFromAxisAngle(u,Math.atan2(h.y,h.x)),o.multiplyQuaternions(o,d),e.quaternion.copy(o))}))},this.init()};(o.prototype=Object.create(n.prototype)).constructor=o;var s=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.BoxGeometry(.125,.125,.125));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.125,.125,.125),new e({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.4,.4,.4),r)]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()};(s.prototype=Object.create(n.prototype)).constructor=s;var l=function(e,t){a.Object3D.call(this),t=void 0!==t?t:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var r=this,n="translate",l=!1,u={translate:new i,rotate:new o,scale:new s};for(var c in u){var f=u[c];f.visible=c===n,this.add(f)}var d={type:"change"},h={type:"mouseDown"},p={type:"mouseUp",mode:n},m={type:"objectChange"},v=new a.Raycaster,g=new a.Vector2,y=new a.Vector3,b=new a.Vector3,w=new a.Vector3,x=new a.Vector3,_=1,A=new a.Matrix4,E=new a.Vector3,S=new a.Matrix4,M=new a.Vector3,T=new a.Quaternion,P=new a.Vector3(1,0,0),F=new a.Vector3(0,1,0),O=new a.Vector3(0,0,1),L=new a.Quaternion,C=new a.Quaternion,R=new a.Quaternion,k=new a.Quaternion,I=new a.Quaternion,N=new a.Vector3,D=new a.Vector3,U=new a.Matrix4,j=new a.Matrix4,B=new a.Vector3,V=new a.Vector3,z=new a.Euler,G=new a.Matrix4,H=new a.Vector3,X=new a.Euler;function Y(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,u[n].pickers.children),a=null;t&&(a=t.object.name,e.preventDefault()),r.axis!==a&&(r.axis=a,r.update(),r.dispatchEvent(d))}}function W(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=e.changedTouches?e.changedTouches[0]:e;if(0===t.button||void 0===t.button){var a=Z(t,u[n].pickers.children);if(a){e.preventDefault(),e.stopPropagation(),r.axis=a.object.name,r.dispatchEvent(h),r.update(),E.copy(H).sub(V).normalize(),u[n].setActivePlane(r.axis,E);var i=Z(t,[u[n].activePlane]);i&&(N.copy(r.object.position),D.copy(r.object.scale),U.extractRotation(r.object.matrix),G.extractRotation(r.object.matrixWorld),j.extractRotation(r.object.parent.matrixWorld),B.setFromMatrixScale(S.getInverse(r.object.parent.matrixWorld)),b.copy(i.point))}}l=!0}}function q(e){if(void 0!==r.object&&null!==r.axis&&!1!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,[u[n].activePlane]);!1!==t&&(e.preventDefault(),e.stopPropagation(),y.copy(t.point),"translate"===n?(y.sub(b),y.multiply(B),"local"===r.space&&(y.applyMatrix4(S.getInverse(G)),-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(U),r.object.position.copy(N),r.object.position.add(y)),"world"!==r.space&&-1===r.axis.search("XYZ")||(-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(S.getInverse(j)),r.object.position.copy(N),r.object.position.add(y)),null!==r.translationSnap&&("local"===r.space&&r.object.position.applyMatrix4(S.getInverse(G)),-1!==r.axis.search("X")&&(r.object.position.x=Math.round(r.object.position.x/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Y")&&(r.object.position.y=Math.round(r.object.position.y/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Z")&&(r.object.position.z=Math.round(r.object.position.z/r.translationSnap)*r.translationSnap),"local"===r.space&&r.object.position.applyMatrix4(G))):"scale"===n?(y.sub(b),y.multiply(B),"local"===r.space&&("XYZ"===r.axis?(_=1+y.y/Math.max(D.x,D.y,D.z),r.object.scale.x=D.x*_,r.object.scale.y=D.y*_,r.object.scale.z=D.z*_):(y.applyMatrix4(S.getInverse(G)),"X"===r.axis&&(r.object.scale.x=D.x*(1+y.x/D.x)),"Y"===r.axis&&(r.object.scale.y=D.y*(1+y.y/D.y)),"Z"===r.axis&&(r.object.scale.z=D.z*(1+y.z/D.z))))):"rotate"===n&&(y.sub(V),y.multiply(B),M.copy(b).sub(V),M.multiply(B),"E"===r.axis?(y.applyMatrix4(S.getInverse(A)),M.applyMatrix4(S.getInverse(A)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),I.setFromAxisAngle(E,w.z-x.z),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,I),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"XYZE"===r.axis?(I.setFromEuler(y.clone().cross(M).normalize()),T.setFromRotationMatrix(S.getInverse(j)),C.setFromAxisAngle(I,-y.clone().angleTo(M)),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,C),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"local"===r.space?(y.applyMatrix4(S.getInverse(G)),M.applyMatrix4(S.getInverse(G)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),L.setFromRotationMatrix(U),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),R.setFromAxisAngle(F,w.y-x.y),k.setFromAxisAngle(O,w.z-x.z)),"X"===r.axis&&L.multiplyQuaternions(L,C),"Y"===r.axis&&L.multiplyQuaternions(L,R),"Z"===r.axis&&L.multiplyQuaternions(L,k),r.object.quaternion.copy(L)):"world"===r.space&&(w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),R.setFromAxisAngle(F,w.y-x.y),k.setFromAxisAngle(O,w.z-x.z)),L.setFromRotationMatrix(G),"X"===r.axis&&T.multiplyQuaternions(T,C),"Y"===r.axis&&T.multiplyQuaternions(T,R),"Z"===r.axis&&T.multiplyQuaternions(T,k),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T))),r.update(),r.dispatchEvent(d),r.dispatchEvent(m))}}function Q(e){e.preventDefault(),void 0!==e.button&&0!==e.button||(l&&null!==r.axis&&(p.mode=n,r.dispatchEvent(p)),l=!1,"TouchEvent"in window&&e instanceof TouchEvent?(r.axis=null,r.update(),r.dispatchEvent(d)):Y(e))}function Z(r,a){var n=t.getBoundingClientRect(),i=(r.clientX-n.left)/n.width,o=(r.clientY-n.top)/n.height;g.set(2*i-1,-2*o+1),v.setFromCamera(g,e);var s=v.intersectObjects(a,!0);return!!s[0]&&s[0]}t.addEventListener("mousedown",W,!1),t.addEventListener("touchstart",W,!1),t.addEventListener("mousemove",Y,!1),t.addEventListener("touchmove",Y,!1),t.addEventListener("mousemove",q,!1),t.addEventListener("touchmove",q,!1),t.addEventListener("mouseup",Q,!1),t.addEventListener("mouseout",Q,!1),t.addEventListener("touchend",Q,!1),t.addEventListener("touchcancel",Q,!1),t.addEventListener("touchleave",Q,!1),this.dispose=function(){t.removeEventListener("mousedown",W),t.removeEventListener("touchstart",W),t.removeEventListener("mousemove",Y),t.removeEventListener("touchmove",Y),t.removeEventListener("mousemove",q),t.removeEventListener("touchmove",q),t.removeEventListener("mouseup",Q),t.removeEventListener("mouseout",Q),t.removeEventListener("touchend",Q),t.removeEventListener("touchcancel",Q),t.removeEventListener("touchleave",Q)},this.attach=function(e){this.object=e,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return n},this.setMode=function(e){for(var t in"scale"===(n=e||n)&&(r.space="local"),u)u[t].visible=t===n;this.update(),r.dispatchEvent(d)},this.setTranslationSnap=function(e){r.translationSnap=e},this.setRotationSnap=function(e){r.rotationSnap=e},this.setSize=function(e){r.size=e,this.update(),r.dispatchEvent(d)},this.setSpace=function(e){r.space=e,this.update(),r.dispatchEvent(d)},this.update=function(){void 0!==r.object&&(r.object.updateMatrixWorld(),V.setFromMatrixPosition(r.object.matrixWorld),z.setFromRotationMatrix(S.extractRotation(r.object.matrixWorld)),e.updateMatrixWorld(),H.setFromMatrixPosition(e.matrixWorld),X.setFromRotationMatrix(S.extractRotation(e.matrixWorld)),_=V.distanceTo(H)/6*r.size,this.position.copy(V),this.scale.set(_,_,_),e instanceof a.PerspectiveCamera?E.copy(H).sub(V).normalize():e instanceof a.OrthographicCamera&&E.copy(H).normalize(),"local"===r.space?u[n].update(z,E):"world"===r.space&&u[n].update(new a.Euler,E),u[n].highlight(r.axis))}};return(l.prototype=Object.create(a.Object3D.prototype)).constructor=l,l}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){var r,n,i=this,o=new a.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")})).catch((function(){console.warn("THREE.VRControls: Unable to get VR Displays")})),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return o},this.update=function(){var t;r&&(r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(i.scale))},this.dispose=function(){r=null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedGeometryExporter=t.STLExporter=t.STLBinaryExporter=t.PLYExporter=t.OBJExporter=t.MMDExporter=t.GLTFExporter=void 0;var a=c(r(41)),n=c(r(42)),i=c(r(43)),o=c(r(44)),s=c(r(45)),l=c(r(46)),u=c(r(47));function c(e){return e&&e.__esModule?e:{default:e}}t.GLTFExporter=a.default,t.MMDExporter=n.default,t.OBJExporter=i.default,t.PLYExporter=o.default,t.STLBinaryExporter=s.default,t.STLExporter=l.default,t.TypedGeometryExporter=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987},i={1003:n.NEAREST,1004:n.NEAREST_MIPMAP_NEAREST,1005:n.NEAREST_MIPMAP_LINEAR,1006:n.LINEAR,1007:n.LINEAR_MIPMAP_NEAREST,1008:n.LINEAR_MIPMAP_LINEAR},o={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},s=function(){};s.prototype={constructor:s,parse:function(e,t,r){(r=Object.assign({},{trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,animations:[],forceIndices:!1,forcePowerOfTwoTextures:!1},r)).animations.length>0&&(r.trs=!0);var s,l={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},u=0,c=[],f=[],d=new Map,h=[],p={},m={attributes:new Map,materials:new Map,textures:new Map};function v(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}function g(e){return 4*Math.ceil(e/4)}function y(e,t){t=t||0;var r=g(e.byteLength);if(r!==e.byteLength){var a=new Uint8Array(r);if(a.set(new Uint8Array(e)),0!==t)for(var n=e.byteLength;n0)&&(t.alphaMode=e.opacity<1?"BLEND":"MASK",e.alphaTest>0&&.5!==e.alphaTest&&(t.alphaCutoff=e.alphaTest)),e.side===a.DoubleSide&&(t.doubleSided=!0),""!==e.name&&(t.name=e.name),l.materials.push(t);var i=l.materials.length-1;return m.materials.set(e,i),i}function S(e){var t,i=e.geometry;if(e.isLineSegments)t=n.LINES;else if(e.isLineLoop)t=n.LINE_LOOP;else if(e.isLine)t=n.LINE_STRIP;else if(e.isPoints)t=n.POINTS;else{if(!i.isBufferGeometry){var o=new a.BufferGeometry;o.fromGeometry(i),i=o}e.drawMode===a.TriangleFanDrawMode?(console.warn("GLTFExporter: TriangleFanDrawMode and wireframe incompatible."),t=n.TRIANGLE_FAN):t=e.drawMode===a.TriangleStripDrawMode?e.material.wireframe?n.LINE_STRIP:n.TRIANGLE_STRIP:e.material.wireframe?n.LINES:n.TRIANGLES}var s={},u={},c=[],f=[],d={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},h=i.getAttribute("normal");for(var p in void 0===h||function(e){if(m.attributes.has(e))return!1;for(var t=new a.Vector3,r=0,n=e.count;r5e-4)return!1;return!0}(h)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.addAttribute("normal",function(e){if(m.attributes.has(e))return m.textures.get(e);for(var t=e.clone(),r=new a.Vector3,n=0,i=t.count;n0){var b=[],x=[],_={};if(void 0!==e.morphTargetDictionary)for(var A in e.morphTargetDictionary)_[e.morphTargetDictionary[A]]=A;for(var S=0;S0&&(s.extras={},s.extras.targetNames=x)}var C=r.forceIndices,R=Array.isArray(e.material);if(R&&0===e.geometry.groups.length)return null;!C&&null===i.index&&R&&(console.warn("THREE.GLTFExporter: Creating index for non-indexed multi-material mesh."),C=!0);var k=!1;if(null===i.index&&C){for(var I=[],N=(S=0,i.attributes.position.count);S0&&(j.targets=f),null!==i.index&&(j.indices=w(i.index,i,U[S].start,U[S].count));var B=E(D[U[S].materialIndex]);null!==B&&(j.material=B),c.push(j)}return k&&i.setIndex(null),s.primitives=c,l.meshes||(l.meshes=[]),l.meshes.push(s),l.meshes.length-1}function M(e,t){l.animations||(l.animations=[]);for(var r=[],n=[],i=0;i0)try{t.extras=JSON.parse(JSON.stringify(e.userData))}catch(e){throw new Error("THREE.GLTFExporter: userData can't be serialized")}if(e.isMesh||e.isLine||e.isPoints){var s=S(e);null!==s&&(t.mesh=s)}else e.isCamera&&(t.camera=function(e){l.cameras||(l.cameras=[]);var t=e.isOrthographicCamera,r={type:t?"orthographic":"perspective"};return t?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:a.Math.degToRad(e.fov)/e.aspect,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),l.cameras.push(r),l.cameras.length-1}(e));if(e.isSkinnedMesh&&h.push(e),e.children.length>0){for(var u=[],c=0,f=e.children.length;c0&&(t.children=u)}l.nodes.push(t);var g=l.nodes.length-1;return d.set(e,g),g}function F(e){l.scenes||(l.scenes=[],l.scene=0);var t={nodes:[]};""!==e.name&&(t.name=e.name),l.scenes.push(t);for(var a=[],n=0,i=e.children.length;n0&&(t.nodes=a)}!function(e){e=e instanceof Array?e:[e];for(var t=[],n=0;n0&&function(e){var t=new a.Scene;t.name="AuxScene";for(var r=0;r0&&(l.extensionsUsed=a),l.buffers&&l.buffers.length>0){l.buffers[0].byteLength=e.size;var n=new window.FileReader;if(!0===r.binary){n.readAsArrayBuffer(e),n.onloadend=function(){var e=y(n.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,e.byteLength,!0),r.setUint32(4,5130562,!0);var a=y(function(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0,a=e.length;r255?32:n}return t.buffer}(JSON.stringify(l)),32),i=new DataView(new ArrayBuffer(8));i.setUint32(0,a.byteLength,!0),i.setUint32(4,1313821514,!0);var o=new ArrayBuffer(12),s=new DataView(o);s.setUint32(0,1179937895,!0),s.setUint32(4,2,!0);var u=12+i.byteLength+a.byteLength+r.byteLength+e.byteLength;s.setUint32(8,u,!0);var c=new Blob([o,i,a,r,e],{type:"application/octet-stream"}),f=new window.FileReader;f.readAsArrayBuffer(c),f.onloadend=function(){t(f.result)}}}else n.readAsDataURL(e),n.onloadend=function(){var e=n.result;l.buffers[0].uri=e,t(l)}}else t(l)}))}},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(0)),n=i(r(4));function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.default=function(){var e;this.parseVpd=function(t,r,i){if(!0!==t.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);var t=e.toString();-1===t.indexOf(".")&&(t+=".");var r=(t+="000000").indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function s(e){for(var t=[],r=0,a=e.length;r255?(u.push(l>>8&255),u.push(255&l)):u.push(255&l)}return new Uint8Array(u)}(x):x}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(){};n.prototype={constructor:n,parse:function(e){var t,r,n,i,o,s="",l=0,u=0,c=0,f=new a.Vector3,d=new a.Vector3,h=new a.Vector2,p=[];return e.traverse((function(e){e instanceof a.Mesh&&function(e){var n=0,m=0,v=0,g=e.geometry,y=new a.Matrix3;if(g instanceof a.Geometry&&(g=(new a.BufferGeometry).setFromObject(e)),g instanceof a.BufferGeometry){var b=g.getAttribute("position"),w=g.getAttribute("normal"),x=g.getAttribute("uv"),_=g.getIndex();if(s+="o "+e.name+"\n",e.material&&e.material.name&&(s+="usemtl "+e.material.name+"\n"),void 0!==b)for(t=0,i=b.count;t=200)return void n("THREE.AssimpJSONLoader: Unsupported assimp2json file format version.")}t(i.parse(r,o))}),r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=new Array(e.length),a=0;a0&&i.addAttribute("normal",new a.Float32BufferAttribute(l,3)),u.length>0&&i.addAttribute("uv",new a.Float32BufferAttribute(u,2)),c.length>0&&i.addAttribute("color",new a.Float32BufferAttribute(c,3)),i.computeBoundingSphere(),i})),o=r(e.materials,(function(e){var t=new a.MeshPhongMaterial;for(var r in e.properties){var i=e.properties[r],o=i.key,s=i.value;switch(o){case"$tex.file":var l=i.semantic;if(1===l||2===l||5===l||6===l){var u;switch(l){case 1:u="map";break;case 2:u="specularMap";break;case 5:u="bumpMap";break;case 6:u="normalMap"}var c=n.load(s);c.wrapS=c.wrapT=a.RepeatWrapping,t[u]=c}break;case"?mat.name":t.name=s;break;case"$clr.diffuse":t.color.fromArray(s);break;case"$clr.specular":t.specular.fromArray(s);break;case"$clr.emissive":t.emissive.fromArray(s);break;case"$mat.shininess":t.shininess=s;break;case"$mat.shadingm":t.flatShading=1===s;break;case"$mat.opacity":s<1&&(t.opacity=s,t.transparent=!0)}}return t}));return function e(t,r,n,i){var o,s,l=new a.Object3D;for(l.name=r.name||"",l.matrix=(new a.Matrix4).fromArray(r.transformation).transpose(),l.matrix.decompose(l.position,l.quaternion,l.scale),o=0;r.meshes&&o0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(var e=0;e=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;for(var r=e.hierarchy[0].keys,a=0;ae){t=this.keys[a],r=this.keys[a+1];break}if(this.keys[a].time4&&(r.length=4);var n=0;for(a=0;a<4;a++)n+=r[a].w*r[a].w;n=Math.sqrt(n);for(a=0;a<4;a++)r[a].w=r[a].w/n,e[a]=r[a].i,t[a]=r[a].w}function k(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(var r in e.children){var a=k(e.children[r],t);if(a)return a}}function I(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e,t){if(0!=this.mBones.length){for(var r=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var o=C(u=i.toTHREE(e),e);this.threeNode.add(o);for(var s=0;s0&&n.addAttribute("normal",new a.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&n.addAttribute("color",new a.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&n.addAttribute("uv",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&n.addAttribute("uv1",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&n.addAttribute("tangents",new a.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&n.addAttribute("bitangents",new a.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){for(var i=[],o=[],s=0;s0&&(r=new a.SkinnedMesh(n,t)),this.threeNode=r,r}}function N(){this.mNumIndices=0,this.mIndices=[]}function D(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new a.Vector3(this.x,this.y,this.z)}}function U(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new a.Color(this.r,this.g,this.b,1)}}function j(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new a.Quaternion(this.x,this.y,this.z,this.w)}}function B(){this.mVertexId=0,this.mWeight=0}function V(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}function z(){this.mTime=0,this.mValue=null}function G(){this.mTime=0,this.mValue=null}function H(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new a.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(var r=0;r0)var r=this.mAnimations[0].toTHREE(this);return{object:e,animation:r}}}function ie(){this.elements=[[],[],[],[]],this.toTHREE=function(){for(var e=new a.Matrix4,t=0;t<4;++t)for(var r=0;r<4;++r)e.elements[4*t+r]=this.elements[r][t];return e}}var oe=!0;function se(e){var t=e.getFloat32(e.readOffset,oe);return e.readOffset+=4,t}function le(e){var t=e.getFloat64(e.readOffset,oe);return e.readOffset+=8,t}function ue(e){var t=e.getUint16(e.readOffset,oe);return e.readOffset+=2,t}function ce(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function fe(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function de(e){var t=new D;return t.x=se(e),t.y=se(e),t.z=se(e),t}function he(e){var t=new U;return t.r=se(e),t.g=se(e),t.b=se(e),t}function pe(e){var t=new V,r=ce(e);return e.ReadBytes(t.data,1,r),t.toString()}function me(e){var t=new B;return t.mVertexId=ce(e),t.mWeight=se(e),t}function ve(e){for(var t=new ie,r=0;r<4;++r)for(var a=0;a<4;++a)t.elements[r][a]=se(e);return t}function ge(e){var t=new z;return t.mTime=le(e),t.mValue=de(e),t}function ye(e){var t=new G;return t.mTime=le(e),t.mValue=function(e){var t=new j;return t.w=se(e),t.x=se(e),t.y=se(e),t.z=se(e),t}(e),t}function be(e,t,r){for(var a=0;a0,Re=ue(r)>0,Ce)throw"Shortened binaries are not supported!";if(r.Seek(256,ke),r.Seek(128,ke),r.Seek(64,ke),!Re)return Le(r,t),t.toTHREE();var a=fe(r),n=r.FileSize()-r.Tell(),i=[];r.Read(i,1,n);var o=[];uncompress(o,a,i,n),Le(new ArrayBuffer(o),t)}(e)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){function e(){this.id=0,this.data=null}function t(){}t.prototype={set:function(e,t){this[e]=t},get:function(e,t){return this.hasOwnProperty(e)?this[e]:t}};var r=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.trunk=new a.Object3D,this.materialFactory=void 0,this._url="",this._baseDir="",this._data=void 0,this._ptr=0,this._version=[],this._streaming=!1,this._optimized_for_accuracy=!1,this._compression=0,this._bodylen=4294967295,this._blocks=[new e],this._accuracyMatrix=!1,this._accuracyGeo=!1,this._accuracyProps=!1};return r.prototype={constructor:r,load:function(e,t,r,n){var i=this;this._url=e,this._baseDir=e.substr(0,e.lastIndexOf("/")+1);var o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){var t=e.byteLength;for(this._ptr=0,this._data=new DataView(e),this._parseHeader(),0!=this._compression&&console.error("compressed AWD not supported"),this._streaming||this._bodylen==e.byteLength-this._ptr||console.error("AWDLoader: body len does not match file length",this._bodylen,t-this._ptr);this._ptr1)for(r=new a.Object3D,p=0;p191&&a<224){var n=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((31&a)<<6|63&n)}else{n=this._data.getUint8(this._ptr++,!0);var i=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((15&a)<<12|(63&n)<<6|63&i)}}return t.join("")}},r}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),r,n)},parse:function(e){function t(e){var t=new a.BufferGeometry,r=e.indices,n=e.positions,i=e.normals,o=e.uvs;t.setIndex(r);for(var s=2,l=n.length;s0&&t.push(new a.VectorKeyframeTrack(n+".position",i,o)),s.length>0&&t.push(new a.QuaternionKeyframeTrack(n+".quaternion",i,s)),l.length>0&&t.push(new a.VectorKeyframeTrack(n+".scale",i,l)),t}function A(e,t,r){var a,n,i,o=!0;for(n=0,i=e.length;n=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function S(e,t,r){for(;t0&&t0&&h.addAttribute("position",new a.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&h.addAttribute("normal",new a.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&h.addAttribute("color",new a.Float32BufferAttribute(l.array,l.stride)),s.array.length>0&&h.addAttribute("uv",new a.Float32BufferAttribute(s.array,s.stride)),u.length>0&&h.addAttribute("skinIndex",new a.Float32BufferAttribute(u,c)),f.length>0&&h.addAttribute("skinWeight",new a.Float32BufferAttribute(f,d)),n.data=h,n.type=e[0].type,n.materialKeys=p,n}function fe(e,t,r,a){var n=e.p,i=e.stride,o=e.vcount;function s(e){for(var t=n[e+r]*u,i=t+u;t4)for(var g=1,y=h-2;g<=y;g++){p=c+i*g,m=c+i*(g+1);s(c+0*i),s(p),s(m)}c+=i*h}else for(f=0,d=n.length;f=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ge(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;rn.limits.max||t>8&255,d>>16&255,d>>24&255))),r;p=!0,o=64,r.format=a.RGBAFormat}r.mipmapCount=1,131072&f[2]&&!1!==t&&(r.mipmapCount=Math.max(1,f[7]));var m=f[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=f[4],r.height=f[3];for(var v=f[1]+4,g=r.isCubemap?6:1,y=0;y>1,1),w=Math.max(w>>1,1)}return r},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="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},n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var i=function(e){this.timeLoaded=0,this.manager=e||n.DefaultLoadingManager,this.materials=null,this.verbosity=0,this.attributeOptions={},this.drawMode=n.TrianglesDrawMode,this.nativeAttributeMap={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"}};i.prototype={constructor:i,load:function(e,t,r,a){var i=this,o=new n.FileLoader(i.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.load(e,(function(e){i.decodeDracoFile(e,t)}),r,a)},setPath:function(e){this.path=e},setCrossOrigin:function(e){this.crossOrigin=e},setVerbosity:function(e){this.verbosity=e},setDrawMode:function(e){this.drawMode=e},setSkipDequantization:function(e,t){var r=!0;void 0!==t&&(r=t),this.getAttributeOptions(e).skipDequantization=r},decodeDracoFile:function(e,t,r){var a=this;i.getDecoderModule().then((function(n){a.decodeDracoFileInternal(e,n.decoder,t,r||{})}))},decodeDracoFileInternal:function(e,t,r,a){var n=new t.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength);var i=new t.Decoder,o=i.GetEncodedGeometryType(n);if(o==t.TRIANGULAR_MESH)this.verbosity>0&&console.log("Loaded a mesh.");else{if(o!=t.POINT_CLOUD){var s="THREE.DRACOLoader: Unknown geometry type.";throw console.error(s),new Error(s)}this.verbosity>0&&console.log("Loaded a point cloud.")}r(this.convertDracoGeometryTo3JS(t,i,o,n,a))},addAttributeToGeometry:function(e,t,r,a,i,o,s){if(0===i.ptr){var l="THREE.DRACOLoader: No attribute "+a;throw console.error(l),new Error(l)}var u=i.num_components(),c=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,c);var f=r.num_points()*u;s[a]=new Float32Array(f);for(var d=0;d0&&console.log("Number of faces loaded: "+c.toString())):c=0;var d=o.num_points(),h=o.num_attributes();this.verbosity>0&&(console.log("Number of points loaded: "+d.toString()),console.log("Number of attributes loaded: "+h.toString()));var p=t.GetAttributeId(o,e.POSITION);if(-1==p){u="THREE.DRACOLoader: No position attribute found.";throw console.error(u),e.destroy(t),e.destroy(o),new Error(u)}var m=t.GetAttribute(o,p),v={},g=new n.BufferGeometry;for(var y in this.nativeAttributeMap)if(void 0===i[y]){var b=t.GetAttributeId(o,e[this.nativeAttributeMap[y]]);if(-1!==b){this.verbosity>0&&console.log("Loaded "+y+" attribute.");var w=t.GetAttribute(o,b);this.addAttributeToGeometry(e,t,o,y,w,g,v)}}for(var y in i){var x=i[y];w=t.GetAttributeByUniqueId(o,x);this.addAttributeToGeometry(e,t,o,y,w,g,v)}if(r==e.TRIANGULAR_MESH)if(this.drawMode===n.TriangleStripDrawMode){var _=new e.DracoInt32Array;t.GetTriangleStripsFromMesh(o,_);v.indices=new Uint32Array(_.size());for(var A=0;A<_.size();++A)v.indices[A]=_.GetValue(A);e.destroy(_)}else{var E=3*c;v.indices=new Uint32Array(E);var S=new e.DracoInt32Array;for(A=0;A65535?n.Uint32BufferAttribute:n.Uint16BufferAttribute)(v.indices,1));var T=new e.AttributeQuantizationTransform;if(T.InitFromAttribute(m)){g.attributes.position.isQuantized=!0,g.attributes.position.maxRange=T.range(),g.attributes.position.numQuantizationBits=T.quantization_bits(),g.attributes.position.minValues=new Float32Array(3);for(A=0;A<3;++A)g.attributes.position.minValues[A]=T.min_value(A)}return e.destroy(T),e.destroy(t),e.destroy(o),this.decode_time=f-l,this.import_time=performance.now()-f,this.verbosity>0&&(console.log("Decode time: "+this.decode_time),console.log("Import time: "+this.import_time)),g},isVersionSupported:function(e,t){i.getDecoderModule().then((function(r){t(r.decoder.isVersionSupported(e))}))},getAttributeOptions:function(e){return void 0===this.attributeOptions[e]&&(this.attributeOptions[e]={}),this.attributeOptions[e]}},i.decoderPath="./",i.decoderConfig={},i.decoderModulePromise=null,i.setDecoderPath=function(e){i.decoderPath=e},i.setDecoderConfig=function(e){var t=i.decoderConfig.wasmBinary;i.decoderConfig=e||{},i.releaseDecoderModule(),t&&(i.decoderConfig.wasmBinary=t)},i.releaseDecoderModule=function(){i.decoderModulePromise=null},i.getDecoderModule=function(){var e=this,t=i.decoderPath,r=i.decoderConfig,n=i.decoderModulePromise;return n||("undefined"!=typeof DracoDecoderModule?n=Promise.resolve():"object"!==("undefined"==typeof WebAssembly?"undefined":a(WebAssembly))||"js"===r.type?n=i._loadScript(t+"draco_decoder.js"):(r.wasmBinaryFile=t+"draco_decoder.wasm",n=i._loadScript(t+"draco_wasm_wrapper.js").then((function(){return i._loadArrayBuffer(r.wasmBinaryFile)})).then((function(e){r.wasmBinary=e}))),n=n.then((function(){return new Promise((function(t){r.onModuleLoaded=function(r){e.timeLoaded=performance.now(),t({decoder:r})},DracoDecoderModule(r)}))})),i.decoderModulePromise=n,n)},i._loadScript=function(e){var t=document.getElementById("decoder_script");null!==t&&t.parentNode.removeChild(t);var r=document.getElementsByTagName("head")[0],a=document.createElement("script");return a.id="decoder_script",a.type="text/javascript",a.src=e,new Promise((function(e){a.onload=e,r.appendChild(a)}))},i._loadArrayBuffer=function(e){var t=new n.FileLoader;return t.setResponseType("arraybuffer"),new Promise((function(r,a){t.load(e,r,void 0,a)}))},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.sourceTexture=e,this.resolution=t,this.views=[{t:[1,0,0],u:[0,-1,0]},{t:[-1,0,0],u:[0,-1,0]},{t:[0,1,0],u:[0,0,1]},{t:[0,-1,0],u:[0,0,-1]},{t:[0,0,1],u:[0,-1,0]},{t:[0,0,-1],u:[0,-1,0]}],this.camera=new a.PerspectiveCamera(90,1,.1,10),this.boxMesh=new a.Mesh(new a.BoxBufferGeometry(1,1,1),this.getShader()),this.boxMesh.material.side=a.BackSide,this.scene=new a.Scene,this.scene.add(this.boxMesh);var r={format:a.RGBAFormat,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.renderTarget=new a.WebGLRenderTargetCube(this.resolution,this.resolution,r)};n.prototype={constructor:n,update:function(e){for(var t=0;t<6;t++){this.renderTarget.activeCubeFace=t;var r=this.views[t];this.camera.position.set(0,0,0),this.camera.up.set(r.u[0],r.u[1],r.u[2]),this.camera.lookAt(r.t[0],r.t[1],r.t[2]),e.render(this.scene,this.camera,this.renderTarget,!0)}return this.renderTarget.texture},getShader:function(){var e=new a.ShaderMaterial({uniforms:{equirectangularMap:{value:this.sourceTexture}},vertexShader:"varying vec3 localPosition;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tlocalPosition = position;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \n\t\t\t\tvarying vec3 localPosition;\n\t\t\t\tuniform sampler2D equirectangularMap;\n\t\t\t\t\n\t\t\t\tvec2 EquiangularSampleUV(vec3 v) {\n\t\t\t vec2 uv = vec2(atan(v.z, v.x), asin(v.y));\n\t\t\t uv *= vec2(0.1591, 0.3183); // inverse atan\n\t\t\t uv += 0.5;\n\t\t\t return uv;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = EquiangularSampleUV(normalize(localPosition));\n \t\t\tvec3 color = texture2D(equirectangularMap, uv).rgb;\n \t\t\t\n\t\t\t\t\tgl_FragColor = vec4( color, 1.0 );\n\t\t\t\t}",blending:a.CustomBlending,premultipliedAlpha:!1,blendSrc:a.OneFactor,blendDst:a.ZeroFactor,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.ZeroFactor,blendEquation:a.AddEquation});return e.type="EquiangularToCubeGenerator",e},dispose:function(){this.boxMesh.geometry.dispose(),this.boxMesh.material.dispose(),this.renderTarget.dispose()}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};(n.prototype=Object.create(a.DataTextureLoader.prototype))._parser=function(e){var t=65536,r=t>>3,n=14,i=65537,o=1<>r&(1<a)return!1;g(6,d,h,e,f);var p=v.l;if(d=v.c,h=v.lc,s[n]=p,p==u){if(f.value-r.value>a)throw"Something wrong with hufUnpackEncTable";g(8,d,h,e,f);var m=v.l+c;if(d=v.c,h=v.lc,n+m>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}else if(p>=l){if(n+(m=p-l+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}}!function(e){for(var t=0;t<=58;++t)y[t]=0;for(t=0;t0;--t){var a=r+y[t]>>1;y[t]=r,r=a}for(t=0;t0&&(e[t]=n|y[n]++<<6)}}(s)}function w(e){return 63&e}function x(e){return e>>6}var _={c:0,lc:0};function A(e,t,r,a){e=e<<8|I(r,a),t+=8,_.c=e,_.lc=t}var E={c:0,lc:0};function S(e,t,r,a,n,i,o,s,l,u){if(e==t){a<8&&(A(r,a,n,o),r=_.c,a=_.lc);var c=r>>(a-=8);if(out+c>oe)throw"Issue with getCode";for(var f=out[-1];c-- >0;)s[l.value++]=f}else{if(!(l.value32767?t-65536:t}var T={a:0,b:0};function P(e,t){var r=M(e),a=M(t),n=r+(1&a)+(a>>1),i=n,o=n-a;T.a=i,T.b=o}function F(e,t,r,a,n,i,o){for(var s,l=r>n?n:r,u=1;u<=l;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var c,f,d,h,p=0,m=p+i*(n-s),v=i*u,g=i*s,y=a*u,b=a*s;p<=m;p+=g){for(var w=p,x=p+a*(r-s);w<=x;w+=b){var _=w+y,A=(E=w+v)+y;P(t[w+e],t[E+e]),c=T.a,d=T.b,P(t[_+e],t[A+e]),f=T.a,h=T.b,P(c,f),t[w+e]=T.a,t[_+e]=T.b,P(d,h),t[E+e]=T.a,t[A+e]=T.b}if(r&u){var E=w+v;P(t[w+e],t[E+e]),c=T.a,t[E+e]=T.b,t[w+e]=c}}if(n&u)for(w=p,x=p+a*(r-s);w<=x;w+=b){_=w+y;P(t[w+e],t[_+e]),c=T.a,t[_+e]=T.b,t[w+e]=c}s=u,u>>=1}return p}function O(e,t,r,a,l,u,c){var f=r.value,d=k(t,r),h=k(t,r);r.value+=4;var p=k(t,r);if(r.value+=4,d<0||d>=i||h<0||h>=i)throw"Something wrong with HUF_ENCSIZE";var m=new Array(i),v=new Array(o);if(function(e){for(var t=0;t8*(a-(r.value-f)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var i=x(e[t]),o=w(e[t]);if(i>>o)throw"Invalid table entry";if(o>n){if((c=a[i>>o-n]).len)throw"Invalid table entry";if(c.lit++,c.p){var s=c.p;c.p=new Array(c.lit);for(var l=0;l0;l--){var c;if((c=a[(i<=n;){if((b=t[d>>h-n&s]).len)h-=b.len,S(b.lit,l,d,h,r,0,i,c,f,p),d=E.c,h=E.lc;else{if(!b.p)throw"hufDecode issues";var v;for(v=0;v=g&&x(e[b.p[v]])==(d>>h-g&(1<>=y,h-=y;h>0;){var b;if(!(b=t[d<=r)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(h<=p)for(var m=0;m>3]&1<<(7&n))&&(r[a++]=n);for(var i=a-1;a>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function j(e,t){var r=e.getUint16(t.value,!0);return t.value+=p,r}function B(e,t){return U(j(e,t))}function V(e,t,r,a,n){if("string"===a||"iccProfile"===a)return function(e,t,r){var a=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,a}(t,r,n);if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value0&&void 0!==r[l[0].ID]&&(0!==(i=r[l[0].ID]).indexOf("blob:")&&0!==i.indexOf("data:")||t.setPath(void 0));o="tga"===e.FileName.slice(-3).toLowerCase()?n.Loader.Handlers.get(".tga").load(i):t.load(i);return t.setPath(s),o}(e,t,r,a);i.ID=e.id,i.name=e.attrName;var o=e.WrapModeU,s=e.WrapModeV,l=void 0!==o?o.value:0,u=void 0!==s?s.value:0;if(i.wrapS=0===l?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===u?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){var c=e.Scaling.value;i.repeat.x=c[0],i.repeat.y=c[1]}return i}function i(e,t,r,i){var s=t.id,l=t.attrName,u=t.ShadingModel;if("object"===(void 0===u?"undefined":a(u))&&(u=u.value),!i.has(s))return null;var c,f=function(e,t,r,a,i){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value);t.Diffuse?s.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new n.Color).fromArray(t.DiffuseColor.value));t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value);t.Emissive?s.emissive=(new n.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new n.Color).fromArray(t.EmissiveColor.value));t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value));t.Opacity&&(s.opacity=parseFloat(t.Opacity.value));s.opacity<1&&(s.transparent=!0);t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value);t.Shininess&&(s.shininess=t.Shininess.value);t.Specular?s.specular=(new n.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new n.Color).fromArray(t.SpecularColor.value));return i.get(a).children.forEach((function(t){var a=t.relationship;switch(a){case"Bump":s.bumpMap=r.get(t.ID);break;case"DiffuseColor":s.map=o(e,r,t.ID,i);break;case"DisplacementColor":s.displacementMap=o(e,r,t.ID,i);break;case"EmissiveColor":s.emissiveMap=o(e,r,t.ID,i);break;case"NormalMap":s.normalMap=o(e,r,t.ID,i);break;case"ReflectionColor":s.envMap=o(e,r,t.ID,i),s.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":s.specularMap=o(e,r,t.ID,i);break;case"TransparentColor":s.alphaMap=o(e,r,t.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a)}})),s}(e,t,r,s,i);switch(u.toLowerCase()){case"phong":c=new n.MeshPhongMaterial;break;case"lambert":c=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',u),c=new n.MeshPhongMaterial({color:3342591})}return c.setValues(f),c.name=l,c}function o(e,t,r,a){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=a.get(r).children[0].ID),t.get(r)}function s(e,t){var r=[];return e.children.forEach((function(e){var a=t[e.ID];if("Cluster"===a.attrType){var i={ID:e.ID,indices:[],weights:[],transform:(new n.Matrix4).fromArray(a.Transform.a),transformLink:(new n.Matrix4).fromArray(a.TransformLink.a),linkMode:a.Mode};"Indexes"in a&&(i.indices=a.Indexes.a,i.weights=a.Weights.a),r.push(i)}})),{rawBones:r,bones:[]}}function l(e,t,r,a){for(var n=[],i=0;i0&&o.addAttribute("color",new n.Float32BufferAttribute(l.colors,3));r&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(l.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(l.vertexWeights,4)),o.FBX_Deformer=r);if(l.normal.length>0){var d=new n.Float32BufferAttribute(l.normal,3);(new n.Matrix3).getNormalMatrix(i).applyToBufferAttribute(d),o.addAttribute("normal",d)}if(l.uvs.forEach((function(e,t){var r="uv"+(t+1).toString();0===t&&(r="uv"),o.addAttribute(r,new n.Float32BufferAttribute(l.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){var h=l.materialIndex[0],p=0;if(l.materialIndex.forEach((function(e,t){e!==h&&(o.addGroup(p,t-p,h),h=e,p=t)})),o.groups.length>0){var m=o.groups[o.groups.length-1],v=m.start+m.count;v!==l.materialIndex.length&&o.addGroup(v,l.materialIndex.length-v,h)}0===o.groups.length&&o.addGroup(0,l.materialIndex.length,l.materialIndex[0])}return function(e,t,r,a,i){if(null===a)return;t.morphAttributes.position=[],t.morphAttributes.normal=[],a.rawTargets.forEach((function(a){var o=e.Objects.Geometry[a.geoID];void 0!==o&&function(e,t,r,a){var i=new n.BufferGeometry;r.attrName&&(i.name=r.attrName);for(var o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],s=void 0!==t.Vertices?t.Vertices.a.slice():[],l=void 0!==r.Vertices?r.Vertices.a:[],u=void 0!==r.Indexes?r.Indexes.a:[],f=0;f4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);var y=[0,0,0,0],b=[0,0,0,0];v.forEach((function(e,t){var r=e,a=m[t];b.forEach((function(e,t,n){if(r>e){n[t]=r,r=e;var i=y[t];y[t]=a,a=i}}))})),m=y,v=b}for(;v.length<4;)v.push(0),m.push(0);for(var w=0;w<4;++w)u.push(v[w]),c.push(m[w])}if(e.normal){g=h(d,r,f,e.normal);o.push(g[0],g[1],g[2])}if(e.material&&"AllSame"!==e.material.mappingType)var x=h(d,r,f,e.material)[0];e.uv&&e.uv.forEach((function(e,t){var a=h(d,r,f,e);void 0===l[t]&&(l[t]=[]),l[t].push(a[0]),l[t].push(a[1])})),a++,p&&(!function(e,t,r,a,n,i,o,s,l,u){for(var c=2;c=f.length&&f===C(c,0,f.length))o=(new M).parse(e);else{var d=C(e);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;for(var a=0;a0,u="string"==typeof o.Content&&""!==o.Content;if(l||u){var c=t(n[i]);a[o.RelativeFilename||o.Filename]=c}}}}for(var s in r){var f=r[s];void 0!==a[f]?r[s]=a[f]:r[s]=r[s].split("\\").pop()}return r}(o),_=function(e,t,r){var a=new Map;if("Material"in e.Objects){var n=e.Objects.Material;for(var o in n){var s=i(e,n[o],t,r);null!==s&&a.set(parseInt(o),s)}}return a}(o,function(e,t,a,n){var i=new Map;if("Texture"in e.Objects){var o=e.Objects.Texture;for(var s in o){var l=r(o[s],t,a,n);i.set(parseInt(s),l)}}return i}(o,new n.TextureLoader(this.manager).setPath(a),x,h),h),A=function(e,t){var r={},a={};if("Deformer"in e.Objects){var n=e.Objects.Deformer;for(var i in n){var o=n[i],u=t.get(parseInt(i));if("Skin"===o.attrType){var c=s(u,n);c.ID=i,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),c.geometryID=u.parents[0].ID,r[i]=c}else if("BlendShape"===o.attrType){var f={id:i};f.rawTargets=l(u,o,n,t),f.id=i,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),f.parentGeoID=u.parents[0].ID,a[i]=f}}}return{skeletons:r,morphTargets:a}}(o,h),E=function(e,t,r){var a=new Map;if("Geometry"in e.Objects){var n=e.Objects.Geometry;for(var i in n){var o=t.get(parseInt(i)),s=u(e,o,n[i],r);a.set(parseInt(i),s)}}return a}(o,h,A);return function(e,t,r,a,i){var o=new n.Group,s=function(e,t,r,a,i){var o=new Map,s=e.Objects.Model;for(var l in s){var u=parseInt(l),c=s[l],f=i.get(u),d=p(f,t,u,c.attrName);if(!d){switch(c.attrType){case"Camera":d=m(e,f);break;case"Light":d=v(e,f);break;case"Mesh":d=g(e,f,r,a);break;case"NurbsCurve":d=y(f,r);break;case"LimbNode":case"Null":default:d=new n.Group}d.name=n.PropertyBinding.sanitizeNodeName(c.attrName),d.ID=u}b(e,d,c),o.set(u,d)}return o}(e,r,a,i,t),l=e.Objects.Model;return s.forEach((function(r){var a=l[r.ID];!function(e,t,r,a,i){if("LookAtProperty"in r){a.get(t.ID).children.forEach((function(r){if("LookAtProperty"===r.relationship){var a=e.Objects.Model[r.ID];if("Lcl_Translation"in a){var o=a.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(o),i.add(t.target)):t.lookAt((new n.Vector3).fromArray(o))}}}))}}(e,r,a,t,o),t.get(r.ID).parents.forEach((function(e){var t=s.get(e.ID);void 0!==t&&t.add(r)})),null===r.parent&&o.add(r)})),function(e,t,r,a,i){var o=function(e){var t={};if("Pose"in e.Objects){var r=e.Objects.Pose;for(var a in r)if("BindPose"===r[a].attrType){var i=r[a].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new n.Matrix4).fromArray(e.Matrix.a)})):t[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return t}(e);for(var s in t){var l=t[s];i.get(parseInt(l.ID)).parents.forEach((function(e){if(r.has(e.ID)){var t=e.ID;i.get(t).parents.forEach((function(e){a.has(e.ID)&&a.get(e.ID).bind(new n.Skeleton(l.bones),o[e.ID])}))}}))}}(e,r,a,s,t),function(e,t,r){r.animations=[];var a=function(e,t){if(void 0===e.Objects.AnimationCurve)return;var r=function(e){var t=e.Objects.AnimationCurveNode,r=new Map;for(var a in t){var n=t[a];if(null!==n.attrName.match(/S|R|T/)){var i={id:n.id,attr:n.attrName,curves:{}};r.set(i.id,i)}}return r}(e);!function(e,t,r){var a=e.Objects.AnimationCurve;for(var n in a){var i={id:a[n].id,times:a[n].KeyTime.a.map(O),values:a[n].KeyValueFloat.a},o=t.get(i.id);if(void 0!==o){var s=o.parents[0].ID,l=o.parents[0].relationship;l.match(/X/)?r.get(s).curves.x=i:l.match(/Y/)?r.get(s).curves.y=i:l.match(/Z/)&&(r.get(s).curves.z=i)}}}(e,t,r);var a=function(e,t,r){var a=e.Objects.AnimationLayer,i=new Map;for(var o in a){var s=[],l=t.get(parseInt(o));if(void 0!==l)l.children.forEach((function(a,i){if(r.has(a.ID)){var o=r.get(a.ID);if(void 0!==o.curves.x||void 0!==o.curves.y||void 0!==o.curves.z){if(void 0===s[i]){var l;t.get(a.ID).parents.forEach((function(e){void 0!==e.relationship&&(l=e.ID)}));var u=e.Objects.Model[l.toString()],c={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};"Lcl_Translation"in u&&(c.initialPosition=u.Lcl_Translation.value),"Lcl_Rotation"in u&&(c.initialRotation=u.Lcl_Rotation.value),"Lcl_Scaling"in u&&(c.initialScale=u.Lcl_Scaling.value),"PreRotation"in u&&(c.preRotations=u.PreRotation.value),s[i]=c}s[i][o.attr]=o}}})),i.set(parseInt(o),s)}return i}(e,t,r);return function(e,t,r){var a=e.Objects.AnimationStack,n={};for(var i in a){var o=t.get(parseInt(i)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=r.get(o[0].ID);n[i]={name:a[i].attrName,layer:s}}return n}(e,t,a)}(e,t);if(void 0===a)return;for(var i in a){var o=w(a[i]);r.animations.push(o)}}(e,t,o),function(e,t){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var r=e.GlobalSettings.AmbientColor.value,a=r[0],i=r[1],o=r[2];if(0!==a||0!==i||0!==o){var s=new n.Color(a,i,o);t.add(new n.AmbientLight(s,1))}}}(e,o),o}(o,h,A.skeletons,E,_)}});var d=[];function h(e,t,r,a){var n;switch(a.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=r;break;case"AllSame":n=a.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+a.mappingType)}"IndexToDirect"===a.referenceType&&(n=a.indices[n]);var i=n*a.dataSize,o=i+a.dataSize;return function(e,t,r,a){for(var n=r,i=0;n1?s=l:l.length>0?s=l[0]:(s=new n.MeshPhongMaterial({color:13421772}),l.push(s)),"color"in o.attributes&&l.forEach((function(e){e.vertexColors=n.VertexColors})),o.FBX_Deformer?(l.forEach((function(e){e.skinning=!0})),i=new n.SkinnedMesh(o,s)):i=new n.Mesh(o,s),i}function y(e,t){var r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),a=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,a)}function b(e,t,r){if("RotationOrder"in r){var a=parseInt(r.RotationOrder.value,10);a>0&&a<6?console.warn("THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.",["XYZ","XZY","YZX","ZXY","YXZ","ZYX","SphericXYZ"][a]):6===a&&console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.")}if("Lcl_Translation"in r&&t.position.fromArray(r.Lcl_Translation.value),"Lcl_Rotation"in r){var i=r.Lcl_Rotation.value.map(n.Math.degToRad);i.push("ZYX"),t.quaternion.setFromEuler((new n.Euler).fromArray(i))}if("Lcl_Scaling"in r&&t.scale.fromArray(r.Lcl_Scaling.value),"PreRotation"in r){var o=r.PreRotation.value.map(n.Math.degToRad);o[3]="ZYX";var s=(new n.Euler).fromArray(o);s=(new n.Quaternion).setFromEuler(s),t.quaternion.premultiply(s)}}function w(e){var t=[];return e.layer.forEach((function(e){t=t.concat(function(e){var t=[];if(void 0!==e.T&&Object.keys(e.T.curves).length>0){var r=x(e.modelName,e.T.curves,e.initialPosition,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=function(e,t,r,a){void 0!==t.x&&(E(t.x),t.x.values=t.x.values.map(n.Math.degToRad));void 0!==t.y&&(E(t.y),t.y.values=t.y.values.map(n.Math.degToRad));void 0!==t.z&&(E(t.z),t.z.values=t.z.values.map(n.Math.degToRad));var i=A(t),o=_(i,t,r);void 0!==a&&((a=a.map(n.Math.degToRad)).push("ZYX"),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a));for(var s=new n.Quaternion,l=new n.Euler,u=[],c=0;c0){var i=x(e.modelName,e.S.curves,e.initialScale,"scale");void 0!==i&&t.push(i)}return t}(e))})),new n.AnimationClip(e.name,-1,t)}function x(e,t,r,a){var i=A(t),o=_(i,t,r);return new n.VectorKeyframeTrack(e+"."+a,i,o)}function _(e,t,r){var a=r,n=[],i=-1,o=-1,s=-1;return e.forEach((function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(s=t.z.times.indexOf(e)),-1!==i){var r=t.x.values[i];n.push(r),a[0]=r}else n.push(a[0]);if(-1!==o){var l=t.y.values[o];n.push(l),a[1]=l}else n.push(a[1]);if(-1!==s){var u=t.z.values[s];n.push(u),a[2]=u}else n.push(a[2])})),n}function A(e){var t=[];return void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})).filter((function(e,t,r){return r.indexOf(e)==t}))}function E(e){for(var t=1;t=180){for(var i=n/180,o=a/i,s=r+o,l=e.times[t-1],u=(e.times[t]-l)/i,c=l+u,f=[],d=[];c1&&(r=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:r,type:a}},parseNodeProperty:function(e,t,r){var a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===a&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());var i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===a){var o=n.split(",").slice(1),s=parseInt(o[0]),l=parseInt(o[1]),u=n.split(",").slice(3);a="connections",function(e,t){for(var r=0,a=e.length,n=t.length;r=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var r={},a=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32(),i=(t>=7500?e.getUint64():e.getUint32(),e.getUint8()),o=e.getString(i);if(0===a)return null;for(var s=[],l=0;l0?s[0]:"",c=s.length>1?s[1]:"",f=s.length>2?s[2]:"";for(r.singleProperty=1===n&&e.getOffset()===a;a>e.getOffset();){var d=this.parseNode(e,t);null!==d&&this.parseSubNode(o,r,d)}return r.propertyList=s,"number"==typeof u&&(r.id=u),""!==c&&(r.attrName=c),""!==f&&(r.attrType=f),""!==o&&(r.name=o),r},parseSubNode:function(e,t,r){if(!0===r.singleProperty){var a=r.propertyList[0];Array.isArray(a)?(t[r.name]=r,r.a=a):t[r.name]=a}else if("Connections"===e&&"C"===r.name){var n=[];r.propertyList.forEach((function(e,t){0!==t&&n.push(e)})),void 0===t.connections&&(t.connections=[]),t.connections.push(n)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){var i,o=r.propertyList[0],s=r.propertyList[1],l=r.propertyList[2],u=r.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),i="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[o]={type:s,type2:l,flag:u,value:i}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var r=e.getUint32();return e.getArrayBuffer(r);case"S":r=e.getUint32();return e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var a=e.getUint32(),n=e.getUint32(),i=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}void 0===window.Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var o=new T(new Zlib.Inflate(new Uint8Array(e.getArrayBuffer(i))).decompress().buffer);switch(t){case"b":case"c":return o.getBooleanArray(a);case"d":return o.getFloat64Array(a);case"f":return o.getFloat32Array(a);case"i":return o.getInt32Array(a);case"l":return o.getInt64Array(a)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}),Object.assign(T.prototype,{getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],r=0;r=0&&(t=t.slice(0,a)),n.LoaderUtils.decodeText(t)}}),Object.assign(P.prototype,{add:function(e,t){this[e]=t}}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.splitLayer=!1};n.prototype.load=function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},n.prototype.parse=function(e){var t={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},r=[],n=void 0,i=new a.LineBasicMaterial({color:16711680});i.name="path";var o=new a.LineBasicMaterial({color:65280});function s(e){n={vertex:[],pathVertex:[],z:e.z},r.push(n)}function l(e,r){return t.relative?r:r-e}function u(e,r){return t.relative?e+r:r}o.name="extruded";for(var c,f,d=e.replace(/;.+/g,"").split("\n"),h=0;h0&&(g.extruding=l(t.e,g.e)>0,null!=n&&g.z==n.z||s(g)),c=t,f=g,void 0===n&&s(c),g.extruding?(n.vertex.push(c.x,c.y,c.z),n.vertex.push(f.x,f.y,f.z)):(n.pathVertex.push(c.x,c.y,c.z),n.pathVertex.push(f.x,f.y,f.z)),t=g}else if("G2"===m||"G3"===m)console.warn("THREE.GCodeLoader: Arc command not supported");else if("G90"===m)t.relative=!1;else if("G91"===m)t.relative=!0;else if("G92"===m){(g=t).x=void 0!==v.x?v.x:g.x,g.y=void 0!==v.y?v.y:g.y,g.z=void 0!==v.z?v.z:g.z,g.e=void 0!==v.e?v.e:g.e,t=g}else console.warn("THREE.GCodeLoader: Command not supported:"+m)}function y(e,t){var r=new a.BufferGeometry;r.addAttribute("position",new a.Float32BufferAttribute(e,3));var n=new a.LineSegments(r,t?o:i);n.name="layer"+h,b.add(n)}var b=new a.Group;if(b.name="gcode",this.splitLayer)for(h=0;h>16&32768,i=a>>12&2047,o=a>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&a):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)}return function(e,t,a,n){var i=e[t+3],o=Math.pow(2,i-128)/255;a[n+0]=r(e[t+0]*o),a[n+1]=r(e[t+1]*o),a[n+2]=r(e[t+2]*o)}}(),l=new n.CubeTexture;l.type=e,l.encoding=e===n.UnsignedByteType?n.RGBEEncoding:n.LinearEncoding,l.format=e===n.UnsignedByteType?n.RGBAFormat:n.RGBFormat,l.minFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.magFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.generateMipmaps=l.encoding!==n.RGBEEncoding,l.anisotropy=0;var u=this.hdrLoader,c=0;function f(r,a,i,f){var d=new n.FileLoader(this.manager);d.setResponseType("arraybuffer"),d.load(t[r],(function(t){c++;var i=u._parser(t);if(i){if(e===n.FloatType){for(var f=i.data.length/4*3,d=new Float32Array(f),h=0;h>8&65280|e>>24&255},e.prototype.mipmaps=function(t){for(var r=[],a=e.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight,o=t?this.numberOfMipmapLevels:1,s=0;s0?o():t(n.mergeVmds(i))}),r,a)}()},s.prototype.loadAudio=function(e,t,r,n){var i=new a.AudioListener,o=new a.Audio(i);new a.AudioLoader(this.manager).load(e,(function(e){o.setBuffer(e),t(o,i)}),r,n)},s.prototype.loadVpd=function(e,t,r,a,n){var i=this;(n&&"unicode"===n.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this)(e,(function(e){t(i.parseVpd(e))}),r,a)},s.prototype.parseModel=function(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}},s.prototype.parsePmd=function(e){return this.parser.parsePmd(e,!0)},s.prototype.parsePmx=function(e){return this.parser.parsePmx(e,!0)},s.prototype.parseVmd=function(e){return this.parser.parseVmd(e,!0)},s.prototype.parseVpd=function(e){return this.parser.parseVpd(e,!0)},s.prototype.mergeVmds=function(e){return this.parser.mergeVmds(e)},s.prototype.pourVmdIntoModel=function(e,t,r){this.createAnimation(e,t,r)},s.prototype.pourVmdIntoCamera=function(e,t,r){var n=new s.DataCreationHelper;!function(){for(var i,o,l=n.createOrderedMotionArray(t.cameras),u=[],c=[],f=[],d=[],h=[],p=[],m=[],v=[],g=[],y=new a.Quaternion,b=new a.Euler,w=new a.Vector3,x=new a.Vector3,_=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},A=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},E=function(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();for(var o=n.length/r.length,l=3===o?12:4,u=1,c=2,f=r.length;cu){r[u]=r[c];for(d=0;d=a?r.skinIndices[a]:0);for(a=0;a<4;a++)l.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t=0&&(l.limitation=new a.Vector3(1,0,0)),s.links.push(l)}t.push(s)}else for(r=0;r=0?c:u);var p=h.load(s,(function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,n=t.height;f.width=r,f.height=n,d.clearRect(0,0,r,n),d.translate(r/2,n/2),d.rotate(.5*Math.PI),d.translate(-r/2,-n/2),d.drawImage(t,0,0),e.image=d.getImageData(0,0,r,n)}e.flipY=!1,e.wrapS=a.RepeatWrapping,e.wrapT=a.RepeatWrapping;for(var i=0;i=0?(x.push(w.slice(0,_)),x.push(w.slice(_+1))):x.push(w);for(var A=0;A=0||E.indexOf(".spa")>=0?(b.envMap=m(E,{sphericalReflectionMapping:!0}),E.indexOf(".sph")>=0?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation):b.map=m(E)}}}else{if(-1!==y.textureIndex){var E=e.textures[y.textureIndex];b.map=m(E)}if(-1!==y.envTextureIndex&&(1===y.envFlag||2==y.envFlag)){E=e.textures[y.envTextureIndex];b.envMap=m(E,{sphericalReflectionMapping:!0}),1===y.envFlag?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation}}var S=void 0===b.map?1:.2;b.emissive=new a.Color(y.ambient[0]*S,y.ambient[1]*S,y.ambient[2]*S),p.push(b)}for(g=0;g0,y.morphTargets=o.morphTargets.length>0,y.lights=!0,y.side="pmx"===e.metadata.format&&1==(1&T.flag)?a.DoubleSide:M.side,y.transparent=M.transparent,y.fog=!0,y.blending=a.CustomBlending,y.blendSrc=a.SrcAlphaFactor,y.blendDst=a.OneMinusSrcAlphaFactor,y.blendSrcAlpha=a.SrcAlphaFactor,y.blendDstAlpha=a.DstAlphaFactor,void 0!==M.map){y.faceOffset=M.faceOffset,y.faceNum=M.faceNum,y.map=v(M.map,l),function(e){e.map.readyCallbacks.push((function(t){function r(e,t){var r=e.width,a=e.height,n=Math.round(t.x*r)%r,i=Math.round(t.y*a)%a;n<0&&(n+=r),i<0&&(i+=a);var o=i*r+n;return e.data[4*o+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),n=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var n=e.width,i=e.height;if(e.data.length/(n*i)!=4)return!1;for(var o=0;o=this.duration;)this.currentTime-=this.duration;return!(this.currentTime=this.duration}},a.MMDGrantSolver=function(e){this.mesh=e},a.MMDGrantSolver.prototype={constructor:a.MMDGrantSolver,update:(o=new a.Quaternion,function(){for(var e=0;e0)}},setAnimations:function(){for(var e=0;e0&&0!==e.action._clip.tracks[0].name.indexOf(".bones")||(e.target._root.looped=!0)}));for(var t=!1,r=!1,n=0;n0&&0===i.tracks[0].name.indexOf(".morphTargetInfluences")?r||(o.play(),r=!0):t||(o.play(),t=!0)}t&&(e.ikSolver=new a.CCDIKSolver(e),void 0!==e.geometry.grants&&(e.grantSolver=new a.MMDGrantSolver(e)))}},setCameraAnimation:function(e){void 0!==e.animations&&(e.mixer=new a.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())},unifyAnimationDuration:function(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,n=0;n0,i=!0,s={};var l=function(e,n){null==n&&(n=1);var o=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,o=2;break;case"sshort":s=Int16Array,o=2;break;case"uint":s=Uint32Array,o=4;break;case"sint":s=Int32Array,o=4;break;case"float":s=Float32Array,o=4;break;case"complex":case"double":s=Float64Array,o=8}var l=new s(t.slice(r,r+=n*o));return a!=i&&(l=function(e,t){for(var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=0;ai;n--,i++){var o=r[i];r[i]=r[n],r[n]=o}return e}(l,o)),1==n?l[0]:l}("uchar",e.byteLength),u=l.length,c=null,f=0;for(p=1;p13)&&32!==a?n+=String.fromCharCode(a):(""!==n&&(l[u]=c(n,o),u++),n="");return""!==n&&(l[u]=c(n,o),u++),l}(t);else if("raw"===s.encoding){for(var h=new Uint8Array(t.length),p=0;p0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,n=this.object.geometry.vertices;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){var a=this.normals,n=this.object.geometry.normals;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addColor:function(e,t,r){var a=this.colors,n=this.object.geometry.colors;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addUV:function(e,t,r){var a=this.uvs,n=this.object.geometry.uvs;n.push(a[e+0],a[e+1]),n.push(a[t+0],a[t+1]),n.push(a[r+0],a[r+1])},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,a,n,i,o,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),f=this.parseVertexIndex(t,u),d=this.parseVertexIndex(r,u);if(this.addVertex(c,f,d),void 0!==a&&""!==a){var h=this.uvs.length;c=this.parseUVIndex(a,h),f=this.parseUVIndex(n,h),d=this.parseUVIndex(i,h),this.addUV(c,f,d)}if(void 0!==o&&""!==o){var p=this.normals.length;c=this.parseNormalIndex(o,p),f=o===s?c:this.parseNormalIndex(s,p),d=o===l?c:this.parseNormalIndex(l,p),this.addNormal(c,f,d)}this.colors.length>0&&this.addColor(c,f,d)},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,r=0,a=e.length;r0){var w=b.split("/");v.push(w)}}var x=v[0];for(g=1,y=v.length-1;g1){var C=c[1].trim().toLowerCase();o.object.smooth="0"!==C&&"off"!==C}else o.object.smooth=!0;(Y=o.object.currentMaterial())&&(Y.smooth=o.object.smooth)}o.finalize();var R=new a.Group;R.materialLibraries=[].concat(o.materialLibraries);for(d=0,h=o.objects.length;d0?B.addAttribute("normal",new a.Float32BufferAttribute(I.normals,3)):B.computeVertexNormals(),I.colors.length>0&&(j=!0,B.addAttribute("color",new a.Float32BufferAttribute(I.colors,3))),I.uvs.length>0&&B.addAttribute("uv",new a.Float32BufferAttribute(I.uvs,2));for(var V,z=[],G=0,H=N.length;G1){for(G=0,H=N.length;Gf){f=d;var r='Download of "'+e.url+'": '+(100*d).toFixed(2)+"%";u.onProgress("progressLoad",r,d)}}}var h=new a.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.load(e.url,c,i,o)}},r.prototype.run=function(e,r){this._applyPrepData(e);var a=e.checkResourceDescriptorFiles(e.resources,[{ext:"obj",type:"ArrayBuffer",ignore:!1},{ext:"mtl",type:"String",ignore:!1},{ext:"zip",type:"String",ignore:!0}]);t.isValid(r)&&(this.terminateWorkerOnLoad=!1,this.workerSupport=r,this.logging.enabled=this.workerSupport.logging.enabled,this.logging.debug=this.workerSupport.logging.debug);var n=this;this._loadMtl(a.mtl,(function(t){null!==t&&n.meshBuilder.setMaterials(t),n._loadObj(a.obj,n.callbacks.onLoad,null,null,n.callbacks.onMeshAlter,e.useAsync)}),e.crossOrigin,e.materialOptions)},r.prototype._applyPrepData=function(e){t.isValid(e)&&(this.setLogging(e.logging.enabled,e.logging.debug),this.setModelName(e.modelName),this.setStreamMeshesTo(e.streamMeshesTo),this.meshBuilder.setMaterials(e.materials),this.setUseIndices(e.useIndices),this.setDisregardNormals(e.disregardNormals),this.setMaterialPerSmoothingGroup(e.materialPerSmoothingGroup),this._setCallbacks(e.getCallbacks()))},r.prototype.parse=function(e){if(!t.isValid(e))return console.warn("Provided content is not a valid ArrayBuffer or String."),this.loaderRootNode;this.logging.enabled&&console.time("OBJLoader2 parse: "+this.modelName),this.meshBuilder.init();var r=new o;r.setLogging(this.logging.enabled,this.logging.debug),r.setMaterialPerSmoothingGroup(this.materialPerSmoothingGroup),r.setUseIndices(this.useIndices),r.setDisregardNormals(this.disregardNormals),r.setMaterials(this.meshBuilder.getMaterials());var a=this;r.setCallbackMeshBuilder((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}));if(r.setCallbackProgress((function(e,t){a.onProgress("progressParse",e,t)})),e instanceof ArrayBuffer||e instanceof Uint8Array)this.logging.enabled&&console.info("Parsing arrayBuffer..."),r.parse(e);else{if(!("string"==typeof e||e instanceof String))throw"Provided content was neither of type String nor Uint8Array! Aborting...";this.logging.enabled&&console.info("Parsing text..."),r.parseText(e)}return this.logging.enabled&&console.timeEnd("OBJLoader2 parse: "+this.modelName),this.loaderRootNode},r.prototype.parseAsync=function(e,r){var a=this,n=!1,i=function(){r({detail:{loaderRootNode:a.loaderRootNode,modelName:a.modelName,instanceNo:a.instanceNo}}),n&&a.logging.enabled&&console.timeEnd("OBJLoader2 parseAsync: "+a.modelName)};t.isValid(e)?n=!0:(console.warn("Provided content is not a valid ArrayBuffer."),i()),n&&this.logging.enabled&&console.time("OBJLoader2 parseAsync: "+this.modelName),this.meshBuilder.init();this.workerSupport.validate((function(e,r){var a="";return a+="/**\n",a+=" * This code was constructed by OBJLoader2 buildCode.\n",a+=" */\n\n",a+="THREE = { LoaderSupport: {} };\n\n",a+=e("LoaderSupport.Validator",t),a+=r("Parser",o)}),"Parser"),this.workerSupport.setCallbacks((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}),i),a.terminateWorkerOnLoad&&this.workerSupport.setTerminateRequested(!0);var s={},l=this.meshBuilder.getMaterials();for(var u in l)s[u]=u;this.workerSupport.run({params:{useAsync:!0,materialPerSmoothingGroup:this.materialPerSmoothingGroup,useIndices:this.useIndices,disregardNormals:this.disregardNormals},logging:{enabled:this.logging.enabled,debug:this.logging.debug},materials:{materials:s},data:{input:e,options:null}})};var o=function(){function e(){this.callbackProgress=null,this.callbackMeshBuilder=null,this.contentRef=null,this.legacyMode=!1,this.materials={},this.useAsync=!1,this.materialPerSmoothingGroup=!1,this.useIndices=!1,this.disregardNormals=!1,this.vertices=[],this.colors=[],this.normals=[],this.uvs=[],this.rawMesh={objectName:"",groupName:"",activeMtlName:"",mtllibName:"",faceType:-1,subGroups:[],subGroupInUse:null,smoothingGroup:{splitMaterials:!1,normalized:-1,real:-1},counts:{doubleIndicesCount:0,faceCount:0,mtlCount:0,smoothingGroupCount:0}},this.inputObjectCount=1,this.outputObjectCount=1,this.globalCounts={vertices:0,faces:0,doubleIndicesCount:0,lineByte:0,currentByte:0,totalBytes:0},this.logging={enabled:!0,debug:!1}}return e.prototype.resetRawMesh=function(){this.rawMesh.subGroups=[],this.rawMesh.subGroupInUse=null,this.rawMesh.smoothingGroup.normalized=-1,this.rawMesh.smoothingGroup.real=-1,this.pushSmoothingGroup(1),this.rawMesh.counts.doubleIndicesCount=0,this.rawMesh.counts.faceCount=0,this.rawMesh.counts.mtlCount=0,this.rawMesh.counts.smoothingGroupCount=0},e.prototype.setUseAsync=function(e){this.useAsync=e},e.prototype.setMaterialPerSmoothingGroup=function(e){this.materialPerSmoothingGroup=e},e.prototype.setUseIndices=function(e){this.useIndices=e},e.prototype.setDisregardNormals=function(e){this.disregardNormals=e},e.prototype.setMaterials=function(e){this.materials=n.default.Validator.verifyInput(e,this.materials),this.materials=n.default.Validator.verifyInput(this.materials,{})},e.prototype.setCallbackMeshBuilder=function(e){if(!n.default.Validator.isValid(e))throw'Unable to run as no "MeshBuilder" callback is set.';this.callbackMeshBuilder=e},e.prototype.setCallbackProgress=function(e){this.callbackProgress=e},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.configure=function(){if(this.pushSmoothingGroup(1),this.logging.enabled){var e=Object.keys(this.materials),t="OBJLoader2.Parser configuration:"+(e.length>0?"\n\tmaterialNames:\n\t\t- "+e.join("\n\t\t- "):"\n\tmaterialNames: None")+"\n\tuseAsync: "+this.useAsync+"\n\tmaterialPerSmoothingGroup: "+this.materialPerSmoothingGroup+"\n\tuseIndices: "+this.useIndices+"\n\tdisregardNormals: "+this.disregardNormals+"\n\tcallbackMeshBuilderName: "+this.callbackMeshBuilder.name+"\n\tcallbackProgressName: "+this.callbackProgress.name;console.info(t)}},e.prototype.parse=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parse"),this.configure();var t=new Uint8Array(e);this.contentRef=t;var r=t.byteLength;this.globalCounts.totalBytes=r;for(var a,n=new Array(128),i="",o=0,s=0,l=0;l0&&(n[o++]=i),i="";break;case 47:i.length>0&&(n[o++]=i),s++,i="";break;case 10:i.length>0&&(n[o++]=i),i="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=l,this.processLine(n,o,s),o=0,s=0;break;case 13:break;default:i+=String.fromCharCode(a)}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parse")},e.prototype.parseText=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parseText"),this.configure(),this.legacyMode=!0,this.contentRef=e;var t=e.length;this.globalCounts.totalBytes=t;for(var r,a=new Array(128),n="",i=0,o=0,s=0;s0&&(a[i++]=n),n="";break;case"/":n.length>0&&(a[i++]=n),o++,n="";break;case"\n":n.length>0&&(a[i++]=n),n="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=s,this.processLine(a,i,o),i=0,o=0;break;case"\r":break;default:n+=r}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parseText")},e.prototype.processLine=function(e,t,r){if(!(t<1)){var a,n,i,o,s=function(e,t,r,a){var n="";if(a>r){var i;if(t)for(i=r;i4&&(this.colors.push(parseFloat(e[4])),this.colors.push(parseFloat(e[5])),this.colors.push(parseFloat(e[6])));break;case"vt":this.uvs.push(parseFloat(e[1])),this.uvs.push(parseFloat(e[2]));break;case"vn":this.normals.push(parseFloat(e[1])),this.normals.push(parseFloat(e[2])),this.normals.push(parseFloat(e[3]));break;case"f":if(a=t-1,0===r)for(this.checkFaceType(0),i=2,n=a;i0?n-1:n+a.vertices.length/3),o=a.rawMesh.subGroupInUse.vertices;o.push(a.vertices[i++]),o.push(a.vertices[i++]),o.push(a.vertices[i]);var s=a.colors.length>0?i:null;if(null!==s){var l=a.rawMesh.subGroupInUse.colors;l.push(a.colors[s++]),l.push(a.colors[s++]),l.push(a.colors[s])}if(t){var u=parseInt(t),c=2*(u>0?u-1:u+a.uvs.length/2),f=a.rawMesh.subGroupInUse.uvs;f.push(a.uvs[c++]),f.push(a.uvs[c])}if(r){var d=parseInt(r),h=3*(d>0?d-1:d+a.normals.length/3),p=a.rawMesh.subGroupInUse.normals;p.push(a.normals[h++]),p.push(a.normals[h++]),p.push(a.normals[h])}};if(this.useIndices){var o=e+(t?"_"+t:"_n")+(r?"_"+r:"_n"),s=this.rawMesh.subGroupInUse.indexMappings[o];n.default.Validator.isValid(s)?this.rawMesh.counts.doubleIndicesCount++:(s=this.rawMesh.subGroupInUse.vertices.length/3,i(),this.rawMesh.subGroupInUse.indexMappings[o]=s,this.rawMesh.subGroupInUse.indexMappingsCount++),this.rawMesh.subGroupInUse.indices.push(s)}else i();this.rawMesh.counts.faceCount++},e.prototype.createRawMeshReport=function(e){return"Input Object number: "+e+"\n\tObject name: "+this.rawMesh.objectName+"\n\tGroup name: "+this.rawMesh.groupName+"\n\tMtllib name: "+this.rawMesh.mtllibName+"\n\tVertex count: "+this.vertices.length/3+"\n\tNormal count: "+this.normals.length/3+"\n\tUV count: "+this.uvs.length/2+"\n\tSmoothingGroup count: "+this.rawMesh.counts.smoothingGroupCount+"\n\tMaterial count: "+this.rawMesh.counts.mtlCount+"\n\tReal MeshOutputGroup count: "+this.rawMesh.subGroups.length},e.prototype.finalizeRawMesh=function(){var e,t,r=[],a=0,n=0,i=0,o=0,s=0,l=0;for(var u in this.rawMesh.subGroups)if((e=this.rawMesh.subGroups[u]).vertices.length>0){if((t=e.indices).length>0&&n>0)for(var c in t)t[c]=t[c]+n;r.push(e),a+=e.vertices.length,n+=e.indexMappingsCount,i+=e.indices.length,o+=e.colors.length,l+=e.uvs.length,s+=e.normals.length}var f=null;return r.length>0&&(f={name:""!==this.rawMesh.groupName?this.rawMesh.groupName:this.rawMesh.objectName,subGroups:r,absoluteVertexCount:a,absoluteIndexCount:i,absoluteColorCount:o,absoluteNormalCount:s,absoluteUvCount:l,faceCount:this.rawMesh.counts.faceCount,doubleIndicesCount:this.rawMesh.counts.doubleIndicesCount}),f},e.prototype.processCompletedMesh=function(){var e=this.finalizeRawMesh();if(n.default.Validator.isValid(e)){if(this.colors.length>0&&this.colors.length!==this.vertices.length)throw"Vertex Colors were detected, but vertex count and color count do not match!";this.logging.enabled&&this.logging.debug&&console.debug(this.createRawMeshReport(this.inputObjectCount)),this.inputObjectCount++,this.buildMesh(e);var t=this.globalCounts.currentByte/this.globalCounts.totalBytes;return this.callbackProgress("Completed [o: "+this.rawMesh.objectName+" g:"+this.rawMesh.groupName+"] Total progress: "+(100*t).toFixed(2)+"%",t),this.resetRawMesh(),!0}return!1},e.prototype.buildMesh=function(e){var t=e.subGroups,r=new Float32Array(e.absoluteVertexCount);this.globalCounts.vertices+=e.absoluteVertexCount/3,this.globalCounts.faces+=e.faceCount,this.globalCounts.doubleIndicesCount+=e.doubleIndicesCount;var a,i,o,s,l,u,c,f=e.absoluteIndexCount>0?new Uint32Array(e.absoluteIndexCount):null,d=e.absoluteColorCount>0?new Float32Array(e.absoluteColorCount):null,h=e.absoluteNormalCount>0?new Float32Array(e.absoluteNormalCount):null,p=e.absoluteUvCount>0?new Float32Array(e.absoluteUvCount):null,m=n.default.Validator.isValid(d),v=[],g=t.length>1,y=0,b=[],w=[],x=0,_=0,A=0,E=0,S=0,M=0,T=0;for(var P in t)if(t.hasOwnProperty(P)){if(c=(a=t[P]).materialName,u=this.rawMesh.faceType<4?c+(m?"_vertexColor":"")+(0===a.smoothingGroup?"_flat":""):6===this.rawMesh.faceType?"defaultPointMaterial":"defaultLineMaterial",s=this.materials[c],l=this.materials[u],!n.default.Validator.isValid(s)&&!n.default.Validator.isValid(l)){var F=m?"defaultVertexColorMaterial":"defaultMaterial";s=this.materials[F],this.logging.enabled&&console.warn('object_group "'+a.objectName+"_"+a.groupName+'" was defined with unresolvable material "'+c+'"! Assigning "'+F+'".'),(c=F)===u&&(l=s,u=F)}if(!n.default.Validator.isValid(l)){var O={materialNameOrg:c,materialName:u,materialProperties:{vertexColors:m?2:0,flatShading:0===a.smoothingGroup}},L={cmd:"materialData",materials:{materialCloneInstructions:O}};this.callbackMeshBuilder(L),this.useAsync&&(this.materials[u]=O)}if(g?((i=b[u])||(i=y,b[u]=y,v.push(u),y++),o={start:M,count:T=this.useIndices?a.indices.length:a.vertices.length/3,index:i},w.push(o),M+=T):v.push(u),r.set(a.vertices,x),x+=a.vertices.length,f&&(f.set(a.indices,_),_+=a.indices.length),d&&(d.set(a.colors,A),A+=a.colors.length),h&&(h.set(a.normals,E),E+=a.normals.length),p&&(p.set(a.uvs,S),S+=a.uvs.length),this.logging.enabled&&this.logging.debug){var C=n.default.Validator.isValid(i)?"\n\t\tmaterialIndex: "+i:"",R="\tOutput Object no.: "+this.outputObjectCount+"\n\t\tgroupName: "+a.groupName+"\n\t\tIndex: "+a.index+"\n\t\tfaceType: "+this.rawMesh.faceType+"\n\t\tmaterialName: "+a.materialName+"\n\t\tsmoothingGroup: "+a.smoothingGroup+C+"\n\t\tobjectName: "+a.objectName+"\n\t\t#vertices: "+a.vertices.length/3+"\n\t\t#indices: "+a.indices.length+"\n\t\t#colors: "+a.colors.length/3+"\n\t\t#uvs: "+a.uvs.length/2+"\n\t\t#normals: "+a.normals.length/3;console.debug(R)}}this.outputObjectCount++,this.callbackMeshBuilder({cmd:"meshData",progress:{numericalValue:this.globalCounts.currentByte/this.globalCounts.totalBytes},params:{meshName:e.name},materials:{multiMaterial:g,materialNames:v,materialGroups:w},buffers:{vertices:r,indices:f,colors:d,normals:h,uvs:p},geometryType:this.rawMesh.faceType<4?0:6===this.rawMesh.faceType?2:1},[r.buffer],n.default.Validator.isValid(f)?[f.buffer]:null,n.default.Validator.isValid(d)?[d.buffer]:null,n.default.Validator.isValid(h)?[h.buffer]:null,n.default.Validator.isValid(p)?[p.buffer]:null)},e.prototype.finalizeParsing=function(){if(this.logging.enabled&&console.info("Global output object count: "+this.outputObjectCount),this.processCompletedMesh()&&this.logging.enabled){var e="Overall counts: \n\tVertices: "+this.globalCounts.vertices+"\n\tFaces: "+this.globalCounts.faces+"\n\tMultiple definitions: "+this.globalCounts.doubleIndicesCount;console.info(e)}},e}();return r.prototype.loadMtl=function(e,t,r,a,i){var o=new n.default.ResourceDescriptor(e,"MTL");o.setContent(t),this._loadMtl(o,r,a,i)},r.prototype._loadMtl=function(e,r,n,o){void 0===i.default&&console.error('"THREE.MTLLoader" is not available. "THREE.OBJLoader2" requires it for loading MTL files.'),t.isValid(e)&&this.logging.enabled&&console.time("Loading MTL: "+e.name);var s=[],l=this,u=function(a){var n=[];if(t.isValid(a))for(var i in a.preload(),n=a.materials)n.hasOwnProperty(i)&&(s[i]=n[i]);t.isValid(e)&&l.logging.enabled&&console.timeEnd("Loading MTL: "+e.name),r(s,a)};if(t.isValid(e)&&(t.isValid(e.content)||t.isValid(e.url))){var c=new i.default(this.manager);if(n=t.verifyInput(n,"anonymous"),c.setCrossOrigin(n),c.setPath(e.path),t.isValid(o)&&c.setMaterialOptions(o),t.isValid(e.content))u(t.isValid(e.content)?c.parse(e.content):null);else if(t.isValid(e.url)){new a.FileLoader(this.manager).load(e.url,(function(t){e.content=t,u(c.parse(t))}),this._onProgress,this._onError)}}else u()},r}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.littleEndian=!0};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(e,(function(r){t(i.parse(r,e))}),r,n)},parse:function(e,t){var r=a.LoaderUtils.decodeText(e),n=function(e){var t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),a=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=a[1],t.headerLen=a[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(var n=0,i=t.fields.length;n0&&v.addAttribute("position",new a.Float32BufferAttribute(i,3)),o.length>0&&v.addAttribute("normal",new a.Float32BufferAttribute(o,3)),s.length>0&&v.addAttribute("color",new a.Float32BufferAttribute(s,3)),v.computeBoundingSphere();var g=new a.PointsMaterial({size:.005});s.length>0?g.vertexColors=!0:g.color.setHex(16777215*Math.random());var y=new a.Points(v,g),b=t.split("").reverse().join("");return b=(b=/([^\/]*)/.exec(b))[1].split("").reverse().join(""),y.name=b,y}console.error("THREE.PCDLoader: binary_compressed files are not supported")}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function n(e,t){var r=parseInt(m[v].substr(e,t));if(r){var a=function(e,t){return"s"+Math.min(e,t)+"e"+Math.max(e,t)}(y,r);void 0===p[a]&&(d.push([y-1,r-1,1]),p[a]=d.length-1)}}for(var i,o,s,l,u,c={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},f=[],d=[],h={},p={},m=e.split("\n"),v=0,g=m.length;v=t.elements[u].count&&(u++,c=0);var h=n(t.elements[u].properties,d);s(a,t.elements[u].name,h),c++}}return o(a)}function o(e){var t=new a.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.addAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.addAttribute("normal",new a.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.addAttribute("uv",new a.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.addAttribute("color",new a.Float32BufferAttribute(e.colors,3)),t.computeBoundingSphere(),t}function s(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){var a=r.vertex_indices||r.vertex_index;3===a.length?e.indices.push(a[0],a[1],a[2]):4===a.length&&(e.indices.push(a[0],a[1],a[3]),e.indices.push(a[1],a[2],a[3]))}}function l(e,t,r,a){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,a),2];case"uint16":case"ushort":return[e.getUint16(t,a),2];case"int32":case"int":return[e.getInt32(t,a),4];case"uint32":case"uint":return[e.getUint32(t,a),4];case"float32":case"float":return[e.getFloat32(t,a),4];case"float64":case"double":return[e.getFloat64(t,a),8]}}function u(e,t,r,a){for(var n,i={},o=0,s=0;s>7&1),s=n>>6&1,l=1==(n>>5&1),u=31&n,c=0,f=0;if(l?(c=(t[2]<<16)+(t[3]<<8)+t[4],f=(t[5]<<16)+(t[6]<<8)+t[7]):(c=t[2]+(t[3]<<8)+(t[4]<<16),f=t[5]+(t[6]<<8)+(t[7]<<16)),0===a)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==a)throw new Error("PRWM decoder: Unsupported format version: "+a);if(!o){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==f)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}var d,h,p,m,v,g,y,b,w=8,x={};for(b=0;b>7&1,m=1+(n>>4&3),w++,g=i(e,v=r[15&n],w=4*Math.ceil(w/4),m*c,l),w+=v.BYTES_PER_ELEMENT*m*c,x[d]={type:p,cardinality:m,values:g}}return w=4*Math.ceil(w/4),y=null,o&&(y=i(e,1===s?Uint32Array:Uint16Array,w,f,l)),{version:a,attributes:x,indices:y}}(e),s=Object.keys(o.attributes),l=new a.BufferGeometry;for(n=0;n0;return 25===h?(r=p?a.RGBA_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,t=4):24===h?(r=p?a.RGBA_PVRTC_2BPPV1_Format:a.RGB_PVRTC_2BPPV1_Format,t=2):console.error("THREE.PVRLoader: Unknown PVR format:",h),e.dataPtr=o,e.bpp=t,e.format=r,e.width=l,e.height=s,e.numSurfaces=d,e.numMipmaps=u+1,e.isCubemap=6===d,n._extract(e)},n._extract=function(e){var t,r={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},a=e.buffer,n=e.dataPtr,i=e.bpp,o=e.numSurfaces,s=0,l=0,u=0,c=0,f=0;2===i?(l=8,u=4):(l=4,u=4),t=l*u*i/8,r.mipmaps.length=e.numMipmaps*o;for(var d=0;d>d,p=e.height>>d;(c=h/l)<2&&(c=2),(f=p/u)<2&&(f=2),s=c*f*t;for(var m=0;m>5&31)/31,n=(_>>10&31)/31):(t=o,r=s,n=l)}for(var A=1;A<=3;A++){var E=y+12*A;m.push(c.getFloat32(E,!0)),m.push(c.getFloat32(E+4,!0)),m.push(c.getFloat32(E+8,!0)),v.push(b,w,x),d&&i.push(t,r,n)}}return p.addAttribute("position",new a.BufferAttribute(new Float32Array(m),3)),p.addAttribute("normal",new a.BufferAttribute(new Float32Array(v),3)),d&&(p.addAttribute("color",new a.BufferAttribute(new Float32Array(i),3)),p.hasColors=!0,p.alpha=u),p}(r):function(e){for(var t,r=new a.BufferGeometry,n=/facet([\s\S]*?)endfacet/g,i=0,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+o+o+o,"g"),l=new RegExp("normal"+o+o+o,"g"),u=[],c=[],f=new a.Vector3;null!==(t=n.exec(e));){for(var d=0,h=0,p=t[0];null!==(t=l.exec(p));)f.x=parseFloat(t[1]),f.y=parseFloat(t[2]),f.z=parseFloat(t[3]),h++;for(;null!==(t=s.exec(p));)u.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),c.push(f.x,f.y,f.z),d++;1!==h&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==d&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}return r.addAttribute("position",new a.Float32BufferAttribute(u,3)),r.addAttribute("normal",new a.Float32BufferAttribute(c,3)),r}("string"!=typeof(t=e)?a.LoaderUtils.decodeText(new Uint8Array(t)):t)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e,t,a,n,i,o,s,l){n=n*Math.PI/180,t=Math.abs(t),a=Math.abs(a);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,f=Math.cos(n)*u+Math.sin(n)*c,d=-Math.sin(n)*u+Math.cos(n)*c,h=t*t,p=a*a,m=f*f,v=d*d,g=m/h+v/p;if(g>1){var y=Math.sqrt(g);h=(t*=y)*t,p=(a*=y)*a}var b=h*v+p*m,w=(h*p-b)/b,x=Math.sqrt(Math.max(0,w));i===o&&(x=-x);var _=x*t*d/a,A=-x*a*f/t,E=Math.cos(n)*_-Math.sin(n)*A+(s.x+l.x)/2,S=Math.sin(n)*_+Math.cos(n)*A+(s.y+l.y)/2,M=r(1,0,(f-_)/t,(d-A)/a),T=r((f-_)/t,(d-A)/a,(-f-_)/t,(-d-A)/a)%(2*Math.PI);e.currentPath.absellipse(E,S,t,a,M,M+T,0===o,n)}function r(e,t,r,a){var n=e*r+t*a,i=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+a*a),o=Math.acos(Math.max(-1,Math.min(1,n/i)));return e*a-t*r<0&&(o=-o),o}function n(e,t){return t=Object.assign({},t),e.hasAttribute("fill")&&(t.fill=e.getAttribute("fill")),""!==e.style.fill&&(t.fill=e.style.fill),t}function i(e){return"none"!==e.fill&&"transparent"!==e.fill}function o(e,t){return 2*e-(t-e)}function s(e){for(var t=e.split(/[\s,]+|(?=\s?[+\-])/),r=0;r0){var p=[];for(u=0;u=t.end)return 0;this.position=t.cur;try{var r=this.readChunk(e);return t.cur+=r.size,r.id}catch(e){return this.debugMessage("Unable to read chunk at "+this.position),0}},resetPosition:function(){this.position-=6},readByte:function(e){var t=e.getUint8(this.position,!0);return this.position+=1,t},readFloat:function(e){try{var t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}},readInt:function(e){var t=e.getInt32(this.position,!0);return this.position+=4,t},readShort:function(e){var t=e.getInt16(this.position,!0);return this.position+=2,t},readDWord:function(e){var t=e.getUint32(this.position,!0);return this.position+=4,t},readWord:function(e){var t=e.getUint16(this.position,!0);return this.position+=2,t},readString:function(e,t){for(var r="",a=0;a256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case a:case n:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;var g=!1,y=!1,b=!1;switch(v.image_type){case i:g=!0,y=!0;break;case r:y=!0;break;case o:g=!0;break;case a:break;case s:g=!0,b=!0;break;case n:b=!0}var w=document.createElement("canvas");w.width=v.width,w.height=v.height;var x=w.getContext("2d"),_=x.createImageData(v.width,v.height),A=function(e,t,r,a,n){var i,o,s,l;if(o=r.pixel_size>>3,s=r.width*r.height*o,t&&(l=n.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,c,f;i=new Uint8Array(s);for(var d=0,h=new Uint8Array(o);d>u){default:case d:i=0,s=1,m=t,o=0,p=1,g=r;break;case c:i=0,s=1,m=t,o=r-1,p=-1,g=-1;break;case h:i=t-1,s=-1,m=-1,o=0,p=1,g=r;break;case f:i=t-1,s=-1,m=-1,o=r-1,p=-1,g=-1}if(b)switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f++)l=s[f],e[4*(u+d*c)+0]=l,e[4*(u+d*c)+1]=l,e[4*(u+d*c)+2]=l,e[4*(u+d*c)+3]=255}(e,o,p,g,i,s,m,a);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=2)e[4*(l+f*u)+0]=s[c+0],e[4*(l+f*u)+1]=s[c+0],e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+3]=s[c+1]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s,l){var u,c,f,d=l,h=0,p=v.width;for(f=t;f!==a;f+=r)for(c=n;c!==o;c+=i,h++)u=s[h],e[4*(c+p*f)+3]=255,e[4*(c+p*f)+2]=d[3*u+0],e[4*(c+p*f)+1]=d[3*u+1],e[4*(c+p*f)+0]=d[3*u+2]}(e,o,p,g,i,s,m,a,n);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f+=2)l=s[f+0]+(s[f+1]<<8),e[4*(u+d*c)+0]=(31744&l)>>7,e[4*(u+d*c)+1]=(992&l)>>2,e[4*(u+d*c)+2]=(31&l)>>3,e[4*(u+d*c)+3]=32768&l?0:255}(e,o,p,g,i,s,m,a);break;case 24:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=3)e[4*(l+f*u)+3]=255,e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2]}(e,o,p,g,i,s,m,a);break;case 32:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=4)e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2],e[4*(l+f*u)+3]=s[c+3]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}}(_.data,v.width,v.height,A.pixel_data,A.palettes);return x.putImageData(_,0,0),w}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.reversed=!1};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){var t,r=[];e.forEach((function(e){"m"===e.type.toLowerCase()?(t=[e],r.push(t)):"z"!==e.type.toLowerCase()&&t.push(e)}));var a=[];return r.forEach((function(e){var t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};a.push(t);for(var r=e.length-1;r>0;r--){var n=e[r];t={type:n.type};void 0!==n.x2&&void 0!==n.y2?(t.x1=n.x2,t.y1=n.y2,t.x2=n.x1,t.y2=n.y1):void 0!==n.x1&&void 0!==n.y1&&(t.x1=n.x1,t.y1=n.y1),t.x=e[r-1].x,t.y=e[r-1].y,a.push(t)}})),a}return"undefined"==typeof opentype?(console.warn("THREE.TTFLoader: The loader requires opentype.js. Make sure it's included before using the loader."),null):function(e,r){for(var a=Math.round,n={},i=1e5/(72*(e.unitsPerEm||2048)),o=0;o-1;o--){var s=i[o];if(/{.*[{\[]/.test(s))(l=s.split("{").join("{\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);else if(/\].*}/.test(s)){var l;(l=s.split("]").join("]\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l)}if(/}.*}/.test(s))(l=s.split("}").join("}\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);/^\b[^\s]+\b$/.test(s.trim())?(i[o+1]=s+" "+i[o+1].trim(),i.splice(o,1)):s.indexOf("coord")>-1&&s.indexOf("[")<0&&s.indexOf("{")<0&&(i[o]+=" Coordinate {}")}var u=i.shift();return/V1.0/.exec(u)?console.warn("THREE.VRMLLoader: V1.0 not supported yet."):/V2.0/.exec(u)&&function(e,n){var i={},o=/(\b|\-|\+)([\d\.e]+)/,s=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g,l=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g;function u(e,t,r,n,i){for(var o=!0===i?1:-1,s=[],l={},u={},c=0;cu.y:m.y>=l.y&&m.y0)for(var d=0;d0&&this.indexes.push(c),c=[]):c.push(parseInt(i[d])));/]/.exec(t)&&(c.length>0&&this.indexes.push(c),c=[],this.isRecordingFaces=!1,e[this.recordingFieldname]=this.indexes)}else if(this.isRecordingPoints){if("Coordinate"==e.nodeType)for(;null!==(i=l.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2]),z:parseFloat(i[3])},this.points.push(n);if("TextureCoordinate"==e.nodeType)for(;null!==(i=s.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2])},this.points.push(n);/]/.exec(t)&&(this.isRecordingPoints=!1,e.points=this.points)}else if(this.isRecordingAngles){if(i.length>0)for(d=0;d-1&&"PointLight"===o.nodeType&&(o.nodeType="AmbientLight");var c=void 0===o.on||o.on,f=void 0!==o.intensity?o.intensity:1,d=new a.Color;if(o.color&&d.copy(o.color),"AmbientLight"===o.nodeType)(l=new a.AmbientLight(d,f)).visible=c,s.add(l);else if("PointLight"===o.nodeType){var h=0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),(l=new a.PointLight(d,f,h)).visible=c,s.add(l)}else if("SpotLight"===o.nodeType){f=1,h=0;var p=Math.PI/3;c=!0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),void 0!==o.cutOffAngle&&(p=o.cutOffAngle),(l=new a.SpotLight(d,f,h,p,0)).visible=c,s.add(l)}else if("Transform"===o.nodeType||"Group"===o.nodeType){if(l=new a.Object3D,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),void 0!==o.translation){var m=o.translation;l.position.set(m.x,m.y,m.z)}if(void 0!==o.rotation){var v=o.rotation;l.quaternion.setFromAxisAngle(new a.Vector3(v.x,v.y,v.z),v.w)}if(void 0!==o.scale){var g=o.scale;l.scale.set(g.x,g.y,g.z)}s.add(l)}else if("Shape"===o.nodeType)l=new a.Mesh,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),s.add(l);else if("Background"===o.nodeType){var y=2e4,b=new a.SphereBufferGeometry(y,20,20),w=new a.MeshBasicMaterial({fog:!1,side:a.BackSide});if(o.skyColor.length>1)u(b,y,o.skyAngle,o.skyColor,!0),w.vertexColors=a.VertexColors;else{var x=o.skyColor[0];w.color.setRGB(x.r,x.b,x.g)}if(n.add(new a.Mesh(b,w)),void 0!==o.groundColor){y=12e3;var _=new a.SphereBufferGeometry(y,20,20,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),A=new a.MeshBasicMaterial({fog:!1,side:a.BackSide,vertexColors:a.VertexColors});u(_,y,o.groundAngle,o.groundColor,!1),n.add(new a.Mesh(_,A))}}else{if(/geometry/.exec(o.string)){if("Box"===o.nodeType){g=o.size;s.geometry=new a.BoxBufferGeometry(g.x,g.y,g.z)}else if("Cylinder"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.radius,o.radius,o.height);else if("Cone"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.topRadius,o.bottomRadius,o.height);else if("Sphere"===o.nodeType)s.geometry=new a.SphereBufferGeometry(o.radius);else if("IndexedFaceSet"===o.nodeType){var E,S,M,T,P,F=new a.BufferGeometry,O=[],L=[];for(B=0,M=o.children.length;B-1){var C=/DEF\s+([^\s]+)/.exec(V.string)[1];i[C]=O.slice(0)}if(V.string.indexOf("USE")>-1){W=/USE\s+([^\s]+)/.exec(V.string)[1];O=i[W]}}}var R=0;if(o.coordIndex){var k=[],I=[];for(E=new a.Vector3,S=new a.Vector2,B=0,M=o.coordIndex.length;B=3&&R0&&F.addAttribute("uv",new a.Float32BufferAttribute(L,2)),F.computeVertexNormals(),F.computeBoundingSphere(),/DEF/.exec(o.string)&&(F.name=/DEF ([^\s]+)/.exec(o.string)[1],i[F.name]=F),s.geometry=F}return}if(/appearance/.exec(o.string)){for(var B=0;B>1^-(1&c),a[n]=s*(l+o),n+=i}},n.prototype.decompressIndices_=function(e,t,r,a,n){for(var i=0,o=0;o>1,p=e.charCodeAt(u+4)+1>>1,m=e.charCodeAt(u+5)+1>>1;l[s++]=n[0]*(c+h),l[s++]=n[1]*(f+p),l[s++]=n[2]*(d+m),l[s++]=n[0]*h,l[s++]=n[1]*p,l[s++]=n[2]*m}return l},n.prototype.decompressMesh=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=u,d=new Float32Array(o*c),h=0;h>1^-(1&f);l[c]+=d,s[t*u+c]=l[c],o[t*u+c]=a[c]*(l[c]+r[c])}},n.prototype.accumulateNormal=function(e,t,r,a,n){var i=a[8*e],o=a[8*e+1],s=a[8*e+2],l=a[8*t],u=a[8*t+1],c=a[8*t+2],f=a[8*r],d=a[8*r+1],h=a[8*r+2];l-=i,f-=i,i=(u-=o)*(h-=s)-(c-=s)*(d-=o),o=c*f-l*h,s=l*d-u*f,n[3*e]+=i,n[3*e+1]+=o,n[3*e+2]+=s,n[3*t]+=i,n[3*t+1]+=o,n[3*t+2]+=s,n[3*r]+=i,n[3*r+1]+=o,n[3*r+2]+=s},n.prototype.decompressMesh2=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=t.codeRange[0],d=3*t.codeRange[2],h=new Uint16Array(d),p=new Int32Array(3*c),m=new Uint16Array(o),v=new Uint16Array(o*c),g=new Float32Array(o*c),y=0,b=0,w=0;w>1^-(1&O))+v[o*A+F]+v[o*E+F]-v[o*S+F];m[F]=L,v[o*y+F]=L,g[o*y+F]=l[F]*(L+s[F])}y++}else this.copyAttrib(o,v,m,P);this.accumulateNormal(A,E,P,v,p)}else{var C=y-(x-_);h[b++]=C,x===_?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,C);var R=y-(x=e.charCodeAt(f++));h[b++]=R,0===x?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,R);var k=y-(x=e.charCodeAt(f++));if(h[b++]=k,0===x){for(F=0;F<5;F++)m[F]=(v[o*C+F]+v[o*R+F])/2;this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++)}else this.copyAttrib(o,v,m,k);this.accumulateNormal(C,R,k,v,p)}}for(w=0;w>1^-(1&j)),g[o*w+6]=U*N+(B>>1^-(1&B)),g[o*w+7]=U*D+(V>>1^-(1&V))}i(a,n,g,h,void 0,t)},n.prototype.downloadMesh=function(e,t,r,a,n){var i=this,s=0;o(e,(function(e){!function(e){for(;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=new s(3*f/4-(i="="===e[f-2]?2:"="===e[f-1]?1:0)),a=i>0?f-4:f;var d=0;for(t=0,r=0;t>16,o[d++]=(65280&n)>>8,o[d++]=255&n;return 2===i?(n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[d++]=255&n):1===i&&(n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[d++]=n>>8&255,o[d++]=255&n),o}function n(e,a){var n,i,s,l,u=0;if("UInt64"===o.attributes.header_type?u=8:"UInt32"===o.attributes.header_type&&(u=4),"binary"===e.attributes.format&&a){var c,f,d,h,p,m;if("Float32"===e.attributes.type)var v=new Float32Array;else if("Int64"===e.attributes.type)v=new Int32Array;f=(c=r(e["#text"]))[0];for(var g=1;g0?3-h%3:0,(p=[]).push(m),d=3*u;for(g=0;g0){r.attributes={};for(var a=0;a0&&(v[g].text=n(v[g],f)),g++;switch(d[h]){case"PointData":var b=parseInt(c.attributes.NumberOfPoints),w=m.attributes.Normals;if(b>0)for(var x=0,_=v.length;x<_;x++)if(w===v[x].attributes.Name){var A=v[x].attributes.NumberOfComponents;(l=new Float32Array(b*A)).set(v[x].text,0)}break;case"Points":if((b=parseInt(c.attributes.NumberOfPoints))>0){A=m.DataArray.attributes.NumberOfComponents;(s=new Float32Array(b*A)).set(m.DataArray.text,0)}break;case"Strips":var E=parseInt(c.attributes.NumberOfStrips);if(E>0){var S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);var T=E+S.length;u=new Uint32Array(3*T-9*E);var P=0;for(x=0,_=E;x<_;x++){for(var F=[],O=0,L=M[x],C=0;O0&&(C=M[x-1]);var R=0;for(L=M[x],C=0;R0&&(C=M[x-1])}}break;case"Polys":var k=parseInt(c.attributes.NumberOfPolys);if(k>0){S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);T=k+S.length;u=new Uint32Array(3*T-9*k);P=0;var I=0;for(x=0,_=k,C=0;x<_;){var N=[];for(O=0,L=M[x];O=3)for(var C=parseInt(L[0]),R=1,k=0;k=3){var I,N;for(k=0;k=u.byteLength)break}var A=new a.BufferGeometry;return A.setIndex(new a.BufferAttribute(h,1)),A.addAttribute("position",new a.BufferAttribute(f,3)),d.length===f.length&&A.addAttribute("normal",new a.BufferAttribute(d,3)),A}(e)}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(var r=t;r-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,a=0;a127)return!0;return!1}},{key:"ensureBinary",value:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),r=0;r0&&(this.baseDir=this.url.substr(0,this.url.lastIndexOf("/")+1));this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this.mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var a=this._data.indexOf("{",r)+1,n=this._data.indexOf("}",r),i=this._data.indexOf("{",a)+1;if(!(a>0&&n>a)){r=-1===a?this._data.length:n+1;break}var o={children:[]},s=this._readLine(this._data.substr(r,a-r-1)).trim(),l=s.split(/ /g);if(l.length>0?(o.type=l[0],l.length>=2?o.name=l[1]:o.name=l[0]+this.Hierarchies.children.length):(o.name=s,o.type=""),"Animation"===o.type){o.data=this._data.substr(i,n-i).trim();var u=this._hierarchieParse(o,n+1);r=u.end,o.children=u.parent.children}else{var c=this._data.lastIndexOf(";",i>0?Math.min(i,n):n);if(o.data=this._data.substr(a,c-a).trim(),i<=0||n0||!this._currentObject.worked?setTimeout((function(){e.mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.Geometry=new a.Geometry,this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new s,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new a.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new a.Bone;if(e.name=this._currentFrame.name,e.applyMatrix(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(var t in this.HieStack)this.HieStack[t].name===this._currentFrame.parentName&&this.HieStack[t].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,a=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,n=0,(a=this._currentObject.data.indexOf(";;",e)+1)<=0&&(a=this._currentObject.data.length)}else{var o=0;switch(t){case 0:o=this._currentObject.data.indexOf(",",e)+1;break;case 1:o=this._currentObject.data.indexOf(";,",e)+1}switch((0===o||o>a)&&(o=a,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,o-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,o-e))}break;case"MeshNormals":switch(t){case 0:this._readNormalVector1(this._currentObject.data.substr(e,o-e));break;case 1:this._readNormalFace1(this._currentObject.data.substr(e,o-e),n)}}e=o+1,n++,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.Geometry.vertices.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))),this._currentGeo.Geometry.skinIndices.push(new a.Vector4(0,0,0,0)),this._currentGeo.Geometry.skinWeights.push(new a.Vector4(1,0,0,0)),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.Geometry.faces.push(new a.Face3(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),new a.Vector3(1,1,1).normalize()))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.normalVectors.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])))}},{key:"_readNormalFace1",value:function(e,t){var r=this._readLine(e.trim()).substr(2,e.length-4).split(","),a=parseInt(r[0],10),n=this._currentGeo.normalVectors[a];a=parseInt(r[1],10);var i=this._currentGeo.normalVectors[a];a=parseInt(r[2],10);var o=this._currentGeo.normalVectors[a];this._currentGeo.Geometry.faces[t].vertexNormals=[n,i,o]}},{key:"_setMeshNormals",value:function(){for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var a=this._currentObject.data.indexOf(",",e)+1;-1===a&&(a=this._currentObject.data.indexOf(";;",e)+1,t=2,r=0);var n=this._currentObject.data.substr(e,a-e),i=this._readLine(n.trim()).split(";");this._currentGeo.normalVectors.push([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]),e=a+1}}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshTextureCoords",value:function(){this._tmpUvArray=[],this._currentGeo.Geometry.faceVertexUvs=[],this._currentGeo.Geometry.faceVertexUvs.push([]);for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),o=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),1-parseFloat(o[1]))):this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),parseFloat(o[1]))),e=n+1}}if(e>=this._currentObject.data.length)break}this._currentGeo.Geometry.faceVertexUvs[0]=[];for(var s=0;s=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new a.MeshPhongMaterial({color:16777215*Math.random()});e.side=a.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t),i=this._readLine(n.trim()).split(";");e.color.r=parseFloat(i[0]),e.color.g=parseFloat(i[1]),e.color.b=parseFloat(i[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(n)),t=r+1,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t);var o=this._readLine(n.trim()).split(";");e.specular.r=parseFloat(o[0]),e.specular.g=parseFloat(o[1]),e.specular.b=parseFloat(o[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),n=this._currentObject.data.substr(t,r-t);var s=this._readLine(n.trim()).split(";");e.emissive.r=parseFloat(s[0]),e.emissive.g=parseFloat(s[1]),e.emissive.b=parseFloat(s[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var u=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(this.baseDir+u);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(this.baseDir+u),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(this.baseDir+u),e.normalScale=new a.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(this.baseDir+u);break;case"LightMapFilename":e.lightMap=this.texloader.load(this.baseDir+u)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new o,t=0,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);t=r+1,e.boneName=n.substr(1,n.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(r=this._currentObject.data.indexOf(";",t))+1,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);for(var i=this._readLine(n.trim()).split(","),s=0;s0)for(var o=0;o0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(var r=0;r4&&console.log("warn! over 4 bone weight! :"+s)}}for(var u=0;u0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,i&&e.context.disable(e.context.STENCIL_TEST),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new a.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new a.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionX,e.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.context.enable(e.context.STENCIL_TEST),e.render(this.scene,this.camera,r,!1),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:new a.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),s.BlurDirectionX=new a.Vector2(1,0),s.BlurDirectionY=new a.Vector2(0,1),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=r(1),i=(a=n)&&a.__esModule?a:{default:a};var o=function(e,t,r,a,n){i.default.call(this),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=a,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};o.prototype=Object.assign(Object.create(i.default.prototype),{constructor:o,render:function(e,t,r,a,n){var i,o,s=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),o=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),this.clearColor&&e.setClearColor(i,o),this.scene.overrideMaterial=null,e.autoClear=s}}),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=c(r(1)),i=c(r(19)),o=c(r(20)),s=c(r(2)),l=c(r(21)),u=c(r(22));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e,t,r,u,c){(n.default.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==r&&r,this.supportsNormalTexture=void 0!==u&&u,this.oldClearColor=new a.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==c?new a.Vector2(c.x,c.y):new a.Vector2(256,256),this.saoRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.NearestFilter,magFilter:a.NearestFilter,format:a.RGBAFormat}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((r=new a.DepthTexture).type=a.UnsignedShortType,r.minFilter=a.NearestFilter,r.maxFilter=a.NearestFilter,this.beautyRenderTarget.depthTexture=r,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.normalMaterial=new a.MeshNormalMaterial,this.normalMaterial.blending=a.NoBlending,void 0===i.default&&console.error("THREE.SAOPass relies on THREE.SAOShader"),this.saoMaterial=new a.ShaderMaterial({defines:Object.assign({},i.default.defines),fragmentShader:i.default.fragmentShader,vertexShader:i.default.vertexShader,uniforms:a.UniformsUtils.clone(i.default.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=a.NoBlending,void 0===o.default&&console.error("THREE.SAOPass relies on THREE.DepthLimitedBlurShader"),this.vBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=a.NoBlending,this.hBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=a.NoBlending,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.CopyShader"),this.materialCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(s.default.uniforms),vertexShader:s.default.vertexShader,fragmentShader:s.default.fragmentShader,blending:a.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=a.CustomBlending,this.materialCopy.blendSrc=a.DstColorFactor,this.materialCopy.blendDst=a.ZeroFactor,this.materialCopy.blendEquation=a.AddEquation,this.materialCopy.blendSrcAlpha=a.DstAlphaFactor,this.materialCopy.blendDstAlpha=a.ZeroFactor,this.materialCopy.blendEquationAlpha=a.AddEquation,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.UnpackDepthRGBAShader"),this.depthCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(l.default.uniforms),vertexShader:l.default.vertexShader,fragmentShader:l.default.fragmentShader,blending:a.NoBlending}),this.quadCamera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.quadScene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quadScene.add(this.quad)};f.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},f.prototype=Object.assign(Object.create(n.default.prototype),{constructor:f,render:function(e,t,r,n,i){if(this.renderToScreen&&(this.materialCopy.blending=a.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,e.clearTarget(this.depthRenderTarget),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(u.default.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(0,1)),u.default.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.render(this.scene,this.camera,this.beautyRenderTarget,!0),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var l=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,l=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?l.blending=a.CustomBlending:l.blending=a.NoBlending,this.renderPass(e,l,this.renderToScreen?null:r),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}},renderPass:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.quad.material=t,e.render(this.quadScene,this.quadCamera,r,l),e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},renderOverride:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1,a=t.clearColor||a,n=t.clearAlpha||n;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.scene.overrideMaterial=t,e.render(this.scene,this.camera,r,l),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}}),t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){n.default.call(this),void 0===i.default&&console.error("THREE.SavePass relies on THREE.CopyShader");var t=i.default;this.textureID="tDiffuse",this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new a.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBFormat,stencilBuffer:!1}),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,e.render(this.scene,this.camera,this.renderTarget,this.clear)}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(23));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),this.edgesRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var r=new Image;r.src=this.getAreaTexture(),this.areaTexture=new a.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=a.RGBFormat,this.areaTexture.minFilter=a.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.needsUpdate=!0,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),this.searchTexture=new a.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=a.NearestFilter,this.searchTexture.minFilter=a.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.needsUpdate=!0,this.searchTexture.flipY=!1,void 0===i.default&&console.error("THREE.SMAAPass relies on THREE.SMAAShader"),this.uniformsEdges=a.UniformsUtils.clone(i.default[0].uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new a.ShaderMaterial({defines:Object.assign({},i.default[0].defines),uniforms:this.uniformsEdges,vertexShader:i.default[0].vertexShader,fragmentShader:i.default[0].fragmentShader}),this.uniformsWeights=a.UniformsUtils.clone(i.default[1].uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new a.ShaderMaterial({defines:Object.assign({},i.default[1].defines),uniforms:this.uniformsWeights,vertexShader:i.default[1].vertexShader,fragmentShader:i.default[1].fragmentShader}),this.uniformsBlend=a.UniformsUtils.clone(i.default[2].uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new a.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:i.default[2].vertexShader,fragmentShader:i.default[2].fragmentShader}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniformsEdges.tDiffuse.value=r.texture,this.quad.material=this.materialEdges,e.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,e.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=r.texture,this.quad.material=this.materialBlend,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUp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wZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(3)),i=o(r(25));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){if(void 0===i.default)return console.warn("THREE.SSAOPass depends on THREE.SSAOShader"),new n.default;n.default.call(this,i.default),this.width=void 0!==r?r:512,this.height=void 0!==o?o:256,this.renderToScreen=!1,this.camera2=t,this.scene2=e,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.depthRenderTarget=new a.WebGLRenderTarget(this.width,this.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter}),this.uniforms.tDepth.value=this.depthRenderTarget.texture,this.uniforms.size.value.set(this.width,this.height),this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far,this.uniforms.radius.value=4,this.uniforms.onlyAO.value=!1,this.uniforms.aoClamp.value=.25,this.uniforms.lumInfluence.value=.7;Object.defineProperties(this,{radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},onlyAO:{get:function(){return this.uniforms.onlyAO.value},set:function(e){this.uniforms.onlyAO.value=e}},aoClamp:{get:function(){return this.uniforms.aoClamp.value},set:function(e){this.uniforms.aoClamp.value=e}},lumInfluence:{get:function(){return this.uniforms.lumInfluence.value},set:function(e){this.uniforms.lumInfluence.value=e}}})};(s.prototype=Object.create(n.default.prototype)).render=function(e,t,r,a,i){this.scene2.overrideMaterial=this.depthMaterial,e.render(this.scene2,this.camera2,this.depthRenderTarget,!0),this.scene2.overrideMaterial=null,n.default.prototype.render.call(this,e,t,r,a,i)},s.prototype.setScene=function(e){this.scene2=e},s.prototype.setCamera=function(e){this.camera2=e,this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far},s.prototype.setSize=function(e,t){this.width=e,this.height=t,this.uniforms.size.value.set(this.width,this.height),this.depthRenderTarget.setSize(this.width,this.height)},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(24),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t,r){void 0===o.default&&console.error("THREE.TAARenderPass relies on THREE.SSAARenderPass"),o.default.call(this,e,t,r),this.sampleLevel=0,this.accumulate=!1};s.JitterVectors=o.default.JitterVectors,s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a){if(!this.accumulate)return o.default.prototype.render.call(this,e,t,r,a),void(this.accumulateIndex=-1);var i=s.JitterVectors[5];this.sampleRenderTarget||(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),this.holdRenderTarget||(this.holdRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.holdRenderTarget.texture.name="TAARenderPass.hold"),this.accumulate&&-1===this.accumulateIndex&&(o.default.prototype.render.call(this,e,this.holdRenderTarget,r,a),this.accumulateIndex=0);var l=e.autoClear;e.autoClear=!1;var u=1/i.length;if(this.accumulateIndex>=0&&this.accumulateIndex=i.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}var h=this.accumulateIndex*u;h>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.render(this.scene2,this.camera2,t,!0)),h<1&&(this.copyUniforms.opacity.value=1-h,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.render(this.scene2,this.camera2,t,0===h)),e.autoClear=l}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),void 0===i.default&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=i.default;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=a.UniformsUtils.clone(r.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){var i=e.autoClear;e.autoClear=!1,this.quad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),e.autoClear=i}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=s(r(1)),i=s(r(2)),o=s(r(26));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e,t,r,s){n.default.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=s,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);var l={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var u=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new a.WebGLRenderTarget(u,c,l),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var f=0;f\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new a.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),l.BlurDirectionX=new a.Vector2(1,0),l.BlurDirectionY=new a.Vector2(0,1),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaterRefractionShader=t.VignetteShader=t.VerticalTiltShiftShader=t.VerticalBlurShader=t.UnpackDepthRGBAShader=t.TriangleBlurShader=t.ToneMapShader=t.TechnicolorShader=t.SSAOShader=t.SobelOperatorShader=t.SMAAShader=t.SepiaShader=t.SAOShader=t.RGBShiftShader=t.PixelShader=t.ParallaxShader=t.NormalMapShader=t.MirrorShader=t.LuminosityShader=t.LuminosityHighPassShader=t.KaleidoShader=t.HueSaturationShader=t.HorizontalTiltShiftShader=t.HorizontalBlurShader=t.HalftoneShader=t.GammaCorrectionShader=t.FXAAShader=t.FresnelShader=t.FreiChenShader=t.FocusShader=t.FilmShader=t.DotScreenShader=t.DOFMipMapShader=t.DigitalGlitch=t.DepthLimitedBlurShader=t.CopyShader=t.ConvolutionShader=t.ColorifyShader=t.ColorCorrectionShader=t.BrightnessContrastShader=t.BokehShader2=t.BokehShader=t.BlurShaderUtils=t.BlendShader=t.BleachBypassShader=t.BasicShader=void 0;var a=Q(r(113)),n=Q(r(114)),i=Q(r(115)),o=Q(r(22)),s=Q(r(14)),l=Q(r(116)),u=Q(r(117)),c=Q(r(118)),f=Q(r(119)),d=Q(r(13)),h=Q(r(2)),p=Q(r(20)),m=Q(r(17)),v=Q(r(120)),g=Q(r(15)),y=Q(r(16)),b=Q(r(121)),w=Q(r(122)),x=Q(r(123)),_=Q(r(124)),A=Q(r(125)),E=Q(r(18)),S=Q(r(126)),M=Q(r(127)),T=Q(r(128)),P=Q(r(129)),F=Q(r(26)),O=Q(r(11)),L=Q(r(130)),C=Q(r(131)),R=(Q(r(132)),Q(r(133))),k=Q(r(134)),I=Q(r(135)),N=Q(r(19)),D=Q(r(136)),U=Q(r(23)),j=Q(r(137)),B=Q(r(25)),V=Q(r(138)),z=Q(r(12)),G=Q(r(139)),H=Q(r(21)),X=Q(r(140)),Y=Q(r(141)),W=Q(r(142)),q=Q(r(143));function Q(e){return e&&e.__esModule?e:{default:e}}t.BasicShader=a.default,t.BleachBypassShader=n.default,t.BlendShader=i.default,t.BlurShaderUtils=o.default,t.BokehShader=s.default,t.BokehShader2=l.default,t.BrightnessContrastShader=u.default,t.ColorCorrectionShader=c.default,t.ColorifyShader=f.default,t.ConvolutionShader=d.default,t.CopyShader=h.default,t.DepthLimitedBlurShader=p.default,t.DigitalGlitch=m.default,t.DOFMipMapShader=v.default,t.DotScreenShader=g.default,t.FilmShader=y.default,t.FocusShader=b.default,t.FreiChenShader=w.default,t.FresnelShader=x.default,t.FXAAShader=_.default,t.GammaCorrectionShader=A.default,t.HalftoneShader=E.default,t.HorizontalBlurShader=S.default,t.HorizontalTiltShiftShader=M.default,t.HueSaturationShader=T.default,t.KaleidoShader=P.default,t.LuminosityHighPassShader=F.default,t.LuminosityShader=O.default,t.MirrorShader=L.default,t.NormalMapShader=C.default,t.ParallaxShader=R.default,t.PixelShader=k.default,t.RGBShiftShader=I.default,t.SAOShader=N.default,t.SepiaShader=D.default,t.SMAAShader=U.default,t.SobelOperatorShader=j.default,t.SSAOShader=B.default,t.TechnicolorShader=V.default,t.ToneMapShader=z.default,t.TriangleBlurShader=G.default,t.UnpackDepthRGBAShader=H.default,t.VerticalBlurShader=X.default,t.VerticalTiltShiftShader=Y.default,t.VignetteShader=W.default,t.WaterRefractionShader=q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","vec4 texel1 = texture2D( tDiffuse1, vUv );","vec4 texel2 = texture2D( tDiffuse2, vUv );","gl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float penta(vec2 coords) {","//pentagonal shape","float scale = float(rings) - 1.3;","vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","vec4 one = vec4( 1.0 );","vec4 P = vec4((coords),vec2(scale, scale));","vec4 dist = vec4(0.0);","float inorout = -4.0;","dist.x = dot( P, HS0 );","dist.y = dot( P, HS1 );","dist.z = dot( P, HS2 );","dist.w = dot( P, HS3 );","dist = smoothstep( -feather, feather, dist );","inorout += dot( dist, one );","dist.x = dot( P, HS4 );","dist.y = HS5.w - abs( P.z );","dist = smoothstep( -feather, feather, dist );","inorout += dist.x;","return clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","// Depth buffer blur","float d = 0.0;","float kernel[9];","vec2 offset[9];","vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","offset[0] = vec2(-wh.x,-wh.y);","offset[1] = vec2( 0.0, -wh.y);","offset[2] = vec2( wh.x -wh.y);","offset[3] = vec2(-wh.x, 0.0);","offset[4] = vec2( 0.0, 0.0);","offset[5] = vec2( wh.x, 0.0);","offset[6] = vec2(-wh.x, wh.y);","offset[7] = vec2( 0.0, wh.y);","offset[8] = vec2( wh.x, wh.y);","kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","for( int i=0; i<9; i++ ) {","float tmp = getDepth( coords + offset[ i ] );","d += tmp * kernel[i];","}","return d;","}","vec3 color(vec2 coords,float blur) {","//processing the sample","vec3 col = vec3(0.0);","vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","vec3 lumcoeff = vec3(0.299,0.587,0.114);","float lum = dot(col.rgb, lumcoeff);","float thresh = max((lum-threshold)*gain, 0.0);","return col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","float edge = 0.002*depth; //distance based edge smoothing","float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","return col;","}","float linearize(float depth) {","return -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","float dist = distance(vUv.xy, vec2(0.5,0.5));","dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","return clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","float rings2 = float(rings);","float step = PI*2.0 / float(ringsamples);","float pw = cos(j*step)*i;","float ph = sin(j*step)*i;","float p = 1.0;","if (pentagon) {","p = penta(vec2(pw,ph));","}","col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","return 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","//scene depth calculation","float depth = linearize( getDepth( vUv.xy ) );","// Blur depth?","if (depthblur) {","depth = linearize(bdepth(vUv.xy));","}","//focal plane calculation","float fDepth = focalDepth;","if (shaderFocus) {","fDepth = linearize( getDepth( focusCoords ) );","}","// dof blur factor calculation","float blur = 0.0;","if (manualdof) {","float a = depth-fDepth; // Focal plane","float b = (a-fdofstart)/fdofdist; // Far DoF","float c = (-a-ndofstart)/ndofdist; // Near Dof","blur = (a>0.0) ? b : c;","} else {","float f = focalLength; // focal length in mm","float d = fDepth*1000.0; // focal plane in mm","float o = depth*1000.0; // depth in mm","float a = (o*f)/(o-f);","float b = (d*f)/(d-f);","float c = (d-f)/(d*fstop*CoC);","blur = abs(a-b)*c;","}","blur = clamp(blur,0.0,1.0);","// calculation of pattern for dithering","vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","// getting blur x and y step factor","float w = (1.0/textureWidth)*blur*maxblur+noise.x;","float h = (1.0/textureHeight)*blur*maxblur+noise.y;","// calculation of final color","vec3 col = vec3(0.0);","if(blur < 0.05) {","//some optimization thingy","col = texture2D(tColor, vUv.xy).rgb;","} else {","col = texture2D(tColor, vUv.xy).rgb;","float s = 1.0;","int ringsamples;","for (int i = 1; i <= rings; i++) {","/*unboxstart*/","ringsamples = i * samples;","for (int j = 0 ; j < maxringsamples ; j++) {","if (j >= ringsamples) break;","s += gather(float(i), float(j), ringsamples, col, w, h, blur);","}","/*unboxend*/","}","col /= s; //divide by sample count","}","if (showFocus) {","col = debugFocus(col, blur, depth);","}","if (vignetting) {","col *= vignette();","}","gl_FragColor.rgb = col;","gl_FragColor.a = 1.0;","} "].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},powRGB:{value:new a.Vector3(2,2,2)},mulRGB:{value:new a.Vector3(1,1,1)},addRGB:{value:new a.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},color:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},aspect:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","G[0] = g0,","G[1] = g1,","G[2] = g2,","G[3] = g3,","G[4] = g4,","G[5] = g5,","G[6] = g6,","G[7] = g7,","G[8] = g8;","mat3 I;","float cnv[9];","vec3 sample;","for (float i=0.0; i<3.0; i++) {","for (float j=0.0; j<3.0; j++) {","sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","I[int(i)][int(j)] = length(sample);","}","}","for (int i=0; i<9; i++) {","float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","cnv[i] = dp3 * dp3;","}","float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","vec3 I = worldPosition.xyz - cameraPosition;","vReflect = reflect( I, worldNormal );","vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","vec4 refractedColor = vec4( 1.0 );","refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immedates."," // Immedates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","gl_FragColor = LinearToGamma( tex, float( GAMMA_FACTOR ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 p = vUv - 0.5;","float r = length(p);","float a = atan(p.y, p.x) + angle;","float tau = 2. * 3.1416 ;","a = mod(a, tau/sides);","a = abs(a - tau/sides/2.) ;","p = r * vec2(cos(a), sin(a));","vec4 color = texture2D(tDiffuse, p + 0.5);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","vec2 p = vUv;","if (side == 0){","if (p.x > 0.5) p.x = 1.0 - p.x;","}else if (side == 1){","if (p.x < 0.5) p.x = 1.0 - p.x;","}else if (side == 2){","if (p.y < 0.5) p.y = 1.0 - p.y;","}else if (side == 3){","if (p.y > 0.5) p.y = 1.0 - p.y;","} ","vec4 color = texture2D(tDiffuse, p);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{heightMap:{value:null},resolution:{value:new a.Vector2(512,512)},scale:{value:new a.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));a.ShaderLib.ocean_sim_vertex={vertexShader:["varying vec2 vUV;","void main (void) {","vUV = position.xy * 0.5 + 0.5;","gl_Position = vec4(position, 1.0 );","}"].join("\n")},a.ShaderLib.ocean_subtransform={uniforms:{u_input:{value:null},u_transformSize:{value:512},u_subtransformSize:{value:250}},fragmentShader:["precision highp float;","#include ","uniform sampler2D u_input;","uniform float u_transformSize;","uniform float u_subtransformSize;","varying vec2 vUV;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","void main (void) {","#ifdef HORIZONTAL","float index = vUV.x * u_transformSize - 0.5;","#else","float index = vUV.y * u_transformSize - 0.5;","#endif","float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);","#ifdef HORIZONTAL","vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","#else","vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;","#endif","float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);","vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));","vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);","vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);","gl_FragColor = vec4(outputA, outputB);","}"].join("\n")},a.ShaderLib.ocean_initial_spectrum={uniforms:{u_wind:{value:new a.Vector2(10,10)},u_resolution:{value:512},u_size:{value:250}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","const float CM = 0.23;","uniform vec2 u_wind;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + pow2(k / KM)));","}","float tanh (float x) {","return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 K = (2.0 * PI * vec2(n, m)) / u_size;","float k = length(K);","float l_wind = length(u_wind);","float Omega = 0.84;","float kp = G * pow2(Omega / l_wind);","float c = omega(k) / k;","float cp = omega(kp) / kp;","float Lpm = exp(-1.25 * pow2(kp / k));","float gamma = 1.7;","float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));","float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));","float Jp = pow(gamma, Gamma);","float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));","float alphap = 0.006 * sqrt(Omega);","float Bl = 0.5 * alphap * cp / c * Fp;","float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);","float uStar = 0.41 * l_wind / log(10.0 / z0);","float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));","float Fm = exp(-0.25 * pow2(k / KM - 1.0));","float Bh = 0.5 * alpham * CM / c * Fm * Lpm;","float a0 = log(2.0) / 4.0;","float am = 0.13 * uStar / CM;","float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));","float cosPhi = dot(normalize(u_wind), normalize(K));","float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));","float dk = 2.0 * PI / u_size;","float h = sqrt(S / 2.0) * dk;","if (K.x == 0.0 && K.y == 0.0) {","h = 0.0;","}","gl_FragColor = vec4(h, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_phase={uniforms:{u_phases:{value:null},u_deltaTime:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform sampler2D u_phases;","uniform float u_deltaTime;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","float deltaTime = 1.0 / 60.0;","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","float deltaPhase = omega(length(waveVector)) * u_deltaTime;","phase = mod(phase + deltaPhase, 2.0 * PI);","gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_spectrum={uniforms:{u_size:{value:null},u_resolution:{value:null},u_choppiness:{value:null},u_phases:{value:null},u_initialSpectrum:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform float u_size;","uniform float u_resolution;","uniform float u_choppiness;","uniform sampler2D u_phases;","uniform sampler2D u_initialSpectrum;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","vec2 multiplyByI (vec2 z) {","return vec2(-z[1], z[0]);","}","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","vec2 phaseVector = vec2(cos(phase), sin(phase));","vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;","vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;","h0Star.y *= -1.0;","vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));","vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;","vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;","if (waveVector.x == 0.0 && waveVector.y == 0.0) {","h = vec2(0.0);","hX = vec2(0.0);","hZ = vec2(0.0);","}","gl_FragColor = vec4(hX + multiplyByI(h), hZ);","}"].join("\n")},a.ShaderLib.ocean_normals={uniforms:{u_displacementMap:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform float u_resolution;","uniform float u_size;","void main (void) {","float texel = 1.0 / u_resolution;","float texelSize = u_size / u_resolution;","vec3 center = texture2D(u_displacementMap, vUV).rgb;","vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;","vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;","vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;","vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;","vec3 topRight = cross(right, top);","vec3 topLeft = cross(top, left);","vec3 bottomLeft = cross(left, bottom);","vec3 bottomRight = cross(bottom, right);","gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);","}"].join("\n")},a.ShaderLib.ocean_main={uniforms:{u_displacementMap:{value:null},u_normalMap:{value:null},u_geometrySize:{value:null},u_size:{value:null},u_projectionMatrix:{value:null},u_viewMatrix:{value:null},u_cameraPosition:{value:null},u_skyColor:{value:null},u_oceanColor:{value:null},u_sunDirection:{value:null},u_exposure:{value:null}},vertexShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform mat4 u_projectionMatrix;","uniform mat4 u_viewMatrix;","uniform float u_size;","uniform float u_geometrySize;","uniform sampler2D u_displacementMap;","void main (void) {","vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);","vPos = newPos;","vUV = uv;","gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);","}"].join("\n"),fragmentShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform sampler2D u_normalMap;","uniform vec3 u_cameraPosition;","uniform vec3 u_oceanColor;","uniform vec3 u_skyColor;","uniform vec3 u_sunDirection;","uniform float u_exposure;","vec3 hdr (vec3 color, float exposure) {","return 1.0 - exp(-color * exposure);","}","void main (void) {","vec3 normal = texture2D(u_normalMap, vUV).rgb;","vec3 view = normalize(u_cameraPosition - vPos);","float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);","vec3 sky = fresnel * u_skyColor;","float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);","vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;","vec3 color = sky + water;","gl_FragColor = vec4(hdr(color, u_exposure), 1.0);","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","vUv = uv;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vViewPosition = -mvPosition.xyz;","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","vec2 parallaxMap( in vec3 V ) {","float initialHeight = texture2D( bumpMap, vUv ).r;","vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","return vUv - texCoordOffset;","}","#else","vec2 parallaxMap( in vec3 V ) {","float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","float layerHeight = 1.0 / numLayers;","float currentLayerHeight = 0.0;","vec2 dtex = parallaxScale * V.xy / V.z / numLayers;","vec2 currentTextureCoords = vUv;","float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","for ( int i = 0; i < 30; i += 1 ) {","if ( heightFromTexture <= currentLayerHeight ) {","break;","}","currentLayerHeight += layerHeight;","currentTextureCoords -= dtex;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","}","#ifdef USE_STEEP_PARALLAX","return currentTextureCoords;","#elif defined( USE_RELIEF_PARALLAX )","vec2 deltaTexCoord = dtex / 2.0;","float deltaHeight = layerHeight / 2.0;","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","const int numSearches = 5;","for ( int i = 0; i < numSearches; i += 1 ) {","deltaTexCoord /= 2.0;","deltaHeight /= 2.0;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","if( heightFromTexture > currentLayerHeight ) {","currentTextureCoords -= deltaTexCoord;","currentLayerHeight += deltaHeight;","} else {","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","}","}","return currentTextureCoords;","#elif defined( USE_OCLUSION_PARALLAX )","vec2 prevTCoords = currentTextureCoords + dtex;","float nextH = heightFromTexture - currentLayerHeight;","float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","float weight = nextH / ( nextH - prevH );","return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","#else","return vUv;","#endif","}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","vec2 texDx = dFdx( vUv );","vec2 texDy = dFdy( vUv );","vec3 vSigmaX = dFdx( surfPosition );","vec3 vSigmaY = dFdy( surfPosition );","vec3 vR1 = cross( vSigmaY, surfNormal );","vec3 vR2 = cross( surfNormal, vSigmaX );","float fDet = dot( vSigmaX, vR1 );","vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","vec3 vProjVtex;","vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","vProjVtex.z = dot( surfNormal, viewPosition );","return parallaxMap( vProjVtex );","}","void main() {","vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","gl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, vUv + offset);","vec4 cga = texture2D(tDiffuse, vUv);","vec4 cb = texture2D(tDiffuse, vUv - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","gl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","gl_FragColor = newTex;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{texture:{value:null},delta:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = rand( vUv );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{color:{type:"c",value:null},time:{type:"f",value:0},tDiffuse:{type:"t",value:null},tDudv:{type:"t",value:null},textureMatrix:{type:"m4",value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Volume=void 0;var a,n=r(10),i=(a=n)&&a.__esModule?a:{default:a};t.Volume=i.default}]))},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,a,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,a)}));case 4:return t.nextTick((function(){e.call(null,r,a,n)}));default:for(i=new Array(s-1),o=0;o>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return n>0&&(e.lastNeed=n-1),n;if(--a=0)return n>0&&(e.lastNeed=n-2),n;if(--a=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";(function(t){var a=r(118); +!function(e,t){for(var r in t)e[r]=t[r]}(exports,function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){e.exports=__webpack_require__(0)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1};Object.assign(a.prototype,{setSize:function(e,t){},render:function(e,t,r,a,n){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(1),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t){o.default.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof n.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=n.UniformsUtils.clone(e.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new n.Scene,this.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)}}),t.default=s},function(e,t,r){!function(e){"use strict";function t(){}function r(e,r){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===r||r,this.encoder=new t}function a(){}function n(){}t.prototype.s2u=function(e){for(var t=this.s2uTable,r="",a=0;a=0&&n<=126||n>=161&&n<=223)&&a0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},a.prototype={constructor:a,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],a=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=a}},n.prototype.parsePmd=function(e,t){var a,n={},i=new r(e);return n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left",function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),function(){var e,t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r0&&(a.englishModelName=i.getSjisStringsAsUnicode(20),a.englishComment=i.getSjisStringsAsUnicode(256)),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneNames=[];for(var t=0;t=2.0 are supported. Use LegacyGLTFLoader instead.")):(m.extensionsUsed&&(m.extensionsUsed.indexOf(r.KHR_LIGHTS)>=0&&(p[r.KHR_LIGHTS]=new i(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_UNLIT)>=0&&(p[r.KHR_MATERIALS_UNLIT]=new o(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(p[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new d),m.extensionsUsed.indexOf(r.KHR_DRACO_MESH_COMPRESSION)>=0&&(p[r.KHR_DRACO_MESH_COMPRESSION]=new f(this.dracoLoader)),m.extensionsUsed.indexOf(r.MSFT_TEXTURE_DDS)>=0&&(p[r.MSFT_TEXTURE_DDS]=new n)),new U(m,p,{path:t||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse((function(e,t,r,a,n){l({scene:e,scenes:t,cameras:r,animations:a,asset:n})}),u))}};var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(){if(!a.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=new a.DDSLoader}function i(e){this.name=r.KHR_LIGHTS,this.lights={};var t=(e.extensions&&e.extensions[r.KHR_LIGHTS]||{}).lights||{};for(var n in t){var i,o=t[n],s=(new a.Color).fromArray(o.color);switch(o.type){case"directional":(i=new a.DirectionalLight(s)).target.position.set(0,0,1),i.add(i.target);break;case"point":i=new a.PointLight(s);break;case"spot":i=new a.SpotLight(s),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;case"ambient":i=new a.AmbientLight(s)}i&&(i.decay=2,void 0!==o.intensity&&(i.intensity=o.intensity),i.name=o.name||"light_"+n,this.lights[n]=i)}}function o(e){this.name=r.KHR_MATERIALS_UNLIT}o.prototype.getMaterialType=function(e){return a.MeshBasicMaterial},o.prototype.extendParams=function(e,t,r){var n=[];e.color=new a.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var o=i.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture.index))}return Promise.all(n)};var s="glTF",l=12,u={JSON:1313821514,BIN:5130562};function c(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,l);if(this.header={magic:a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,l),i=0;i",s).replace("#include ",l).replace("#include ",u).replace("#include ",c).replace("#include ",f);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new a.Color).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=d,e.uniforms=o,e.defines={STANDARD:""},e.color=new a.Color(1,1,1),e.opacity=1;var h=[];if(Array.isArray(n.diffuseFactor)){var p=n.diffuseFactor;e.color.fromArray(p),e.opacity=p[3]}if(void 0!==n.diffuseTexture&&h.push(r.assignTexture(e,"map",n.diffuseTexture.index)),e.emissive=new a.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new a.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var m=n.specularGlossinessTexture.index;h.push(r.assignTexture(e,"glossinessMap",m)),h.push(r.assignTexture(e,"specularMap",m))}return Promise.all(h)},createMaterial:function(e){var t=new a.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var r=this.specularGlossinessParams,a=0,n=r.length;a=2&&(n[i+1]=e.getY(i)),r>=3&&(n[i+2]=e.getZ(i)),r>=4&&(n[i+3]=e.getW(i));return new a.BufferAttribute(n,r,e.normalized)}return e.clone()}function U(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new t,this.primitiveCache=[],this.textureLoader=new a.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function j(e,t,r){var a=t.attributes;for(var n in a){var i=T[n],o=r[a[n]];i&&(i in e.attributes||e.addAttribute(i,o))}void 0===t.indices||e.index||e.setIndex(r[t.indices])}return U.prototype.parse=function(e,t){var r=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then((function(t){var a=t.scenes||[],n=a[r.scene||0],i=t.animations||[],o=r.asset,s=t.cameras||[];e(n,a,s,i,o)})).catch(t)},U.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},i=0,o=t.length;i=2&&o.setY(T,A[E*l+1]),l>=3&&o.setZ(T,A[E*l+2]),l>=4&&o.setW(T,A[E*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},U.prototype.loadTexture=function(e){var t,n=this,i=this.json,o=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=i.textures[e],c=u.extensions||{},f=(t=c[r.MSFT_TEXTURE_DDS]?i.images[c[r.MSFT_TEXTURE_DDS].source]:i.images[u.source]).uri,d=!1;return void 0!==t.bufferView&&(f=n.getDependency("bufferView",t.bufferView).then((function(e){d=!0;var r=new Blob([e],{type:t.mimeType});return f=l.createObjectURL(r)}))),Promise.resolve(f).then((function(e){var t=a.Loader.Handlers.get(e);return t||(t=c[r.MSFT_TEXTURE_DDS]?n.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(r,a){t.load(R(e,o.path),r,void 0,a)}))})).then((function(e){!0===d&&l.revokeObjectURL(f),e.flipY=!1,void 0!==u.name&&(e.name=u.name),c[r.MSFT_TEXTURE_DDS]||(e.format=void 0!==u.format?E[u.format]:a.RGBAFormat),void 0!==u.internalFormat&&e.format!==E[u.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==u.type?S[u.type]:a.UnsignedByteType;var t=(i.samplers||{})[u.sampler]||{};return e.magFilter=_[t.magFilter]||a.LinearFilter,e.minFilter=_[t.minFilter]||a.LinearMipMapLinearFilter,e.wrapS=A[t.wrapS]||a.RepeatWrapping,e.wrapT=A[t.wrapT]||a.RepeatWrapping,e}))},U.prototype.assignTexture=function(e,t,r){return this.getDependency("texture",r).then((function(r){e[t]=r}))},U.prototype.loadMaterial=function(e){this.json;var t,n=this.extensions,i=this.json.materials[e],o={},s=i.extensions||{},l=[];if(s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(i),l.push(u.extendParams(o,i,this))}else if(s[r.KHR_MATERIALS_UNLIT]){var c=n[r.KHR_MATERIALS_UNLIT];t=c.getMaterialType(i),l.push(c.extendParams(o,i,this))}else{t=a.MeshStandardMaterial;var f=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(f.baseColorFactor)){var d=f.baseColorFactor;o.color.fromArray(d),o.opacity=d[3]}if(void 0!==f.baseColorTexture&&l.push(this.assignTexture(o,"map",f.baseColorTexture.index)),o.metalness=void 0!==f.metallicFactor?f.metallicFactor:1,o.roughness=void 0!==f.roughnessFactor?f.roughnessFactor:1,void 0!==f.metallicRoughnessTexture){var h=f.metallicRoughnessTexture.index;l.push(this.assignTexture(o,"metalnessMap",h)),l.push(this.assignTexture(o,"roughnessMap",h))}}!0===i.doubleSided&&(o.side=a.DoubleSide);var p=i.alphaMode||O;return p===C?o.transparent=!0:(o.transparent=!1,p===L&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"normalMap",i.normalTexture.index)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale&&o.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"aoMap",i.occlusionTexture.index)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==a.MeshBasicMaterial&&l.push(this.assignTexture(o,"emissiveMap",i.emissiveTexture.index)),Promise.all(l).then((function(){var e;return e=t===a.ShaderMaterial?n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==i.name&&(e.name=i.name),e.normalScale&&(e.normalScale.y=-e.normalScale.y),e.map&&(e.map.encoding=a.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=a.sRGBEncoding),i.extras&&(e.userData=i.extras),e}))},U.prototype.loadGeometries=function(e){var t=this,n=this.extensions,i=this.primitiveCache;return this.getDependencies("accessor").then((function(o){for(var s=[],l=0,u=e.length;l1))return _;_.name+="_"+c,s.add(_)}return s}))}))},U.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new a.PerspectiveCamera(a.Math.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new a.OrthographicCamera(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar)),void 0!==r.name&&(t.name=r.name),r.extras&&(t.userData=r.extras),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},U.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},U.prototype.loadAnimation=function(e){this.json;var t=this.json.animations[e];return this.getMultiDependencies(["accessor","node"]).then((function(r){for(var n=[],i=0,o=t.channels.length;i1&&(s.name+="_instance_"+i[o.mesh]++)}else if(void 0!==o.camera)s=e.cameras[o.camera];else if(o.extensions&&o.extensions[r.KHR_LIGHTS]&&void 0!==o.extensions[r.KHR_LIGHTS].light){s=t[r.KHR_LIGHTS].lights[o.extensions[r.KHR_LIGHTS].light]}else s=new a.Object3D;if(void 0!==o.name&&(s.name=a.PropertyBinding.sanitizeNodeName(o.name)),o.extras&&(s.userData=o.extras),void 0!==o.matrix){var d=new a.Matrix4;d.fromArray(o.matrix),s.applyMatrix(d)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return s}))},U.prototype.loadScene=function(){function e(t,r,n,i,o){var s=i[t],l=n.nodes[t];if(void 0!==l.skin)for(var u=!0===s.isGroup?s.children:[s],c=0,f=u.length;c(n=s.indexOf("\n"))&&i=e.byteLength||!(a=r(e)))return t(1,"no header found");if(!(n=a.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(u.valid|=1,u.programtype=n[1],u.string+=a+"\n";!1!==(a=r(e));)if(u.string+=a+"\n","#"!==a.charAt(0)){if((n=a.match(i))&&(u.gamma=parseFloat(n[1],10)),(n=a.match(o))&&(u.exposure=parseFloat(n[1],10)),(n=a.match(s))&&(u.valid|=2,u.format=n[1]),(n=a.match(l))&&(u.valid|=4,u.height=parseInt(n[1],10),u.width=parseInt(n[2],10)),2&u.valid&&4&u.valid)break}else u.comments+=a+"\n";return 2&u.valid?4&u.valid?u:t(3,"missing image size specifier"):t(3,"missing format specifier")}(n);if(-1!==i){var o=i.width,s=i.height,l=function(e,r,a){var n,i,o,s,l,u,c,f,d,h,p,m,v,g=r,y=a;if(g<8||g>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(g!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(n=new Uint8Array(4*r*a))||!n.length)return t(4,"unable to allocate buffer space");for(i=0,o=0,f=4*g,v=new Uint8Array(4),u=new Uint8Array(f);y>0&&oe.byteLength)return t(1);if(v[0]=e[o++],v[1]=e[o++],v[2]=e[o++],v[3]=e[o++],2!=v[0]||2!=v[1]||(v[2]<<8|v[3])!=g)return t(3,"bad rgbe scanline format");for(c=0;c128)&&(s-=128),0===s||c+s>f)return t(3,"bad scanline data");if(m)for(l=e[o++],d=0;d0){var x=[];for(var w in v)h=v[w],x[w]=h.name;m="Adding mesh(es) ("+x.length+": "+x+") from input mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)"}else m="Not adding mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)";var _=this.callbacks.onProgress;t.isValid(_)&&_(new CustomEvent("MeshBuilderEvent",{detail:{type:"progress",modelName:e.params.meshName,text:m,numericalValue:e.progress.numericalValue}}));return v},r.prototype.updateMaterials=function(e){var r,a,i=e.materials.materialCloneInstructions;if(t.isValid(i)){var o=i.materialNameOrg,s=this.materials[o];if(t.isValid(o)){r=s.clone(),a=i.materialName,r.name=a;var l=i.materialProperties;for(var u in l)r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&(r[u]=l[u]);this.materials[a]=r}else console.warn('Requested material "'+o+'" is not available!')}var c=e.materials.serializedMaterials;if(t.isValid(c)&&Object.keys(c).length>0){var f,d=new n.MaterialLoader;for(a in c)f=c[a],t.isValid(f)&&(r=d.parse(f),this.logging.enabled&&console.info('De-serialized material with name "'+a+'" will be added.'),this.materials[a]=r)}if(c=e.materials.runtimeMaterials,t.isValid(c)&&Object.keys(c).length>0)for(a in c)r=c[a],this.logging.enabled&&console.info('Material with name "'+a+'" will be added.'),this.materials[a]=r},r.prototype.getMaterialsJSON=function(){var e,t={};for(var r in this.materials)e=this.materials[r],t[r]=e.toJSON();return t},r.prototype.getMaterials=function(){return this.materials},r}(),s.WorkerRunnerRefImpl=function(){function e(){var e=this;self.addEventListener("message",(function(t){e.processMessage(t.data)}),!1)}return e.prototype.applyProperties=function(e,t){var r,a,n;for(r in t)a="set"+r.substring(0,1).toLocaleUpperCase()+r.substring(1),n=t[r],"function"==typeof e[a]?e[a](n):e.hasOwnProperty(r)&&(e[r]=n)},e.prototype.processMessage=function(e){if("run"===e.cmd){var t={callbackMeshBuilder:function(e){self.postMessage(e)},callbackProgress:function(t){e.logging.enabled&&e.logging.debug&&console.debug("WorkerRunner: progress: "+t)}},r=new Parser;"function"==typeof r.setLogging&&r.setLogging(e.logging.enabled,e.logging.debug),this.applyProperties(r,e.params),this.applyProperties(r,e.materials),this.applyProperties(r,t),r.workerScope=self,r.parse(e.data.input,e.data.options),e.logging.enabled&&console.log("WorkerRunner: Run complete!"),t.callbackMeshBuilder({cmd:"complete",msg:"WorkerRunner completed run."})}else console.error("WorkerRunner: Received unknown command: "+e.cmd)},e}(),s.WorkerSupport=function(){var e="2.2.0",t=s.Validator,r=function(){function e(){this._reset()}return e.prototype._reset=function(){this.logging={enabled:!0,debug:!1},this.worker=null,this.runnerImplName=null,this.callbacks={meshBuilder:null,onLoad:null},this.terminateRequested=!1,this.queuedMessage=null,this.started=!1,this.forceCopy=!1},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.setForceCopy=function(e){this.forceCopy=!0===e},e.prototype.initWorker=function(e,t){this.runnerImplName=t;var r=new Blob([e],{type:"application/javascript"});this.worker=new Worker(o.URL.createObjectURL(r)),this.worker.onmessage=this._receiveWorkerMessage,this.worker.runtimeRef=this,this._postMessage()},e.prototype._receiveWorkerMessage=function(e){var t=e.data;switch(t.cmd){case"meshData":case"materialData":case"imageData":this.runtimeRef.callbacks.meshBuilder(t);break;case"complete":this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run is complete. Terminating application on request!"),this.runtimeRef._terminate());break;case"error":console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Reported error: "+t.msg),this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run reported error. Terminating application on request!"),this.runtimeRef._terminate());break;default:console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Received unknown command: "+t.cmd)}},e.prototype.setCallbacks=function(e,r){this.callbacks.meshBuilder=t.verifyInput(e,this.callbacks.meshBuilder),this.callbacks.onLoad=t.verifyInput(r,this.callbacks.onLoad)},e.prototype.run=function(e){if(t.isValid(this.queuedMessage))console.warn("Already processing message. Rejecting new run instruction");else{if(this.queuedMessage=e,this.started=!0,!t.isValid(this.callbacks.meshBuilder))throw'Unable to run as no "MeshBuilder" callback is set.';if(!t.isValid(this.callbacks.onLoad))throw'Unable to run as no "onLoad" callback is set.';"run"!==e.cmd&&(e.cmd="run"),t.isValid(e.logging)?(e.logging.enabled=!0===e.logging.enabled,e.logging.debug=!0===e.logging.debug):e.logging={enabled:!0,debug:!1},this._postMessage()}},e.prototype._postMessage=function(){var e;t.isValid(this.queuedMessage)&&t.isValid(this.worker)&&(this.queuedMessage.data.input instanceof ArrayBuffer?(e=this.forceCopy?this.queuedMessage.data.input.slice(0):this.queuedMessage.data.input,this.worker.postMessage(this.queuedMessage,[e])):this.worker.postMessage(this.queuedMessage))},e.prototype.setTerminateRequested=function(e){this.terminateRequested=!0===e,this.terminateRequested&&t.isValid(this.worker)&&!t.isValid(this.queuedMessage)&&this.started&&(this.logging.enabled&&console.info("Worker is terminated immediately as it is not running!"),this._terminate())},e.prototype._terminate=function(){this.worker.terminate(),this._reset()},e}();function a(){if(console.info("Using THREE.LoaderSupport.WorkerSupport version: "+e),this.logging={enabled:!0,debug:!1},void 0===o.Worker)throw"This browser does not support web workers!";if(void 0===o.Blob)throw"This browser does not support Blob!";if("function"!=typeof o.URL.createObjectURL)throw"This browser does not support Object creation from URL!";this.loaderWorker=new r}a.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t,this.loaderWorker.setLogging(this.logging.enabled,this.logging.debug)},a.prototype.setForceWorkerDataCopy=function(e){this.loaderWorker.setForceCopy(e)},a.prototype.validate=function(e,r,a,o,u){if(!t.isValid(this.loaderWorker.worker)){this.logging.enabled&&(console.info("WorkerSupport: Building worker code..."),console.time("buildWebWorkerCode")),t.isValid(u)?this.logging.enabled&&console.info('WorkerSupport: Using "'+u.name+'" as Runner class for worker.'):(u=s.WorkerRunnerRefImpl,this.logging.enabled&&console.info('WorkerSupport: Using DEFAULT "THREE.LoaderSupport.WorkerRunnerRefImpl" as Runner class for worker.'));var c=e(i,l);c+="var Parser = "+r+";\n\n",c+=l(u.name,u),c+="new "+u.name+"();\n\n";var f=this;if(t.isValid(a)&&a.length>0){var d="";!function e(t,r){if(0===r.length)f.loaderWorker.initWorker(d+c,u.name),f.logging.enabled&&console.timeEnd("buildWebWorkerCode");else{var a=new n.FileLoader;a.setPath(t),a.setResponseType("text"),a.load(r[0],(function(a){d+=a,e(t,r)})),r.shift()}}(o,a)}else this.loaderWorker.initWorker(c,u.name),this.logging.enabled&&console.timeEnd("buildWebWorkerCode")}},a.prototype.setCallbacks=function(e,t){this.loaderWorker.setCallbacks(e,t)},a.prototype.run=function(e){this.loaderWorker.run(e)},a.prototype.setTerminateRequested=function(e){this.loaderWorker.setTerminateRequested(e)};var i=function(e,t){var r,a=e+" = {\n";for(var n in t)"string"==typeof(r=t[n])||r instanceof String?a+="\t"+n+': "'+(r=(r=r.replace("\n","\\n")).replace("\r","\\r"))+'",\n':r instanceof Array?a+="\t"+n+": ["+r+"],\n":Number.isInteger(r)?a+="\t"+n+": "+r+",\n":"function"==typeof r&&(a+="\t"+n+": "+r+",\n");return a+="}\n\n"},l=function(e,r,a,n,i){var o,s,l="",u=t.isValid(a)?a:r.name;for(var c in i=t.verifyInput(i,[]),r.prototype)o=r.prototype[c],"constructor"===c?s="\tfunction "+u+o.toString().replace("function","")+";\n\n":"function"==typeof o&&i.indexOf(c)<0&&(l+="\t"+u+".prototype."+c+" = "+o.toString()+";\n\n");l+="\treturn "+u+";\n",l+="})();\n\n";var f="";return t.isValid(n)&&(f+="\n",f+=u+".prototype = Object.create( "+n+".prototype );\n",f+=u+".constructor = "+u+";\n",f+="\n"),t.isValid(s)?l=e+" = (function () {\n\n"+f+s+l:(s=e+" = (function () {\n\n",l=(s+=f+"\t"+r.prototype.constructor.toString()+"\n\n")+l),l};return a}(),s.WorkerDirector=function(){var e="2.2.0",t=s.Validator,r=16,a=8192;function i(n){if(console.info("Using THREE.LoaderSupport.WorkerDirector version: "+e),this.logging={enabled:!0,debug:!1},this.maxQueueSize=a,this.maxWebWorkers=r,this.crossOrigin=null,!t.isValid(n))throw"Provided invalid classDef: "+n;this.workerDescription={classDef:n,globalCallbacks:{},workerSupports:{},forceWorkerDataCopy:!0},this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0,this.callbackOnFinishedProcessing=null}return i.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},i.prototype.getMaxQueueSize=function(){return this.maxQueueSize},i.prototype.getMaxWebWorkers=function(){return this.maxWebWorkers},i.prototype.setCrossOrigin=function(e){this.crossOrigin=e},i.prototype.setForceWorkerDataCopy=function(e){this.workerDescription.forceWorkerDataCopy=!0===e},i.prototype.prepareWorkers=function(e,i,o){t.isValid(e)&&(this.workerDescription.globalCallbacks=e),this.maxQueueSize=Math.min(i,a),this.maxWebWorkers=Math.min(o,r),this.maxWebWorkers=Math.min(this.maxWebWorkers,this.maxQueueSize),this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0;for(var s=0;s0&&this.instructionQueuePointer0},i.prototype.processQueue=function(){var e,t;for(var r in this.workerDescription.workerSupports)(t=this.workerDescription.workerSupports[r]).inUse||(this.instructionQueuePointer=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},i[c]=r;else if(r)if("ka"===u||"kd"===u||"ks"===u){var f=c.split(a,3);r[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else r[u]=c}}var d=new n.MaterialCreator(this.texturePath||this.path,this.materialOptions);return d.setCrossOrigin(this.crossOrigin),d.setManager(this.manager),d.setMaterials(i),d}},(n.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:a.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:a.RepeatWrapping}).prototype={constructor:n.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var r in e){var a=e[r],n={};for(var i in t[r]=n,a){var o=!0,s=a[i],l=i.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(n[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,r=this.materialsInfo[e],n={name:e,side:this.side};function i(e,r){if(!n[e]){var a,i,o=t.getTextureParams(r,n),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(i=o.url)||""===i?"":/^https?:\/\//i.test(i)?i:a+i));s.repeat.copy(o.scale),s.offset.copy(o.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,n[e]=s}}for(var o in r){var s,l=r[o];if(""!==l)switch(o.toLowerCase()){case"kd":n.color=(new a.Color).fromArray(l);break;case"ks":n.specular=(new a.Color).fromArray(l);break;case"map_kd":i("map",l);break;case"map_ks":i("specularMap",l);break;case"norm":i("normalMap",l);break;case"map_bump":case"bump":i("bumpMap",l);break;case"ns":n.shininess=parseFloat(l);break;case"d":(s=parseFloat(l))<1&&(n.opacity=s,n.transparent=!0);break;case"tr":s=parseFloat(l),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var r,n={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},i=e.split(/\s+/);return(r=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),(r=i.indexOf("-s"))>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),(r=i.indexOf("-o"))>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n},loadTexture:function(e,t,r,n,i){var o,s=a.Loader.Handlers.get(e),l=void 0!==this.manager?this.manager:a.DefaultLoadingManager;return null===s&&(s=new a.TextureLoader(l)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,r,n,i),void 0!==t&&(o.mapping=t),o}},t.default=n},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _three=__webpack_require__(0),THREE=_interopRequireWildcard(_three);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var Volume=function(e,t,r,a,n){if(arguments.length>0){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,a){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(n);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(n);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(n);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(n);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(n);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(n);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw"Error in THREE.Volume constructor : this type is not supported in JavaScript";case"Float32":case"float32":case"float":this.data=new Float32Array(n);break;case"Float64":case"float64":case"double":this.data=new Float64Array(n);break;default:this.data=new Uint8Array(n)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw"Error in THREE.Volume constructor, lengths are not matching arrayBuffer size"}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new THREE.Matrix3,this.matrix.identity();var i=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return i},set:function(e){i=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});var o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[]};Volume.prototype={constructor:Volume,getData:function(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]},access:function(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e},reverseAccess:function(e){var t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]},map:function(e,t){var r=this.data.length;t=t||this;for(var a=0;a.9})),jDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[1]))>.9})),kDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[2]))>.9})),argumentsWithInversion=["volume.xLength-1-","volume.yLength-1-","volume.zLength-1-"],argArray=[iDirection,jDirection,kDirection].map((function(e,t){return(e.dot(base[t])>0?"":argumentsWithInversion[t])+(e===axisInIJK?"IJKIndex":e.argVar)})),argString=argArray.join(",");return sliceAccess=eval("(function sliceAccess (i,j) {return volume.access( "+argString+");})"),{iLength:iLength,jLength:jLength,sliceAccess:sliceAccess,matrix:planeMatrix,planeWidth:planeWidth,planeHeight:planeHeight}},extractSlice:function(e,t){var r=new THREE.VolumeSlice(this,t,e);return this.sliceList.push(r),r},repaintAllSlices:function(){return this.sliceList.forEach((function(e){e.repaint()})),this},computeMinMax:function(){var e=1/0,t=-1/0,r=this.data.length,a=0;for(a=0;a","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","float l = linearToRelativeLuminance( texel.rgb );","gl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","uniform sampler2D luminanceMap;","#else","uniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","#ifdef ADAPTED_LUMINANCE","float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","#else","float fLumAvg = averageLuminance;","#endif","float fLumPixel = linearToRelativeLuminance( vColor );","float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","return fLumCompressed * vColor;","}","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-e*e/(2*t*t))}var r,a,n,i,o=2*Math.ceil(3*e)+1;for(o>25&&(o=25),i=.5*(o-1),a=new Array(o),n=0,r=0;r","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","vec2 aspectcorrect = vec2( 1.0, aspect );","float viewZ = getViewZ( getDepth( vUv ) );","float factor = ( focus + viewZ );","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},tSize:{value:new a.Vector2(256,256)},center:{value:new a.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float dx = rand( vUv + time );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","if(byp<1) {","vec2 p = vUv;","float xs = floor(gl_FragCoord.x / 0.5);","float ys = floor(gl_FragCoord.y / 0.5);","vec4 normal = texture2D (tDisp, p*seed*seed);","if(p.ydistortion_x-col_s*seed) {","if(seed_x>0.){","p.y = 1. - (p.y + distortion_y);","}","else {","p.y = distortion_y;","}","}","if(p.xdistortion_y-col_s*seed) {","if(seed_y>0.){","p.x=distortion_x;","}","else {","p.x = 1. - (p.x + distortion_x);","}","}","p.x+=normal.x*seed_x*(seed/5.);","p.y+=normal.y*seed_y*(seed/5.);","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, p + offset);","vec4 cga = texture2D(tDiffuse, p);","vec4 cb = texture2D(tDiffuse, p - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","gl_FragColor = gl_FragColor+ snow;","}","else {","gl_FragColor=texture2D (tDiffuse, vUv);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","vUV = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","return a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","return sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","float dist = hypot( coord.x - p.x, coord.y - p.y );","float rad = channel;","if ( shape == SHAPE_DOT ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","} else if ( shape == SHAPE_ELLIPSE ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","if ( dist != 0.0 ) {","float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","}","} else if ( shape == SHAPE_LINE ) {","rad = pow( abs( rad ), 1.5) * rad_max;","float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","dist = hypot( normal.x * dot_p, normal.y * dot_p );","} else if ( shape == SHAPE_SQUARE ) {","float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","float sin_t = abs( sin( theta ) );","float cos_t = abs( cos( theta ) );","rad = pow( abs( rad ), 1.4 );","rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","}","return rad - dist;","}","struct Cell {","vec2 normal;","vec2 p1;","vec2 p2;","vec2 p3;","vec2 p4;","float samp2;","float samp1;","float samp3;","float samp4;","};","vec4 getSample( vec2 point ) {","vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","float step = PI2 / float( samples );","float dist = radius * 0.66;","for ( int i = 0; i < samples; ++i ) {","float r = base + step * float( i );","vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","}","tex /= float( samples ) + 1.0;","return tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","if ( channel == 0 ) {","c.samp1 = getSample( c.p1 ).r;","c.samp2 = getSample( c.p2 ).r;","c.samp3 = getSample( c.p3 ).r;","c.samp4 = getSample( c.p4 ).r;","} else if (channel == 1) {","c.samp1 = getSample( c.p1 ).g;","c.samp2 = getSample( c.p2 ).g;","c.samp3 = getSample( c.p3 ).g;","c.samp4 = getSample( c.p4 ).g;","} else {","c.samp1 = getSample( c.p1 ).b;","c.samp3 = getSample( c.p3 ).b;","c.samp2 = getSample( c.p2 ).b;","c.samp4 = getSample( c.p4 ).b;","}","dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","res = clamp( res, 0.0, 1.0 );","return res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","Cell c;","vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","float threshold = step * 0.5;","float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","float offset_normal = mod( hypot( offset.x, offset.y ), step );","float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","c.normal = n;","c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","if ( scatter != 0.0 ) {","float off_mag = scatter * threshold * 0.5;","float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","c.p1.x += cos( off_angle ) * off_mag;","c.p1.y += sin( off_angle ) * off_mag;","}","float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","c.p2.x = c.p1.x - n.x * normal_step;","c.p2.y = c.p1.y - n.y * normal_step;","c.p3.x = c.p1.x + n.y * line_step;","c.p3.y = c.p1.y - n.x * line_step;","c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","return c;","}","float blendColour( float a, float b, float t ) {","if ( blendingMode == BLENDING_LINEAR ) {","return blend( a, b, 1.0 - t );","} else if ( blendingMode == BLENDING_ADD ) {","return blend( a, min( 1.0, a + b ), t );","} else if ( blendingMode == BLENDING_MULTIPLY ) {","return blend( a, max( 0.0, a * b ), t );","} else if ( blendingMode == BLENDING_LIGHTER ) {","return blend( a, max( a, b ), t );","} else if ( blendingMode == BLENDING_DARKER ) {","return blend( a, min( a, b ), t );","} else {","return blend( a, b, 1.0 - t );","}","}","void main() {","if ( ! disable ) {","vec2 p = vec2( vUV.x * width, vUV.y * height );","vec2 origin = vec2( 0, 0 );","float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","Cell cell_r = getReferenceCell( p, origin, rotateR, radius );","Cell cell_g = getReferenceCell( p, origin, rotateG, radius );","Cell cell_b = getReferenceCell( p, origin, rotateB, radius );","float r = getDotColour( cell_r, p, 0, rotateR, aa );","float g = getDotColour( cell_g, p, 1, rotateG, aa );","float b = getDotColour( cell_b, p, 2, rotateB, aa );","vec4 colour = texture2D( tDiffuse, vUV );","r = blendColour( r, colour.r, blending );","g = blendColour( g, colour.g, blending );","b = blendColour( b, colour.b, blending );","if ( greyscale ) {","r = g = b = (r + b + g) / 3.0;","}","gl_FragColor = vec4( r, g, b, 1.0 );","} else {","gl_FragColor = texture2D( tDiffuse, vUV );","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{type:"t",value:null},tDiffuse:{type:"t",value:null},tNormal:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},cameraProjectionMatrix:{type:"m4",value:new a.Matrix4},cameraInverseProjectionMatrix:{type:"m4",value:new a.Matrix4},scale:{type:"f",value:1},intensity:{type:"f",value:.1},bias:{type:"f",value:.5},minResolution:{type:"f",value:0},kernelRadius:{type:"f",value:100},randomSeed:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},sampleUvOffsets:{type:"v2v",value:[new a.Vector2(0,0)]},sampleWeights:{type:"1fv",value:[1]},tDepth:{type:"t",value:null},cameraNear:{type:"f",value:10},cameraFar:{type:"f",value:1e3},depthCutoff:{type:"f",value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","float depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={createSampleWeights:function(e,t){for(var r=function(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)},a=[],n=0;n<=e;n++)a.push(r(n,t));return a},createSampleOffsets:function(e,t){for(var r=[],a=0;a<=e;a++)r.push(t.clone().multiplyScalar(a));return r},configure:function(e,t,r,n){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=a.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=a.createSampleWeights(t,r),e.needsUpdate=!0}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","t = abs( C - Ctop );","delta.y = max( max( t.r, t.g ), t.b );","vec2 edges = step( threshold, delta.xy );","if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){n.default.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==o?o:0,void 0===i.default&&console.error("THREE.SSAARenderPass relies on THREE.CopyShader");var s=i.default;this.copyUniforms=a.UniformsUtils.clone(s.uniforms),this.copyMaterial=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.camera2=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene2=new a.Scene,this.quad2=new a.Mesh(new a.PlaneBufferGeometry(2,2),this.copyMaterial),this.quad2.frustumCulled=!1,this.scene2.add(this.quad2)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var n=s.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1;var o=e.getClearColor().getHex(),l=e.getClearAlpha(),u=1/n.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;for(var c=r.width,f=r.height,d=0;d","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );","float gg = fract( coord.t * ( size.y / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float readDepth( const in vec2 coord ) {","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","#ifdef USE_LOGDEPTHBUF","float logz = unpackRGBAToDepth( texture2D( tDepth, coord ) );","float w = pow(2.0, (logz / logDepthBufFC)) - 1.0;","float z = (logz / w) + 1.0;","#else","float z = unpackRGBAToDepth( texture2D( tDepth, coord ) );","#endif","return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 8.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + radius * vv;","vec2 coord2 = vUv - radius * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float ao = 0.0;","float dz = 1.0 / float( samples );","float l = 0.0;","float z = 1.0 - dz / 2.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","float pw = cos( l ) * r;","float ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{type:"t",value:null},luminosityThreshold:{type:"f",value:1},smoothWidth:{type:"f",value:1},defaultColor:{type:"c",value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(0)},defaultOpacity:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","gl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var n=r(40);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}));var i=r(48);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}));var o=r(90);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}));var s=r(112);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})}));var l=r(144);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VRControls=t.TransformControls=t.TrackballControls=t.PointerLockControls=t.OrthographicTrackballControls=t.OrbitControls=t.FlyControls=t.FirstPersonControls=t.EditorControls=t.DragControls=t.DeviceOrientationControls=void 0;var a=p(r(29)),n=p(r(30)),i=p(r(31)),o=p(r(32)),s=p(r(33)),l=p(r(34)),u=p(r(35)),c=p(r(36)),f=p(r(37)),d=p(r(38)),h=p(r(39));function p(e){return e&&e.__esModule?e:{default:e}}t.DeviceOrientationControls=a.default,t.DragControls=n.default,t.EditorControls=i.default,t.FirstPersonControls=o.default,t.FlyControls=s.default,t.OrbitControls=l.default,t.OrthographicTrackballControls=u.default,t.PointerLockControls=c.default,t.TrackballControls=f.default,t.TransformControls=d.default,t.VRControls=h.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r,n,i,o,s=function(e){t.deviceOrientation=e},l=function(){t.screenOrientation=window.orientation||0},u=(r=new a.Vector3(0,0,1),n=new a.Euler,i=new a.Quaternion,o=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),function(e,t,a,s,l){n.set(a,t,-s,"YXZ"),e.setFromEuler(n),e.multiply(o),e.multiply(i.setFromAxisAngle(r,-l))});this.connect=function(){l(),window.addEventListener("orientationchange",l,!1),window.addEventListener("deviceorientation",s,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",l,!1),window.removeEventListener("deviceorientation",s,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var r=e.alpha?a.Math.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?a.Math.degToRad(e.beta):0,i=e.gamma?a.Math.degToRad(e.gamma):0,o=t.screenOrientation?a.Math.degToRad(t.screenOrientation):0;u(t.object.quaternion,r,n,i,o)}}},this.dispose=function(){t.disconnect()},this.connect()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t,r){if(e instanceof a.Camera){console.warn("THREE.DragControls: Constructor now expects ( objects, camera, domElement )");var n=e;e=t,t=n}var i=new a.Plane,o=new a.Raycaster,s=new a.Vector2,l=new a.Vector3,u=new a.Vector3,c=null,f=null,d=this;function h(){r.addEventListener("mousemove",m,!1),r.addEventListener("mousedown",v,!1),r.addEventListener("mouseup",g,!1),r.addEventListener("mouseleave",g,!1),r.addEventListener("touchmove",y,!1),r.addEventListener("touchstart",b,!1),r.addEventListener("touchend",w,!1)}function p(){r.removeEventListener("mousemove",m,!1),r.removeEventListener("mousedown",v,!1),r.removeEventListener("mouseup",g,!1),r.removeEventListener("mouseleave",g,!1),r.removeEventListener("touchmove",y,!1),r.removeEventListener("touchstart",b,!1),r.removeEventListener("touchend",w,!1)}function m(a){a.preventDefault();var n=r.getBoundingClientRect();if(s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c});o.setFromCamera(s,t);var h=o.intersectObjects(e);if(h.length>0){var p=h[0].object;i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),p.position),f!==p&&(d.dispatchEvent({type:"hoveron",object:p}),r.style.cursor="pointer",f=p)}else null!==f&&(d.dispatchEvent({type:"hoveroff",object:f}),r.style.cursor="auto",f=null)}function v(a){a.preventDefault(),o.setFromCamera(s,t);var n=o.intersectObjects(e);n.length>0&&(c=n[0].object,o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function g(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}function y(e){e.preventDefault(),e=e.changedTouches[0];var a=r.getBoundingClientRect();if(s.x=(e.clientX-a.left)/a.width*2-1,s.y=-(e.clientY-a.top)/a.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c})}function b(a){a.preventDefault(),a=a.changedTouches[0];var n=r.getBoundingClientRect();s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t);var f=o.intersectObjects(e);f.length>0&&(c=f[0].object,i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),c.position),o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function w(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}h(),this.enabled=!0,this.activate=h,this.deactivate=p,this.dispose=function(){p()},this.setObjects=function(){console.error("THREE.DragControls: setObjects() has been removed.")},this.on=function(e,t){console.warn("THREE.DragControls: on() has been deprecated. Use addEventListener() instead."),d.addEventListener(e,t)},this.off=function(e,t){console.warn("THREE.DragControls: off() has been deprecated. Use removeEventListener() instead."),d.removeEventListener(e,t)},this.notify=function(e){console.error("THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead."),d.dispatchEvent({type:e})}};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){t=void 0!==t?t:document,this.enabled=!0,this.center=new a.Vector3,this.panSpeed=.001,this.zoomSpeed=.001,this.rotationSpeed=.005;var r=this,n=new a.Vector3,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2},o=i.NONE,s=this.center,l=new a.Matrix3,u=new a.Vector2,c=new a.Vector2,f=new a.Spherical,d={type:"change"};function h(e){!1!==r.enabled&&(0===e.button?o=i.ROTATE:1===e.button?o=i.ZOOM:2===e.button&&(o=i.PAN),c.set(e.clientX,e.clientY),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",m,!1),t.addEventListener("mouseout",m,!1),t.addEventListener("dblclick",m,!1))}function p(e){if(!1!==r.enabled){u.set(e.clientX,e.clientY);var t=u.x-c.x,n=u.y-c.y;o===i.ROTATE?r.rotate(new a.Vector3(-t*r.rotationSpeed,-n*r.rotationSpeed,0)):o===i.ZOOM?r.zoom(new a.Vector3(0,0,n)):o===i.PAN&&r.pan(new a.Vector3(-t,n,0)),c.set(e.clientX,e.clientY)}}function m(e){t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),o=i.NONE}function v(e){e.preventDefault(),r.zoom(new a.Vector3(0,0,e.deltaY))}function g(e){e.preventDefault()}this.focus=function(t){var n,i=(new a.Box3).setFromObject(t);!1===i.isEmpty()?(s.copy(i.getCenter()),n=i.getBoundingSphere().radius):(s.setFromMatrixPosition(t.matrixWorld),n=.1);var o=new a.Vector3(0,0,1);o.applyQuaternion(e.quaternion),o.multiplyScalar(4*n),e.position.copy(s).add(o),r.dispatchEvent(d)},this.pan=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.panSpeed),t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),s.add(t),r.dispatchEvent(d)},this.zoom=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.zoomSpeed),t.length()>a||(t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),r.dispatchEvent(d))},this.rotate=function(t){n.copy(e.position).sub(s),f.setFromVector3(n),f.theta+=t.x,f.phi+=t.y,f.makeSafe(),n.setFromSpherical(f),e.position.copy(s).add(n),e.lookAt(s),r.dispatchEvent(d)},this.dispose=function(){t.removeEventListener("contextmenu",g,!1),t.removeEventListener("mousedown",h,!1),t.removeEventListener("wheel",v,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),t.removeEventListener("touchstart",x,!1),t.removeEventListener("touchmove",_,!1)},t.addEventListener("contextmenu",g,!1),t.addEventListener("mousedown",h,!1),t.addEventListener("wheel",v,!1);var y=[new a.Vector3,new a.Vector3,new a.Vector3],b=[new a.Vector3,new a.Vector3,new a.Vector3],w=null;function x(e){if(!1!==r.enabled){switch(e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0);break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0),w=y[0].distanceTo(y[1])}b[0].copy(y[0]),b[1].copy(y[1])}}function _(e){if(!1!==r.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0),r.rotate(y[0].sub(o(y[0],b)).multiplyScalar(-r.rotationSpeed));break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0);var t=y[0].distanceTo(y[1]);r.zoom(new a.Vector3(0,0,w-t)),w=t;var n=y[0].clone().sub(o(y[0],b)),i=y[1].clone().sub(o(y[1],b));n.x=-n.x,i.x=-i.x,r.pan(n.add(i).multiplyScalar(.5))}b[0].copy(y[0]),b[1].copy(y[1])}function o(e,t){var r=t[0];for(var a in t)r.distanceTo(e)>t[a].distanceTo(e)&&(r=t[a]);return r}}t.addEventListener("touchstart",x,!1),t.addEventListener("touchmove",_,!1)};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e){e.preventDefault()}this.object=e,this.target=new a.Vector3(0,0,0),this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.lookSpeed=.005,this.lookVertical=!0,this.autoForward=!1,this.activeLook=!0,this.heightSpeed=!1,this.heightCoef=1,this.heightMin=0,this.heightMax=1,this.constrainVertical=!1,this.verticalMin=0,this.verticalMax=Math.PI,this.autoSpeedFactor=0,this.mouseX=0,this.mouseY=0,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.moveForward=!1,this.moveBackward=!1,this.moveLeft=!1,this.moveRight=!1,this.mouseDragOn=!1,this.viewHalfX=0,this.viewHalfY=0,this.domElement!==document&&this.domElement.setAttribute("tabindex",-1),this.handleResize=function(){this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)},this.onMouseDown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0},this.onMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1},this.onMouseMove=function(e){this.domElement===document?(this.mouseX=e.pageX-this.viewHalfX,this.mouseY=e.pageY-this.viewHalfY):(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)},this.onKeyDown=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0}},this.onKeyUp=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}},this.update=function(e){if(!1!==this.enabled){if(this.heightSpeed){var t=a.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;var r=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(r+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(r),this.moveLeft&&this.object.translateX(-r),this.moveRight&&this.object.translateX(r),this.moveUp&&this.object.translateY(r),this.moveDown&&this.object.translateY(-r);var n=e*this.lookSpeed;this.activeLook||(n=0);var i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon+=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*i),this.lat=Math.max(-85,Math.min(85,this.lat)),this.phi=a.Math.degToRad(90-this.lat),this.theta=a.Math.degToRad(this.lon),this.constrainVertical&&(this.phi=a.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax));var o=this.target,s=this.object.position;o.x=s.x+100*Math.sin(this.phi)*Math.cos(this.theta),o.y=s.y+100*Math.cos(this.phi),o.z=s.z+100*Math.sin(this.phi)*Math.sin(this.theta),this.object.lookAt(o)}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",r,!1),this.domElement.removeEventListener("mousedown",i,!1),this.domElement.removeEventListener("mousemove",n,!1),this.domElement.removeEventListener("mouseup",o,!1),window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",l,!1)};var n=u(this,this.onMouseMove),i=u(this,this.onMouseDown),o=u(this,this.onMouseUp),s=u(this,this.onKeyDown),l=u(this,this.onKeyUp);function u(e,t){return function(){t.apply(e,arguments)}}this.domElement.addEventListener("contextmenu",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mouseup",o,!1),window.addEventListener("keydown",s,!1),window.addEventListener("keyup",l,!1),this.handleResize()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e,t){return function(){t.apply(e,arguments)}}function n(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this.tmpQuaternion=new a.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new a.Vector3(0,0,0),this.rotationVector=new a.Vector3(0,0,0),this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)},this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),r=t.size[0]/2,a=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-a)/a,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){var t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order)},this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",n,!1),this.domElement.removeEventListener("mousedown",o,!1),this.domElement.removeEventListener("mousemove",i,!1),this.domElement.removeEventListener("mouseup",s,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",u,!1)};var i=r(this,this.mousemove),o=r(this,this.mousedown),s=r(this,this.mouseup),l=r(this,this.keydown),u=r(this,this.keyup);this.domElement.addEventListener("contextmenu",n,!1),this.domElement.addEventListener("mousemove",i,!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mouseup",s,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",u,!1),this.updateMovementVector(),this.updateRotationVector()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),h=d.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&h===d.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),y.set(0,0,0)),g=1,!!(b||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,R=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),k=function(){var e=new a.Vector3;return function(t,r){!0===l.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var a=l.domElement===document?l.domElement.body:l.domElement;if(l.object.isPerspectiveCamera){var n=l.object.position;e.copy(n).sub(l.target);var i=e.length();i*=Math.tan(l.object.fov/2*Math.PI/180),R(2*t*i/a.clientHeight,l.object.matrix),k(2*r*i/a.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(R(t*(l.object.right-l.object.left)/l.object.zoom/a.clientWidth,l.object.matrix),k(r*(l.object.top-l.object.bottom)/l.object.zoom/a.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object.isPerspectiveCamera?g/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object.isPerspectiveCamera?g*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(c),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);A.set(n,i)}}(e),h=d.TOUCH_DOLLY_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;if(h!==d.TOUCH_DOLLY_PAN)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.set(0,Math.pow(T.y/M.y,l.zoomSpeed)),N(P.y),M.copy(T)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);E.set(n,i),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E)}l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.radius=0,this.rotateSpeed=1,this.zoomSpeed=1.2,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.keys=[65,83,68],this.target=new a.Vector3;var i=!0,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector3,c=new a.Vector3,f=new a.Vector2,d=new a.Vector2,h=0,p=0,m=new a.Vector2,v=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom;var g={type:"change"},y={type:"start"},b={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}this.radius=.5*Math.min(this.screen.width,this.screen.height),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var w,x,_,A,E,S,M=(w=new a.Vector2,function(e,t){return w.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),w}),T=function(){var e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(a,i){n.set((a-.5*r.screen.width-r.screen.left)/r.radius,(.5*r.screen.height+r.screen.top-i)/r.radius,0);var o=n.length();return r.noRoll?o1?n.normalize():n.z=Math.sqrt(1-o*o),l.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(n.y),e.add(t.copy(r.object.up).cross(l).setLength(n.x)),e.add(l.setLength(n.z)),e}}();function P(e){!1!==r.enabled&&(window.removeEventListener("keydown",P),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function F(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",P,!1))}function O(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(m.copy(M(e.pageX,e.pageY)),v.copy(m)):(f.copy(M(e.pageX,e.pageY)),d.copy(f)):(u.copy(T(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",L,!1),document.addEventListener("mouseup",C,!1),r.dispatchEvent(y))}function L(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||v.copy(M(e.pageX,e.pageY)):d.copy(M(e.pageX,e.pageY)):c.copy(T(e.pageX,e.pageY)))}function C(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",C),r.dispatchEvent(b))}function R(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),f.y+=.01*e.deltaY,r.dispatchEvent(y),r.dispatchEvent(b))}function k(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,u.copy(T(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;case 2:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=h=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(M(i,s)),v.copy(m);break;default:o=n.NONE}r.dispatchEvent(y)}}function I(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(i,s));break;default:o=n.NONE}}function N(e){if(!1!==r.enabled){switch(e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;case 2:h=p=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,a=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(t,a)),m.copy(v)}o=n.NONE,r.dispatchEvent(b)}}function D(e){e.preventDefault()}this.rotateCamera=(x=new a.Vector3,_=new a.Quaternion,function(){var e=Math.acos(u.dot(c)/u.length()/c.length());e&&(x.crossVectors(u,c).normalize(),e*=r.rotateSpeed,_.setFromAxisAngle(x,-e),l.applyQuaternion(_),r.object.up.applyQuaternion(_),c.applyQuaternion(_),r.staticMoving?u.copy(c):(_.setFromAxisAngle(x,e*(r.dynamicDampingFactor-1)),u.applyQuaternion(_)),i=!0)}),this.zoomCamera=function(){if(o===n.TOUCH_ZOOM_PAN){var e=p/h;h=p,r.object.zoom*=e,i=!0}else{e=1+(d.y-f.y)*r.zoomSpeed;Math.abs(e-1)>1e-6&&e>0&&(r.object.zoom/=e,r.staticMoving?f.copy(d):f.y+=(d.y-f.y)*this.dynamicDampingFactor,i=!0)}},this.panCamera=(A=new a.Vector2,E=new a.Vector3,S=new a.Vector3,function(){if(A.copy(v).sub(m),A.lengthSq()){var e=(r.object.right-r.object.left)/r.object.zoom,t=(r.object.top-r.object.bottom)/r.object.zoom;A.x*=e,A.y*=t,S.copy(l).cross(r.object.up).setLength(A.x),S.add(E.copy(r.object.up).setLength(A.y)),r.object.position.add(S),r.target.add(S),r.staticMoving?m.copy(v):m.add(A.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)),i=!0}}),this.update=function(){l.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||(r.zoomCamera(),i&&r.object.updateProjectionMatrix()),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,l),r.object.lookAt(r.target),i&&(r.dispatchEvent(g),i=!1)},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.left=r.left0,r.object.right=r.right0,r.object.top=r.top0,r.object.bottom=r.bottom0,r.object.lookAt(r.target),r.dispatchEvent(g),i=!1},this.dispose=function(){this.domElement.removeEventListener("contextmenu",D,!1),this.domElement.removeEventListener("mousedown",O,!1),this.domElement.removeEventListener("wheel",R,!1),this.domElement.removeEventListener("touchstart",k,!1),this.domElement.removeEventListener("touchend",N,!1),this.domElement.removeEventListener("touchmove",I,!1),document.removeEventListener("mousemove",L,!1),document.removeEventListener("mouseup",C,!1),window.removeEventListener("keydown",P,!1),window.removeEventListener("keyup",F,!1)},this.domElement.addEventListener("contextmenu",D,!1),this.domElement.addEventListener("mousedown",O,!1),this.domElement.addEventListener("wheel",R,!1),this.domElement.addEventListener("touchstart",k,!1),this.domElement.addEventListener("touchend",N,!1),this.domElement.addEventListener("touchmove",I,!1),window.addEventListener("keydown",P,!1),window.addEventListener("keyup",F,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;e.rotation.set(0,0,0);var r=new a.Object3D;r.add(e);var n=new a.Object3D;n.position.y=10,n.add(r);var i,o,s=Math.PI/2,l=function(e){if(!1!==t.enabled){var a=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;n.rotation.y-=.002*a,r.rotation.x-=.002*i,r.rotation.x=Math.max(-s,Math.min(s,r.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",l,!1)},document.addEventListener("mousemove",l,!1),this.enabled=!1,this.getObject=function(){return n},this.getDirection=(i=new a.Vector3(0,0,-1),o=new a.Euler(0,0,0,"YXZ"),function(e){return o.set(r.rotation.x,n.rotation.y,0),e.copy(i).applyEuler(o),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new a.Vector3;var i=new a.Vector3,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector2,c=new a.Vector2,f=new a.Vector3,d=0,h=new a.Vector2,p=new a.Vector2,m=0,v=0,g=new a.Vector2,y=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var b={type:"change"},w={type:"start"},x={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var _,A,E,S,M,T,P,F,O,L,C,R=(_=new a.Vector2,function(e,t){return _.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),_}),k=function(){var e=new a.Vector2;return function(t,a){return e.set((t-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-a))/r.screen.width),e}}();function I(e){!1!==r.enabled&&(window.removeEventListener("keydown",I),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function N(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",I,!1))}function D(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(g.copy(R(e.pageX,e.pageY)),y.copy(g)):(h.copy(R(e.pageX,e.pageY)),p.copy(h)):(c.copy(k(e.pageX,e.pageY)),u.copy(c)),document.addEventListener("mousemove",U,!1),document.addEventListener("mouseup",j,!1),r.dispatchEvent(w))}function U(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||y.copy(R(e.pageX,e.pageY)):p.copy(R(e.pageX,e.pageY)):(u.copy(c),c.copy(k(e.pageX,e.pageY))))}function j(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",j),r.dispatchEvent(x))}function B(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:h.y-=.025*e.deltaY;break;case 1:h.y-=.01*e.deltaY;break;default:h.y-=25e-5*e.deltaY}r.dispatchEvent(w),r.dispatchEvent(x)}}function V(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,c.copy(k(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;default:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=m=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;g.copy(R(i,s)),y.copy(g)}r.dispatchEvent(w)}}function z(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:u.copy(c),c.copy(k(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=Math.sqrt(t*t+a*a);var n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;y.copy(R(n,i))}}function G(e){if(!1!==r.enabled){switch(e.touches.length){case 0:o=n.NONE;break;case 1:o=n.TOUCH_ROTATE,c.copy(k(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c)}r.dispatchEvent(x)}}function H(e){!1!==r.enabled&&e.preventDefault()}this.rotateCamera=(E=new a.Vector3,S=new a.Quaternion,M=new a.Vector3,T=new a.Vector3,P=new a.Vector3,F=new a.Vector3,function(){F.set(c.x-u.x,c.y-u.y,0),(A=F.length())?(l.copy(r.object.position).sub(r.target),M.copy(l).normalize(),T.copy(r.object.up).normalize(),P.crossVectors(T,M).normalize(),T.setLength(c.y-u.y),P.setLength(c.x-u.x),F.copy(T.add(P)),E.crossVectors(F,l).normalize(),A*=r.rotateSpeed,S.setFromAxisAngle(E,A),l.applyQuaternion(S),r.object.up.applyQuaternion(S),f.copy(E),d=A):!r.staticMoving&&d&&(d*=Math.sqrt(1-r.dynamicDampingFactor),l.copy(r.object.position).sub(r.target),S.setFromAxisAngle(f,d),l.applyQuaternion(S),r.object.up.applyQuaternion(S)),u.copy(c)}),this.zoomCamera=function(){var e;o===n.TOUCH_ZOOM_PAN?(e=m/v,m=v,l.multiplyScalar(e)):(1!==(e=1+(p.y-h.y)*r.zoomSpeed)&&e>0&&l.multiplyScalar(e),r.staticMoving?h.copy(p):h.y+=(p.y-h.y)*this.dynamicDampingFactor)},this.panCamera=(O=new a.Vector2,L=new a.Vector3,C=new a.Vector3,function(){O.copy(y).sub(g),O.lengthSq()&&(O.multiplyScalar(l.length()*r.panSpeed),C.copy(l).cross(r.object.up).setLength(O.x),C.add(L.copy(r.object.up).setLength(O.y)),r.object.position.add(C),r.target.add(C),r.staticMoving?g.copy(y):g.add(O.subVectors(y,g).multiplyScalar(r.dynamicDampingFactor)))}),this.checkDistances=function(){r.noZoom&&r.noPan||(l.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,l.setLength(r.maxDistance)),h.copy(p)),l.lengthSq()1e-6&&(r.dispatchEvent(b),i.copy(r.object.position))},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(b),i.copy(r.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",H,!1),this.domElement.removeEventListener("mousedown",D,!1),this.domElement.removeEventListener("wheel",B,!1),this.domElement.removeEventListener("touchstart",V,!1),this.domElement.removeEventListener("touchend",G,!1),this.domElement.removeEventListener("touchmove",z,!1),document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",I,!1),window.removeEventListener("keyup",N,!1)},this.domElement.addEventListener("contextmenu",H,!1),this.domElement.addEventListener("mousedown",D,!1),this.domElement.addEventListener("wheel",B,!1),this.domElement.addEventListener("touchstart",V,!1),this.domElement.addEventListener("touchend",G,!1),this.domElement.addEventListener("touchmove",z,!1),window.addEventListener("keydown",I,!1),window.addEventListener("keyup",N,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){var e=function(e){a.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.side=a.FrontSide,this.transparent=!0,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(e.prototype=Object.create(a.MeshBasicMaterial.prototype)).constructor=e;var t=function(e){a.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.transparent=!0,this.linewidth=1,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(t.prototype=Object.create(a.LineBasicMaterial.prototype)).constructor=t;var r=new e({visible:!1,transparent:!1}),n=function(){this.init=function(){a.Object3D.call(this),this.handles=new a.Object3D,this.pickers=new a.Object3D,this.planes=new a.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new a.PlaneBufferGeometry(50,50,2,2),t=new a.MeshBasicMaterial({visible:!1,side:a.DoubleSide}),r={XY:new a.Mesh(e,t),YZ:new a.Mesh(e,t),XZ:new a.Mesh(e,t),XYZE:new a.Mesh(e,t)};for(var n in this.activePlane=r.XYZE,r.YZ.rotation.set(0,Math.PI/2,0),r.XZ.rotation.set(-Math.PI/2,0,0),r)r[n].name=n,this.planes.add(r[n]),this.planes[n]=r[n];var i=function(e,t){for(var r in e)for(n=e[r].length;n--;){var a=e[r][n][0],i=e[r][n][1],o=e[r][n][2];a.name=r,a.renderOrder=1/0,i&&a.position.set(i[0],i[1],i[2]),o&&a.rotation.set(o[0],o[1],o[2]),t.add(a)}};i(this.handleGizmos,this.handles),i(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof a.Mesh){e.updateMatrix();var t=e.geometry.clone();t.applyMatrix(e.matrix),e.geometry=t,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))},this.highlight=function(e){this.traverse((function(t){t.material&&t.material.highlight&&(t.name===e?t.material.highlight(!0):t.material.highlight(!1))}))}};(n.prototype=Object.create(a.Object3D.prototype)).constructor=n,n.prototype.update=function(e,t){var r=new a.Vector3(0,0,0),n=new a.Vector3(0,1,0),i=new a.Matrix4;this.traverse((function(a){-1!==a.name.search("E")?a.quaternion.setFromRotationMatrix(i.lookAt(t,r,n)):-1===a.name.search("X")&&-1===a.name.search("Y")&&-1===a.name.search("Z")||a.quaternion.setFromEuler(e)}))};var i=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.CylinderGeometry(0,.05,.2,12,1,!1));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),new e({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),r)]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()};(i.prototype=Object.create(n.prototype)).constructor=i;var o=function(){n.call(this);var e=function(e,t,r){var n=new a.BufferGeometry,i=[];r=r||1;for(var o=0;o<=64*r;++o)"x"===t&&i.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&i.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&i.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return n.addAttribute("position",new a.Float32BufferAttribute(i,3)),n};this.handleGizmos={X:[[new a.Line(new e(1,"x",.5),new t({color:16711680}))]],Y:[[new a.Line(new e(1,"y",.5),new t({color:65280}))]],Z:[[new a.Line(new e(1,"z",.5),new t({color:255}))]],E:[[new a.Line(new e(1.25,"z",1),new t({color:13421568}))]],XYZE:[[new a.Line(new e(1,"z",1),new t({color:7895160}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusBufferGeometry(1.25,.12,2,24),r)]],XYZE:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,2,24),r)]]},this.pickerGizmos.XYZE[0][0].visible=!1,this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){n.prototype.update.apply(this,arguments);var r=new a.Matrix4,i=new a.Euler(0,0,1),o=new a.Quaternion,s=new a.Vector3(1,0,0),l=new a.Vector3(0,1,0),u=new a.Vector3(0,0,1),c=new a.Quaternion,f=new a.Quaternion,d=new a.Quaternion,h=t.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),r.makeRotationFromQuaternion(o).getInverse(r),h.applyMatrix4(r),this.traverse((function(e){o.setFromEuler(i),"X"===e.name&&(c.setFromAxisAngle(s,Math.atan2(-h.y,h.z)),o.multiplyQuaternions(o,c),e.quaternion.copy(o)),"Y"===e.name&&(f.setFromAxisAngle(l,Math.atan2(h.x,h.z)),o.multiplyQuaternions(o,f),e.quaternion.copy(o)),"Z"===e.name&&(d.setFromAxisAngle(u,Math.atan2(h.y,h.x)),o.multiplyQuaternions(o,d),e.quaternion.copy(o))}))},this.init()};(o.prototype=Object.create(n.prototype)).constructor=o;var s=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.BoxGeometry(.125,.125,.125));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.125,.125,.125),new e({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.4,.4,.4),r)]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()};(s.prototype=Object.create(n.prototype)).constructor=s;var l=function(e,t){a.Object3D.call(this),t=void 0!==t?t:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var r=this,n="translate",l=!1,u={translate:new i,rotate:new o,scale:new s};for(var c in u){var f=u[c];f.visible=c===n,this.add(f)}var d={type:"change"},h={type:"mouseDown"},p={type:"mouseUp",mode:n},m={type:"objectChange"},v=new a.Raycaster,g=new a.Vector2,y=new a.Vector3,b=new a.Vector3,w=new a.Vector3,x=new a.Vector3,_=1,A=new a.Matrix4,E=new a.Vector3,S=new a.Matrix4,M=new a.Vector3,T=new a.Quaternion,P=new a.Vector3(1,0,0),F=new a.Vector3(0,1,0),O=new a.Vector3(0,0,1),L=new a.Quaternion,C=new a.Quaternion,R=new a.Quaternion,k=new a.Quaternion,I=new a.Quaternion,N=new a.Vector3,D=new a.Vector3,U=new a.Matrix4,j=new a.Matrix4,B=new a.Vector3,V=new a.Vector3,z=new a.Euler,G=new a.Matrix4,H=new a.Vector3,X=new a.Euler;function Y(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,u[n].pickers.children),a=null;t&&(a=t.object.name,e.preventDefault()),r.axis!==a&&(r.axis=a,r.update(),r.dispatchEvent(d))}}function W(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=e.changedTouches?e.changedTouches[0]:e;if(0===t.button||void 0===t.button){var a=Z(t,u[n].pickers.children);if(a){e.preventDefault(),e.stopPropagation(),r.axis=a.object.name,r.dispatchEvent(h),r.update(),E.copy(H).sub(V).normalize(),u[n].setActivePlane(r.axis,E);var i=Z(t,[u[n].activePlane]);i&&(N.copy(r.object.position),D.copy(r.object.scale),U.extractRotation(r.object.matrix),G.extractRotation(r.object.matrixWorld),j.extractRotation(r.object.parent.matrixWorld),B.setFromMatrixScale(S.getInverse(r.object.parent.matrixWorld)),b.copy(i.point))}}l=!0}}function q(e){if(void 0!==r.object&&null!==r.axis&&!1!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,[u[n].activePlane]);!1!==t&&(e.preventDefault(),e.stopPropagation(),y.copy(t.point),"translate"===n?(y.sub(b),y.multiply(B),"local"===r.space&&(y.applyMatrix4(S.getInverse(G)),-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(U),r.object.position.copy(N),r.object.position.add(y)),"world"!==r.space&&-1===r.axis.search("XYZ")||(-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(S.getInverse(j)),r.object.position.copy(N),r.object.position.add(y)),null!==r.translationSnap&&("local"===r.space&&r.object.position.applyMatrix4(S.getInverse(G)),-1!==r.axis.search("X")&&(r.object.position.x=Math.round(r.object.position.x/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Y")&&(r.object.position.y=Math.round(r.object.position.y/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Z")&&(r.object.position.z=Math.round(r.object.position.z/r.translationSnap)*r.translationSnap),"local"===r.space&&r.object.position.applyMatrix4(G))):"scale"===n?(y.sub(b),y.multiply(B),"local"===r.space&&("XYZ"===r.axis?(_=1+y.y/Math.max(D.x,D.y,D.z),r.object.scale.x=D.x*_,r.object.scale.y=D.y*_,r.object.scale.z=D.z*_):(y.applyMatrix4(S.getInverse(G)),"X"===r.axis&&(r.object.scale.x=D.x*(1+y.x/D.x)),"Y"===r.axis&&(r.object.scale.y=D.y*(1+y.y/D.y)),"Z"===r.axis&&(r.object.scale.z=D.z*(1+y.z/D.z))))):"rotate"===n&&(y.sub(V),y.multiply(B),M.copy(b).sub(V),M.multiply(B),"E"===r.axis?(y.applyMatrix4(S.getInverse(A)),M.applyMatrix4(S.getInverse(A)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),I.setFromAxisAngle(E,w.z-x.z),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,I),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"XYZE"===r.axis?(I.setFromEuler(y.clone().cross(M).normalize()),T.setFromRotationMatrix(S.getInverse(j)),C.setFromAxisAngle(I,-y.clone().angleTo(M)),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,C),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"local"===r.space?(y.applyMatrix4(S.getInverse(G)),M.applyMatrix4(S.getInverse(G)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),L.setFromRotationMatrix(U),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),R.setFromAxisAngle(F,w.y-x.y),k.setFromAxisAngle(O,w.z-x.z)),"X"===r.axis&&L.multiplyQuaternions(L,C),"Y"===r.axis&&L.multiplyQuaternions(L,R),"Z"===r.axis&&L.multiplyQuaternions(L,k),r.object.quaternion.copy(L)):"world"===r.space&&(w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),R.setFromAxisAngle(F,w.y-x.y),k.setFromAxisAngle(O,w.z-x.z)),L.setFromRotationMatrix(G),"X"===r.axis&&T.multiplyQuaternions(T,C),"Y"===r.axis&&T.multiplyQuaternions(T,R),"Z"===r.axis&&T.multiplyQuaternions(T,k),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T))),r.update(),r.dispatchEvent(d),r.dispatchEvent(m))}}function Q(e){e.preventDefault(),void 0!==e.button&&0!==e.button||(l&&null!==r.axis&&(p.mode=n,r.dispatchEvent(p)),l=!1,"TouchEvent"in window&&e instanceof TouchEvent?(r.axis=null,r.update(),r.dispatchEvent(d)):Y(e))}function Z(r,a){var n=t.getBoundingClientRect(),i=(r.clientX-n.left)/n.width,o=(r.clientY-n.top)/n.height;g.set(2*i-1,-2*o+1),v.setFromCamera(g,e);var s=v.intersectObjects(a,!0);return!!s[0]&&s[0]}t.addEventListener("mousedown",W,!1),t.addEventListener("touchstart",W,!1),t.addEventListener("mousemove",Y,!1),t.addEventListener("touchmove",Y,!1),t.addEventListener("mousemove",q,!1),t.addEventListener("touchmove",q,!1),t.addEventListener("mouseup",Q,!1),t.addEventListener("mouseout",Q,!1),t.addEventListener("touchend",Q,!1),t.addEventListener("touchcancel",Q,!1),t.addEventListener("touchleave",Q,!1),this.dispose=function(){t.removeEventListener("mousedown",W),t.removeEventListener("touchstart",W),t.removeEventListener("mousemove",Y),t.removeEventListener("touchmove",Y),t.removeEventListener("mousemove",q),t.removeEventListener("touchmove",q),t.removeEventListener("mouseup",Q),t.removeEventListener("mouseout",Q),t.removeEventListener("touchend",Q),t.removeEventListener("touchcancel",Q),t.removeEventListener("touchleave",Q)},this.attach=function(e){this.object=e,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return n},this.setMode=function(e){for(var t in"scale"===(n=e||n)&&(r.space="local"),u)u[t].visible=t===n;this.update(),r.dispatchEvent(d)},this.setTranslationSnap=function(e){r.translationSnap=e},this.setRotationSnap=function(e){r.rotationSnap=e},this.setSize=function(e){r.size=e,this.update(),r.dispatchEvent(d)},this.setSpace=function(e){r.space=e,this.update(),r.dispatchEvent(d)},this.update=function(){void 0!==r.object&&(r.object.updateMatrixWorld(),V.setFromMatrixPosition(r.object.matrixWorld),z.setFromRotationMatrix(S.extractRotation(r.object.matrixWorld)),e.updateMatrixWorld(),H.setFromMatrixPosition(e.matrixWorld),X.setFromRotationMatrix(S.extractRotation(e.matrixWorld)),_=V.distanceTo(H)/6*r.size,this.position.copy(V),this.scale.set(_,_,_),e instanceof a.PerspectiveCamera?E.copy(H).sub(V).normalize():e instanceof a.OrthographicCamera&&E.copy(H).normalize(),"local"===r.space?u[n].update(z,E):"world"===r.space&&u[n].update(new a.Euler,E),u[n].highlight(r.axis))}};return(l.prototype=Object.create(a.Object3D.prototype)).constructor=l,l}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){var r,n,i=this,o=new a.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")})).catch((function(){console.warn("THREE.VRControls: Unable to get VR Displays")})),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return o},this.update=function(){var t;r&&(r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(i.scale))},this.dispose=function(){r=null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedGeometryExporter=t.STLExporter=t.STLBinaryExporter=t.PLYExporter=t.OBJExporter=t.MMDExporter=t.GLTFExporter=void 0;var a=c(r(41)),n=c(r(42)),i=c(r(43)),o=c(r(44)),s=c(r(45)),l=c(r(46)),u=c(r(47));function c(e){return e&&e.__esModule?e:{default:e}}t.GLTFExporter=a.default,t.MMDExporter=n.default,t.OBJExporter=i.default,t.PLYExporter=o.default,t.STLBinaryExporter=s.default,t.STLExporter=l.default,t.TypedGeometryExporter=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987},i={1003:n.NEAREST,1004:n.NEAREST_MIPMAP_NEAREST,1005:n.NEAREST_MIPMAP_LINEAR,1006:n.LINEAR,1007:n.LINEAR_MIPMAP_NEAREST,1008:n.LINEAR_MIPMAP_LINEAR},o={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},s=function(){};s.prototype={constructor:s,parse:function(e,t,r){(r=Object.assign({},{trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,animations:[],forceIndices:!1,forcePowerOfTwoTextures:!1},r)).animations.length>0&&(r.trs=!0);var s,l={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},u=0,c=[],f=[],d=new Map,h=[],p={},m={attributes:new Map,materials:new Map,textures:new Map};function v(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}function g(e){return 4*Math.ceil(e/4)}function y(e,t){t=t||0;var r=g(e.byteLength);if(r!==e.byteLength){var a=new Uint8Array(r);if(a.set(new Uint8Array(e)),0!==t)for(var n=e.byteLength;n0)&&(t.alphaMode=e.opacity<1?"BLEND":"MASK",e.alphaTest>0&&.5!==e.alphaTest&&(t.alphaCutoff=e.alphaTest)),e.side===a.DoubleSide&&(t.doubleSided=!0),""!==e.name&&(t.name=e.name),l.materials.push(t);var i=l.materials.length-1;return m.materials.set(e,i),i}function S(e){var t,i=e.geometry;if(e.isLineSegments)t=n.LINES;else if(e.isLineLoop)t=n.LINE_LOOP;else if(e.isLine)t=n.LINE_STRIP;else if(e.isPoints)t=n.POINTS;else{if(!i.isBufferGeometry){var o=new a.BufferGeometry;o.fromGeometry(i),i=o}e.drawMode===a.TriangleFanDrawMode?(console.warn("GLTFExporter: TriangleFanDrawMode and wireframe incompatible."),t=n.TRIANGLE_FAN):t=e.drawMode===a.TriangleStripDrawMode?e.material.wireframe?n.LINE_STRIP:n.TRIANGLE_STRIP:e.material.wireframe?n.LINES:n.TRIANGLES}var s={},u={},c=[],f=[],d={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},h=i.getAttribute("normal");for(var p in void 0===h||function(e){if(m.attributes.has(e))return!1;for(var t=new a.Vector3,r=0,n=e.count;r5e-4)return!1;return!0}(h)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.addAttribute("normal",function(e){if(m.attributes.has(e))return m.textures.get(e);for(var t=e.clone(),r=new a.Vector3,n=0,i=t.count;n0){var b=[],x=[],_={};if(void 0!==e.morphTargetDictionary)for(var A in e.morphTargetDictionary)_[e.morphTargetDictionary[A]]=A;for(var S=0;S0&&(s.extras={},s.extras.targetNames=x)}var C=r.forceIndices,R=Array.isArray(e.material);if(R&&0===e.geometry.groups.length)return null;!C&&null===i.index&&R&&(console.warn("THREE.GLTFExporter: Creating index for non-indexed multi-material mesh."),C=!0);var k=!1;if(null===i.index&&C){for(var I=[],N=(S=0,i.attributes.position.count);S0&&(j.targets=f),null!==i.index&&(j.indices=w(i.index,i,U[S].start,U[S].count));var B=E(D[U[S].materialIndex]);null!==B&&(j.material=B),c.push(j)}return k&&i.setIndex(null),s.primitives=c,l.meshes||(l.meshes=[]),l.meshes.push(s),l.meshes.length-1}function M(e,t){l.animations||(l.animations=[]);for(var r=[],n=[],i=0;i0)try{t.extras=JSON.parse(JSON.stringify(e.userData))}catch(e){throw new Error("THREE.GLTFExporter: userData can't be serialized")}if(e.isMesh||e.isLine||e.isPoints){var s=S(e);null!==s&&(t.mesh=s)}else e.isCamera&&(t.camera=function(e){l.cameras||(l.cameras=[]);var t=e.isOrthographicCamera,r={type:t?"orthographic":"perspective"};return t?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:a.Math.degToRad(e.fov)/e.aspect,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),l.cameras.push(r),l.cameras.length-1}(e));if(e.isSkinnedMesh&&h.push(e),e.children.length>0){for(var u=[],c=0,f=e.children.length;c0&&(t.children=u)}l.nodes.push(t);var g=l.nodes.length-1;return d.set(e,g),g}function F(e){l.scenes||(l.scenes=[],l.scene=0);var t={nodes:[]};""!==e.name&&(t.name=e.name),l.scenes.push(t);for(var a=[],n=0,i=e.children.length;n0&&(t.nodes=a)}!function(e){e=e instanceof Array?e:[e];for(var t=[],n=0;n0&&function(e){var t=new a.Scene;t.name="AuxScene";for(var r=0;r0&&(l.extensionsUsed=a),l.buffers&&l.buffers.length>0){l.buffers[0].byteLength=e.size;var n=new window.FileReader;if(!0===r.binary){n.readAsArrayBuffer(e),n.onloadend=function(){var e=y(n.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,e.byteLength,!0),r.setUint32(4,5130562,!0);var a=y(function(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0,a=e.length;r255?32:n}return t.buffer}(JSON.stringify(l)),32),i=new DataView(new ArrayBuffer(8));i.setUint32(0,a.byteLength,!0),i.setUint32(4,1313821514,!0);var o=new ArrayBuffer(12),s=new DataView(o);s.setUint32(0,1179937895,!0),s.setUint32(4,2,!0);var u=12+i.byteLength+a.byteLength+r.byteLength+e.byteLength;s.setUint32(8,u,!0);var c=new Blob([o,i,a,r,e],{type:"application/octet-stream"}),f=new window.FileReader;f.readAsArrayBuffer(c),f.onloadend=function(){t(f.result)}}}else n.readAsDataURL(e),n.onloadend=function(){var e=n.result;l.buffers[0].uri=e,t(l)}}else t(l)}))}},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(0)),n=i(r(4));function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.default=function(){var e;this.parseVpd=function(t,r,i){if(!0!==t.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);var t=e.toString();-1===t.indexOf(".")&&(t+=".");var r=(t+="000000").indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function s(e){for(var t=[],r=0,a=e.length;r255?(u.push(l>>8&255),u.push(255&l)):u.push(255&l)}return new Uint8Array(u)}(x):x}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(){};n.prototype={constructor:n,parse:function(e){var t,r,n,i,o,s="",l=0,u=0,c=0,f=new a.Vector3,d=new a.Vector3,h=new a.Vector2,p=[];return e.traverse((function(e){e instanceof a.Mesh&&function(e){var n=0,m=0,v=0,g=e.geometry,y=new a.Matrix3;if(g instanceof a.Geometry&&(g=(new a.BufferGeometry).setFromObject(e)),g instanceof a.BufferGeometry){var b=g.getAttribute("position"),w=g.getAttribute("normal"),x=g.getAttribute("uv"),_=g.getIndex();if(s+="o "+e.name+"\n",e.material&&e.material.name&&(s+="usemtl "+e.material.name+"\n"),void 0!==b)for(t=0,i=b.count;t=200)return void n("THREE.AssimpJSONLoader: Unsupported assimp2json file format version.")}t(i.parse(r,o))}),r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=new Array(e.length),a=0;a0&&i.addAttribute("normal",new a.Float32BufferAttribute(l,3)),u.length>0&&i.addAttribute("uv",new a.Float32BufferAttribute(u,2)),c.length>0&&i.addAttribute("color",new a.Float32BufferAttribute(c,3)),i.computeBoundingSphere(),i})),o=r(e.materials,(function(e){var t=new a.MeshPhongMaterial;for(var r in e.properties){var i=e.properties[r],o=i.key,s=i.value;switch(o){case"$tex.file":var l=i.semantic;if(1===l||2===l||5===l||6===l){var u;switch(l){case 1:u="map";break;case 2:u="specularMap";break;case 5:u="bumpMap";break;case 6:u="normalMap"}var c=n.load(s);c.wrapS=c.wrapT=a.RepeatWrapping,t[u]=c}break;case"?mat.name":t.name=s;break;case"$clr.diffuse":t.color.fromArray(s);break;case"$clr.specular":t.specular.fromArray(s);break;case"$clr.emissive":t.emissive.fromArray(s);break;case"$mat.shininess":t.shininess=s;break;case"$mat.shadingm":t.flatShading=1===s;break;case"$mat.opacity":s<1&&(t.opacity=s,t.transparent=!0)}}return t}));return function e(t,r,n,i){var o,s,l=new a.Object3D;for(l.name=r.name||"",l.matrix=(new a.Matrix4).fromArray(r.transformation).transpose(),l.matrix.decompose(l.position,l.quaternion,l.scale),o=0;r.meshes&&o0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(var e=0;e=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;for(var r=e.hierarchy[0].keys,a=0;ae){t=this.keys[a],r=this.keys[a+1];break}if(this.keys[a].time4&&(r.length=4);var n=0;for(a=0;a<4;a++)n+=r[a].w*r[a].w;n=Math.sqrt(n);for(a=0;a<4;a++)r[a].w=r[a].w/n,e[a]=r[a].i,t[a]=r[a].w}function k(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(var r in e.children){var a=k(e.children[r],t);if(a)return a}}function I(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e,t){if(0!=this.mBones.length){for(var r=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var o=C(u=i.toTHREE(e),e);this.threeNode.add(o);for(var s=0;s0&&n.addAttribute("normal",new a.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&n.addAttribute("color",new a.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&n.addAttribute("uv",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&n.addAttribute("uv1",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&n.addAttribute("tangents",new a.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&n.addAttribute("bitangents",new a.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){for(var i=[],o=[],s=0;s0&&(r=new a.SkinnedMesh(n,t)),this.threeNode=r,r}}function N(){this.mNumIndices=0,this.mIndices=[]}function D(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new a.Vector3(this.x,this.y,this.z)}}function U(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new a.Color(this.r,this.g,this.b,1)}}function j(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new a.Quaternion(this.x,this.y,this.z,this.w)}}function B(){this.mVertexId=0,this.mWeight=0}function V(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}function z(){this.mTime=0,this.mValue=null}function G(){this.mTime=0,this.mValue=null}function H(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new a.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(var r=0;r0)var r=this.mAnimations[0].toTHREE(this);return{object:e,animation:r}}}function ie(){this.elements=[[],[],[],[]],this.toTHREE=function(){for(var e=new a.Matrix4,t=0;t<4;++t)for(var r=0;r<4;++r)e.elements[4*t+r]=this.elements[r][t];return e}}var oe=!0;function se(e){var t=e.getFloat32(e.readOffset,oe);return e.readOffset+=4,t}function le(e){var t=e.getFloat64(e.readOffset,oe);return e.readOffset+=8,t}function ue(e){var t=e.getUint16(e.readOffset,oe);return e.readOffset+=2,t}function ce(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function fe(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function de(e){var t=new D;return t.x=se(e),t.y=se(e),t.z=se(e),t}function he(e){var t=new U;return t.r=se(e),t.g=se(e),t.b=se(e),t}function pe(e){var t=new V,r=ce(e);return e.ReadBytes(t.data,1,r),t.toString()}function me(e){var t=new B;return t.mVertexId=ce(e),t.mWeight=se(e),t}function ve(e){for(var t=new ie,r=0;r<4;++r)for(var a=0;a<4;++a)t.elements[r][a]=se(e);return t}function ge(e){var t=new z;return t.mTime=le(e),t.mValue=de(e),t}function ye(e){var t=new G;return t.mTime=le(e),t.mValue=function(e){var t=new j;return t.w=se(e),t.x=se(e),t.y=se(e),t.z=se(e),t}(e),t}function be(e,t,r){for(var a=0;a0,Re=ue(r)>0,Ce)throw"Shortened binaries are not supported!";if(r.Seek(256,ke),r.Seek(128,ke),r.Seek(64,ke),!Re)return Le(r,t),t.toTHREE();var a=fe(r),n=r.FileSize()-r.Tell(),i=[];r.Read(i,1,n);var o=[];uncompress(o,a,i,n),Le(new ArrayBuffer(o),t)}(e)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){function e(){this.id=0,this.data=null}function t(){}t.prototype={set:function(e,t){this[e]=t},get:function(e,t){return this.hasOwnProperty(e)?this[e]:t}};var r=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.trunk=new a.Object3D,this.materialFactory=void 0,this._url="",this._baseDir="",this._data=void 0,this._ptr=0,this._version=[],this._streaming=!1,this._optimized_for_accuracy=!1,this._compression=0,this._bodylen=4294967295,this._blocks=[new e],this._accuracyMatrix=!1,this._accuracyGeo=!1,this._accuracyProps=!1};return r.prototype={constructor:r,load:function(e,t,r,n){var i=this;this._url=e,this._baseDir=e.substr(0,e.lastIndexOf("/")+1);var o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){var t=e.byteLength;for(this._ptr=0,this._data=new DataView(e),this._parseHeader(),0!=this._compression&&console.error("compressed AWD not supported"),this._streaming||this._bodylen==e.byteLength-this._ptr||console.error("AWDLoader: body len does not match file length",this._bodylen,t-this._ptr);this._ptr1)for(r=new a.Object3D,p=0;p191&&a<224){var n=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((31&a)<<6|63&n)}else{n=this._data.getUint8(this._ptr++,!0);var i=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((15&a)<<12|(63&n)<<6|63&i)}}return t.join("")}},r}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),r,n)},parse:function(e){function t(e){var t=new a.BufferGeometry,r=e.indices,n=e.positions,i=e.normals,o=e.uvs;t.setIndex(r);for(var s=2,l=n.length;s0&&t.push(new a.VectorKeyframeTrack(n+".position",i,o)),s.length>0&&t.push(new a.QuaternionKeyframeTrack(n+".quaternion",i,s)),l.length>0&&t.push(new a.VectorKeyframeTrack(n+".scale",i,l)),t}function A(e,t,r){var a,n,i,o=!0;for(n=0,i=e.length;n=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function S(e,t,r){for(;t0&&t0&&h.addAttribute("position",new a.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&h.addAttribute("normal",new a.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&h.addAttribute("color",new a.Float32BufferAttribute(l.array,l.stride)),s.array.length>0&&h.addAttribute("uv",new a.Float32BufferAttribute(s.array,s.stride)),u.length>0&&h.addAttribute("skinIndex",new a.Float32BufferAttribute(u,c)),f.length>0&&h.addAttribute("skinWeight",new a.Float32BufferAttribute(f,d)),n.data=h,n.type=e[0].type,n.materialKeys=p,n}function fe(e,t,r,a){var n=e.p,i=e.stride,o=e.vcount;function s(e){for(var t=n[e+r]*u,i=t+u;t4)for(var g=1,y=h-2;g<=y;g++){p=c+i*g,m=c+i*(g+1);s(c+0*i),s(p),s(m)}c+=i*h}else for(f=0,d=n.length;f=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ge(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;rn.limits.max||t>8&255,d>>16&255,d>>24&255))),r;p=!0,o=64,r.format=a.RGBAFormat}r.mipmapCount=1,131072&f[2]&&!1!==t&&(r.mipmapCount=Math.max(1,f[7]));var m=f[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=f[4],r.height=f[3];for(var v=f[1]+4,g=r.isCubemap?6:1,y=0;y>1,1),w=Math.max(w>>1,1)}return r},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="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},n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var i=function(e){this.timeLoaded=0,this.manager=e||n.DefaultLoadingManager,this.materials=null,this.verbosity=0,this.attributeOptions={},this.drawMode=n.TrianglesDrawMode,this.nativeAttributeMap={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"}};i.prototype={constructor:i,load:function(e,t,r,a){var i=this,o=new n.FileLoader(i.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.load(e,(function(e){i.decodeDracoFile(e,t)}),r,a)},setPath:function(e){this.path=e},setCrossOrigin:function(e){this.crossOrigin=e},setVerbosity:function(e){this.verbosity=e},setDrawMode:function(e){this.drawMode=e},setSkipDequantization:function(e,t){var r=!0;void 0!==t&&(r=t),this.getAttributeOptions(e).skipDequantization=r},decodeDracoFile:function(e,t,r){var a=this;i.getDecoderModule().then((function(n){a.decodeDracoFileInternal(e,n.decoder,t,r||{})}))},decodeDracoFileInternal:function(e,t,r,a){var n=new t.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength);var i=new t.Decoder,o=i.GetEncodedGeometryType(n);if(o==t.TRIANGULAR_MESH)this.verbosity>0&&console.log("Loaded a mesh.");else{if(o!=t.POINT_CLOUD){var s="THREE.DRACOLoader: Unknown geometry type.";throw console.error(s),new Error(s)}this.verbosity>0&&console.log("Loaded a point cloud.")}r(this.convertDracoGeometryTo3JS(t,i,o,n,a))},addAttributeToGeometry:function(e,t,r,a,i,o,s){if(0===i.ptr){var l="THREE.DRACOLoader: No attribute "+a;throw console.error(l),new Error(l)}var u=i.num_components(),c=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,c);var f=r.num_points()*u;s[a]=new Float32Array(f);for(var d=0;d0&&console.log("Number of faces loaded: "+c.toString())):c=0;var d=o.num_points(),h=o.num_attributes();this.verbosity>0&&(console.log("Number of points loaded: "+d.toString()),console.log("Number of attributes loaded: "+h.toString()));var p=t.GetAttributeId(o,e.POSITION);if(-1==p){u="THREE.DRACOLoader: No position attribute found.";throw console.error(u),e.destroy(t),e.destroy(o),new Error(u)}var m=t.GetAttribute(o,p),v={},g=new n.BufferGeometry;for(var y in this.nativeAttributeMap)if(void 0===i[y]){var b=t.GetAttributeId(o,e[this.nativeAttributeMap[y]]);if(-1!==b){this.verbosity>0&&console.log("Loaded "+y+" attribute.");var w=t.GetAttribute(o,b);this.addAttributeToGeometry(e,t,o,y,w,g,v)}}for(var y in i){var x=i[y];w=t.GetAttributeByUniqueId(o,x);this.addAttributeToGeometry(e,t,o,y,w,g,v)}if(r==e.TRIANGULAR_MESH)if(this.drawMode===n.TriangleStripDrawMode){var _=new e.DracoInt32Array;t.GetTriangleStripsFromMesh(o,_);v.indices=new Uint32Array(_.size());for(var A=0;A<_.size();++A)v.indices[A]=_.GetValue(A);e.destroy(_)}else{var E=3*c;v.indices=new Uint32Array(E);var S=new e.DracoInt32Array;for(A=0;A65535?n.Uint32BufferAttribute:n.Uint16BufferAttribute)(v.indices,1));var T=new e.AttributeQuantizationTransform;if(T.InitFromAttribute(m)){g.attributes.position.isQuantized=!0,g.attributes.position.maxRange=T.range(),g.attributes.position.numQuantizationBits=T.quantization_bits(),g.attributes.position.minValues=new Float32Array(3);for(A=0;A<3;++A)g.attributes.position.minValues[A]=T.min_value(A)}return e.destroy(T),e.destroy(t),e.destroy(o),this.decode_time=f-l,this.import_time=performance.now()-f,this.verbosity>0&&(console.log("Decode time: "+this.decode_time),console.log("Import time: "+this.import_time)),g},isVersionSupported:function(e,t){i.getDecoderModule().then((function(r){t(r.decoder.isVersionSupported(e))}))},getAttributeOptions:function(e){return void 0===this.attributeOptions[e]&&(this.attributeOptions[e]={}),this.attributeOptions[e]}},i.decoderPath="./",i.decoderConfig={},i.decoderModulePromise=null,i.setDecoderPath=function(e){i.decoderPath=e},i.setDecoderConfig=function(e){var t=i.decoderConfig.wasmBinary;i.decoderConfig=e||{},i.releaseDecoderModule(),t&&(i.decoderConfig.wasmBinary=t)},i.releaseDecoderModule=function(){i.decoderModulePromise=null},i.getDecoderModule=function(){var e=this,t=i.decoderPath,r=i.decoderConfig,n=i.decoderModulePromise;return n||("undefined"!=typeof DracoDecoderModule?n=Promise.resolve():"object"!==("undefined"==typeof WebAssembly?"undefined":a(WebAssembly))||"js"===r.type?n=i._loadScript(t+"draco_decoder.js"):(r.wasmBinaryFile=t+"draco_decoder.wasm",n=i._loadScript(t+"draco_wasm_wrapper.js").then((function(){return i._loadArrayBuffer(r.wasmBinaryFile)})).then((function(e){r.wasmBinary=e}))),n=n.then((function(){return new Promise((function(t){r.onModuleLoaded=function(r){e.timeLoaded=performance.now(),t({decoder:r})},DracoDecoderModule(r)}))})),i.decoderModulePromise=n,n)},i._loadScript=function(e){var t=document.getElementById("decoder_script");null!==t&&t.parentNode.removeChild(t);var r=document.getElementsByTagName("head")[0],a=document.createElement("script");return a.id="decoder_script",a.type="text/javascript",a.src=e,new Promise((function(e){a.onload=e,r.appendChild(a)}))},i._loadArrayBuffer=function(e){var t=new n.FileLoader;return t.setResponseType("arraybuffer"),new Promise((function(r,a){t.load(e,r,void 0,a)}))},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.sourceTexture=e,this.resolution=t,this.views=[{t:[1,0,0],u:[0,-1,0]},{t:[-1,0,0],u:[0,-1,0]},{t:[0,1,0],u:[0,0,1]},{t:[0,-1,0],u:[0,0,-1]},{t:[0,0,1],u:[0,-1,0]},{t:[0,0,-1],u:[0,-1,0]}],this.camera=new a.PerspectiveCamera(90,1,.1,10),this.boxMesh=new a.Mesh(new a.BoxBufferGeometry(1,1,1),this.getShader()),this.boxMesh.material.side=a.BackSide,this.scene=new a.Scene,this.scene.add(this.boxMesh);var r={format:a.RGBAFormat,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.renderTarget=new a.WebGLRenderTargetCube(this.resolution,this.resolution,r)};n.prototype={constructor:n,update:function(e){for(var t=0;t<6;t++){this.renderTarget.activeCubeFace=t;var r=this.views[t];this.camera.position.set(0,0,0),this.camera.up.set(r.u[0],r.u[1],r.u[2]),this.camera.lookAt(r.t[0],r.t[1],r.t[2]),e.render(this.scene,this.camera,this.renderTarget,!0)}return this.renderTarget.texture},getShader:function(){var e=new a.ShaderMaterial({uniforms:{equirectangularMap:{value:this.sourceTexture}},vertexShader:"varying vec3 localPosition;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tlocalPosition = position;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \n\t\t\t\tvarying vec3 localPosition;\n\t\t\t\tuniform sampler2D equirectangularMap;\n\t\t\t\t\n\t\t\t\tvec2 EquiangularSampleUV(vec3 v) {\n\t\t\t vec2 uv = vec2(atan(v.z, v.x), asin(v.y));\n\t\t\t uv *= vec2(0.1591, 0.3183); // inverse atan\n\t\t\t uv += 0.5;\n\t\t\t return uv;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = EquiangularSampleUV(normalize(localPosition));\n \t\t\tvec3 color = texture2D(equirectangularMap, uv).rgb;\n \t\t\t\n\t\t\t\t\tgl_FragColor = vec4( color, 1.0 );\n\t\t\t\t}",blending:a.CustomBlending,premultipliedAlpha:!1,blendSrc:a.OneFactor,blendDst:a.ZeroFactor,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.ZeroFactor,blendEquation:a.AddEquation});return e.type="EquiangularToCubeGenerator",e},dispose:function(){this.boxMesh.geometry.dispose(),this.boxMesh.material.dispose(),this.renderTarget.dispose()}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};(n.prototype=Object.create(a.DataTextureLoader.prototype))._parser=function(e){var t=65536,r=t>>3,n=14,i=65537,o=1<>r&(1<a)return!1;g(6,d,h,e,f);var p=v.l;if(d=v.c,h=v.lc,s[n]=p,p==u){if(f.value-r.value>a)throw"Something wrong with hufUnpackEncTable";g(8,d,h,e,f);var m=v.l+c;if(d=v.c,h=v.lc,n+m>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}else if(p>=l){if(n+(m=p-l+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}}!function(e){for(var t=0;t<=58;++t)y[t]=0;for(t=0;t0;--t){var a=r+y[t]>>1;y[t]=r,r=a}for(t=0;t0&&(e[t]=n|y[n]++<<6)}}(s)}function w(e){return 63&e}function x(e){return e>>6}var _={c:0,lc:0};function A(e,t,r,a){e=e<<8|I(r,a),t+=8,_.c=e,_.lc=t}var E={c:0,lc:0};function S(e,t,r,a,n,i,o,s,l,u){if(e==t){a<8&&(A(r,a,n,o),r=_.c,a=_.lc);var c=r>>(a-=8);if(out+c>oe)throw"Issue with getCode";for(var f=out[-1];c-- >0;)s[l.value++]=f}else{if(!(l.value32767?t-65536:t}var T={a:0,b:0};function P(e,t){var r=M(e),a=M(t),n=r+(1&a)+(a>>1),i=n,o=n-a;T.a=i,T.b=o}function F(e,t,r,a,n,i,o){for(var s,l=r>n?n:r,u=1;u<=l;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var c,f,d,h,p=0,m=p+i*(n-s),v=i*u,g=i*s,y=a*u,b=a*s;p<=m;p+=g){for(var w=p,x=p+a*(r-s);w<=x;w+=b){var _=w+y,A=(E=w+v)+y;P(t[w+e],t[E+e]),c=T.a,d=T.b,P(t[_+e],t[A+e]),f=T.a,h=T.b,P(c,f),t[w+e]=T.a,t[_+e]=T.b,P(d,h),t[E+e]=T.a,t[A+e]=T.b}if(r&u){var E=w+v;P(t[w+e],t[E+e]),c=T.a,t[E+e]=T.b,t[w+e]=c}}if(n&u)for(w=p,x=p+a*(r-s);w<=x;w+=b){_=w+y;P(t[w+e],t[_+e]),c=T.a,t[_+e]=T.b,t[w+e]=c}s=u,u>>=1}return p}function O(e,t,r,a,l,u,c){var f=r.value,d=k(t,r),h=k(t,r);r.value+=4;var p=k(t,r);if(r.value+=4,d<0||d>=i||h<0||h>=i)throw"Something wrong with HUF_ENCSIZE";var m=new Array(i),v=new Array(o);if(function(e){for(var t=0;t8*(a-(r.value-f)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var i=x(e[t]),o=w(e[t]);if(i>>o)throw"Invalid table entry";if(o>n){if((c=a[i>>o-n]).len)throw"Invalid table entry";if(c.lit++,c.p){var s=c.p;c.p=new Array(c.lit);for(var l=0;l0;l--){var c;if((c=a[(i<=n;){if((b=t[d>>h-n&s]).len)h-=b.len,S(b.lit,l,d,h,r,0,i,c,f,p),d=E.c,h=E.lc;else{if(!b.p)throw"hufDecode issues";var v;for(v=0;v=g&&x(e[b.p[v]])==(d>>h-g&(1<>=y,h-=y;h>0;){var b;if(!(b=t[d<=r)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(h<=p)for(var m=0;m>3]&1<<(7&n))&&(r[a++]=n);for(var i=a-1;a>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function j(e,t){var r=e.getUint16(t.value,!0);return t.value+=p,r}function B(e,t){return U(j(e,t))}function V(e,t,r,a,n){if("string"===a||"iccProfile"===a)return function(e,t,r){var a=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,a}(t,r,n);if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value0&&void 0!==r[l[0].ID]&&(0!==(i=r[l[0].ID]).indexOf("blob:")&&0!==i.indexOf("data:")||t.setPath(void 0));o="tga"===e.FileName.slice(-3).toLowerCase()?n.Loader.Handlers.get(".tga").load(i):t.load(i);return t.setPath(s),o}(e,t,r,a);i.ID=e.id,i.name=e.attrName;var o=e.WrapModeU,s=e.WrapModeV,l=void 0!==o?o.value:0,u=void 0!==s?s.value:0;if(i.wrapS=0===l?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===u?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){var c=e.Scaling.value;i.repeat.x=c[0],i.repeat.y=c[1]}return i}function i(e,t,r,i){var s=t.id,l=t.attrName,u=t.ShadingModel;if("object"===(void 0===u?"undefined":a(u))&&(u=u.value),!i.has(s))return null;var c,f=function(e,t,r,a,i){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value);t.Diffuse?s.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new n.Color).fromArray(t.DiffuseColor.value));t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value);t.Emissive?s.emissive=(new n.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new n.Color).fromArray(t.EmissiveColor.value));t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value));t.Opacity&&(s.opacity=parseFloat(t.Opacity.value));s.opacity<1&&(s.transparent=!0);t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value);t.Shininess&&(s.shininess=t.Shininess.value);t.Specular?s.specular=(new n.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new n.Color).fromArray(t.SpecularColor.value));return i.get(a).children.forEach((function(t){var a=t.relationship;switch(a){case"Bump":s.bumpMap=r.get(t.ID);break;case"DiffuseColor":s.map=o(e,r,t.ID,i);break;case"DisplacementColor":s.displacementMap=o(e,r,t.ID,i);break;case"EmissiveColor":s.emissiveMap=o(e,r,t.ID,i);break;case"NormalMap":s.normalMap=o(e,r,t.ID,i);break;case"ReflectionColor":s.envMap=o(e,r,t.ID,i),s.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":s.specularMap=o(e,r,t.ID,i);break;case"TransparentColor":s.alphaMap=o(e,r,t.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a)}})),s}(e,t,r,s,i);switch(u.toLowerCase()){case"phong":c=new n.MeshPhongMaterial;break;case"lambert":c=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',u),c=new n.MeshPhongMaterial({color:3342591})}return c.setValues(f),c.name=l,c}function o(e,t,r,a){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=a.get(r).children[0].ID),t.get(r)}function s(e,t){var r=[];return e.children.forEach((function(e){var a=t[e.ID];if("Cluster"===a.attrType){var i={ID:e.ID,indices:[],weights:[],transform:(new n.Matrix4).fromArray(a.Transform.a),transformLink:(new n.Matrix4).fromArray(a.TransformLink.a),linkMode:a.Mode};"Indexes"in a&&(i.indices=a.Indexes.a,i.weights=a.Weights.a),r.push(i)}})),{rawBones:r,bones:[]}}function l(e,t,r,a){for(var n=[],i=0;i0&&o.addAttribute("color",new n.Float32BufferAttribute(l.colors,3));r&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(l.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(l.vertexWeights,4)),o.FBX_Deformer=r);if(l.normal.length>0){var d=new n.Float32BufferAttribute(l.normal,3);(new n.Matrix3).getNormalMatrix(i).applyToBufferAttribute(d),o.addAttribute("normal",d)}if(l.uvs.forEach((function(e,t){var r="uv"+(t+1).toString();0===t&&(r="uv"),o.addAttribute(r,new n.Float32BufferAttribute(l.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){var h=l.materialIndex[0],p=0;if(l.materialIndex.forEach((function(e,t){e!==h&&(o.addGroup(p,t-p,h),h=e,p=t)})),o.groups.length>0){var m=o.groups[o.groups.length-1],v=m.start+m.count;v!==l.materialIndex.length&&o.addGroup(v,l.materialIndex.length-v,h)}0===o.groups.length&&o.addGroup(0,l.materialIndex.length,l.materialIndex[0])}return function(e,t,r,a,i){if(null===a)return;t.morphAttributes.position=[],t.morphAttributes.normal=[],a.rawTargets.forEach((function(a){var o=e.Objects.Geometry[a.geoID];void 0!==o&&function(e,t,r,a){var i=new n.BufferGeometry;r.attrName&&(i.name=r.attrName);for(var o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],s=void 0!==t.Vertices?t.Vertices.a.slice():[],l=void 0!==r.Vertices?r.Vertices.a:[],u=void 0!==r.Indexes?r.Indexes.a:[],f=0;f4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);var y=[0,0,0,0],b=[0,0,0,0];v.forEach((function(e,t){var r=e,a=m[t];b.forEach((function(e,t,n){if(r>e){n[t]=r,r=e;var i=y[t];y[t]=a,a=i}}))})),m=y,v=b}for(;v.length<4;)v.push(0),m.push(0);for(var w=0;w<4;++w)u.push(v[w]),c.push(m[w])}if(e.normal){g=h(d,r,f,e.normal);o.push(g[0],g[1],g[2])}if(e.material&&"AllSame"!==e.material.mappingType)var x=h(d,r,f,e.material)[0];e.uv&&e.uv.forEach((function(e,t){var a=h(d,r,f,e);void 0===l[t]&&(l[t]=[]),l[t].push(a[0]),l[t].push(a[1])})),a++,p&&(!function(e,t,r,a,n,i,o,s,l,u){for(var c=2;c=f.length&&f===C(c,0,f.length))o=(new M).parse(e);else{var d=C(e);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;for(var a=0;a0,u="string"==typeof o.Content&&""!==o.Content;if(l||u){var c=t(n[i]);a[o.RelativeFilename||o.Filename]=c}}}}for(var s in r){var f=r[s];void 0!==a[f]?r[s]=a[f]:r[s]=r[s].split("\\").pop()}return r}(o),_=function(e,t,r){var a=new Map;if("Material"in e.Objects){var n=e.Objects.Material;for(var o in n){var s=i(e,n[o],t,r);null!==s&&a.set(parseInt(o),s)}}return a}(o,function(e,t,a,n){var i=new Map;if("Texture"in e.Objects){var o=e.Objects.Texture;for(var s in o){var l=r(o[s],t,a,n);i.set(parseInt(s),l)}}return i}(o,new n.TextureLoader(this.manager).setPath(a),x,h),h),A=function(e,t){var r={},a={};if("Deformer"in e.Objects){var n=e.Objects.Deformer;for(var i in n){var o=n[i],u=t.get(parseInt(i));if("Skin"===o.attrType){var c=s(u,n);c.ID=i,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),c.geometryID=u.parents[0].ID,r[i]=c}else if("BlendShape"===o.attrType){var f={id:i};f.rawTargets=l(u,o,n,t),f.id=i,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),f.parentGeoID=u.parents[0].ID,a[i]=f}}}return{skeletons:r,morphTargets:a}}(o,h),E=function(e,t,r){var a=new Map;if("Geometry"in e.Objects){var n=e.Objects.Geometry;for(var i in n){var o=t.get(parseInt(i)),s=u(e,o,n[i],r);a.set(parseInt(i),s)}}return a}(o,h,A);return function(e,t,r,a,i){var o=new n.Group,s=function(e,t,r,a,i){var o=new Map,s=e.Objects.Model;for(var l in s){var u=parseInt(l),c=s[l],f=i.get(u),d=p(f,t,u,c.attrName);if(!d){switch(c.attrType){case"Camera":d=m(e,f);break;case"Light":d=v(e,f);break;case"Mesh":d=g(e,f,r,a);break;case"NurbsCurve":d=y(f,r);break;case"LimbNode":case"Null":default:d=new n.Group}d.name=n.PropertyBinding.sanitizeNodeName(c.attrName),d.ID=u}b(e,d,c),o.set(u,d)}return o}(e,r,a,i,t),l=e.Objects.Model;return s.forEach((function(r){var a=l[r.ID];!function(e,t,r,a,i){if("LookAtProperty"in r){a.get(t.ID).children.forEach((function(r){if("LookAtProperty"===r.relationship){var a=e.Objects.Model[r.ID];if("Lcl_Translation"in a){var o=a.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(o),i.add(t.target)):t.lookAt((new n.Vector3).fromArray(o))}}}))}}(e,r,a,t,o),t.get(r.ID).parents.forEach((function(e){var t=s.get(e.ID);void 0!==t&&t.add(r)})),null===r.parent&&o.add(r)})),function(e,t,r,a,i){var o=function(e){var t={};if("Pose"in e.Objects){var r=e.Objects.Pose;for(var a in r)if("BindPose"===r[a].attrType){var i=r[a].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new n.Matrix4).fromArray(e.Matrix.a)})):t[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return t}(e);for(var s in t){var l=t[s];i.get(parseInt(l.ID)).parents.forEach((function(e){if(r.has(e.ID)){var t=e.ID;i.get(t).parents.forEach((function(e){a.has(e.ID)&&a.get(e.ID).bind(new n.Skeleton(l.bones),o[e.ID])}))}}))}}(e,r,a,s,t),function(e,t,r){r.animations=[];var a=function(e,t){if(void 0===e.Objects.AnimationCurve)return;var r=function(e){var t=e.Objects.AnimationCurveNode,r=new Map;for(var a in t){var n=t[a];if(null!==n.attrName.match(/S|R|T/)){var i={id:n.id,attr:n.attrName,curves:{}};r.set(i.id,i)}}return r}(e);!function(e,t,r){var a=e.Objects.AnimationCurve;for(var n in a){var i={id:a[n].id,times:a[n].KeyTime.a.map(O),values:a[n].KeyValueFloat.a},o=t.get(i.id);if(void 0!==o){var s=o.parents[0].ID,l=o.parents[0].relationship;l.match(/X/)?r.get(s).curves.x=i:l.match(/Y/)?r.get(s).curves.y=i:l.match(/Z/)&&(r.get(s).curves.z=i)}}}(e,t,r);var a=function(e,t,r){var a=e.Objects.AnimationLayer,i=new Map;for(var o in a){var s=[],l=t.get(parseInt(o));if(void 0!==l)l.children.forEach((function(a,i){if(r.has(a.ID)){var o=r.get(a.ID);if(void 0!==o.curves.x||void 0!==o.curves.y||void 0!==o.curves.z){if(void 0===s[i]){var l;t.get(a.ID).parents.forEach((function(e){void 0!==e.relationship&&(l=e.ID)}));var u=e.Objects.Model[l.toString()],c={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};"Lcl_Translation"in u&&(c.initialPosition=u.Lcl_Translation.value),"Lcl_Rotation"in u&&(c.initialRotation=u.Lcl_Rotation.value),"Lcl_Scaling"in u&&(c.initialScale=u.Lcl_Scaling.value),"PreRotation"in u&&(c.preRotations=u.PreRotation.value),s[i]=c}s[i][o.attr]=o}}})),i.set(parseInt(o),s)}return i}(e,t,r);return function(e,t,r){var a=e.Objects.AnimationStack,n={};for(var i in a){var o=t.get(parseInt(i)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=r.get(o[0].ID);n[i]={name:a[i].attrName,layer:s}}return n}(e,t,a)}(e,t);if(void 0===a)return;for(var i in a){var o=w(a[i]);r.animations.push(o)}}(e,t,o),function(e,t){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var r=e.GlobalSettings.AmbientColor.value,a=r[0],i=r[1],o=r[2];if(0!==a||0!==i||0!==o){var s=new n.Color(a,i,o);t.add(new n.AmbientLight(s,1))}}}(e,o),o}(o,h,A.skeletons,E,_)}});var d=[];function h(e,t,r,a){var n;switch(a.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=r;break;case"AllSame":n=a.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+a.mappingType)}"IndexToDirect"===a.referenceType&&(n=a.indices[n]);var i=n*a.dataSize,o=i+a.dataSize;return function(e,t,r,a){for(var n=r,i=0;n1?s=l:l.length>0?s=l[0]:(s=new n.MeshPhongMaterial({color:13421772}),l.push(s)),"color"in o.attributes&&l.forEach((function(e){e.vertexColors=n.VertexColors})),o.FBX_Deformer?(l.forEach((function(e){e.skinning=!0})),i=new n.SkinnedMesh(o,s)):i=new n.Mesh(o,s),i}function y(e,t){var r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),a=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,a)}function b(e,t,r){if("RotationOrder"in r){var a=parseInt(r.RotationOrder.value,10);a>0&&a<6?console.warn("THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.",["XYZ","XZY","YZX","ZXY","YXZ","ZYX","SphericXYZ"][a]):6===a&&console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.")}if("Lcl_Translation"in r&&t.position.fromArray(r.Lcl_Translation.value),"Lcl_Rotation"in r){var i=r.Lcl_Rotation.value.map(n.Math.degToRad);i.push("ZYX"),t.quaternion.setFromEuler((new n.Euler).fromArray(i))}if("Lcl_Scaling"in r&&t.scale.fromArray(r.Lcl_Scaling.value),"PreRotation"in r){var o=r.PreRotation.value.map(n.Math.degToRad);o[3]="ZYX";var s=(new n.Euler).fromArray(o);s=(new n.Quaternion).setFromEuler(s),t.quaternion.premultiply(s)}}function w(e){var t=[];return e.layer.forEach((function(e){t=t.concat(function(e){var t=[];if(void 0!==e.T&&Object.keys(e.T.curves).length>0){var r=x(e.modelName,e.T.curves,e.initialPosition,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=function(e,t,r,a){void 0!==t.x&&(E(t.x),t.x.values=t.x.values.map(n.Math.degToRad));void 0!==t.y&&(E(t.y),t.y.values=t.y.values.map(n.Math.degToRad));void 0!==t.z&&(E(t.z),t.z.values=t.z.values.map(n.Math.degToRad));var i=A(t),o=_(i,t,r);void 0!==a&&((a=a.map(n.Math.degToRad)).push("ZYX"),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a));for(var s=new n.Quaternion,l=new n.Euler,u=[],c=0;c0){var i=x(e.modelName,e.S.curves,e.initialScale,"scale");void 0!==i&&t.push(i)}return t}(e))})),new n.AnimationClip(e.name,-1,t)}function x(e,t,r,a){var i=A(t),o=_(i,t,r);return new n.VectorKeyframeTrack(e+"."+a,i,o)}function _(e,t,r){var a=r,n=[],i=-1,o=-1,s=-1;return e.forEach((function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(s=t.z.times.indexOf(e)),-1!==i){var r=t.x.values[i];n.push(r),a[0]=r}else n.push(a[0]);if(-1!==o){var l=t.y.values[o];n.push(l),a[1]=l}else n.push(a[1]);if(-1!==s){var u=t.z.values[s];n.push(u),a[2]=u}else n.push(a[2])})),n}function A(e){var t=[];return void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})).filter((function(e,t,r){return r.indexOf(e)==t}))}function E(e){for(var t=1;t=180){for(var i=n/180,o=a/i,s=r+o,l=e.times[t-1],u=(e.times[t]-l)/i,c=l+u,f=[],d=[];c1&&(r=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:r,type:a}},parseNodeProperty:function(e,t,r){var a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===a&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());var i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===a){var o=n.split(",").slice(1),s=parseInt(o[0]),l=parseInt(o[1]),u=n.split(",").slice(3);a="connections",function(e,t){for(var r=0,a=e.length,n=t.length;r=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var r={},a=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32(),i=(t>=7500?e.getUint64():e.getUint32(),e.getUint8()),o=e.getString(i);if(0===a)return null;for(var s=[],l=0;l0?s[0]:"",c=s.length>1?s[1]:"",f=s.length>2?s[2]:"";for(r.singleProperty=1===n&&e.getOffset()===a;a>e.getOffset();){var d=this.parseNode(e,t);null!==d&&this.parseSubNode(o,r,d)}return r.propertyList=s,"number"==typeof u&&(r.id=u),""!==c&&(r.attrName=c),""!==f&&(r.attrType=f),""!==o&&(r.name=o),r},parseSubNode:function(e,t,r){if(!0===r.singleProperty){var a=r.propertyList[0];Array.isArray(a)?(t[r.name]=r,r.a=a):t[r.name]=a}else if("Connections"===e&&"C"===r.name){var n=[];r.propertyList.forEach((function(e,t){0!==t&&n.push(e)})),void 0===t.connections&&(t.connections=[]),t.connections.push(n)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){var i,o=r.propertyList[0],s=r.propertyList[1],l=r.propertyList[2],u=r.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),i="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[o]={type:s,type2:l,flag:u,value:i}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var r=e.getUint32();return e.getArrayBuffer(r);case"S":r=e.getUint32();return e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var a=e.getUint32(),n=e.getUint32(),i=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}void 0===window.Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var o=new T(new Zlib.Inflate(new Uint8Array(e.getArrayBuffer(i))).decompress().buffer);switch(t){case"b":case"c":return o.getBooleanArray(a);case"d":return o.getFloat64Array(a);case"f":return o.getFloat32Array(a);case"i":return o.getInt32Array(a);case"l":return o.getInt64Array(a)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}),Object.assign(T.prototype,{getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],r=0;r=0&&(t=t.slice(0,a)),n.LoaderUtils.decodeText(t)}}),Object.assign(P.prototype,{add:function(e,t){this[e]=t}}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.splitLayer=!1};n.prototype.load=function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},n.prototype.parse=function(e){var t={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},r=[],n=void 0,i=new a.LineBasicMaterial({color:16711680});i.name="path";var o=new a.LineBasicMaterial({color:65280});function s(e){n={vertex:[],pathVertex:[],z:e.z},r.push(n)}function l(e,r){return t.relative?r:r-e}function u(e,r){return t.relative?e+r:r}o.name="extruded";for(var c,f,d=e.replace(/;.+/g,"").split("\n"),h=0;h0&&(g.extruding=l(t.e,g.e)>0,null!=n&&g.z==n.z||s(g)),c=t,f=g,void 0===n&&s(c),g.extruding?(n.vertex.push(c.x,c.y,c.z),n.vertex.push(f.x,f.y,f.z)):(n.pathVertex.push(c.x,c.y,c.z),n.pathVertex.push(f.x,f.y,f.z)),t=g}else if("G2"===m||"G3"===m)console.warn("THREE.GCodeLoader: Arc command not supported");else if("G90"===m)t.relative=!1;else if("G91"===m)t.relative=!0;else if("G92"===m){(g=t).x=void 0!==v.x?v.x:g.x,g.y=void 0!==v.y?v.y:g.y,g.z=void 0!==v.z?v.z:g.z,g.e=void 0!==v.e?v.e:g.e,t=g}else console.warn("THREE.GCodeLoader: Command not supported:"+m)}function y(e,t){var r=new a.BufferGeometry;r.addAttribute("position",new a.Float32BufferAttribute(e,3));var n=new a.LineSegments(r,t?o:i);n.name="layer"+h,b.add(n)}var b=new a.Group;if(b.name="gcode",this.splitLayer)for(h=0;h>16&32768,i=a>>12&2047,o=a>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&a):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)}return function(e,t,a,n){var i=e[t+3],o=Math.pow(2,i-128)/255;a[n+0]=r(e[t+0]*o),a[n+1]=r(e[t+1]*o),a[n+2]=r(e[t+2]*o)}}(),l=new n.CubeTexture;l.type=e,l.encoding=e===n.UnsignedByteType?n.RGBEEncoding:n.LinearEncoding,l.format=e===n.UnsignedByteType?n.RGBAFormat:n.RGBFormat,l.minFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.magFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.generateMipmaps=l.encoding!==n.RGBEEncoding,l.anisotropy=0;var u=this.hdrLoader,c=0;function f(r,a,i,f){var d=new n.FileLoader(this.manager);d.setResponseType("arraybuffer"),d.load(t[r],(function(t){c++;var i=u._parser(t);if(i){if(e===n.FloatType){for(var f=i.data.length/4*3,d=new Float32Array(f),h=0;h>8&65280|e>>24&255},e.prototype.mipmaps=function(t){for(var r=[],a=e.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight,o=t?this.numberOfMipmapLevels:1,s=0;s0?o():t(n.mergeVmds(i))}),r,a)}()},s.prototype.loadAudio=function(e,t,r,n){var i=new a.AudioListener,o=new a.Audio(i);new a.AudioLoader(this.manager).load(e,(function(e){o.setBuffer(e),t(o,i)}),r,n)},s.prototype.loadVpd=function(e,t,r,a,n){var i=this;(n&&"unicode"===n.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this)(e,(function(e){t(i.parseVpd(e))}),r,a)},s.prototype.parseModel=function(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}},s.prototype.parsePmd=function(e){return this.parser.parsePmd(e,!0)},s.prototype.parsePmx=function(e){return this.parser.parsePmx(e,!0)},s.prototype.parseVmd=function(e){return this.parser.parseVmd(e,!0)},s.prototype.parseVpd=function(e){return this.parser.parseVpd(e,!0)},s.prototype.mergeVmds=function(e){return this.parser.mergeVmds(e)},s.prototype.pourVmdIntoModel=function(e,t,r){this.createAnimation(e,t,r)},s.prototype.pourVmdIntoCamera=function(e,t,r){var n=new s.DataCreationHelper;!function(){for(var i,o,l=n.createOrderedMotionArray(t.cameras),u=[],c=[],f=[],d=[],h=[],p=[],m=[],v=[],g=[],y=new a.Quaternion,b=new a.Euler,w=new a.Vector3,x=new a.Vector3,_=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},A=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},E=function(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();for(var o=n.length/r.length,l=3===o?12:4,u=1,c=2,f=r.length;cu){r[u]=r[c];for(d=0;d=a?r.skinIndices[a]:0);for(a=0;a<4;a++)l.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t=0&&(l.limitation=new a.Vector3(1,0,0)),s.links.push(l)}t.push(s)}else for(r=0;r=0?c:u);var p=h.load(s,(function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,n=t.height;f.width=r,f.height=n,d.clearRect(0,0,r,n),d.translate(r/2,n/2),d.rotate(.5*Math.PI),d.translate(-r/2,-n/2),d.drawImage(t,0,0),e.image=d.getImageData(0,0,r,n)}e.flipY=!1,e.wrapS=a.RepeatWrapping,e.wrapT=a.RepeatWrapping;for(var i=0;i=0?(x.push(w.slice(0,_)),x.push(w.slice(_+1))):x.push(w);for(var A=0;A=0||E.indexOf(".spa")>=0?(b.envMap=m(E,{sphericalReflectionMapping:!0}),E.indexOf(".sph")>=0?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation):b.map=m(E)}}}else{if(-1!==y.textureIndex){var E=e.textures[y.textureIndex];b.map=m(E)}if(-1!==y.envTextureIndex&&(1===y.envFlag||2==y.envFlag)){E=e.textures[y.envTextureIndex];b.envMap=m(E,{sphericalReflectionMapping:!0}),1===y.envFlag?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation}}var S=void 0===b.map?1:.2;b.emissive=new a.Color(y.ambient[0]*S,y.ambient[1]*S,y.ambient[2]*S),p.push(b)}for(g=0;g0,y.morphTargets=o.morphTargets.length>0,y.lights=!0,y.side="pmx"===e.metadata.format&&1==(1&T.flag)?a.DoubleSide:M.side,y.transparent=M.transparent,y.fog=!0,y.blending=a.CustomBlending,y.blendSrc=a.SrcAlphaFactor,y.blendDst=a.OneMinusSrcAlphaFactor,y.blendSrcAlpha=a.SrcAlphaFactor,y.blendDstAlpha=a.DstAlphaFactor,void 0!==M.map){y.faceOffset=M.faceOffset,y.faceNum=M.faceNum,y.map=v(M.map,l),function(e){e.map.readyCallbacks.push((function(t){function r(e,t){var r=e.width,a=e.height,n=Math.round(t.x*r)%r,i=Math.round(t.y*a)%a;n<0&&(n+=r),i<0&&(i+=a);var o=i*r+n;return e.data[4*o+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),n=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var n=e.width,i=e.height;if(e.data.length/(n*i)!=4)return!1;for(var o=0;o=this.duration;)this.currentTime-=this.duration;return!(this.currentTime=this.duration}},a.MMDGrantSolver=function(e){this.mesh=e},a.MMDGrantSolver.prototype={constructor:a.MMDGrantSolver,update:(o=new a.Quaternion,function(){for(var e=0;e0)}},setAnimations:function(){for(var e=0;e0&&0!==e.action._clip.tracks[0].name.indexOf(".bones")||(e.target._root.looped=!0)}));for(var t=!1,r=!1,n=0;n0&&0===i.tracks[0].name.indexOf(".morphTargetInfluences")?r||(o.play(),r=!0):t||(o.play(),t=!0)}t&&(e.ikSolver=new a.CCDIKSolver(e),void 0!==e.geometry.grants&&(e.grantSolver=new a.MMDGrantSolver(e)))}},setCameraAnimation:function(e){void 0!==e.animations&&(e.mixer=new a.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())},unifyAnimationDuration:function(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,n=0;n0,i=!0,s={};var l=function(e,n){null==n&&(n=1);var o=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,o=2;break;case"sshort":s=Int16Array,o=2;break;case"uint":s=Uint32Array,o=4;break;case"sint":s=Int32Array,o=4;break;case"float":s=Float32Array,o=4;break;case"complex":case"double":s=Float64Array,o=8}var l=new s(t.slice(r,r+=n*o));return a!=i&&(l=function(e,t){for(var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=0;ai;n--,i++){var o=r[i];r[i]=r[n],r[n]=o}return e}(l,o)),1==n?l[0]:l}("uchar",e.byteLength),u=l.length,c=null,f=0;for(p=1;p13)&&32!==a?n+=String.fromCharCode(a):(""!==n&&(l[u]=c(n,o),u++),n="");return""!==n&&(l[u]=c(n,o),u++),l}(t);else if("raw"===s.encoding){for(var h=new Uint8Array(t.length),p=0;p0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,n=this.object.geometry.vertices;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){var a=this.normals,n=this.object.geometry.normals;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addColor:function(e,t,r){var a=this.colors,n=this.object.geometry.colors;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addUV:function(e,t,r){var a=this.uvs,n=this.object.geometry.uvs;n.push(a[e+0],a[e+1]),n.push(a[t+0],a[t+1]),n.push(a[r+0],a[r+1])},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,a,n,i,o,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),f=this.parseVertexIndex(t,u),d=this.parseVertexIndex(r,u);if(this.addVertex(c,f,d),void 0!==a&&""!==a){var h=this.uvs.length;c=this.parseUVIndex(a,h),f=this.parseUVIndex(n,h),d=this.parseUVIndex(i,h),this.addUV(c,f,d)}if(void 0!==o&&""!==o){var p=this.normals.length;c=this.parseNormalIndex(o,p),f=o===s?c:this.parseNormalIndex(s,p),d=o===l?c:this.parseNormalIndex(l,p),this.addNormal(c,f,d)}this.colors.length>0&&this.addColor(c,f,d)},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,r=0,a=e.length;r0){var w=b.split("/");v.push(w)}}var x=v[0];for(g=1,y=v.length-1;g1){var C=c[1].trim().toLowerCase();o.object.smooth="0"!==C&&"off"!==C}else o.object.smooth=!0;(Y=o.object.currentMaterial())&&(Y.smooth=o.object.smooth)}o.finalize();var R=new a.Group;R.materialLibraries=[].concat(o.materialLibraries);for(d=0,h=o.objects.length;d0?B.addAttribute("normal",new a.Float32BufferAttribute(I.normals,3)):B.computeVertexNormals(),I.colors.length>0&&(j=!0,B.addAttribute("color",new a.Float32BufferAttribute(I.colors,3))),I.uvs.length>0&&B.addAttribute("uv",new a.Float32BufferAttribute(I.uvs,2));for(var V,z=[],G=0,H=N.length;G1){for(G=0,H=N.length;Gf){f=d;var r='Download of "'+e.url+'": '+(100*d).toFixed(2)+"%";u.onProgress("progressLoad",r,d)}}}var h=new a.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.load(e.url,c,i,o)}},r.prototype.run=function(e,r){this._applyPrepData(e);var a=e.checkResourceDescriptorFiles(e.resources,[{ext:"obj",type:"ArrayBuffer",ignore:!1},{ext:"mtl",type:"String",ignore:!1},{ext:"zip",type:"String",ignore:!0}]);t.isValid(r)&&(this.terminateWorkerOnLoad=!1,this.workerSupport=r,this.logging.enabled=this.workerSupport.logging.enabled,this.logging.debug=this.workerSupport.logging.debug);var n=this;this._loadMtl(a.mtl,(function(t){null!==t&&n.meshBuilder.setMaterials(t),n._loadObj(a.obj,n.callbacks.onLoad,null,null,n.callbacks.onMeshAlter,e.useAsync)}),e.crossOrigin,e.materialOptions)},r.prototype._applyPrepData=function(e){t.isValid(e)&&(this.setLogging(e.logging.enabled,e.logging.debug),this.setModelName(e.modelName),this.setStreamMeshesTo(e.streamMeshesTo),this.meshBuilder.setMaterials(e.materials),this.setUseIndices(e.useIndices),this.setDisregardNormals(e.disregardNormals),this.setMaterialPerSmoothingGroup(e.materialPerSmoothingGroup),this._setCallbacks(e.getCallbacks()))},r.prototype.parse=function(e){if(!t.isValid(e))return console.warn("Provided content is not a valid ArrayBuffer or String."),this.loaderRootNode;this.logging.enabled&&console.time("OBJLoader2 parse: "+this.modelName),this.meshBuilder.init();var r=new o;r.setLogging(this.logging.enabled,this.logging.debug),r.setMaterialPerSmoothingGroup(this.materialPerSmoothingGroup),r.setUseIndices(this.useIndices),r.setDisregardNormals(this.disregardNormals),r.setMaterials(this.meshBuilder.getMaterials());var a=this;r.setCallbackMeshBuilder((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}));if(r.setCallbackProgress((function(e,t){a.onProgress("progressParse",e,t)})),e instanceof ArrayBuffer||e instanceof Uint8Array)this.logging.enabled&&console.info("Parsing arrayBuffer..."),r.parse(e);else{if(!("string"==typeof e||e instanceof String))throw"Provided content was neither of type String nor Uint8Array! Aborting...";this.logging.enabled&&console.info("Parsing text..."),r.parseText(e)}return this.logging.enabled&&console.timeEnd("OBJLoader2 parse: "+this.modelName),this.loaderRootNode},r.prototype.parseAsync=function(e,r){var a=this,n=!1,i=function(){r({detail:{loaderRootNode:a.loaderRootNode,modelName:a.modelName,instanceNo:a.instanceNo}}),n&&a.logging.enabled&&console.timeEnd("OBJLoader2 parseAsync: "+a.modelName)};t.isValid(e)?n=!0:(console.warn("Provided content is not a valid ArrayBuffer."),i()),n&&this.logging.enabled&&console.time("OBJLoader2 parseAsync: "+this.modelName),this.meshBuilder.init();this.workerSupport.validate((function(e,r){var a="";return a+="/**\n",a+=" * This code was constructed by OBJLoader2 buildCode.\n",a+=" */\n\n",a+="THREE = { LoaderSupport: {} };\n\n",a+=e("LoaderSupport.Validator",t),a+=r("Parser",o)}),"Parser"),this.workerSupport.setCallbacks((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}),i),a.terminateWorkerOnLoad&&this.workerSupport.setTerminateRequested(!0);var s={},l=this.meshBuilder.getMaterials();for(var u in l)s[u]=u;this.workerSupport.run({params:{useAsync:!0,materialPerSmoothingGroup:this.materialPerSmoothingGroup,useIndices:this.useIndices,disregardNormals:this.disregardNormals},logging:{enabled:this.logging.enabled,debug:this.logging.debug},materials:{materials:s},data:{input:e,options:null}})};var o=function(){function e(){this.callbackProgress=null,this.callbackMeshBuilder=null,this.contentRef=null,this.legacyMode=!1,this.materials={},this.useAsync=!1,this.materialPerSmoothingGroup=!1,this.useIndices=!1,this.disregardNormals=!1,this.vertices=[],this.colors=[],this.normals=[],this.uvs=[],this.rawMesh={objectName:"",groupName:"",activeMtlName:"",mtllibName:"",faceType:-1,subGroups:[],subGroupInUse:null,smoothingGroup:{splitMaterials:!1,normalized:-1,real:-1},counts:{doubleIndicesCount:0,faceCount:0,mtlCount:0,smoothingGroupCount:0}},this.inputObjectCount=1,this.outputObjectCount=1,this.globalCounts={vertices:0,faces:0,doubleIndicesCount:0,lineByte:0,currentByte:0,totalBytes:0},this.logging={enabled:!0,debug:!1}}return e.prototype.resetRawMesh=function(){this.rawMesh.subGroups=[],this.rawMesh.subGroupInUse=null,this.rawMesh.smoothingGroup.normalized=-1,this.rawMesh.smoothingGroup.real=-1,this.pushSmoothingGroup(1),this.rawMesh.counts.doubleIndicesCount=0,this.rawMesh.counts.faceCount=0,this.rawMesh.counts.mtlCount=0,this.rawMesh.counts.smoothingGroupCount=0},e.prototype.setUseAsync=function(e){this.useAsync=e},e.prototype.setMaterialPerSmoothingGroup=function(e){this.materialPerSmoothingGroup=e},e.prototype.setUseIndices=function(e){this.useIndices=e},e.prototype.setDisregardNormals=function(e){this.disregardNormals=e},e.prototype.setMaterials=function(e){this.materials=n.default.Validator.verifyInput(e,this.materials),this.materials=n.default.Validator.verifyInput(this.materials,{})},e.prototype.setCallbackMeshBuilder=function(e){if(!n.default.Validator.isValid(e))throw'Unable to run as no "MeshBuilder" callback is set.';this.callbackMeshBuilder=e},e.prototype.setCallbackProgress=function(e){this.callbackProgress=e},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.configure=function(){if(this.pushSmoothingGroup(1),this.logging.enabled){var e=Object.keys(this.materials),t="OBJLoader2.Parser configuration:"+(e.length>0?"\n\tmaterialNames:\n\t\t- "+e.join("\n\t\t- "):"\n\tmaterialNames: None")+"\n\tuseAsync: "+this.useAsync+"\n\tmaterialPerSmoothingGroup: "+this.materialPerSmoothingGroup+"\n\tuseIndices: "+this.useIndices+"\n\tdisregardNormals: "+this.disregardNormals+"\n\tcallbackMeshBuilderName: "+this.callbackMeshBuilder.name+"\n\tcallbackProgressName: "+this.callbackProgress.name;console.info(t)}},e.prototype.parse=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parse"),this.configure();var t=new Uint8Array(e);this.contentRef=t;var r=t.byteLength;this.globalCounts.totalBytes=r;for(var a,n=new Array(128),i="",o=0,s=0,l=0;l0&&(n[o++]=i),i="";break;case 47:i.length>0&&(n[o++]=i),s++,i="";break;case 10:i.length>0&&(n[o++]=i),i="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=l,this.processLine(n,o,s),o=0,s=0;break;case 13:break;default:i+=String.fromCharCode(a)}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parse")},e.prototype.parseText=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parseText"),this.configure(),this.legacyMode=!0,this.contentRef=e;var t=e.length;this.globalCounts.totalBytes=t;for(var r,a=new Array(128),n="",i=0,o=0,s=0;s0&&(a[i++]=n),n="";break;case"/":n.length>0&&(a[i++]=n),o++,n="";break;case"\n":n.length>0&&(a[i++]=n),n="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=s,this.processLine(a,i,o),i=0,o=0;break;case"\r":break;default:n+=r}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parseText")},e.prototype.processLine=function(e,t,r){if(!(t<1)){var a,n,i,o,s=function(e,t,r,a){var n="";if(a>r){var i;if(t)for(i=r;i4&&(this.colors.push(parseFloat(e[4])),this.colors.push(parseFloat(e[5])),this.colors.push(parseFloat(e[6])));break;case"vt":this.uvs.push(parseFloat(e[1])),this.uvs.push(parseFloat(e[2]));break;case"vn":this.normals.push(parseFloat(e[1])),this.normals.push(parseFloat(e[2])),this.normals.push(parseFloat(e[3]));break;case"f":if(a=t-1,0===r)for(this.checkFaceType(0),i=2,n=a;i0?n-1:n+a.vertices.length/3),o=a.rawMesh.subGroupInUse.vertices;o.push(a.vertices[i++]),o.push(a.vertices[i++]),o.push(a.vertices[i]);var s=a.colors.length>0?i:null;if(null!==s){var l=a.rawMesh.subGroupInUse.colors;l.push(a.colors[s++]),l.push(a.colors[s++]),l.push(a.colors[s])}if(t){var u=parseInt(t),c=2*(u>0?u-1:u+a.uvs.length/2),f=a.rawMesh.subGroupInUse.uvs;f.push(a.uvs[c++]),f.push(a.uvs[c])}if(r){var d=parseInt(r),h=3*(d>0?d-1:d+a.normals.length/3),p=a.rawMesh.subGroupInUse.normals;p.push(a.normals[h++]),p.push(a.normals[h++]),p.push(a.normals[h])}};if(this.useIndices){var o=e+(t?"_"+t:"_n")+(r?"_"+r:"_n"),s=this.rawMesh.subGroupInUse.indexMappings[o];n.default.Validator.isValid(s)?this.rawMesh.counts.doubleIndicesCount++:(s=this.rawMesh.subGroupInUse.vertices.length/3,i(),this.rawMesh.subGroupInUse.indexMappings[o]=s,this.rawMesh.subGroupInUse.indexMappingsCount++),this.rawMesh.subGroupInUse.indices.push(s)}else i();this.rawMesh.counts.faceCount++},e.prototype.createRawMeshReport=function(e){return"Input Object number: "+e+"\n\tObject name: "+this.rawMesh.objectName+"\n\tGroup name: "+this.rawMesh.groupName+"\n\tMtllib name: "+this.rawMesh.mtllibName+"\n\tVertex count: "+this.vertices.length/3+"\n\tNormal count: "+this.normals.length/3+"\n\tUV count: "+this.uvs.length/2+"\n\tSmoothingGroup count: "+this.rawMesh.counts.smoothingGroupCount+"\n\tMaterial count: "+this.rawMesh.counts.mtlCount+"\n\tReal MeshOutputGroup count: "+this.rawMesh.subGroups.length},e.prototype.finalizeRawMesh=function(){var e,t,r=[],a=0,n=0,i=0,o=0,s=0,l=0;for(var u in this.rawMesh.subGroups)if((e=this.rawMesh.subGroups[u]).vertices.length>0){if((t=e.indices).length>0&&n>0)for(var c in t)t[c]=t[c]+n;r.push(e),a+=e.vertices.length,n+=e.indexMappingsCount,i+=e.indices.length,o+=e.colors.length,l+=e.uvs.length,s+=e.normals.length}var f=null;return r.length>0&&(f={name:""!==this.rawMesh.groupName?this.rawMesh.groupName:this.rawMesh.objectName,subGroups:r,absoluteVertexCount:a,absoluteIndexCount:i,absoluteColorCount:o,absoluteNormalCount:s,absoluteUvCount:l,faceCount:this.rawMesh.counts.faceCount,doubleIndicesCount:this.rawMesh.counts.doubleIndicesCount}),f},e.prototype.processCompletedMesh=function(){var e=this.finalizeRawMesh();if(n.default.Validator.isValid(e)){if(this.colors.length>0&&this.colors.length!==this.vertices.length)throw"Vertex Colors were detected, but vertex count and color count do not match!";this.logging.enabled&&this.logging.debug&&console.debug(this.createRawMeshReport(this.inputObjectCount)),this.inputObjectCount++,this.buildMesh(e);var t=this.globalCounts.currentByte/this.globalCounts.totalBytes;return this.callbackProgress("Completed [o: "+this.rawMesh.objectName+" g:"+this.rawMesh.groupName+"] Total progress: "+(100*t).toFixed(2)+"%",t),this.resetRawMesh(),!0}return!1},e.prototype.buildMesh=function(e){var t=e.subGroups,r=new Float32Array(e.absoluteVertexCount);this.globalCounts.vertices+=e.absoluteVertexCount/3,this.globalCounts.faces+=e.faceCount,this.globalCounts.doubleIndicesCount+=e.doubleIndicesCount;var a,i,o,s,l,u,c,f=e.absoluteIndexCount>0?new Uint32Array(e.absoluteIndexCount):null,d=e.absoluteColorCount>0?new Float32Array(e.absoluteColorCount):null,h=e.absoluteNormalCount>0?new Float32Array(e.absoluteNormalCount):null,p=e.absoluteUvCount>0?new Float32Array(e.absoluteUvCount):null,m=n.default.Validator.isValid(d),v=[],g=t.length>1,y=0,b=[],w=[],x=0,_=0,A=0,E=0,S=0,M=0,T=0;for(var P in t)if(t.hasOwnProperty(P)){if(c=(a=t[P]).materialName,u=this.rawMesh.faceType<4?c+(m?"_vertexColor":"")+(0===a.smoothingGroup?"_flat":""):6===this.rawMesh.faceType?"defaultPointMaterial":"defaultLineMaterial",s=this.materials[c],l=this.materials[u],!n.default.Validator.isValid(s)&&!n.default.Validator.isValid(l)){var F=m?"defaultVertexColorMaterial":"defaultMaterial";s=this.materials[F],this.logging.enabled&&console.warn('object_group "'+a.objectName+"_"+a.groupName+'" was defined with unresolvable material "'+c+'"! Assigning "'+F+'".'),(c=F)===u&&(l=s,u=F)}if(!n.default.Validator.isValid(l)){var O={materialNameOrg:c,materialName:u,materialProperties:{vertexColors:m?2:0,flatShading:0===a.smoothingGroup}},L={cmd:"materialData",materials:{materialCloneInstructions:O}};this.callbackMeshBuilder(L),this.useAsync&&(this.materials[u]=O)}if(g?((i=b[u])||(i=y,b[u]=y,v.push(u),y++),o={start:M,count:T=this.useIndices?a.indices.length:a.vertices.length/3,index:i},w.push(o),M+=T):v.push(u),r.set(a.vertices,x),x+=a.vertices.length,f&&(f.set(a.indices,_),_+=a.indices.length),d&&(d.set(a.colors,A),A+=a.colors.length),h&&(h.set(a.normals,E),E+=a.normals.length),p&&(p.set(a.uvs,S),S+=a.uvs.length),this.logging.enabled&&this.logging.debug){var C=n.default.Validator.isValid(i)?"\n\t\tmaterialIndex: "+i:"",R="\tOutput Object no.: "+this.outputObjectCount+"\n\t\tgroupName: "+a.groupName+"\n\t\tIndex: "+a.index+"\n\t\tfaceType: "+this.rawMesh.faceType+"\n\t\tmaterialName: "+a.materialName+"\n\t\tsmoothingGroup: "+a.smoothingGroup+C+"\n\t\tobjectName: "+a.objectName+"\n\t\t#vertices: "+a.vertices.length/3+"\n\t\t#indices: "+a.indices.length+"\n\t\t#colors: "+a.colors.length/3+"\n\t\t#uvs: "+a.uvs.length/2+"\n\t\t#normals: "+a.normals.length/3;console.debug(R)}}this.outputObjectCount++,this.callbackMeshBuilder({cmd:"meshData",progress:{numericalValue:this.globalCounts.currentByte/this.globalCounts.totalBytes},params:{meshName:e.name},materials:{multiMaterial:g,materialNames:v,materialGroups:w},buffers:{vertices:r,indices:f,colors:d,normals:h,uvs:p},geometryType:this.rawMesh.faceType<4?0:6===this.rawMesh.faceType?2:1},[r.buffer],n.default.Validator.isValid(f)?[f.buffer]:null,n.default.Validator.isValid(d)?[d.buffer]:null,n.default.Validator.isValid(h)?[h.buffer]:null,n.default.Validator.isValid(p)?[p.buffer]:null)},e.prototype.finalizeParsing=function(){if(this.logging.enabled&&console.info("Global output object count: "+this.outputObjectCount),this.processCompletedMesh()&&this.logging.enabled){var e="Overall counts: \n\tVertices: "+this.globalCounts.vertices+"\n\tFaces: "+this.globalCounts.faces+"\n\tMultiple definitions: "+this.globalCounts.doubleIndicesCount;console.info(e)}},e}();return r.prototype.loadMtl=function(e,t,r,a,i){var o=new n.default.ResourceDescriptor(e,"MTL");o.setContent(t),this._loadMtl(o,r,a,i)},r.prototype._loadMtl=function(e,r,n,o){void 0===i.default&&console.error('"THREE.MTLLoader" is not available. "THREE.OBJLoader2" requires it for loading MTL files.'),t.isValid(e)&&this.logging.enabled&&console.time("Loading MTL: "+e.name);var s=[],l=this,u=function(a){var n=[];if(t.isValid(a))for(var i in a.preload(),n=a.materials)n.hasOwnProperty(i)&&(s[i]=n[i]);t.isValid(e)&&l.logging.enabled&&console.timeEnd("Loading MTL: "+e.name),r(s,a)};if(t.isValid(e)&&(t.isValid(e.content)||t.isValid(e.url))){var c=new i.default(this.manager);if(n=t.verifyInput(n,"anonymous"),c.setCrossOrigin(n),c.setPath(e.path),t.isValid(o)&&c.setMaterialOptions(o),t.isValid(e.content))u(t.isValid(e.content)?c.parse(e.content):null);else if(t.isValid(e.url)){new a.FileLoader(this.manager).load(e.url,(function(t){e.content=t,u(c.parse(t))}),this._onProgress,this._onError)}}else u()},r}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.littleEndian=!0};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(e,(function(r){t(i.parse(r,e))}),r,n)},parse:function(e,t){var r=a.LoaderUtils.decodeText(e),n=function(e){var t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),a=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=a[1],t.headerLen=a[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(var n=0,i=t.fields.length;n0&&v.addAttribute("position",new a.Float32BufferAttribute(i,3)),o.length>0&&v.addAttribute("normal",new a.Float32BufferAttribute(o,3)),s.length>0&&v.addAttribute("color",new a.Float32BufferAttribute(s,3)),v.computeBoundingSphere();var g=new a.PointsMaterial({size:.005});s.length>0?g.vertexColors=!0:g.color.setHex(16777215*Math.random());var y=new a.Points(v,g),b=t.split("").reverse().join("");return b=(b=/([^\/]*)/.exec(b))[1].split("").reverse().join(""),y.name=b,y}console.error("THREE.PCDLoader: binary_compressed files are not supported")}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function n(e,t){var r=parseInt(m[v].substr(e,t));if(r){var a=function(e,t){return"s"+Math.min(e,t)+"e"+Math.max(e,t)}(y,r);void 0===p[a]&&(d.push([y-1,r-1,1]),p[a]=d.length-1)}}for(var i,o,s,l,u,c={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},f=[],d=[],h={},p={},m=e.split("\n"),v=0,g=m.length;v=t.elements[u].count&&(u++,c=0);var h=n(t.elements[u].properties,d);s(a,t.elements[u].name,h),c++}}return o(a)}function o(e){var t=new a.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.addAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.addAttribute("normal",new a.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.addAttribute("uv",new a.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.addAttribute("color",new a.Float32BufferAttribute(e.colors,3)),t.computeBoundingSphere(),t}function s(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){var a=r.vertex_indices||r.vertex_index;3===a.length?e.indices.push(a[0],a[1],a[2]):4===a.length&&(e.indices.push(a[0],a[1],a[3]),e.indices.push(a[1],a[2],a[3]))}}function l(e,t,r,a){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,a),2];case"uint16":case"ushort":return[e.getUint16(t,a),2];case"int32":case"int":return[e.getInt32(t,a),4];case"uint32":case"uint":return[e.getUint32(t,a),4];case"float32":case"float":return[e.getFloat32(t,a),4];case"float64":case"double":return[e.getFloat64(t,a),8]}}function u(e,t,r,a){for(var n,i={},o=0,s=0;s>7&1),s=n>>6&1,l=1==(n>>5&1),u=31&n,c=0,f=0;if(l?(c=(t[2]<<16)+(t[3]<<8)+t[4],f=(t[5]<<16)+(t[6]<<8)+t[7]):(c=t[2]+(t[3]<<8)+(t[4]<<16),f=t[5]+(t[6]<<8)+(t[7]<<16)),0===a)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==a)throw new Error("PRWM decoder: Unsupported format version: "+a);if(!o){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==f)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}var d,h,p,m,v,g,y,b,w=8,x={};for(b=0;b>7&1,m=1+(n>>4&3),w++,g=i(e,v=r[15&n],w=4*Math.ceil(w/4),m*c,l),w+=v.BYTES_PER_ELEMENT*m*c,x[d]={type:p,cardinality:m,values:g}}return w=4*Math.ceil(w/4),y=null,o&&(y=i(e,1===s?Uint32Array:Uint16Array,w,f,l)),{version:a,attributes:x,indices:y}}(e),s=Object.keys(o.attributes),l=new a.BufferGeometry;for(n=0;n0;return 25===h?(r=p?a.RGBA_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,t=4):24===h?(r=p?a.RGBA_PVRTC_2BPPV1_Format:a.RGB_PVRTC_2BPPV1_Format,t=2):console.error("THREE.PVRLoader: Unknown PVR format:",h),e.dataPtr=o,e.bpp=t,e.format=r,e.width=l,e.height=s,e.numSurfaces=d,e.numMipmaps=u+1,e.isCubemap=6===d,n._extract(e)},n._extract=function(e){var t,r={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},a=e.buffer,n=e.dataPtr,i=e.bpp,o=e.numSurfaces,s=0,l=0,u=0,c=0,f=0;2===i?(l=8,u=4):(l=4,u=4),t=l*u*i/8,r.mipmaps.length=e.numMipmaps*o;for(var d=0;d>d,p=e.height>>d;(c=h/l)<2&&(c=2),(f=p/u)<2&&(f=2),s=c*f*t;for(var m=0;m>5&31)/31,n=(_>>10&31)/31):(t=o,r=s,n=l)}for(var A=1;A<=3;A++){var E=y+12*A;m.push(c.getFloat32(E,!0)),m.push(c.getFloat32(E+4,!0)),m.push(c.getFloat32(E+8,!0)),v.push(b,w,x),d&&i.push(t,r,n)}}return p.addAttribute("position",new a.BufferAttribute(new Float32Array(m),3)),p.addAttribute("normal",new a.BufferAttribute(new Float32Array(v),3)),d&&(p.addAttribute("color",new a.BufferAttribute(new Float32Array(i),3)),p.hasColors=!0,p.alpha=u),p}(r):function(e){for(var t,r=new a.BufferGeometry,n=/facet([\s\S]*?)endfacet/g,i=0,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+o+o+o,"g"),l=new RegExp("normal"+o+o+o,"g"),u=[],c=[],f=new a.Vector3;null!==(t=n.exec(e));){for(var d=0,h=0,p=t[0];null!==(t=l.exec(p));)f.x=parseFloat(t[1]),f.y=parseFloat(t[2]),f.z=parseFloat(t[3]),h++;for(;null!==(t=s.exec(p));)u.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),c.push(f.x,f.y,f.z),d++;1!==h&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==d&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}return r.addAttribute("position",new a.Float32BufferAttribute(u,3)),r.addAttribute("normal",new a.Float32BufferAttribute(c,3)),r}("string"!=typeof(t=e)?a.LoaderUtils.decodeText(new Uint8Array(t)):t)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e,t,a,n,i,o,s,l){n=n*Math.PI/180,t=Math.abs(t),a=Math.abs(a);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,f=Math.cos(n)*u+Math.sin(n)*c,d=-Math.sin(n)*u+Math.cos(n)*c,h=t*t,p=a*a,m=f*f,v=d*d,g=m/h+v/p;if(g>1){var y=Math.sqrt(g);h=(t*=y)*t,p=(a*=y)*a}var b=h*v+p*m,w=(h*p-b)/b,x=Math.sqrt(Math.max(0,w));i===o&&(x=-x);var _=x*t*d/a,A=-x*a*f/t,E=Math.cos(n)*_-Math.sin(n)*A+(s.x+l.x)/2,S=Math.sin(n)*_+Math.cos(n)*A+(s.y+l.y)/2,M=r(1,0,(f-_)/t,(d-A)/a),T=r((f-_)/t,(d-A)/a,(-f-_)/t,(-d-A)/a)%(2*Math.PI);e.currentPath.absellipse(E,S,t,a,M,M+T,0===o,n)}function r(e,t,r,a){var n=e*r+t*a,i=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+a*a),o=Math.acos(Math.max(-1,Math.min(1,n/i)));return e*a-t*r<0&&(o=-o),o}function n(e,t){return t=Object.assign({},t),e.hasAttribute("fill")&&(t.fill=e.getAttribute("fill")),""!==e.style.fill&&(t.fill=e.style.fill),t}function i(e){return"none"!==e.fill&&"transparent"!==e.fill}function o(e,t){return 2*e-(t-e)}function s(e){for(var t=e.split(/[\s,]+|(?=\s?[+\-])/),r=0;r0){var p=[];for(u=0;u=t.end)return 0;this.position=t.cur;try{var r=this.readChunk(e);return t.cur+=r.size,r.id}catch(e){return this.debugMessage("Unable to read chunk at "+this.position),0}},resetPosition:function(){this.position-=6},readByte:function(e){var t=e.getUint8(this.position,!0);return this.position+=1,t},readFloat:function(e){try{var t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}},readInt:function(e){var t=e.getInt32(this.position,!0);return this.position+=4,t},readShort:function(e){var t=e.getInt16(this.position,!0);return this.position+=2,t},readDWord:function(e){var t=e.getUint32(this.position,!0);return this.position+=4,t},readWord:function(e){var t=e.getUint16(this.position,!0);return this.position+=2,t},readString:function(e,t){for(var r="",a=0;a256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case a:case n:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;var g=!1,y=!1,b=!1;switch(v.image_type){case i:g=!0,y=!0;break;case r:y=!0;break;case o:g=!0;break;case a:break;case s:g=!0,b=!0;break;case n:b=!0}var w=document.createElement("canvas");w.width=v.width,w.height=v.height;var x=w.getContext("2d"),_=x.createImageData(v.width,v.height),A=function(e,t,r,a,n){var i,o,s,l;if(o=r.pixel_size>>3,s=r.width*r.height*o,t&&(l=n.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,c,f;i=new Uint8Array(s);for(var d=0,h=new Uint8Array(o);d>u){default:case d:i=0,s=1,m=t,o=0,p=1,g=r;break;case c:i=0,s=1,m=t,o=r-1,p=-1,g=-1;break;case h:i=t-1,s=-1,m=-1,o=0,p=1,g=r;break;case f:i=t-1,s=-1,m=-1,o=r-1,p=-1,g=-1}if(b)switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f++)l=s[f],e[4*(u+d*c)+0]=l,e[4*(u+d*c)+1]=l,e[4*(u+d*c)+2]=l,e[4*(u+d*c)+3]=255}(e,o,p,g,i,s,m,a);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=2)e[4*(l+f*u)+0]=s[c+0],e[4*(l+f*u)+1]=s[c+0],e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+3]=s[c+1]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s,l){var u,c,f,d=l,h=0,p=v.width;for(f=t;f!==a;f+=r)for(c=n;c!==o;c+=i,h++)u=s[h],e[4*(c+p*f)+3]=255,e[4*(c+p*f)+2]=d[3*u+0],e[4*(c+p*f)+1]=d[3*u+1],e[4*(c+p*f)+0]=d[3*u+2]}(e,o,p,g,i,s,m,a,n);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f+=2)l=s[f+0]+(s[f+1]<<8),e[4*(u+d*c)+0]=(31744&l)>>7,e[4*(u+d*c)+1]=(992&l)>>2,e[4*(u+d*c)+2]=(31&l)>>3,e[4*(u+d*c)+3]=32768&l?0:255}(e,o,p,g,i,s,m,a);break;case 24:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=3)e[4*(l+f*u)+3]=255,e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2]}(e,o,p,g,i,s,m,a);break;case 32:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=4)e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2],e[4*(l+f*u)+3]=s[c+3]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}}(_.data,v.width,v.height,A.pixel_data,A.palettes);return x.putImageData(_,0,0),w}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.reversed=!1};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){var t,r=[];e.forEach((function(e){"m"===e.type.toLowerCase()?(t=[e],r.push(t)):"z"!==e.type.toLowerCase()&&t.push(e)}));var a=[];return r.forEach((function(e){var t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};a.push(t);for(var r=e.length-1;r>0;r--){var n=e[r];t={type:n.type};void 0!==n.x2&&void 0!==n.y2?(t.x1=n.x2,t.y1=n.y2,t.x2=n.x1,t.y2=n.y1):void 0!==n.x1&&void 0!==n.y1&&(t.x1=n.x1,t.y1=n.y1),t.x=e[r-1].x,t.y=e[r-1].y,a.push(t)}})),a}return"undefined"==typeof opentype?(console.warn("THREE.TTFLoader: The loader requires opentype.js. Make sure it's included before using the loader."),null):function(e,r){for(var a=Math.round,n={},i=1e5/(72*(e.unitsPerEm||2048)),o=0;o-1;o--){var s=i[o];if(/{.*[{\[]/.test(s))(l=s.split("{").join("{\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);else if(/\].*}/.test(s)){var l;(l=s.split("]").join("]\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l)}if(/}.*}/.test(s))(l=s.split("}").join("}\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);/^\b[^\s]+\b$/.test(s.trim())?(i[o+1]=s+" "+i[o+1].trim(),i.splice(o,1)):s.indexOf("coord")>-1&&s.indexOf("[")<0&&s.indexOf("{")<0&&(i[o]+=" Coordinate {}")}var u=i.shift();return/V1.0/.exec(u)?console.warn("THREE.VRMLLoader: V1.0 not supported yet."):/V2.0/.exec(u)&&function(e,n){var i={},o=/(\b|\-|\+)([\d\.e]+)/,s=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g,l=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g;function u(e,t,r,n,i){for(var o=!0===i?1:-1,s=[],l={},u={},c=0;cu.y:m.y>=l.y&&m.y0)for(var d=0;d0&&this.indexes.push(c),c=[]):c.push(parseInt(i[d])));/]/.exec(t)&&(c.length>0&&this.indexes.push(c),c=[],this.isRecordingFaces=!1,e[this.recordingFieldname]=this.indexes)}else if(this.isRecordingPoints){if("Coordinate"==e.nodeType)for(;null!==(i=l.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2]),z:parseFloat(i[3])},this.points.push(n);if("TextureCoordinate"==e.nodeType)for(;null!==(i=s.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2])},this.points.push(n);/]/.exec(t)&&(this.isRecordingPoints=!1,e.points=this.points)}else if(this.isRecordingAngles){if(i.length>0)for(d=0;d-1&&"PointLight"===o.nodeType&&(o.nodeType="AmbientLight");var c=void 0===o.on||o.on,f=void 0!==o.intensity?o.intensity:1,d=new a.Color;if(o.color&&d.copy(o.color),"AmbientLight"===o.nodeType)(l=new a.AmbientLight(d,f)).visible=c,s.add(l);else if("PointLight"===o.nodeType){var h=0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),(l=new a.PointLight(d,f,h)).visible=c,s.add(l)}else if("SpotLight"===o.nodeType){f=1,h=0;var p=Math.PI/3;c=!0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),void 0!==o.cutOffAngle&&(p=o.cutOffAngle),(l=new a.SpotLight(d,f,h,p,0)).visible=c,s.add(l)}else if("Transform"===o.nodeType||"Group"===o.nodeType){if(l=new a.Object3D,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),void 0!==o.translation){var m=o.translation;l.position.set(m.x,m.y,m.z)}if(void 0!==o.rotation){var v=o.rotation;l.quaternion.setFromAxisAngle(new a.Vector3(v.x,v.y,v.z),v.w)}if(void 0!==o.scale){var g=o.scale;l.scale.set(g.x,g.y,g.z)}s.add(l)}else if("Shape"===o.nodeType)l=new a.Mesh,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),s.add(l);else if("Background"===o.nodeType){var y=2e4,b=new a.SphereBufferGeometry(y,20,20),w=new a.MeshBasicMaterial({fog:!1,side:a.BackSide});if(o.skyColor.length>1)u(b,y,o.skyAngle,o.skyColor,!0),w.vertexColors=a.VertexColors;else{var x=o.skyColor[0];w.color.setRGB(x.r,x.b,x.g)}if(n.add(new a.Mesh(b,w)),void 0!==o.groundColor){y=12e3;var _=new a.SphereBufferGeometry(y,20,20,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),A=new a.MeshBasicMaterial({fog:!1,side:a.BackSide,vertexColors:a.VertexColors});u(_,y,o.groundAngle,o.groundColor,!1),n.add(new a.Mesh(_,A))}}else{if(/geometry/.exec(o.string)){if("Box"===o.nodeType){g=o.size;s.geometry=new a.BoxBufferGeometry(g.x,g.y,g.z)}else if("Cylinder"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.radius,o.radius,o.height);else if("Cone"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.topRadius,o.bottomRadius,o.height);else if("Sphere"===o.nodeType)s.geometry=new a.SphereBufferGeometry(o.radius);else if("IndexedFaceSet"===o.nodeType){var E,S,M,T,P,F=new a.BufferGeometry,O=[],L=[];for(B=0,M=o.children.length;B-1){var C=/DEF\s+([^\s]+)/.exec(V.string)[1];i[C]=O.slice(0)}if(V.string.indexOf("USE")>-1){W=/USE\s+([^\s]+)/.exec(V.string)[1];O=i[W]}}}var R=0;if(o.coordIndex){var k=[],I=[];for(E=new a.Vector3,S=new a.Vector2,B=0,M=o.coordIndex.length;B=3&&R0&&F.addAttribute("uv",new a.Float32BufferAttribute(L,2)),F.computeVertexNormals(),F.computeBoundingSphere(),/DEF/.exec(o.string)&&(F.name=/DEF ([^\s]+)/.exec(o.string)[1],i[F.name]=F),s.geometry=F}return}if(/appearance/.exec(o.string)){for(var B=0;B>1^-(1&c),a[n]=s*(l+o),n+=i}},n.prototype.decompressIndices_=function(e,t,r,a,n){for(var i=0,o=0;o>1,p=e.charCodeAt(u+4)+1>>1,m=e.charCodeAt(u+5)+1>>1;l[s++]=n[0]*(c+h),l[s++]=n[1]*(f+p),l[s++]=n[2]*(d+m),l[s++]=n[0]*h,l[s++]=n[1]*p,l[s++]=n[2]*m}return l},n.prototype.decompressMesh=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=u,d=new Float32Array(o*c),h=0;h>1^-(1&f);l[c]+=d,s[t*u+c]=l[c],o[t*u+c]=a[c]*(l[c]+r[c])}},n.prototype.accumulateNormal=function(e,t,r,a,n){var i=a[8*e],o=a[8*e+1],s=a[8*e+2],l=a[8*t],u=a[8*t+1],c=a[8*t+2],f=a[8*r],d=a[8*r+1],h=a[8*r+2];l-=i,f-=i,i=(u-=o)*(h-=s)-(c-=s)*(d-=o),o=c*f-l*h,s=l*d-u*f,n[3*e]+=i,n[3*e+1]+=o,n[3*e+2]+=s,n[3*t]+=i,n[3*t+1]+=o,n[3*t+2]+=s,n[3*r]+=i,n[3*r+1]+=o,n[3*r+2]+=s},n.prototype.decompressMesh2=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=t.codeRange[0],d=3*t.codeRange[2],h=new Uint16Array(d),p=new Int32Array(3*c),m=new Uint16Array(o),v=new Uint16Array(o*c),g=new Float32Array(o*c),y=0,b=0,w=0;w>1^-(1&O))+v[o*A+F]+v[o*E+F]-v[o*S+F];m[F]=L,v[o*y+F]=L,g[o*y+F]=l[F]*(L+s[F])}y++}else this.copyAttrib(o,v,m,P);this.accumulateNormal(A,E,P,v,p)}else{var C=y-(x-_);h[b++]=C,x===_?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,C);var R=y-(x=e.charCodeAt(f++));h[b++]=R,0===x?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,R);var k=y-(x=e.charCodeAt(f++));if(h[b++]=k,0===x){for(F=0;F<5;F++)m[F]=(v[o*C+F]+v[o*R+F])/2;this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++)}else this.copyAttrib(o,v,m,k);this.accumulateNormal(C,R,k,v,p)}}for(w=0;w>1^-(1&j)),g[o*w+6]=U*N+(B>>1^-(1&B)),g[o*w+7]=U*D+(V>>1^-(1&V))}i(a,n,g,h,void 0,t)},n.prototype.downloadMesh=function(e,t,r,a,n){var i=this,s=0;o(e,(function(e){!function(e){for(;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=new s(3*f/4-(i="="===e[f-2]?2:"="===e[f-1]?1:0)),a=i>0?f-4:f;var d=0;for(t=0,r=0;t>16,o[d++]=(65280&n)>>8,o[d++]=255&n;return 2===i?(n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[d++]=255&n):1===i&&(n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[d++]=n>>8&255,o[d++]=255&n),o}function n(e,a){var n,i,s,l,u=0;if("UInt64"===o.attributes.header_type?u=8:"UInt32"===o.attributes.header_type&&(u=4),"binary"===e.attributes.format&&a){var c,f,d,h,p,m;if("Float32"===e.attributes.type)var v=new Float32Array;else if("Int64"===e.attributes.type)v=new Int32Array;f=(c=r(e["#text"]))[0];for(var g=1;g0?3-h%3:0,(p=[]).push(m),d=3*u;for(g=0;g0){r.attributes={};for(var a=0;a0&&(v[g].text=n(v[g],f)),g++;switch(d[h]){case"PointData":var b=parseInt(c.attributes.NumberOfPoints),w=m.attributes.Normals;if(b>0)for(var x=0,_=v.length;x<_;x++)if(w===v[x].attributes.Name){var A=v[x].attributes.NumberOfComponents;(l=new Float32Array(b*A)).set(v[x].text,0)}break;case"Points":if((b=parseInt(c.attributes.NumberOfPoints))>0){A=m.DataArray.attributes.NumberOfComponents;(s=new Float32Array(b*A)).set(m.DataArray.text,0)}break;case"Strips":var E=parseInt(c.attributes.NumberOfStrips);if(E>0){var S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);var T=E+S.length;u=new Uint32Array(3*T-9*E);var P=0;for(x=0,_=E;x<_;x++){for(var F=[],O=0,L=M[x],C=0;O0&&(C=M[x-1]);var R=0;for(L=M[x],C=0;R0&&(C=M[x-1])}}break;case"Polys":var k=parseInt(c.attributes.NumberOfPolys);if(k>0){S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);T=k+S.length;u=new Uint32Array(3*T-9*k);P=0;var I=0;for(x=0,_=k,C=0;x<_;){var N=[];for(O=0,L=M[x];O=3)for(var C=parseInt(L[0]),R=1,k=0;k=3){var I,N;for(k=0;k=u.byteLength)break}var A=new a.BufferGeometry;return A.setIndex(new a.BufferAttribute(h,1)),A.addAttribute("position",new a.BufferAttribute(f,3)),d.length===f.length&&A.addAttribute("normal",new a.BufferAttribute(d,3)),A}(e)}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(var r=t;r-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,a=0;a127)return!0;return!1}},{key:"ensureBinary",value:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),r=0;r0&&(this.baseDir=this.url.substr(0,this.url.lastIndexOf("/")+1));this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this.mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var a=this._data.indexOf("{",r)+1,n=this._data.indexOf("}",r),i=this._data.indexOf("{",a)+1;if(!(a>0&&n>a)){r=-1===a?this._data.length:n+1;break}var o={children:[]},s=this._readLine(this._data.substr(r,a-r-1)).trim(),l=s.split(/ /g);if(l.length>0?(o.type=l[0],l.length>=2?o.name=l[1]:o.name=l[0]+this.Hierarchies.children.length):(o.name=s,o.type=""),"Animation"===o.type){o.data=this._data.substr(i,n-i).trim();var u=this._hierarchieParse(o,n+1);r=u.end,o.children=u.parent.children}else{var c=this._data.lastIndexOf(";",i>0?Math.min(i,n):n);if(o.data=this._data.substr(a,c-a).trim(),i<=0||n0||!this._currentObject.worked?setTimeout((function(){e.mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.Geometry=new a.Geometry,this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new s,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new a.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new a.Bone;if(e.name=this._currentFrame.name,e.applyMatrix(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(var t in this.HieStack)this.HieStack[t].name===this._currentFrame.parentName&&this.HieStack[t].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,a=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,n=0,(a=this._currentObject.data.indexOf(";;",e)+1)<=0&&(a=this._currentObject.data.length)}else{var o=0;switch(t){case 0:o=this._currentObject.data.indexOf(",",e)+1;break;case 1:o=this._currentObject.data.indexOf(";,",e)+1}switch((0===o||o>a)&&(o=a,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,o-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,o-e))}break;case"MeshNormals":switch(t){case 0:this._readNormalVector1(this._currentObject.data.substr(e,o-e));break;case 1:this._readNormalFace1(this._currentObject.data.substr(e,o-e),n)}}e=o+1,n++,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.Geometry.vertices.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))),this._currentGeo.Geometry.skinIndices.push(new a.Vector4(0,0,0,0)),this._currentGeo.Geometry.skinWeights.push(new a.Vector4(1,0,0,0)),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.Geometry.faces.push(new a.Face3(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),new a.Vector3(1,1,1).normalize()))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.normalVectors.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])))}},{key:"_readNormalFace1",value:function(e,t){var r=this._readLine(e.trim()).substr(2,e.length-4).split(","),a=parseInt(r[0],10),n=this._currentGeo.normalVectors[a];a=parseInt(r[1],10);var i=this._currentGeo.normalVectors[a];a=parseInt(r[2],10);var o=this._currentGeo.normalVectors[a];this._currentGeo.Geometry.faces[t].vertexNormals=[n,i,o]}},{key:"_setMeshNormals",value:function(){for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var a=this._currentObject.data.indexOf(",",e)+1;-1===a&&(a=this._currentObject.data.indexOf(";;",e)+1,t=2,r=0);var n=this._currentObject.data.substr(e,a-e),i=this._readLine(n.trim()).split(";");this._currentGeo.normalVectors.push([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]),e=a+1}}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshTextureCoords",value:function(){this._tmpUvArray=[],this._currentGeo.Geometry.faceVertexUvs=[],this._currentGeo.Geometry.faceVertexUvs.push([]);for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),o=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),1-parseFloat(o[1]))):this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),parseFloat(o[1]))),e=n+1}}if(e>=this._currentObject.data.length)break}this._currentGeo.Geometry.faceVertexUvs[0]=[];for(var s=0;s=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new a.MeshPhongMaterial({color:16777215*Math.random()});e.side=a.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t),i=this._readLine(n.trim()).split(";");e.color.r=parseFloat(i[0]),e.color.g=parseFloat(i[1]),e.color.b=parseFloat(i[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(n)),t=r+1,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t);var o=this._readLine(n.trim()).split(";");e.specular.r=parseFloat(o[0]),e.specular.g=parseFloat(o[1]),e.specular.b=parseFloat(o[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),n=this._currentObject.data.substr(t,r-t);var s=this._readLine(n.trim()).split(";");e.emissive.r=parseFloat(s[0]),e.emissive.g=parseFloat(s[1]),e.emissive.b=parseFloat(s[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var u=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(this.baseDir+u);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(this.baseDir+u),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(this.baseDir+u),e.normalScale=new a.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(this.baseDir+u);break;case"LightMapFilename":e.lightMap=this.texloader.load(this.baseDir+u)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new o,t=0,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);t=r+1,e.boneName=n.substr(1,n.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(r=this._currentObject.data.indexOf(";",t))+1,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);for(var i=this._readLine(n.trim()).split(","),s=0;s0)for(var o=0;o0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(var r=0;r4&&console.log("warn! over 4 bone weight! :"+s)}}for(var u=0;u0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,i&&e.context.disable(e.context.STENCIL_TEST),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new a.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new a.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionX,e.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.context.enable(e.context.STENCIL_TEST),e.render(this.scene,this.camera,r,!1),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:new a.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),s.BlurDirectionX=new a.Vector2(1,0),s.BlurDirectionY=new a.Vector2(0,1),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=r(1),i=(a=n)&&a.__esModule?a:{default:a};var o=function(e,t,r,a,n){i.default.call(this),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=a,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};o.prototype=Object.assign(Object.create(i.default.prototype),{constructor:o,render:function(e,t,r,a,n){var i,o,s=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),o=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),this.clearColor&&e.setClearColor(i,o),this.scene.overrideMaterial=null,e.autoClear=s}}),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=c(r(1)),i=c(r(19)),o=c(r(20)),s=c(r(2)),l=c(r(21)),u=c(r(22));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e,t,r,u,c){(n.default.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==r&&r,this.supportsNormalTexture=void 0!==u&&u,this.oldClearColor=new a.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==c?new a.Vector2(c.x,c.y):new a.Vector2(256,256),this.saoRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.NearestFilter,magFilter:a.NearestFilter,format:a.RGBAFormat}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((r=new a.DepthTexture).type=a.UnsignedShortType,r.minFilter=a.NearestFilter,r.maxFilter=a.NearestFilter,this.beautyRenderTarget.depthTexture=r,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.normalMaterial=new a.MeshNormalMaterial,this.normalMaterial.blending=a.NoBlending,void 0===i.default&&console.error("THREE.SAOPass relies on THREE.SAOShader"),this.saoMaterial=new a.ShaderMaterial({defines:Object.assign({},i.default.defines),fragmentShader:i.default.fragmentShader,vertexShader:i.default.vertexShader,uniforms:a.UniformsUtils.clone(i.default.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=a.NoBlending,void 0===o.default&&console.error("THREE.SAOPass relies on THREE.DepthLimitedBlurShader"),this.vBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=a.NoBlending,this.hBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=a.NoBlending,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.CopyShader"),this.materialCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(s.default.uniforms),vertexShader:s.default.vertexShader,fragmentShader:s.default.fragmentShader,blending:a.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=a.CustomBlending,this.materialCopy.blendSrc=a.DstColorFactor,this.materialCopy.blendDst=a.ZeroFactor,this.materialCopy.blendEquation=a.AddEquation,this.materialCopy.blendSrcAlpha=a.DstAlphaFactor,this.materialCopy.blendDstAlpha=a.ZeroFactor,this.materialCopy.blendEquationAlpha=a.AddEquation,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.UnpackDepthRGBAShader"),this.depthCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(l.default.uniforms),vertexShader:l.default.vertexShader,fragmentShader:l.default.fragmentShader,blending:a.NoBlending}),this.quadCamera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.quadScene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quadScene.add(this.quad)};f.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},f.prototype=Object.assign(Object.create(n.default.prototype),{constructor:f,render:function(e,t,r,n,i){if(this.renderToScreen&&(this.materialCopy.blending=a.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,e.clearTarget(this.depthRenderTarget),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(u.default.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(0,1)),u.default.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.render(this.scene,this.camera,this.beautyRenderTarget,!0),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var l=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,l=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?l.blending=a.CustomBlending:l.blending=a.NoBlending,this.renderPass(e,l,this.renderToScreen?null:r),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}},renderPass:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.quad.material=t,e.render(this.quadScene,this.quadCamera,r,l),e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},renderOverride:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1,a=t.clearColor||a,n=t.clearAlpha||n;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.scene.overrideMaterial=t,e.render(this.scene,this.camera,r,l),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}}),t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){n.default.call(this),void 0===i.default&&console.error("THREE.SavePass relies on THREE.CopyShader");var t=i.default;this.textureID="tDiffuse",this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new a.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBFormat,stencilBuffer:!1}),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,e.render(this.scene,this.camera,this.renderTarget,this.clear)}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(23));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),this.edgesRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var r=new Image;r.src=this.getAreaTexture(),this.areaTexture=new a.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=a.RGBFormat,this.areaTexture.minFilter=a.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.needsUpdate=!0,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),this.searchTexture=new a.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=a.NearestFilter,this.searchTexture.minFilter=a.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.needsUpdate=!0,this.searchTexture.flipY=!1,void 0===i.default&&console.error("THREE.SMAAPass relies on THREE.SMAAShader"),this.uniformsEdges=a.UniformsUtils.clone(i.default[0].uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new a.ShaderMaterial({defines:Object.assign({},i.default[0].defines),uniforms:this.uniformsEdges,vertexShader:i.default[0].vertexShader,fragmentShader:i.default[0].fragmentShader}),this.uniformsWeights=a.UniformsUtils.clone(i.default[1].uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new a.ShaderMaterial({defines:Object.assign({},i.default[1].defines),uniforms:this.uniformsWeights,vertexShader:i.default[1].vertexShader,fragmentShader:i.default[1].fragmentShader}),this.uniformsBlend=a.UniformsUtils.clone(i.default[2].uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new a.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:i.default[2].vertexShader,fragmentShader:i.default[2].fragmentShader}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniformsEdges.tDiffuse.value=r.texture,this.quad.material=this.materialEdges,e.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,e.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=r.texture,this.quad.material=this.materialBlend,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vu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hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(3)),i=o(r(25));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){if(void 0===i.default)return console.warn("THREE.SSAOPass depends on THREE.SSAOShader"),new n.default;n.default.call(this,i.default),this.width=void 0!==r?r:512,this.height=void 0!==o?o:256,this.renderToScreen=!1,this.camera2=t,this.scene2=e,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.depthRenderTarget=new a.WebGLRenderTarget(this.width,this.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter}),this.uniforms.tDepth.value=this.depthRenderTarget.texture,this.uniforms.size.value.set(this.width,this.height),this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far,this.uniforms.radius.value=4,this.uniforms.onlyAO.value=!1,this.uniforms.aoClamp.value=.25,this.uniforms.lumInfluence.value=.7;Object.defineProperties(this,{radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},onlyAO:{get:function(){return this.uniforms.onlyAO.value},set:function(e){this.uniforms.onlyAO.value=e}},aoClamp:{get:function(){return this.uniforms.aoClamp.value},set:function(e){this.uniforms.aoClamp.value=e}},lumInfluence:{get:function(){return this.uniforms.lumInfluence.value},set:function(e){this.uniforms.lumInfluence.value=e}}})};(s.prototype=Object.create(n.default.prototype)).render=function(e,t,r,a,i){this.scene2.overrideMaterial=this.depthMaterial,e.render(this.scene2,this.camera2,this.depthRenderTarget,!0),this.scene2.overrideMaterial=null,n.default.prototype.render.call(this,e,t,r,a,i)},s.prototype.setScene=function(e){this.scene2=e},s.prototype.setCamera=function(e){this.camera2=e,this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far},s.prototype.setSize=function(e,t){this.width=e,this.height=t,this.uniforms.size.value.set(this.width,this.height),this.depthRenderTarget.setSize(this.width,this.height)},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(24),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t,r){void 0===o.default&&console.error("THREE.TAARenderPass relies on THREE.SSAARenderPass"),o.default.call(this,e,t,r),this.sampleLevel=0,this.accumulate=!1};s.JitterVectors=o.default.JitterVectors,s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a){if(!this.accumulate)return o.default.prototype.render.call(this,e,t,r,a),void(this.accumulateIndex=-1);var i=s.JitterVectors[5];this.sampleRenderTarget||(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),this.holdRenderTarget||(this.holdRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.holdRenderTarget.texture.name="TAARenderPass.hold"),this.accumulate&&-1===this.accumulateIndex&&(o.default.prototype.render.call(this,e,this.holdRenderTarget,r,a),this.accumulateIndex=0);var l=e.autoClear;e.autoClear=!1;var u=1/i.length;if(this.accumulateIndex>=0&&this.accumulateIndex=i.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}var h=this.accumulateIndex*u;h>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.render(this.scene2,this.camera2,t,!0)),h<1&&(this.copyUniforms.opacity.value=1-h,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.render(this.scene2,this.camera2,t,0===h)),e.autoClear=l}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),void 0===i.default&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=i.default;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=a.UniformsUtils.clone(r.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){var i=e.autoClear;e.autoClear=!1,this.quad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),e.autoClear=i}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=s(r(1)),i=s(r(2)),o=s(r(26));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e,t,r,s){n.default.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=s,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);var l={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var u=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new a.WebGLRenderTarget(u,c,l),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var f=0;f\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new a.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),l.BlurDirectionX=new a.Vector2(1,0),l.BlurDirectionY=new a.Vector2(0,1),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaterRefractionShader=t.VignetteShader=t.VerticalTiltShiftShader=t.VerticalBlurShader=t.UnpackDepthRGBAShader=t.TriangleBlurShader=t.ToneMapShader=t.TechnicolorShader=t.SSAOShader=t.SobelOperatorShader=t.SMAAShader=t.SepiaShader=t.SAOShader=t.RGBShiftShader=t.PixelShader=t.ParallaxShader=t.NormalMapShader=t.MirrorShader=t.LuminosityShader=t.LuminosityHighPassShader=t.KaleidoShader=t.HueSaturationShader=t.HorizontalTiltShiftShader=t.HorizontalBlurShader=t.HalftoneShader=t.GammaCorrectionShader=t.FXAAShader=t.FresnelShader=t.FreiChenShader=t.FocusShader=t.FilmShader=t.DotScreenShader=t.DOFMipMapShader=t.DigitalGlitch=t.DepthLimitedBlurShader=t.CopyShader=t.ConvolutionShader=t.ColorifyShader=t.ColorCorrectionShader=t.BrightnessContrastShader=t.BokehShader2=t.BokehShader=t.BlurShaderUtils=t.BlendShader=t.BleachBypassShader=t.BasicShader=void 0;var a=Q(r(113)),n=Q(r(114)),i=Q(r(115)),o=Q(r(22)),s=Q(r(14)),l=Q(r(116)),u=Q(r(117)),c=Q(r(118)),f=Q(r(119)),d=Q(r(13)),h=Q(r(2)),p=Q(r(20)),m=Q(r(17)),v=Q(r(120)),g=Q(r(15)),y=Q(r(16)),b=Q(r(121)),w=Q(r(122)),x=Q(r(123)),_=Q(r(124)),A=Q(r(125)),E=Q(r(18)),S=Q(r(126)),M=Q(r(127)),T=Q(r(128)),P=Q(r(129)),F=Q(r(26)),O=Q(r(11)),L=Q(r(130)),C=Q(r(131)),R=(Q(r(132)),Q(r(133))),k=Q(r(134)),I=Q(r(135)),N=Q(r(19)),D=Q(r(136)),U=Q(r(23)),j=Q(r(137)),B=Q(r(25)),V=Q(r(138)),z=Q(r(12)),G=Q(r(139)),H=Q(r(21)),X=Q(r(140)),Y=Q(r(141)),W=Q(r(142)),q=Q(r(143));function Q(e){return e&&e.__esModule?e:{default:e}}t.BasicShader=a.default,t.BleachBypassShader=n.default,t.BlendShader=i.default,t.BlurShaderUtils=o.default,t.BokehShader=s.default,t.BokehShader2=l.default,t.BrightnessContrastShader=u.default,t.ColorCorrectionShader=c.default,t.ColorifyShader=f.default,t.ConvolutionShader=d.default,t.CopyShader=h.default,t.DepthLimitedBlurShader=p.default,t.DigitalGlitch=m.default,t.DOFMipMapShader=v.default,t.DotScreenShader=g.default,t.FilmShader=y.default,t.FocusShader=b.default,t.FreiChenShader=w.default,t.FresnelShader=x.default,t.FXAAShader=_.default,t.GammaCorrectionShader=A.default,t.HalftoneShader=E.default,t.HorizontalBlurShader=S.default,t.HorizontalTiltShiftShader=M.default,t.HueSaturationShader=T.default,t.KaleidoShader=P.default,t.LuminosityHighPassShader=F.default,t.LuminosityShader=O.default,t.MirrorShader=L.default,t.NormalMapShader=C.default,t.ParallaxShader=R.default,t.PixelShader=k.default,t.RGBShiftShader=I.default,t.SAOShader=N.default,t.SepiaShader=D.default,t.SMAAShader=U.default,t.SobelOperatorShader=j.default,t.SSAOShader=B.default,t.TechnicolorShader=V.default,t.ToneMapShader=z.default,t.TriangleBlurShader=G.default,t.UnpackDepthRGBAShader=H.default,t.VerticalBlurShader=X.default,t.VerticalTiltShiftShader=Y.default,t.VignetteShader=W.default,t.WaterRefractionShader=q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","vec4 texel1 = texture2D( tDiffuse1, vUv );","vec4 texel2 = texture2D( tDiffuse2, vUv );","gl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float penta(vec2 coords) {","//pentagonal shape","float scale = float(rings) - 1.3;","vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","vec4 one = vec4( 1.0 );","vec4 P = vec4((coords),vec2(scale, scale));","vec4 dist = vec4(0.0);","float inorout = -4.0;","dist.x = dot( P, HS0 );","dist.y = dot( P, HS1 );","dist.z = dot( P, HS2 );","dist.w = dot( P, HS3 );","dist = smoothstep( -feather, feather, dist );","inorout += dot( dist, one );","dist.x = dot( P, HS4 );","dist.y = HS5.w - abs( P.z );","dist = smoothstep( -feather, feather, dist );","inorout += dist.x;","return clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","// Depth buffer blur","float d = 0.0;","float kernel[9];","vec2 offset[9];","vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","offset[0] = vec2(-wh.x,-wh.y);","offset[1] = vec2( 0.0, -wh.y);","offset[2] = vec2( wh.x -wh.y);","offset[3] = vec2(-wh.x, 0.0);","offset[4] = vec2( 0.0, 0.0);","offset[5] = vec2( wh.x, 0.0);","offset[6] = vec2(-wh.x, wh.y);","offset[7] = vec2( 0.0, wh.y);","offset[8] = vec2( wh.x, wh.y);","kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","for( int i=0; i<9; i++ ) {","float tmp = getDepth( coords + offset[ i ] );","d += tmp * kernel[i];","}","return d;","}","vec3 color(vec2 coords,float blur) {","//processing the sample","vec3 col = vec3(0.0);","vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","vec3 lumcoeff = vec3(0.299,0.587,0.114);","float lum = dot(col.rgb, lumcoeff);","float thresh = max((lum-threshold)*gain, 0.0);","return col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","float edge = 0.002*depth; //distance based edge smoothing","float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","return col;","}","float linearize(float depth) {","return -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","float dist = distance(vUv.xy, vec2(0.5,0.5));","dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","return clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","float rings2 = float(rings);","float step = PI*2.0 / float(ringsamples);","float pw = cos(j*step)*i;","float ph = sin(j*step)*i;","float p = 1.0;","if (pentagon) {","p = penta(vec2(pw,ph));","}","col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","return 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","//scene depth calculation","float depth = linearize( getDepth( vUv.xy ) );","// Blur depth?","if (depthblur) {","depth = linearize(bdepth(vUv.xy));","}","//focal plane calculation","float fDepth = focalDepth;","if (shaderFocus) {","fDepth = linearize( getDepth( focusCoords ) );","}","// dof blur factor calculation","float blur = 0.0;","if (manualdof) {","float a = depth-fDepth; // Focal plane","float b = (a-fdofstart)/fdofdist; // Far DoF","float c = (-a-ndofstart)/ndofdist; // Near Dof","blur = (a>0.0) ? b : c;","} else {","float f = focalLength; // focal length in mm","float d = fDepth*1000.0; // focal plane in mm","float o = depth*1000.0; // depth in mm","float a = (o*f)/(o-f);","float b = (d*f)/(d-f);","float c = (d-f)/(d*fstop*CoC);","blur = abs(a-b)*c;","}","blur = clamp(blur,0.0,1.0);","// calculation of pattern for dithering","vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","// getting blur x and y step factor","float w = (1.0/textureWidth)*blur*maxblur+noise.x;","float h = (1.0/textureHeight)*blur*maxblur+noise.y;","// calculation of final color","vec3 col = vec3(0.0);","if(blur < 0.05) {","//some optimization thingy","col = texture2D(tColor, vUv.xy).rgb;","} else {","col = texture2D(tColor, vUv.xy).rgb;","float s = 1.0;","int ringsamples;","for (int i = 1; i <= rings; i++) {","/*unboxstart*/","ringsamples = i * samples;","for (int j = 0 ; j < maxringsamples ; j++) {","if (j >= ringsamples) break;","s += gather(float(i), float(j), ringsamples, col, w, h, blur);","}","/*unboxend*/","}","col /= s; //divide by sample count","}","if (showFocus) {","col = debugFocus(col, blur, depth);","}","if (vignetting) {","col *= vignette();","}","gl_FragColor.rgb = col;","gl_FragColor.a = 1.0;","} "].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},powRGB:{value:new a.Vector3(2,2,2)},mulRGB:{value:new a.Vector3(1,1,1)},addRGB:{value:new a.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},color:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},aspect:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","G[0] = g0,","G[1] = g1,","G[2] = g2,","G[3] = g3,","G[4] = g4,","G[5] = g5,","G[6] = g6,","G[7] = g7,","G[8] = g8;","mat3 I;","float cnv[9];","vec3 sample;","for (float i=0.0; i<3.0; i++) {","for (float j=0.0; j<3.0; j++) {","sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","I[int(i)][int(j)] = length(sample);","}","}","for (int i=0; i<9; i++) {","float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","cnv[i] = dp3 * dp3;","}","float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","vec3 I = worldPosition.xyz - cameraPosition;","vReflect = reflect( I, worldNormal );","vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","vec4 refractedColor = vec4( 1.0 );","refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immedates."," // Immedates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","gl_FragColor = LinearToGamma( tex, float( GAMMA_FACTOR ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 p = vUv - 0.5;","float r = length(p);","float a = atan(p.y, p.x) + angle;","float tau = 2. * 3.1416 ;","a = mod(a, tau/sides);","a = abs(a - tau/sides/2.) ;","p = r * vec2(cos(a), sin(a));","vec4 color = texture2D(tDiffuse, p + 0.5);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","vec2 p = vUv;","if (side == 0){","if (p.x > 0.5) p.x = 1.0 - p.x;","}else if (side == 1){","if (p.x < 0.5) p.x = 1.0 - p.x;","}else if (side == 2){","if (p.y < 0.5) p.y = 1.0 - p.y;","}else if (side == 3){","if (p.y > 0.5) p.y = 1.0 - p.y;","} ","vec4 color = texture2D(tDiffuse, p);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{heightMap:{value:null},resolution:{value:new a.Vector2(512,512)},scale:{value:new a.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));a.ShaderLib.ocean_sim_vertex={vertexShader:["varying vec2 vUV;","void main (void) {","vUV = position.xy * 0.5 + 0.5;","gl_Position = vec4(position, 1.0 );","}"].join("\n")},a.ShaderLib.ocean_subtransform={uniforms:{u_input:{value:null},u_transformSize:{value:512},u_subtransformSize:{value:250}},fragmentShader:["precision highp float;","#include ","uniform sampler2D u_input;","uniform float u_transformSize;","uniform float u_subtransformSize;","varying vec2 vUV;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","void main (void) {","#ifdef HORIZONTAL","float index = vUV.x * u_transformSize - 0.5;","#else","float index = vUV.y * u_transformSize - 0.5;","#endif","float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);","#ifdef HORIZONTAL","vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","#else","vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;","#endif","float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);","vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));","vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);","vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);","gl_FragColor = vec4(outputA, outputB);","}"].join("\n")},a.ShaderLib.ocean_initial_spectrum={uniforms:{u_wind:{value:new a.Vector2(10,10)},u_resolution:{value:512},u_size:{value:250}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","const float CM = 0.23;","uniform vec2 u_wind;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + pow2(k / KM)));","}","float tanh (float x) {","return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 K = (2.0 * PI * vec2(n, m)) / u_size;","float k = length(K);","float l_wind = length(u_wind);","float Omega = 0.84;","float kp = G * pow2(Omega / l_wind);","float c = omega(k) / k;","float cp = omega(kp) / kp;","float Lpm = exp(-1.25 * pow2(kp / k));","float gamma = 1.7;","float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));","float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));","float Jp = pow(gamma, Gamma);","float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));","float alphap = 0.006 * sqrt(Omega);","float Bl = 0.5 * alphap * cp / c * Fp;","float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);","float uStar = 0.41 * l_wind / log(10.0 / z0);","float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));","float Fm = exp(-0.25 * pow2(k / KM - 1.0));","float Bh = 0.5 * alpham * CM / c * Fm * Lpm;","float a0 = log(2.0) / 4.0;","float am = 0.13 * uStar / CM;","float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));","float cosPhi = dot(normalize(u_wind), normalize(K));","float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));","float dk = 2.0 * PI / u_size;","float h = sqrt(S / 2.0) * dk;","if (K.x == 0.0 && K.y == 0.0) {","h = 0.0;","}","gl_FragColor = vec4(h, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_phase={uniforms:{u_phases:{value:null},u_deltaTime:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform sampler2D u_phases;","uniform float u_deltaTime;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","float deltaTime = 1.0 / 60.0;","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","float deltaPhase = omega(length(waveVector)) * u_deltaTime;","phase = mod(phase + deltaPhase, 2.0 * PI);","gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_spectrum={uniforms:{u_size:{value:null},u_resolution:{value:null},u_choppiness:{value:null},u_phases:{value:null},u_initialSpectrum:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform float u_size;","uniform float u_resolution;","uniform float u_choppiness;","uniform sampler2D u_phases;","uniform sampler2D u_initialSpectrum;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","vec2 multiplyByI (vec2 z) {","return vec2(-z[1], z[0]);","}","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","vec2 phaseVector = vec2(cos(phase), sin(phase));","vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;","vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;","h0Star.y *= -1.0;","vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));","vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;","vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;","if (waveVector.x == 0.0 && waveVector.y == 0.0) {","h = vec2(0.0);","hX = vec2(0.0);","hZ = vec2(0.0);","}","gl_FragColor = vec4(hX + multiplyByI(h), hZ);","}"].join("\n")},a.ShaderLib.ocean_normals={uniforms:{u_displacementMap:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform float u_resolution;","uniform float u_size;","void main (void) {","float texel = 1.0 / u_resolution;","float texelSize = u_size / u_resolution;","vec3 center = texture2D(u_displacementMap, vUV).rgb;","vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;","vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;","vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;","vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;","vec3 topRight = cross(right, top);","vec3 topLeft = cross(top, left);","vec3 bottomLeft = cross(left, bottom);","vec3 bottomRight = cross(bottom, right);","gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);","}"].join("\n")},a.ShaderLib.ocean_main={uniforms:{u_displacementMap:{value:null},u_normalMap:{value:null},u_geometrySize:{value:null},u_size:{value:null},u_projectionMatrix:{value:null},u_viewMatrix:{value:null},u_cameraPosition:{value:null},u_skyColor:{value:null},u_oceanColor:{value:null},u_sunDirection:{value:null},u_exposure:{value:null}},vertexShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform mat4 u_projectionMatrix;","uniform mat4 u_viewMatrix;","uniform float u_size;","uniform float u_geometrySize;","uniform sampler2D u_displacementMap;","void main (void) {","vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);","vPos = newPos;","vUV = uv;","gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);","}"].join("\n"),fragmentShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform sampler2D u_normalMap;","uniform vec3 u_cameraPosition;","uniform vec3 u_oceanColor;","uniform vec3 u_skyColor;","uniform vec3 u_sunDirection;","uniform float u_exposure;","vec3 hdr (vec3 color, float exposure) {","return 1.0 - exp(-color * exposure);","}","void main (void) {","vec3 normal = texture2D(u_normalMap, vUV).rgb;","vec3 view = normalize(u_cameraPosition - vPos);","float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);","vec3 sky = fresnel * u_skyColor;","float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);","vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;","vec3 color = sky + water;","gl_FragColor = vec4(hdr(color, u_exposure), 1.0);","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","vUv = uv;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vViewPosition = -mvPosition.xyz;","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","vec2 parallaxMap( in vec3 V ) {","float initialHeight = texture2D( bumpMap, vUv ).r;","vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","return vUv - texCoordOffset;","}","#else","vec2 parallaxMap( in vec3 V ) {","float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","float layerHeight = 1.0 / numLayers;","float currentLayerHeight = 0.0;","vec2 dtex = parallaxScale * V.xy / V.z / numLayers;","vec2 currentTextureCoords = vUv;","float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","for ( int i = 0; i < 30; i += 1 ) {","if ( heightFromTexture <= currentLayerHeight ) {","break;","}","currentLayerHeight += layerHeight;","currentTextureCoords -= dtex;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","}","#ifdef USE_STEEP_PARALLAX","return currentTextureCoords;","#elif defined( USE_RELIEF_PARALLAX )","vec2 deltaTexCoord = dtex / 2.0;","float deltaHeight = layerHeight / 2.0;","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","const int numSearches = 5;","for ( int i = 0; i < numSearches; i += 1 ) {","deltaTexCoord /= 2.0;","deltaHeight /= 2.0;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","if( heightFromTexture > currentLayerHeight ) {","currentTextureCoords -= deltaTexCoord;","currentLayerHeight += deltaHeight;","} else {","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","}","}","return currentTextureCoords;","#elif defined( USE_OCLUSION_PARALLAX )","vec2 prevTCoords = currentTextureCoords + dtex;","float nextH = heightFromTexture - currentLayerHeight;","float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","float weight = nextH / ( nextH - prevH );","return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","#else","return vUv;","#endif","}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","vec2 texDx = dFdx( vUv );","vec2 texDy = dFdy( vUv );","vec3 vSigmaX = dFdx( surfPosition );","vec3 vSigmaY = dFdy( surfPosition );","vec3 vR1 = cross( vSigmaY, surfNormal );","vec3 vR2 = cross( surfNormal, vSigmaX );","float fDet = dot( vSigmaX, vR1 );","vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","vec3 vProjVtex;","vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","vProjVtex.z = dot( surfNormal, viewPosition );","return parallaxMap( vProjVtex );","}","void main() {","vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","gl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, vUv + offset);","vec4 cga = texture2D(tDiffuse, vUv);","vec4 cb = texture2D(tDiffuse, vUv - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","gl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","gl_FragColor = newTex;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{texture:{value:null},delta:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = rand( vUv );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{color:{type:"c",value:null},time:{type:"f",value:0},tDiffuse:{type:"t",value:null},tDudv:{type:"t",value:null},textureMatrix:{type:"m4",value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Volume=void 0;var a,n=r(10),i=(a=n)&&a.__esModule?a:{default:a};t.Volume=i.default}]))},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,a,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,a)}));case 4:return t.nextTick((function(){e.call(null,r,a,n)}));default:for(i=new Array(s-1),o=0;o>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return n>0&&(e.lastNeed=n-1),n;if(--a=0)return n>0&&(e.lastNeed=n-2),n;if(--a=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";(function(t){var a=r(121); /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */function n(e,t){if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);n=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(e[s],t[s],r,a))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function x(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,a){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(a=r,r=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),a=(r&&r.name?" ("+r.name+").":".")+(a?" "+a:"."),e&&!n&&g(n,r,"Missing expected exception"+a);var i="string"==typeof a,s=!e&&n&&!r;if((!e&&o.isError(n)&&i&&x(n,r)||s)&&g(n,r,"Got unwanted exception"+a),e&&n&&r&&!x(n,r)||!e&&n)throw n}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(v(e.actual),128)+" "+e.operator+" "+m(v(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var a=r.stack,n=p(t),i=a.indexOf("\n"+n);if(i>=0){var o=a.indexOf("\n",i+1);a=a.substring(o+1)}this.stack=a}}},o.inherits(d.AssertionError,Error),d.fail=g,d.ok=y,d.equal=function(e,t,r){e!=t&&g(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){b(e,t,!1)||g(e,t,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,r){b(e,t,!0)||g(e,t,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,r){b(e,t,!1)&&g(e,t,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,r,a){b(t,r,!0)&&g(t,r,a,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",d.notStrictEqual)},d.throws=function(e,t,r){_(!0,e,t,r)},d.doesNotThrow=function(e,t,r){_(!1,e,t,r)},d.ifError=function(e){if(e)throw e},d.strict=a((function e(t,r){t||g(t,!0,r,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var A=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(34);Object.defineProperty(t,"CopyShader",{enumerable:!0,get:function(){return h(a).default}});var n=r(10);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return h(n).default}});var i=r(48);Object.defineProperty(t,"ShaderPass",{enumerable:!0,get:function(){return h(i).default}});var o=r(82);Object.defineProperty(t,"RenderingPass",{enumerable:!0,get:function(){return h(o).default}});var s=r(83);Object.defineProperty(t,"TexturePass",{enumerable:!0,get:function(){return h(s).default}});var l=r(84);Object.defineProperty(t,"RenderPass",{enumerable:!0,get:function(){return h(l).default}});var u=r(49);Object.defineProperty(t,"MaskPass",{enumerable:!0,get:function(){return h(u).default}});var c=r(50);Object.defineProperty(t,"ClearMaskPass",{enumerable:!0,get:function(){return h(c).default}});var f=r(85);Object.defineProperty(t,"ClearPass",{enumerable:!0,get:function(){return h(f).default}});var d=r(86);function h(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h(d).default}})},function(e,t,r){var a,n,i,o,s;a=r(181),n=r(78).utf8,i=r(182),o=r(78).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):n.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var r=a.bytesToWords(e),l=8*e.length,u=1732584193,c=-271733879,f=-1732584194,d=271733878,h=0;h>>24)|4278255360&(r[h]<<24|r[h]>>>8);r[l>>>5]|=128<>>9<<4)]=l;var p=s._ff,m=s._gg,v=s._hh,g=s._ii;for(h=0;h>>0,c=c+b>>>0,f=f+w>>>0,d=d+x>>>0}return a.endian([u,c,f,d])})._ff=function(e,t,r,a,n,i,o){var s=e+(t&r|~t&a)+(n>>>0)+o;return(s<>>32-i)+t},s._gg=function(e,t,r,a,n,i,o){var s=e+(t&a|r&~a)+(n>>>0)+o;return(s<>>32-i)+t},s._hh=function(e,t,r,a,n,i,o){var s=e+(t^r^a)+(n>>>0)+o;return(s<>>32-i)+t},s._ii=function(e,t,r,a,n,i,o){var s=e+(r^(t|~a))+(n>>>0)+o;return(s<>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=a.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?o.bytesToString(r):a.bytesToHex(r)}},function(e,t,r){function a(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var a=r(r.s=ENTRY_MODULE);return a.default||a}var n="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+n+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e,t,a){var s={};s[a]=[];var l=t.toString(),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return s;for(var c,f=u[1],d=new RegExp("(\\\\n|\\W)"+o(f)+i,"g");c=d.exec(l);)"dll-reference"!==c[3]&&s[a].push(c[3]);for(d=new RegExp("\\("+o(f)+'\\("(dll-reference\\s('+n+'))"\\)\\)'+i,"g");c=d.exec(l);)e[c[2]]||(s[a].push(c[1]),e[c[2]]=r(c[1]).m),s[c[2]]=s[c[2]]||[],s[c[2]].push(c[4]);for(var h,p=Object.keys(s),m=0;m0}),!1)}e.exports=function(e,t){t=t||{};var n={main:r.m},i=t.all?{main:Object.keys(n.main)}:function(e,t){for(var r={main:[t]},a={main:[]},n={main:{}};l(r);)for(var i=Object.keys(r),o=0;o-1?a:i.nextTick;y.WritableState=g;var u=r(20);u.inherits=r(6);var c={deprecate:r(60)},f=r(58),d=r(28).Buffer,h=n.Uint8Array||function(){};var p,m=r(59);function v(){}function g(e,t){s=s||r(13),e=e||{};var a=t instanceof s;this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:a&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,a=r.sync,n=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,a,n){--t.pendingcb,r?(i.nextTick(n,a),i.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",a)):(n(a),e._writableState.errorEmitted=!0,e.emit("error",a),E(e,t))}(e,r,a,t,n);else{var o=_(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),a?l(w,e,r,o,n):w(e,r,o,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(s=s||r(13),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,r,a,n,i,o){t.writelen=a,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,i,t.onwrite),t.sync=!1}function w(e,t,r,a){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,a(),E(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var a=t.bufferedRequestCount,n=new Array(a),i=t.corkedRequestsFree;i.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,b(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),E(e,t)}))}function E(e,t){var r=_(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(A,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(y,f),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var a,n=this._writableState,o=!1,s=!n.objectMode&&(a=e,d.isBuffer(a)||a instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}(this,r):(s||function(e,t,r,a){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),i.nextTick(a,o),n=!1),n}(this,n,e,r))&&(n.pendingcb++,o=function(e,t,r,a,n,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,a,n);a!==o&&(r=!0,n="buffer",a=o)}var s=t.objectMode?1:a.length;t.length+=s;var l=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var a=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||a.finished||function(e,t,r){t.ending=!0,E(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,a,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(5),r(110).setImmediate,r(4))},function(e,t,r){"use strict";var a=r(129),n=r(41),i=r(15),o=r(63),s=r(131);function l(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof o)return p(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var n,i,s,c=u.call(this,t,r);return c&&(n=c.schema,t=c.root,s=c.baseId),n instanceof o?i=n.validate||e.call(this,n.schema,t,void 0,s):void 0!==n&&(i=p(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,s)),i}function u(e,t){var r=a.parse(t),n=v(r),i=m(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==i){var s=y(n),l=this._refs[s];if("string"==typeof l)return c.call(this,e,l,r);if(l instanceof o)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[s])instanceof o))return;if(l.validate||this._compile(l),s==y(t))return{schema:l,root:e,baseId:i};e=l}if(!e.schema)return;i=m(this._getId(e.schema))}return d.call(this,r,i,e.schema,e)}function c(e,t,r){var a=u.call(this,e,t);if(a){var n=a.schema,i=a.baseId;e=a.root;var o=this._getId(n);return o&&(i=b(i,o)),d.call(this,r,i,n,e)}}e.exports=l,l.normalizeId=y,l.fullPath=m,l.url=b,l.ids=function(e){var t=y(this._getId(e)),r={"":t},o={"":m(t,!1)},l={},u=this;return s(e,{allKeys:!0},(function(e,t,s,c,f,d,h){if(""!==t){var p=u._getId(e),m=r[c],v=o[c]+"/"+f;if(void 0!==h&&(v+="/"+("number"==typeof h?h:i.escapeFragment(h))),"string"==typeof p){p=m=y(m?a.resolve(m,p):p);var g=u._refs[p];if("string"==typeof g&&(g=u._refs[g]),g&&g.schema){if(!n(e,g.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=y(v))if("#"==p[0]){if(l[p]&&!n(e,l[p]))throw new Error('id "'+p+'" resolves to more than one schema');l[p]=e}else u._refs[p]=v}r[t]=m,o[t]=v}})),l},l.inlineRef=p,l.schema=u;var f=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var n=e.fragment.split("/"),o=1;o{if(e.file){let r=new FileReader;r.onload=function(){let e=this.result,r=new Uint8Array(e);t(r)},r.readAsArrayBuffer(e.file)}else if(e.url){let r=new XMLHttpRequest;r.open("GET",e.url,!0),r.responseType="arraybuffer",r.onloadend=function(){if(200===r.status){let e=new Uint8Array(r.response||r.responseText);t(e)}},r.send()}else e.raw?e.raw instanceof Uint8Array?t(e.raw):t(new Uint8Array(e.raw)):r()})}function o(e,t){return new Promise((r,a)=>{if("compound"===e.type)if(e.value.hasOwnProperty("blocks")&&(e.value.hasOwnProperty("palette")||e.value.hasOwnProperty("palettes"))){let a;if(e.value.hasOwnProperty("palette"))a=e.value.palette.value.value;else{if(void 0===t&&(t=0),t>=e.value.palettes.value.value.length||!e.value.palettes.value.value[t])return void console.warn("Specified palette index ("+t+") is outside of available palettes ("+e.value.palettes.value.value.length+")");a=e.value.palettes.value.value[t].value}let n=[];for(let e=0;e{let n=e.value.Width.value,i=e.value.Height.value,o=e.value.Length.value,s=function(t,r,a){let i=(r*o+a)*n+t;return{id:255&(e.value.Blocks.value[i]||0),data:e.value.Data.value[i]||0}},l=function(e,r){let a=t.blocks[e+":"+r];return a||(console.warn("Missing legacy mapping for "+e+":"+r),"minecraft:air")},u=[];for(let e=0;e{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);o(r).then(e=>{t(e)})})})},n.prototype.schematicToModels=function(e,t){i(e).then(e=>{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);let a=new XMLHttpRequest;a.open("GET","https://minerender.org/res/idsToNames.json",!0),a.onloadend=function(){if(200===a.status){console.log(a.response||a.responseText);let e=JSON.parse(a.response||a.responseText);s(r,e).then(e=>t(e))}},a.send()})})},n.loadNBT=i,n.parseStructureData=o,n.parseSchematicData=s;let l={stained_glass:function(e){return e.color.value+"_stained_glass"},planks:function(e){return e.variant.value+"_planks"}};n.prototype.constructor=n,window.ModelConverter=n,t.a=n},function(e,t,r){const a=r(103),n=r(120).ProtoDef,i=r(179).compound,o=JSON.stringify(r(180)),s=o.replace(/(i[0-9]+)/g,"l$1");function l(e){const t=new n;return t.addType("compound",i),t.addTypes(JSON.parse(e?s:o)),t}const u=l(!1),c=l(!0);function f(e,t){return(t?c:u).parsePacketBuffer("nbt",e).data}const d=function(e){let t=!0;return 31!==e[0]&&(t=!1),139!==e[1]&&(t=!1),t};e.exports={writeUncompressed:function(e,t){return(t?c:u).createPacketBuffer("nbt",e)},parseUncompressed:f,simplify:function e(t){return function t(r,a){return"compound"===a?Object.keys(r).reduce((function(t,a){return t[a]=e(r[a]),t}),{}):"list"===a?r.value.map((function(e){return t(e,r.type)})):r}(t.value,t.type)},parse:function(e,t,r){let n=!1;"function"==typeof t?r=t:n=t,d(e)?a.gunzip(e,(function(t,a){t?r(t,e):r(null,f(a,n))})):r(null,f(e,n))},proto:u,protoLE:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(){function e(e,t){for(var r=0;r4?9:0)}function $(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ae(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ne(e,t){var r,a,n=e.max_chain_length,i=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-D?e.strstart-(e.w_size-D):0,u=e.window,c=e.w_mask,f=e.prev,d=e.strstart+N,h=u[i+o-1],p=u[i+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===h&&u[r]===u[i]&&u[++r]===u[i+1]){i+=2,r++;do{}while(u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&io){if(e.match_start=t,o=a,a>=s)break;h=u[i+o-1],p=u[i+o]}}}while((t=f[t&c])>l&&0!=--n);return o<=e.lookahead?o:e.lookahead}function ie(e){var t,r,a,i,l,u,c,f,d,h,p=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-D)){n.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;do{a=e.head[--t],e.head[t]=a>=p?a-p:0}while(--r);t=r=p;do{a=e.prev[--t],e.prev[t]=a>=p?a-p:0}while(--r);i+=p}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,f=e.strstart+e.lookahead,d=i,h=void 0,(h=u.avail_in)>d&&(h=d),r=0===h?0:(u.avail_in-=h,n.arraySet(c,u.input,u.next_in,h,f),1===u.state.wrap?u.adler=o(u.adler,c,h,f):2===u.state.wrap&&(u.adler=s(u.adler,c,h,f)),u.next_in+=h,u.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=I)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I)if(a=i._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-I,a=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<15&&(s=2,a-=16),i<1||i>T||r!==M||a<8||a>15||t<0||t>9||o<0||o>A)return K(e,v);8===a&&(a=9);var l=new ue;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=a,l.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ie(e),0===e.lookahead&&t===u)return Y;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+r;if((0===e.strstart||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,te(e,!1),0===e.strm.avail_out))return Y;if(e.strstart-e.block_start>=e.w_size-D&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),Y)})),new le(4,4,8,4,oe),new le(4,5,16,8,oe),new le(4,6,32,32,oe),new le(4,4,16,16,se),new le(8,16,32,32,se),new le(8,16,128,128,se),new le(8,32,128,256,se),new le(32,128,258,1024,se),new le(32,258,258,4096,se)],t.deflateInit=function(e,t){return de(e,t,M,P,F,E)},t.deflateInit2=de,t.deflateReset=fe,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?v:(e.state.gzhead=t,p):v},t.deflate=function(e,t){var r,n,o,l;if(!e||!e.state||t>h||t<0)return e?K(e,v):v;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===X&&t!==d)return K(e,0===e.avail_out?y:v);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===j)if(2===n.wrap)e.adler=0,re(n,31),re(n,139),re(n,8),n.gzhead?(re(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),re(n,255&n.gzhead.time),re(n,n.gzhead.time>>8&255),re(n,n.gzhead.time>>16&255),re(n,n.gzhead.time>>24&255),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(re(n,255&n.gzhead.extra.length),re(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=s(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=B):(re(n,0),re(n,0),re(n,0),re(n,0),re(n,0),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,Z),n.status=H);else{var g=M+(n.w_bits-8<<4)<<8;g|=(n.strategy>=x||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(g|=U),g+=31-g%31,n.status=H,ae(n,g),0!==n.strstart&&(ae(n,e.adler>>>16),ae(n,65535&e.adler)),e.adler=1}if(n.status===B)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending!==n.pending_buf_size));)re(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=V)}else n.status=V;if(n.status===V)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=z)}else n.status=z;if(n.status===z)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=G)}else n.status=G;if(n.status===G&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ee(e),n.pending+2<=n.pending_buf_size&&(re(n,255&e.adler),re(n,e.adler>>8&255),e.adler=0,n.status=H)):n.status=H),0!==n.pending){if(ee(e),0===e.avail_out)return n.last_flush=-1,p}else if(0===e.avail_in&&J(t)<=J(r)&&t!==d)return K(e,y);if(n.status===X&&0!==e.avail_in)return K(e,y);if(0!==e.avail_in||0!==n.lookahead||t!==u&&n.status!==X){var b=n.strategy===x?function(e,t){for(var r;;){if(0===e.lookahead&&(ie(e),0===e.lookahead)){if(t===u)return Y;break}if(e.match_length=0,r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):n.strategy===_?function(e,t){for(var r,a,n,o,s=e.window;;){if(e.lookahead<=N){if(ie(e),e.lookahead<=N&&t===u)return Y;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(a=s[n=e.strstart-1])===s[++n]&&a===s[++n]&&a===s[++n]){o=e.strstart+N;do{}while(a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&ne.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=i._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):a[n.level].func(n,t);if(b!==q&&b!==Q||(n.status=X),b===Y||b===q)return 0===e.avail_out&&(n.last_flush=-1),p;if(b===W&&(t===c?i._tr_align(n):t!==h&&(i._tr_stored_block(n,0,0,!1),t===f&&($(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),ee(e),0===e.avail_out))return n.last_flush=-1,p}return t!==d?p:n.wrap<=0?m:(2===n.wrap?(re(n,255&e.adler),re(n,e.adler>>8&255),re(n,e.adler>>16&255),re(n,e.adler>>24&255),re(n,255&e.total_in),re(n,e.total_in>>8&255),re(n,e.total_in>>16&255),re(n,e.total_in>>24&255)):(ae(n,e.adler>>>16),ae(n,65535&e.adler)),ee(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?p:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==j&&t!==B&&t!==V&&t!==z&&t!==G&&t!==H&&t!==X?K(e,v):(e.state=null,t===H?K(e,g):p):v},t.deflateSetDictionary=function(e,t){var r,a,i,s,l,u,c,f,d=t.length;if(!e||!e.state)return v;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==j||r.lookahead)return v;for(1===s&&(e.adler=o(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&($(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new n.Buf8(r.w_size),n.arraySet(f,t,d-r.w_size,r.w_size,0),t=f,d=r.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,ie(r);r.lookahead>=I;){a=r.strstart,i=r.lookahead-(I-1);do{r.ins_h=(r.ins_h<>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{i=i+(n=n+t[a++]|0)|0}while(--o);n%=65521,i%=65521}return n|i<<16|0}},function(e,t,r){"use strict";var a=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,n){var i=a,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}},function(e,t,r){"use strict";var a=r(11),n=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var o=new a.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&i||!e.subarray&&n))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var r="",o=0;o>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new a.Buf8(e.length),r=0,n=t.length;r4)u[a++]=65533,r+=i-1;else{for(n&=2===i?31:3===i?15:7;i>1&&r1?u[a++]=65533:n<65536?u[a++]=n:(n-=65536,u[a++]=55296|n>>10&1023,u[a++]=56320|1023&n)}return l(u,a)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+o[e[r]]>t?r:t}},function(e,t,r){"use strict";var a=r(11),n=r(52),i=r(53),o=r(100),s=r(101),l=0,u=1,c=2,f=4,d=5,h=6,p=0,m=1,v=2,g=-2,y=-3,b=-4,w=-5,x=8,_=1,A=2,E=3,S=4,M=5,T=6,P=7,F=8,O=9,L=10,C=11,R=12,k=13,I=14,N=15,D=16,U=17,j=18,B=19,V=20,z=21,G=22,H=23,X=24,Y=25,W=26,q=27,Q=28,Z=29,K=30,J=31,$=32,ee=852,te=592,re=15;function ae(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ne(){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 a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(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=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new a.Buf32(ee),t.distcode=t.distdyn=new a.Buf32(te),t.sane=1,t.back=-1,p):g}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):g}function se(e,t){var r,a;return e&&e.state?(a=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?g:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=r,a.wbits=t,oe(e))):g}function le(e,t){var r,a;return e?(a=new ne,e.state=a,a.window=null,(r=se(e,t))!==p&&(e.state=null),r):g}var ue,ce,fe=!0;function de(e){if(fe){var t;for(ue=new a.Buf32(512),ce=new a.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,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,ce,0,e.work,{bits:5}),fe=!1}e.lencode=ue,e.lenbits=9,e.distcode=ce,e.distbits=5}function he(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(a.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),a.arraySet(o.window,t,r-n,i,o.wnext),(n-=i)?(a.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=i(r.check,Te,2,0),se=0,le=0,r.mode=A;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=K;break}if((15&se)!==x){e.msg="unknown compression method",r.mode=K;break}if(le-=4,_e=8+(15&(se>>>=4)),0===r.wbits)r.wbits=_e;else if(_e>r.wbits){e.msg="invalid window size",r.mode=K;break}r.dmax=1<<_e,e.adler=r.check=1,r.mode=512&se?L:R,se=0,le=0;break;case A:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8&1),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=E;case E:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,Te[2]=se>>>16&255,Te[3]=se>>>24&255,r.check=i(r.check,Te,4,0)),se=0,le=0,r.mode=S;case S:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=M;case M:if(1024&r.flags){for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0}else r.head&&(r.head.extra=null);r.mode=T;case T:if(1024&r.flags&&((fe=r.length)>ie&&(fe=ie),fe&&(r.head&&(_e=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),a.arraySet(r.head.extra,ee,re,fe,_e)),512&r.flags&&(r.check=i(r.check,ee,fe,re)),ie-=fe,re+=fe,r.length-=fe),r.length))break e;r.length=0,r.mode=P;case P:if(2048&r.flags){if(0===ie)break e;fe=0;do{_e=ee[re+fe++],r.head&&_e&&r.length<65536&&(r.head.name+=String.fromCharCode(_e))}while(_e&&fe>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=R;break;case L:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>=7&le,le-=7&le,r.mode=q;break}for(;le<3;){if(0===ie)break e;ie--,se+=ee[re++]<>>=1)){case 0:r.mode=I;break;case 1:if(de(r),r.mode=V,t===h){se>>>=2,le-=2;break e}break;case 2:r.mode=U;break;case 3:e.msg="invalid block type",r.mode=K}se>>>=2,le-=2;break;case I:for(se>>>=7&le,le-=7≤le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=K;break}if(r.length=65535&se,se=0,le=0,r.mode=N,t===h)break e;case N:r.mode=D;case D:if(fe=r.length){if(fe>ie&&(fe=ie),fe>oe&&(fe=oe),0===fe)break e;a.arraySet(te,ee,re,fe,ne),ie-=fe,re+=fe,oe-=fe,ne+=fe,r.length-=fe;break}r.mode=R;break;case U:for(;le<14;){if(0===ie)break e;ie--,se+=ee[re++]<>>=5,le-=5,r.ndist=1+(31&se),se>>>=5,le-=5,r.ncode=4+(15&se),se>>>=4,le-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=K;break}r.have=0,r.mode=j;case j:for(;r.have>>=3,le-=3}for(;r.have<19;)r.lens[Pe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},Ae=s(l,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid code lengths set",r.mode=K;break}r.have=0,r.mode=B;case B:for(;r.have>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=ve,le-=ve,r.lens[r.have++]=ye;else{if(16===ye){for(Se=ve+2;le>>=ve,le-=ve,0===r.have){e.msg="invalid bit length repeat",r.mode=K;break}_e=r.lens[r.have-1],fe=3+(3&se),se>>>=2,le-=2}else if(17===ye){for(Se=ve+3;le>>=ve)),se>>>=3,le-=3}else{for(Se=ve+7;le>>=ve)),se>>>=7,le-=7}if(r.have+fe>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=K;break}for(;fe--;)r.lens[r.have++]=_e}}if(r.mode===K)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=K;break}if(r.lenbits=9,Ee={bits:r.lenbits},Ae=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid literal/lengths set",r.mode=K;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},Ae=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,Ae){e.msg="invalid distances set",r.mode=K;break}if(r.mode=V,t===h)break e;case V:r.mode=z;case z:if(ie>=6&&oe>=258){e.next_out=ne,e.avail_out=oe,e.next_in=re,e.avail_in=ie,r.hold=se,r.bits=le,o(e,ce),ne=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,ie=e.avail_in,se=r.hold,le=r.bits,r.mode===R&&(r.back=-1);break}for(r.back=0;ge=(Me=r.lencode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,r.length=ye,0===ge){r.mode=W;break}if(32&ge){r.back=-1,r.mode=R;break}if(64&ge){e.msg="invalid literal/length code",r.mode=K;break}r.extra=15&ge,r.mode=G;case G:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=H;case H:for(;ge=(Me=r.distcode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,64&ge){e.msg="invalid distance code",r.mode=K;break}r.offset=ye,r.extra=15&ge,r.mode=X;case X:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=K;break}r.mode=Y;case Y:if(0===oe)break e;if(fe=ce-oe,r.offset>fe){if((fe=r.offset-fe)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=K;break}fe>r.wnext?(fe-=r.wnext,pe=r.wsize-fe):pe=r.wnext-fe,fe>r.length&&(fe=r.length),me=r.window}else me=te,pe=ne-r.offset,fe=r.length;fe>oe&&(fe=oe),oe-=fe,r.length-=fe;do{te[ne++]=me[pe++]}while(--fe);0===r.length&&(r.mode=z);break;case W:if(0===oe)break e;te[ne++]=r.length,oe--,r.mode=z;break;case q:if(r.wrap){for(;le<32;){if(0===ie)break e;ie--,se|=ee[re++]<0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),a?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?x(e,o,t,!1):M(e,o)):x(e,o,t,!1))):a||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),O(e)}function M(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var a;ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++a}return t.length-=a,n}(e,t):function(e,t){var r=u.allocUnsafe(e),a=t.head,n=1;a.data.copy(r),e-=a.data.length;for(;a=a.next;){var i=a.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++n,a.next?t.head=a.next:t.head=t.tail=null):(t.head=a,a.data=i.slice(o));break}++n}return t.length-=n,r}(e,t);return a}(e,t.buffer,t.decoder),r);var r}function C(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function k(e,t){for(var r=0,a=e.length;r=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):E(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&C(this),null;var a,n=t.needReadable;return h("need readable",n),(0===t.length||t.length-e0?L(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&C(this)),null!==a&&this.emit("data",a),a},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var l=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?c:b;function u(t,a){h("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",v),e.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",b),r.removeListener("data",m),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){h("onend"),e.end()}i.endEmitted?n.nextTick(l):r.once("end",l),e.on("unpipe",u);var f=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",f);var d=!1;var p=!1;function m(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==k(i.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(t){h("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){h("onfinish"),e.removeListener("close",g),b()}function b(){h("unpipe"),r.unpipe(e)}return r.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i=i)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(e){return"[Circular]"}default:return e}})),l=a[r];r=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),p(r)?a.showHidden=r:r&&t._extend(a,r),y(a.showHidden)&&(a.showHidden=!1),y(a.depth)&&(a.depth=2),y(a.colors)&&(a.colors=!1),y(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=l),c(a,e,a.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function c(e,r,a){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(a,e);return g(n)||(n=c(e,n,a)),n}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(A(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return f(r)}var u,w="",E=!1,S=["{","}"];(h(r)&&(E=!0,S=["[","]"]),A(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),x(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+f(r)),0!==o.length||E&&0!=r.length?a<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=E?function(e,t,r,a,n){for(var i=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,w,S)):S[0]+w+S[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,a,n,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),P(a,n)||(o="["+n+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(i&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===E(e)}function _(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function A(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(y(i)&&(i=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var a=e.pid;o[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,a,e)}}else o[r]=function(){};return o[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=b,t.isObject=w,t.isDate=x,t.isError=_,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(119);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(6),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),a=r.length;a--;)e[r[a]]=t[r[a]];return e};var F="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(F&&e[F]){var t;if("function"!=typeof(t=e[F]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,F,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,a=new Promise((function(e,a){t=e,r=a})),n=[],i=0;i",y=h?">":"<",b=void 0;if(v){var w=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+i,_="exclType"+i,A="exclIsNumber"+i,E="' + "+(T="op"+i)+" + '";n+=" var schemaExcl"+i+" = "+w+"; ",n+=" var "+x+"; var "+_+" = typeof "+(w="schemaExcl"+i)+"; if ("+_+" != 'boolean' && "+_+" != 'undefined' && "+_+" != 'number') { ";var S;b=p;(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var M=n;n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+_+" == 'number' ? ( ("+x+" = "+a+" === undefined || "+w+" "+g+"= "+a+") ? "+f+" "+y+"= "+w+" : "+f+" "+y+" "+a+" ) : ( ("+x+" = "+w+" === true) ? "+f+" "+y+"= "+a+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { var op"+i+" = "+x+" ? '"+g+"' : '"+g+"='; ",void 0===s&&(b=p,u=e.errSchemaPath+"/"+p,a=w,d=v)}else{E=g;if((A="number"==typeof m)&&d){var T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" ( "+a+" === undefined || "+m+" "+g+"= "+a+" ? "+f+" "+y+"= "+m+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { "}else{A&&void 0===s?(x=!0,b=p,u=e.errSchemaPath+"/"+p,a=m,y+="="):(A&&(a=Math[h?"min":"max"](m,s)),m===(!A||a)?(x=!0,b=p,u=e.errSchemaPath+"/"+p,y+="="):(x=!1,E+="="));T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+" "+y+" "+a+" || "+f+" !== "+f+") { "}}b=b||t,(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+T+", limit: "+a+", exclusive: "+x+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+E+" ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";M=n;return n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+".length "+("maxItems"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s;var h="maxLength"==t?">":"<";n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?n+=" "+f+".length ":n+=" ucs2length("+f+") ",n+=" "+h+" "+a+") { ";var p=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" Object.keys("+f+").length "+("maxProperties"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},function(e){e.exports=JSON.parse('{"switch":{"title":"switch","type":"array","items":[{"enum":["switch"]},{"type":"object","properties":{"compareTo":{"$ref":"definitions#/definitions/contextualizedFieldName"},"compareToValue":{"type":"string"},"fields":{"type":"object","patternProperties":{"^[-a-zA-Z0-9 _:]+$":{"$ref":"dataType"}},"additionalProperties":false},"default":{"$ref":"dataType"}},"oneOf":[{"required":["compareTo","fields"]},{"required":["compareToValue","fields"]}],"additionalProperties":false}],"additionalItems":false},"option":{"title":"option","type":"array","items":[{"enum":["option"]},{"$ref":"dataType"}],"additionalItems":false}}')},function(e,t,r){"use strict";(function(t,a){var n;e.exports=S,S.ReadableState=E;r(19).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(73),s=r(8).Buffer,l=t.Uint8Array||function(){};var u,c=r(172);u=c&&c.debuglog?c.debuglog("stream"):function(){};var f,d,h,p=r(173),m=r(74),v=r(75).getHighWaterMark,g=r(16).codes,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,x=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6)(S,o);var _=m.errorOrDestroy,A=["error","close","destroy","pause","resume"];function E(e,t,a){n=n||r(17),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",a),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(29).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(17),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function M(e,t,r,a,n){u("readableAddChunk",t);var i,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}(e,o);else if(n||(i=function(e,t){var r;a=t,s.isBuffer(a)||a instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var a;return r}(o,t)),i)_(e,i);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),a)o.endEmitted?_(e,new x):T(e,o,t,!0);else if(o.ended)_(e,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):C(e,o)):T(e,o,t,!1)}else a||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,a.nextTick(L,e))}function L(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function C(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){u("readable nexttick read 0"),e.read(0)}function N(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,a.nextTick(B,t,e))}function B(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function V(e,t){for(var r=0,a=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=F(e,t))&&t.ended)return 0===t.length&&j(this),null;var a,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==a&&this.emit("data",a),a},S.prototype._read=function(e){_(this,new w("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?l:v;function s(t,a){u("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",v),r.removeListener("data",d),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){u("onend"),e.end()}n.endEmitted?a.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var f=!1;function d(t){u("ondata");var a=e.write(t);u("dest.write",a),!1===a&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!f&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){u("onerror",t),v(),e.removeListener("error",h),0===i(e,"error")&&_(e,t)}function p(){e.removeListener("finish",m),v()}function m(){u("onfinish"),e.removeListener("close",p),v()}function v(){u("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",m),e.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?O(this):n.reading||a.nextTick(I,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&a.nextTick(k,this),r},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||a.nextTick(k,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(N,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(a=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,L(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=f.destroy,S.prototype._undestroy=f.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this,r(4),r(5))},function(e,t,r){"use strict";e.exports=c;var a=r(16).codes,n=a.ERR_METHOD_NOT_IMPLEMENTED,i=a.ERR_MULTIPLE_CALLBACK,o=a.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=a.ERR_TRANSFORM_WITH_LENGTH_0,l=r(17);function u(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(null===a)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),a(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length1&&void 0!==arguments[1]?arguments[1]:{tolerance:0};if(!e)throw new Error("You should specify the element you want to test");"string"==typeof e&&(e=document.querySelector(e));var r=e.getBoundingClientRect();return(r.bottom-t.tolerance>0&&r.right-t.tolerance>0&&r.left+t.tolerance<(window.innerWidth||document.documentElement.clientWidth)&&r.top+t.tolerance<(window.innerHeight||document.documentElement.clientHeight))}function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0,container:""};if(!e)throw new Error("You should specify the element you want to test");if("string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={tolerance:0,container:document.querySelector(t)}),"string"==typeof t.container&&(t.container=document.querySelector(t.container)),t instanceof HTMLElement&&(t={tolerance:0,container:t}),!t.container)throw new Error("You should specify a container element");var r=t.container.getBoundingClientRect();return(e.offsetTop+e.clientHeight-t.tolerance>t.container.scrollTop&&e.offsetLeft+e.clientWidth-t.tolerance>t.container.scrollLeft&&e.offsetLeft+t.tolerance0&&void 0!==arguments[0]?arguments[0]:{tolerance:0,debounce:100,container:window};this.options={},this.trackedElements={},Object.defineProperties(this.options,{container:{configurable:!1,enumerable:!1,get:function(){var e=void 0;return"string"==typeof n.container?e=document.querySelector(n.container):n.container instanceof HTMLElement&&(e=n.container),e||window},set:function(e){n.container=e}},debounce:{get:function(){return parseInt(n.debounce,10)||100},set:function(e){n.debounce=e}},tolerance:{get:function(){return parseInt(n.tolerance,10)||0},set:function(e){n.tolerance=e}}}),Object.defineProperty(this,"_scroll",{enumerable:!1,configurable:!1,writable:!1,value:this._debouncedScroll.call(this)}),e=document.querySelector("body"),t=function(){Object.keys(a.trackedElements).forEach((function(e){a.on("enter",e),a.on("leave",e)}))},(r=window.MutationObserver||window.WebKitMutationObserver)?new r(t).observe(e,{childList:!0,subtree:!0}):(e.addEventListener("DOMNodeInserted",t,!1),e.addEventListener("DOMNodeRemoved",t,!1)),this.attach()}return Object.defineProperties(r.prototype,{_debouncedScroll:{configurable:!1,writable:!1,enumerable:!1,value:function(){var r=this,a=void 0;return function(){clearTimeout(a),a=setTimeout((function(){!function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0},n=Object.keys(r),i=void 0;n.length&&(i=a.container===window?e:t,n.forEach((function(e){r[e].nodes.forEach((function(t){if(i(t.node,a)?(t.wasVisible=t.isVisible,t.isVisible=!0):(t.wasVisible=t.isVisible,t.isVisible=!1),!0===t.isVisible&&!1===t.wasVisible){if(!r[e].enter)return;Object.keys(r[e].enter).forEach((function(a){"function"==typeof r[e].enter[a]&&r[e].enter[a](t.node,"enter")}))}if(!1===t.isVisible&&!0===t.wasVisible){if(!r[e].leave)return;Object.keys(r[e].leave).forEach((function(a){"function"==typeof r[e].leave[a]&&r[e].leave[a](t.node,"leave")}))}}))})))}(r.trackedElements,r.options)}),r.options.debounce)}}},attach:{configurable:!1,writable:!1,enumerable:!1,value:function(){var e=this.options.container;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.addEventListener("scroll",this._scroll,{passive:!0}),window.addEventListener("resize",this._scroll,{passive:!0}),this._scroll(),this.attached=!0}},destroy:{configurable:!1,writable:!1,enumerable:!1,value:function(){this.options.container.removeEventListener("scroll",this._scroll),window.removeEventListener("resize",this._scroll),this.attached=!1}},off:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){var a=Object.keys(this.trackedElements[t].enter||{}),n=Object.keys(this.trackedElements[t].leave||{});if({}.hasOwnProperty.call(this.trackedElements,t))if(r){if(this.trackedElements[t][e]){var i="function"==typeof r?r.name:r;delete this.trackedElements[t][e][i]}}else delete this.trackedElements[t][e];a.length||n.length||delete this.trackedElements[t]}},on:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){if(!e)throw new Error("No event given. Choose either enter or leave");if(!t)throw new Error("No selector to track");if(["enter","leave"].indexOf(e)<0)throw new Error(e+" event is not supported");({}).hasOwnProperty.call(this.trackedElements,t)||(this.trackedElements[t]={}),this.trackedElements[t].nodes=[];for(var a=0,n=document.querySelectorAll(t);a0&&void 0!==arguments[0]?arguments[0]:this.clock.getDelta(),t=this.renderer.getRenderTarget(),r=!1,a=void 0,n=void 0,i=this.passes.length;for(n=0;n=96;r(88)(e);var a=new e.MeshDepthMaterial;a.depthPacking=e.RGBADepthPacking,a.clipping=!0,a.defines={INSTANCE_TRANSFORM:""};var n=e.ShaderLib.distanceRGBA,i=e.UniformsUtils.clone(n.uniforms),o=new e.ShaderMaterial({defines:{USE_SHADOWMAP:"",INSTANCE_TRANSFORM:""},uniforms:i,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,clipping:!0});return e.InstancedMesh=function(t,r,n,i,s,l){e.Mesh.call(this,(new e.InstancedBufferGeometry).copy(t)),this._dynamic=!!i,this._uniformScale=!!l,this._colors=!!s,this.numInstances=n,this._setAttributes(),this.material=r,this.frustumCulled=!1,this.customDepthMaterial=a,this.customDistanceMaterial=o},e.InstancedMesh.prototype=Object.create(e.Mesh.prototype),e.InstancedMesh.constructor=e.InstancedMesh,Object.defineProperties(e.InstancedMesh.prototype,{material:{set:function(e){let t=function(e){e.defines?(e.defines.INSTANCE_TRANSFORM="",this._uniformScale?e.defines.INSTANCE_UNIFORM="":delete e.defines.INSTANCE_UNIFORM,this._colors?e.defines.INSTANCE_COLOR="":delete e.defines.INSTANCE_COLOR):(e.defines={INSTANCE_TRANSFORM:""},this._uniformScale&&(e.defines.INSTANCE_UNIFORM=""),this._colors&&(e.defines.INSTANCE_COLOR=""))};if(Array.isArray(e)){e=e.slice(0);for(let r=0;r{const n=r[a];let i;t?i=new e.InstancedBufferAttribute(...n):(i=new e.InstancedBufferAttribute(n[0],n[1],n[3])).normalized=n[2],i.dynamic=this._dynamic,this.geometry.addAttribute(a,i)})},e.InstancedMesh}},function(e,t,r){e.exports=function(e){return/InstancedMesh/.test(e.REVISION)?e:(r(89)(e),e.REVISION+="_InstancedMesh",e)}},function(e,t,r){e.exports=function(e){e.ShaderChunk.begin_vertex=r(90),e.ShaderChunk.color_fragment=r(91),e.ShaderChunk.color_pars_fragment=r(92),e.ShaderChunk.color_vertex=r(93),e.ShaderChunk.defaultnormal_vertex=r(94),e.ShaderChunk.uv_pars_vertex=r(95)}},function(e,t){e.exports=["#ifndef INSTANCE_TRANSFORM","vec3 transformed = vec3( position );","#else","#ifndef INSTANCE_MATRIX","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","vec3 transformed = ( _instanceMatrix * vec4( position , 1. )).xyz;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","diffuseColor.rgb *= vColor;","#endif","#if defined(INSTANCE_COLOR)","diffuseColor.rgb *= vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","varying vec3 vColor;","#endif","#if defined( INSTANCE_COLOR )","varying vec3 vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","vColor.xyz = color.xyz;","#endif","#if defined( INSTANCE_COLOR ) && defined( INSTANCE_TRANSFORM )","vInstanceColor = instanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef FLIP_SIDED","objectNormal = -objectNormal;","#endif","#ifndef INSTANCE_TRANSFORM","vec3 transformedNormal = normalMatrix * objectNormal;","#else","#ifndef INSTANCE_MATRIX ","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","#ifndef INSTANCE_UNIFORM","vec3 transformedNormal = transposeMat3( inverse( mat3( modelViewMatrix * _instanceMatrix ) ) ) * objectNormal ;","#else","vec3 transformedNormal = ( modelViewMatrix * _instanceMatrix * vec4( objectNormal , 0.0 ) ).xyz;","#endif","#endif"].join("\n")},function(e,t){e.exports=["#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )","varying vec2 vUv;","uniform mat3 uvTransform;","#endif","#ifdef INSTANCE_TRANSFORM","mat3 inverse(mat3 m) {","float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];","float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];","float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];","float b01 = a22 * a11 - a12 * a21;","float b11 = -a22 * a10 + a12 * a20;","float b21 = a21 * a10 - a11 * a20;","float det = a00 * b01 + a01 * b11 + a02 * b21;","return mat3(b01, (-a22 * a01 + a02 * a21), ( a12 * a01 - a02 * a11),","b11, ( a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),","b21, (-a21 * a00 + a01 * a20), ( a11 * a00 - a01 * a10)) / det;","}","attribute vec3 instancePosition;","attribute vec4 instanceQuaternion;","attribute vec3 instanceScale;","#if defined( INSTANCE_COLOR )","attribute vec3 instanceColor;","varying vec3 vInstanceColor;","#endif","mat4 getInstanceMatrix(){","vec4 q = instanceQuaternion;","vec3 s = instanceScale;","vec3 v = instancePosition;","vec3 q2 = q.xyz + q.xyz;","vec3 a = q.xxx * q2.xyz;","vec3 b = q.yyz * q2.yzz;","vec3 c = q.www * q2.xyz;","vec3 r0 = vec3( 1.0 - (b.x + b.z) , a.y + c.z , a.z - c.y ) * s.xxx;","vec3 r1 = vec3( a.y - c.z , 1.0 - (a.x + b.z) , b.y + c.x ) * s.yyy;","vec3 r2 = vec3( a.z + c.y , b.y - c.x , 1.0 - (a.x + b.x) ) * s.zzz;","return mat4(","r0 , 0.0,","r1 , 0.0,","r2 , 0.0,","v , 1.0",");","}","#endif"].join("\n")},function(e,t,r){"use strict";var a={};(0,r(11).assign)(a,r(97),r(99),r(37)),e.exports=a},function(e,t,r){"use strict";var a=r(51),n=r(11),i=r(54),o=r(35),s=r(36),l=Object.prototype.toString,u=0,c=-1,f=0,d=8;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({level:c,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&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 r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==u)throw new Error(o[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,p))!==u)throw new Error(o[r]);this._dict_set=!0}}function p(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}h.prototype.push=function(e,t){var r,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=i.string2buf(e):"[object ArrayBuffer]"===l.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 n.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=a.deflate(s,o))&&r!==u)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(n.shrinkBuf(s.output,s.next_out))):this.onData(n.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u):2!==o||(this.onEnd(u),s.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=h,t.deflate=p,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},function(e,t,r){"use strict";var a=r(11),n=4,i=0,o=1,s=2;function l(e){for(var t=e.length;--t>=0;)e[t]=0}var u=0,c=1,f=2,d=29,h=256,p=h+1+d,m=30,v=19,g=2*p+1,y=15,b=16,w=7,x=256,_=16,A=17,E=18,S=[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],M=[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],T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(p+2));l(F);var O=new Array(2*m);l(O);var L=new Array(512);l(L);var C=new Array(256);l(C);var R=new Array(d);l(R);var k,I,N,D=new Array(m);function U(e,t,r,a,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=a,this.max_length=n,this.has_stree=e&&e.length}function j(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function B(e){return e<256?L[e]:L[256+(e>>>7)]}function V(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function z(e,t,r){e.bi_valid>b-r?(e.bi_buf|=t<>b-e.bi_valid,e.bi_valid+=r-b):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function X(e,t,r){var a,n,i=new Array(y+1),o=0;for(a=1;a<=y;a++)i[a]=o=o+r[a-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=H(i[s]++,s))}}function Y(e){var t;for(t=0;t8?V(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,a){var n=2*t,i=2*r;return e[n]>1;r>=1;r--)Q(e,i,r);n=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Q(e,i,1),a=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=a,i[2*n]=i[2*r]+i[2*a],e.depth[n]=(e.depth[r]>=e.depth[a]?e.depth[r]:e.depth[a])+1,i[2*r+1]=i[2*a+1]=n,e.heap[1]=n++,Q(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,a,n,i,o,s,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(i=0;i<=y;i++)e.bl_count[i]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(i=p,m++),l[2*a+1]=i,a>u||(e.bl_count[i]++,o=0,a>=h&&(o=d[a-h]),s=l[2*a],e.opt_len+=s*(i+o),f&&(e.static_len+=s*(c[2*a+1]+o)));if(0!==m){do{for(i=p-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(i=p;0!==i;i--)for(a=e.bl_count[i];0!==a;)(n=e.heap[--r])>u||(l[2*n+1]!==i&&(e.opt_len+=(i-l[2*n+1])*l[2*n],l[2*n+1]=i),a--)}}(e,t),X(i,u,e.bl_count)}function J(e,t,r){var a,n,i=-1,o=t[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(r+1)+1]=65535,a=0;a<=r;a++)n=o,o=t[2*(a+1)+1],++s>=7;a0?(e.strm.data_type===s&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&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 o;for(t=32;t=3&&0===e.bl_tree[2*P[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),l=e.opt_len+3+7>>>3,(u=e.static_len+3+7>>>3)<=l&&(l=u)):l=u=r+5,r+4<=l&&-1!==t?te(e,t,r,a):e.strategy===n||u===l?(z(e,(c<<1)+(a?1:0),3),Z(e,F,O)):(z(e,(f<<1)+(a?1:0),3),function(e,t,r,a){var n;for(z(e,t-257,5),z(e,r-1,5),z(e,a-4,4),n=0;n>>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&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(C[r]+h+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){z(e,c<<1,3),G(e,x,F),function(e){16===e.bi_valid?(V(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,r){"use strict";var a=r(55),n=r(11),i=r(54),o=r(37),s=r(35),l=r(36),u=r(102),c=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new u,a.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=i.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=a.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function d(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,l,u,f,d=this.strm,h=this.options.chunkSize,p=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?d.input=i.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new n.Buf8(h),d.next_out=0,d.avail_out=h),(r=a.inflate(d,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(r=a.inflateSetDictionary(this.strm,p)),r===o.Z_BUF_ERROR&&!0===m&&(r=o.Z_OK,m=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==o.Z_STREAM_END&&(0!==d.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=i.utf8border(d.output,d.next_out),u=d.next_out-l,f=i.buf2string(d.output,l),d.next_out=u,d.avail_out=h-u,u&&n.arraySet(d.output,d.output,l,u,0),this.onData(f)):this.onData(n.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),d.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=d,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.ungzip=d},function(e,t,r){"use strict";e.exports=function(e,t){var r,a,n,i,o,s,l,u,c,f,d,h,p,m,v,g,y,b,w,x,_,A,E,S,M;r=e.state,a=e.next_in,S=e.input,n=a+(e.avail_in-5),i=e.next_out,M=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,f=r.wnext,d=r.window,h=r.hold,p=r.bits,m=r.lencode,v=r.distcode,g=(1<>>=w=b>>>24,p-=w,0===(w=b>>>16&255))M[i++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(h&(1<>>=w,p-=w),p<15&&(h+=S[a++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=v[(65535&b)+(h&(1<l){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,p-=w,_>(w=i-o)){if((w=_-w)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(A=0,E=d,0===f){if(A+=u-w,w2;)M[i++]=E[A++],M[i++]=E[A++],M[i++]=E[A++],x-=3;x&&(M[i++]=E[A++],x>1&&(M[i++]=E[A++]))}else{A=i-_;do{M[i++]=M[A++],M[i++]=M[A++],M[i++]=M[A++],x-=3}while(x>2);x&&(M[i++]=M[A++],x>1&&(M[i++]=M[A++]))}break}}break}}while(a>3,h&=(1<<(p-=x<<3))-1,e.next_in=a,e.next_out=i,e.avail_in=a=1&&0===I[M];M--);if(T>M&&(T=M),0===M)return u[c++]=20971520,u[c++]=20971520,d.bits=1,0;for(S=1;S0&&(0===e||1!==M))return-1;for(N[1]=0,A=1;A<15;A++)N[A+1]=N[A]+I[A];for(E=0;E852||2===e&&L>592)return 1;for(;;){b=A-F,f[E]y?(w=D[U+f[E]],x=R[k+f[E]]):(w=96,x=0),h=1<>F)+(p-=h)]=b<<24|w<<16|x|0}while(0!==p);for(h=1<>=1;if(0!==h?(C&=h-1,C+=h):C=0,E++,0==--I[A]){if(A===M)break;A=t[r+f[E]]}if(A>T&&(C&v)!==m){for(0===F&&(F=T),g+=S,O=1<<(P=A-F);P+F852||2===e&&L>592)return 1;u[m=C&v]=T<<24|P<<16|g-c|0}}return 0!==C&&(u[g+C]=A-F<<24|64<<16|0),d.bits=T,0}},function(e,t,r){"use strict";e.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}},function(e,t,r){"use strict";(function(e){var a=r(8).Buffer,n=r(106).Transform,i=r(117),o=r(62),s=r(30).ok,l=r(8).kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";i.Z_MIN_WINDOWBITS=8,i.Z_MAX_WINDOWBITS=15,i.Z_DEFAULT_WINDOWBITS=15,i.Z_MIN_CHUNK=64,i.Z_MAX_CHUNK=1/0,i.Z_DEFAULT_CHUNK=16384,i.Z_MIN_MEMLEVEL=1,i.Z_MAX_MEMLEVEL=9,i.Z_DEFAULT_MEMLEVEL=8,i.Z_MIN_LEVEL=-1,i.Z_MAX_LEVEL=9,i.Z_DEFAULT_LEVEL=i.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(i),f=0;f=l?o=new RangeError(u):t=a.concat(n,i),n=[],e.close(),r(o,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)})),e.on("end",s),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=a.from(t)),!a.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function b(e){if(!(this instanceof b))return new b(e);T.call(this,e,i.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);T.call(this,e,i.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,i.GZIP)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,i.GUNZIP)}function A(e){if(!(this instanceof A))return new A(e);T.call(this,e,i.DEFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);T.call(this,e,i.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,i.UNZIP)}function M(e){return e===i.Z_NO_FLUSH||e===i.Z_PARTIAL_FLUSH||e===i.Z_SYNC_FLUSH||e===i.Z_FULL_FLUSH||e===i.Z_FINISH||e===i.Z_BLOCK}function T(e,r){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,n.call(this,e),e.flush&&!M(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!M(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||i.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:i.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!a.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new i.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){P(s),s._hadError=!0;var a=new Error(e);a.errno=r,a.code=t.codes[r],s.emit("error",a)};var l=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(l=e.level);var u=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,l,e.memLevel||t.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=a.allocUnsafe(this._chunkSize),this._offset=0,this._level=l,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function P(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function F(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),t.Deflate=b,t.Inflate=w,t.Gzip=x,t.Gunzip=_,t.DeflateRaw=A,t.InflateRaw=E,t.Unzip=S,t.createDeflate=function(e){return new b(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new A(e)},t.createInflateRaw=function(e){return new E(e)},t.createGzip=function(e){return new x(e)},t.createGunzip=function(e){return new _(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new b(t),e,r)},t.deflateSync=function(e,t){return y(new b(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new x(t),e,r)},t.gzipSync=function(e,t){return y(new x(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new A(t),e,r)},t.deflateRawSync=function(e,t){return y(new A(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new S(t),e,r)},t.unzipSync=function(e,t){return y(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new w(t),e,r)},t.inflateSync=function(e,t){return y(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new _(t),e,r)},t.gunzipSync=function(e,t){return y(new _(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new E(t),e,r)},t.inflateRawSync=function(e,t){return y(new E(t),e)},o.inherits(T,n),T.prototype.params=function(r,a,n){if(rt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(a!=t.Z_FILTERED&&a!=t.Z_HUFFMAN_ONLY&&a!=t.Z_RLE&&a!=t.Z_FIXED&&a!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+a);if(this._level!==r||this._strategy!==a){var o=this;this.flush(i.Z_SYNC_FLUSH,(function(){s(o._handle,"zlib binding closed"),o._handle.params(r,a),o._hadError||(o._level=r,o._strategy=a,n&&n())}))}else e.nextTick(n)},T.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},T.prototype._flush=function(e){this._transform(a.alloc(0),"",e)},T.prototype.flush=function(t,r){var n=this,o=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=i.Z_FULL_FLUSH),o.ended?r&&e.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",(function(){return n.flush(t,r)})):(this._flushFlag=t,this.write(a.alloc(0),"",r))},T.prototype.close=function(t){P(this,t),e.nextTick(F,this)},T.prototype._transform=function(e,t,r){var n,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||a.isBuffer(e)?this._handle?(s?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||i.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},T.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,c=this,f="function"==typeof r;if(!f){var d,h=[],p=0;this.on("error",(function(e){d=e})),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw d;if(p>=l)throw P(this),new RangeError(u);var v=a.concat(h,p);return P(this),v}s(this._handle,"zlib binding closed");var g=this._handle.write(t,e,o,n,this._buffer,this._offset,i);function y(l,u){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var d=i-u;if(s(d>=0,"have should not go down"),d>0){var m=c._buffer.slice(c._offset,c._offset+d);c._offset+=d,f?c.push(m):(h.push(m),p+=m.length)}if((0===u||c._offset>=c._chunkSize)&&(i=c._chunkSize,c._offset=0,c._buffer=a.allocUnsafe(c._chunkSize)),0===u){if(o+=n-l,n=l,!f)return!0;var v=c._handle.write(t,e,o,n,c._buffer,c._offset,c._chunkSize);return v.callback=y,void(v.buffer=e)}if(!f)return!1;r()}}g.buffer=e,g.callback=y},o.inherits(b,T),o.inherits(w,T),o.inherits(x,T),o.inherits(_,T),o.inherits(A,T),o.inherits(E,T),o.inherits(S,T)}).call(this,r(5))},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],a=t[1];return 3*(r+a)/4-a},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));1===n?(t=e[r-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var n,i,o=[],s=t;s>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,a,n){var i,o,s=8*n-a-1,l=(1<>1,c=-7,f=r?n-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=d,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=a;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,a),i-=u}return(h?-1:1)*o*Math.pow(2,i-a)},t.write=function(e,t,r,a,n,i){var o,s,l,u=8*i-n-1,c=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=a?0:i-1,p=a?1:-1,m=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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,n),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;e[r+h]=255&s,h+=p,s/=256,n-=8);for(o=o<0;e[r+h]=255&o,h+=p,o/=256,u-=8);e[r+h-p]|=128*m}},function(e,t,r){e.exports=n;var a=r(19).EventEmitter;function n(){a.call(this)}r(6)(n,a),n.Readable=r(38),n.Writable=r(113),n.Duplex=r(114),n.Transform=r(115),n.PassThrough=r(116),n.Stream=n,n.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===a.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var a=r(28).Buffer,n=r(109);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,t.copy(r,n),s+=o.data.length,o=o.next;return i},e}(),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var a=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(n.call(setTimeout,a,arguments),clearTimeout)},t.setInterval=function(){return new i(n.call(setInterval,a,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(a,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(111),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(4))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var a,n,i,o,s,l=1,u={},c=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?a=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},a=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(n=f.documentElement,a=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):a=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),a=function(t){e.postMessage(o+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;rt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,n(this.init_done,"close before init"),n(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,a,n,i,o){return this._write(!0,e,t,r,a,n,i,o)},c.prototype.writeSync=function(e,t,r,a,n,i,o){return this._write(!1,e,t,r,a,n,i,o)},c.prototype._write=function(r,i,o,s,l,u,c,f){if(n.equal(arguments.length,8),n(this.init_done,"write before init"),n(this.mode!==t.NONE,"already finalized"),n.equal(!1,this.write_in_progress,"write already in progress"),n.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,n.equal(!1,void 0===i,"must provide flush value"),this.write_in_progress=!0,i!==t.Z_NO_FLUSH&&i!==t.Z_PARTIAL_FLUSH&&i!==t.Z_SYNC_FLUSH&&i!==t.Z_FULL_FLUSH&&i!==t.Z_FINISH&&i!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=e.alloc(0),l=0,s=0),this.strm.avail_in=l,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=u,this.strm.next_out=c,this.flush=i,!r)return this._process(),this._checkError()?this._afterSync():void 0;var d=this;return a.nextTick((function(){d._process(),d._after()})),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,r,a,i,o){n(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),n(e>=8&&e<=15,"invalid windowBits"),n(r>=-1&&r<=9,"invalid compression level"),n(a>=1&&a<=9,"invalid memlevel"),n(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,a,i,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,r,a,n,l){switch(this.level=e,this.windowBits=r,this.memLevel=a,this.strategy=n,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new i,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=l,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=o.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=c}).call(this,r(8).Buffer,r(5))},function(e,t,r){"use strict"; + */function n(e,t){if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);n=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(e[s],t[s],r,a))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function x(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,a){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(a=r,r=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),a=(r&&r.name?" ("+r.name+").":".")+(a?" "+a:"."),e&&!n&&g(n,r,"Missing expected exception"+a);var i="string"==typeof a,s=!e&&n&&!r;if((!e&&o.isError(n)&&i&&x(n,r)||s)&&g(n,r,"Got unwanted exception"+a),e&&n&&r&&!x(n,r)||!e&&n)throw n}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(v(e.actual),128)+" "+e.operator+" "+m(v(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var a=r.stack,n=p(t),i=a.indexOf("\n"+n);if(i>=0){var o=a.indexOf("\n",i+1);a=a.substring(o+1)}this.stack=a}}},o.inherits(d.AssertionError,Error),d.fail=g,d.ok=y,d.equal=function(e,t,r){e!=t&&g(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){b(e,t,!1)||g(e,t,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,r){b(e,t,!0)||g(e,t,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,r){b(e,t,!1)&&g(e,t,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,r,a){b(t,r,!0)&&g(t,r,a,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",d.notStrictEqual)},d.throws=function(e,t,r){_(!0,e,t,r)},d.doesNotThrow=function(e,t,r){_(!1,e,t,r)},d.ifError=function(e){if(e)throw e},d.strict=a((function e(t,r){t||g(t,!0,r,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var A=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(35);Object.defineProperty(t,"CopyShader",{enumerable:!0,get:function(){return h(a).default}});var n=r(10);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return h(n).default}});var i=r(49);Object.defineProperty(t,"ShaderPass",{enumerable:!0,get:function(){return h(i).default}});var o=r(83);Object.defineProperty(t,"RenderingPass",{enumerable:!0,get:function(){return h(o).default}});var s=r(84);Object.defineProperty(t,"TexturePass",{enumerable:!0,get:function(){return h(s).default}});var l=r(85);Object.defineProperty(t,"RenderPass",{enumerable:!0,get:function(){return h(l).default}});var u=r(50);Object.defineProperty(t,"MaskPass",{enumerable:!0,get:function(){return h(u).default}});var c=r(51);Object.defineProperty(t,"ClearMaskPass",{enumerable:!0,get:function(){return h(c).default}});var f=r(86);Object.defineProperty(t,"ClearPass",{enumerable:!0,get:function(){return h(f).default}});var d=r(87);function h(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h(d).default}})},function(e,t,r){var a,n,i,o,s;a=r(184),n=r(79).utf8,i=r(185),o=r(79).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):n.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var r=a.bytesToWords(e),l=8*e.length,u=1732584193,c=-271733879,f=-1732584194,d=271733878,h=0;h>>24)|4278255360&(r[h]<<24|r[h]>>>8);r[l>>>5]|=128<>>9<<4)]=l;var p=s._ff,m=s._gg,v=s._hh,g=s._ii;for(h=0;h>>0,c=c+b>>>0,f=f+w>>>0,d=d+x>>>0}return a.endian([u,c,f,d])})._ff=function(e,t,r,a,n,i,o){var s=e+(t&r|~t&a)+(n>>>0)+o;return(s<>>32-i)+t},s._gg=function(e,t,r,a,n,i,o){var s=e+(t&a|r&~a)+(n>>>0)+o;return(s<>>32-i)+t},s._hh=function(e,t,r,a,n,i,o){var s=e+(t^r^a)+(n>>>0)+o;return(s<>>32-i)+t},s._ii=function(e,t,r,a,n,i,o){var s=e+(r^(t|~a))+(n>>>0)+o;return(s<>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=a.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?o.bytesToString(r):a.bytesToHex(r)}},function(e,t,r){function a(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var a=r(r.s=ENTRY_MODULE);return a.default||a}var n="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+n+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e,t,a){var s={};s[a]=[];var l=t.toString(),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return s;for(var c,f=u[1],d=new RegExp("(\\\\n|\\W)"+o(f)+i,"g");c=d.exec(l);)"dll-reference"!==c[3]&&s[a].push(c[3]);for(d=new RegExp("\\("+o(f)+'\\("(dll-reference\\s('+n+'))"\\)\\)'+i,"g");c=d.exec(l);)e[c[2]]||(s[a].push(c[1]),e[c[2]]=r(c[1]).m),s[c[2]]=s[c[2]]||[],s[c[2]].push(c[4]);for(var h,p=Object.keys(s),m=0;m0}),!1)}e.exports=function(e,t){t=t||{};var n={main:r.m},i=t.all?{main:Object.keys(n.main)}:function(e,t){for(var r={main:[t]},a={main:[]},n={main:{}};l(r);)for(var i=Object.keys(r),o=0;o-1?a:i.nextTick;y.WritableState=g;var u=r(21);u.inherits=r(6);var c={deprecate:r(61)},f=r(59),d=r(29).Buffer,h=n.Uint8Array||function(){};var p,m=r(60);function v(){}function g(e,t){s=s||r(14),e=e||{};var a=t instanceof s;this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:a&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,a=r.sync,n=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,a,n){--t.pendingcb,r?(i.nextTick(n,a),i.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",a)):(n(a),e._writableState.errorEmitted=!0,e.emit("error",a),E(e,t))}(e,r,a,t,n);else{var o=_(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),a?l(w,e,r,o,n):w(e,r,o,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(s=s||r(14),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,r,a,n,i,o){t.writelen=a,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,i,t.onwrite),t.sync=!1}function w(e,t,r,a){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,a(),E(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var a=t.bufferedRequestCount,n=new Array(a),i=t.corkedRequestsFree;i.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,b(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),E(e,t)}))}function E(e,t){var r=_(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(A,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(y,f),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var a,n=this._writableState,o=!1,s=!n.objectMode&&(a=e,d.isBuffer(a)||a instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}(this,r):(s||function(e,t,r,a){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),i.nextTick(a,o),n=!1),n}(this,n,e,r))&&(n.pendingcb++,o=function(e,t,r,a,n,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,a,n);a!==o&&(r=!0,n="buffer",a=o)}var s=t.objectMode?1:a.length;t.length+=s;var l=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var a=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||a.finished||function(e,t,r){t.ending=!0,E(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,a,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(5),r(113).setImmediate,r(4))},function(e,t,r){"use strict";var a=r(132),n=r(42),i=r(16),o=r(64),s=r(134);function l(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof o)return p(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var n,i,s,c=u.call(this,t,r);return c&&(n=c.schema,t=c.root,s=c.baseId),n instanceof o?i=n.validate||e.call(this,n.schema,t,void 0,s):void 0!==n&&(i=p(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,s)),i}function u(e,t){var r=a.parse(t),n=v(r),i=m(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==i){var s=y(n),l=this._refs[s];if("string"==typeof l)return c.call(this,e,l,r);if(l instanceof o)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[s])instanceof o))return;if(l.validate||this._compile(l),s==y(t))return{schema:l,root:e,baseId:i};e=l}if(!e.schema)return;i=m(this._getId(e.schema))}return d.call(this,r,i,e.schema,e)}function c(e,t,r){var a=u.call(this,e,t);if(a){var n=a.schema,i=a.baseId;e=a.root;var o=this._getId(n);return o&&(i=b(i,o)),d.call(this,r,i,n,e)}}e.exports=l,l.normalizeId=y,l.fullPath=m,l.url=b,l.ids=function(e){var t=y(this._getId(e)),r={"":t},o={"":m(t,!1)},l={},u=this;return s(e,{allKeys:!0},(function(e,t,s,c,f,d,h){if(""!==t){var p=u._getId(e),m=r[c],v=o[c]+"/"+f;if(void 0!==h&&(v+="/"+("number"==typeof h?h:i.escapeFragment(h))),"string"==typeof p){p=m=y(m?a.resolve(m,p):p);var g=u._refs[p];if("string"==typeof g&&(g=u._refs[g]),g&&g.schema){if(!n(e,g.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=y(v))if("#"==p[0]){if(l[p]&&!n(e,l[p]))throw new Error('id "'+p+'" resolves to more than one schema');l[p]=e}else u._refs[p]=v}r[t]=m,o[t]=v}})),l},l.inlineRef=p,l.schema=u;var f=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var n=e.fragment.split("/"),o=1;o{if(e.file){let r=new FileReader;r.onload=function(){let e=this.result,r=new Uint8Array(e);t(r)},r.readAsArrayBuffer(e.file)}else if(e.url){let r=new XMLHttpRequest;r.open("GET",e.url,!0),r.responseType="arraybuffer",r.onloadend=function(){if(200===r.status){let e=new Uint8Array(r.response||r.responseText);t(e)}},r.send()}else e.raw?e.raw instanceof Uint8Array?t(e.raw):t(new Uint8Array(e.raw)):r()})}function o(e,t){return new Promise((r,a)=>{if("compound"===e.type)if(e.value.hasOwnProperty("blocks")&&(e.value.hasOwnProperty("palette")||e.value.hasOwnProperty("palettes"))){let a;if(e.value.hasOwnProperty("palette"))a=e.value.palette.value.value;else{if(void 0===t&&(t=0),t>=e.value.palettes.value.value.length||!e.value.palettes.value.value[t])return void console.warn("Specified palette index ("+t+") is outside of available palettes ("+e.value.palettes.value.value.length+")");a=e.value.palettes.value.value[t].value}let n=[];for(let e=0;e{let n=e.value.Width.value,i=e.value.Height.value,o=e.value.Length.value,s=function(t,r,a){let i=(r*o+a)*n+t;return{id:255&(e.value.Blocks.value[i]||0),data:e.value.Data.value[i]||0}},l=function(e,r){let a=t.blocks[e+":"+r];return a||(console.warn("Missing legacy mapping for "+e+":"+r),"minecraft:air")},u=[];for(let e=0;e{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);o(r).then(e=>{t(e)})})})},n.prototype.schematicToModels=function(e,t){i(e).then(e=>{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);let a=new XMLHttpRequest;a.open("GET","https://minerender.org/res/idsToNames.json",!0),a.onloadend=function(){if(200===a.status){console.log(a.response||a.responseText);let e=JSON.parse(a.response||a.responseText);s(r,e).then(e=>t(e))}},a.send()})})},n.loadNBT=i,n.parseStructureData=o,n.parseSchematicData=s;let l={stained_glass:function(e){return e.color.value+"_stained_glass"},planks:function(e){return e.variant.value+"_planks"}};n.prototype.constructor=n,window.ModelConverter=n,t.a=n},function(e,t,r){const a=r(106),n=r(123).ProtoDef,i=r(182).compound,o=JSON.stringify(r(183)),s=o.replace(/(i[0-9]+)/g,"l$1");function l(e){const t=new n;return t.addType("compound",i),t.addTypes(JSON.parse(e?s:o)),t}const u=l(!1),c=l(!0);function f(e,t){return(t?c:u).parsePacketBuffer("nbt",e).data}const d=function(e){let t=!0;return 31!==e[0]&&(t=!1),139!==e[1]&&(t=!1),t};e.exports={writeUncompressed:function(e,t){return(t?c:u).createPacketBuffer("nbt",e)},parseUncompressed:f,simplify:function e(t){return function t(r,a){return"compound"===a?Object.keys(r).reduce((function(t,a){return t[a]=e(r[a]),t}),{}):"list"===a?r.value.map((function(e){return t(e,r.type)})):r}(t.value,t.type)},parse:function(e,t,r){let n=!1;"function"==typeof t?r=t:n=t,d(e)?a.gunzip(e,(function(t,a){t?r(t,e):r(null,f(a,n))})):r(null,f(e,n))},proto:u,protoLE:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(){function e(e,t){for(var r=0;r4?9:0)}function $(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ae(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ne(e,t){var r,a,n=e.max_chain_length,i=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-D?e.strstart-(e.w_size-D):0,u=e.window,c=e.w_mask,f=e.prev,d=e.strstart+N,h=u[i+o-1],p=u[i+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===h&&u[r]===u[i]&&u[++r]===u[i+1]){i+=2,r++;do{}while(u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&io){if(e.match_start=t,o=a,a>=s)break;h=u[i+o-1],p=u[i+o]}}}while((t=f[t&c])>l&&0!=--n);return o<=e.lookahead?o:e.lookahead}function ie(e){var t,r,a,i,l,u,c,f,d,h,p=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-D)){n.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;do{a=e.head[--t],e.head[t]=a>=p?a-p:0}while(--r);t=r=p;do{a=e.prev[--t],e.prev[t]=a>=p?a-p:0}while(--r);i+=p}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,f=e.strstart+e.lookahead,d=i,h=void 0,(h=u.avail_in)>d&&(h=d),r=0===h?0:(u.avail_in-=h,n.arraySet(c,u.input,u.next_in,h,f),1===u.state.wrap?u.adler=o(u.adler,c,h,f):2===u.state.wrap&&(u.adler=s(u.adler,c,h,f)),u.next_in+=h,u.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=I)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I)if(a=i._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-I,a=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<15&&(s=2,a-=16),i<1||i>T||r!==M||a<8||a>15||t<0||t>9||o<0||o>A)return K(e,v);8===a&&(a=9);var l=new ue;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=a,l.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ie(e),0===e.lookahead&&t===u)return Y;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+r;if((0===e.strstart||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,te(e,!1),0===e.strm.avail_out))return Y;if(e.strstart-e.block_start>=e.w_size-D&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),Y)})),new le(4,4,8,4,oe),new le(4,5,16,8,oe),new le(4,6,32,32,oe),new le(4,4,16,16,se),new le(8,16,32,32,se),new le(8,16,128,128,se),new le(8,32,128,256,se),new le(32,128,258,1024,se),new le(32,258,258,4096,se)],t.deflateInit=function(e,t){return de(e,t,M,P,F,E)},t.deflateInit2=de,t.deflateReset=fe,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?v:(e.state.gzhead=t,p):v},t.deflate=function(e,t){var r,n,o,l;if(!e||!e.state||t>h||t<0)return e?K(e,v):v;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===X&&t!==d)return K(e,0===e.avail_out?y:v);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===j)if(2===n.wrap)e.adler=0,re(n,31),re(n,139),re(n,8),n.gzhead?(re(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),re(n,255&n.gzhead.time),re(n,n.gzhead.time>>8&255),re(n,n.gzhead.time>>16&255),re(n,n.gzhead.time>>24&255),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(re(n,255&n.gzhead.extra.length),re(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=s(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=B):(re(n,0),re(n,0),re(n,0),re(n,0),re(n,0),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,Z),n.status=H);else{var g=M+(n.w_bits-8<<4)<<8;g|=(n.strategy>=x||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(g|=U),g+=31-g%31,n.status=H,ae(n,g),0!==n.strstart&&(ae(n,e.adler>>>16),ae(n,65535&e.adler)),e.adler=1}if(n.status===B)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending!==n.pending_buf_size));)re(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=V)}else n.status=V;if(n.status===V)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=z)}else n.status=z;if(n.status===z)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=G)}else n.status=G;if(n.status===G&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ee(e),n.pending+2<=n.pending_buf_size&&(re(n,255&e.adler),re(n,e.adler>>8&255),e.adler=0,n.status=H)):n.status=H),0!==n.pending){if(ee(e),0===e.avail_out)return n.last_flush=-1,p}else if(0===e.avail_in&&J(t)<=J(r)&&t!==d)return K(e,y);if(n.status===X&&0!==e.avail_in)return K(e,y);if(0!==e.avail_in||0!==n.lookahead||t!==u&&n.status!==X){var b=n.strategy===x?function(e,t){for(var r;;){if(0===e.lookahead&&(ie(e),0===e.lookahead)){if(t===u)return Y;break}if(e.match_length=0,r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):n.strategy===_?function(e,t){for(var r,a,n,o,s=e.window;;){if(e.lookahead<=N){if(ie(e),e.lookahead<=N&&t===u)return Y;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(a=s[n=e.strstart-1])===s[++n]&&a===s[++n]&&a===s[++n]){o=e.strstart+N;do{}while(a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&ne.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=i._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):a[n.level].func(n,t);if(b!==q&&b!==Q||(n.status=X),b===Y||b===q)return 0===e.avail_out&&(n.last_flush=-1),p;if(b===W&&(t===c?i._tr_align(n):t!==h&&(i._tr_stored_block(n,0,0,!1),t===f&&($(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),ee(e),0===e.avail_out))return n.last_flush=-1,p}return t!==d?p:n.wrap<=0?m:(2===n.wrap?(re(n,255&e.adler),re(n,e.adler>>8&255),re(n,e.adler>>16&255),re(n,e.adler>>24&255),re(n,255&e.total_in),re(n,e.total_in>>8&255),re(n,e.total_in>>16&255),re(n,e.total_in>>24&255)):(ae(n,e.adler>>>16),ae(n,65535&e.adler)),ee(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?p:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==j&&t!==B&&t!==V&&t!==z&&t!==G&&t!==H&&t!==X?K(e,v):(e.state=null,t===H?K(e,g):p):v},t.deflateSetDictionary=function(e,t){var r,a,i,s,l,u,c,f,d=t.length;if(!e||!e.state)return v;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==j||r.lookahead)return v;for(1===s&&(e.adler=o(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&($(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new n.Buf8(r.w_size),n.arraySet(f,t,d-r.w_size,r.w_size,0),t=f,d=r.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,ie(r);r.lookahead>=I;){a=r.strstart,i=r.lookahead-(I-1);do{r.ins_h=(r.ins_h<>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{i=i+(n=n+t[a++]|0)|0}while(--o);n%=65521,i%=65521}return n|i<<16|0}},function(e,t,r){"use strict";var a=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,n){var i=a,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}},function(e,t,r){"use strict";var a=r(11),n=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var o=new a.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&i||!e.subarray&&n))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var r="",o=0;o>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new a.Buf8(e.length),r=0,n=t.length;r4)u[a++]=65533,r+=i-1;else{for(n&=2===i?31:3===i?15:7;i>1&&r1?u[a++]=65533:n<65536?u[a++]=n:(n-=65536,u[a++]=55296|n>>10&1023,u[a++]=56320|1023&n)}return l(u,a)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+o[e[r]]>t?r:t}},function(e,t,r){"use strict";var a=r(11),n=r(53),i=r(54),o=r(103),s=r(104),l=0,u=1,c=2,f=4,d=5,h=6,p=0,m=1,v=2,g=-2,y=-3,b=-4,w=-5,x=8,_=1,A=2,E=3,S=4,M=5,T=6,P=7,F=8,O=9,L=10,C=11,R=12,k=13,I=14,N=15,D=16,U=17,j=18,B=19,V=20,z=21,G=22,H=23,X=24,Y=25,W=26,q=27,Q=28,Z=29,K=30,J=31,$=32,ee=852,te=592,re=15;function ae(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ne(){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 a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(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=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new a.Buf32(ee),t.distcode=t.distdyn=new a.Buf32(te),t.sane=1,t.back=-1,p):g}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):g}function se(e,t){var r,a;return e&&e.state?(a=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?g:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=r,a.wbits=t,oe(e))):g}function le(e,t){var r,a;return e?(a=new ne,e.state=a,a.window=null,(r=se(e,t))!==p&&(e.state=null),r):g}var ue,ce,fe=!0;function de(e){if(fe){var t;for(ue=new a.Buf32(512),ce=new a.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,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,ce,0,e.work,{bits:5}),fe=!1}e.lencode=ue,e.lenbits=9,e.distcode=ce,e.distbits=5}function he(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(a.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),a.arraySet(o.window,t,r-n,i,o.wnext),(n-=i)?(a.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=i(r.check,Te,2,0),se=0,le=0,r.mode=A;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=K;break}if((15&se)!==x){e.msg="unknown compression method",r.mode=K;break}if(le-=4,_e=8+(15&(se>>>=4)),0===r.wbits)r.wbits=_e;else if(_e>r.wbits){e.msg="invalid window size",r.mode=K;break}r.dmax=1<<_e,e.adler=r.check=1,r.mode=512&se?L:R,se=0,le=0;break;case A:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8&1),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=E;case E:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,Te[2]=se>>>16&255,Te[3]=se>>>24&255,r.check=i(r.check,Te,4,0)),se=0,le=0,r.mode=S;case S:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=M;case M:if(1024&r.flags){for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0}else r.head&&(r.head.extra=null);r.mode=T;case T:if(1024&r.flags&&((fe=r.length)>ie&&(fe=ie),fe&&(r.head&&(_e=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),a.arraySet(r.head.extra,ee,re,fe,_e)),512&r.flags&&(r.check=i(r.check,ee,fe,re)),ie-=fe,re+=fe,r.length-=fe),r.length))break e;r.length=0,r.mode=P;case P:if(2048&r.flags){if(0===ie)break e;fe=0;do{_e=ee[re+fe++],r.head&&_e&&r.length<65536&&(r.head.name+=String.fromCharCode(_e))}while(_e&&fe>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=R;break;case L:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>=7&le,le-=7&le,r.mode=q;break}for(;le<3;){if(0===ie)break e;ie--,se+=ee[re++]<>>=1)){case 0:r.mode=I;break;case 1:if(de(r),r.mode=V,t===h){se>>>=2,le-=2;break e}break;case 2:r.mode=U;break;case 3:e.msg="invalid block type",r.mode=K}se>>>=2,le-=2;break;case I:for(se>>>=7&le,le-=7≤le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=K;break}if(r.length=65535&se,se=0,le=0,r.mode=N,t===h)break e;case N:r.mode=D;case D:if(fe=r.length){if(fe>ie&&(fe=ie),fe>oe&&(fe=oe),0===fe)break e;a.arraySet(te,ee,re,fe,ne),ie-=fe,re+=fe,oe-=fe,ne+=fe,r.length-=fe;break}r.mode=R;break;case U:for(;le<14;){if(0===ie)break e;ie--,se+=ee[re++]<>>=5,le-=5,r.ndist=1+(31&se),se>>>=5,le-=5,r.ncode=4+(15&se),se>>>=4,le-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=K;break}r.have=0,r.mode=j;case j:for(;r.have>>=3,le-=3}for(;r.have<19;)r.lens[Pe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},Ae=s(l,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid code lengths set",r.mode=K;break}r.have=0,r.mode=B;case B:for(;r.have>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=ve,le-=ve,r.lens[r.have++]=ye;else{if(16===ye){for(Se=ve+2;le>>=ve,le-=ve,0===r.have){e.msg="invalid bit length repeat",r.mode=K;break}_e=r.lens[r.have-1],fe=3+(3&se),se>>>=2,le-=2}else if(17===ye){for(Se=ve+3;le>>=ve)),se>>>=3,le-=3}else{for(Se=ve+7;le>>=ve)),se>>>=7,le-=7}if(r.have+fe>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=K;break}for(;fe--;)r.lens[r.have++]=_e}}if(r.mode===K)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=K;break}if(r.lenbits=9,Ee={bits:r.lenbits},Ae=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid literal/lengths set",r.mode=K;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},Ae=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,Ae){e.msg="invalid distances set",r.mode=K;break}if(r.mode=V,t===h)break e;case V:r.mode=z;case z:if(ie>=6&&oe>=258){e.next_out=ne,e.avail_out=oe,e.next_in=re,e.avail_in=ie,r.hold=se,r.bits=le,o(e,ce),ne=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,ie=e.avail_in,se=r.hold,le=r.bits,r.mode===R&&(r.back=-1);break}for(r.back=0;ge=(Me=r.lencode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,r.length=ye,0===ge){r.mode=W;break}if(32&ge){r.back=-1,r.mode=R;break}if(64&ge){e.msg="invalid literal/length code",r.mode=K;break}r.extra=15&ge,r.mode=G;case G:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=H;case H:for(;ge=(Me=r.distcode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,64&ge){e.msg="invalid distance code",r.mode=K;break}r.offset=ye,r.extra=15&ge,r.mode=X;case X:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=K;break}r.mode=Y;case Y:if(0===oe)break e;if(fe=ce-oe,r.offset>fe){if((fe=r.offset-fe)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=K;break}fe>r.wnext?(fe-=r.wnext,pe=r.wsize-fe):pe=r.wnext-fe,fe>r.length&&(fe=r.length),me=r.window}else me=te,pe=ne-r.offset,fe=r.length;fe>oe&&(fe=oe),oe-=fe,r.length-=fe;do{te[ne++]=me[pe++]}while(--fe);0===r.length&&(r.mode=z);break;case W:if(0===oe)break e;te[ne++]=r.length,oe--,r.mode=z;break;case q:if(r.wrap){for(;le<32;){if(0===ie)break e;ie--,se|=ee[re++]<0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),a?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?x(e,o,t,!1):M(e,o)):x(e,o,t,!1))):a||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),O(e)}function M(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var a;ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++a}return t.length-=a,n}(e,t):function(e,t){var r=u.allocUnsafe(e),a=t.head,n=1;a.data.copy(r),e-=a.data.length;for(;a=a.next;){var i=a.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++n,a.next?t.head=a.next:t.head=t.tail=null):(t.head=a,a.data=i.slice(o));break}++n}return t.length-=n,r}(e,t);return a}(e,t.buffer,t.decoder),r);var r}function C(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function k(e,t){for(var r=0,a=e.length;r=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):E(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&C(this),null;var a,n=t.needReadable;return h("need readable",n),(0===t.length||t.length-e0?L(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&C(this)),null!==a&&this.emit("data",a),a},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var l=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?c:b;function u(t,a){h("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",v),e.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",b),r.removeListener("data",m),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){h("onend"),e.end()}i.endEmitted?n.nextTick(l):r.once("end",l),e.on("unpipe",u);var f=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",f);var d=!1;var p=!1;function m(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==k(i.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(t){h("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){h("onfinish"),e.removeListener("close",g),b()}function b(){h("unpipe"),r.unpipe(e)}return r.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i=i)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(e){return"[Circular]"}default:return e}})),l=a[r];r=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),p(r)?a.showHidden=r:r&&t._extend(a,r),y(a.showHidden)&&(a.showHidden=!1),y(a.depth)&&(a.depth=2),y(a.colors)&&(a.colors=!1),y(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=l),c(a,e,a.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function c(e,r,a){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(a,e);return g(n)||(n=c(e,n,a)),n}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(A(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return f(r)}var u,w="",E=!1,S=["{","}"];(h(r)&&(E=!0,S=["[","]"]),A(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),x(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+f(r)),0!==o.length||E&&0!=r.length?a<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=E?function(e,t,r,a,n){for(var i=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,w,S)):S[0]+w+S[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,a,n,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),P(a,n)||(o="["+n+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(i&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===E(e)}function _(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function A(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(y(i)&&(i=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var a=e.pid;o[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,a,e)}}else o[r]=function(){};return o[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=b,t.isObject=w,t.isDate=x,t.isError=_,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(122);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(6),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),a=r.length;a--;)e[r[a]]=t[r[a]];return e};var F="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(F&&e[F]){var t;if("function"!=typeof(t=e[F]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,F,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,a=new Promise((function(e,a){t=e,r=a})),n=[],i=0;i",y=h?">":"<",b=void 0;if(v){var w=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+i,_="exclType"+i,A="exclIsNumber"+i,E="' + "+(T="op"+i)+" + '";n+=" var schemaExcl"+i+" = "+w+"; ",n+=" var "+x+"; var "+_+" = typeof "+(w="schemaExcl"+i)+"; if ("+_+" != 'boolean' && "+_+" != 'undefined' && "+_+" != 'number') { ";var S;b=p;(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var M=n;n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+_+" == 'number' ? ( ("+x+" = "+a+" === undefined || "+w+" "+g+"= "+a+") ? "+f+" "+y+"= "+w+" : "+f+" "+y+" "+a+" ) : ( ("+x+" = "+w+" === true) ? "+f+" "+y+"= "+a+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { var op"+i+" = "+x+" ? '"+g+"' : '"+g+"='; ",void 0===s&&(b=p,u=e.errSchemaPath+"/"+p,a=w,d=v)}else{E=g;if((A="number"==typeof m)&&d){var T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" ( "+a+" === undefined || "+m+" "+g+"= "+a+" ? "+f+" "+y+"= "+m+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { "}else{A&&void 0===s?(x=!0,b=p,u=e.errSchemaPath+"/"+p,a=m,y+="="):(A&&(a=Math[h?"min":"max"](m,s)),m===(!A||a)?(x=!0,b=p,u=e.errSchemaPath+"/"+p,y+="="):(x=!1,E+="="));T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+" "+y+" "+a+" || "+f+" !== "+f+") { "}}b=b||t,(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+T+", limit: "+a+", exclusive: "+x+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+E+" ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";M=n;return n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+".length "+("maxItems"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s;var h="maxLength"==t?">":"<";n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?n+=" "+f+".length ":n+=" ucs2length("+f+") ",n+=" "+h+" "+a+") { ";var p=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" Object.keys("+f+").length "+("maxProperties"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},function(e){e.exports=JSON.parse('{"switch":{"title":"switch","type":"array","items":[{"enum":["switch"]},{"type":"object","properties":{"compareTo":{"$ref":"definitions#/definitions/contextualizedFieldName"},"compareToValue":{"type":"string"},"fields":{"type":"object","patternProperties":{"^[-a-zA-Z0-9 _:]+$":{"$ref":"dataType"}},"additionalProperties":false},"default":{"$ref":"dataType"}},"oneOf":[{"required":["compareTo","fields"]},{"required":["compareToValue","fields"]}],"additionalProperties":false}],"additionalItems":false},"option":{"title":"option","type":"array","items":[{"enum":["option"]},{"$ref":"dataType"}],"additionalItems":false}}')},function(e,t,r){"use strict";(function(t,a){var n;e.exports=S,S.ReadableState=E;r(20).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(74),s=r(8).Buffer,l=t.Uint8Array||function(){};var u,c=r(175);u=c&&c.debuglog?c.debuglog("stream"):function(){};var f,d,h,p=r(176),m=r(75),v=r(76).getHighWaterMark,g=r(17).codes,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,x=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6)(S,o);var _=m.errorOrDestroy,A=["error","close","destroy","pause","resume"];function E(e,t,a){n=n||r(18),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",a),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(30).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(18),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function M(e,t,r,a,n){u("readableAddChunk",t);var i,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}(e,o);else if(n||(i=function(e,t){var r;a=t,s.isBuffer(a)||a instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var a;return r}(o,t)),i)_(e,i);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),a)o.endEmitted?_(e,new x):T(e,o,t,!0);else if(o.ended)_(e,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):C(e,o)):T(e,o,t,!1)}else a||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,a.nextTick(L,e))}function L(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function C(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){u("readable nexttick read 0"),e.read(0)}function N(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,a.nextTick(B,t,e))}function B(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function V(e,t){for(var r=0,a=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=F(e,t))&&t.ended)return 0===t.length&&j(this),null;var a,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==a&&this.emit("data",a),a},S.prototype._read=function(e){_(this,new w("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?l:v;function s(t,a){u("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",v),r.removeListener("data",d),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){u("onend"),e.end()}n.endEmitted?a.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var f=!1;function d(t){u("ondata");var a=e.write(t);u("dest.write",a),!1===a&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!f&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){u("onerror",t),v(),e.removeListener("error",h),0===i(e,"error")&&_(e,t)}function p(){e.removeListener("finish",m),v()}function m(){u("onfinish"),e.removeListener("close",p),v()}function v(){u("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",m),e.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?O(this):n.reading||a.nextTick(I,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&a.nextTick(k,this),r},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||a.nextTick(k,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(N,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(a=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,L(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=f.destroy,S.prototype._undestroy=f.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this,r(4),r(5))},function(e,t,r){"use strict";e.exports=c;var a=r(17).codes,n=a.ERR_METHOD_NOT_IMPLEMENTED,i=a.ERR_MULTIPLE_CALLBACK,o=a.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=a.ERR_TRANSFORM_WITH_LENGTH_0,l=r(18);function u(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(null===a)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),a(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length1&&void 0!==arguments[1]?arguments[1]:{tolerance:0};if(!e)throw new Error("You should specify the element you want to test");"string"==typeof e&&(e=document.querySelector(e));var r=e.getBoundingClientRect();return(r.bottom-t.tolerance>0&&r.right-t.tolerance>0&&r.left+t.tolerance<(window.innerWidth||document.documentElement.clientWidth)&&r.top+t.tolerance<(window.innerHeight||document.documentElement.clientHeight))}function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0,container:""};if(!e)throw new Error("You should specify the element you want to test");if("string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={tolerance:0,container:document.querySelector(t)}),"string"==typeof t.container&&(t.container=document.querySelector(t.container)),t instanceof HTMLElement&&(t={tolerance:0,container:t}),!t.container)throw new Error("You should specify a container element");var r=t.container.getBoundingClientRect();return(e.offsetTop+e.clientHeight-t.tolerance>t.container.scrollTop&&e.offsetLeft+e.clientWidth-t.tolerance>t.container.scrollLeft&&e.offsetLeft+t.tolerance0&&void 0!==arguments[0]?arguments[0]:{tolerance:0,debounce:100,container:window};this.options={},this.trackedElements={},Object.defineProperties(this.options,{container:{configurable:!1,enumerable:!1,get:function(){var e=void 0;return"string"==typeof n.container?e=document.querySelector(n.container):n.container instanceof HTMLElement&&(e=n.container),e||window},set:function(e){n.container=e}},debounce:{get:function(){return parseInt(n.debounce,10)||100},set:function(e){n.debounce=e}},tolerance:{get:function(){return parseInt(n.tolerance,10)||0},set:function(e){n.tolerance=e}}}),Object.defineProperty(this,"_scroll",{enumerable:!1,configurable:!1,writable:!1,value:this._debouncedScroll.call(this)}),e=document.querySelector("body"),t=function(){Object.keys(a.trackedElements).forEach((function(e){a.on("enter",e),a.on("leave",e)}))},(r=window.MutationObserver||window.WebKitMutationObserver)?new r(t).observe(e,{childList:!0,subtree:!0}):(e.addEventListener("DOMNodeInserted",t,!1),e.addEventListener("DOMNodeRemoved",t,!1)),this.attach()}return Object.defineProperties(r.prototype,{_debouncedScroll:{configurable:!1,writable:!1,enumerable:!1,value:function(){var r=this,a=void 0;return function(){clearTimeout(a),a=setTimeout((function(){!function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0},n=Object.keys(r),i=void 0;n.length&&(i=a.container===window?e:t,n.forEach((function(e){r[e].nodes.forEach((function(t){if(i(t.node,a)?(t.wasVisible=t.isVisible,t.isVisible=!0):(t.wasVisible=t.isVisible,t.isVisible=!1),!0===t.isVisible&&!1===t.wasVisible){if(!r[e].enter)return;Object.keys(r[e].enter).forEach((function(a){"function"==typeof r[e].enter[a]&&r[e].enter[a](t.node,"enter")}))}if(!1===t.isVisible&&!0===t.wasVisible){if(!r[e].leave)return;Object.keys(r[e].leave).forEach((function(a){"function"==typeof r[e].leave[a]&&r[e].leave[a](t.node,"leave")}))}}))})))}(r.trackedElements,r.options)}),r.options.debounce)}}},attach:{configurable:!1,writable:!1,enumerable:!1,value:function(){var e=this.options.container;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.addEventListener("scroll",this._scroll,{passive:!0}),window.addEventListener("resize",this._scroll,{passive:!0}),this._scroll(),this.attached=!0}},destroy:{configurable:!1,writable:!1,enumerable:!1,value:function(){this.options.container.removeEventListener("scroll",this._scroll),window.removeEventListener("resize",this._scroll),this.attached=!1}},off:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){var a=Object.keys(this.trackedElements[t].enter||{}),n=Object.keys(this.trackedElements[t].leave||{});if({}.hasOwnProperty.call(this.trackedElements,t))if(r){if(this.trackedElements[t][e]){var i="function"==typeof r?r.name:r;delete this.trackedElements[t][e][i]}}else delete this.trackedElements[t][e];a.length||n.length||delete this.trackedElements[t]}},on:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){if(!e)throw new Error("No event given. Choose either enter or leave");if(!t)throw new Error("No selector to track");if(["enter","leave"].indexOf(e)<0)throw new Error(e+" event is not supported");({}).hasOwnProperty.call(this.trackedElements,t)||(this.trackedElements[t]={}),this.trackedElements[t].nodes=[];for(var a=0,n=document.querySelectorAll(t);a0&&void 0!==arguments[0]?arguments[0]:this.clock.getDelta(),t=this.renderer.getRenderTarget(),r=!1,a=void 0,n=void 0,i=this.passes.length;for(n=0;n0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*a;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?s(l=e,i,"day")||s(l,n,"hour")||s(l,a,"minute")||s(l,r,"second")||l+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=n)return Math.round(e/n)+"h";if(e>=a)return Math.round(e/a)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){e.exports=function(e){const t=parseInt(e.REVISION)>=96;r(91)(e);var a=new e.MeshDepthMaterial;a.depthPacking=e.RGBADepthPacking,a.clipping=!0,a.defines={INSTANCE_TRANSFORM:""};var n=e.ShaderLib.distanceRGBA,i=e.UniformsUtils.clone(n.uniforms),o=new e.ShaderMaterial({defines:{USE_SHADOWMAP:"",INSTANCE_TRANSFORM:""},uniforms:i,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,clipping:!0});return e.InstancedMesh=function(t,r,n,i,s,l){e.Mesh.call(this,(new e.InstancedBufferGeometry).copy(t)),this._dynamic=!!i,this._uniformScale=!!l,this._colors=!!s,this.numInstances=n,this._setAttributes(),this.material=r,this.frustumCulled=!1,this.customDepthMaterial=a,this.customDistanceMaterial=o},e.InstancedMesh.prototype=Object.create(e.Mesh.prototype),e.InstancedMesh.constructor=e.InstancedMesh,Object.defineProperties(e.InstancedMesh.prototype,{material:{set:function(e){let t=function(e){e.defines?(e.defines.INSTANCE_TRANSFORM="",this._uniformScale?e.defines.INSTANCE_UNIFORM="":delete e.defines.INSTANCE_UNIFORM,this._colors?e.defines.INSTANCE_COLOR="":delete e.defines.INSTANCE_COLOR):(e.defines={INSTANCE_TRANSFORM:""},this._uniformScale&&(e.defines.INSTANCE_UNIFORM=""),this._colors&&(e.defines.INSTANCE_COLOR=""))};if(Array.isArray(e)){e=e.slice(0);for(let r=0;r{const n=r[a];let i;t?i=new e.InstancedBufferAttribute(...n):(i=new e.InstancedBufferAttribute(n[0],n[1],n[3])).normalized=n[2],i.dynamic=this._dynamic,this.geometry.addAttribute(a,i)})},e.InstancedMesh}},function(e,t,r){e.exports=function(e){return/InstancedMesh/.test(e.REVISION)?e:(r(92)(e),e.REVISION+="_InstancedMesh",e)}},function(e,t,r){e.exports=function(e){e.ShaderChunk.begin_vertex=r(93),e.ShaderChunk.color_fragment=r(94),e.ShaderChunk.color_pars_fragment=r(95),e.ShaderChunk.color_vertex=r(96),e.ShaderChunk.defaultnormal_vertex=r(97),e.ShaderChunk.uv_pars_vertex=r(98)}},function(e,t){e.exports=["#ifndef INSTANCE_TRANSFORM","vec3 transformed = vec3( position );","#else","#ifndef INSTANCE_MATRIX","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","vec3 transformed = ( _instanceMatrix * vec4( position , 1. )).xyz;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","diffuseColor.rgb *= vColor;","#endif","#if defined(INSTANCE_COLOR)","diffuseColor.rgb *= vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","varying vec3 vColor;","#endif","#if defined( INSTANCE_COLOR )","varying vec3 vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","vColor.xyz = color.xyz;","#endif","#if defined( INSTANCE_COLOR ) && defined( INSTANCE_TRANSFORM )","vInstanceColor = instanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef FLIP_SIDED","objectNormal = -objectNormal;","#endif","#ifndef INSTANCE_TRANSFORM","vec3 transformedNormal = normalMatrix * objectNormal;","#else","#ifndef INSTANCE_MATRIX ","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","#ifndef INSTANCE_UNIFORM","vec3 transformedNormal = transposeMat3( inverse( mat3( modelViewMatrix * _instanceMatrix ) ) ) * objectNormal ;","#else","vec3 transformedNormal = ( modelViewMatrix * _instanceMatrix * vec4( objectNormal , 0.0 ) ).xyz;","#endif","#endif"].join("\n")},function(e,t){e.exports=["#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )","varying vec2 vUv;","uniform mat3 uvTransform;","#endif","#ifdef INSTANCE_TRANSFORM","mat3 inverse(mat3 m) {","float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];","float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];","float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];","float b01 = a22 * a11 - a12 * a21;","float b11 = -a22 * a10 + a12 * a20;","float b21 = a21 * a10 - a11 * a20;","float det = a00 * b01 + a01 * b11 + a02 * b21;","return mat3(b01, (-a22 * a01 + a02 * a21), ( a12 * a01 - a02 * a11),","b11, ( a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),","b21, (-a21 * a00 + a01 * a20), ( a11 * a00 - a01 * a10)) / det;","}","attribute vec3 instancePosition;","attribute vec4 instanceQuaternion;","attribute vec3 instanceScale;","#if defined( INSTANCE_COLOR )","attribute vec3 instanceColor;","varying vec3 vInstanceColor;","#endif","mat4 getInstanceMatrix(){","vec4 q = instanceQuaternion;","vec3 s = instanceScale;","vec3 v = instancePosition;","vec3 q2 = q.xyz + q.xyz;","vec3 a = q.xxx * q2.xyz;","vec3 b = q.yyz * q2.yzz;","vec3 c = q.www * q2.xyz;","vec3 r0 = vec3( 1.0 - (b.x + b.z) , a.y + c.z , a.z - c.y ) * s.xxx;","vec3 r1 = vec3( a.y - c.z , 1.0 - (a.x + b.z) , b.y + c.x ) * s.yyy;","vec3 r2 = vec3( a.z + c.y , b.y - c.x , 1.0 - (a.x + b.x) ) * s.zzz;","return mat4(","r0 , 0.0,","r1 , 0.0,","r2 , 0.0,","v , 1.0",");","}","#endif"].join("\n")},function(e,t,r){"use strict";var a={};(0,r(11).assign)(a,r(100),r(102),r(38)),e.exports=a},function(e,t,r){"use strict";var a=r(52),n=r(11),i=r(55),o=r(36),s=r(37),l=Object.prototype.toString,u=0,c=-1,f=0,d=8;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({level:c,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&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 r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==u)throw new Error(o[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,p))!==u)throw new Error(o[r]);this._dict_set=!0}}function p(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}h.prototype.push=function(e,t){var r,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=i.string2buf(e):"[object ArrayBuffer]"===l.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 n.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=a.deflate(s,o))&&r!==u)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(n.shrinkBuf(s.output,s.next_out))):this.onData(n.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u):2!==o||(this.onEnd(u),s.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=h,t.deflate=p,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},function(e,t,r){"use strict";var a=r(11),n=4,i=0,o=1,s=2;function l(e){for(var t=e.length;--t>=0;)e[t]=0}var u=0,c=1,f=2,d=29,h=256,p=h+1+d,m=30,v=19,g=2*p+1,y=15,b=16,w=7,x=256,_=16,A=17,E=18,S=[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],M=[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],T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(p+2));l(F);var O=new Array(2*m);l(O);var L=new Array(512);l(L);var C=new Array(256);l(C);var R=new Array(d);l(R);var k,I,N,D=new Array(m);function U(e,t,r,a,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=a,this.max_length=n,this.has_stree=e&&e.length}function j(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function B(e){return e<256?L[e]:L[256+(e>>>7)]}function V(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function z(e,t,r){e.bi_valid>b-r?(e.bi_buf|=t<>b-e.bi_valid,e.bi_valid+=r-b):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function X(e,t,r){var a,n,i=new Array(y+1),o=0;for(a=1;a<=y;a++)i[a]=o=o+r[a-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=H(i[s]++,s))}}function Y(e){var t;for(t=0;t8?V(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,a){var n=2*t,i=2*r;return e[n]>1;r>=1;r--)Q(e,i,r);n=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Q(e,i,1),a=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=a,i[2*n]=i[2*r]+i[2*a],e.depth[n]=(e.depth[r]>=e.depth[a]?e.depth[r]:e.depth[a])+1,i[2*r+1]=i[2*a+1]=n,e.heap[1]=n++,Q(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,a,n,i,o,s,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(i=0;i<=y;i++)e.bl_count[i]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(i=p,m++),l[2*a+1]=i,a>u||(e.bl_count[i]++,o=0,a>=h&&(o=d[a-h]),s=l[2*a],e.opt_len+=s*(i+o),f&&(e.static_len+=s*(c[2*a+1]+o)));if(0!==m){do{for(i=p-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(i=p;0!==i;i--)for(a=e.bl_count[i];0!==a;)(n=e.heap[--r])>u||(l[2*n+1]!==i&&(e.opt_len+=(i-l[2*n+1])*l[2*n],l[2*n+1]=i),a--)}}(e,t),X(i,u,e.bl_count)}function J(e,t,r){var a,n,i=-1,o=t[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(r+1)+1]=65535,a=0;a<=r;a++)n=o,o=t[2*(a+1)+1],++s>=7;a0?(e.strm.data_type===s&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&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 o;for(t=32;t=3&&0===e.bl_tree[2*P[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),l=e.opt_len+3+7>>>3,(u=e.static_len+3+7>>>3)<=l&&(l=u)):l=u=r+5,r+4<=l&&-1!==t?te(e,t,r,a):e.strategy===n||u===l?(z(e,(c<<1)+(a?1:0),3),Z(e,F,O)):(z(e,(f<<1)+(a?1:0),3),function(e,t,r,a){var n;for(z(e,t-257,5),z(e,r-1,5),z(e,a-4,4),n=0;n>>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&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(C[r]+h+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){z(e,c<<1,3),G(e,x,F),function(e){16===e.bi_valid?(V(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,r){"use strict";var a=r(56),n=r(11),i=r(55),o=r(38),s=r(36),l=r(37),u=r(105),c=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new u,a.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=i.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=a.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function d(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,l,u,f,d=this.strm,h=this.options.chunkSize,p=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?d.input=i.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new n.Buf8(h),d.next_out=0,d.avail_out=h),(r=a.inflate(d,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(r=a.inflateSetDictionary(this.strm,p)),r===o.Z_BUF_ERROR&&!0===m&&(r=o.Z_OK,m=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==o.Z_STREAM_END&&(0!==d.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=i.utf8border(d.output,d.next_out),u=d.next_out-l,f=i.buf2string(d.output,l),d.next_out=u,d.avail_out=h-u,u&&n.arraySet(d.output,d.output,l,u,0),this.onData(f)):this.onData(n.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),d.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=d,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.ungzip=d},function(e,t,r){"use strict";e.exports=function(e,t){var r,a,n,i,o,s,l,u,c,f,d,h,p,m,v,g,y,b,w,x,_,A,E,S,M;r=e.state,a=e.next_in,S=e.input,n=a+(e.avail_in-5),i=e.next_out,M=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,f=r.wnext,d=r.window,h=r.hold,p=r.bits,m=r.lencode,v=r.distcode,g=(1<>>=w=b>>>24,p-=w,0===(w=b>>>16&255))M[i++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(h&(1<>>=w,p-=w),p<15&&(h+=S[a++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=v[(65535&b)+(h&(1<l){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,p-=w,_>(w=i-o)){if((w=_-w)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(A=0,E=d,0===f){if(A+=u-w,w2;)M[i++]=E[A++],M[i++]=E[A++],M[i++]=E[A++],x-=3;x&&(M[i++]=E[A++],x>1&&(M[i++]=E[A++]))}else{A=i-_;do{M[i++]=M[A++],M[i++]=M[A++],M[i++]=M[A++],x-=3}while(x>2);x&&(M[i++]=M[A++],x>1&&(M[i++]=M[A++]))}break}}break}}while(a>3,h&=(1<<(p-=x<<3))-1,e.next_in=a,e.next_out=i,e.avail_in=a=1&&0===I[M];M--);if(T>M&&(T=M),0===M)return u[c++]=20971520,u[c++]=20971520,d.bits=1,0;for(S=1;S0&&(0===e||1!==M))return-1;for(N[1]=0,A=1;A<15;A++)N[A+1]=N[A]+I[A];for(E=0;E852||2===e&&L>592)return 1;for(;;){b=A-F,f[E]y?(w=D[U+f[E]],x=R[k+f[E]]):(w=96,x=0),h=1<>F)+(p-=h)]=b<<24|w<<16|x|0}while(0!==p);for(h=1<>=1;if(0!==h?(C&=h-1,C+=h):C=0,E++,0==--I[A]){if(A===M)break;A=t[r+f[E]]}if(A>T&&(C&v)!==m){for(0===F&&(F=T),g+=S,O=1<<(P=A-F);P+F852||2===e&&L>592)return 1;u[m=C&v]=T<<24|P<<16|g-c|0}}return 0!==C&&(u[g+C]=A-F<<24|64<<16|0),d.bits=T,0}},function(e,t,r){"use strict";e.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}},function(e,t,r){"use strict";(function(e){var a=r(8).Buffer,n=r(109).Transform,i=r(120),o=r(63),s=r(31).ok,l=r(8).kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";i.Z_MIN_WINDOWBITS=8,i.Z_MAX_WINDOWBITS=15,i.Z_DEFAULT_WINDOWBITS=15,i.Z_MIN_CHUNK=64,i.Z_MAX_CHUNK=1/0,i.Z_DEFAULT_CHUNK=16384,i.Z_MIN_MEMLEVEL=1,i.Z_MAX_MEMLEVEL=9,i.Z_DEFAULT_MEMLEVEL=8,i.Z_MIN_LEVEL=-1,i.Z_MAX_LEVEL=9,i.Z_DEFAULT_LEVEL=i.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(i),f=0;f=l?o=new RangeError(u):t=a.concat(n,i),n=[],e.close(),r(o,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)})),e.on("end",s),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=a.from(t)),!a.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function b(e){if(!(this instanceof b))return new b(e);T.call(this,e,i.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);T.call(this,e,i.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,i.GZIP)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,i.GUNZIP)}function A(e){if(!(this instanceof A))return new A(e);T.call(this,e,i.DEFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);T.call(this,e,i.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,i.UNZIP)}function M(e){return e===i.Z_NO_FLUSH||e===i.Z_PARTIAL_FLUSH||e===i.Z_SYNC_FLUSH||e===i.Z_FULL_FLUSH||e===i.Z_FINISH||e===i.Z_BLOCK}function T(e,r){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,n.call(this,e),e.flush&&!M(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!M(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||i.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:i.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!a.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new i.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){P(s),s._hadError=!0;var a=new Error(e);a.errno=r,a.code=t.codes[r],s.emit("error",a)};var l=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(l=e.level);var u=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,l,e.memLevel||t.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=a.allocUnsafe(this._chunkSize),this._offset=0,this._level=l,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function P(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function F(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),t.Deflate=b,t.Inflate=w,t.Gzip=x,t.Gunzip=_,t.DeflateRaw=A,t.InflateRaw=E,t.Unzip=S,t.createDeflate=function(e){return new b(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new A(e)},t.createInflateRaw=function(e){return new E(e)},t.createGzip=function(e){return new x(e)},t.createGunzip=function(e){return new _(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new b(t),e,r)},t.deflateSync=function(e,t){return y(new b(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new x(t),e,r)},t.gzipSync=function(e,t){return y(new x(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new A(t),e,r)},t.deflateRawSync=function(e,t){return y(new A(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new S(t),e,r)},t.unzipSync=function(e,t){return y(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new w(t),e,r)},t.inflateSync=function(e,t){return y(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new _(t),e,r)},t.gunzipSync=function(e,t){return y(new _(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new E(t),e,r)},t.inflateRawSync=function(e,t){return y(new E(t),e)},o.inherits(T,n),T.prototype.params=function(r,a,n){if(rt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(a!=t.Z_FILTERED&&a!=t.Z_HUFFMAN_ONLY&&a!=t.Z_RLE&&a!=t.Z_FIXED&&a!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+a);if(this._level!==r||this._strategy!==a){var o=this;this.flush(i.Z_SYNC_FLUSH,(function(){s(o._handle,"zlib binding closed"),o._handle.params(r,a),o._hadError||(o._level=r,o._strategy=a,n&&n())}))}else e.nextTick(n)},T.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},T.prototype._flush=function(e){this._transform(a.alloc(0),"",e)},T.prototype.flush=function(t,r){var n=this,o=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=i.Z_FULL_FLUSH),o.ended?r&&e.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",(function(){return n.flush(t,r)})):(this._flushFlag=t,this.write(a.alloc(0),"",r))},T.prototype.close=function(t){P(this,t),e.nextTick(F,this)},T.prototype._transform=function(e,t,r){var n,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||a.isBuffer(e)?this._handle?(s?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||i.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},T.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,c=this,f="function"==typeof r;if(!f){var d,h=[],p=0;this.on("error",(function(e){d=e})),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw d;if(p>=l)throw P(this),new RangeError(u);var v=a.concat(h,p);return P(this),v}s(this._handle,"zlib binding closed");var g=this._handle.write(t,e,o,n,this._buffer,this._offset,i);function y(l,u){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var d=i-u;if(s(d>=0,"have should not go down"),d>0){var m=c._buffer.slice(c._offset,c._offset+d);c._offset+=d,f?c.push(m):(h.push(m),p+=m.length)}if((0===u||c._offset>=c._chunkSize)&&(i=c._chunkSize,c._offset=0,c._buffer=a.allocUnsafe(c._chunkSize)),0===u){if(o+=n-l,n=l,!f)return!0;var v=c._handle.write(t,e,o,n,c._buffer,c._offset,c._chunkSize);return v.callback=y,void(v.buffer=e)}if(!f)return!1;r()}}g.buffer=e,g.callback=y},o.inherits(b,T),o.inherits(w,T),o.inherits(x,T),o.inherits(_,T),o.inherits(A,T),o.inherits(E,T),o.inherits(S,T)}).call(this,r(5))},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],a=t[1];return 3*(r+a)/4-a},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));1===n?(t=e[r-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var n,i,o=[],s=t;s>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,a,n){var i,o,s=8*n-a-1,l=(1<>1,c=-7,f=r?n-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=d,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=a;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,a),i-=u}return(h?-1:1)*o*Math.pow(2,i-a)},t.write=function(e,t,r,a,n,i){var o,s,l,u=8*i-n-1,c=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=a?0:i-1,p=a?1:-1,m=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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,n),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;e[r+h]=255&s,h+=p,s/=256,n-=8);for(o=o<0;e[r+h]=255&o,h+=p,o/=256,u-=8);e[r+h-p]|=128*m}},function(e,t,r){e.exports=n;var a=r(20).EventEmitter;function n(){a.call(this)}r(6)(n,a),n.Readable=r(39),n.Writable=r(116),n.Duplex=r(117),n.Transform=r(118),n.PassThrough=r(119),n.Stream=n,n.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===a.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var a=r(29).Buffer,n=r(112);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,t.copy(r,n),s+=o.data.length,o=o.next;return i},e}(),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var a=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(n.call(setTimeout,a,arguments),clearTimeout)},t.setInterval=function(){return new i(n.call(setInterval,a,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(a,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(114),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(4))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var a,n,i,o,s,l=1,u={},c=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?a=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},a=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(n=f.documentElement,a=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):a=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),a=function(t){e.postMessage(o+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;rt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,n(this.init_done,"close before init"),n(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,a,n,i,o){return this._write(!0,e,t,r,a,n,i,o)},c.prototype.writeSync=function(e,t,r,a,n,i,o){return this._write(!1,e,t,r,a,n,i,o)},c.prototype._write=function(r,i,o,s,l,u,c,f){if(n.equal(arguments.length,8),n(this.init_done,"write before init"),n(this.mode!==t.NONE,"already finalized"),n.equal(!1,this.write_in_progress,"write already in progress"),n.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,n.equal(!1,void 0===i,"must provide flush value"),this.write_in_progress=!0,i!==t.Z_NO_FLUSH&&i!==t.Z_PARTIAL_FLUSH&&i!==t.Z_SYNC_FLUSH&&i!==t.Z_FULL_FLUSH&&i!==t.Z_FINISH&&i!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=e.alloc(0),l=0,s=0),this.strm.avail_in=l,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=u,this.strm.next_out=c,this.flush=i,!r)return this._process(),this._checkError()?this._afterSync():void 0;var d=this;return a.nextTick((function(){d._process(),d._after()})),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,r,a,i,o){n(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),n(e>=8&&e<=15,"invalid windowBits"),n(r>=-1&&r<=9,"invalid compression level"),n(a>=1&&a<=9,"invalid memlevel"),n(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,a,i,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,r,a,n,l){switch(this.level=e,this.windowBits=r,this.memLevel=a,this.strategy=n,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new i,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=l,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=o.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=c}).call(this,r(8).Buffer,r(5))},function(e,t,r){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT -*/var a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach((function(e){a[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,l=o(e),u=1;u({path:r+"."+e.path,val:e.val})))),e}e.exports=class{constructor(e=!0){this.types={},this.validator=e?new s:null,this.addDefaultTypes()}addDefaultTypes(){this.addTypes(r(167)),this.addTypes(r(168)),this.addTypes(r(169)),this.addTypes(r(170))}addProtocol(e,t){const r=this;this.validator&&this.validator.validateProtocol(e),function e(t,a){void 0!==t&&(t.types&&r.addTypes(t.types),e(o(t,a.shift()),a))}(e,t)}addType(e,t,r=!0){if("native"!==t)if(l(t)){this.validator&&(r&&this.validator.validateType(t),this.validator.addType(e));let{type:n,typeArgs:o}=a(t);this.types[e]=o?function(e,t){const r=JSON.stringify(t),a=i(t,u,[]);function n(e){const t=JSON.parse(r);return a.forEach(r=>{!function(e,t,r){const a=e.split(".").reverse();for(;a.length>1;)r=r[a.pop()];r[a.pop()]=t}(r.path,e[r.val],t)}),t}return[function(t,r,a,i){return e[0].call(this,t,r,n(a),i)},function(t,r,a,i,o){return e[1].call(this,t,r,a,n(i),o)},function(t,r,a){return"function"==typeof e[2]?e[2].call(this,t,n(r),a):e[2]}]}(this.types[n],o):this.types[n]}else this.validator&&(t[3]?this.validator.addType(e,t[3]):this.validator.addType(e)),this.types[e]=t;else this.validator&&this.validator.addType(e)}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t],!1)),this.validator&&Object.keys(e).forEach(t=>{l(e[t])&&this.validator.validateType(e[t])})}read(e,t,r,n){let{type:i,typeArgs:o}=a(r);const s=this.types[i];if(!s)throw new Error("missing data type: "+i);return s[0].call(this,e,t,o,n)}write(e,t,r,n,i){let{type:o,typeArgs:s}=a(n);const l=this.types[o];if(!l)throw new Error("missing data type: "+o);return l[1].call(this,e,t,r,s,i)}sizeOf(e,t,r){let{type:n,typeArgs:i}=a(t);const o=this.types[n];if(!o)throw new Error("missing data type: "+n);return"function"==typeof o[2]?o[2].call(this,e,i,r):o[2]}createPacketBuffer(e,r){const a=n(()=>this.sizeOf(r,e,{}),e=>{throw e.message=`SizeOf error for ${e.field} : ${e.message}`,e}),i=t.allocUnsafe(a);return n(()=>this.write(r,i,0,e,{}),e=>{throw e.message=`Write error for ${e.field} : ${e.message}`,e}),i}parsePacketBuffer(e,t){const{value:r,size:a}=n(()=>this.read(t,0,e,{}),e=>{throw e.message=`Read error for ${e.field} : ${e.message}`,e});return{data:r,metadata:{size:a},buffer:t.slice(0,a)}}}}).call(this,r(8).Buffer)},function(e,t,r){(function(e,r){var a=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,l=1/0,u=9007199254740991,c="[object Arguments]",f="[object Array]",d="[object Boolean]",h="[object Date]",p="[object Error]",m="[object Function]",v="[object GeneratorFunction]",g="[object Map]",y="[object Number]",b="[object Object]",w="[object RegExp]",x="[object Set]",_="[object String]",A="[object Symbol]",E="[object ArrayBuffer]",S="[object DataView]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,P=/^\./,F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,L=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[c]=R[f]=R[E]=R[d]=R[S]=R[h]=R[p]=R[m]=R[g]=R[y]=R[b]=R[w]=R[x]=R[_]=R["[object WeakMap]"]=!1;var k="object"==typeof e&&e&&e.Object===Object&&e,I="object"==typeof self&&self&&self.Object===Object&&self,N=k||I||Function("return this")(),D=t&&!t.nodeType&&t,U=D&&"object"==typeof r&&r&&!r.nodeType&&r,j=U&&U.exports===D&&k.process,B=function(){try{return j&&j.binding("util")}catch(e){}}(),V=B&&B.isTypedArray;function z(e,t,r,a){var n=-1,i=e?e.length:0;for(a&&i&&(r=e[++n]);++n-1},Me.prototype.set=function(e,t){var r=this.__data__,a=Le(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},Te.prototype.clear=function(){this.__data__={hash:new Se,map:new(de||Me),string:new Se}},Te.prototype.delete=function(e){return He(this,e).delete(e)},Te.prototype.get=function(e){return He(this,e).get(e)},Te.prototype.has=function(e){return He(this,e).has(e)},Te.prototype.set=function(e,t){return He(this,e).set(e,t),this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,i),this},Pe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.clear=function(){this.__data__=new Me},Fe.prototype.delete=function(e){return this.__data__.delete(e)},Fe.prototype.get=function(e){return this.__data__.get(e)},Fe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Me){var n=r.__data__;if(!de||n.lengthu))return!1;var f=i.get(e);if(f&&i.get(t))return f==t;var d=-1,h=!0,p=n&o?new Pe:void 0;for(i.set(e,t),i.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=u}function st(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function lt(e){return!!e&&"object"==typeof e}function ut(e){return"symbol"==typeof e||lt(e)&&ne.call(e)==A}var ct=V?function(e){return function(t){return e(t)}}(V):function(e){return lt(e)&&ot(e.length)&&!!R[ne.call(e)]};function ft(e){return nt(e)?Oe(e):Ve(e)}function dt(e){return e}r.exports=function(e,t,r){var a=at(e)?z:H,n=arguments.length<3;return a(e,Be(t),r,n,ke)}}).call(this,r(4),r(124)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){(function(t){var r="Expected a function",a="__lodash_hash_undefined__",n=1/0,i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,c=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p="object"==typeof t&&t&&t.Object===Object&&t,m="object"==typeof self&&self&&self.Object===Object&&self,v=p||m||Function("return this")();var g,y=Array.prototype,b=Function.prototype,w=Object.prototype,x=v["__core-js_shared__"],_=(g=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",A=b.toString,E=w.hasOwnProperty,S=w.toString,M=RegExp("^"+A.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=v.Symbol,P=y.splice,F=B(v,"Map"),O=B(Object,"create"),L=T?T.prototype:void 0,C=L?L.toString:void 0;function R(e){var t=-1,r=e?e.length:0;for(this.clear();++t-1},k.prototype.set=function(e,t){var r=this.__data__,a=N(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},I.prototype.clear=function(){this.__data__={hash:new R,map:new(F||k),string:new R}},I.prototype.delete=function(e){return j(this,e).delete(e)},I.prototype.get=function(e){return j(this,e).get(e)},I.prototype.has=function(e){return j(this,e).has(e)},I.prototype.set=function(e,t){return j(this,e).set(e,t),this};var V=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}(t);var r=[];return c.test(e)&&r.push(""),e.replace(f,(function(e,t,a,n){r.push(a?n.replace(d,"$1"):t||e)})),r}));function z(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-n?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(r);var a=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=a.cache;if(i.has(n))return i.get(n);var o=e.apply(this,r);return a.cache=i.set(n,o),o};return a.cache=new(G.Cache||I),a}G.Cache=I;var H=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==s}e.exports=function(e,t,r){var a=null==e?void 0:D(e,t);return void 0===a?r:a}}).call(this,r(4))},function(e,t,r){const a=r(127),n=r(30);class i{constructor(e){this.createAjvInstance(e),this.addDefaultTypes()}createAjvInstance(e){this.typesSchemas={},this.compiled=!1,this.ajv=new a({verbose:!0}),this.ajv.addSchema(r(161),"definitions"),this.ajv.addSchema(r(162),"protocol"),e&&Object.keys(e).forEach(t=>this.addType(t,e[t]))}addDefaultTypes(){this.addTypes(r(163)),this.addTypes(r(164)),this.addTypes(r(165)),this.addTypes(r(166))}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t]))}typeToSchemaName(e){return e.replace("|","_")}addType(e,t){const r=this.typeToSchemaName(e);null==this.typesSchemas[r]&&(t||(t={oneOf:[{enum:[e]},{type:"array",items:[{enum:[e]},{oneOf:[{type:"object"},{type:"array"}]}]}]}),this.typesSchemas[r]=t,this.compiled?this.createAjvInstance(this.typesSchemas):this.ajv.addSchema(t,r),this.ajv.removeSchema("dataType"),this.ajv.addSchema({title:"dataType",oneOf:[{enum:["native"]}].concat(Object.keys(this.typesSchemas).map(e=>({$ref:this.typeToSchemaName(e)})))},"dataType"))}validateType(e){let t=this.ajv.validate("dataType",e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}validateTypeGoingInside(e){if(Array.isArray(e)){n.ok(null!=this.typesSchemas[this.typeToSchemaName(e[0])],e+" is an undefined type");let t=this.ajv.validate(e[0],e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}else{if("native"==e)return;n.ok(null!=this.typesSchemas[this.typeToSchemaName(e)],e+" is an undefined type")}}validateProtocol(e){let t=this.ajv.validate("protocol",e);n.ok(t,JSON.stringify(this.ajv.errors,null,2)),function e(t,r,a){const n=new i(r.typesSchemas);Object.keys(t).forEach(r=>{"types"==r?(Object.keys(t[r]).forEach(e=>n.addType(e)),Object.keys(t[r]).forEach(e=>{try{n.validateType(t[r][e],a+"."+r+"."+e)}catch(t){throw new Error("Error at "+a+"."+r+"."+e)}})):e(t[r],n,a+"."+r)})}(e,this,"root")}}e.exports=i},function(e,t,r){"use strict";var a=r(128),n=r(40),i=r(132),o=r(63),s=r(64),l=r(133),u=r(134),c=r(155),f=r(15);e.exports=g,g.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var n=r(t);!0!==r.$async&&(this.errors=r.errors);return n},g.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},g.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var i=0;i=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:t,baseId:r},{index:a,compiling:!1})}function d(e,t,r){var a=h.call(this,e,t,r);a>=0&&this._compilations.splice(a,1)}function h(e,t,r){for(var a=0;a({path:r+"."+e.path,val:e.val})))),e}e.exports=class{constructor(e=!0){this.types={},this.validator=e?new s:null,this.addDefaultTypes()}addDefaultTypes(){this.addTypes(r(170)),this.addTypes(r(171)),this.addTypes(r(172)),this.addTypes(r(173))}addProtocol(e,t){const r=this;this.validator&&this.validator.validateProtocol(e),function e(t,a){void 0!==t&&(t.types&&r.addTypes(t.types),e(o(t,a.shift()),a))}(e,t)}addType(e,t,r=!0){if("native"!==t)if(l(t)){this.validator&&(r&&this.validator.validateType(t),this.validator.addType(e));let{type:n,typeArgs:o}=a(t);this.types[e]=o?function(e,t){const r=JSON.stringify(t),a=i(t,u,[]);function n(e){const t=JSON.parse(r);return a.forEach(r=>{!function(e,t,r){const a=e.split(".").reverse();for(;a.length>1;)r=r[a.pop()];r[a.pop()]=t}(r.path,e[r.val],t)}),t}return[function(t,r,a,i){return e[0].call(this,t,r,n(a),i)},function(t,r,a,i,o){return e[1].call(this,t,r,a,n(i),o)},function(t,r,a){return"function"==typeof e[2]?e[2].call(this,t,n(r),a):e[2]}]}(this.types[n],o):this.types[n]}else this.validator&&(t[3]?this.validator.addType(e,t[3]):this.validator.addType(e)),this.types[e]=t;else this.validator&&this.validator.addType(e)}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t],!1)),this.validator&&Object.keys(e).forEach(t=>{l(e[t])&&this.validator.validateType(e[t])})}read(e,t,r,n){let{type:i,typeArgs:o}=a(r);const s=this.types[i];if(!s)throw new Error("missing data type: "+i);return s[0].call(this,e,t,o,n)}write(e,t,r,n,i){let{type:o,typeArgs:s}=a(n);const l=this.types[o];if(!l)throw new Error("missing data type: "+o);return l[1].call(this,e,t,r,s,i)}sizeOf(e,t,r){let{type:n,typeArgs:i}=a(t);const o=this.types[n];if(!o)throw new Error("missing data type: "+n);return"function"==typeof o[2]?o[2].call(this,e,i,r):o[2]}createPacketBuffer(e,r){const a=n(()=>this.sizeOf(r,e,{}),e=>{throw e.message=`SizeOf error for ${e.field} : ${e.message}`,e}),i=t.allocUnsafe(a);return n(()=>this.write(r,i,0,e,{}),e=>{throw e.message=`Write error for ${e.field} : ${e.message}`,e}),i}parsePacketBuffer(e,t){const{value:r,size:a}=n(()=>this.read(t,0,e,{}),e=>{throw e.message=`Read error for ${e.field} : ${e.message}`,e});return{data:r,metadata:{size:a},buffer:t.slice(0,a)}}}}).call(this,r(8).Buffer)},function(e,t,r){(function(e,r){var a=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,l=1/0,u=9007199254740991,c="[object Arguments]",f="[object Array]",d="[object Boolean]",h="[object Date]",p="[object Error]",m="[object Function]",v="[object GeneratorFunction]",g="[object Map]",y="[object Number]",b="[object Object]",w="[object RegExp]",x="[object Set]",_="[object String]",A="[object Symbol]",E="[object ArrayBuffer]",S="[object DataView]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,P=/^\./,F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,L=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[c]=R[f]=R[E]=R[d]=R[S]=R[h]=R[p]=R[m]=R[g]=R[y]=R[b]=R[w]=R[x]=R[_]=R["[object WeakMap]"]=!1;var k="object"==typeof e&&e&&e.Object===Object&&e,I="object"==typeof self&&self&&self.Object===Object&&self,N=k||I||Function("return this")(),D=t&&!t.nodeType&&t,U=D&&"object"==typeof r&&r&&!r.nodeType&&r,j=U&&U.exports===D&&k.process,B=function(){try{return j&&j.binding("util")}catch(e){}}(),V=B&&B.isTypedArray;function z(e,t,r,a){var n=-1,i=e?e.length:0;for(a&&i&&(r=e[++n]);++n-1},Me.prototype.set=function(e,t){var r=this.__data__,a=Le(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},Te.prototype.clear=function(){this.__data__={hash:new Se,map:new(de||Me),string:new Se}},Te.prototype.delete=function(e){return He(this,e).delete(e)},Te.prototype.get=function(e){return He(this,e).get(e)},Te.prototype.has=function(e){return He(this,e).has(e)},Te.prototype.set=function(e,t){return He(this,e).set(e,t),this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,i),this},Pe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.clear=function(){this.__data__=new Me},Fe.prototype.delete=function(e){return this.__data__.delete(e)},Fe.prototype.get=function(e){return this.__data__.get(e)},Fe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Me){var n=r.__data__;if(!de||n.lengthu))return!1;var f=i.get(e);if(f&&i.get(t))return f==t;var d=-1,h=!0,p=n&o?new Pe:void 0;for(i.set(e,t),i.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=u}function st(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function lt(e){return!!e&&"object"==typeof e}function ut(e){return"symbol"==typeof e||lt(e)&&ne.call(e)==A}var ct=V?function(e){return function(t){return e(t)}}(V):function(e){return lt(e)&&ot(e.length)&&!!R[ne.call(e)]};function ft(e){return nt(e)?Oe(e):Ve(e)}function dt(e){return e}r.exports=function(e,t,r){var a=at(e)?z:H,n=arguments.length<3;return a(e,Be(t),r,n,ke)}}).call(this,r(4),r(127)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){(function(t){var r="Expected a function",a="__lodash_hash_undefined__",n=1/0,i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,c=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p="object"==typeof t&&t&&t.Object===Object&&t,m="object"==typeof self&&self&&self.Object===Object&&self,v=p||m||Function("return this")();var g,y=Array.prototype,b=Function.prototype,w=Object.prototype,x=v["__core-js_shared__"],_=(g=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",A=b.toString,E=w.hasOwnProperty,S=w.toString,M=RegExp("^"+A.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=v.Symbol,P=y.splice,F=B(v,"Map"),O=B(Object,"create"),L=T?T.prototype:void 0,C=L?L.toString:void 0;function R(e){var t=-1,r=e?e.length:0;for(this.clear();++t-1},k.prototype.set=function(e,t){var r=this.__data__,a=N(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},I.prototype.clear=function(){this.__data__={hash:new R,map:new(F||k),string:new R}},I.prototype.delete=function(e){return j(this,e).delete(e)},I.prototype.get=function(e){return j(this,e).get(e)},I.prototype.has=function(e){return j(this,e).has(e)},I.prototype.set=function(e,t){return j(this,e).set(e,t),this};var V=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}(t);var r=[];return c.test(e)&&r.push(""),e.replace(f,(function(e,t,a,n){r.push(a?n.replace(d,"$1"):t||e)})),r}));function z(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-n?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(r);var a=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=a.cache;if(i.has(n))return i.get(n);var o=e.apply(this,r);return a.cache=i.set(n,o),o};return a.cache=new(G.Cache||I),a}G.Cache=I;var H=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==s}e.exports=function(e,t,r){var a=null==e?void 0:D(e,t);return void 0===a?r:a}}).call(this,r(4))},function(e,t,r){const a=r(130),n=r(31);class i{constructor(e){this.createAjvInstance(e),this.addDefaultTypes()}createAjvInstance(e){this.typesSchemas={},this.compiled=!1,this.ajv=new a({verbose:!0}),this.ajv.addSchema(r(164),"definitions"),this.ajv.addSchema(r(165),"protocol"),e&&Object.keys(e).forEach(t=>this.addType(t,e[t]))}addDefaultTypes(){this.addTypes(r(166)),this.addTypes(r(167)),this.addTypes(r(168)),this.addTypes(r(169))}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t]))}typeToSchemaName(e){return e.replace("|","_")}addType(e,t){const r=this.typeToSchemaName(e);null==this.typesSchemas[r]&&(t||(t={oneOf:[{enum:[e]},{type:"array",items:[{enum:[e]},{oneOf:[{type:"object"},{type:"array"}]}]}]}),this.typesSchemas[r]=t,this.compiled?this.createAjvInstance(this.typesSchemas):this.ajv.addSchema(t,r),this.ajv.removeSchema("dataType"),this.ajv.addSchema({title:"dataType",oneOf:[{enum:["native"]}].concat(Object.keys(this.typesSchemas).map(e=>({$ref:this.typeToSchemaName(e)})))},"dataType"))}validateType(e){let t=this.ajv.validate("dataType",e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}validateTypeGoingInside(e){if(Array.isArray(e)){n.ok(null!=this.typesSchemas[this.typeToSchemaName(e[0])],e+" is an undefined type");let t=this.ajv.validate(e[0],e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}else{if("native"==e)return;n.ok(null!=this.typesSchemas[this.typeToSchemaName(e)],e+" is an undefined type")}}validateProtocol(e){let t=this.ajv.validate("protocol",e);n.ok(t,JSON.stringify(this.ajv.errors,null,2)),function e(t,r,a){const n=new i(r.typesSchemas);Object.keys(t).forEach(r=>{"types"==r?(Object.keys(t[r]).forEach(e=>n.addType(e)),Object.keys(t[r]).forEach(e=>{try{n.validateType(t[r][e],a+"."+r+"."+e)}catch(t){throw new Error("Error at "+a+"."+r+"."+e)}})):e(t[r],n,a+"."+r)})}(e,this,"root")}}e.exports=i},function(e,t,r){"use strict";var a=r(131),n=r(41),i=r(135),o=r(64),s=r(65),l=r(136),u=r(137),c=r(158),f=r(16);e.exports=g,g.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var n=r(t);!0!==r.$async&&(this.errors=r.errors);return n},g.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},g.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var i=0;i=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:t,baseId:r},{index:a,compiling:!1})}function d(e,t,r){var a=h.call(this,e,t,r);a>=0&&this._compilations.splice(a,1)}function h(e,t,r){for(var a=0;a1){t[0]=t[0].slice(0,-1);for(var a=t.length-1,n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(e){throw new RangeError(h[e])}function g(e,t){var r=e.split("@"),a="";r.length>1&&(a=r[0]+"@",e=r[1]);var n=function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(d,".")).split("."),t).join(".");return a+n}function y(e){for(var t=[],r=0,a=e.length;r=55296&&n<=56319&&r>1,e+=p(e/t);e>455;a+=36)e=p(e/35);return p(a+36*e/(e+38))},x=function(e){var t,r=[],a=e.length,n=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var l=0;l=128&&v("not-basic"),r.push(e.charCodeAt(l));for(var c=s>0?s+1:0;c=a&&v("invalid-input");var m=(t=e.charCodeAt(c++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>p((u-n)/d))&&v("overflow"),n+=m*d;var g=h<=o?1:h>=o+26?26:h-o;if(mp(u/y)&&v("overflow"),d*=y}var b=r.length+1;o=w(n-f,b,0==f),p(n/b)>u-i&&v("overflow"),i+=p(n/b),n%=b,r.splice(n++,0,i)}return String.fromCodePoint.apply(String,r)},_=function(e){var t=[],r=(e=y(e)).length,a=128,n=0,i=72,o=!0,s=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(o=(c=f.next()).done);o=!0){var d=c.value;d<128&&t.push(m(d))}}catch(e){s=!0,l=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw l}}var h=t.length,g=h;for(h&&t.push("-");g=a&&Tp((u-n)/P)&&v("overflow"),n+=(x-a)*P,a=x;var F=!0,O=!1,L=void 0;try{for(var C,R=e[Symbol.iterator]();!(F=(C=R.next()).done);F=!0){var k=C.value;if(ku&&v("overflow"),k==a){for(var I=n,N=36;;N+=36){var D=N<=i?1:N>=i+26?26:N-i;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function M(e){for(var t="",r=0,a=e.length;r=194&&n<224){if(a-r>=6){var i=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&n)<<6|63&i)}else t+=e.substr(r,6);r+=6}else if(n>=224){if(a-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function T(e,t){function r(e){var r=M(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,n)),e}function P(e){return e.replace(/^0*(.*)/,"$1")||"0"}function F(e,t){var r=e.match(t.IPV4ADDRESS)||[],a=l(r,2)[1];return a?a.split(".").map(P).join("."):e}function O(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=l(r,3),n=a[1],i=a[2];if(n){for(var o=n.toLowerCase().split("::").reverse(),s=l(o,2),u=s[0],c=s[1],f=c?c.split(":").map(P):[],d=u.split(":").map(P),h=t.IPV4ADDRESS.test(d[d.length-1]),p=h?7:8,m=d.length-p,v=Array(p),g=0;g1){var w=v.slice(0,y.index),x=v.slice(y.index+y.length);b=w.join(":")+"::"+x.join(":")}else b=v.join(":");return i&&(b+="%"+i),b}return e}var L=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,C=void 0==="".match(/(){0}/)[1];function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(L);if(n){C?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=O(F(r.host,a),a)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var i=E[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)T(r,a);else{if(r.host&&(t.domainHost||i&&i.domainHost))try{r.host=A.toASCII(r.host.replace(a.PCT_ENCODED,M).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}T(r,o)}i&&i.parse&&i.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var k=/^\.\.?\//,I=/^\/\.(\/|$)/,N=/^\/\.\.(\/|$)/,D=/^\/?(?:.|\n)*?(?=\/|$)/;function U(e){for(var t=[];e.length;)if(e.match(k))e=e.replace(k,"");else if(e.match(I))e=e.replace(I,"/");else if(e.match(N))e=e.replace(N,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(D);if(!r)throw new Error("Unexpected dot segment condition");var a=r[0];e=e.slice(a.length),t.push(a)}return t.join("")}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,a=[],n=E[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||n&&n.domainHost)try{e.host=t.iri?A.toUnicode(e.host):A.toASCII(e.host.replace(r.PCT_ENCODED,M).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}T(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var i=function(e,t){var r=!1!==t.iri?s:o,a=[];return void 0!==e.userinfo&&(a.push(e.userinfo),a.push("@")),void 0!==e.host&&a.push(O(F(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"==typeof e.port&&(a.push(":"),a.push(e.port.toString(10))),a.length?a.join(""):void 0}(e,t);if(void 0!==i&&("suffix"!==t.reference&&a.push("//"),a.push(i),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||n&&n.absolutePath||(l=U(l)),void 0===i&&(l=l.replace(/^\/\//,"/%2F")),a.push(l)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function B(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=R(j(e,r),r),t=R(j(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=U(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=U(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function V(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,M)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},G={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},H={},X="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",W=r(r("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+r("%"+Y+Y)),q=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Q=new RegExp(X,"g"),Z=new RegExp(W,"g"),K=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',q),"g"),J=new RegExp(t("[^]",X,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),$=J;function ee(e){var t=M(e);return t.match(Q)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,i={},o=r.query.split("&"),s=0,l=o.length;s=55296&&t<=56319&&n%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",a.copy(m[e])}function v(e){var t=e.match(n);if(!t)return!1;var r=+t[1],a=+t[2],o=+t[3];return a>=1&&a<=12&&o>=1&&o<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[a])}function g(e,t){var r=e.match(o);if(!r)return!1;var a=r[1],n=r[2],i=r[3],s=r[5];return(a<=23&&n<=59&&i<=59||23==a&&59==n&&60==i)&&(!t||s)}e.exports=m,m.fast={date:/^\d\d\d\d-[0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?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p},m.full={date:v,time:g,"date-time":function(e){var t=e.split(y);return 2==t.length&&v(t[0])&&g(t[1],!0)},uri:function(e){return b.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0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:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p};var y=/t|\s/i;var b=/\/|:/;var w=/[^\\]\\Z/;function x(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},function(e,t,r){"use strict";var a=r(135),n=r(15).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=n(t),e.types=n(["number","integer","string","array","object","boolean","null"]),e.forEach((function(r){r.rules=r.rules.map((function(r){var n;if("object"==typeof r){var i=Object.keys(r)[0];n=r[i],r=i,n.forEach((function(r){t.push(r),e.all[r]=!0}))}return t.push(r),e.all[r]={keyword:r,code:a[r],implements:n}})),e.all.$comment={keyword:"$comment",code:a.$comment},r.type&&(e.types[r.type]=r)})),e.keywords=n(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},function(e,t,r){"use strict";e.exports={$ref:r(136),allOf:r(137),anyOf:r(138),$comment:r(139),const:r(140),contains:r(141),dependencies:r(142),enum:r(143),format:r(144),if:r(145),items:r(146),maximum:r(66),minimum:r(66),maxItems:r(67),minItems:r(67),maxLength:r(68),minLength:r(68),maxProperties:r(69),minProperties:r(69),multipleOf:r(147),not:r(148),oneOf:r(149),pattern:r(150),properties:r(151),propertyNames:r(152),required:r(153),uniqueItems:r(154),validate:r(65)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n,i=" ",o=e.level,s=e.dataLevel,l=e.schema[t],u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(s||""),d="valid"+o;if("#"==l||"#/"==l)e.isRoot?(a=e.async,n="validate"):(a=!0===e.root.schema.$async,n="root.refVal[0]");else{var h=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===h){var p=e.MissingRefError.message(e.baseId,l);if("fail"==e.opts.missingRefs){e.logger.error(p),(y=y||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,l,p);e.logger.warn(p),c&&(i+=" if (true) { ")}}else if(h.inline){var v=e.util.copy(e);v.level++;var g="valid"+v.level;v.schema=h.schema,v.schemaPath="",v.errSchemaPath=l,i+=" "+e.validate(v).replace(/validate\.schema/g,h.code)+" ",c&&(i+=" if ("+g+") { ")}else a=!0===h.$async||e.async&&!1!==h.$async,n=h.code}if(n){var y;(y=y||[]).push(i),i="",e.opts.passContext?i+=" "+n+".call(this, ":i+=" "+n+"( ",i+=" "+f+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var b=i+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(i=y.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(i+=" var "+d+"; "),i+=" try { await "+b+"; ",c&&(i+=" "+d+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(i+=" "+d+" = false; "),i+=" } ",c&&(i+=" if ("+d+") { ")}else i+=" if (!"+b+") { if (vErrors === null) vErrors = "+n+".errors; else vErrors = vErrors.concat("+n+".errors); errors = vErrors.length; } ",c&&(i+=" else { ")}return i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.schema[t],i=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,l=e.util.copy(e),u="";l.level++;var c="valid"+l.level,f=l.baseId,d=!0,h=n;if(h)for(var p,m=-1,v=h.length-1;m0:e.util.schemaHasRules(p,e.RULES.all))&&(d=!1,l.schema=p,l.schemaPath=i+"["+m+"]",l.errSchemaPath=o+"/"+m,a+=" "+e.validate(l)+" ",l.baseId=f,s&&(a+=" if ("+c+") { ",u+="}"));return s&&(a+=d?" if (true) { ":" "+u.slice(0,-1)+" "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level;if(o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var v=h.baseId;a+=" var "+d+" = errors; var "+f+" = false; ";var g=e.compositeRule;e.compositeRule=h.compositeRule=!0;var y=o;if(y)for(var b,w=-1,x=y.length-1;w0:e.util.schemaHasRules(o,e.RULES.all);if(a+="var "+d+" = errors;var "+f+";",b){var w=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+p+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var x=c+"["+m+"]";h.dataPathArr[v]=m;var _=e.validate(h);h.baseId=y,e.util.varOccurences(_,g)<2?a+=" "+e.util.varReplace(_,g,x)+" ":a+=" var "+g+" = "+x+"; "+_+" ",a+=" if ("+p+") break; } ",e.compositeRule=h.compositeRule=w,a+=" if (!"+p+") {"}else a+=" if ("+c+".length == 0) {";var A=A||[];A.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;return a=A.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",b&&(a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m={},v={},g=e.opts.ownProperties;for(x in o){var y=o[x],b=Array.isArray(y)?v:m;b[x]=y}a+="var "+f+" = errors;";var w=e.errorPath;for(var x in a+="var missing"+n+";",v)if((b=v[x]).length){if(a+=" if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),u){a+=" && ( ";var _=b;if(_)for(var A=-1,E=_.length-1;A0:e.util.schemaHasRules(y,e.RULES.all))&&(a+=" "+p+" = true; if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),a+=") { ",d.schema=y,d.schemaPath=s+e.util.getProperty(x),d.errSchemaPath=l+"/"+e.util.escapeFragment(x),a+=" "+e.validate(d)+" ",d.baseId=I,a+=" } ",u&&(a+=" if ("+p+") { ",h+="}"))}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d=e.opts.$data&&o&&o.$data;d&&(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var h="i"+n,p="schema"+n;d||(a+=" var "+p+" = validate.schema"+s+";"),a+="var "+f+";",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=f+" = false;for (var "+h+"=0; "+h+"<"+p+".length; "+h+"++) if (equal("+c+", "+p+"["+h+"])) { "+f+" = true; break; }",d&&(a+=" } "),a+=" if (!"+f+") { ";var m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var v=a;return a=m.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||"");if(!1===e.opts.format)return u&&(a+=" if (true) { "),a;var f,d=e.opts.$data&&o&&o.$data;d?(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",f="schema"+n):f=o;var h=e.opts.unknownFormats,p=Array.isArray(h);if(d){a+=" var "+(m="format"+n)+" = formats["+f+"]; var "+(v="isObject"+n)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(g="formatType"+n)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+n+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",d&&(a+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),a+=" (","ignore"!=h&&(a+=" ("+f+" && !"+m+" ",p&&(a+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),a+=") || "),a+=" ("+m+" && "+g+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?a+=" (async"+n+" ? await "+m+"("+c+") : "+m+"("+c+")) ":a+=" "+m+"("+c+") ",a+=" : "+m+".test("+c+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==h)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(a+=" if (true) { "),a;if(p&&h.indexOf(o)>=0)return u&&(a+=" if (true) { "),a;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,g=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var y=!0===m.async;m=m.validate}if(g!=r)return u&&(a+=" if (true) { "),a;if(y){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(b="formats"+e.util.getProperty(o)+".validate")+"("+c+"))) { "}else{a+=" if (! ";var b="formats"+e.util.getProperty(o);v&&(b+=".validate"),a+="function"==typeof m?" "+b+"("+c+") ":" "+b+".test("+c+") ",a+=") { "}}var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=d?""+f:""+e.util.toQuotedString(o),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=d?"' + "+f+" + '":""+e.util.escapeQuotes(o),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=d?"validate.schema"+s:""+e.util.toQuotedString(o),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var x=a;return a=w.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e);h.level++;var p="valid"+h.level,m=e.schema.then,v=e.schema.else,g=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),b=h.baseId;if(g||y){var w;h.createErrors=!1,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+d+" = errors; var "+f+" = true; ";var x=e.compositeRule;e.compositeRule=h.compositeRule=!0,a+=" "+e.validate(h)+" ",h.baseId=b,h.createErrors=!0,a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=x,g?(a+=" if ("+p+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'then'; ":w="'then'",a+=" } ",y&&(a+=" else { ")):a+=" if (!"+p+") { ",y&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'else'; ":w="'else'",a+=" } "),a+=" if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",u&&(a+=" else { "),a=e.util.cleanUpCode(a)}else u&&(a+=" if (true) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v="i"+n,g=h.dataLevel=e.dataLevel+1,y="data"+g,b=e.baseId;if(a+="var "+d+" = errors;var "+f+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){a+=" "+f+" = "+c+".length <= "+o.length+"; ";var x=l;l=e.errSchemaPath+"/additionalItems",a+=" if (!"+f+") { ";var _=_||[];_.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var A=a;a=_.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+A+"]); ":a+=" validate.errors = ["+A+"]; return false; ":a+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l=x,u&&(p+="}",a+=" else { ")}var E=o;if(E)for(var S,M=-1,T=E.length-1;M0:e.util.schemaHasRules(S,e.RULES.all)){a+=" "+m+" = true; if ("+c+".length > "+M+") { ";var P=c+"["+M+"]";h.schema=S,h.schemaPath=s+"["+M+"]",h.errSchemaPath=l+"/"+M,h.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,!0),h.dataPathArr[g]=M;var F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",a+=" } ",u&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){h.schema=w,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+c+".length > "+o.length+") { for (var "+v+" = "+o.length+"; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" } } ",u&&(a+=" if ("+m+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" }"}return u&&(a+=" "+p+" if ("+d+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="var division"+i+";if (",d&&(n+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),n+=" (division"+i+" = "+f+" / "+a+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+i+" !== parseInt(division"+i+") ",n+=" ) ",d&&(n+=" ) "),n+=" ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" var "+f+" = errors; ";var p,m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(p=d.opts.allErrors,d.opts.allErrors=!1),a+=" "+e.validate(d)+" ",d.createErrors=!0,p&&(d.opts.allErrors=p),e.compositeRule=d.compositeRule=m,a+=" if ("+h+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(a+=" if (false) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v=h.baseId,g="prevValid"+n,y="passingSchemas"+n;a+="var "+d+" = errors , "+g+" = false , "+f+" = false , "+y+" = null; ";var b=e.compositeRule;e.compositeRule=h.compositeRule=!0;var w=o;if(w)for(var x,_=-1,A=w.length-1;_0:e.util.schemaHasRules(x,e.RULES.all))?(h.schema=x,h.schemaPath=s+"["+_+"]",h.errSchemaPath=l+"/"+_,a+=" "+e.validate(h)+" ",h.baseId=v):a+=" var "+m+" = true; ",_&&(a+=" if ("+m+" && "+g+") { "+f+" = false; "+y+" = ["+y+", "+_+"]; } else { ",p+="}"),a+=" if ("+m+") { "+f+" = "+g+" = true; "+y+" = "+_+"; }";return e.compositeRule=h.compositeRule=b,a+=p+"if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'string') || "),n+=" !"+(d?"(new RegExp("+a+"))":e.usePattern(s))+".test("+f+") ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",n+=d?""+a:""+e.util.toQuotedString(s),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match pattern \"",n+=d?"' + "+a+" + '":""+e.util.escapeQuotes(s),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+e.util.toQuotedString(s),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m="key"+n,v="idx"+n,g=d.dataLevel=e.dataLevel+1,y="data"+g,b="dataProperties"+n,w=Object.keys(o||{}),x=e.schema.patternProperties||{},_=Object.keys(x),A=e.schema.additionalProperties,E=w.length||_.length,S=!1===A,M="object"==typeof A&&Object.keys(A).length,T=e.opts.removeAdditional,P=S||M||T,F=e.opts.ownProperties,O=e.baseId,L=e.schema.required;if(L&&(!e.opts.$data||!L.$data)&&L.length8)a+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var R=w;if(R)for(var k=-1,I=R.length-1;k0:e.util.schemaHasRules(K,e.RULES.all)){var J=e.util.getProperty(q),$=(H=c+J,Y&&void 0!==K.default);d.schema=K,d.schemaPath=s+J,d.errSchemaPath=l+"/"+e.util.escapeFragment(q),d.errorPath=e.util.getPath(e.errorPath,q,e.opts.jsonPointers),d.dataPathArr[g]=e.util.toQuotedString(q);X=e.validate(d);if(d.baseId=O,e.util.varOccurences(X,y)<2){X=e.util.varReplace(X,y,H);var ee=H}else{ee=y;a+=" var "+y+" = "+H+"; "}if($)a+=" "+X+" ";else{if(C&&C[q]){a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = false; ";j=e.errorPath,V=l;var te,re=e.util.escapeQuotes(q);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,q,e.opts.jsonPointers)),l=e.errSchemaPath+"/required",(te=te||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+re+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";z=a;a=te.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+z+"]); ":a+=" validate.errors = ["+z+"]; return false; ":a+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=V,e.errorPath=j,a+=" } else { "}else u?(a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = true; } else { "):(a+=" if ("+ee+" !== undefined ",F&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=" ) { ");a+=" "+X+" } "}}u&&(a+=" if ("+p+") { ",h+="}")}}if(_.length){var ae=_;if(ae)for(var ne,ie=-1,oe=ae.length-1;ie0:e.util.schemaHasRules(K,e.RULES.all)){d.schema=K,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ne),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ne),a+=F?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+b+".length; "+v+"++) { var "+m+" = "+b+"["+v+"]; ":" for (var "+m+" in "+c+") { ",a+=" if ("+e.usePattern(ne)+".test("+m+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);H=c+"["+m+"]";d.dataPathArr[g]=m;X=e.validate(d);d.baseId=O,e.util.varOccurences(X,y)<2?a+=" "+e.util.varReplace(X,y,H)+" ":a+=" var "+y+" = "+H+"; "+X+" ",u&&(a+=" if (!"+p+") break; "),a+=" } ",u&&(a+=" else "+p+" = true; "),a+=" } ",u&&(a+=" if ("+p+") { ",h+="}")}}}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(a+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l;var p="key"+n,m="idx"+n,v="i"+n,g="' + "+p+" + '",y="data"+(d.dataLevel=e.dataLevel+1),b="dataProperties"+n,w=e.opts.ownProperties,x=e.baseId;w&&(a+=" var "+b+" = undefined; "),a+=w?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+b+".length; "+m+"++) { var "+p+" = "+b+"["+m+"]; ":" for (var "+p+" in "+c+") { ",a+=" var startErrs"+n+" = errors; ";var _=p,A=e.compositeRule;e.compositeRule=d.compositeRule=!0;var E=e.validate(d);d.baseId=x,e.util.varOccurences(E,y)<2?a+=" "+e.util.varReplace(E,y,_)+" ":a+=" var "+y+" = "+_+"; "+E+" ",e.compositeRule=d.compositeRule=A,a+=" if (!"+h+") { for (var "+v+"=startErrs"+n+"; "+v+"0:e.util.schemaHasRules(b,e.RULES.all))||(p[p.length]=v)}}else p=o;if(d||p.length){var w=e.errorPath,x=d||p.length>=e.opts.loopRequired,_=e.opts.ownProperties;if(u)if(a+=" var missing"+n+"; ",x){d||(a+=" var "+h+" = validate.schema"+s+"; ");var A="' + "+(F="schema"+n+"["+(M="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),a+=" var "+f+" = true; ",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=" for (var "+M+" = 0; "+M+" < "+h+".length; "+M+"++) { "+f+" = "+c+"["+h+"["+M+"]] !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", "+h+"["+M+"]) "),a+="; if (!"+f+") break; } ",d&&(a+=" } "),a+=" if (!"+f+") { ",(P=P||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+A+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;a=P.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var S=p;if(S)for(var M=-1,T=S.length-1;M 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(p.indexOf("object")>=0||p.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+d+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var v="checkDataType"+(m?"s":"");n+=" if ("+e.util[v](p,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",h&&(n+=" } "),n+=" if (!"+d+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var y=n;n=g.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { ")}else c&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";var a=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,t){for(var r=0;r(e[t]=function(e,t,r,n){return[(t,n)=>{if(n+r>t.length)throw new a;return{value:t[e](n),size:r}},(e,a,n)=>(a[t](e,n),n+r),r,n]}(n[t][0],n[t][1],n[t][2],r(21)[t]),e),{});i.i64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32BE(t),e.readInt32BE(t+4)],size:8}},function(e,t,r){return t.writeInt32BE(e[0],r),t.writeInt32BE(e[1],r+4),r+8},8,r(21).i64],i.li64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32LE(t+4),e.readInt32LE(t)],size:8}},function(e,t,r){return t.writeInt32LE(e[0],r+4),t.writeInt32LE(e[1],r),r+8},8,r(21).li64],i.u64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32BE(t),e.readUInt32BE(t+4)],size:8}},function(e,t,r){return t.writeUInt32BE(e[0],r),t.writeUInt32BE(e[1],r+4),r+8},8,r(21).u64],i.lu64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32LE(t+4),e.readUInt32LE(t)],size:8}},function(e,t,r){return t.writeUInt32LE(e[0],r+4),t.writeUInt32LE(e[1],r),r+8},8,r(21).lu64],e.exports=i},function(e,t,r){(function(t){const a=r(30),{getCount:n,sendCount:i,calcCount:o,PartialReadError:s}=r(14);function l(e,t){return e===t||parseInt(e)===parseInt(t)}function u(e){return(1<e.length)throw new s;const o=e.readUInt8(i);if(r|=(127&o)<>>=7;return t.writeUInt8(e,r+a),r+a+1},function(e){let t=0;for(;-128&e;)e>>>=7,t++;return t+1},r(12).varint],bool:[function(e,t){if(t+1>e.length)throw new s;return{value:!!e.readInt8(t),size:1}},function(e,t,r){return t.writeInt8(+e,r),r+1},1,r(12).bool],pstring:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a),l=t+i,u=l+o;if(u>e.length)throw new s("Missing characters in string, found size is "+e.length+" expected size was "+u);return{value:e.toString("utf8",l,u),size:u-t}},function(e,r,a,n,o){const s=t.byteLength(e,"utf8");return a=i.call(this,s,r,a,n,o),r.write(e,a,s,"utf8"),a+s},function(e,r,a){const n=t.byteLength(e,"utf8");return o.call(this,n,r,a)+n},r(12).pstring],buffer:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a);if((t+=i)+o>e.length)throw new s;return{value:e.slice(t,t+o),size:i+o}},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.copy(t,r),r+e.length},function(e,t,r){return o.call(this,e.length,t,r)+e.length},r(12).buffer],void:[function(){return{value:void 0,size:0}},function(e,t,r){return r},0,r(12).void],bitfield:[function(e,t,r){const a=t;let n=null,i=0;const o={};return o.value=r.reduce((r,{size:a,signed:o,name:l})=>{let c=a,f=0;for(;c>0;){if(0===i){if(e.length>i-r,i-=r,c-=r}return o&&f>=1<{const l=e[s];if(!o&&l<0||o&&l<-(1<=1<=(1<= "+o?1<0;){const e=Math.min(8-i,a);n=n<>a-e&u(e),a-=e,8===(i+=e)&&(t[r++]=n,i=0,n=0)}}),0!==i&&(t[r++]=n<<8-i);return r},function(e,t){return Math.ceil(t.reduce((e,{size:t})=>e+t,0)/8)},r(12).bitfield],cstring:[function(e,t){let r=0;for(;t+rthis.read(e,t,r.type,a),n)),i.size+=u,t+=u,i.value.push(o);return i},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.reduce((e,r,i)=>s(()=>this.write(r,t,e,a.type,n),i),r)},function(e,t,r){let a=o.call(this,e.length,t,r);return a=e.reduce((e,a,n)=>s(()=>e+this.sizeOf(a,t.type,r),n),a)},r(43).array],count:[function(e,t,{type:r},a){return this.read(e,t,r,a)},function(e,t,r,{countFor:n,type:i},o){return this.write(a(n,o).length,t,r,i,o)},function(e,{countFor:t,type:r},n){return this.sizeOf(a(t,n).length,r,n)},r(43).count],container:[function(e,t,r,a){const n={value:{"..":a},size:0};return r.forEach(({type:r,name:a,anon:i})=>{s(()=>{const o=this.read(e,t,r,n.value);n.size+=o.size,t+=o.size,i?void 0!==o.value&&Object.keys(o.value).forEach(e=>{n.value[e]=o.value[e]}):n.value[a]=o.value},a||"unknown")}),delete n.value[".."],n},function(e,t,r,a,n){return e[".."]=n,r=a.reduce((r,{type:a,name:n,anon:i})=>s(()=>this.write(i?e:e[n],t,r,a,e),n||"unknown"),r),delete e[".."],r},function(e,t,r){e[".."]=r;const a=t.reduce((t,{type:r,name:a,anon:n})=>t+s(()=>this.sizeOf(n?e:e[a],r,e),a||"unknown"),0);return delete e[".."],a},r(43).container]}},function(e,t,r){const{getField:a,getFieldInfo:n,tryDoc:i,PartialReadError:o}=r(14);e.exports={switch:[function(e,t,{compareTo:r,fields:o,compareToValue:s,default:l},u){if(r=void 0!==s?s:a(r,u),void 0===o[r]&&void 0===l)throw new Error(r+" has no associated fieldInfo in switch");const c=void 0===o[r],f=c?l:o[r],d=n(f);return i(()=>this.read(e,t,d,u),c?"default":r)},function(e,t,r,{compareTo:o,fields:s,compareToValue:l,default:u},c){if(o=void 0!==l?l:a(o,c),void 0===s[o]&&void 0===u)throw new Error(o+" has no associated fieldInfo in switch");const f=void 0===s[o],d=n(f?u:s[o]);return i(()=>this.write(e,t,r,d,c),f?"default":o)},function(e,{compareTo:t,fields:r,compareToValue:o,default:s},l){if(t=void 0!==o?o:a(t,l),void 0===r[t]&&void 0===s)throw new Error(t+" has no associated fieldInfo in switch");const u=void 0===r[t],c=n(u?s:r[t]);return i(()=>this.sizeOf(e,c,l),u?"default":t)},r(71).switch],option:[function(e,t,r,a){if(e.length0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,a,n=o.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=n,a=s,o.prototype.copy.call(t,r,a),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(i===n.length?a+=n:a+=n.slice(0,e),0==(e-=i)){i===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(i));break}++r}return this.length-=r,a}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,i=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,i),0==(e-=i)){i===n.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(i));break}++a}return this.length-=a,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&d.forEach(l),i||(d.forEach(l),f(c))}))}));return t.reduce(u)}},function(e,t){e.exports={compound:[function(e,t,r,a){const n={value:{},size:0};for(;;){const r=this.read(e,t,"i8",a);if(0===r.value){t+=r.size,n.size+=r.size;break}const i=this.read(e,t,"nbt",a);t+=i.size,n.size+=i.size,n.value[i.value.name]={type:i.value.type,value:i.value.value}}return n},function(e,t,r,a,n){const i=this;return Object.keys(e).map((function(a){r=i.write({name:a,type:e[a].type,value:e[a].value},t,r,"nbt",n)})),r=this.write(0,t,r,"i8",n)},function(e,t,r){const a=this;return 1+Object.keys(e).reduce((function(t,n){return t+a.sizeOf({name:n,type:e[n].type,value:e[n].value},"nbt",r)}),0)}]}},function(e){e.exports=JSON.parse('{"container":"native","i8":"native","switch":"native","compound":"native","i16":"native","i32":"native","i64":"native","f32":"native","f64":"native","pstring":"native","shortString":["pstring",{"countType":"i16"}],"byteArray":["array",{"countType":"i32","type":"i8"}],"list":["container",[{"name":"type","type":"nbtMapper"},{"name":"value","type":["array",{"countType":"i32","type":["nbtSwitch",{"type":"type"}]}]}]],"intArray":["array",{"countType":"i32","type":"i32"}],"longArray":["array",{"countType":"i32","type":"i64"}],"nbtMapper":["mapper",{"type":"i8","mappings":{"0":"end","1":"byte","2":"short","3":"int","4":"long","5":"float","6":"double","7":"byteArray","8":"string","9":"list","10":"compound","11":"intArray","12":"longArray"}}],"nbtSwitch":["switch",{"compareTo":"$type","fields":{"end":"void","byte":"i8","short":"i16","int":"i32","long":"i64","float":"f32","double":"f64","byteArray":"byteArray","string":"shortString","list":"list","compound":"compound","intArray":"intArray","longArray":"longArray"}}],"nbt":["container",[{"name":"type","type":"nbtMapper"},{"name":"name","type":"shortString"},{"name":"value","type":["nbtSwitch",{"type":"type"}]}]]}')},function(e,t){var r,a;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&a.rotl(e,8)|4278255360&a.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,a=0;r>>5]|=e[r]<<24-a%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],a=0,n=0;a>>6-2*n);return t}},e.exports=a},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} +!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var a=t.length-1,n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(e){throw new RangeError(h[e])}function g(e,t){var r=e.split("@"),a="";r.length>1&&(a=r[0]+"@",e=r[1]);var n=function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(d,".")).split("."),t).join(".");return a+n}function y(e){for(var t=[],r=0,a=e.length;r=55296&&n<=56319&&r>1,e+=p(e/t);e>455;a+=36)e=p(e/35);return p(a+36*e/(e+38))},x=function(e){var t,r=[],a=e.length,n=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var l=0;l=128&&v("not-basic"),r.push(e.charCodeAt(l));for(var c=s>0?s+1:0;c=a&&v("invalid-input");var m=(t=e.charCodeAt(c++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>p((u-n)/d))&&v("overflow"),n+=m*d;var g=h<=o?1:h>=o+26?26:h-o;if(mp(u/y)&&v("overflow"),d*=y}var b=r.length+1;o=w(n-f,b,0==f),p(n/b)>u-i&&v("overflow"),i+=p(n/b),n%=b,r.splice(n++,0,i)}return String.fromCodePoint.apply(String,r)},_=function(e){var t=[],r=(e=y(e)).length,a=128,n=0,i=72,o=!0,s=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(o=(c=f.next()).done);o=!0){var d=c.value;d<128&&t.push(m(d))}}catch(e){s=!0,l=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw l}}var h=t.length,g=h;for(h&&t.push("-");g=a&&Tp((u-n)/P)&&v("overflow"),n+=(x-a)*P,a=x;var F=!0,O=!1,L=void 0;try{for(var C,R=e[Symbol.iterator]();!(F=(C=R.next()).done);F=!0){var k=C.value;if(ku&&v("overflow"),k==a){for(var I=n,N=36;;N+=36){var D=N<=i?1:N>=i+26?26:N-i;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function M(e){for(var t="",r=0,a=e.length;r=194&&n<224){if(a-r>=6){var i=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&n)<<6|63&i)}else t+=e.substr(r,6);r+=6}else if(n>=224){if(a-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function T(e,t){function r(e){var r=M(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,n)),e}function P(e){return e.replace(/^0*(.*)/,"$1")||"0"}function F(e,t){var r=e.match(t.IPV4ADDRESS)||[],a=l(r,2)[1];return a?a.split(".").map(P).join("."):e}function O(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=l(r,3),n=a[1],i=a[2];if(n){for(var o=n.toLowerCase().split("::").reverse(),s=l(o,2),u=s[0],c=s[1],f=c?c.split(":").map(P):[],d=u.split(":").map(P),h=t.IPV4ADDRESS.test(d[d.length-1]),p=h?7:8,m=d.length-p,v=Array(p),g=0;g1){var w=v.slice(0,y.index),x=v.slice(y.index+y.length);b=w.join(":")+"::"+x.join(":")}else b=v.join(":");return i&&(b+="%"+i),b}return e}var L=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,C=void 0==="".match(/(){0}/)[1];function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(L);if(n){C?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=O(F(r.host,a),a)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var i=E[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)T(r,a);else{if(r.host&&(t.domainHost||i&&i.domainHost))try{r.host=A.toASCII(r.host.replace(a.PCT_ENCODED,M).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}T(r,o)}i&&i.parse&&i.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var k=/^\.\.?\//,I=/^\/\.(\/|$)/,N=/^\/\.\.(\/|$)/,D=/^\/?(?:.|\n)*?(?=\/|$)/;function U(e){for(var t=[];e.length;)if(e.match(k))e=e.replace(k,"");else if(e.match(I))e=e.replace(I,"/");else if(e.match(N))e=e.replace(N,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(D);if(!r)throw new Error("Unexpected dot segment condition");var a=r[0];e=e.slice(a.length),t.push(a)}return t.join("")}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,a=[],n=E[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||n&&n.domainHost)try{e.host=t.iri?A.toUnicode(e.host):A.toASCII(e.host.replace(r.PCT_ENCODED,M).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}T(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var i=function(e,t){var r=!1!==t.iri?s:o,a=[];return void 0!==e.userinfo&&(a.push(e.userinfo),a.push("@")),void 0!==e.host&&a.push(O(F(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"==typeof e.port&&(a.push(":"),a.push(e.port.toString(10))),a.length?a.join(""):void 0}(e,t);if(void 0!==i&&("suffix"!==t.reference&&a.push("//"),a.push(i),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||n&&n.absolutePath||(l=U(l)),void 0===i&&(l=l.replace(/^\/\//,"/%2F")),a.push(l)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function B(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=R(j(e,r),r),t=R(j(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=U(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=U(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function V(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,M)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},G={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},H={},X="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",W=r(r("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+r("%"+Y+Y)),q=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Q=new RegExp(X,"g"),Z=new RegExp(W,"g"),K=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',q),"g"),J=new RegExp(t("[^]",X,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),$=J;function ee(e){var t=M(e);return t.match(Q)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,i={},o=r.query.split("&"),s=0,l=o.length;s=55296&&t<=56319&&n%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",a.copy(m[e])}function v(e){var t=e.match(n);if(!t)return!1;var r=+t[1],a=+t[2],o=+t[3];return a>=1&&a<=12&&o>=1&&o<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[a])}function g(e,t){var r=e.match(o);if(!r)return!1;var a=r[1],n=r[2],i=r[3],s=r[5];return(a<=23&&n<=59&&i<=59||23==a&&59==n&&60==i)&&(!t||s)}e.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\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:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p},m.full={date:v,time:g,"date-time":function(e){var t=e.split(y);return 2==t.length&&v(t[0])&&g(t[1],!0)},uri:function(e){return b.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{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-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p};var y=/t|\s/i;var b=/\/|:/;var w=/[^\\]\\Z/;function x(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},function(e,t,r){"use strict";var a=r(138),n=r(16).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=n(t),e.types=n(["number","integer","string","array","object","boolean","null"]),e.forEach((function(r){r.rules=r.rules.map((function(r){var n;if("object"==typeof r){var i=Object.keys(r)[0];n=r[i],r=i,n.forEach((function(r){t.push(r),e.all[r]=!0}))}return t.push(r),e.all[r]={keyword:r,code:a[r],implements:n}})),e.all.$comment={keyword:"$comment",code:a.$comment},r.type&&(e.types[r.type]=r)})),e.keywords=n(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},function(e,t,r){"use strict";e.exports={$ref:r(139),allOf:r(140),anyOf:r(141),$comment:r(142),const:r(143),contains:r(144),dependencies:r(145),enum:r(146),format:r(147),if:r(148),items:r(149),maximum:r(67),minimum:r(67),maxItems:r(68),minItems:r(68),maxLength:r(69),minLength:r(69),maxProperties:r(70),minProperties:r(70),multipleOf:r(150),not:r(151),oneOf:r(152),pattern:r(153),properties:r(154),propertyNames:r(155),required:r(156),uniqueItems:r(157),validate:r(66)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n,i=" ",o=e.level,s=e.dataLevel,l=e.schema[t],u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(s||""),d="valid"+o;if("#"==l||"#/"==l)e.isRoot?(a=e.async,n="validate"):(a=!0===e.root.schema.$async,n="root.refVal[0]");else{var h=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===h){var p=e.MissingRefError.message(e.baseId,l);if("fail"==e.opts.missingRefs){e.logger.error(p),(y=y||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,l,p);e.logger.warn(p),c&&(i+=" if (true) { ")}}else if(h.inline){var v=e.util.copy(e);v.level++;var g="valid"+v.level;v.schema=h.schema,v.schemaPath="",v.errSchemaPath=l,i+=" "+e.validate(v).replace(/validate\.schema/g,h.code)+" ",c&&(i+=" if ("+g+") { ")}else a=!0===h.$async||e.async&&!1!==h.$async,n=h.code}if(n){var y;(y=y||[]).push(i),i="",e.opts.passContext?i+=" "+n+".call(this, ":i+=" "+n+"( ",i+=" "+f+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var b=i+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(i=y.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(i+=" var "+d+"; "),i+=" try { await "+b+"; ",c&&(i+=" "+d+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(i+=" "+d+" = false; "),i+=" } ",c&&(i+=" if ("+d+") { ")}else i+=" if (!"+b+") { if (vErrors === null) vErrors = "+n+".errors; else vErrors = vErrors.concat("+n+".errors); errors = vErrors.length; } ",c&&(i+=" else { ")}return i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.schema[t],i=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,l=e.util.copy(e),u="";l.level++;var c="valid"+l.level,f=l.baseId,d=!0,h=n;if(h)for(var p,m=-1,v=h.length-1;m0:e.util.schemaHasRules(p,e.RULES.all))&&(d=!1,l.schema=p,l.schemaPath=i+"["+m+"]",l.errSchemaPath=o+"/"+m,a+=" "+e.validate(l)+" ",l.baseId=f,s&&(a+=" if ("+c+") { ",u+="}"));return s&&(a+=d?" if (true) { ":" "+u.slice(0,-1)+" "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level;if(o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var v=h.baseId;a+=" var "+d+" = errors; var "+f+" = false; ";var g=e.compositeRule;e.compositeRule=h.compositeRule=!0;var y=o;if(y)for(var b,w=-1,x=y.length-1;w0:e.util.schemaHasRules(o,e.RULES.all);if(a+="var "+d+" = errors;var "+f+";",b){var w=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+p+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var x=c+"["+m+"]";h.dataPathArr[v]=m;var _=e.validate(h);h.baseId=y,e.util.varOccurences(_,g)<2?a+=" "+e.util.varReplace(_,g,x)+" ":a+=" var "+g+" = "+x+"; "+_+" ",a+=" if ("+p+") break; } ",e.compositeRule=h.compositeRule=w,a+=" if (!"+p+") {"}else a+=" if ("+c+".length == 0) {";var A=A||[];A.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;return a=A.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",b&&(a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m={},v={},g=e.opts.ownProperties;for(x in o){var y=o[x],b=Array.isArray(y)?v:m;b[x]=y}a+="var "+f+" = errors;";var w=e.errorPath;for(var x in a+="var missing"+n+";",v)if((b=v[x]).length){if(a+=" if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),u){a+=" && ( ";var _=b;if(_)for(var A=-1,E=_.length-1;A0:e.util.schemaHasRules(y,e.RULES.all))&&(a+=" "+p+" = true; if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),a+=") { ",d.schema=y,d.schemaPath=s+e.util.getProperty(x),d.errSchemaPath=l+"/"+e.util.escapeFragment(x),a+=" "+e.validate(d)+" ",d.baseId=I,a+=" } ",u&&(a+=" if ("+p+") { ",h+="}"))}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d=e.opts.$data&&o&&o.$data;d&&(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var h="i"+n,p="schema"+n;d||(a+=" var "+p+" = validate.schema"+s+";"),a+="var "+f+";",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=f+" = false;for (var "+h+"=0; "+h+"<"+p+".length; "+h+"++) if (equal("+c+", "+p+"["+h+"])) { "+f+" = true; break; }",d&&(a+=" } "),a+=" if (!"+f+") { ";var m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var v=a;return a=m.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||"");if(!1===e.opts.format)return u&&(a+=" if (true) { "),a;var f,d=e.opts.$data&&o&&o.$data;d?(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",f="schema"+n):f=o;var h=e.opts.unknownFormats,p=Array.isArray(h);if(d){a+=" var "+(m="format"+n)+" = formats["+f+"]; var "+(v="isObject"+n)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(g="formatType"+n)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+n+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",d&&(a+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),a+=" (","ignore"!=h&&(a+=" ("+f+" && !"+m+" ",p&&(a+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),a+=") || "),a+=" ("+m+" && "+g+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?a+=" (async"+n+" ? await "+m+"("+c+") : "+m+"("+c+")) ":a+=" "+m+"("+c+") ",a+=" : "+m+".test("+c+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==h)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(a+=" if (true) { "),a;if(p&&h.indexOf(o)>=0)return u&&(a+=" if (true) { "),a;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,g=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var y=!0===m.async;m=m.validate}if(g!=r)return u&&(a+=" if (true) { "),a;if(y){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(b="formats"+e.util.getProperty(o)+".validate")+"("+c+"))) { "}else{a+=" if (! ";var b="formats"+e.util.getProperty(o);v&&(b+=".validate"),a+="function"==typeof m?" "+b+"("+c+") ":" "+b+".test("+c+") ",a+=") { "}}var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=d?""+f:""+e.util.toQuotedString(o),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=d?"' + "+f+" + '":""+e.util.escapeQuotes(o),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=d?"validate.schema"+s:""+e.util.toQuotedString(o),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var x=a;return a=w.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e);h.level++;var p="valid"+h.level,m=e.schema.then,v=e.schema.else,g=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),b=h.baseId;if(g||y){var w;h.createErrors=!1,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+d+" = errors; var "+f+" = true; ";var x=e.compositeRule;e.compositeRule=h.compositeRule=!0,a+=" "+e.validate(h)+" ",h.baseId=b,h.createErrors=!0,a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=x,g?(a+=" if ("+p+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'then'; ":w="'then'",a+=" } ",y&&(a+=" else { ")):a+=" if (!"+p+") { ",y&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'else'; ":w="'else'",a+=" } "),a+=" if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",u&&(a+=" else { "),a=e.util.cleanUpCode(a)}else u&&(a+=" if (true) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v="i"+n,g=h.dataLevel=e.dataLevel+1,y="data"+g,b=e.baseId;if(a+="var "+d+" = errors;var "+f+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){a+=" "+f+" = "+c+".length <= "+o.length+"; ";var x=l;l=e.errSchemaPath+"/additionalItems",a+=" if (!"+f+") { ";var _=_||[];_.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var A=a;a=_.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+A+"]); ":a+=" validate.errors = ["+A+"]; return false; ":a+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l=x,u&&(p+="}",a+=" else { ")}var E=o;if(E)for(var S,M=-1,T=E.length-1;M0:e.util.schemaHasRules(S,e.RULES.all)){a+=" "+m+" = true; if ("+c+".length > "+M+") { ";var P=c+"["+M+"]";h.schema=S,h.schemaPath=s+"["+M+"]",h.errSchemaPath=l+"/"+M,h.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,!0),h.dataPathArr[g]=M;var F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",a+=" } ",u&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){h.schema=w,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+c+".length > "+o.length+") { for (var "+v+" = "+o.length+"; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" } } ",u&&(a+=" if ("+m+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" }"}return u&&(a+=" "+p+" if ("+d+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="var division"+i+";if (",d&&(n+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),n+=" (division"+i+" = "+f+" / "+a+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+i+" !== parseInt(division"+i+") ",n+=" ) ",d&&(n+=" ) "),n+=" ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" var "+f+" = errors; ";var p,m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(p=d.opts.allErrors,d.opts.allErrors=!1),a+=" "+e.validate(d)+" ",d.createErrors=!0,p&&(d.opts.allErrors=p),e.compositeRule=d.compositeRule=m,a+=" if ("+h+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(a+=" if (false) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v=h.baseId,g="prevValid"+n,y="passingSchemas"+n;a+="var "+d+" = errors , "+g+" = false , "+f+" = false , "+y+" = null; ";var b=e.compositeRule;e.compositeRule=h.compositeRule=!0;var w=o;if(w)for(var x,_=-1,A=w.length-1;_0:e.util.schemaHasRules(x,e.RULES.all))?(h.schema=x,h.schemaPath=s+"["+_+"]",h.errSchemaPath=l+"/"+_,a+=" "+e.validate(h)+" ",h.baseId=v):a+=" var "+m+" = true; ",_&&(a+=" if ("+m+" && "+g+") { "+f+" = false; "+y+" = ["+y+", "+_+"]; } else { ",p+="}"),a+=" if ("+m+") { "+f+" = "+g+" = true; "+y+" = "+_+"; }";return e.compositeRule=h.compositeRule=b,a+=p+"if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'string') || "),n+=" !"+(d?"(new RegExp("+a+"))":e.usePattern(s))+".test("+f+") ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",n+=d?""+a:""+e.util.toQuotedString(s),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match pattern \"",n+=d?"' + "+a+" + '":""+e.util.escapeQuotes(s),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+e.util.toQuotedString(s),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m="key"+n,v="idx"+n,g=d.dataLevel=e.dataLevel+1,y="data"+g,b="dataProperties"+n,w=Object.keys(o||{}),x=e.schema.patternProperties||{},_=Object.keys(x),A=e.schema.additionalProperties,E=w.length||_.length,S=!1===A,M="object"==typeof A&&Object.keys(A).length,T=e.opts.removeAdditional,P=S||M||T,F=e.opts.ownProperties,O=e.baseId,L=e.schema.required;if(L&&(!e.opts.$data||!L.$data)&&L.length8)a+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var R=w;if(R)for(var k=-1,I=R.length-1;k0:e.util.schemaHasRules(K,e.RULES.all)){var J=e.util.getProperty(q),$=(H=c+J,Y&&void 0!==K.default);d.schema=K,d.schemaPath=s+J,d.errSchemaPath=l+"/"+e.util.escapeFragment(q),d.errorPath=e.util.getPath(e.errorPath,q,e.opts.jsonPointers),d.dataPathArr[g]=e.util.toQuotedString(q);X=e.validate(d);if(d.baseId=O,e.util.varOccurences(X,y)<2){X=e.util.varReplace(X,y,H);var ee=H}else{ee=y;a+=" var "+y+" = "+H+"; "}if($)a+=" "+X+" ";else{if(C&&C[q]){a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = false; ";j=e.errorPath,V=l;var te,re=e.util.escapeQuotes(q);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,q,e.opts.jsonPointers)),l=e.errSchemaPath+"/required",(te=te||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+re+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";z=a;a=te.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+z+"]); ":a+=" validate.errors = ["+z+"]; return false; ":a+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=V,e.errorPath=j,a+=" } else { "}else u?(a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = true; } else { "):(a+=" if ("+ee+" !== undefined ",F&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=" ) { ");a+=" "+X+" } "}}u&&(a+=" if ("+p+") { ",h+="}")}}if(_.length){var ae=_;if(ae)for(var ne,ie=-1,oe=ae.length-1;ie0:e.util.schemaHasRules(K,e.RULES.all)){d.schema=K,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ne),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ne),a+=F?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+b+".length; "+v+"++) { var "+m+" = "+b+"["+v+"]; ":" for (var "+m+" in "+c+") { ",a+=" if ("+e.usePattern(ne)+".test("+m+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);H=c+"["+m+"]";d.dataPathArr[g]=m;X=e.validate(d);d.baseId=O,e.util.varOccurences(X,y)<2?a+=" "+e.util.varReplace(X,y,H)+" ":a+=" var "+y+" = "+H+"; "+X+" ",u&&(a+=" if (!"+p+") break; "),a+=" } ",u&&(a+=" else "+p+" = true; "),a+=" } ",u&&(a+=" if ("+p+") { ",h+="}")}}}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(a+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l;var p="key"+n,m="idx"+n,v="i"+n,g="' + "+p+" + '",y="data"+(d.dataLevel=e.dataLevel+1),b="dataProperties"+n,w=e.opts.ownProperties,x=e.baseId;w&&(a+=" var "+b+" = undefined; "),a+=w?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+b+".length; "+m+"++) { var "+p+" = "+b+"["+m+"]; ":" for (var "+p+" in "+c+") { ",a+=" var startErrs"+n+" = errors; ";var _=p,A=e.compositeRule;e.compositeRule=d.compositeRule=!0;var E=e.validate(d);d.baseId=x,e.util.varOccurences(E,y)<2?a+=" "+e.util.varReplace(E,y,_)+" ":a+=" var "+y+" = "+_+"; "+E+" ",e.compositeRule=d.compositeRule=A,a+=" if (!"+h+") { for (var "+v+"=startErrs"+n+"; "+v+"0:e.util.schemaHasRules(b,e.RULES.all))||(p[p.length]=v)}}else p=o;if(d||p.length){var w=e.errorPath,x=d||p.length>=e.opts.loopRequired,_=e.opts.ownProperties;if(u)if(a+=" var missing"+n+"; ",x){d||(a+=" var "+h+" = validate.schema"+s+"; ");var A="' + "+(F="schema"+n+"["+(M="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),a+=" var "+f+" = true; ",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=" for (var "+M+" = 0; "+M+" < "+h+".length; "+M+"++) { "+f+" = "+c+"["+h+"["+M+"]] !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", "+h+"["+M+"]) "),a+="; if (!"+f+") break; } ",d&&(a+=" } "),a+=" if (!"+f+") { ",(P=P||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+A+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;a=P.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var S=p;if(S)for(var M=-1,T=S.length-1;M 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(p.indexOf("object")>=0||p.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+d+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var v="checkDataType"+(m?"s":"");n+=" if ("+e.util[v](p,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",h&&(n+=" } "),n+=" if (!"+d+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var y=n;n=g.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { ")}else c&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";var a=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,t){for(var r=0;r(e[t]=function(e,t,r,n){return[(t,n)=>{if(n+r>t.length)throw new a;return{value:t[e](n),size:r}},(e,a,n)=>(a[t](e,n),n+r),r,n]}(n[t][0],n[t][1],n[t][2],r(22)[t]),e),{});i.i64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32BE(t),e.readInt32BE(t+4)],size:8}},function(e,t,r){return t.writeInt32BE(e[0],r),t.writeInt32BE(e[1],r+4),r+8},8,r(22).i64],i.li64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32LE(t+4),e.readInt32LE(t)],size:8}},function(e,t,r){return t.writeInt32LE(e[0],r+4),t.writeInt32LE(e[1],r),r+8},8,r(22).li64],i.u64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32BE(t),e.readUInt32BE(t+4)],size:8}},function(e,t,r){return t.writeUInt32BE(e[0],r),t.writeUInt32BE(e[1],r+4),r+8},8,r(22).u64],i.lu64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32LE(t+4),e.readUInt32LE(t)],size:8}},function(e,t,r){return t.writeUInt32LE(e[0],r+4),t.writeUInt32LE(e[1],r),r+8},8,r(22).lu64],e.exports=i},function(e,t,r){(function(t){const a=r(31),{getCount:n,sendCount:i,calcCount:o,PartialReadError:s}=r(15);function l(e,t){return e===t||parseInt(e)===parseInt(t)}function u(e){return(1<e.length)throw new s;const o=e.readUInt8(i);if(r|=(127&o)<>>=7;return t.writeUInt8(e,r+a),r+a+1},function(e){let t=0;for(;-128&e;)e>>>=7,t++;return t+1},r(12).varint],bool:[function(e,t){if(t+1>e.length)throw new s;return{value:!!e.readInt8(t),size:1}},function(e,t,r){return t.writeInt8(+e,r),r+1},1,r(12).bool],pstring:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a),l=t+i,u=l+o;if(u>e.length)throw new s("Missing characters in string, found size is "+e.length+" expected size was "+u);return{value:e.toString("utf8",l,u),size:u-t}},function(e,r,a,n,o){const s=t.byteLength(e,"utf8");return a=i.call(this,s,r,a,n,o),r.write(e,a,s,"utf8"),a+s},function(e,r,a){const n=t.byteLength(e,"utf8");return o.call(this,n,r,a)+n},r(12).pstring],buffer:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a);if((t+=i)+o>e.length)throw new s;return{value:e.slice(t,t+o),size:i+o}},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.copy(t,r),r+e.length},function(e,t,r){return o.call(this,e.length,t,r)+e.length},r(12).buffer],void:[function(){return{value:void 0,size:0}},function(e,t,r){return r},0,r(12).void],bitfield:[function(e,t,r){const a=t;let n=null,i=0;const o={};return o.value=r.reduce((r,{size:a,signed:o,name:l})=>{let c=a,f=0;for(;c>0;){if(0===i){if(e.length>i-r,i-=r,c-=r}return o&&f>=1<{const l=e[s];if(!o&&l<0||o&&l<-(1<=1<=(1<= "+o?1<0;){const e=Math.min(8-i,a);n=n<>a-e&u(e),a-=e,8===(i+=e)&&(t[r++]=n,i=0,n=0)}}),0!==i&&(t[r++]=n<<8-i);return r},function(e,t){return Math.ceil(t.reduce((e,{size:t})=>e+t,0)/8)},r(12).bitfield],cstring:[function(e,t){let r=0;for(;t+rthis.read(e,t,r.type,a),n)),i.size+=u,t+=u,i.value.push(o);return i},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.reduce((e,r,i)=>s(()=>this.write(r,t,e,a.type,n),i),r)},function(e,t,r){let a=o.call(this,e.length,t,r);return a=e.reduce((e,a,n)=>s(()=>e+this.sizeOf(a,t.type,r),n),a)},r(44).array],count:[function(e,t,{type:r},a){return this.read(e,t,r,a)},function(e,t,r,{countFor:n,type:i},o){return this.write(a(n,o).length,t,r,i,o)},function(e,{countFor:t,type:r},n){return this.sizeOf(a(t,n).length,r,n)},r(44).count],container:[function(e,t,r,a){const n={value:{"..":a},size:0};return r.forEach(({type:r,name:a,anon:i})=>{s(()=>{const o=this.read(e,t,r,n.value);n.size+=o.size,t+=o.size,i?void 0!==o.value&&Object.keys(o.value).forEach(e=>{n.value[e]=o.value[e]}):n.value[a]=o.value},a||"unknown")}),delete n.value[".."],n},function(e,t,r,a,n){return e[".."]=n,r=a.reduce((r,{type:a,name:n,anon:i})=>s(()=>this.write(i?e:e[n],t,r,a,e),n||"unknown"),r),delete e[".."],r},function(e,t,r){e[".."]=r;const a=t.reduce((t,{type:r,name:a,anon:n})=>t+s(()=>this.sizeOf(n?e:e[a],r,e),a||"unknown"),0);return delete e[".."],a},r(44).container]}},function(e,t,r){const{getField:a,getFieldInfo:n,tryDoc:i,PartialReadError:o}=r(15);e.exports={switch:[function(e,t,{compareTo:r,fields:o,compareToValue:s,default:l},u){if(r=void 0!==s?s:a(r,u),void 0===o[r]&&void 0===l)throw new Error(r+" has no associated fieldInfo in switch");const c=void 0===o[r],f=c?l:o[r],d=n(f);return i(()=>this.read(e,t,d,u),c?"default":r)},function(e,t,r,{compareTo:o,fields:s,compareToValue:l,default:u},c){if(o=void 0!==l?l:a(o,c),void 0===s[o]&&void 0===u)throw new Error(o+" has no associated fieldInfo in switch");const f=void 0===s[o],d=n(f?u:s[o]);return i(()=>this.write(e,t,r,d,c),f?"default":o)},function(e,{compareTo:t,fields:r,compareToValue:o,default:s},l){if(t=void 0!==o?o:a(t,l),void 0===r[t]&&void 0===s)throw new Error(t+" has no associated fieldInfo in switch");const u=void 0===r[t],c=n(u?s:r[t]);return i(()=>this.sizeOf(e,c,l),u?"default":t)},r(72).switch],option:[function(e,t,r,a){if(e.length0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,a,n=o.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=n,a=s,o.prototype.copy.call(t,r,a),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(i===n.length?a+=n:a+=n.slice(0,e),0==(e-=i)){i===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(i));break}++r}return this.length-=r,a}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,i=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,i),0==(e-=i)){i===n.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(i));break}++a}return this.length-=a,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&d.forEach(l),i||(d.forEach(l),f(c))}))}));return t.reduce(u)}},function(e,t){e.exports={compound:[function(e,t,r,a){const n={value:{},size:0};for(;;){const r=this.read(e,t,"i8",a);if(0===r.value){t+=r.size,n.size+=r.size;break}const i=this.read(e,t,"nbt",a);t+=i.size,n.size+=i.size,n.value[i.value.name]={type:i.value.type,value:i.value.value}}return n},function(e,t,r,a,n){const i=this;return Object.keys(e).map((function(a){r=i.write({name:a,type:e[a].type,value:e[a].value},t,r,"nbt",n)})),r=this.write(0,t,r,"i8",n)},function(e,t,r){const a=this;return 1+Object.keys(e).reduce((function(t,n){return t+a.sizeOf({name:n,type:e[n].type,value:e[n].value},"nbt",r)}),0)}]}},function(e){e.exports=JSON.parse('{"container":"native","i8":"native","switch":"native","compound":"native","i16":"native","i32":"native","i64":"native","f32":"native","f64":"native","pstring":"native","shortString":["pstring",{"countType":"i16"}],"byteArray":["array",{"countType":"i32","type":"i8"}],"list":["container",[{"name":"type","type":"nbtMapper"},{"name":"value","type":["array",{"countType":"i32","type":["nbtSwitch",{"type":"type"}]}]}]],"intArray":["array",{"countType":"i32","type":"i32"}],"longArray":["array",{"countType":"i32","type":"i64"}],"nbtMapper":["mapper",{"type":"i8","mappings":{"0":"end","1":"byte","2":"short","3":"int","4":"long","5":"float","6":"double","7":"byteArray","8":"string","9":"list","10":"compound","11":"intArray","12":"longArray"}}],"nbtSwitch":["switch",{"compareTo":"$type","fields":{"end":"void","byte":"i8","short":"i16","int":"i32","long":"i64","float":"f32","double":"f64","byteArray":"byteArray","string":"shortString","list":"list","compound":"compound","intArray":"intArray","longArray":"longArray"}}],"nbt":["container",[{"name":"type","type":"nbtMapper"},{"name":"name","type":"shortString"},{"name":"value","type":["nbtSwitch",{"type":"type"}]}]]}')},function(e,t){var r,a;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&a.rotl(e,8)|4278255360&a.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,a=0;r>>5]|=e[r]<<24-a%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],a=0,n=0;a>>6-2*n);return t}},e.exports=a},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ -e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict"},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return n}));var a=r(1);function n(e){console.debug("New Worker!"),e.addEventListener("message",t=>{let r=t.data;"parseModel"===r.func?Object(a.e)(r.model,r.modelOptions,[],r.assetRoot).then(t=>{e.postMessage({msg:"done",parsedModelList:t}),close()}):"loadAndMergeModel"===r.func?Object(a.b)(r.model,r.assetRoot).then(t=>{e.postMessage({msg:"done",mergedModel:t}),close()}):"loadTextures"===r.func?Object(a.c)(r.textures,r.assetRoot).then(t=>{e.postMessage({msg:"done",textures:t}),close()}):(console.warn("Unknown function '"+r.func+"' for ModelWorker"),console.warn(r),close())})}},function(e,t,r){"use strict";(function(e){var t=r(0),a=r(22),n=r(23),i=r.n(n),o=r(7),s=r(2);r(24);const l=["left","right","top","bottom","front","back"];let u={camera:{type:"perspective",x:35,y:25,z:20,target:[0,16,0]},assetRoot:s.a};class c extends o.b{constructor(e,t){super(e,u,t),this.renderType="EntityRender",this.entities=[],this.attached=!1}render(e,r){let a=this;a.attached||a._scene?console.log("[EntityRender] is attached - skipping scene init"):super.initScene((function(){a.element.dispatchEvent(new CustomEvent("entityRender",{detail:{entities:a.entities}}))}));let n=[];for(let r=0;r{let i=e[r];console.log(i),"object"!=typeof i&&(i={model:i,texture:i,textureScale:1}),i.textureScale||(i.textureScale=1),p(i.model).then(e=>v(e)).then(e=>{console.log("Merged:"),console.log(e),Object(s.d)(a.options.assetRoot,"minecraft","/entity/",i.texture).then(r=>{(new t.TextureLoader).load(r,(function(r){r.magFilter=t.NearestFilter,r.minFilter=t.NearestFilter,r.anisotropy=0,r.needsUpdate=!0,f(a,e,r,i.textureScale).then(e=>{a.addToScene(e),a.entities.push(e),n()})}))}).catch(()=>{console.warn("Missing texture for entity "+i.texture)})}).catch(()=>{console.warn("No model file found for entity "+i.model)})}));Promise.all(n).then(()=>{"function"==typeof r&&r()})}}function f(e,r,a,n){return console.log(r),new Promise(i=>{let o=new t.Object3D;for(let i in r.groups)if(r.groups.hasOwnProperty(i)){let s=r.groups[i],l=new t.Object3D;l.name=s.name,s.pivot&&l.applyMatrix((new t.Matrix4).makeTranslation(s.pivot[0],s.pivot[1],s.pivot[2])),s.pos,s.rotation&&3===s.rotation.length&&(l.rotation.x=s.rotation[0],l.rotation.y=s.rotation[1],l.rotation.z=s.rotation[2]);for(let r=0;r{a.ajax("https://minerender.org/res/models/entities/"+e+".json").done(e=>{t(e)}).fail(()=>{r()})})}const m=(e,t,r)=>t;let v=function(e){return new Promise((t,r)=>{g(e,[],t,r)})},g=function(e,t,r,a){if(console.log(t),t.push(e),!e.hasOwnProperty("parent")){t.reverse();let e={};for(let r=0;r{g(e,t,r,a)})};"undefined"!=typeof window&&(window.EntityRender=c),void 0!==e&&(e.EntityRender=c)}).call(this,r(4))}]); \ No newline at end of file +e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict"},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return o}));var a=r(1),n=r(13);const i=n("minerender");function o(e){i("New Worker!"),e.addEventListener("message",t=>{let r=t.data;"parseModel"===r.func?Object(a.e)(r.model,r.modelOptions,[],r.assetRoot).then(t=>{e.postMessage({msg:"done",parsedModelList:t}),close()}):"loadAndMergeModel"===r.func?Object(a.b)(r.model,r.assetRoot).then(t=>{e.postMessage({msg:"done",mergedModel:t}),close()}):"loadTextures"===r.func?Object(a.c)(r.textures,r.assetRoot).then(t=>{e.postMessage({msg:"done",textures:t}),close()}):(console.warn("Unknown function '"+r.func+"' for ModelWorker"),console.warn(r),close())})}},function(e,t,r){"use strict";(function(e){var t=r(0),a=r(23),n=r(24),i=r.n(n),o=r(7),s=r(2);r(25);const l=["left","right","top","bottom","front","back"];let u={camera:{type:"perspective",x:35,y:25,z:20,target:[0,16,0]},assetRoot:s.a};class c extends o.b{constructor(e,t){super(e,u,t),this.renderType="EntityRender",this.entities=[],this.attached=!1}render(e,r){let a=this;a.attached||a._scene?console.log("[EntityRender] is attached - skipping scene init"):super.initScene((function(){a.element.dispatchEvent(new CustomEvent("entityRender",{detail:{entities:a.entities}}))}));let n=[];for(let r=0;r{let i=e[r];console.log(i),"object"!=typeof i&&(i={model:i,texture:i,textureScale:1}),i.textureScale||(i.textureScale=1),p(i.model).then(e=>v(e)).then(e=>{console.log("Merged:"),console.log(e),Object(s.d)(a.options.assetRoot,"minecraft","/entity/",i.texture).then(r=>{(new t.TextureLoader).load(r,(function(r){r.magFilter=t.NearestFilter,r.minFilter=t.NearestFilter,r.anisotropy=0,r.needsUpdate=!0,f(a,e,r,i.textureScale).then(e=>{a.addToScene(e),a.entities.push(e),n()})}))}).catch(()=>{console.warn("Missing texture for entity "+i.texture)})}).catch(()=>{console.warn("No model file found for entity "+i.model)})}));Promise.all(n).then(()=>{"function"==typeof r&&r()})}}function f(e,r,a,n){return console.log(r),new Promise(i=>{let o=new t.Object3D;for(let i in r.groups)if(r.groups.hasOwnProperty(i)){let s=r.groups[i],l=new t.Object3D;l.name=s.name,s.pivot&&l.applyMatrix((new t.Matrix4).makeTranslation(s.pivot[0],s.pivot[1],s.pivot[2])),s.pos,s.rotation&&3===s.rotation.length&&(l.rotation.x=s.rotation[0],l.rotation.y=s.rotation[1],l.rotation.z=s.rotation[2]);for(let r=0;r{a.ajax("https://minerender.org/res/models/entities/"+e+".json").done(e=>{t(e)}).fail(()=>{r()})})}const m=(e,t,r)=>t;let v=function(e){return new Promise((t,r)=>{g(e,[],t,r)})},g=function(e,t,r,a){if(console.log(t),t.push(e),!e.hasOwnProperty("parent")){t.reverse();let e={};for(let r=0;r{g(e,t,r,a)})};"undefined"!=typeof window&&(window.EntityRender=c),void 0!==e&&(e.EntityRender=c)}).call(this,r(4))}]); \ No newline at end of file diff --git a/dist/entity.js b/dist/entity.js index 57936c61..7d966464 100644 --- a/dist/entity.js +++ b/dist/entity.js @@ -1,8 +1,8 @@ /*! - * MineRender 1.4.6 + * MineRender 1.4.7 * (c) 2018, Haylee Schäfer (inventivetalent) / MIT License * https://minerender.org - * Build #1612195849082 / Mon Feb 01 2021 17:10:49 GMT+0100 (GMT+01:00) + * Build #1612197069607 / Mon Feb 01 2021 17:31:09 GMT+0100 (GMT+01:00) */ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache @@ -317,6 +317,28 @@ eval("(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefg /***/ }), +/***/ "./node_modules/debug/src/browser.js": +/*!*******************************************!*\ + !*** ./node_modules/debug/src/browser.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(/*! ./debug */ \"./node_modules/debug/src/debug.js\");\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/process/browser.js */ \"./node_modules/node-libs-browser/node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/debug/src/browser.js?"); + +/***/ }), + +/***/ "./node_modules/debug/src/debug.js": +/*!*****************************************!*\ + !*** ./node_modules/debug/src/debug.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n\n//# sourceURL=webpack:///./node_modules/debug/src/debug.js?"); + +/***/ }), + /***/ "./node_modules/deepmerge/dist/cjs.js": /*!********************************************!*\ !*** ./node_modules/deepmerge/dist/cjs.js ***! @@ -442,6 +464,17 @@ eval("(function(){\r\n var crypt = __webpack_require__(/*! crypt */ \"./node_mo /***/ }), +/***/ "./node_modules/ms/index.js": +/*!**********************************!*\ + !*** ./node_modules/ms/index.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n\n//# sourceURL=webpack:///./node_modules/ms/index.js?"); + +/***/ }), + /***/ "./node_modules/node-libs-browser/node_modules/process/browser.js": /*!************************************************************************!*\ !*** ./node_modules/node-libs-browser/node_modules/process/browser.js ***! @@ -2049,7 +2082,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(f /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_ROOT\", function() { return DEFAULT_ROOT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureAsBase64\", function() { return loadTextureAsBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadBlockState\", function() { return loadBlockState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureMeta\", function() { return loadTextureMeta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath\", function() { return loadJsonFromPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath_\", function() { return loadJsonFromPath_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleUv\", function() { return scaleUv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trimCanvas\", function() { return trimCanvas; });\n/**\r\n * Default asset root\r\n * @type {string}\r\n */\r\nconst DEFAULT_ROOT = \"https://assets.mcasset.cloud/1.13\";\r\n/**\r\n * Texture cache\r\n * @type {Object.}\r\n */\r\nconst textureCache = {};\r\n/**\r\n * Texture callbacks\r\n * @type {Object.}\r\n */\r\nconst textureCallbacks = {};\r\n\r\n/**\r\n * Model cache\r\n * @type {Object.}\r\n */\r\nconst modelCache = {};\r\n/**\r\n * Model callbacks\r\n * @type {Object.}\r\n */\r\nconst modelCallbacks = {};\r\n\r\n\r\n/**\r\n * Loads a Mincraft texture an returns it as Base64\r\n *\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} namespace Namespace, usually 'minecraft'\r\n * @param {string} dir Directory of the texture\r\n * @param {string} name Name of the texture\r\n * @returns {Promise}\r\n */\r\nfunction loadTextureAsBase64(root, namespace, dir, name) {\r\n return new Promise((resolve, reject) => {\r\n loadTexture(root, namespace, dir, name, resolve, reject);\r\n })\r\n};\r\n\r\n/**\r\n * Load a texture as base64 - shouldn't be used directly\r\n * @see loadTextureAsBase64\r\n * @ignore\r\n */\r\nfunction loadTexture(root, namespace, dir, name, resolve, reject, forceLoad) {\r\n let path = \"/assets/\" + namespace + \"/textures\" + dir + name + \".png\";\r\n\r\n if (textureCache.hasOwnProperty(path)) {\r\n if (textureCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(textureCache[path]);\r\n return;\r\n }\r\n\r\n if (!textureCallbacks.hasOwnProperty(path) || textureCallbacks[path].length === 0 || forceLoad) {\r\n // https://gist.github.com/oliyh/db3d1a582aefe6d8fee9 / https://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', root + path, true);\r\n xhr.responseType = 'arraybuffer';\r\n xhr.onloadend = function () {\r\n if (xhr.status === 200) {\r\n let arr = new Uint8Array(xhr.response || xhr.responseText);\r\n let raw = String.fromCharCode.apply(null, arr);\r\n let b64 = btoa(raw);\r\n let dataURL = \"data:image/png;base64,\" + b64;\r\n\r\n textureCache[path] = dataURL;\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[0](dataURL);\r\n }\r\n }\r\n } else {\r\n if (DEFAULT_ROOT === root) {\r\n textureCache[path] = \"__invalid\";\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n loadTexture(DEFAULT_ROOT, namespace, dir, name, resolve, reject, true)\r\n }\r\n }\r\n };\r\n xhr.send();\r\n\r\n // init array\r\n if (!textureCallbacks.hasOwnProperty(path))\r\n textureCallbacks[path] = [];\r\n }\r\n\r\n // add the promise callback\r\n textureCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n\r\n/**\r\n * Loads a blockstate file and returns the contained JSON\r\n * @param {string} state Name of the blockstate\r\n * @param {string} assetRoot Asset root, see {@link DEFAULT_ROOT}\r\n * @returns {Promise}\r\n */\r\nfunction loadBlockState(state, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/blockstates/\" + state + \".json\")\r\n};\r\n\r\nfunction loadTextureMeta(texture, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/textures/block/\" + texture + \".png.mcmeta\")\r\n}\r\n\r\n/**\r\n * Loads a model file and returns the contained JSON\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} path Path to the model file\r\n * @returns {Promise}\r\n */\r\nfunction loadJsonFromPath(root, path) {\r\n return new Promise((resolve, reject) => {\r\n loadJsonFromPath_(root, path, resolve, reject);\r\n })\r\n}\r\n\r\n/**\r\n * Load a model - shouldn't used directly\r\n * @see loadJsonFromPath\r\n * @ignore\r\n */\r\nfunction loadJsonFromPath_(root, path, resolve, reject, forceLoad) {\r\n if (modelCache.hasOwnProperty(path)) {\r\n if (modelCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(Object.assign({}, modelCache[path]));\r\n return;\r\n }\r\n\r\n if (!modelCallbacks.hasOwnProperty(path) || modelCallbacks[path].length === 0 || forceLoad) {\r\n console.log(root + path)\r\n fetch(root + path, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"json data:\", data);\r\n modelCache[path] = data;\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let dataCopy = Object.assign({}, data);\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[0](dataCopy);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n console.warn(err);\r\n if (DEFAULT_ROOT === root) {\r\n modelCache[path] = \"__invalid\";\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n // Try again with default root\r\n loadJsonFromPath_(DEFAULT_ROOT, path, resolve, reject, true);\r\n }\r\n });\r\n\r\n if (!modelCallbacks.hasOwnProperty(path))\r\n modelCallbacks[path] = [];\r\n }\r\n\r\n modelCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n/**\r\n * Scales UV values\r\n * @param {number} uv UV value\r\n * @param {number} size\r\n * @param {number} [scale=16]\r\n * @returns {number}\r\n */\r\nfunction scaleUv(uv, size, scale) {\r\n if (uv === 0) return 0;\r\n return size / (scale || 16) * uv;\r\n}\r\n\r\n\r\n// https://gist.github.com/remy/784508\r\nfunction trimCanvas(c) {\r\n let ctx = c.getContext('2d'),\r\n copy = document.createElement('canvas').getContext('2d'),\r\n pixels = ctx.getImageData(0, 0, c.width, c.height),\r\n l = pixels.data.length,\r\n i,\r\n bound = {\r\n top: null,\r\n left: null,\r\n right: null,\r\n bottom: null\r\n },\r\n x, y;\r\n\r\n for (i = 0; i < l; i += 4) {\r\n if (pixels.data[i + 3] !== 0) {\r\n x = (i / 4) % c.width;\r\n y = ~~((i / 4) / c.width);\r\n\r\n if (bound.top === null) {\r\n bound.top = y;\r\n }\r\n\r\n if (bound.left === null) {\r\n bound.left = x;\r\n } else if (x < bound.left) {\r\n bound.left = x;\r\n }\r\n\r\n if (bound.right === null) {\r\n bound.right = x;\r\n } else if (bound.right < x) {\r\n bound.right = x;\r\n }\r\n\r\n if (bound.bottom === null) {\r\n bound.bottom = y;\r\n } else if (bound.bottom < y) {\r\n bound.bottom = y;\r\n }\r\n }\r\n }\r\n\r\n let trimHeight = bound.bottom - bound.top,\r\n trimWidth = bound.right - bound.left,\r\n trimmed = ctx.getImageData(bound.left, bound.top, trimWidth, trimHeight);\r\n\r\n copy.canvas.width = trimWidth;\r\n copy.canvas.height = trimHeight;\r\n copy.putImageData(trimmed, 0, 0);\r\n\r\n // open new window with trimmed image:\r\n return copy.canvas;\r\n}\n\n//# sourceURL=webpack:///./src/functions.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_ROOT\", function() { return DEFAULT_ROOT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureAsBase64\", function() { return loadTextureAsBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadBlockState\", function() { return loadBlockState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureMeta\", function() { return loadTextureMeta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath\", function() { return loadJsonFromPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath_\", function() { return loadJsonFromPath_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleUv\", function() { return scaleUv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trimCanvas\", function() { return trimCanvas; });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_0__);\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__(\"minerender\");\r\n\r\n/**\r\n * Default asset root\r\n * @type {string}\r\n */\r\nconst DEFAULT_ROOT = \"https://assets.mcasset.cloud/1.13\";\r\n/**\r\n * Texture cache\r\n * @type {Object.}\r\n */\r\nconst textureCache = {};\r\n/**\r\n * Texture callbacks\r\n * @type {Object.}\r\n */\r\nconst textureCallbacks = {};\r\n\r\n/**\r\n * Model cache\r\n * @type {Object.}\r\n */\r\nconst modelCache = {};\r\n/**\r\n * Model callbacks\r\n * @type {Object.}\r\n */\r\nconst modelCallbacks = {};\r\n\r\n\r\n/**\r\n * Loads a Mincraft texture an returns it as Base64\r\n *\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} namespace Namespace, usually 'minecraft'\r\n * @param {string} dir Directory of the texture\r\n * @param {string} name Name of the texture\r\n * @returns {Promise}\r\n */\r\nfunction loadTextureAsBase64(root, namespace, dir, name) {\r\n return new Promise((resolve, reject) => {\r\n loadTexture(root, namespace, dir, name, resolve, reject);\r\n })\r\n};\r\n\r\n/**\r\n * Load a texture as base64 - shouldn't be used directly\r\n * @see loadTextureAsBase64\r\n * @ignore\r\n */\r\nfunction loadTexture(root, namespace, dir, name, resolve, reject, forceLoad) {\r\n let path = \"/assets/\" + namespace + \"/textures\" + dir + name + \".png\";\r\n\r\n if (textureCache.hasOwnProperty(path)) {\r\n if (textureCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(textureCache[path]);\r\n return;\r\n }\r\n\r\n if (!textureCallbacks.hasOwnProperty(path) || textureCallbacks[path].length === 0 || forceLoad) {\r\n // https://gist.github.com/oliyh/db3d1a582aefe6d8fee9 / https://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', root + path, true);\r\n xhr.responseType = 'arraybuffer';\r\n xhr.onloadend = function () {\r\n if (xhr.status === 200) {\r\n let arr = new Uint8Array(xhr.response || xhr.responseText);\r\n let raw = String.fromCharCode.apply(null, arr);\r\n let b64 = btoa(raw);\r\n let dataURL = \"data:image/png;base64,\" + b64;\r\n\r\n textureCache[path] = dataURL;\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[0](dataURL);\r\n }\r\n }\r\n } else {\r\n if (DEFAULT_ROOT === root) {\r\n textureCache[path] = \"__invalid\";\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n loadTexture(DEFAULT_ROOT, namespace, dir, name, resolve, reject, true)\r\n }\r\n }\r\n };\r\n xhr.send();\r\n\r\n // init array\r\n if (!textureCallbacks.hasOwnProperty(path))\r\n textureCallbacks[path] = [];\r\n }\r\n\r\n // add the promise callback\r\n textureCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n\r\n/**\r\n * Loads a blockstate file and returns the contained JSON\r\n * @param {string} state Name of the blockstate\r\n * @param {string} assetRoot Asset root, see {@link DEFAULT_ROOT}\r\n * @returns {Promise}\r\n */\r\nfunction loadBlockState(state, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/blockstates/\" + state + \".json\")\r\n};\r\n\r\nfunction loadTextureMeta(texture, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/textures/block/\" + texture + \".png.mcmeta\")\r\n}\r\n\r\n/**\r\n * Loads a model file and returns the contained JSON\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} path Path to the model file\r\n * @returns {Promise}\r\n */\r\nfunction loadJsonFromPath(root, path) {\r\n return new Promise((resolve, reject) => {\r\n loadJsonFromPath_(root, path, resolve, reject);\r\n })\r\n}\r\n\r\n/**\r\n * Load a model - shouldn't used directly\r\n * @see loadJsonFromPath\r\n * @ignore\r\n */\r\nfunction loadJsonFromPath_(root, path, resolve, reject, forceLoad) {\r\n if (modelCache.hasOwnProperty(path)) {\r\n if (modelCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(Object.assign({}, modelCache[path]));\r\n return;\r\n }\r\n\r\n if (!modelCallbacks.hasOwnProperty(path) || modelCallbacks[path].length === 0 || forceLoad) {\r\n debug(root + path)\r\n fetch(root + path, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n debug(\"json data:\", data);\r\n modelCache[path] = data;\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let dataCopy = Object.assign({}, data);\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[0](dataCopy);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n console.warn(err);\r\n if (DEFAULT_ROOT === root) {\r\n modelCache[path] = \"__invalid\";\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n // Try again with default root\r\n loadJsonFromPath_(DEFAULT_ROOT, path, resolve, reject, true);\r\n }\r\n });\r\n\r\n if (!modelCallbacks.hasOwnProperty(path))\r\n modelCallbacks[path] = [];\r\n }\r\n\r\n modelCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n/**\r\n * Scales UV values\r\n * @param {number} uv UV value\r\n * @param {number} size\r\n * @param {number} [scale=16]\r\n * @returns {number}\r\n */\r\nfunction scaleUv(uv, size, scale) {\r\n if (uv === 0) return 0;\r\n return size / (scale || 16) * uv;\r\n}\r\n\r\n\r\n// https://gist.github.com/remy/784508\r\nfunction trimCanvas(c) {\r\n let ctx = c.getContext('2d'),\r\n copy = document.createElement('canvas').getContext('2d'),\r\n pixels = ctx.getImageData(0, 0, c.width, c.height),\r\n l = pixels.data.length,\r\n i,\r\n bound = {\r\n top: null,\r\n left: null,\r\n right: null,\r\n bottom: null\r\n },\r\n x, y;\r\n\r\n for (i = 0; i < l; i += 4) {\r\n if (pixels.data[i + 3] !== 0) {\r\n x = (i / 4) % c.width;\r\n y = ~~((i / 4) / c.width);\r\n\r\n if (bound.top === null) {\r\n bound.top = y;\r\n }\r\n\r\n if (bound.left === null) {\r\n bound.left = x;\r\n } else if (x < bound.left) {\r\n bound.left = x;\r\n }\r\n\r\n if (bound.right === null) {\r\n bound.right = x;\r\n } else if (bound.right < x) {\r\n bound.right = x;\r\n }\r\n\r\n if (bound.bottom === null) {\r\n bound.bottom = y;\r\n } else if (bound.bottom < y) {\r\n bound.bottom = y;\r\n }\r\n }\r\n }\r\n\r\n let trimHeight = bound.bottom - bound.top,\r\n trimWidth = bound.right - bound.left,\r\n trimmed = ctx.getImageData(bound.left, bound.top, trimWidth, trimHeight);\r\n\r\n copy.canvas.width = trimWidth;\r\n copy.canvas.height = trimHeight;\r\n copy.putImageData(trimmed, 0, 0);\r\n\r\n // open new window with trimmed image:\r\n return copy.canvas;\r\n}\r\n\n\n//# sourceURL=webpack:///./src/functions.js?"); /***/ }), @@ -2109,7 +2142,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return worker; });\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n\r\n\r\nfunction worker(self) {\r\n console.debug(\"New Worker!\")\r\n self.addEventListener(\"message\", event => {\r\n let msg = event.data;\r\n\r\n if (msg.func === \"parseModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"parseModel\"])(msg.model, msg.modelOptions, [], msg.assetRoot).then((parsedModelList) => {\r\n self.postMessage({msg: \"done\",parsedModelList:parsedModelList})\r\n close();\r\n })\r\n } else if (msg.func === \"loadAndMergeModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadAndMergeModel\"])(msg.model, msg.assetRoot).then((mergedModel) => {\r\n self.postMessage({msg: \"done\",mergedModel:mergedModel});\r\n close();\r\n })\r\n } else if (msg.func === \"loadTextures\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextures\"])(msg.textures, msg.assetRoot).then((textures) => {\r\n self.postMessage({msg: \"done\",textures:textures});\r\n close();\r\n })\r\n } else {\r\n console.warn(\"Unknown function '\" + msg.func + \"' for ModelWorker\");\r\n console.warn(msg);\r\n close();\r\n }\r\n })\r\n};\r\n\n\n//# sourceURL=webpack:///./src/model/ModelWorker.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return worker; });\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_1__(\"minerender\");\r\n\r\nfunction worker(self) {\r\n debug(\"New Worker!\")\r\n self.addEventListener(\"message\", event => {\r\n let msg = event.data;\r\n\r\n if (msg.func === \"parseModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"parseModel\"])(msg.model, msg.modelOptions, [], msg.assetRoot).then((parsedModelList) => {\r\n self.postMessage({msg: \"done\",parsedModelList:parsedModelList})\r\n close();\r\n })\r\n } else if (msg.func === \"loadAndMergeModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadAndMergeModel\"])(msg.model, msg.assetRoot).then((mergedModel) => {\r\n self.postMessage({msg: \"done\",mergedModel:mergedModel});\r\n close();\r\n })\r\n } else if (msg.func === \"loadTextures\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextures\"])(msg.textures, msg.assetRoot).then((textures) => {\r\n self.postMessage({msg: \"done\",textures:textures});\r\n close();\r\n })\r\n } else {\r\n console.warn(\"Unknown function '\" + msg.func + \"' for ModelWorker\");\r\n console.warn(msg);\r\n close();\r\n }\r\n })\r\n};\r\n\n\n//# sourceURL=webpack:///./src/model/ModelWorker.js?"); /***/ }), @@ -2121,7 +2154,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _renderBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../renderBase */ \"./src/renderBase.js\");\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var _modelConverter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modelConverter */ \"./src/model/modelConverter.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! md5 */ \"./node_modules/md5/md5.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! webworkify-webpack */ \"./node_modules/webworkify-webpack/index.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _skin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../skin */ \"./src/skin/index.js\");\n/* harmony import */ var onscreen_lib_methods_off__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! onscreen/lib/methods/off */ \"./node_modules/onscreen/lib/methods/off.js\");\n\r\n\r\n__webpack_require__(/*! three-instanced-mesh */ \"./node_modules/three-instanced-mesh/index.js\")(three__WEBPACK_IMPORTED_MODULE_0__);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst ModelWorker = /*require.resolve*/(/*! ./ModelWorker.js */ \"./src/model/ModelWorker.js\");\r\n\r\n\r\nString.prototype.replaceAll = function (search, replacement) {\r\n let target = this;\r\n return target.replace(new RegExp(search, 'g'), replacement);\r\n};\r\n\r\nconst colors = [\r\n 0xFF0000,\r\n 0x00FFFF,\r\n 0x0000FF,\r\n 0x000080,\r\n 0xFF00FF,\r\n 0x800080,\r\n 0x808000,\r\n 0x00FF00,\r\n 0x008000,\r\n 0xFFFF00,\r\n 0x800000,\r\n 0x008080,\r\n];\r\n\r\nconst FACE_ORDER = [\"east\", \"west\", \"up\", \"down\", \"south\", \"north\"];\r\nconst TINTS = [\"lightgreen\"];\r\n\r\nconst mergedModelCache = {};\r\nconst loadedTextureCache = {};\r\nconst modelInstances = {};\r\n\r\nconst textureCache = {};\r\nconst canvasCache = {};\r\nconst materialCache = {};\r\nconst geometryCache = {};\r\nconst instanceCache = {};\r\n\r\nconst animatedTextures = [];\r\n\r\n/**\r\n * @see defaultOptions\r\n * @property {string} type alternative way to specify the model type (block/item)\r\n * @property {boolean} [centerCubes=false] center the cube's rotation point\r\n * @property {string} [assetRoot=DEFAULT_ROOT] root to get asset files from\r\n */\r\nlet defOptions = {\r\n camera: {\r\n type: \"perspective\",\r\n x: 35,\r\n y: 25,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n type: \"block\",\r\n centerCubes: false,\r\n assetRoot: _functions__WEBPACK_IMPORTED_MODULE_4__[\"DEFAULT_ROOT\"],\r\n useWebWorkers: false\r\n};\r\n\r\n/**\r\n * A renderer for Minecraft models, i.e. blocks & items\r\n */\r\nclass ModelRender extends _renderBase__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\r\n\r\n /**\r\n * @param {Object} [options] The options for this renderer, see {@link defaultOptions}\r\n * @param {string} [options.assetRoot=DEFAULT_ROOT] root to get asset files from\r\n *\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, element) {\r\n super(options, defOptions, element);\r\n\r\n this.renderType = \"ModelRender\";\r\n\r\n this.models = [];\r\n this.instancePositionMap = {};\r\n this.attached = false;\r\n }\r\n\r\n /**\r\n * Does the actual rendering\r\n * @param {(string[]|Object[])} models Array of models to render - Either strings in the format / or objects\r\n * @param {string} [models[].type=block] either 'block' or 'item'\r\n * @param {string} models[].model if 'type' is given, just the block/item name otherwise '/'\r\n * @param {number[]} [models[].offset] [x,y,z] array of the offset\r\n * @param {number[]} [models[].rotation] [x,y,z] array of the rotation\r\n * @param {string} [models[].blockstate] name of a blockstate to be used to determine the models (only for blocks)\r\n * @param {string} [models[].variant=normal] if 'blockstate' is given, the block variant to use\r\n * @param {function} [cb] Callback when rendering finished\r\n */\r\n render(models, cb) {\r\n let modelRender = this;\r\n\r\n if (!modelRender.attached && !modelRender._scene) {// Don't init scene if attached, since we already have an available scene\r\n super.initScene(function () {\r\n // Animate textures\r\n for (let i = 0; i < animatedTextures.length; i++) {\r\n animatedTextures[i]();\r\n }\r\n\r\n modelRender.element.dispatchEvent(new CustomEvent(\"modelRender\", {detail: {models: modelRender.models}}));\r\n });\r\n } else {\r\n console.log(\"[ModelRender] is attached - skipping scene init\");\r\n }\r\n\r\n let parsedModelList = [];\r\n\r\n parseModels(modelRender, models, parsedModelList)\r\n .then(() => loadAndMergeModels(modelRender, parsedModelList))\r\n .then(() => loadModelTextures(modelRender, parsedModelList))\r\n .then(() => doModelRender(modelRender, parsedModelList))\r\n .then((renderedModels) => {\r\n console.timeEnd(\"doModelRender\");\r\n console.debug(renderedModels)\r\n if (typeof cb === \"function\") cb();\r\n })\r\n\r\n }\r\n\r\n}\r\n\r\n\r\nfunction parseModels(modelRender, models, parsedModelList) {\r\n console.time(\"parseModels\");\r\n console.log(\"Parsing Models...\");\r\n let parsePromises = [];\r\n for (let i = 0; i < models.length; i++) {\r\n let model = models[i];\r\n\r\n // parsePromises.push(parseModel(model, model, parsedModelList, modelRender.options.assetRoot))\r\n parsePromises.push(new Promise(resolve => {\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n parsedModelList.push(...event.data.parsedModelList);\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"parseModel\",\r\n model: model,\r\n modelOptions: model,\r\n parsedModelList: parsedModelList,\r\n assetRoot: modelRender.options.assetRoot\r\n })\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"parseModel\"])(model, model, parsedModelList, modelRender.options.assetRoot).then(() => {\r\n resolve();\r\n })\r\n }\r\n }))\r\n\r\n }\r\n\r\n return Promise.all(parsePromises);\r\n}\r\n\r\n\r\nfunction loadAndMergeModels(modelRender, parsedModelList) {\r\n console.timeEnd(\"parseModels\");\r\n console.time(\"loadAndMergeModels\");\r\n\r\n let jsonPromises = [];\r\n\r\n console.log(\"Loading Model JSON data & merging...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i]);\r\n modelInstances[cacheKey] = (modelInstances[cacheKey] || 0) + 1;\r\n uniqueModels[cacheKey] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n console.debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n jsonPromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n console.debug(\"loadAndMerge \" + cacheKey);\r\n\r\n\r\n if (mergedModelCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n mergedModelCache[cacheKey] = event.data.mergedModel;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadAndMergeModel\",\r\n model: model,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadAndMergeModel\"])(model, modelRender.options.assetRoot).then((mergedModel) => {\r\n mergedModelCache[cacheKey] = mergedModel;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n return Promise.all(jsonPromises);\r\n}\r\n\r\nfunction loadModelTextures(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadAndMergeModels\");\r\n console.time(\"loadModelTextures\");\r\n\r\n let texturePromises = [];\r\n\r\n console.log(\"Loading Textures...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n uniqueModels[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i])] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n console.debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n texturePromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n console.debug(\"loadTexture \" + cacheKey);\r\n let mergedModel = mergedModelCache[cacheKey];\r\n\r\n if (loadedTextureCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel) {\r\n console.warn(\"Missing merged model\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel.textures) {\r\n console.warn(\"The model doesn't have any textures!\");\r\n console.warn(\"Please make sure you're using the proper file.\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n loadedTextureCache[cacheKey] = event.data.textures;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadTextures\",\r\n textures: mergedModel.textures,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadTextures\"])(mergedModel.textures, modelRender.options.assetRoot).then((textures) => {\r\n loadedTextureCache[cacheKey] = textures;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n\r\n return Promise.all(texturePromises);\r\n}\r\n\r\nfunction doModelRender(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadModelTextures\");\r\n console.time(\"doModelRender\");\r\n\r\n console.log(\"Rendering Models...\");\r\n\r\n let renderPromises = [];\r\n\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n renderPromises.push(new Promise(resolve => {\r\n let model = parsedModelList[i];\r\n\r\n let mergedModel = mergedModelCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n let textures = loadedTextureCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n\r\n let offset = model.offset || [0, 0, 0];\r\n let rotation = model.rotation || [0, 0, 0];\r\n let scale = model.scale || [1, 1, 1];\r\n\r\n if (model.options.hasOwnProperty(\"display\")) {\r\n if (mergedModel.hasOwnProperty(\"display\")) {\r\n if (mergedModel.display.hasOwnProperty(model.options.display)) {\r\n let displayData = mergedModel.display[model.options.display];\r\n\r\n if (displayData.hasOwnProperty(\"translation\")) {\r\n offset = [offset[0] + displayData.translation[0], offset[1] + displayData.translation[1], offset[2] + displayData.translation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"rotation\")) {\r\n rotation = [rotation[0] + displayData.rotation[0], rotation[1] + displayData.rotation[1], rotation[2] + displayData.rotation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"scale\")) {\r\n scale = [displayData.scale[0], displayData.scale[1], displayData.scale[2]];\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n\r\n renderModel(modelRender, mergedModel, textures, mergedModel.textures, model.type, model.name, model.variant, offset, rotation, scale).then((renderedModel) => {\r\n\r\n if (renderedModel.firstInstance) {\r\n let container = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\r\n container.add(renderedModel.mesh);\r\n\r\n modelRender.models.push(container);\r\n modelRender.addToScene(container);\r\n }\r\n\r\n resolve(renderedModel);\r\n })\r\n }))\r\n }\r\n\r\n return Promise.all(renderPromises);\r\n}\r\n\r\n\r\nlet renderModel = function (modelRender, model, textures, textureNames, type, name, variant, offset, rotation, scale) {\r\n return new Promise((resolve) => {\r\n if (model.hasOwnProperty(\"elements\")) {// block OR item with block parent\r\n let modelKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant});\r\n let instanceCount = modelInstances[modelKey];\r\n\r\n let applyModelTransforms = function (mesh, instanceIndex) {\r\n mesh.userData.modelType = type;\r\n mesh.userData.modelName = name;\r\n\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n let instanceInfo = {\r\n key: modelKey,\r\n index: instanceIndex,\r\n offset: offset,\r\n scale: scale,\r\n rotation: rotation\r\n };\r\n\r\n if (rotation) {\r\n mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new three__WEBPACK_IMPORTED_MODULE_0__[\"Euler\"](Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]))));\r\n }\r\n if (offset) {\r\n mesh.setPositionAt(instanceIndex, _v3o.set(offset[0], offset[1], offset[2]));\r\n modelRender.instancePositionMap[offset[0] + \"_\" + offset[1] + \"_\" + offset[2]] = instanceInfo;\r\n }\r\n if (scale) {\r\n mesh.setScaleAt(instanceIndex, _v3s.set(scale[0], scale[1], scale[2]));\r\n }\r\n\r\n mesh.needsUpdate();\r\n\r\n // mesh.position = _v3o;\r\n // Object.defineProperty(mesh.position,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(x, this.y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, this.y, z));\r\n // }\r\n // })\r\n //\r\n // mesh.rotation = new THREE.Euler(toRadians(rotation[0]), toRadians(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), toRadians(rotation[2]));\r\n // Object.defineProperty(mesh.rotation,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(x), toRadians(this.y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(this.y), toRadians(z))));\r\n // }\r\n // });\r\n //\r\n // mesh.scale = _v3s;\r\n\r\n resolve({\r\n mesh: mesh,\r\n firstInstance: instanceIndex === 0\r\n });\r\n };\r\n\r\n let finalizeCubeModel = function (geometry, materials) {\r\n geometry.translate(-8, -8, -8);\r\n\r\n\r\n let cachedInstance;\r\n\r\n if (!instanceCache.hasOwnProperty(modelKey)) {\r\n console.debug(\"Caching new model instance \" + modelKey + \" (with \" + instanceCount + \" instances)\");\r\n let newInstance = new three__WEBPACK_IMPORTED_MODULE_0__[\"InstancedMesh\"](\r\n geometry,\r\n materials,\r\n instanceCount,\r\n false,\r\n false,\r\n false);\r\n cachedInstance = {\r\n instance: newInstance,\r\n index: 0\r\n };\r\n instanceCache[modelKey] = cachedInstance;\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](1, 1, 1);\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n for (let i = 0; i < instanceCount; i++) {\r\n\r\n newInstance.setQuaternionAt(i, _q);\r\n newInstance.setPositionAt(i, _v3o);\r\n newInstance.setScaleAt(i, _v3s);\r\n\r\n }\r\n } else {\r\n console.debug(\"Using cached instance (\" + modelKey + \")\");\r\n cachedInstance = instanceCache[modelKey];\r\n\r\n }\r\n\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n };\r\n\r\n if (instanceCache.hasOwnProperty(modelKey)) {\r\n console.debug(\"Using cached model instance (\" + modelKey + \")\");\r\n let cachedInstance = instanceCache[modelKey];\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n return;\r\n }\r\n\r\n // Render the elements\r\n let promises = [];\r\n for (let i = 0; i < model.elements.length; i++) {\r\n let element = model.elements[i];\r\n\r\n // // From net.minecraft.client.renderer.block.model.BlockPart.java#47 - https://yeleha.co/2JcqSr4\r\n let fallbackFaces = {\r\n down: {\r\n uv: [element.from[0], 16 - element.to[2], element.to[0], 16 - element.from[2]],\r\n texture: \"#down\"\r\n },\r\n up: {\r\n uv: [element.from[0], element.from[2], element.to[0], element.to[2]],\r\n texture: \"#up\"\r\n },\r\n north: {\r\n uv: [16 - element.to[0], 16 - element.to[1], 16 - element.from[0], 16 - element.from[1]],\r\n texture: \"#north\"\r\n },\r\n south: {\r\n uv: [element.from[0], 16 - element.to[1], element.to[0], 16 - element.from[1]],\r\n texture: \"#south\"\r\n },\r\n west: {\r\n uv: [element.from[2], 16 - element.to[1], element.to[2], 16 - element.from[2]],\r\n texture: \"#west\"\r\n },\r\n east: {\r\n uv: [16 - element.to[2], 16 - element.to[1], 16 - element.from[2], 16 - element.from[1]],\r\n texture: \"#east\"\r\n }\r\n };\r\n\r\n promises.push(new Promise((resolve) => {\r\n let baseName = name.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" + (element.__comment ? element.__comment.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" : \"\");\r\n createCube(element.to[0] - element.from[0], element.to[1] - element.from[1], element.to[2] - element.from[2],\r\n baseName + Date.now(),\r\n element.faces, fallbackFaces, textures, textureNames, modelRender.options.assetRoot, baseName)\r\n .then((cube) => {\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation((element.to[0] - element.from[0]) / 2, (element.to[1] - element.from[1]) / 2, (element.to[2] - element.from[2]) / 2));\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(element.from[0], element.from[1], element.from[2]));\r\n\r\n if (element.rotation) {\r\n rotateAboutPoint(cube,\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.origin[0], element.rotation.origin[1], element.rotation.origin[2]),\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.axis === \"x\" ? 1 : 0, element.rotation.axis === \"y\" ? 1 : 0, element.rotation.axis === \"z\" ? 1 : 0),\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(element.rotation.angle));\r\n }\r\n\r\n resolve(cube);\r\n })\r\n }));\r\n\r\n\r\n }\r\n\r\n Promise.all(promises).then((cubes) => {\r\n let mergedCubes = Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"mergeCubeMeshes\"])(cubes, true);\r\n mergedCubes.sourceSize = cubes.length;\r\n finalizeCubeModel(mergedCubes.geometry, mergedCubes.materials, cubes.length);\r\n for (let i = 0; i < cubes.length; i++) {\r\n Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"deepDisposeMesh\"])(cubes[i], true);\r\n }\r\n })\r\n } else {// 2d item\r\n createPlane(name + \"_\" + Date.now(), textures).then((plane) => {\r\n if (offset) {\r\n plane.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(offset[0], offset[1], offset[2]))\r\n }\r\n if (rotation) {\r\n plane.rotation.set(Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]));\r\n }\r\n if (scale) {\r\n plane.scale.set(scale[0], scale[1], scale[2]);\r\n }\r\n\r\n resolve({\r\n mesh: plane,\r\n firstInstance: true\r\n });\r\n })\r\n }\r\n })\r\n};\r\n\r\nfunction setVisibilityOfInstance(meshKey, visibleScale, instanceIndex, visible) {\r\n let instance = instanceCache[meshKey];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n let newScale;\r\n if (visible) {\r\n if (visibleScale) {\r\n newScale = visibleScale;\r\n } else {\r\n newScale = [1, 1, 1];\r\n }\r\n } else {\r\n newScale = [0, 0, 0];\r\n }\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n mesh.setScaleAt(instanceIndex, _v3s.set(newScale[0], newScale[1], newScale[2]));\r\n return mesh;\r\n }\r\n}\r\n\r\nfunction setVisibilityAtMulti(positions, visible) {\r\n let updatedMeshes = {};\r\n for (let pos of positions) {\r\n let info = this.instancePositionMap[pos[0] + \"_\" + pos[1] + \"_\" + pos[2]];\r\n if (info) {\r\n let mesh = setVisibilityOfInstance(info.key, info.scale, info.index, visible);\r\n if (mesh) {\r\n updatedMeshes[info.key] = mesh;\r\n }\r\n }\r\n }\r\n for (let mesh of Object.values(updatedMeshes)) {\r\n mesh.needsUpdate();\r\n }\r\n}\r\n\r\nfunction setVisibilityAt(x, y, z, visible) {\r\n setVisibilityAtMulti([[x, y, z]], visible);\r\n}\r\n\r\nModelRender.prototype.setVisibilityAtMulti = setVisibilityAtMulti;\r\nModelRender.prototype.setVisibilityAt = setVisibilityAt;\r\n\r\nfunction setVisibilityOfType(type, name, variant, visible) {\r\n let instance = instanceCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant})];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n mesh.visible = visible;\r\n }\r\n}\r\n\r\nModelRender.prototype.setVisibilityOfType = setVisibilityOfType;\r\n\r\nlet createDot = function (c) {\r\n let dotGeometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"Geometry\"]();\r\n dotGeometry.vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]());\r\n let dotMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"PointsMaterial\"]({size: 5, sizeAttenuation: false, color: c});\r\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Points\"](dotGeometry, dotMaterial);\r\n};\r\n\r\nlet createPlane = function (name, textures) {\r\n return new Promise((resolve) => {\r\n\r\n let materialLoaded = function (material, width, height) {\r\n let geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"PlaneGeometry\"](width, height);\r\n let plane = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, material);\r\n plane.name = name;\r\n plane.receiveShadow = true;\r\n\r\n resolve(plane);\r\n };\r\n\r\n if (textures) {\r\n let w = 0, h = 0;\r\n let promises = [];\r\n for (let t in textures) {\r\n if (textures.hasOwnProperty(t)) {\r\n promises.push(new Promise((resolve) => {\r\n let img = new Image();\r\n img.onload = function () {\r\n if (img.width > w) w = img.width;\r\n if (img.height > h) h = img.height;\r\n resolve(img);\r\n };\r\n img.src = textures[t];\r\n }))\r\n }\r\n }\r\n Promise.all(promises).then((images) => {\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = w;\r\n canvas.height = h;\r\n let context = canvas.getContext(\"2d\");\r\n\r\n for (let i = 0; i < images.length; i++) {\r\n let img = images[i];\r\n context.drawImage(img, 0, 0);\r\n }\r\n\r\n let data = canvas.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \")\");\r\n materialLoaded(materialCache[hash], w, h);\r\n return;\r\n }\r\n\r\n let textureLoaded = function (texture) {\r\n let material = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: texture,\r\n transparent: true,\r\n side: three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"],\r\n alphaTest: 0.5,\r\n name: name\r\n });\r\n\r\n // Add material to cache\r\n console.debug(\"Caching Material \" + hash);\r\n materialCache[hash] = material;\r\n\r\n materialLoaded(material, w, h);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n console.debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n });\r\n }\r\n\r\n })\r\n};\r\n\r\n\r\n/// From https://github.com/InventivetalentDev/SkinRender/blob/master/js/render/skin.js#L353\r\nlet createCube = function (width, height, depth, name, faces, fallbackFaces, textures, textureNames, assetRoot, baseName) {\r\n return new Promise((resolve) => {\r\n let geometryKey = width + \"_\" + height + \"_\" + depth;\r\n let geometry;\r\n if (geometryCache.hasOwnProperty(geometryKey)) {\r\n console.debug(\"Using cached Geometry (\" + geometryKey + \")\");\r\n geometry = geometryCache[geometryKey];\r\n } else {\r\n geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BoxGeometry\"](width, height, depth);\r\n console.debug(\"Caching Geometry \" + geometryKey);\r\n geometryCache[geometryKey] = geometry;\r\n }\r\n\r\n let materialsLoaded = function (materials) {\r\n let cube = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, materials);\r\n cube.name = name;\r\n cube.receiveShadow = true;\r\n\r\n resolve(cube);\r\n };\r\n if (textures) {\r\n let promises = [];\r\n for (let i = 0; i < 6; i++) {\r\n promises.push(new Promise((resolve) => {\r\n let f = FACE_ORDER[i];\r\n if (!faces.hasOwnProperty(f)) {\r\n // console.warn(\"Missing face: \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n let face = faces[f];\r\n let textureRef = face.texture.substr(1);\r\n if (!textures.hasOwnProperty(textureRef) || !textures[textureRef]) {\r\n console.warn(\"Missing texture '\" + textureRef + \"' for face \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let canvasKey = textureRef + \"_\" + f + \"_\" + baseName;\r\n\r\n let processImgToCanvasData = (img) => {\r\n let uv = face.uv;\r\n if (!uv) {\r\n // console.warn(\"Missing UV mapping for face \" + f + \" in model \" + name + \". Using defaults\");\r\n uv = fallbackFaces[f].uv;\r\n }\r\n\r\n // Scale the uv values to match the image width, so we can support resource packs with higher-resolution textures\r\n uv = [\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[0], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[1], img.height),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[2], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[3], img.height)\r\n ];\r\n\r\n\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = Math.abs(uv[2] - uv[0]);\r\n canvas.height = Math.abs(uv[3] - uv[1]);\r\n\r\n let context = canvas.getContext(\"2d\");\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n let tintColor;\r\n if (face.hasOwnProperty(\"tintindex\")) {\r\n tintColor = TINTS[face.tintindex];\r\n } else if (baseName.startsWith(\"water_\")) {\r\n tintColor = \"blue\";\r\n }\r\n\r\n if (tintColor) {\r\n context.fillStyle = tintColor;\r\n context.globalCompositeOperation = 'multiply';\r\n context.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n context.globalAlpha = 1;\r\n context.globalCompositeOperation = 'destination-in';\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n // context.globalAlpha = 0.5;\r\n // context.beginPath();\r\n // context.fillStyle = \"green\";\r\n // context.rect(0, 0, uv[2] - uv[0], uv[3] - uv[1]);\r\n // context.fill();\r\n // context.globalAlpha = 1.0;\r\n }\r\n\r\n let canvasData = context.getImageData(0, 0, canvas.width, canvas.height).data;\r\n let hasTransparency = false;\r\n for (let i = 3; i < (canvas.width * canvas.height); i += 4) {\r\n if (canvasData[i] < 255) {\r\n hasTransparency = true;\r\n break;\r\n }\r\n }\r\n\r\n let dataUrl = canvas.toDataURL(\"image/png\");\r\n let dataHash = md5__WEBPACK_IMPORTED_MODULE_6__(dataUrl);\r\n\r\n let d = {\r\n canvas: canvas,\r\n data: canvasData,\r\n dataUrl: dataUrl,\r\n dataUrlHash: dataHash,\r\n hasTransparency: hasTransparency,\r\n width: canvas.width,\r\n height: canvas.height\r\n };\r\n console.debug(\"Caching new canvas (\" + canvasKey + \"/\" + dataHash + \")\")\r\n canvasCache[canvasKey] = d;\r\n return d;\r\n };\r\n\r\n let loadTextureFromCanvas = (canvas) => {\r\n\r\n\r\n let loadTextureDefault = function (canvas) {\r\n let data = canvas.dataUrl;\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \", without meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n let n = textureNames[textureRef];\r\n if (n.startsWith(\"#\")) {\r\n n = textureNames[name.substr(1)];\r\n }\r\n console.debug(\"Pre-Caching Material \" + hash + \", without meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5,\r\n name: f + \"_\" + textureRef + \"_\" + n\r\n });\r\n\r\n let textureLoaded = function (texture) {\r\n // Add material to cache\r\n console.debug(\"Finalizing Cached Material \" + hash + \", without meta\");\r\n materialCache[hash].map = texture;\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture from cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n if (face.hasOwnProperty(\"rotation\")) {\r\n texture.center.x = .5;\r\n texture.center.y = .5;\r\n texture.rotation = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(face.rotation);\r\n }\r\n\r\n console.debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n };\r\n\r\n let loadTextureWithMeta = function (canvas, meta) {\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \", with meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Material \" + hash + \", with meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5\r\n });\r\n\r\n let frametime = 1;\r\n if (meta.hasOwnProperty(\"animation\")) {\r\n if (meta.animation.hasOwnProperty(\"frametime\")) {\r\n frametime = meta.animation.frametime;\r\n }\r\n }\r\n\r\n let parts = Math.floor(canvas.height / canvas.width);\r\n\r\n console.log(\"Generating animated texture...\");\r\n\r\n let promises1 = [];\r\n for (let i = 0; i < parts; i++) {\r\n promises1.push(new Promise((resolve) => {\r\n let canvas1 = document.createElement(\"canvas\");\r\n canvas1.width = canvas.width;\r\n canvas1.height = canvas.width;\r\n let context1 = canvas1.getContext(\"2d\");\r\n context1.drawImage(canvas.canvas, 0, i * canvas.width, canvas.width, canvas.width, 0, 0, canvas.width, canvas.width);\r\n\r\n let data = canvas1.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n resolve(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n console.debug(\"Caching Texture \" + hash + \", without meta\");\r\n // add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n resolve(texture);\r\n });\r\n }));\r\n }\r\n\r\n Promise.all(promises1).then((textures) => {\r\n\r\n let frameCounter = 0;\r\n let textureIndex = 0;\r\n animatedTextures.push(() => {// called on render\r\n if (frameCounter >= frametime) {\r\n frameCounter = 0;\r\n\r\n // Set new texture\r\n materialCache[hash].map = textures[textureIndex];\r\n\r\n textureIndex++;\r\n }\r\n if (textureIndex >= textures.length) {\r\n textureIndex = 0;\r\n }\r\n frameCounter += 0.1;// game ticks TODO: figure out the proper value for this\r\n })\r\n\r\n // Add material to cache\r\n console.debug(\"Finalizing Cached Material \" + hash + \", with meta\");\r\n materialCache[hash].map = textures[0];\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n });\r\n };\r\n\r\n if ((canvas.height > canvas.width) && (canvas.height % canvas.width === 0)) {// Taking a guess that this is an animated texture\r\n let name = textureNames[textureRef];\r\n if (name.startsWith(\"#\")) {\r\n name = textureNames[name.substr(1)];\r\n }\r\n if (name.indexOf(\"/\") !== -1) {\r\n name = name.substr(name.indexOf(\"/\") + 1);\r\n }\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"loadTextureMeta\"])(name, assetRoot).then((meta) => {\r\n loadTextureWithMeta(canvas, meta);\r\n }).catch(() => {// Guessed wrong :shrug:\r\n loadTextureDefault(canvas);\r\n })\r\n } else {\r\n loadTextureDefault(canvas);\r\n }\r\n };\r\n\r\n\r\n if (canvasCache.hasOwnProperty(canvasKey)) {\r\n let cachedCanvas = canvasCache[canvasKey];\r\n\r\n if (cachedCanvas.hasOwnProperty(\"img\")) {\r\n console.debug(\"Waiting for canvas image that's already loading (\" + canvasKey + \")\")\r\n let img = cachedCanvas.img;\r\n img.waitingForCanvas.push(function (canvas) {\r\n loadTextureFromCanvas(canvas);\r\n });\r\n } else {\r\n console.debug(\"Using cached canvas (\" + canvasKey + \")\")\r\n loadTextureFromCanvas(canvasCache[canvasKey]);\r\n }\r\n } else {\r\n let img = new Image();\r\n img.onerror = function (err) {\r\n console.warn(err);\r\n resolve(null);\r\n };\r\n img.waitingForCanvas = [];\r\n img.onload = function () {\r\n let canvasData = processImgToCanvasData(img);\r\n loadTextureFromCanvas(canvasData);\r\n\r\n for (let c = 0; c < img.waitingForCanvas.length; c++) {\r\n img.waitingForCanvas[c](canvasData);\r\n }\r\n };\r\n console.debug(\"Pre-caching canvas (\" + canvasKey + \")\");\r\n canvasCache[canvasKey] = {\r\n img: img\r\n };\r\n img.src = textures[textureRef];\r\n }\r\n }));\r\n }\r\n Promise.all(promises).then(materials => materialsLoaded(materials))\r\n } else {\r\n let materials = [];\r\n for (let i = 0; i < 6; i++) {\r\n materials.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n color: colors[i + 2],\r\n wireframe: true\r\n }))\r\n }\r\n materialsLoaded(materials);\r\n }\r\n\r\n // if (textures) {\r\n // applyCubeTextureToGeometry(geometry, texture, uv, width, height, depth);\r\n // }\r\n\r\n\r\n })\r\n};\r\n\r\n/// https://stackoverflow.com/questions/42812861/three-js-pivot-point/42866733#42866733\r\n// obj - your object (THREE.Object3D or derived)\r\n// point - the point of rotation (THREE.Vector3)\r\n// axis - the axis of rotation (normalized THREE.Vector3)\r\n// theta - radian value of rotation\r\nfunction rotateAboutPoint(obj, point, axis, theta) {\r\n obj.position.sub(point); // remove the offset\r\n obj.position.applyAxisAngle(axis, theta); // rotate the POSITION\r\n obj.position.add(point); // re-add the offset\r\n\r\n obj.rotateOnAxis(axis, theta); // rotate the OBJECT\r\n}\r\n\r\nModelRender.cache = {\r\n loadedTextures: loadedTextureCache,\r\n mergedModels: mergedModelCache,\r\n instanceCount: modelInstances,\r\n\r\n texture: textureCache,\r\n canvas: canvasCache,\r\n material: materialCache,\r\n geometry: geometryCache,\r\n instances: instanceCache,\r\n\r\n animated: animatedTextures,\r\n\r\n\r\n resetInstances: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n },\r\n clearAll: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(loadedTextureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(mergedModelCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(textureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(canvasCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(materialCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(geometryCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n animatedTextures.splice(0, animatedTextures.length);\r\n }\r\n};\r\nModelRender.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n\r\nif (typeof window !== \"undefined\") {\r\n window.ModelRender = ModelRender;\r\n window.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n}\r\nif (typeof global !== \"undefined\")\r\n global.ModelRender = ModelRender;\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (ModelRender);\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./src/model/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _renderBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../renderBase */ \"./src/renderBase.js\");\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var _modelConverter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modelConverter */ \"./src/model/modelConverter.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! md5 */ \"./node_modules/md5/md5.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! webworkify-webpack */ \"./node_modules/webworkify-webpack/index.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _skin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../skin */ \"./src/skin/index.js\");\n/* harmony import */ var onscreen_lib_methods_off__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! onscreen/lib/methods/off */ \"./node_modules/onscreen/lib/methods/off.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_11__);\n\r\n\r\n__webpack_require__(/*! three-instanced-mesh */ \"./node_modules/three-instanced-mesh/index.js\")(three__WEBPACK_IMPORTED_MODULE_0__);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_11__(\"minerender\");\r\n\r\nconst ModelWorker = /*require.resolve*/(/*! ./ModelWorker.js */ \"./src/model/ModelWorker.js\");\r\n\r\n\r\nString.prototype.replaceAll = function (search, replacement) {\r\n let target = this;\r\n return target.replace(new RegExp(search, 'g'), replacement);\r\n};\r\n\r\nconst colors = [\r\n 0xFF0000,\r\n 0x00FFFF,\r\n 0x0000FF,\r\n 0x000080,\r\n 0xFF00FF,\r\n 0x800080,\r\n 0x808000,\r\n 0x00FF00,\r\n 0x008000,\r\n 0xFFFF00,\r\n 0x800000,\r\n 0x008080,\r\n];\r\n\r\nconst FACE_ORDER = [\"east\", \"west\", \"up\", \"down\", \"south\", \"north\"];\r\nconst TINTS = [\"lightgreen\"];\r\n\r\nconst mergedModelCache = {};\r\nconst loadedTextureCache = {};\r\nconst modelInstances = {};\r\n\r\nconst textureCache = {};\r\nconst canvasCache = {};\r\nconst materialCache = {};\r\nconst geometryCache = {};\r\nconst instanceCache = {};\r\n\r\nconst animatedTextures = [];\r\n\r\n/**\r\n * @see defaultOptions\r\n * @property {string} type alternative way to specify the model type (block/item)\r\n * @property {boolean} [centerCubes=false] center the cube's rotation point\r\n * @property {string} [assetRoot=DEFAULT_ROOT] root to get asset files from\r\n */\r\nlet defOptions = {\r\n camera: {\r\n type: \"perspective\",\r\n x: 35,\r\n y: 25,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n type: \"block\",\r\n centerCubes: false,\r\n assetRoot: _functions__WEBPACK_IMPORTED_MODULE_4__[\"DEFAULT_ROOT\"],\r\n useWebWorkers: false\r\n};\r\n\r\n/**\r\n * A renderer for Minecraft models, i.e. blocks & items\r\n */\r\nclass ModelRender extends _renderBase__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\r\n\r\n /**\r\n * @param {Object} [options] The options for this renderer, see {@link defaultOptions}\r\n * @param {string} [options.assetRoot=DEFAULT_ROOT] root to get asset files from\r\n *\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, element) {\r\n super(options, defOptions, element);\r\n\r\n this.renderType = \"ModelRender\";\r\n\r\n this.models = [];\r\n this.instancePositionMap = {};\r\n this.attached = false;\r\n }\r\n\r\n /**\r\n * Does the actual rendering\r\n * @param {(string[]|Object[])} models Array of models to render - Either strings in the format / or objects\r\n * @param {string} [models[].type=block] either 'block' or 'item'\r\n * @param {string} models[].model if 'type' is given, just the block/item name otherwise '/'\r\n * @param {number[]} [models[].offset] [x,y,z] array of the offset\r\n * @param {number[]} [models[].rotation] [x,y,z] array of the rotation\r\n * @param {string} [models[].blockstate] name of a blockstate to be used to determine the models (only for blocks)\r\n * @param {string} [models[].variant=normal] if 'blockstate' is given, the block variant to use\r\n * @param {function} [cb] Callback when rendering finished\r\n */\r\n render(models, cb) {\r\n let modelRender = this;\r\n\r\n if (!modelRender.attached && !modelRender._scene) {// Don't init scene if attached, since we already have an available scene\r\n super.initScene(function () {\r\n // Animate textures\r\n for (let i = 0; i < animatedTextures.length; i++) {\r\n animatedTextures[i]();\r\n }\r\n\r\n modelRender.element.dispatchEvent(new CustomEvent(\"modelRender\", {detail: {models: modelRender.models}}));\r\n });\r\n } else {\r\n console.log(\"[ModelRender] is attached - skipping scene init\");\r\n }\r\n\r\n let parsedModelList = [];\r\n\r\n parseModels(modelRender, models, parsedModelList)\r\n .then(() => loadAndMergeModels(modelRender, parsedModelList))\r\n .then(() => loadModelTextures(modelRender, parsedModelList))\r\n .then(() => doModelRender(modelRender, parsedModelList))\r\n .then((renderedModels) => {\r\n console.timeEnd(\"doModelRender\");\r\n debug(renderedModels)\r\n if (typeof cb === \"function\") cb();\r\n })\r\n\r\n }\r\n\r\n}\r\n\r\n\r\nfunction parseModels(modelRender, models, parsedModelList) {\r\n console.time(\"parseModels\");\r\n console.log(\"Parsing Models...\");\r\n let parsePromises = [];\r\n for (let i = 0; i < models.length; i++) {\r\n let model = models[i];\r\n\r\n // parsePromises.push(parseModel(model, model, parsedModelList, modelRender.options.assetRoot))\r\n parsePromises.push(new Promise(resolve => {\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n parsedModelList.push(...event.data.parsedModelList);\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"parseModel\",\r\n model: model,\r\n modelOptions: model,\r\n parsedModelList: parsedModelList,\r\n assetRoot: modelRender.options.assetRoot\r\n })\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"parseModel\"])(model, model, parsedModelList, modelRender.options.assetRoot).then(() => {\r\n resolve();\r\n })\r\n }\r\n }))\r\n\r\n }\r\n\r\n return Promise.all(parsePromises);\r\n}\r\n\r\n\r\nfunction loadAndMergeModels(modelRender, parsedModelList) {\r\n console.timeEnd(\"parseModels\");\r\n console.time(\"loadAndMergeModels\");\r\n\r\n let jsonPromises = [];\r\n\r\n console.log(\"Loading Model JSON data & merging...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i]);\r\n modelInstances[cacheKey] = (modelInstances[cacheKey] || 0) + 1;\r\n uniqueModels[cacheKey] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n jsonPromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n debug(\"loadAndMerge \" + cacheKey);\r\n\r\n\r\n if (mergedModelCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n mergedModelCache[cacheKey] = event.data.mergedModel;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadAndMergeModel\",\r\n model: model,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadAndMergeModel\"])(model, modelRender.options.assetRoot).then((mergedModel) => {\r\n mergedModelCache[cacheKey] = mergedModel;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n return Promise.all(jsonPromises);\r\n}\r\n\r\nfunction loadModelTextures(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadAndMergeModels\");\r\n console.time(\"loadModelTextures\");\r\n\r\n let texturePromises = [];\r\n\r\n console.log(\"Loading Textures...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n uniqueModels[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i])] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n texturePromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n debug(\"loadTexture \" + cacheKey);\r\n let mergedModel = mergedModelCache[cacheKey];\r\n\r\n if (loadedTextureCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel) {\r\n console.warn(\"Missing merged model\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel.textures) {\r\n console.warn(\"The model doesn't have any textures!\");\r\n console.warn(\"Please make sure you're using the proper file.\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n loadedTextureCache[cacheKey] = event.data.textures;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadTextures\",\r\n textures: mergedModel.textures,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadTextures\"])(mergedModel.textures, modelRender.options.assetRoot).then((textures) => {\r\n loadedTextureCache[cacheKey] = textures;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n\r\n return Promise.all(texturePromises);\r\n}\r\n\r\nfunction doModelRender(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadModelTextures\");\r\n console.time(\"doModelRender\");\r\n\r\n console.log(\"Rendering Models...\");\r\n\r\n let renderPromises = [];\r\n\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n renderPromises.push(new Promise(resolve => {\r\n let model = parsedModelList[i];\r\n\r\n let mergedModel = mergedModelCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n let textures = loadedTextureCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n\r\n let offset = model.offset || [0, 0, 0];\r\n let rotation = model.rotation || [0, 0, 0];\r\n let scale = model.scale || [1, 1, 1];\r\n\r\n if (model.options.hasOwnProperty(\"display\")) {\r\n if (mergedModel.hasOwnProperty(\"display\")) {\r\n if (mergedModel.display.hasOwnProperty(model.options.display)) {\r\n let displayData = mergedModel.display[model.options.display];\r\n\r\n if (displayData.hasOwnProperty(\"translation\")) {\r\n offset = [offset[0] + displayData.translation[0], offset[1] + displayData.translation[1], offset[2] + displayData.translation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"rotation\")) {\r\n rotation = [rotation[0] + displayData.rotation[0], rotation[1] + displayData.rotation[1], rotation[2] + displayData.rotation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"scale\")) {\r\n scale = [displayData.scale[0], displayData.scale[1], displayData.scale[2]];\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n\r\n renderModel(modelRender, mergedModel, textures, mergedModel.textures, model.type, model.name, model.variant, offset, rotation, scale).then((renderedModel) => {\r\n\r\n if (renderedModel.firstInstance) {\r\n let container = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\r\n container.add(renderedModel.mesh);\r\n\r\n modelRender.models.push(container);\r\n modelRender.addToScene(container);\r\n }\r\n\r\n resolve(renderedModel);\r\n })\r\n }))\r\n }\r\n\r\n return Promise.all(renderPromises);\r\n}\r\n\r\n\r\nlet renderModel = function (modelRender, model, textures, textureNames, type, name, variant, offset, rotation, scale) {\r\n return new Promise((resolve) => {\r\n if (model.hasOwnProperty(\"elements\")) {// block OR item with block parent\r\n let modelKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant});\r\n let instanceCount = modelInstances[modelKey];\r\n\r\n let applyModelTransforms = function (mesh, instanceIndex) {\r\n mesh.userData.modelType = type;\r\n mesh.userData.modelName = name;\r\n\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n let instanceInfo = {\r\n key: modelKey,\r\n index: instanceIndex,\r\n offset: offset,\r\n scale: scale,\r\n rotation: rotation\r\n };\r\n\r\n if (rotation) {\r\n mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new three__WEBPACK_IMPORTED_MODULE_0__[\"Euler\"](Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]))));\r\n }\r\n if (offset) {\r\n mesh.setPositionAt(instanceIndex, _v3o.set(offset[0], offset[1], offset[2]));\r\n modelRender.instancePositionMap[offset[0] + \"_\" + offset[1] + \"_\" + offset[2]] = instanceInfo;\r\n }\r\n if (scale) {\r\n mesh.setScaleAt(instanceIndex, _v3s.set(scale[0], scale[1], scale[2]));\r\n }\r\n\r\n mesh.needsUpdate();\r\n\r\n // mesh.position = _v3o;\r\n // Object.defineProperty(mesh.position,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(x, this.y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, this.y, z));\r\n // }\r\n // })\r\n //\r\n // mesh.rotation = new THREE.Euler(toRadians(rotation[0]), toRadians(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), toRadians(rotation[2]));\r\n // Object.defineProperty(mesh.rotation,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(x), toRadians(this.y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(this.y), toRadians(z))));\r\n // }\r\n // });\r\n //\r\n // mesh.scale = _v3s;\r\n\r\n resolve({\r\n mesh: mesh,\r\n firstInstance: instanceIndex === 0\r\n });\r\n };\r\n\r\n let finalizeCubeModel = function (geometry, materials) {\r\n geometry.translate(-8, -8, -8);\r\n\r\n\r\n let cachedInstance;\r\n\r\n if (!instanceCache.hasOwnProperty(modelKey)) {\r\n debug(\"Caching new model instance \" + modelKey + \" (with \" + instanceCount + \" instances)\");\r\n let newInstance = new three__WEBPACK_IMPORTED_MODULE_0__[\"InstancedMesh\"](\r\n geometry,\r\n materials,\r\n instanceCount,\r\n false,\r\n false,\r\n false);\r\n cachedInstance = {\r\n instance: newInstance,\r\n index: 0\r\n };\r\n instanceCache[modelKey] = cachedInstance;\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](1, 1, 1);\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n for (let i = 0; i < instanceCount; i++) {\r\n\r\n newInstance.setQuaternionAt(i, _q);\r\n newInstance.setPositionAt(i, _v3o);\r\n newInstance.setScaleAt(i, _v3s);\r\n\r\n }\r\n } else {\r\n debug(\"Using cached instance (\" + modelKey + \")\");\r\n cachedInstance = instanceCache[modelKey];\r\n\r\n }\r\n\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n };\r\n\r\n if (instanceCache.hasOwnProperty(modelKey)) {\r\n debug(\"Using cached model instance (\" + modelKey + \")\");\r\n let cachedInstance = instanceCache[modelKey];\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n return;\r\n }\r\n\r\n // Render the elements\r\n let promises = [];\r\n for (let i = 0; i < model.elements.length; i++) {\r\n let element = model.elements[i];\r\n\r\n // // From net.minecraft.client.renderer.block.model.BlockPart.java#47 - https://yeleha.co/2JcqSr4\r\n let fallbackFaces = {\r\n down: {\r\n uv: [element.from[0], 16 - element.to[2], element.to[0], 16 - element.from[2]],\r\n texture: \"#down\"\r\n },\r\n up: {\r\n uv: [element.from[0], element.from[2], element.to[0], element.to[2]],\r\n texture: \"#up\"\r\n },\r\n north: {\r\n uv: [16 - element.to[0], 16 - element.to[1], 16 - element.from[0], 16 - element.from[1]],\r\n texture: \"#north\"\r\n },\r\n south: {\r\n uv: [element.from[0], 16 - element.to[1], element.to[0], 16 - element.from[1]],\r\n texture: \"#south\"\r\n },\r\n west: {\r\n uv: [element.from[2], 16 - element.to[1], element.to[2], 16 - element.from[2]],\r\n texture: \"#west\"\r\n },\r\n east: {\r\n uv: [16 - element.to[2], 16 - element.to[1], 16 - element.from[2], 16 - element.from[1]],\r\n texture: \"#east\"\r\n }\r\n };\r\n\r\n promises.push(new Promise((resolve) => {\r\n let baseName = name.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" + (element.__comment ? element.__comment.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" : \"\");\r\n createCube(element.to[0] - element.from[0], element.to[1] - element.from[1], element.to[2] - element.from[2],\r\n baseName + Date.now(),\r\n element.faces, fallbackFaces, textures, textureNames, modelRender.options.assetRoot, baseName)\r\n .then((cube) => {\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation((element.to[0] - element.from[0]) / 2, (element.to[1] - element.from[1]) / 2, (element.to[2] - element.from[2]) / 2));\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(element.from[0], element.from[1], element.from[2]));\r\n\r\n if (element.rotation) {\r\n rotateAboutPoint(cube,\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.origin[0], element.rotation.origin[1], element.rotation.origin[2]),\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.axis === \"x\" ? 1 : 0, element.rotation.axis === \"y\" ? 1 : 0, element.rotation.axis === \"z\" ? 1 : 0),\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(element.rotation.angle));\r\n }\r\n\r\n resolve(cube);\r\n })\r\n }));\r\n\r\n\r\n }\r\n\r\n Promise.all(promises).then((cubes) => {\r\n let mergedCubes = Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"mergeCubeMeshes\"])(cubes, true);\r\n mergedCubes.sourceSize = cubes.length;\r\n finalizeCubeModel(mergedCubes.geometry, mergedCubes.materials, cubes.length);\r\n for (let i = 0; i < cubes.length; i++) {\r\n Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"deepDisposeMesh\"])(cubes[i], true);\r\n }\r\n })\r\n } else {// 2d item\r\n createPlane(name + \"_\" + Date.now(), textures).then((plane) => {\r\n if (offset) {\r\n plane.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(offset[0], offset[1], offset[2]))\r\n }\r\n if (rotation) {\r\n plane.rotation.set(Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]));\r\n }\r\n if (scale) {\r\n plane.scale.set(scale[0], scale[1], scale[2]);\r\n }\r\n\r\n resolve({\r\n mesh: plane,\r\n firstInstance: true\r\n });\r\n })\r\n }\r\n })\r\n};\r\n\r\nfunction setVisibilityOfInstance(meshKey, visibleScale, instanceIndex, visible) {\r\n let instance = instanceCache[meshKey];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n let newScale;\r\n if (visible) {\r\n if (visibleScale) {\r\n newScale = visibleScale;\r\n } else {\r\n newScale = [1, 1, 1];\r\n }\r\n } else {\r\n newScale = [0, 0, 0];\r\n }\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n mesh.setScaleAt(instanceIndex, _v3s.set(newScale[0], newScale[1], newScale[2]));\r\n return mesh;\r\n }\r\n}\r\n\r\nfunction setVisibilityAtMulti(positions, visible) {\r\n let updatedMeshes = {};\r\n for (let pos of positions) {\r\n let info = this.instancePositionMap[pos[0] + \"_\" + pos[1] + \"_\" + pos[2]];\r\n if (info) {\r\n let mesh = setVisibilityOfInstance(info.key, info.scale, info.index, visible);\r\n if (mesh) {\r\n updatedMeshes[info.key] = mesh;\r\n }\r\n }\r\n }\r\n for (let mesh of Object.values(updatedMeshes)) {\r\n mesh.needsUpdate();\r\n }\r\n}\r\n\r\nfunction setVisibilityAt(x, y, z, visible) {\r\n setVisibilityAtMulti([[x, y, z]], visible);\r\n}\r\n\r\nModelRender.prototype.setVisibilityAtMulti = setVisibilityAtMulti;\r\nModelRender.prototype.setVisibilityAt = setVisibilityAt;\r\n\r\nfunction setVisibilityOfType(type, name, variant, visible) {\r\n let instance = instanceCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant})];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n mesh.visible = visible;\r\n }\r\n}\r\n\r\nModelRender.prototype.setVisibilityOfType = setVisibilityOfType;\r\n\r\nlet createDot = function (c) {\r\n let dotGeometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"Geometry\"]();\r\n dotGeometry.vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]());\r\n let dotMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"PointsMaterial\"]({size: 5, sizeAttenuation: false, color: c});\r\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Points\"](dotGeometry, dotMaterial);\r\n};\r\n\r\nlet createPlane = function (name, textures) {\r\n return new Promise((resolve) => {\r\n\r\n let materialLoaded = function (material, width, height) {\r\n let geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"PlaneGeometry\"](width, height);\r\n let plane = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, material);\r\n plane.name = name;\r\n plane.receiveShadow = true;\r\n\r\n resolve(plane);\r\n };\r\n\r\n if (textures) {\r\n let w = 0, h = 0;\r\n let promises = [];\r\n for (let t in textures) {\r\n if (textures.hasOwnProperty(t)) {\r\n promises.push(new Promise((resolve) => {\r\n let img = new Image();\r\n img.onload = function () {\r\n if (img.width > w) w = img.width;\r\n if (img.height > h) h = img.height;\r\n resolve(img);\r\n };\r\n img.src = textures[t];\r\n }))\r\n }\r\n }\r\n Promise.all(promises).then((images) => {\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = w;\r\n canvas.height = h;\r\n let context = canvas.getContext(\"2d\");\r\n\r\n for (let i = 0; i < images.length; i++) {\r\n let img = images[i];\r\n context.drawImage(img, 0, 0);\r\n }\r\n\r\n let data = canvas.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \")\");\r\n materialLoaded(materialCache[hash], w, h);\r\n return;\r\n }\r\n\r\n let textureLoaded = function (texture) {\r\n let material = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: texture,\r\n transparent: true,\r\n side: three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"],\r\n alphaTest: 0.5,\r\n name: name\r\n });\r\n\r\n // Add material to cache\r\n debug(\"Caching Material \" + hash);\r\n materialCache[hash] = material;\r\n\r\n materialLoaded(material, w, h);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n });\r\n }\r\n\r\n })\r\n};\r\n\r\n\r\n/// From https://github.com/InventivetalentDev/SkinRender/blob/master/js/render/skin.js#L353\r\nlet createCube = function (width, height, depth, name, faces, fallbackFaces, textures, textureNames, assetRoot, baseName) {\r\n return new Promise((resolve) => {\r\n let geometryKey = width + \"_\" + height + \"_\" + depth;\r\n let geometry;\r\n if (geometryCache.hasOwnProperty(geometryKey)) {\r\n debug(\"Using cached Geometry (\" + geometryKey + \")\");\r\n geometry = geometryCache[geometryKey];\r\n } else {\r\n geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BoxGeometry\"](width, height, depth);\r\n debug(\"Caching Geometry \" + geometryKey);\r\n geometryCache[geometryKey] = geometry;\r\n }\r\n\r\n let materialsLoaded = function (materials) {\r\n let cube = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, materials);\r\n cube.name = name;\r\n cube.receiveShadow = true;\r\n\r\n resolve(cube);\r\n };\r\n if (textures) {\r\n let promises = [];\r\n for (let i = 0; i < 6; i++) {\r\n promises.push(new Promise((resolve) => {\r\n let f = FACE_ORDER[i];\r\n if (!faces.hasOwnProperty(f)) {\r\n // console.warn(\"Missing face: \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n let face = faces[f];\r\n let textureRef = face.texture.substr(1);\r\n if (!textures.hasOwnProperty(textureRef) || !textures[textureRef]) {\r\n console.warn(\"Missing texture '\" + textureRef + \"' for face \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let canvasKey = textureRef + \"_\" + f + \"_\" + baseName;\r\n\r\n let processImgToCanvasData = (img) => {\r\n let uv = face.uv;\r\n if (!uv) {\r\n // console.warn(\"Missing UV mapping for face \" + f + \" in model \" + name + \". Using defaults\");\r\n uv = fallbackFaces[f].uv;\r\n }\r\n\r\n // Scale the uv values to match the image width, so we can support resource packs with higher-resolution textures\r\n uv = [\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[0], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[1], img.height),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[2], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[3], img.height)\r\n ];\r\n\r\n\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = Math.abs(uv[2] - uv[0]);\r\n canvas.height = Math.abs(uv[3] - uv[1]);\r\n\r\n let context = canvas.getContext(\"2d\");\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n let tintColor;\r\n if (face.hasOwnProperty(\"tintindex\")) {\r\n tintColor = TINTS[face.tintindex];\r\n } else if (baseName.startsWith(\"water_\")) {\r\n tintColor = \"blue\";\r\n }\r\n\r\n if (tintColor) {\r\n context.fillStyle = tintColor;\r\n context.globalCompositeOperation = 'multiply';\r\n context.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n context.globalAlpha = 1;\r\n context.globalCompositeOperation = 'destination-in';\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n // context.globalAlpha = 0.5;\r\n // context.beginPath();\r\n // context.fillStyle = \"green\";\r\n // context.rect(0, 0, uv[2] - uv[0], uv[3] - uv[1]);\r\n // context.fill();\r\n // context.globalAlpha = 1.0;\r\n }\r\n\r\n let canvasData = context.getImageData(0, 0, canvas.width, canvas.height).data;\r\n let hasTransparency = false;\r\n for (let i = 3; i < (canvas.width * canvas.height); i += 4) {\r\n if (canvasData[i] < 255) {\r\n hasTransparency = true;\r\n break;\r\n }\r\n }\r\n\r\n let dataUrl = canvas.toDataURL(\"image/png\");\r\n let dataHash = md5__WEBPACK_IMPORTED_MODULE_6__(dataUrl);\r\n\r\n let d = {\r\n canvas: canvas,\r\n data: canvasData,\r\n dataUrl: dataUrl,\r\n dataUrlHash: dataHash,\r\n hasTransparency: hasTransparency,\r\n width: canvas.width,\r\n height: canvas.height\r\n };\r\n debug(\"Caching new canvas (\" + canvasKey + \"/\" + dataHash + \")\")\r\n canvasCache[canvasKey] = d;\r\n return d;\r\n };\r\n\r\n let loadTextureFromCanvas = (canvas) => {\r\n\r\n\r\n let loadTextureDefault = function (canvas) {\r\n let data = canvas.dataUrl;\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \", without meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n let n = textureNames[textureRef];\r\n if (n.startsWith(\"#\")) {\r\n n = textureNames[name.substr(1)];\r\n }\r\n debug(\"Pre-Caching Material \" + hash + \", without meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5,\r\n name: f + \"_\" + textureRef + \"_\" + n\r\n });\r\n\r\n let textureLoaded = function (texture) {\r\n // Add material to cache\r\n debug(\"Finalizing Cached Material \" + hash + \", without meta\");\r\n materialCache[hash].map = texture;\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture from cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n if (face.hasOwnProperty(\"rotation\")) {\r\n texture.center.x = .5;\r\n texture.center.y = .5;\r\n texture.rotation = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(face.rotation);\r\n }\r\n\r\n debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n };\r\n\r\n let loadTextureWithMeta = function (canvas, meta) {\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \", with meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Material \" + hash + \", with meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5\r\n });\r\n\r\n let frametime = 1;\r\n if (meta.hasOwnProperty(\"animation\")) {\r\n if (meta.animation.hasOwnProperty(\"frametime\")) {\r\n frametime = meta.animation.frametime;\r\n }\r\n }\r\n\r\n let parts = Math.floor(canvas.height / canvas.width);\r\n\r\n console.log(\"Generating animated texture...\");\r\n\r\n let promises1 = [];\r\n for (let i = 0; i < parts; i++) {\r\n promises1.push(new Promise((resolve) => {\r\n let canvas1 = document.createElement(\"canvas\");\r\n canvas1.width = canvas.width;\r\n canvas1.height = canvas.width;\r\n let context1 = canvas1.getContext(\"2d\");\r\n context1.drawImage(canvas.canvas, 0, i * canvas.width, canvas.width, canvas.width, 0, 0, canvas.width, canvas.width);\r\n\r\n let data = canvas1.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n resolve(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n debug(\"Caching Texture \" + hash + \", without meta\");\r\n // add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n resolve(texture);\r\n });\r\n }));\r\n }\r\n\r\n Promise.all(promises1).then((textures) => {\r\n\r\n let frameCounter = 0;\r\n let textureIndex = 0;\r\n animatedTextures.push(() => {// called on render\r\n if (frameCounter >= frametime) {\r\n frameCounter = 0;\r\n\r\n // Set new texture\r\n materialCache[hash].map = textures[textureIndex];\r\n\r\n textureIndex++;\r\n }\r\n if (textureIndex >= textures.length) {\r\n textureIndex = 0;\r\n }\r\n frameCounter += 0.1;// game ticks TODO: figure out the proper value for this\r\n })\r\n\r\n // Add material to cache\r\n debug(\"Finalizing Cached Material \" + hash + \", with meta\");\r\n materialCache[hash].map = textures[0];\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n });\r\n };\r\n\r\n if ((canvas.height > canvas.width) && (canvas.height % canvas.width === 0)) {// Taking a guess that this is an animated texture\r\n let name = textureNames[textureRef];\r\n if (name.startsWith(\"#\")) {\r\n name = textureNames[name.substr(1)];\r\n }\r\n if (name.indexOf(\"/\") !== -1) {\r\n name = name.substr(name.indexOf(\"/\") + 1);\r\n }\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"loadTextureMeta\"])(name, assetRoot).then((meta) => {\r\n loadTextureWithMeta(canvas, meta);\r\n }).catch(() => {// Guessed wrong :shrug:\r\n loadTextureDefault(canvas);\r\n })\r\n } else {\r\n loadTextureDefault(canvas);\r\n }\r\n };\r\n\r\n\r\n if (canvasCache.hasOwnProperty(canvasKey)) {\r\n let cachedCanvas = canvasCache[canvasKey];\r\n\r\n if (cachedCanvas.hasOwnProperty(\"img\")) {\r\n debug(\"Waiting for canvas image that's already loading (\" + canvasKey + \")\")\r\n let img = cachedCanvas.img;\r\n img.waitingForCanvas.push(function (canvas) {\r\n loadTextureFromCanvas(canvas);\r\n });\r\n } else {\r\n debug(\"Using cached canvas (\" + canvasKey + \")\")\r\n loadTextureFromCanvas(canvasCache[canvasKey]);\r\n }\r\n } else {\r\n let img = new Image();\r\n img.onerror = function (err) {\r\n console.warn(err);\r\n resolve(null);\r\n };\r\n img.waitingForCanvas = [];\r\n img.onload = function () {\r\n let canvasData = processImgToCanvasData(img);\r\n loadTextureFromCanvas(canvasData);\r\n\r\n for (let c = 0; c < img.waitingForCanvas.length; c++) {\r\n img.waitingForCanvas[c](canvasData);\r\n }\r\n };\r\n debug(\"Pre-caching canvas (\" + canvasKey + \")\");\r\n canvasCache[canvasKey] = {\r\n img: img\r\n };\r\n img.src = textures[textureRef];\r\n }\r\n }));\r\n }\r\n Promise.all(promises).then(materials => materialsLoaded(materials))\r\n } else {\r\n let materials = [];\r\n for (let i = 0; i < 6; i++) {\r\n materials.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n color: colors[i + 2],\r\n wireframe: true\r\n }))\r\n }\r\n materialsLoaded(materials);\r\n }\r\n\r\n // if (textures) {\r\n // applyCubeTextureToGeometry(geometry, texture, uv, width, height, depth);\r\n // }\r\n\r\n\r\n })\r\n};\r\n\r\n/// https://stackoverflow.com/questions/42812861/three-js-pivot-point/42866733#42866733\r\n// obj - your object (THREE.Object3D or derived)\r\n// point - the point of rotation (THREE.Vector3)\r\n// axis - the axis of rotation (normalized THREE.Vector3)\r\n// theta - radian value of rotation\r\nfunction rotateAboutPoint(obj, point, axis, theta) {\r\n obj.position.sub(point); // remove the offset\r\n obj.position.applyAxisAngle(axis, theta); // rotate the POSITION\r\n obj.position.add(point); // re-add the offset\r\n\r\n obj.rotateOnAxis(axis, theta); // rotate the OBJECT\r\n}\r\n\r\nModelRender.cache = {\r\n loadedTextures: loadedTextureCache,\r\n mergedModels: mergedModelCache,\r\n instanceCount: modelInstances,\r\n\r\n texture: textureCache,\r\n canvas: canvasCache,\r\n material: materialCache,\r\n geometry: geometryCache,\r\n instances: instanceCache,\r\n\r\n animated: animatedTextures,\r\n\r\n\r\n resetInstances: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n },\r\n clearAll: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(loadedTextureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(mergedModelCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(textureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(canvasCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(materialCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(geometryCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n animatedTextures.splice(0, animatedTextures.length);\r\n }\r\n};\r\nModelRender.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n\r\nif (typeof window !== \"undefined\") {\r\n window.ModelRender = ModelRender;\r\n window.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n}\r\nif (typeof global !== \"undefined\")\r\n global.ModelRender = ModelRender;\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (ModelRender);\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./src/model/index.js?"); /***/ }), @@ -2145,7 +2178,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var pako /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModel\", function() { return parseModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadAndMergeModel\", function() { return loadAndMergeModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modelCacheKey\", function() { return modelCacheKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findMatchingVariant\", function() { return findMatchingVariant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"variantStringToObject\", function() { return variantStringToObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModelType\", function() { return parseModelType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadModel\", function() { return loadModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextures\", function() { return loadTextures; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeParents\", function() { return mergeParents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadians\", function() { return toRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deleteObjectProperties\", function() { return deleteObjectProperties; });\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\n\r\nfunction parseModel(model, modelOptions, parsedModelList, assetRoot) {\r\n return new Promise(resolve => {\r\n let type = \"block\";\r\n let offset;\r\n let rotation;\r\n let scale;\r\n\r\n if (typeof model === \"string\") {\r\n let parsed = parseModelType(model);\r\n model = parsed.model;\r\n type = parsed.type;\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (typeof model === \"object\") {\r\n if (model.hasOwnProperty(\"offset\")) {\r\n offset = model[\"offset\"];\r\n }\r\n if (model.hasOwnProperty(\"rotation\")) {\r\n rotation = model[\"rotation\"];\r\n }\r\n if (model.hasOwnProperty(\"scale\")) {\r\n scale = model[\"scale\"];\r\n }\r\n\r\n if (model.hasOwnProperty(\"model\")) {\r\n if (model.hasOwnProperty(\"type\")) {\r\n type = model[\"type\"];\r\n model = model[\"model\"];\r\n } else {\r\n let parsed = parseModelType(model[\"model\"]);\r\n model = parsed.model;\r\n type = parsed.type;\r\n }\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (model.hasOwnProperty(\"blockstate\")) {\r\n type = \"block\";\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadBlockState\"])(model.blockstate, assetRoot).then((blockstate) => {\r\n if (blockstate.hasOwnProperty(\"variants\")) {\r\n\r\n if (model.hasOwnProperty(\"variant\")) {\r\n let variantKey = findMatchingVariant(blockstate.variants, model.variant);\r\n if (variantKey === null) {\r\n console.warn(\"Missing variant key for \" + model.blockstate + \": \" + model.variant);\r\n console.warn(blockstate.variants);\r\n resolve(null);\r\n return;\r\n }\r\n let variant = blockstate.variants[variantKey];\r\n if (!variant) {\r\n console.warn(\"Missing variant for \" + model.blockstate + \": \" + model.variant);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else {\r\n let variant;\r\n if (blockstate.variants.hasOwnProperty(\"normal\")) {\r\n variant = blockstate.variants.normal;\r\n } else if (blockstate.variants.hasOwnProperty(\"\")) {\r\n variant = blockstate.variants[\"\"];\r\n } else {\r\n variant = blockstate.variants[Object.keys(blockstate.variants)[0]]\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n resolve(parsedModelList);\r\n }\r\n } else if (blockstate.hasOwnProperty(\"multipart\")) {\r\n for (let j = 0; j < blockstate.multipart.length; j++) {\r\n let cond = blockstate.multipart[j];\r\n let apply = cond.apply;\r\n let when = cond.when;\r\n\r\n rotation = [0, 0, 0];\r\n\r\n if (!when) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n } else if (model.hasOwnProperty(\"multipart\")) {\r\n let multipartConditions = model.multipart;\r\n\r\n let applies = false;\r\n if (when.hasOwnProperty(\"OR\")) {\r\n for (let k = 0; k < when.OR.length; k++) {\r\n if (applies) break;\r\n for (let c in when.OR[k]) {\r\n if (applies) break;\r\n if (when.OR[k].hasOwnProperty(c)) {\r\n let expected = when.OR[k][c];\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n for (let c in when) {// this SHOULD be a single case, but iterating makes it a bit easier\r\n if (applies) break;\r\n if (when.hasOwnProperty(c)) {\r\n let expected = String(when[c]);\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (applies) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n }\r\n }\r\n }\r\n\r\n resolve(parsedModelList);\r\n }\r\n }).catch(()=>{\r\n resolve(parsedModelList);\r\n })\r\n }\r\n\r\n }\r\n })\r\n}\r\n\r\nfunction loadAndMergeModel(model, assetRoot) {\r\n return loadModel(model.name, model.type, assetRoot)\r\n .then(modelData => mergeParents(modelData, model.name, assetRoot))\r\n .then(merged => {\r\n console.debug(model.name + \" merged:\");\r\n console.debug(merged);\r\n if (!merged.hasOwnProperty(\"elements\")) {\r\n if (model.name === \"lava\" || model.name === \"water\") {\r\n merged.elements = [\r\n {\r\n \"from\": [0, 0, 0],\r\n \"to\": [16, 16, 16],\r\n \"faces\": {\r\n \"down\": {\"texture\": \"#particle\", \"cullface\": \"down\"},\r\n \"up\": {\"texture\": \"#particle\", \"cullface\": \"up\"},\r\n \"north\": {\"texture\": \"#particle\", \"cullface\": \"north\"},\r\n \"south\": {\"texture\": \"#particle\", \"cullface\": \"south\"},\r\n \"west\": {\"texture\": \"#particle\", \"cullface\": \"west\"},\r\n \"east\": {\"texture\": \"#particle\", \"cullface\": \"east\"}\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n return merged;\r\n })\r\n}\r\n\r\n\r\n\r\n// Utils\r\n\r\nfunction modelCacheKey(model) {\r\n return model.type + \"__\" + model.name /*+ \"[\" + (model.variant || \"default\") + \"]\"*/;\r\n}\r\n\r\nfunction findMatchingVariant(variants, selector) {\r\n if (!Array.isArray(variants)) variants = Object.keys(variants);\r\n\r\n if (!selector || selector === \"\" || selector.length === 0) return \"\";\r\n let selectorObj = variantStringToObject(selector);\r\n for (let i = 0; i < variants.length; i++) {\r\n let variantObj = variantStringToObject(variants[i]);\r\n\r\n let matches = true;\r\n for (let k in selectorObj) {\r\n if (selectorObj.hasOwnProperty(k)) {\r\n if (variantObj.hasOwnProperty(k)) {\r\n if (selectorObj[k] !== variantObj[k]) {\r\n matches = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (matches) return variants[i];\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction variantStringToObject(str) {\r\n let split = str.split(\",\");\r\n let obj = {};\r\n for (let i = 0; i < split.length; i++) {\r\n let spl = split[i];\r\n let split1 = spl.split(\"=\");\r\n obj[split1[0]] = split1[1];\r\n }\r\n return obj;\r\n}\r\n\r\nfunction parseModelType(string) {\r\n if (string.startsWith(\"block/\")) {\r\n // if (type === \"item\") {\r\n // throw new Error(\"Tried to mix block/item models\");\r\n // }\r\n return {\r\n type: \"block\",\r\n model: string.substr(\"block/\".length)\r\n }\r\n } else if (string.startsWith(\"item/\")) {\r\n // if (type === \"block\") {\r\n // throw new Error(\"Tried to mix item/block models\");\r\n // }\r\n return {\r\n type: \"item\",\r\n model: string.substr(\"item/\".length)\r\n }\r\n }\r\n return {\r\n type: \"block\",\r\n model: \"string\"\r\n }\r\n}\r\n\r\nfunction loadModel(model, type/* block OR item */, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n if (typeof model === \"string\") {\r\n if (model.startsWith(\"{\") && model.endsWith(\"}\")) {// JSON string\r\n resolve(JSON.parse(model));\r\n } else if (model.startsWith(\"http\")) {// URL\r\n fetch(model, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"model data:\", data);\r\n resolve(data);\r\n })\r\n } else {// model name -> use local data\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + (type || \"block\") + \"/\" + model + \".json\").then((data) => {\r\n resolve(data);\r\n })\r\n }\r\n } else if (typeof model === \"object\") {// JSON object\r\n resolve(model);\r\n } else {\r\n console.warn(\"Invalid model\");\r\n reject();\r\n }\r\n });\r\n};\r\n\r\nfunction loadTextures(textureNames, assetRoot) {\r\n return new Promise((resolve) => {\r\n let promises = [];\r\n let filteredNames = [];\r\n\r\n let names = Object.keys(textureNames);\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n let texture = textureNames[name];\r\n if (texture.startsWith(\"#\")) {// reference to another texture, no need to load\r\n continue;\r\n }\r\n filteredNames.push(name);\r\n promises.push(Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextureAsBase64\"])(assetRoot, \"minecraft\", \"/\", texture));\r\n }\r\n Promise.all(promises).then((textures) => {\r\n let mappedTextures = {};\r\n for (let i = 0; i < textures.length; i++) {\r\n mappedTextures[filteredNames[i]] = textures[i];\r\n }\r\n\r\n // Fill in the referenced textures\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n if (!mappedTextures.hasOwnProperty(name) && textureNames.hasOwnProperty(name)) {\r\n let ref = textureNames[name].substr(1);\r\n mappedTextures[name] = mappedTextures[ref];\r\n }\r\n }\r\n\r\n resolve(mappedTextures);\r\n });\r\n })\r\n};\r\n\r\n\r\nfunction mergeParents(model, modelName, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n mergeParents_(model, modelName, [], [], assetRoot, resolve, reject);\r\n });\r\n};\r\nlet mergeParents_ = function (model, name, stack, hierarchy, assetRoot, resolve, reject) {\r\n stack.push(model);\r\n\r\n if (!model.hasOwnProperty(\"parent\") || model[\"parent\"] === \"builtin/generated\" || model[\"parent\"] === \"builtin/entity\") {// already at the highest parent OR we reach the builtin parent which seems to be the hardcoded stuff that's not in the json files\r\n let merged = {};\r\n for (let i = stack.length - 1; i >= 0; i--) {\r\n merged = deepmerge__WEBPACK_IMPORTED_MODULE_1___default()(merged, stack[i]);\r\n }\r\n\r\n hierarchy.unshift(name);\r\n merged.hierarchy = hierarchy;\r\n resolve(merged);\r\n return;\r\n }\r\n\r\n let parent = model[\"parent\"];\r\n delete model[\"parent\"];// remove the child's parent so it will be replaced by the parent's parent\r\n hierarchy.push(parent);\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + parent + \".json\").then((parentData) => {\r\n let mergedModel = Object.assign({}, model, parentData);\r\n mergeParents_(mergedModel, name, stack, hierarchy, assetRoot, resolve, reject);\r\n }).catch(reject);\r\n\r\n};\r\n\r\nfunction toRadians(angle) {\r\n return angle * (Math.PI / 180);\r\n}\r\n\r\nfunction deleteObjectProperties(obj) {\r\n Object.keys(obj).forEach(function (key) {\r\n delete obj[key];\r\n });\r\n}\r\n\n\n//# sourceURL=webpack:///./src/model/modelFunctions.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModel\", function() { return parseModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadAndMergeModel\", function() { return loadAndMergeModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modelCacheKey\", function() { return modelCacheKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findMatchingVariant\", function() { return findMatchingVariant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"variantStringToObject\", function() { return variantStringToObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModelType\", function() { return parseModelType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadModel\", function() { return loadModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextures\", function() { return loadTextures; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeParents\", function() { return mergeParents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadians\", function() { return toRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deleteObjectProperties\", function() { return deleteObjectProperties; });\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_2__);\n\r\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_2__(\"minerender\");\r\n\r\nfunction parseModel(model, modelOptions, parsedModelList, assetRoot) {\r\n return new Promise(resolve => {\r\n let type = \"block\";\r\n let offset;\r\n let rotation;\r\n let scale;\r\n\r\n if (typeof model === \"string\") {\r\n let parsed = parseModelType(model);\r\n model = parsed.model;\r\n type = parsed.type;\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (typeof model === \"object\") {\r\n if (model.hasOwnProperty(\"offset\")) {\r\n offset = model[\"offset\"];\r\n }\r\n if (model.hasOwnProperty(\"rotation\")) {\r\n rotation = model[\"rotation\"];\r\n }\r\n if (model.hasOwnProperty(\"scale\")) {\r\n scale = model[\"scale\"];\r\n }\r\n\r\n if (model.hasOwnProperty(\"model\")) {\r\n if (model.hasOwnProperty(\"type\")) {\r\n type = model[\"type\"];\r\n model = model[\"model\"];\r\n } else {\r\n let parsed = parseModelType(model[\"model\"]);\r\n model = parsed.model;\r\n type = parsed.type;\r\n }\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (model.hasOwnProperty(\"blockstate\")) {\r\n type = \"block\";\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadBlockState\"])(model.blockstate, assetRoot).then((blockstate) => {\r\n if (blockstate.hasOwnProperty(\"variants\")) {\r\n\r\n if (model.hasOwnProperty(\"variant\")) {\r\n let variantKey = findMatchingVariant(blockstate.variants, model.variant);\r\n if (variantKey === null) {\r\n console.warn(\"Missing variant key for \" + model.blockstate + \": \" + model.variant);\r\n console.warn(blockstate.variants);\r\n resolve(null);\r\n return;\r\n }\r\n let variant = blockstate.variants[variantKey];\r\n if (!variant) {\r\n console.warn(\"Missing variant for \" + model.blockstate + \": \" + model.variant);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else {\r\n let variant;\r\n if (blockstate.variants.hasOwnProperty(\"normal\")) {\r\n variant = blockstate.variants.normal;\r\n } else if (blockstate.variants.hasOwnProperty(\"\")) {\r\n variant = blockstate.variants[\"\"];\r\n } else {\r\n variant = blockstate.variants[Object.keys(blockstate.variants)[0]]\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n resolve(parsedModelList);\r\n }\r\n } else if (blockstate.hasOwnProperty(\"multipart\")) {\r\n for (let j = 0; j < blockstate.multipart.length; j++) {\r\n let cond = blockstate.multipart[j];\r\n let apply = cond.apply;\r\n let when = cond.when;\r\n\r\n rotation = [0, 0, 0];\r\n\r\n if (!when) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n } else if (model.hasOwnProperty(\"multipart\")) {\r\n let multipartConditions = model.multipart;\r\n\r\n let applies = false;\r\n if (when.hasOwnProperty(\"OR\")) {\r\n for (let k = 0; k < when.OR.length; k++) {\r\n if (applies) break;\r\n for (let c in when.OR[k]) {\r\n if (applies) break;\r\n if (when.OR[k].hasOwnProperty(c)) {\r\n let expected = when.OR[k][c];\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n for (let c in when) {// this SHOULD be a single case, but iterating makes it a bit easier\r\n if (applies) break;\r\n if (when.hasOwnProperty(c)) {\r\n let expected = String(when[c]);\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (applies) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n }\r\n }\r\n }\r\n\r\n resolve(parsedModelList);\r\n }\r\n }).catch(()=>{\r\n resolve(parsedModelList);\r\n })\r\n }\r\n\r\n }\r\n })\r\n}\r\n\r\nfunction loadAndMergeModel(model, assetRoot) {\r\n return loadModel(model.name, model.type, assetRoot)\r\n .then(modelData => mergeParents(modelData, model.name, assetRoot))\r\n .then(merged => {\r\n debug(model.name + \" merged:\");\r\n debug(merged);\r\n if (!merged.hasOwnProperty(\"elements\")) {\r\n if (model.name === \"lava\" || model.name === \"water\") {\r\n merged.elements = [\r\n {\r\n \"from\": [0, 0, 0],\r\n \"to\": [16, 16, 16],\r\n \"faces\": {\r\n \"down\": {\"texture\": \"#particle\", \"cullface\": \"down\"},\r\n \"up\": {\"texture\": \"#particle\", \"cullface\": \"up\"},\r\n \"north\": {\"texture\": \"#particle\", \"cullface\": \"north\"},\r\n \"south\": {\"texture\": \"#particle\", \"cullface\": \"south\"},\r\n \"west\": {\"texture\": \"#particle\", \"cullface\": \"west\"},\r\n \"east\": {\"texture\": \"#particle\", \"cullface\": \"east\"}\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n return merged;\r\n })\r\n}\r\n\r\n\r\n\r\n// Utils\r\n\r\nfunction modelCacheKey(model) {\r\n return model.type + \"__\" + model.name /*+ \"[\" + (model.variant || \"default\") + \"]\"*/;\r\n}\r\n\r\nfunction findMatchingVariant(variants, selector) {\r\n if (!Array.isArray(variants)) variants = Object.keys(variants);\r\n\r\n if (!selector || selector === \"\" || selector.length === 0) return \"\";\r\n let selectorObj = variantStringToObject(selector);\r\n for (let i = 0; i < variants.length; i++) {\r\n let variantObj = variantStringToObject(variants[i]);\r\n\r\n let matches = true;\r\n for (let k in selectorObj) {\r\n if (selectorObj.hasOwnProperty(k)) {\r\n if (variantObj.hasOwnProperty(k)) {\r\n if (selectorObj[k] !== variantObj[k]) {\r\n matches = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (matches) return variants[i];\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction variantStringToObject(str) {\r\n let split = str.split(\",\");\r\n let obj = {};\r\n for (let i = 0; i < split.length; i++) {\r\n let spl = split[i];\r\n let split1 = spl.split(\"=\");\r\n obj[split1[0]] = split1[1];\r\n }\r\n return obj;\r\n}\r\n\r\nfunction parseModelType(string) {\r\n if (string.startsWith(\"block/\")) {\r\n // if (type === \"item\") {\r\n // throw new Error(\"Tried to mix block/item models\");\r\n // }\r\n return {\r\n type: \"block\",\r\n model: string.substr(\"block/\".length)\r\n }\r\n } else if (string.startsWith(\"item/\")) {\r\n // if (type === \"block\") {\r\n // throw new Error(\"Tried to mix item/block models\");\r\n // }\r\n return {\r\n type: \"item\",\r\n model: string.substr(\"item/\".length)\r\n }\r\n }\r\n return {\r\n type: \"block\",\r\n model: \"string\"\r\n }\r\n}\r\n\r\nfunction loadModel(model, type/* block OR item */, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n if (typeof model === \"string\") {\r\n if (model.startsWith(\"{\") && model.endsWith(\"}\")) {// JSON string\r\n resolve(JSON.parse(model));\r\n } else if (model.startsWith(\"http\")) {// URL\r\n fetch(model, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"model data:\", data);\r\n resolve(data);\r\n })\r\n } else {// model name -> use local data\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + (type || \"block\") + \"/\" + model + \".json\").then((data) => {\r\n resolve(data);\r\n })\r\n }\r\n } else if (typeof model === \"object\") {// JSON object\r\n resolve(model);\r\n } else {\r\n console.warn(\"Invalid model\");\r\n reject();\r\n }\r\n });\r\n};\r\n\r\nfunction loadTextures(textureNames, assetRoot) {\r\n return new Promise((resolve) => {\r\n let promises = [];\r\n let filteredNames = [];\r\n\r\n let names = Object.keys(textureNames);\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n let texture = textureNames[name];\r\n if (texture.startsWith(\"#\")) {// reference to another texture, no need to load\r\n continue;\r\n }\r\n filteredNames.push(name);\r\n promises.push(Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextureAsBase64\"])(assetRoot, \"minecraft\", \"/\", texture));\r\n }\r\n Promise.all(promises).then((textures) => {\r\n let mappedTextures = {};\r\n for (let i = 0; i < textures.length; i++) {\r\n mappedTextures[filteredNames[i]] = textures[i];\r\n }\r\n\r\n // Fill in the referenced textures\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n if (!mappedTextures.hasOwnProperty(name) && textureNames.hasOwnProperty(name)) {\r\n let ref = textureNames[name].substr(1);\r\n mappedTextures[name] = mappedTextures[ref];\r\n }\r\n }\r\n\r\n resolve(mappedTextures);\r\n });\r\n })\r\n};\r\n\r\n\r\nfunction mergeParents(model, modelName, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n mergeParents_(model, modelName, [], [], assetRoot, resolve, reject);\r\n });\r\n};\r\nlet mergeParents_ = function (model, name, stack, hierarchy, assetRoot, resolve, reject) {\r\n stack.push(model);\r\n\r\n if (!model.hasOwnProperty(\"parent\") || model[\"parent\"] === \"builtin/generated\" || model[\"parent\"] === \"builtin/entity\") {// already at the highest parent OR we reach the builtin parent which seems to be the hardcoded stuff that's not in the json files\r\n let merged = {};\r\n for (let i = stack.length - 1; i >= 0; i--) {\r\n merged = deepmerge__WEBPACK_IMPORTED_MODULE_1___default()(merged, stack[i]);\r\n }\r\n\r\n hierarchy.unshift(name);\r\n merged.hierarchy = hierarchy;\r\n resolve(merged);\r\n return;\r\n }\r\n\r\n let parent = model[\"parent\"];\r\n delete model[\"parent\"];// remove the child's parent so it will be replaced by the parent's parent\r\n hierarchy.push(parent);\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + parent + \".json\").then((parentData) => {\r\n let mergedModel = Object.assign({}, model, parentData);\r\n mergeParents_(mergedModel, name, stack, hierarchy, assetRoot, resolve, reject);\r\n }).catch(reject);\r\n\r\n};\r\n\r\nfunction toRadians(angle) {\r\n return angle * (Math.PI / 180);\r\n}\r\n\r\nfunction deleteObjectProperties(obj) {\r\n Object.keys(obj).forEach(function (key) {\r\n delete obj[key];\r\n });\r\n}\r\n\n\n//# sourceURL=webpack:///./src/model/modelFunctions.js?"); /***/ }), @@ -2157,7 +2190,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultOptions\", function() { return defaultOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepDisposeMesh\", function() { return deepDisposeMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeMeshes__\", function() { return mergeMeshes__; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeCubeMeshes\", function() { return mergeCubeMeshes; });\n/* harmony import */ var _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/OrbitControls */ \"./src/lib/OrbitControls.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! threejs-ext */ \"./node_modules/threejs-ext/dist/index.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(threejs_ext__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @johh/three-effectcomposer */ \"./node_modules/@johh/three-effectcomposer/dist/index.js\");\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! onscreen */ \"./node_modules/onscreen/dist/on-screen.umd.js\");\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(onscreen__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions */ \"./src/functions.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @property {boolean} showAxes Debugging - Show the scene's axes\r\n * @property {boolean} showOutlines Debugging - Show bounding boxes\r\n * @property {boolean} showGrid Debugging - Show coordinate grid\r\n *\r\n * @property {object} controls Controls settings\r\n * @property {boolean} [controls.enabled=true] Toggle controls\r\n * @property {boolean} [controls.zoom=true] Toggle zoom\r\n * @property {boolean} [controls.rotate=true] Toggle rotation\r\n * @property {boolean} [controls.pan=true] Toggle panning\r\n *\r\n * @property {object} camera Camera settings\r\n * @property {string} [camera.type=perspective] Camera type\r\n * @property {number} camera.x Camera X-position\r\n * @property {number} camera.y Camera Y-Position\r\n * @property {number} camera.z Camera Z-Position\r\n * @property {number[]} camera.target [x,y,z] array where the camera should look\r\n */\r\nconst defaultOptions = {\r\n showAxes: false,\r\n showGrid: false,\r\n autoResize: false,\r\n controls: {\r\n enabled: true,\r\n zoom: true,\r\n rotate: true,\r\n pan: true,\r\n keys: true\r\n },\r\n camera: {\r\n type: \"perspective\",\r\n x: 20,\r\n y: 35,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n canvas: {\r\n width: undefined,\r\n height: undefined\r\n },\r\n pauseHidden: true,\r\n forceContext: false,\r\n sendStats: true\r\n};\r\n\r\n/**\r\n * Base class for all Renders\r\n */\r\nclass Render {\r\n\r\n /**\r\n * @param {object} options The options for this renderer, see {@link defaultOptions}\r\n * @param {object} defOptions Additional default options, provided by the individual renders\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, defOptions, element) {\r\n /**\r\n * DOM Element to attach the renderer to\r\n * @type {HTMLElement}\r\n */\r\n this.element = element || document.body;\r\n /**\r\n * Combined options\r\n * @type {{} & defaultOptions & defOptions & options}\r\n */\r\n this.options = Object.assign({}, defaultOptions, defOptions, options);\r\n\r\n this.renderType = \"_Base_\";\r\n }\r\n\r\n /**\r\n * @param {boolean} [trim=false] whether to trim transparent pixels\r\n * @param {string} [mime=image/png] mime type of the image\r\n * @returns {string} The content of the renderer's canvas as a Base64 encoded image\r\n */\r\n toImage(trim, mime) {\r\n if (!mime) mime = \"image/png\";\r\n if (this._renderer) {\r\n if (!trim) {\r\n return this._renderer.domElement.toDataURL(mime);\r\n } else {\r\n // Clone the canvas onto a 2d context, so we can trim it properly\r\n let newCanvas = document.createElement('canvas');\r\n let context = newCanvas.getContext('2d');\r\n\r\n newCanvas.width = this._renderer.domElement.width;\r\n newCanvas.height = this._renderer.domElement.height;\r\n\r\n context.drawImage(this._renderer.domElement, 0, 0);\r\n\r\n let trimmed = Object(_functions__WEBPACK_IMPORTED_MODULE_6__[\"trimCanvas\"])(newCanvas);\r\n return trimmed.toDataURL(mime);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Export the current scene content in the .obj format (only geometries, no textures)\r\n * @returns {string} the .obj file content\r\n */\r\n toObj() {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"OBJExporter\"]();\r\n return exporter.parse(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Export the current scene content in the .gltf format (geometries + textures)\r\n * @returns {Promise} a promise which resolves with the .gltf file content\r\n */\r\n toGLTF(exportOptions) {\r\n return new Promise((resolve, reject) => {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"GLTFExporter\"]();\r\n exporter.parse(this._scene, (gltf) => {\r\n resolve(gltf);\r\n }, exportOptions)\r\n } else {\r\n reject();\r\n }\r\n })\r\n }\r\n\r\n toPLY(exportOptions) {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"PLYExporter\"]();\r\n return exporter.parse(this._scene, exportOptions);\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the scene\r\n * @param renderCb\r\n * @param doNotAnimate\r\n * @protected\r\n */\r\n initScene(renderCb, doNotAnimate) {\r\n let renderObj = this;\r\n\r\n console.log(\" \");\r\n console.log('%c ', 'font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;');\r\n console.log(\"MineRender/\" + (renderObj.renderType || renderObj.constructor.name) + \"/\" + \"1.4.6\");\r\n console.log(( false ? undefined : \"DEVELOPMENT\") + \" build\");\r\n console.log(\"Built @ \" + \"2021-02-01T16:10:49.094Z\");\r\n console.log(\" \");\r\n\r\n if (renderObj.options.sendStats) {\r\n // Send stats\r\n\r\n let iframe = false;\r\n try {\r\n iframe = window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n let hostname;\r\n try{\r\n hostname = new URL(iframe ? document.referrer : window.location).hostname;\r\n }catch (e) {\r\n console.warn(\"Failed to get hostname\");\r\n }\r\n\r\n jquery__WEBPACK_IMPORTED_MODULE_5__[\"post\"]({\r\n url: \"https://minerender.org/stats.php\",\r\n data: {\r\n action: \"init\",\r\n type: renderObj.renderType,\r\n host: hostname,\r\n source: (iframe ? \"iframe\" : \"javascript\")\r\n }\r\n });\r\n }\r\n\r\n // Scene INIT\r\n let scene = new three__WEBPACK_IMPORTED_MODULE_3__[\"Scene\"]();\r\n renderObj._scene = scene;\r\n let camera;\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"OrthographicCamera\"]((renderObj.options.canvas.width || window.innerWidth) / -2, (renderObj.options.canvas.width || window.innerWidth) / 2, (renderObj.options.canvas.height || window.innerHeight) / 2, (renderObj.options.canvas.height || window.innerHeight) / -2, 1, 1000);\r\n } else {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"PerspectiveCamera\"](75, (renderObj.options.canvas.width || window.innerWidth) / (renderObj.options.canvas.height || window.innerHeight), 5, 1000);\r\n }\r\n renderObj._camera = camera;\r\n\r\n if (renderObj.options.camera.zoom) {\r\n camera.zoom = renderObj.options.camera.zoom;\r\n }\r\n\r\n let renderer = new three__WEBPACK_IMPORTED_MODULE_3__[\"WebGLRenderer\"]({alpha: true, antialias: true, preserveDrawingBuffer: true});\r\n renderObj._renderer = renderer;\r\n renderer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderer.setClearColor(0x000000, 0);\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.shadowMap.enabled = true;\r\n renderer.shadowMap.type = three__WEBPACK_IMPORTED_MODULE_3__[\"PCFSoftShadowMap\"];\r\n renderObj.element.appendChild(renderObj._canvas = renderer.domElement);\r\n\r\n let composer = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default.a(renderer);\r\n composer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderObj._composer = composer;\r\n let ssaaRenderPass = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"SSAARenderPass\"](scene, camera);\r\n ssaaRenderPass.unbiased = true;\r\n composer.addPass(ssaaRenderPass);\r\n // let renderPass = new RenderPass(scene, camera);\r\n // renderPass.enabled = false;\r\n // composer.addPass(renderPass);\r\n let copyPass = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"ShaderPass\"](_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"CopyShader\"]);\r\n copyPass.renderToScreen = true;\r\n composer.addPass(copyPass);\r\n\r\n if (renderObj.options.autoResize) {\r\n renderObj._resizeListener = function () {\r\n let width = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetWidth : window.innerWidth;\r\n let height = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetHeight : window.innerHeight;\r\n\r\n renderObj._resize(width, height);\r\n };\r\n window.addEventListener(\"resize\", renderObj._resizeListener);\r\n }\r\n renderObj._resize = function (width, height) {\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera.left = width / -2;\r\n camera.right = width / 2;\r\n camera.top = height / 2;\r\n camera.bottom = height / -2;\r\n } else {\r\n camera.aspect = width / height;\r\n }\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(width, height);\r\n composer.setSize(width, height);\r\n };\r\n\r\n // Helpers\r\n if (renderObj.options.showAxes) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"AxesHelper\"](50));\r\n }\r\n if (renderObj.options.showGrid) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"GridHelper\"](100, 100));\r\n }\r\n\r\n let light = new three__WEBPACK_IMPORTED_MODULE_3__[\"AmbientLight\"](0xFFFFFF); // soft white light\r\n scene.add(light);\r\n\r\n // Init controls\r\n let controls = new _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__[\"default\"](camera, renderer.domElement);\r\n renderObj._controls = controls;\r\n controls.enableZoom = renderObj.options.controls.zoom;\r\n controls.enableRotate = renderObj.options.controls.rotate;\r\n controls.enablePan = renderObj.options.controls.pan;\r\n controls.enableKeys = renderObj.options.controls.keys;\r\n controls.target.set(renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]);\r\n\r\n // Set camera location & target\r\n camera.position.x = renderObj.options.camera.x;\r\n camera.position.y = renderObj.options.camera.y;\r\n camera.position.z = renderObj.options.camera.z;\r\n camera.lookAt(new three__WEBPACK_IMPORTED_MODULE_3__[\"Vector3\"](renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]));\r\n\r\n // Do the render!\r\n let animate = function () {\r\n renderObj._animId = requestAnimationFrame(animate);\r\n\r\n if (renderObj.onScreen) {\r\n if (typeof renderCb === \"function\") renderCb();\r\n\r\n composer.render();\r\n }\r\n };\r\n renderObj._animate = animate;\r\n\r\n if (!doNotAnimate) {\r\n animate();\r\n }\r\n\r\n renderObj.onScreen = true;// default to true, in case the checking is disabled\r\n let id = \"minerender-canvas-\" + renderObj._scene.uuid + \"-\" + Date.now();\r\n renderObj._canvas.id = id;\r\n if (renderObj.options.pauseHidden) {\r\n renderObj.onScreen = false;// set to false if the check is enabled\r\n let os = new onscreen__WEBPACK_IMPORTED_MODULE_4___default.a();\r\n renderObj._onScreenObserver = os;\r\n\r\n os.on(\"enter\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = true;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextRestore();\r\n }\r\n })\r\n os.on(\"leave\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = false;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextLoss();\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Adds an object to the scene & sets userData.renderType to this renderer's type\r\n * @param toAdd object to add\r\n */\r\n addToScene(toAdd) {\r\n let renderObj = this;\r\n if (renderObj._scene && toAdd) {\r\n toAdd.userData.renderType = renderObj.renderType;\r\n renderObj._scene.add(toAdd);\r\n }\r\n }\r\n\r\n /**\r\n * Clears the scene\r\n * @param onlySelfType whether to remove only objects whose type is equal to this renderer's type (useful for combined render)\r\n * @param filterFn Filter function to check which children of the scene to remove\r\n */\r\n clearScene(onlySelfType, filterFn) {\r\n if (onlySelfType || filterFn) {\r\n for (let i = this._scene.children.length - 1; i >= 0; i--) {\r\n let child = this._scene.children[i];\r\n if (filterFn) {\r\n let shouldKeep = filterFn(child);\r\n if (shouldKeep) {\r\n continue;\r\n }\r\n }\r\n if (onlySelfType) {\r\n if (child.userData.renderType !== this.renderType) {\r\n continue;\r\n }\r\n }\r\n deepDisposeMesh(child, true);\r\n this._scene.remove(child);\r\n }\r\n } else {\r\n while (this._scene.children.length > 0) {\r\n this._scene.remove(this._scene.children[0]);\r\n }\r\n }\r\n };\r\n\r\n dispose() {\r\n cancelAnimationFrame(this._animId);\r\n if (this._onScreenObserver) {\r\n this._onScreenObserver.destroy();\r\n }\r\n\r\n this.clearScene();\r\n\r\n this._canvas.remove();\r\n let el = this.element;\r\n while (el.firstChild) {\r\n el.removeChild(el.firstChild);\r\n }\r\n\r\n if (this.options.autoResize) {\r\n window.removeEventListener(\"resize\", this._resizeListener);\r\n }\r\n };\r\n\r\n}\r\n\r\n// https://stackoverflow.com/questions/27217388/use-multiple-materials-for-merged-geometries-in-three-js/44485364#44485364\r\nfunction deepDisposeMesh(obj, removeChildren) {\r\n if (!obj) return;\r\n if (obj.geometry && obj.geometry.dispose) obj.geometry.dispose();\r\n if (obj.material && obj.material.dispose) obj.material.dispose();\r\n if (obj.texture && obj.texture.dispose) obj.texture.dispose();\r\n if (obj.children) {\r\n let children = obj.children;\r\n for (let i = 0; i < children.length; i++) {\r\n deepDisposeMesh(children[i], removeChildren);\r\n }\r\n\r\n if (removeChildren) {\r\n for (let i = obj.children.length - 1; i >= 0; i--) {\r\n obj.remove(children[i]);\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction mergeMeshes__(meshes, toBufferGeometry) {\r\n let finalGeometry,\r\n materials = [],\r\n mergedGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"](),\r\n mergedMesh;\r\n\r\n meshes.forEach(function (mesh, index) {\r\n mesh.updateMatrix();\r\n mesh.geometry.faces.forEach(function (face) {\r\n face.materialIndex = 0;\r\n });\r\n mergedGeometry.merge(mesh.geometry, mesh.matrix, index);\r\n materials.push(mesh.material);\r\n });\r\n\r\n mergedGeometry.groupsNeedUpdate = true;\r\n\r\n if (toBufferGeometry) {\r\n finalGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedGeometry);\r\n } else {\r\n finalGeometry = mergedGeometry;\r\n }\r\n\r\n mergedMesh = new three__WEBPACK_IMPORTED_MODULE_3__[\"Mesh\"](finalGeometry, materials);\r\n mergedMesh.geometry.computeFaceNormals();\r\n mergedMesh.geometry.computeVertexNormals();\r\n\r\n return mergedMesh;\r\n\r\n}\r\n\r\nfunction mergeCubeMeshes(cubes, toBuffer) {\r\n cubes = cubes.filter(c => !!c);\r\n\r\n let mergedCubes = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"]();\r\n let mergedMaterials = [];\r\n for (let i = 0; i < cubes.length; i++) {\r\n let offset = i * Math.max(cubes[i].material.length, 1);\r\n mergedCubes.merge(cubes[i].geometry, cubes[i].matrix, offset);\r\n for (let j = 0; j < cubes[i].material.length; j++) {\r\n mergedMaterials.push(cubes[i].material[j]);\r\n }\r\n // for (let j = 0; j < cubes[i].geometry.faces.length; j++) {\r\n // cubes[i].geometry.faces[j].materialIndex=offset-1+j;\r\n // }\r\n\r\n deepDisposeMesh(cubes[i], true);\r\n }\r\n mergedCubes.mergeVertices();\r\n return {\r\n geometry: toBuffer ? new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedCubes) : mergedCubes,\r\n materials: mergedMaterials\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./src/renderBase.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultOptions\", function() { return defaultOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepDisposeMesh\", function() { return deepDisposeMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeMeshes__\", function() { return mergeMeshes__; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeCubeMeshes\", function() { return mergeCubeMeshes; });\n/* harmony import */ var _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/OrbitControls */ \"./src/lib/OrbitControls.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! threejs-ext */ \"./node_modules/threejs-ext/dist/index.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(threejs_ext__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @johh/three-effectcomposer */ \"./node_modules/@johh/three-effectcomposer/dist/index.js\");\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! onscreen */ \"./node_modules/onscreen/dist/on-screen.umd.js\");\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(onscreen__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions */ \"./src/functions.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @property {boolean} showAxes Debugging - Show the scene's axes\r\n * @property {boolean} showOutlines Debugging - Show bounding boxes\r\n * @property {boolean} showGrid Debugging - Show coordinate grid\r\n *\r\n * @property {object} controls Controls settings\r\n * @property {boolean} [controls.enabled=true] Toggle controls\r\n * @property {boolean} [controls.zoom=true] Toggle zoom\r\n * @property {boolean} [controls.rotate=true] Toggle rotation\r\n * @property {boolean} [controls.pan=true] Toggle panning\r\n *\r\n * @property {object} camera Camera settings\r\n * @property {string} [camera.type=perspective] Camera type\r\n * @property {number} camera.x Camera X-position\r\n * @property {number} camera.y Camera Y-Position\r\n * @property {number} camera.z Camera Z-Position\r\n * @property {number[]} camera.target [x,y,z] array where the camera should look\r\n */\r\nconst defaultOptions = {\r\n showAxes: false,\r\n showGrid: false,\r\n autoResize: false,\r\n controls: {\r\n enabled: true,\r\n zoom: true,\r\n rotate: true,\r\n pan: true,\r\n keys: true\r\n },\r\n camera: {\r\n type: \"perspective\",\r\n x: 20,\r\n y: 35,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n canvas: {\r\n width: undefined,\r\n height: undefined\r\n },\r\n pauseHidden: true,\r\n forceContext: false,\r\n sendStats: true\r\n};\r\n\r\n/**\r\n * Base class for all Renders\r\n */\r\nclass Render {\r\n\r\n /**\r\n * @param {object} options The options for this renderer, see {@link defaultOptions}\r\n * @param {object} defOptions Additional default options, provided by the individual renders\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, defOptions, element) {\r\n /**\r\n * DOM Element to attach the renderer to\r\n * @type {HTMLElement}\r\n */\r\n this.element = element || document.body;\r\n /**\r\n * Combined options\r\n * @type {{} & defaultOptions & defOptions & options}\r\n */\r\n this.options = Object.assign({}, defaultOptions, defOptions, options);\r\n\r\n this.renderType = \"_Base_\";\r\n }\r\n\r\n /**\r\n * @param {boolean} [trim=false] whether to trim transparent pixels\r\n * @param {string} [mime=image/png] mime type of the image\r\n * @returns {string} The content of the renderer's canvas as a Base64 encoded image\r\n */\r\n toImage(trim, mime) {\r\n if (!mime) mime = \"image/png\";\r\n if (this._renderer) {\r\n if (!trim) {\r\n return this._renderer.domElement.toDataURL(mime);\r\n } else {\r\n // Clone the canvas onto a 2d context, so we can trim it properly\r\n let newCanvas = document.createElement('canvas');\r\n let context = newCanvas.getContext('2d');\r\n\r\n newCanvas.width = this._renderer.domElement.width;\r\n newCanvas.height = this._renderer.domElement.height;\r\n\r\n context.drawImage(this._renderer.domElement, 0, 0);\r\n\r\n let trimmed = Object(_functions__WEBPACK_IMPORTED_MODULE_6__[\"trimCanvas\"])(newCanvas);\r\n return trimmed.toDataURL(mime);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Export the current scene content in the .obj format (only geometries, no textures)\r\n * @returns {string} the .obj file content\r\n */\r\n toObj() {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"OBJExporter\"]();\r\n return exporter.parse(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Export the current scene content in the .gltf format (geometries + textures)\r\n * @returns {Promise} a promise which resolves with the .gltf file content\r\n */\r\n toGLTF(exportOptions) {\r\n return new Promise((resolve, reject) => {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"GLTFExporter\"]();\r\n exporter.parse(this._scene, (gltf) => {\r\n resolve(gltf);\r\n }, exportOptions)\r\n } else {\r\n reject();\r\n }\r\n })\r\n }\r\n\r\n toPLY(exportOptions) {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"PLYExporter\"]();\r\n return exporter.parse(this._scene, exportOptions);\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the scene\r\n * @param renderCb\r\n * @param doNotAnimate\r\n * @protected\r\n */\r\n initScene(renderCb, doNotAnimate) {\r\n let renderObj = this;\r\n\r\n console.log(\" \");\r\n console.log('%c ', 'font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;');\r\n console.log(\"MineRender/\" + (renderObj.renderType || renderObj.constructor.name) + \"/\" + \"1.4.7\");\r\n console.log(( false ? undefined : \"DEVELOPMENT\") + \" build\");\r\n console.log(\"Built @ \" + \"2021-02-01T16:31:09.608Z\");\r\n console.log(\" \");\r\n\r\n if (renderObj.options.sendStats) {\r\n // Send stats\r\n\r\n let iframe = false;\r\n try {\r\n iframe = window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n let hostname;\r\n try{\r\n hostname = new URL(iframe ? document.referrer : window.location).hostname;\r\n }catch (e) {\r\n console.warn(\"Failed to get hostname\");\r\n }\r\n\r\n jquery__WEBPACK_IMPORTED_MODULE_5__[\"post\"]({\r\n url: \"https://minerender.org/stats.php\",\r\n data: {\r\n action: \"init\",\r\n type: renderObj.renderType,\r\n host: hostname,\r\n source: (iframe ? \"iframe\" : \"javascript\")\r\n }\r\n });\r\n }\r\n\r\n // Scene INIT\r\n let scene = new three__WEBPACK_IMPORTED_MODULE_3__[\"Scene\"]();\r\n renderObj._scene = scene;\r\n let camera;\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"OrthographicCamera\"]((renderObj.options.canvas.width || window.innerWidth) / -2, (renderObj.options.canvas.width || window.innerWidth) / 2, (renderObj.options.canvas.height || window.innerHeight) / 2, (renderObj.options.canvas.height || window.innerHeight) / -2, 1, 1000);\r\n } else {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"PerspectiveCamera\"](75, (renderObj.options.canvas.width || window.innerWidth) / (renderObj.options.canvas.height || window.innerHeight), 5, 1000);\r\n }\r\n renderObj._camera = camera;\r\n\r\n if (renderObj.options.camera.zoom) {\r\n camera.zoom = renderObj.options.camera.zoom;\r\n }\r\n\r\n let renderer = new three__WEBPACK_IMPORTED_MODULE_3__[\"WebGLRenderer\"]({alpha: true, antialias: true, preserveDrawingBuffer: true});\r\n renderObj._renderer = renderer;\r\n renderer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderer.setClearColor(0x000000, 0);\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.shadowMap.enabled = true;\r\n renderer.shadowMap.type = three__WEBPACK_IMPORTED_MODULE_3__[\"PCFSoftShadowMap\"];\r\n renderObj.element.appendChild(renderObj._canvas = renderer.domElement);\r\n\r\n let composer = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default.a(renderer);\r\n composer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderObj._composer = composer;\r\n let ssaaRenderPass = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"SSAARenderPass\"](scene, camera);\r\n ssaaRenderPass.unbiased = true;\r\n composer.addPass(ssaaRenderPass);\r\n // let renderPass = new RenderPass(scene, camera);\r\n // renderPass.enabled = false;\r\n // composer.addPass(renderPass);\r\n let copyPass = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"ShaderPass\"](_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"CopyShader\"]);\r\n copyPass.renderToScreen = true;\r\n composer.addPass(copyPass);\r\n\r\n if (renderObj.options.autoResize) {\r\n renderObj._resizeListener = function () {\r\n let width = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetWidth : window.innerWidth;\r\n let height = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetHeight : window.innerHeight;\r\n\r\n renderObj._resize(width, height);\r\n };\r\n window.addEventListener(\"resize\", renderObj._resizeListener);\r\n }\r\n renderObj._resize = function (width, height) {\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera.left = width / -2;\r\n camera.right = width / 2;\r\n camera.top = height / 2;\r\n camera.bottom = height / -2;\r\n } else {\r\n camera.aspect = width / height;\r\n }\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(width, height);\r\n composer.setSize(width, height);\r\n };\r\n\r\n // Helpers\r\n if (renderObj.options.showAxes) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"AxesHelper\"](50));\r\n }\r\n if (renderObj.options.showGrid) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"GridHelper\"](100, 100));\r\n }\r\n\r\n let light = new three__WEBPACK_IMPORTED_MODULE_3__[\"AmbientLight\"](0xFFFFFF); // soft white light\r\n scene.add(light);\r\n\r\n // Init controls\r\n let controls = new _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__[\"default\"](camera, renderer.domElement);\r\n renderObj._controls = controls;\r\n controls.enableZoom = renderObj.options.controls.zoom;\r\n controls.enableRotate = renderObj.options.controls.rotate;\r\n controls.enablePan = renderObj.options.controls.pan;\r\n controls.enableKeys = renderObj.options.controls.keys;\r\n controls.target.set(renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]);\r\n\r\n // Set camera location & target\r\n camera.position.x = renderObj.options.camera.x;\r\n camera.position.y = renderObj.options.camera.y;\r\n camera.position.z = renderObj.options.camera.z;\r\n camera.lookAt(new three__WEBPACK_IMPORTED_MODULE_3__[\"Vector3\"](renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]));\r\n\r\n // Do the render!\r\n let animate = function () {\r\n renderObj._animId = requestAnimationFrame(animate);\r\n\r\n if (renderObj.onScreen) {\r\n if (typeof renderCb === \"function\") renderCb();\r\n\r\n composer.render();\r\n }\r\n };\r\n renderObj._animate = animate;\r\n\r\n if (!doNotAnimate) {\r\n animate();\r\n }\r\n\r\n renderObj.onScreen = true;// default to true, in case the checking is disabled\r\n let id = \"minerender-canvas-\" + renderObj._scene.uuid + \"-\" + Date.now();\r\n renderObj._canvas.id = id;\r\n if (renderObj.options.pauseHidden) {\r\n renderObj.onScreen = false;// set to false if the check is enabled\r\n let os = new onscreen__WEBPACK_IMPORTED_MODULE_4___default.a();\r\n renderObj._onScreenObserver = os;\r\n\r\n os.on(\"enter\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = true;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextRestore();\r\n }\r\n })\r\n os.on(\"leave\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = false;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextLoss();\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Adds an object to the scene & sets userData.renderType to this renderer's type\r\n * @param toAdd object to add\r\n */\r\n addToScene(toAdd) {\r\n let renderObj = this;\r\n if (renderObj._scene && toAdd) {\r\n toAdd.userData.renderType = renderObj.renderType;\r\n renderObj._scene.add(toAdd);\r\n }\r\n }\r\n\r\n /**\r\n * Clears the scene\r\n * @param onlySelfType whether to remove only objects whose type is equal to this renderer's type (useful for combined render)\r\n * @param filterFn Filter function to check which children of the scene to remove\r\n */\r\n clearScene(onlySelfType, filterFn) {\r\n if (onlySelfType || filterFn) {\r\n for (let i = this._scene.children.length - 1; i >= 0; i--) {\r\n let child = this._scene.children[i];\r\n if (filterFn) {\r\n let shouldKeep = filterFn(child);\r\n if (shouldKeep) {\r\n continue;\r\n }\r\n }\r\n if (onlySelfType) {\r\n if (child.userData.renderType !== this.renderType) {\r\n continue;\r\n }\r\n }\r\n deepDisposeMesh(child, true);\r\n this._scene.remove(child);\r\n }\r\n } else {\r\n while (this._scene.children.length > 0) {\r\n this._scene.remove(this._scene.children[0]);\r\n }\r\n }\r\n };\r\n\r\n dispose() {\r\n cancelAnimationFrame(this._animId);\r\n if (this._onScreenObserver) {\r\n this._onScreenObserver.destroy();\r\n }\r\n\r\n this.clearScene();\r\n\r\n this._canvas.remove();\r\n let el = this.element;\r\n while (el.firstChild) {\r\n el.removeChild(el.firstChild);\r\n }\r\n\r\n if (this.options.autoResize) {\r\n window.removeEventListener(\"resize\", this._resizeListener);\r\n }\r\n };\r\n\r\n}\r\n\r\n// https://stackoverflow.com/questions/27217388/use-multiple-materials-for-merged-geometries-in-three-js/44485364#44485364\r\nfunction deepDisposeMesh(obj, removeChildren) {\r\n if (!obj) return;\r\n if (obj.geometry && obj.geometry.dispose) obj.geometry.dispose();\r\n if (obj.material && obj.material.dispose) obj.material.dispose();\r\n if (obj.texture && obj.texture.dispose) obj.texture.dispose();\r\n if (obj.children) {\r\n let children = obj.children;\r\n for (let i = 0; i < children.length; i++) {\r\n deepDisposeMesh(children[i], removeChildren);\r\n }\r\n\r\n if (removeChildren) {\r\n for (let i = obj.children.length - 1; i >= 0; i--) {\r\n obj.remove(children[i]);\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction mergeMeshes__(meshes, toBufferGeometry) {\r\n let finalGeometry,\r\n materials = [],\r\n mergedGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"](),\r\n mergedMesh;\r\n\r\n meshes.forEach(function (mesh, index) {\r\n mesh.updateMatrix();\r\n mesh.geometry.faces.forEach(function (face) {\r\n face.materialIndex = 0;\r\n });\r\n mergedGeometry.merge(mesh.geometry, mesh.matrix, index);\r\n materials.push(mesh.material);\r\n });\r\n\r\n mergedGeometry.groupsNeedUpdate = true;\r\n\r\n if (toBufferGeometry) {\r\n finalGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedGeometry);\r\n } else {\r\n finalGeometry = mergedGeometry;\r\n }\r\n\r\n mergedMesh = new three__WEBPACK_IMPORTED_MODULE_3__[\"Mesh\"](finalGeometry, materials);\r\n mergedMesh.geometry.computeFaceNormals();\r\n mergedMesh.geometry.computeVertexNormals();\r\n\r\n return mergedMesh;\r\n\r\n}\r\n\r\nfunction mergeCubeMeshes(cubes, toBuffer) {\r\n cubes = cubes.filter(c => !!c);\r\n\r\n let mergedCubes = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"]();\r\n let mergedMaterials = [];\r\n for (let i = 0; i < cubes.length; i++) {\r\n let offset = i * Math.max(cubes[i].material.length, 1);\r\n mergedCubes.merge(cubes[i].geometry, cubes[i].matrix, offset);\r\n for (let j = 0; j < cubes[i].material.length; j++) {\r\n mergedMaterials.push(cubes[i].material[j]);\r\n }\r\n // for (let j = 0; j < cubes[i].geometry.faces.length; j++) {\r\n // cubes[i].geometry.faces[j].materialIndex=offset-1+j;\r\n // }\r\n\r\n deepDisposeMesh(cubes[i], true);\r\n }\r\n mergedCubes.mergeVertices();\r\n return {\r\n geometry: toBuffer ? new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedCubes) : mergedCubes,\r\n materials: mergedMaterials\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./src/renderBase.js?"); /***/ }), diff --git a/dist/entity.min.js b/dist/entity.min.js index f0c7a663..7f0368dd 100644 --- a/dist/entity.min.js +++ b/dist/entity.min.js @@ -1,16 +1,16 @@ /*! - * MineRender 1.4.6 + * MineRender 1.4.7 * (c) 2018, Haylee Schäfer (inventivetalent) / MIT License * https://minerender.org - * Build #1612195849082 / Mon Feb 01 2021 17:10:49 GMT+0100 (GMT+01:00) - */!function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=79)}([function(e,t){e.exports=THREE},function(e,t,r){"use strict";r.d(t,"e",(function(){return o})),r.d(t,"b",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"c",(function(){return f})),r.d(t,"f",(function(){return h})),r.d(t,"a",(function(){return p}));var a=r(2),n=r(22),i=r.n(n);function o(e,t,r,n){return new Promise(i=>{let o,s,l,f="block";if("string"==typeof e){let a=c(e);e=a.model,f=a.type,r.push({name:e,type:f,options:t}),i(r)}else if("object"==typeof e)if(e.hasOwnProperty("offset")&&(o=e.offset),e.hasOwnProperty("rotation")&&(s=e.rotation),e.hasOwnProperty("scale")&&(l=e.scale),e.hasOwnProperty("model")){if(e.hasOwnProperty("type"))f=e.type,e=e.model;else{let t=c(e.model);e=t.model,f=t.type}r.push({name:e,type:f,offset:o,rotation:s,scale:l,options:t}),i(r)}else e.hasOwnProperty("blockstate")&&(f="block",Object(a.b)(e.blockstate,n).then(a=>{if(a.hasOwnProperty("variants"))if(e.hasOwnProperty("variant")){let n=function(e,t){Array.isArray(e)||(e=Object.keys(e));if(!t||""===t||0===t.length)return"";let r=u(t);for(let t=0;t{i(r)}))})}function s(e,t){return function(e,t,r){return new Promise((n,i)=>{"string"==typeof e?e.startsWith("{")&&e.endsWith("}")?n(JSON.parse(e)):e.startsWith("http")?fetch(e,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{console.log("model data:",e),n(e)}):Object(a.c)(r,"/assets/minecraft/models/"+(t||"block")+"/"+e+".json").then(e=>{n(e)}):"object"==typeof e?n(e):(console.warn("Invalid model"),i())})}(e.name,e.type,t).then(r=>(function(e,t,r){return new Promise((a,n)=>{d(e,t,[],[],r,a,n)})})(r,e.name,t)).then(t=>(console.debug(e.name+" merged:"),console.debug(t),t.hasOwnProperty("elements")||"lava"!==e.name&&"water"!==e.name||(t.elements=[{from:[0,0,0],to:[16,16,16],faces:{down:{texture:"#particle",cullface:"down"},up:{texture:"#particle",cullface:"up"},north:{texture:"#particle",cullface:"north"},south:{texture:"#particle",cullface:"south"},west:{texture:"#particle",cullface:"west"},east:{texture:"#particle",cullface:"east"}}}]),t))}function l(e){return e.type+"__"+e.name}function u(e){let t=e.split(","),r={};for(let e=0;e{let n=[],i=[],o=Object.keys(e);for(let r=0;r{let a={};for(let e=0;e=0;t--)e=i()(e,r[t]);return n.unshift(t),e.hierarchy=n,void s(e)}let u=e.parent;delete e.parent,n.push(u),Object(a.c)(o,"/assets/minecraft/models/"+u+".json").then(a=>{let i=Object.assign({},e,a);d(i,t,r,n,o,s,l)}).catch(l)};function h(e){return e*(Math.PI/180)}function p(e){Object.keys(e).forEach((function(t){delete e[t]}))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return u})),r.d(t,"e",(function(){return c})),r.d(t,"c",(function(){return f})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return h}));const a="https://assets.mcasset.cloud/1.13",n={},i={},o={},s={};function l(e,t,r,o){return new Promise((s,l)=>{!function e(t,r,o,s,l,u,c){let f="/assets/"+r+"/textures"+o+s+".png";if(n.hasOwnProperty(f))return"__invalid"===n[f]?void u():void l(n[f]);if(!i.hasOwnProperty(f)||0===i[f].length||c){let c=new XMLHttpRequest;c.open("GET",t+f,!0),c.responseType="arraybuffer",c.onloadend=function(){if(200===c.status){let e=new Uint8Array(c.response||c.responseText),t=String.fromCharCode.apply(null,e),r="data:image/png;base64,"+btoa(t);if(n[f]=r,i.hasOwnProperty(f))for(;i[f].length>0;){i[f].shift(0)[0](r)}}else if(a===t){if(n[f]="__invalid",i.hasOwnProperty(f))for(;i[f].length>0;){i[f].shift(0)[1]()}}else e(a,r,o,s,l,u,!0)},c.send(),i.hasOwnProperty(f)||(i[f]=[])}i[f].push([l,u])}(e,t,r,o,s,l)})}function u(e,t){return f(t,"/assets/minecraft/blockstates/"+e+".json")}function c(e,t){return f(t,"/assets/minecraft/textures/block/"+e+".png.mcmeta")}function f(e,t){return new Promise((r,n)=>{!function e(t,r,n,i,l){if(o.hasOwnProperty(r))return"__invalid"===o[r]?void i():void n(Object.assign({},o[r]));s.hasOwnProperty(r)&&0!==s[r].length&&!l||(console.log(t+r),fetch(t+r,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{if(console.log("json data:",e),o[r]=e,s.hasOwnProperty(r))for(;s[r].length>0;){let t=Object.assign({},e);s[r].shift(0)[0](t)}}).catch(l=>{if(console.warn(l),a===t){if(o[r]="__invalid",s.hasOwnProperty(r))for(;s[r].length>0;){s[r].shift(0)[1]()}}else e(a,r,n,i,!0)}),s.hasOwnProperty(r)||(s[r]=[]));s[r].push([n,i])}(e,t,r,n)})}function d(e,t,r){return 0===e?0:t/(r||16)*e}function h(e){let t,r,a,n=e.getContext("2d"),i=document.createElement("canvas").getContext("2d"),o=n.getImageData(0,0,e.width,e.height),s=o.data.length,l={top:null,left:null,right:null,bottom:null};for(t=0;t1)for(var r=1;r{let o,s,l,u="block";if("string"==typeof e){let a=d(e);e=a.model,u=a.type,r.push({name:e,type:u,options:t}),i(r)}else if("object"==typeof e)if(e.hasOwnProperty("offset")&&(o=e.offset),e.hasOwnProperty("rotation")&&(s=e.rotation),e.hasOwnProperty("scale")&&(l=e.scale),e.hasOwnProperty("model")){if(e.hasOwnProperty("type"))u=e.type,e=e.model;else{let t=d(e.model);e=t.model,u=t.type}r.push({name:e,type:u,offset:o,rotation:s,scale:l,options:t}),i(r)}else e.hasOwnProperty("blockstate")&&(u="block",Object(a.b)(e.blockstate,n).then(a=>{if(a.hasOwnProperty("variants"))if(e.hasOwnProperty("variant")){let n=function(e,t){Array.isArray(e)||(e=Object.keys(e));if(!t||""===t||0===t.length)return"";let r=f(t);for(let t=0;t{i(r)}))})}function u(e,t){return function(e,t,r){return new Promise((n,i)=>{"string"==typeof e?e.startsWith("{")&&e.endsWith("}")?n(JSON.parse(e)):e.startsWith("http")?fetch(e,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{console.log("model data:",e),n(e)}):Object(a.c)(r,"/assets/minecraft/models/"+(t||"block")+"/"+e+".json").then(e=>{n(e)}):"object"==typeof e?n(e):(console.warn("Invalid model"),i())})}(e.name,e.type,t).then(r=>(function(e,t,r){return new Promise((a,n)=>{p(e,t,[],[],r,a,n)})})(r,e.name,t)).then(t=>(s(e.name+" merged:"),s(t),t.hasOwnProperty("elements")||"lava"!==e.name&&"water"!==e.name||(t.elements=[{from:[0,0,0],to:[16,16,16],faces:{down:{texture:"#particle",cullface:"down"},up:{texture:"#particle",cullface:"up"},north:{texture:"#particle",cullface:"north"},south:{texture:"#particle",cullface:"south"},west:{texture:"#particle",cullface:"west"},east:{texture:"#particle",cullface:"east"}}}]),t))}function c(e){return e.type+"__"+e.name}function f(e){let t=e.split(","),r={};for(let e=0;e{let n=[],i=[],o=Object.keys(e);for(let r=0;r{let a={};for(let e=0;e=0;t--)e=i()(e,r[t]);return n.unshift(t),e.hierarchy=n,void s(e)}let u=e.parent;delete e.parent,n.push(u),Object(a.c)(o,"/assets/minecraft/models/"+u+".json").then(a=>{let i=Object.assign({},e,a);p(i,t,r,n,o,s,l)}).catch(l)};function m(e){return e*(Math.PI/180)}function v(e){Object.keys(e).forEach((function(t){delete e[t]}))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"d",(function(){return c})),r.d(t,"b",(function(){return f})),r.d(t,"e",(function(){return d})),r.d(t,"c",(function(){return h})),r.d(t,"f",(function(){return p})),r.d(t,"g",(function(){return m}));var a=r(13);const n=a("minerender"),i="https://assets.mcasset.cloud/1.13",o={},s={},l={},u={};function c(e,t,r,a){return new Promise((n,l)=>{!function e(t,r,a,n,l,u,c){let f="/assets/"+r+"/textures"+a+n+".png";if(o.hasOwnProperty(f))return"__invalid"===o[f]?void u():void l(o[f]);if(!s.hasOwnProperty(f)||0===s[f].length||c){let c=new XMLHttpRequest;c.open("GET",t+f,!0),c.responseType="arraybuffer",c.onloadend=function(){if(200===c.status){let e=new Uint8Array(c.response||c.responseText),t=String.fromCharCode.apply(null,e),r="data:image/png;base64,"+btoa(t);if(o[f]=r,s.hasOwnProperty(f))for(;s[f].length>0;){s[f].shift(0)[0](r)}}else if(i===t){if(o[f]="__invalid",s.hasOwnProperty(f))for(;s[f].length>0;){s[f].shift(0)[1]()}}else e(i,r,a,n,l,u,!0)},c.send(),s.hasOwnProperty(f)||(s[f]=[])}s[f].push([l,u])}(e,t,r,a,n,l)})}function f(e,t){return h(t,"/assets/minecraft/blockstates/"+e+".json")}function d(e,t){return h(t,"/assets/minecraft/textures/block/"+e+".png.mcmeta")}function h(e,t){return new Promise((r,a)=>{!function e(t,r,a,o,s){if(l.hasOwnProperty(r))return"__invalid"===l[r]?void o():void a(Object.assign({},l[r]));u.hasOwnProperty(r)&&0!==u[r].length&&!s||(n(t+r),fetch(t+r,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{if(n("json data:",e),l[r]=e,u.hasOwnProperty(r))for(;u[r].length>0;){let t=Object.assign({},e);u[r].shift(0)[0](t)}}).catch(n=>{if(console.warn(n),i===t){if(l[r]="__invalid",u.hasOwnProperty(r))for(;u[r].length>0;){u[r].shift(0)[1]()}}else e(i,r,a,o,!0)}),u.hasOwnProperty(r)||(u[r]=[]));u[r].push([a,o])}(e,t,r,a)})}function p(e,t,r){return 0===e?0:t/(r||16)*e}function m(e){let t,r,a,n=e.getContext("2d"),i=document.createElement("canvas").getContext("2d"),o=n.getImageData(0,0,e.width,e.height),s=o.data.length,l={top:null,left:null,right:null,bottom:null};for(t=0;t1)for(var r=1;r * @license MIT */ -var a=r(104),n=r(105),i=r(53);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(a)return V(e).length;t=(""+t).toLowerCase(),a=!0}}function m(e,t,r){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function v(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function g(e,t,r,a,n){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,a)),l.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,n);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,a,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,a,n){var i,o=1,s=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,d=0;dn&&(a=n):a=n;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");a>i/2&&(a=i/2);for(var o=0;o>8,n=r%256,i.push(n),i.push(a);return i}(t,e.length-r),e,r,a)}function S(e,t,r){return 0===t&&r===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[n+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[n+1],o=e[n+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[n+1],o=e[n+2],s=e[n+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),n+=f}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var r="",a=0;for(;a0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,a,n){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(a>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(i,o),u=this.slice(a,n),c=e.slice(t,r),f=0;fn)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;na)&&(r=a);for(var n="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,a,n,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function R(e,t,r,a){t<0&&(t=65535+t+1);for(var n=0,i=Math.min(e.length-r,2);n>>8*(a?n:1-n)}function I(e,t,r,a){t<0&&(t=4294967295+t+1);for(var n=0,i=Math.min(e.length-r,4);n>>8*(a?n:3-n)&255}function N(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,a,i){return i||N(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function U(e,t,r,a,i){return i||N(e,0,r,8),n.write(e,t,r,a,52,8),r+8}l.prototype.slice=function(e,t){var r,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t0&&(n*=256);)a+=this[e+--t]*n;return a},l.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=this[e],n=1,i=0;++i=(n*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=t,n=1,i=this[e+--a];a>0&&(n*=256);)i+=this[e+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,a){(e=+e,t|=0,r|=0,a)||k(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+n]=e/i&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,a){if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return a.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,a){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,r(4))},function(e,t,r){"use strict";var a=r(0);function n(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),h=d.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&h===d.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor):v.set(0,0,0),g=1,y.set(0,0,0),!!(b||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,k=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),R=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,1),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var n=l.domElement===document?l.domElement.body:l.domElement;if(l.object instanceof a.PerspectiveCamera){var i=l.object.position;e.copy(i).sub(l.target);var o=e.length();o*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*o/n.clientHeight,l.object.matrix),R(2*r*o/n.clientHeight,l.object.matrix)}else l.object instanceof a.OrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),R(r*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object instanceof a.PerspectiveCamera?g/=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object instanceof a.PerspectiveCamera?g*=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(c),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}(e),h=d.TOUCH_DOLLY;break;case 3:if(!1===l.enablePan)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom)return;if(h!==d.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.subVectors(T,M),P.y>0?D(F()):P.y<0&&N(F()),M.copy(T),l.update()}(e);break;case 3:if(!1===l.enablePan)return;if(h!==d.TOUCH_PAN)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()}n.prototype=Object.create(a.EventDispatcher.prototype),n.prototype.constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var i=r(23),o=r(28),s=r.n(o),l=r(77),u=r.n(l),c=r(21),f=r(2);r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return m}));const d={showAxes:!1,showGrid:!1,autoResize:!1,controls:{enabled:!0,zoom:!0,rotate:!0,pan:!0,keys:!0},camera:{type:"perspective",x:20,y:35,z:20,target:[0,0,0]},canvas:{width:void 0,height:void 0},pauseHidden:!0,forceContext:!1,sendStats:!0};class h{constructor(e,t,r){this.element=r||document.body,this.options=Object.assign({},d,t,e),this.renderType="_Base_"}toImage(e,t){if(t||(t="image/png"),this._renderer){if(e){let e=document.createElement("canvas"),r=e.getContext("2d");return e.width=this._renderer.domElement.width,e.height=this._renderer.domElement.height,r.drawImage(this._renderer.domElement,0,0),Object(f.g)(e).toDataURL(t)}return this._renderer.domElement.toDataURL(t)}}toObj(){if(this._scene){return(new i.OBJExporter).parse(this._scene)}}toGLTF(e){return new Promise((t,r)=>{if(this._scene){(new i.GLTFExporter).parse(this._scene,e=>{t(e)},e)}else r()})}toPLY(e){if(this._scene){return(new i.PLYExporter).parse(this._scene,e)}}initScene(e,t){let r=this;if(console.log(" "),console.log("%c ","font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;"),console.log("MineRender/"+(r.renderType||r.constructor.name)+"/1.4.6"),console.log("PRODUCTION build"),console.log("Built @ 2021-02-01T16:10:49.105Z"),console.log(" "),r.options.sendStats){let e,t=!1;try{t=window.self!==window.top}catch(e){return!0}try{e=new URL(t?document.referrer:window.location).hostname}catch(e){console.warn("Failed to get hostname")}c.post({url:"https://minerender.org/stats.php",data:{action:"init",type:r.renderType,host:e,source:t?"iframe":"javascript"}})}let l,f=new a.Scene;r._scene=f,l="orthographic"===r.options.camera.type?new a.OrthographicCamera((r.options.canvas.width||window.innerWidth)/-2,(r.options.canvas.width||window.innerWidth)/2,(r.options.canvas.height||window.innerHeight)/2,(r.options.canvas.height||window.innerHeight)/-2,1,1e3):new a.PerspectiveCamera(75,(r.options.canvas.width||window.innerWidth)/(r.options.canvas.height||window.innerHeight),5,1e3),r._camera=l,r.options.camera.zoom&&(l.zoom=r.options.camera.zoom);let d=new a.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});r._renderer=d,d.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),d.setClearColor(0,0),d.setPixelRatio(window.devicePixelRatio),d.shadowMap.enabled=!0,d.shadowMap.type=a.PCFSoftShadowMap,r.element.appendChild(r._canvas=d.domElement);let h=new s.a(d);h.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),r._composer=h;let p=new i.SSAARenderPass(f,l);p.unbiased=!0,h.addPass(p);let m=new o.ShaderPass(o.CopyShader);m.renderToScreen=!0,h.addPass(m),r.options.autoResize&&(r._resizeListener=function(){let e=r.element&&r.element!==document.body?r.element.offsetWidth:window.innerWidth,t=r.element&&r.element!==document.body?r.element.offsetHeight:window.innerHeight;r._resize(e,t)},window.addEventListener("resize",r._resizeListener)),r._resize=function(e,t){"orthographic"===r.options.camera.type?(l.left=e/-2,l.right=e/2,l.top=t/2,l.bottom=t/-2):l.aspect=e/t,l.updateProjectionMatrix(),d.setSize(e,t),h.setSize(e,t)},r.options.showAxes&&f.add(new a.AxesHelper(50)),r.options.showGrid&&f.add(new a.GridHelper(100,100));let v=new a.AmbientLight(16777215);f.add(v);let g=new n(l,d.domElement);r._controls=g,g.enableZoom=r.options.controls.zoom,g.enableRotate=r.options.controls.rotate,g.enablePan=r.options.controls.pan,g.enableKeys=r.options.controls.keys,g.target.set(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]),l.position.x=r.options.camera.x,l.position.y=r.options.camera.y,l.position.z=r.options.camera.z,l.lookAt(new a.Vector3(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]));let y=function(){r._animId=requestAnimationFrame(y),r.onScreen&&("function"==typeof e&&e(),h.render())};r._animate=y,t||y(),r.onScreen=!0;let b="minerender-canvas-"+r._scene.uuid+"-"+Date.now();if(r._canvas.id=b,r.options.pauseHidden){r.onScreen=!1;let e=new u.a;r._onScreenObserver=e,e.on("enter","#"+b,(e,t)=>{r.onScreen=!0,r.options.forceContext&&r._renderer.forceContextRestore()}),e.on("leave","#"+b,(e,t)=>{r.onScreen=!1,r.options.forceContext&&r._renderer.forceContextLoss()})}}addToScene(e){let t=this;t._scene&&e&&(e.userData.renderType=t.renderType,t._scene.add(e))}clearScene(e,t){if(e||t)for(let r=this._scene.children.length-1;r>=0;r--){let a=this._scene.children[r];if(t){if(t(a))continue}e&&a.userData.renderType!==this.renderType||(p(a,!0),this._scene.remove(a))}else for(;this._scene.children.length>0;)this._scene.remove(this._scene.children[0])}dispose(){cancelAnimationFrame(this._animId),this._onScreenObserver&&this._onScreenObserver.destroy(),this.clearScene(),this._canvas.remove();let e=this.element;for(;e.firstChild;)e.removeChild(e.firstChild);this.options.autoResize&&window.removeEventListener("resize",this._resizeListener)}}function p(e,t){if(e&&(e.geometry&&e.geometry.dispose&&e.geometry.dispose(),e.material&&e.material.dispose&&e.material.dispose(),e.texture&&e.texture.dispose&&e.texture.dispose(),e.children)){let r=e.children;for(let e=0;e=0;t--)e.remove(r[t])}}function m(e,t){e=e.filter(e=>!!e);let r=new a.Geometry,n=[];for(let t=0;tn(e,t))}class s extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e,Error.captureStackTrace(this,this.constructor.name)}}e.exports={getField:r,getFieldInfo:a,addErrorField:n,getCount:function(e,t,{count:n,countType:i},s){let l=0,u=0;return"number"==typeof n?l=n:void 0!==n?l=r(n,s):void 0!==i?({size:u,value:l}=o(()=>this.read(e,t,a(i),s),"$count")):l=0,{count:l,size:u}},sendCount:function(e,t,r,{count:n,countType:i},o){return void 0!==n&&e!==n||void 0!==i&&(r=this.write(e,t,r,a(i),o)),r},calcCount:function(e,{count:t,countType:r},n){return void 0===t&&void 0!==r?o(()=>this.sizeOf(e,a(r),n),"$count"):0},tryCatch:i,tryDoc:o,PartialReadError:class extends s{constructor(e){super(e),this.partialReadError=!0}}}},function(e,t,r){"use strict";function a(e,t,r){var a=r?" !== ":" === ",n=r?" || ":" && ",i=r?"!":"",o=r?"":"!";switch(e){case"null":return t+a+"null";case"array":return i+"Array.isArray("+t+")";case"object":return"("+i+t+n+"typeof "+t+a+'"object"'+n+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+a+'"number"'+n+o+"("+t+" % 1)"+n+t+a+t+")";default:return"typeof "+t+a+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:a,checkDataTypes:function(e,t){switch(e.length){case 1:return a(e[0],t,!0);default:var r="",n=i(e);for(var o in n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)r+=(r?" && ":"")+a(o,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],a=0;a=t)throw new Error("Cannot access property/index "+a+" levels up, current level is "+t);return r[t-a]}if(a>t)throw new Error("Cannot access data "+a+" levels up, current level is "+t);if(i="data"+(t-a||""),!n)return i}for(var s=i,u=n.split("/"),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,n,o,s;if("string"==typeof t&&(n="not ",t.substr(!o||o<0?0:+o,n.length)===n)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(a," ").concat(i(t,"type"));else{var l=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(a," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var n=r(69),i=r(73);r(6)(u,n);for(var o=a(i.prototype),s=0;s0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function f(){for(var e=[],t=0;t0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=n[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=m(l,u);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;a--)this.removeListener(e,t[a]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(7).Buffer)},function(e){e.exports=JSON.parse('{"i8":{"enum":["i8"]},"u8":{"enum":["u8"]},"i16":{"enum":["i16"]},"u16":{"enum":["u16"]},"i32":{"enum":["i32"]},"u32":{"enum":["u32"]},"f32":{"enum":["f32"]},"f64":{"enum":["f64"]},"li8":{"enum":["li8"]},"lu8":{"enum":["lu8"]},"li16":{"enum":["li16"]},"lu16":{"enum":["lu16"]},"li32":{"enum":["li32"]},"lu32":{"enum":["lu32"]},"lf32":{"enum":["lf32"]},"lf64":{"enum":["lf64"]},"i64":{"enum":["i64"]},"li64":{"enum":["li64"]},"u64":{"enum":["u64"]},"lu64":{"enum":["lu64"]}}')},function(e,t){e.exports=jQuery},function(e,t,r){"use strict";var a=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?c((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function o(e,t,r){return e.concat(t).map((function(e){return i(e,r)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function l(e,t){try{return t in e}catch(e){return!1}}function u(e,t,r){var a={};return r.isMergeableObject(e)&&s(e).forEach((function(t){a[t]=i(e[t],r)})),s(t).forEach((function(n){(function(e,t){return l(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,n)||(l(e,n)&&r.isMergeableObject(t[n])?a[n]=function(e,t){if(!t.customMerge)return c;var r=t.customMerge(e);return"function"==typeof r?r:c}(n,r)(e[n],t[n],r):a[n]=i(t[n],r))})),a}function c(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||a,r.cloneUnlessOtherwiseSpecified=i;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):u(e,t,r):i(t,r)}c.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return c(e,r,t)}),{})};var f=c;e.exports=f},function(module,exports,__webpack_require__){ +var a=r(107),n=r(108),i=r(54);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(a)return V(e).length;t=(""+t).toLowerCase(),a=!0}}function m(e,t,r){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function v(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function g(e,t,r,a,n){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,a)),l.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,n);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,a,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,a,n){var i,o=1,s=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,d=0;dn&&(a=n):a=n;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");a>i/2&&(a=i/2);for(var o=0;o>8,n=r%256,i.push(n),i.push(a);return i}(t,e.length-r),e,r,a)}function S(e,t,r){return 0===t&&r===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[n+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[n+1],o=e[n+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[n+1],o=e[n+2],s=e[n+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),n+=f}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var r="",a=0;for(;a0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,a,n){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(a>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(i,o),u=this.slice(a,n),c=e.slice(t,r),f=0;fn)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;na)&&(r=a);for(var n="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,a,n,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function R(e,t,r,a){t<0&&(t=65535+t+1);for(var n=0,i=Math.min(e.length-r,2);n>>8*(a?n:1-n)}function I(e,t,r,a){t<0&&(t=4294967295+t+1);for(var n=0,i=Math.min(e.length-r,4);n>>8*(a?n:3-n)&255}function N(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,a,i){return i||N(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function U(e,t,r,a,i){return i||N(e,0,r,8),n.write(e,t,r,a,52,8),r+8}l.prototype.slice=function(e,t){var r,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t0&&(n*=256);)a+=this[e+--t]*n;return a},l.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=this[e],n=1,i=0;++i=(n*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=t,n=1,i=this[e+--a];a>0&&(n*=256);)i+=this[e+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,a){(e=+e,t|=0,r|=0,a)||k(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+n]=e/i&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,a){if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return a.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,a){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,r(4))},function(e,t,r){"use strict";var a=r(0);function n(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),h=d.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&h===d.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor):v.set(0,0,0),g=1,y.set(0,0,0),!!(b||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,k=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),R=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,1),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var n=l.domElement===document?l.domElement.body:l.domElement;if(l.object instanceof a.PerspectiveCamera){var i=l.object.position;e.copy(i).sub(l.target);var o=e.length();o*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*o/n.clientHeight,l.object.matrix),R(2*r*o/n.clientHeight,l.object.matrix)}else l.object instanceof a.OrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),R(r*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object instanceof a.PerspectiveCamera?g/=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object instanceof a.PerspectiveCamera?g*=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(c),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}(e),h=d.TOUCH_DOLLY;break;case 3:if(!1===l.enablePan)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom)return;if(h!==d.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.subVectors(T,M),P.y>0?D(F()):P.y<0&&N(F()),M.copy(T),l.update()}(e);break;case 3:if(!1===l.enablePan)return;if(h!==d.TOUCH_PAN)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()}n.prototype=Object.create(a.EventDispatcher.prototype),n.prototype.constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var i=r(24),o=r(29),s=r.n(o),l=r(78),u=r.n(l),c=r(22),f=r(2);r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return m}));const d={showAxes:!1,showGrid:!1,autoResize:!1,controls:{enabled:!0,zoom:!0,rotate:!0,pan:!0,keys:!0},camera:{type:"perspective",x:20,y:35,z:20,target:[0,0,0]},canvas:{width:void 0,height:void 0},pauseHidden:!0,forceContext:!1,sendStats:!0};class h{constructor(e,t,r){this.element=r||document.body,this.options=Object.assign({},d,t,e),this.renderType="_Base_"}toImage(e,t){if(t||(t="image/png"),this._renderer){if(e){let e=document.createElement("canvas"),r=e.getContext("2d");return e.width=this._renderer.domElement.width,e.height=this._renderer.domElement.height,r.drawImage(this._renderer.domElement,0,0),Object(f.g)(e).toDataURL(t)}return this._renderer.domElement.toDataURL(t)}}toObj(){if(this._scene){return(new i.OBJExporter).parse(this._scene)}}toGLTF(e){return new Promise((t,r)=>{if(this._scene){(new i.GLTFExporter).parse(this._scene,e=>{t(e)},e)}else r()})}toPLY(e){if(this._scene){return(new i.PLYExporter).parse(this._scene,e)}}initScene(e,t){let r=this;if(console.log(" "),console.log("%c ","font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;"),console.log("MineRender/"+(r.renderType||r.constructor.name)+"/1.4.7"),console.log("PRODUCTION build"),console.log("Built @ 2021-02-01T16:31:09.617Z"),console.log(" "),r.options.sendStats){let e,t=!1;try{t=window.self!==window.top}catch(e){return!0}try{e=new URL(t?document.referrer:window.location).hostname}catch(e){console.warn("Failed to get hostname")}c.post({url:"https://minerender.org/stats.php",data:{action:"init",type:r.renderType,host:e,source:t?"iframe":"javascript"}})}let l,f=new a.Scene;r._scene=f,l="orthographic"===r.options.camera.type?new a.OrthographicCamera((r.options.canvas.width||window.innerWidth)/-2,(r.options.canvas.width||window.innerWidth)/2,(r.options.canvas.height||window.innerHeight)/2,(r.options.canvas.height||window.innerHeight)/-2,1,1e3):new a.PerspectiveCamera(75,(r.options.canvas.width||window.innerWidth)/(r.options.canvas.height||window.innerHeight),5,1e3),r._camera=l,r.options.camera.zoom&&(l.zoom=r.options.camera.zoom);let d=new a.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});r._renderer=d,d.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),d.setClearColor(0,0),d.setPixelRatio(window.devicePixelRatio),d.shadowMap.enabled=!0,d.shadowMap.type=a.PCFSoftShadowMap,r.element.appendChild(r._canvas=d.domElement);let h=new s.a(d);h.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),r._composer=h;let p=new i.SSAARenderPass(f,l);p.unbiased=!0,h.addPass(p);let m=new o.ShaderPass(o.CopyShader);m.renderToScreen=!0,h.addPass(m),r.options.autoResize&&(r._resizeListener=function(){let e=r.element&&r.element!==document.body?r.element.offsetWidth:window.innerWidth,t=r.element&&r.element!==document.body?r.element.offsetHeight:window.innerHeight;r._resize(e,t)},window.addEventListener("resize",r._resizeListener)),r._resize=function(e,t){"orthographic"===r.options.camera.type?(l.left=e/-2,l.right=e/2,l.top=t/2,l.bottom=t/-2):l.aspect=e/t,l.updateProjectionMatrix(),d.setSize(e,t),h.setSize(e,t)},r.options.showAxes&&f.add(new a.AxesHelper(50)),r.options.showGrid&&f.add(new a.GridHelper(100,100));let v=new a.AmbientLight(16777215);f.add(v);let g=new n(l,d.domElement);r._controls=g,g.enableZoom=r.options.controls.zoom,g.enableRotate=r.options.controls.rotate,g.enablePan=r.options.controls.pan,g.enableKeys=r.options.controls.keys,g.target.set(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]),l.position.x=r.options.camera.x,l.position.y=r.options.camera.y,l.position.z=r.options.camera.z,l.lookAt(new a.Vector3(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]));let y=function(){r._animId=requestAnimationFrame(y),r.onScreen&&("function"==typeof e&&e(),h.render())};r._animate=y,t||y(),r.onScreen=!0;let b="minerender-canvas-"+r._scene.uuid+"-"+Date.now();if(r._canvas.id=b,r.options.pauseHidden){r.onScreen=!1;let e=new u.a;r._onScreenObserver=e,e.on("enter","#"+b,(e,t)=>{r.onScreen=!0,r.options.forceContext&&r._renderer.forceContextRestore()}),e.on("leave","#"+b,(e,t)=>{r.onScreen=!1,r.options.forceContext&&r._renderer.forceContextLoss()})}}addToScene(e){let t=this;t._scene&&e&&(e.userData.renderType=t.renderType,t._scene.add(e))}clearScene(e,t){if(e||t)for(let r=this._scene.children.length-1;r>=0;r--){let a=this._scene.children[r];if(t){if(t(a))continue}e&&a.userData.renderType!==this.renderType||(p(a,!0),this._scene.remove(a))}else for(;this._scene.children.length>0;)this._scene.remove(this._scene.children[0])}dispose(){cancelAnimationFrame(this._animId),this._onScreenObserver&&this._onScreenObserver.destroy(),this.clearScene(),this._canvas.remove();let e=this.element;for(;e.firstChild;)e.removeChild(e.firstChild);this.options.autoResize&&window.removeEventListener("resize",this._resizeListener)}}function p(e,t){if(e&&(e.geometry&&e.geometry.dispose&&e.geometry.dispose(),e.material&&e.material.dispose&&e.material.dispose(),e.texture&&e.texture.dispose&&e.texture.dispose(),e.children)){let r=e.children;for(let e=0;e=0;t--)e.remove(r[t])}}function m(e,t){e=e.filter(e=>!!e);let r=new a.Geometry,n=[];for(let t=0;t=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}).call(this,r(5))},function(e,t,r){"use strict";var a=r(25),n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var i=r(20);i.inherits=r(6);var o=r(55),s=r(37);i.inherits(f,o);for(var l=n(s.prototype),u=0;un(e,t))}class s extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e,Error.captureStackTrace(this,this.constructor.name)}}e.exports={getField:r,getFieldInfo:a,addErrorField:n,getCount:function(e,t,{count:n,countType:i},s){let l=0,u=0;return"number"==typeof n?l=n:void 0!==n?l=r(n,s):void 0!==i?({size:u,value:l}=o(()=>this.read(e,t,a(i),s),"$count")):l=0,{count:l,size:u}},sendCount:function(e,t,r,{count:n,countType:i},o){return void 0!==n&&e!==n||void 0!==i&&(r=this.write(e,t,r,a(i),o)),r},calcCount:function(e,{count:t,countType:r},n){return void 0===t&&void 0!==r?o(()=>this.sizeOf(e,a(r),n),"$count"):0},tryCatch:i,tryDoc:o,PartialReadError:class extends s{constructor(e){super(e),this.partialReadError=!0}}}},function(e,t,r){"use strict";function a(e,t,r){var a=r?" !== ":" === ",n=r?" || ":" && ",i=r?"!":"",o=r?"":"!";switch(e){case"null":return t+a+"null";case"array":return i+"Array.isArray("+t+")";case"object":return"("+i+t+n+"typeof "+t+a+'"object"'+n+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+a+'"number"'+n+o+"("+t+" % 1)"+n+t+a+t+")";default:return"typeof "+t+a+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:a,checkDataTypes:function(e,t){switch(e.length){case 1:return a(e[0],t,!0);default:var r="",n=i(e);for(var o in n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)r+=(r?" && ":"")+a(o,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],a=0;a=t)throw new Error("Cannot access property/index "+a+" levels up, current level is "+t);return r[t-a]}if(a>t)throw new Error("Cannot access data "+a+" levels up, current level is "+t);if(i="data"+(t-a||""),!n)return i}for(var s=i,u=n.split("/"),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,n,o,s;if("string"==typeof t&&(n="not ",t.substr(!o||o<0?0:+o,n.length)===n)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(a," ").concat(i(t,"type"));else{var l=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(a," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var n=r(70),i=r(74);r(6)(u,n);for(var o=a(i.prototype),s=0;s0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function f(){for(var e=[],t=0;t0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=n[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=m(l,u);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;a--)this.removeListener(e,t[a]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(7).Buffer)},function(e){e.exports=JSON.parse('{"i8":{"enum":["i8"]},"u8":{"enum":["u8"]},"i16":{"enum":["i16"]},"u16":{"enum":["u16"]},"i32":{"enum":["i32"]},"u32":{"enum":["u32"]},"f32":{"enum":["f32"]},"f64":{"enum":["f64"]},"li8":{"enum":["li8"]},"lu8":{"enum":["lu8"]},"li16":{"enum":["li16"]},"lu16":{"enum":["lu16"]},"li32":{"enum":["li32"]},"lu32":{"enum":["lu32"]},"lf32":{"enum":["lf32"]},"lf64":{"enum":["lf64"]},"i64":{"enum":["i64"]},"li64":{"enum":["li64"]},"u64":{"enum":["u64"]},"lu64":{"enum":["lu64"]}}')},function(e,t){e.exports=jQuery},function(e,t,r){"use strict";var a=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?c((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function o(e,t,r){return e.concat(t).map((function(e){return i(e,r)}))}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function l(e,t){try{return t in e}catch(e){return!1}}function u(e,t,r){var a={};return r.isMergeableObject(e)&&s(e).forEach((function(t){a[t]=i(e[t],r)})),s(t).forEach((function(n){(function(e,t){return l(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,n)||(l(e,n)&&r.isMergeableObject(t[n])?a[n]=function(e,t){if(!t.customMerge)return c;var r=t.customMerge(e);return"function"==typeof r?r:c}(n,r)(e[n],t[n],r):a[n]=i(t[n],r))})),a}function c(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||o,r.isMergeableObject=r.isMergeableObject||a,r.cloneUnlessOtherwiseSpecified=i;var n=Array.isArray(t);return n===Array.isArray(e)?n?r.arrayMerge(e,t,r):u(e,t,r):i(t,r)}c.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return c(e,r,t)}),{})};var f=c;e.exports=f},function(module,exports,__webpack_require__){ /*! * The three.js expansion library v0.92.0 * Collected by Jusfoun Visualization Department @@ -28,24 +28,24 @@ var a=r(104),n=r(105),i=r(53);function o(){return l.TYPED_ARRAY_SUPPORT?21474836 * The three.js LICENSE * http://threejs.org/license */ -!function(e,t){for(var r in t)e[r]=t[r]}(exports,function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){e.exports=__webpack_require__(0)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1};Object.assign(a.prototype,{setSize:function(e,t){},render:function(e,t,r,a,n){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(1),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t){o.default.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof n.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=n.UniformsUtils.clone(e.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new n.Scene,this.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)}}),t.default=s},function(e,t,r){!function(e){"use strict";function t(){}function r(e,r){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===r||r,this.encoder=new t}function a(){}function n(){}t.prototype.s2u=function(e){for(var t=this.s2uTable,r="",a=0;a=0&&n<=126||n>=161&&n<=223)&&a0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},a.prototype={constructor:a,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],a=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=a}},n.prototype.parsePmd=function(e,t){var a,n={},i=new r(e);return n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left",function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),function(){var e,t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r0&&(a.englishModelName=i.getSjisStringsAsUnicode(20),a.englishComment=i.getSjisStringsAsUnicode(256)),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneNames=[];for(var t=0;t=2.0 are supported. Use LegacyGLTFLoader instead.")):(m.extensionsUsed&&(m.extensionsUsed.indexOf(r.KHR_LIGHTS)>=0&&(p[r.KHR_LIGHTS]=new i(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_UNLIT)>=0&&(p[r.KHR_MATERIALS_UNLIT]=new o(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(p[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new d),m.extensionsUsed.indexOf(r.KHR_DRACO_MESH_COMPRESSION)>=0&&(p[r.KHR_DRACO_MESH_COMPRESSION]=new f(this.dracoLoader)),m.extensionsUsed.indexOf(r.MSFT_TEXTURE_DDS)>=0&&(p[r.MSFT_TEXTURE_DDS]=new n)),new U(m,p,{path:t||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse((function(e,t,r,a,n){l({scene:e,scenes:t,cameras:r,animations:a,asset:n})}),u))}};var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(){if(!a.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=new a.DDSLoader}function i(e){this.name=r.KHR_LIGHTS,this.lights={};var t=(e.extensions&&e.extensions[r.KHR_LIGHTS]||{}).lights||{};for(var n in t){var i,o=t[n],s=(new a.Color).fromArray(o.color);switch(o.type){case"directional":(i=new a.DirectionalLight(s)).target.position.set(0,0,1),i.add(i.target);break;case"point":i=new a.PointLight(s);break;case"spot":i=new a.SpotLight(s),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;case"ambient":i=new a.AmbientLight(s)}i&&(i.decay=2,void 0!==o.intensity&&(i.intensity=o.intensity),i.name=o.name||"light_"+n,this.lights[n]=i)}}function o(e){this.name=r.KHR_MATERIALS_UNLIT}o.prototype.getMaterialType=function(e){return a.MeshBasicMaterial},o.prototype.extendParams=function(e,t,r){var n=[];e.color=new a.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var o=i.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture.index))}return Promise.all(n)};var s="glTF",l=12,u={JSON:1313821514,BIN:5130562};function c(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,l);if(this.header={magic:a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,l),i=0;i",s).replace("#include ",l).replace("#include ",u).replace("#include ",c).replace("#include ",f);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new a.Color).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=d,e.uniforms=o,e.defines={STANDARD:""},e.color=new a.Color(1,1,1),e.opacity=1;var h=[];if(Array.isArray(n.diffuseFactor)){var p=n.diffuseFactor;e.color.fromArray(p),e.opacity=p[3]}if(void 0!==n.diffuseTexture&&h.push(r.assignTexture(e,"map",n.diffuseTexture.index)),e.emissive=new a.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new a.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var m=n.specularGlossinessTexture.index;h.push(r.assignTexture(e,"glossinessMap",m)),h.push(r.assignTexture(e,"specularMap",m))}return Promise.all(h)},createMaterial:function(e){var t=new a.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var r=this.specularGlossinessParams,a=0,n=r.length;a=2&&(n[i+1]=e.getY(i)),r>=3&&(n[i+2]=e.getZ(i)),r>=4&&(n[i+3]=e.getW(i));return new a.BufferAttribute(n,r,e.normalized)}return e.clone()}function U(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new t,this.primitiveCache=[],this.textureLoader=new a.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function j(e,t,r){var a=t.attributes;for(var n in a){var i=T[n],o=r[a[n]];i&&(i in e.attributes||e.addAttribute(i,o))}void 0===t.indices||e.index||e.setIndex(r[t.indices])}return U.prototype.parse=function(e,t){var r=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then((function(t){var a=t.scenes||[],n=a[r.scene||0],i=t.animations||[],o=r.asset,s=t.cameras||[];e(n,a,s,i,o)})).catch(t)},U.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},i=0,o=t.length;i=2&&o.setY(T,A[E*l+1]),l>=3&&o.setZ(T,A[E*l+2]),l>=4&&o.setW(T,A[E*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},U.prototype.loadTexture=function(e){var t,n=this,i=this.json,o=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=i.textures[e],c=u.extensions||{},f=(t=c[r.MSFT_TEXTURE_DDS]?i.images[c[r.MSFT_TEXTURE_DDS].source]:i.images[u.source]).uri,d=!1;return void 0!==t.bufferView&&(f=n.getDependency("bufferView",t.bufferView).then((function(e){d=!0;var r=new Blob([e],{type:t.mimeType});return f=l.createObjectURL(r)}))),Promise.resolve(f).then((function(e){var t=a.Loader.Handlers.get(e);return t||(t=c[r.MSFT_TEXTURE_DDS]?n.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(r,a){t.load(k(e,o.path),r,void 0,a)}))})).then((function(e){!0===d&&l.revokeObjectURL(f),e.flipY=!1,void 0!==u.name&&(e.name=u.name),c[r.MSFT_TEXTURE_DDS]||(e.format=void 0!==u.format?E[u.format]:a.RGBAFormat),void 0!==u.internalFormat&&e.format!==E[u.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==u.type?S[u.type]:a.UnsignedByteType;var t=(i.samplers||{})[u.sampler]||{};return e.magFilter=_[t.magFilter]||a.LinearFilter,e.minFilter=_[t.minFilter]||a.LinearMipMapLinearFilter,e.wrapS=A[t.wrapS]||a.RepeatWrapping,e.wrapT=A[t.wrapT]||a.RepeatWrapping,e}))},U.prototype.assignTexture=function(e,t,r){return this.getDependency("texture",r).then((function(r){e[t]=r}))},U.prototype.loadMaterial=function(e){this.json;var t,n=this.extensions,i=this.json.materials[e],o={},s=i.extensions||{},l=[];if(s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(i),l.push(u.extendParams(o,i,this))}else if(s[r.KHR_MATERIALS_UNLIT]){var c=n[r.KHR_MATERIALS_UNLIT];t=c.getMaterialType(i),l.push(c.extendParams(o,i,this))}else{t=a.MeshStandardMaterial;var f=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(f.baseColorFactor)){var d=f.baseColorFactor;o.color.fromArray(d),o.opacity=d[3]}if(void 0!==f.baseColorTexture&&l.push(this.assignTexture(o,"map",f.baseColorTexture.index)),o.metalness=void 0!==f.metallicFactor?f.metallicFactor:1,o.roughness=void 0!==f.roughnessFactor?f.roughnessFactor:1,void 0!==f.metallicRoughnessTexture){var h=f.metallicRoughnessTexture.index;l.push(this.assignTexture(o,"metalnessMap",h)),l.push(this.assignTexture(o,"roughnessMap",h))}}!0===i.doubleSided&&(o.side=a.DoubleSide);var p=i.alphaMode||O;return p===C?o.transparent=!0:(o.transparent=!1,p===L&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"normalMap",i.normalTexture.index)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale&&o.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"aoMap",i.occlusionTexture.index)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==a.MeshBasicMaterial&&l.push(this.assignTexture(o,"emissiveMap",i.emissiveTexture.index)),Promise.all(l).then((function(){var e;return e=t===a.ShaderMaterial?n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==i.name&&(e.name=i.name),e.normalScale&&(e.normalScale.y=-e.normalScale.y),e.map&&(e.map.encoding=a.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=a.sRGBEncoding),i.extras&&(e.userData=i.extras),e}))},U.prototype.loadGeometries=function(e){var t=this,n=this.extensions,i=this.primitiveCache;return this.getDependencies("accessor").then((function(o){for(var s=[],l=0,u=e.length;l1))return _;_.name+="_"+c,s.add(_)}return s}))}))},U.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new a.PerspectiveCamera(a.Math.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new a.OrthographicCamera(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar)),void 0!==r.name&&(t.name=r.name),r.extras&&(t.userData=r.extras),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},U.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},U.prototype.loadAnimation=function(e){this.json;var t=this.json.animations[e];return this.getMultiDependencies(["accessor","node"]).then((function(r){for(var n=[],i=0,o=t.channels.length;i1&&(s.name+="_instance_"+i[o.mesh]++)}else if(void 0!==o.camera)s=e.cameras[o.camera];else if(o.extensions&&o.extensions[r.KHR_LIGHTS]&&void 0!==o.extensions[r.KHR_LIGHTS].light){s=t[r.KHR_LIGHTS].lights[o.extensions[r.KHR_LIGHTS].light]}else s=new a.Object3D;if(void 0!==o.name&&(s.name=a.PropertyBinding.sanitizeNodeName(o.name)),o.extras&&(s.userData=o.extras),void 0!==o.matrix){var d=new a.Matrix4;d.fromArray(o.matrix),s.applyMatrix(d)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return s}))},U.prototype.loadScene=function(){function e(t,r,n,i,o){var s=i[t],l=n.nodes[t];if(void 0!==l.skin)for(var u=!0===s.isGroup?s.children:[s],c=0,f=u.length;c(n=s.indexOf("\n"))&&i=e.byteLength||!(a=r(e)))return t(1,"no header found");if(!(n=a.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(u.valid|=1,u.programtype=n[1],u.string+=a+"\n";!1!==(a=r(e));)if(u.string+=a+"\n","#"!==a.charAt(0)){if((n=a.match(i))&&(u.gamma=parseFloat(n[1],10)),(n=a.match(o))&&(u.exposure=parseFloat(n[1],10)),(n=a.match(s))&&(u.valid|=2,u.format=n[1]),(n=a.match(l))&&(u.valid|=4,u.height=parseInt(n[1],10),u.width=parseInt(n[2],10)),2&u.valid&&4&u.valid)break}else u.comments+=a+"\n";return 2&u.valid?4&u.valid?u:t(3,"missing image size specifier"):t(3,"missing format specifier")}(n);if(-1!==i){var o=i.width,s=i.height,l=function(e,r,a){var n,i,o,s,l,u,c,f,d,h,p,m,v,g=r,y=a;if(g<8||g>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(g!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(n=new Uint8Array(4*r*a))||!n.length)return t(4,"unable to allocate buffer space");for(i=0,o=0,f=4*g,v=new Uint8Array(4),u=new Uint8Array(f);y>0&&oe.byteLength)return t(1);if(v[0]=e[o++],v[1]=e[o++],v[2]=e[o++],v[3]=e[o++],2!=v[0]||2!=v[1]||(v[2]<<8|v[3])!=g)return t(3,"bad rgbe scanline format");for(c=0;c128)&&(s-=128),0===s||c+s>f)return t(3,"bad scanline data");if(m)for(l=e[o++],d=0;d0){var x=[];for(var w in v)h=v[w],x[w]=h.name;m="Adding mesh(es) ("+x.length+": "+x+") from input mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)"}else m="Not adding mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)";var _=this.callbacks.onProgress;t.isValid(_)&&_(new CustomEvent("MeshBuilderEvent",{detail:{type:"progress",modelName:e.params.meshName,text:m,numericalValue:e.progress.numericalValue}}));return v},r.prototype.updateMaterials=function(e){var r,a,i=e.materials.materialCloneInstructions;if(t.isValid(i)){var o=i.materialNameOrg,s=this.materials[o];if(t.isValid(o)){r=s.clone(),a=i.materialName,r.name=a;var l=i.materialProperties;for(var u in l)r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&(r[u]=l[u]);this.materials[a]=r}else console.warn('Requested material "'+o+'" is not available!')}var c=e.materials.serializedMaterials;if(t.isValid(c)&&Object.keys(c).length>0){var f,d=new n.MaterialLoader;for(a in c)f=c[a],t.isValid(f)&&(r=d.parse(f),this.logging.enabled&&console.info('De-serialized material with name "'+a+'" will be added.'),this.materials[a]=r)}if(c=e.materials.runtimeMaterials,t.isValid(c)&&Object.keys(c).length>0)for(a in c)r=c[a],this.logging.enabled&&console.info('Material with name "'+a+'" will be added.'),this.materials[a]=r},r.prototype.getMaterialsJSON=function(){var e,t={};for(var r in this.materials)e=this.materials[r],t[r]=e.toJSON();return t},r.prototype.getMaterials=function(){return this.materials},r}(),s.WorkerRunnerRefImpl=function(){function e(){var e=this;self.addEventListener("message",(function(t){e.processMessage(t.data)}),!1)}return e.prototype.applyProperties=function(e,t){var r,a,n;for(r in t)a="set"+r.substring(0,1).toLocaleUpperCase()+r.substring(1),n=t[r],"function"==typeof e[a]?e[a](n):e.hasOwnProperty(r)&&(e[r]=n)},e.prototype.processMessage=function(e){if("run"===e.cmd){var t={callbackMeshBuilder:function(e){self.postMessage(e)},callbackProgress:function(t){e.logging.enabled&&e.logging.debug&&console.debug("WorkerRunner: progress: "+t)}},r=new Parser;"function"==typeof r.setLogging&&r.setLogging(e.logging.enabled,e.logging.debug),this.applyProperties(r,e.params),this.applyProperties(r,e.materials),this.applyProperties(r,t),r.workerScope=self,r.parse(e.data.input,e.data.options),e.logging.enabled&&console.log("WorkerRunner: Run complete!"),t.callbackMeshBuilder({cmd:"complete",msg:"WorkerRunner completed run."})}else console.error("WorkerRunner: Received unknown command: "+e.cmd)},e}(),s.WorkerSupport=function(){var e="2.2.0",t=s.Validator,r=function(){function e(){this._reset()}return e.prototype._reset=function(){this.logging={enabled:!0,debug:!1},this.worker=null,this.runnerImplName=null,this.callbacks={meshBuilder:null,onLoad:null},this.terminateRequested=!1,this.queuedMessage=null,this.started=!1,this.forceCopy=!1},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.setForceCopy=function(e){this.forceCopy=!0===e},e.prototype.initWorker=function(e,t){this.runnerImplName=t;var r=new Blob([e],{type:"application/javascript"});this.worker=new Worker(o.URL.createObjectURL(r)),this.worker.onmessage=this._receiveWorkerMessage,this.worker.runtimeRef=this,this._postMessage()},e.prototype._receiveWorkerMessage=function(e){var t=e.data;switch(t.cmd){case"meshData":case"materialData":case"imageData":this.runtimeRef.callbacks.meshBuilder(t);break;case"complete":this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run is complete. Terminating application on request!"),this.runtimeRef._terminate());break;case"error":console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Reported error: "+t.msg),this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run reported error. Terminating application on request!"),this.runtimeRef._terminate());break;default:console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Received unknown command: "+t.cmd)}},e.prototype.setCallbacks=function(e,r){this.callbacks.meshBuilder=t.verifyInput(e,this.callbacks.meshBuilder),this.callbacks.onLoad=t.verifyInput(r,this.callbacks.onLoad)},e.prototype.run=function(e){if(t.isValid(this.queuedMessage))console.warn("Already processing message. Rejecting new run instruction");else{if(this.queuedMessage=e,this.started=!0,!t.isValid(this.callbacks.meshBuilder))throw'Unable to run as no "MeshBuilder" callback is set.';if(!t.isValid(this.callbacks.onLoad))throw'Unable to run as no "onLoad" callback is set.';"run"!==e.cmd&&(e.cmd="run"),t.isValid(e.logging)?(e.logging.enabled=!0===e.logging.enabled,e.logging.debug=!0===e.logging.debug):e.logging={enabled:!0,debug:!1},this._postMessage()}},e.prototype._postMessage=function(){var e;t.isValid(this.queuedMessage)&&t.isValid(this.worker)&&(this.queuedMessage.data.input instanceof ArrayBuffer?(e=this.forceCopy?this.queuedMessage.data.input.slice(0):this.queuedMessage.data.input,this.worker.postMessage(this.queuedMessage,[e])):this.worker.postMessage(this.queuedMessage))},e.prototype.setTerminateRequested=function(e){this.terminateRequested=!0===e,this.terminateRequested&&t.isValid(this.worker)&&!t.isValid(this.queuedMessage)&&this.started&&(this.logging.enabled&&console.info("Worker is terminated immediately as it is not running!"),this._terminate())},e.prototype._terminate=function(){this.worker.terminate(),this._reset()},e}();function a(){if(console.info("Using THREE.LoaderSupport.WorkerSupport version: "+e),this.logging={enabled:!0,debug:!1},void 0===o.Worker)throw"This browser does not support web workers!";if(void 0===o.Blob)throw"This browser does not support Blob!";if("function"!=typeof o.URL.createObjectURL)throw"This browser does not support Object creation from URL!";this.loaderWorker=new r}a.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t,this.loaderWorker.setLogging(this.logging.enabled,this.logging.debug)},a.prototype.setForceWorkerDataCopy=function(e){this.loaderWorker.setForceCopy(e)},a.prototype.validate=function(e,r,a,o,u){if(!t.isValid(this.loaderWorker.worker)){this.logging.enabled&&(console.info("WorkerSupport: Building worker code..."),console.time("buildWebWorkerCode")),t.isValid(u)?this.logging.enabled&&console.info('WorkerSupport: Using "'+u.name+'" as Runner class for worker.'):(u=s.WorkerRunnerRefImpl,this.logging.enabled&&console.info('WorkerSupport: Using DEFAULT "THREE.LoaderSupport.WorkerRunnerRefImpl" as Runner class for worker.'));var c=e(i,l);c+="var Parser = "+r+";\n\n",c+=l(u.name,u),c+="new "+u.name+"();\n\n";var f=this;if(t.isValid(a)&&a.length>0){var d="";!function e(t,r){if(0===r.length)f.loaderWorker.initWorker(d+c,u.name),f.logging.enabled&&console.timeEnd("buildWebWorkerCode");else{var a=new n.FileLoader;a.setPath(t),a.setResponseType("text"),a.load(r[0],(function(a){d+=a,e(t,r)})),r.shift()}}(o,a)}else this.loaderWorker.initWorker(c,u.name),this.logging.enabled&&console.timeEnd("buildWebWorkerCode")}},a.prototype.setCallbacks=function(e,t){this.loaderWorker.setCallbacks(e,t)},a.prototype.run=function(e){this.loaderWorker.run(e)},a.prototype.setTerminateRequested=function(e){this.loaderWorker.setTerminateRequested(e)};var i=function(e,t){var r,a=e+" = {\n";for(var n in t)"string"==typeof(r=t[n])||r instanceof String?a+="\t"+n+': "'+(r=(r=r.replace("\n","\\n")).replace("\r","\\r"))+'",\n':r instanceof Array?a+="\t"+n+": ["+r+"],\n":Number.isInteger(r)?a+="\t"+n+": "+r+",\n":"function"==typeof r&&(a+="\t"+n+": "+r+",\n");return a+="}\n\n"},l=function(e,r,a,n,i){var o,s,l="",u=t.isValid(a)?a:r.name;for(var c in i=t.verifyInput(i,[]),r.prototype)o=r.prototype[c],"constructor"===c?s="\tfunction "+u+o.toString().replace("function","")+";\n\n":"function"==typeof o&&i.indexOf(c)<0&&(l+="\t"+u+".prototype."+c+" = "+o.toString()+";\n\n");l+="\treturn "+u+";\n",l+="})();\n\n";var f="";return t.isValid(n)&&(f+="\n",f+=u+".prototype = Object.create( "+n+".prototype );\n",f+=u+".constructor = "+u+";\n",f+="\n"),t.isValid(s)?l=e+" = (function () {\n\n"+f+s+l:(s=e+" = (function () {\n\n",l=(s+=f+"\t"+r.prototype.constructor.toString()+"\n\n")+l),l};return a}(),s.WorkerDirector=function(){var e="2.2.0",t=s.Validator,r=16,a=8192;function i(n){if(console.info("Using THREE.LoaderSupport.WorkerDirector version: "+e),this.logging={enabled:!0,debug:!1},this.maxQueueSize=a,this.maxWebWorkers=r,this.crossOrigin=null,!t.isValid(n))throw"Provided invalid classDef: "+n;this.workerDescription={classDef:n,globalCallbacks:{},workerSupports:{},forceWorkerDataCopy:!0},this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0,this.callbackOnFinishedProcessing=null}return i.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},i.prototype.getMaxQueueSize=function(){return this.maxQueueSize},i.prototype.getMaxWebWorkers=function(){return this.maxWebWorkers},i.prototype.setCrossOrigin=function(e){this.crossOrigin=e},i.prototype.setForceWorkerDataCopy=function(e){this.workerDescription.forceWorkerDataCopy=!0===e},i.prototype.prepareWorkers=function(e,i,o){t.isValid(e)&&(this.workerDescription.globalCallbacks=e),this.maxQueueSize=Math.min(i,a),this.maxWebWorkers=Math.min(o,r),this.maxWebWorkers=Math.min(this.maxWebWorkers,this.maxQueueSize),this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0;for(var s=0;s0&&this.instructionQueuePointer0},i.prototype.processQueue=function(){var e,t;for(var r in this.workerDescription.workerSupports)(t=this.workerDescription.workerSupports[r]).inUse||(this.instructionQueuePointer=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},i[c]=r;else if(r)if("ka"===u||"kd"===u||"ks"===u){var f=c.split(a,3);r[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else r[u]=c}}var d=new n.MaterialCreator(this.texturePath||this.path,this.materialOptions);return d.setCrossOrigin(this.crossOrigin),d.setManager(this.manager),d.setMaterials(i),d}},(n.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:a.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:a.RepeatWrapping}).prototype={constructor:n.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var r in e){var a=e[r],n={};for(var i in t[r]=n,a){var o=!0,s=a[i],l=i.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(n[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,r=this.materialsInfo[e],n={name:e,side:this.side};function i(e,r){if(!n[e]){var a,i,o=t.getTextureParams(r,n),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(i=o.url)||""===i?"":/^https?:\/\//i.test(i)?i:a+i));s.repeat.copy(o.scale),s.offset.copy(o.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,n[e]=s}}for(var o in r){var s,l=r[o];if(""!==l)switch(o.toLowerCase()){case"kd":n.color=(new a.Color).fromArray(l);break;case"ks":n.specular=(new a.Color).fromArray(l);break;case"map_kd":i("map",l);break;case"map_ks":i("specularMap",l);break;case"norm":i("normalMap",l);break;case"map_bump":case"bump":i("bumpMap",l);break;case"ns":n.shininess=parseFloat(l);break;case"d":(s=parseFloat(l))<1&&(n.opacity=s,n.transparent=!0);break;case"tr":s=parseFloat(l),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var r,n={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},i=e.split(/\s+/);return(r=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),(r=i.indexOf("-s"))>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),(r=i.indexOf("-o"))>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n},loadTexture:function(e,t,r,n,i){var o,s=a.Loader.Handlers.get(e),l=void 0!==this.manager?this.manager:a.DefaultLoadingManager;return null===s&&(s=new a.TextureLoader(l)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,r,n,i),void 0!==t&&(o.mapping=t),o}},t.default=n},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _three=__webpack_require__(0),THREE=_interopRequireWildcard(_three);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var Volume=function(e,t,r,a,n){if(arguments.length>0){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,a){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(n);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(n);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(n);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(n);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(n);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(n);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw"Error in THREE.Volume constructor : this type is not supported in JavaScript";case"Float32":case"float32":case"float":this.data=new Float32Array(n);break;case"Float64":case"float64":case"double":this.data=new Float64Array(n);break;default:this.data=new Uint8Array(n)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw"Error in THREE.Volume constructor, lengths are not matching arrayBuffer size"}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new THREE.Matrix3,this.matrix.identity();var i=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return i},set:function(e){i=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});var o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[]};Volume.prototype={constructor:Volume,getData:function(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]},access:function(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e},reverseAccess:function(e){var t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]},map:function(e,t){var r=this.data.length;t=t||this;for(var a=0;a.9})),jDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[1]))>.9})),kDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[2]))>.9})),argumentsWithInversion=["volume.xLength-1-","volume.yLength-1-","volume.zLength-1-"],argArray=[iDirection,jDirection,kDirection].map((function(e,t){return(e.dot(base[t])>0?"":argumentsWithInversion[t])+(e===axisInIJK?"IJKIndex":e.argVar)})),argString=argArray.join(",");return sliceAccess=eval("(function sliceAccess (i,j) {return volume.access( "+argString+");})"),{iLength:iLength,jLength:jLength,sliceAccess:sliceAccess,matrix:planeMatrix,planeWidth:planeWidth,planeHeight:planeHeight}},extractSlice:function(e,t){var r=new THREE.VolumeSlice(this,t,e);return this.sliceList.push(r),r},repaintAllSlices:function(){return this.sliceList.forEach((function(e){e.repaint()})),this},computeMinMax:function(){var e=1/0,t=-1/0,r=this.data.length,a=0;for(a=0;a","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","float l = linearToRelativeLuminance( texel.rgb );","gl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","uniform sampler2D luminanceMap;","#else","uniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","#ifdef ADAPTED_LUMINANCE","float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","#else","float fLumAvg = averageLuminance;","#endif","float fLumPixel = linearToRelativeLuminance( vColor );","float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","return fLumCompressed * vColor;","}","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-e*e/(2*t*t))}var r,a,n,i,o=2*Math.ceil(3*e)+1;for(o>25&&(o=25),i=.5*(o-1),a=new Array(o),n=0,r=0;r","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","vec2 aspectcorrect = vec2( 1.0, aspect );","float viewZ = getViewZ( getDepth( vUv ) );","float factor = ( focus + viewZ );","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},tSize:{value:new a.Vector2(256,256)},center:{value:new a.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float dx = rand( vUv + time );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","if(byp<1) {","vec2 p = vUv;","float xs = floor(gl_FragCoord.x / 0.5);","float ys = floor(gl_FragCoord.y / 0.5);","vec4 normal = texture2D (tDisp, p*seed*seed);","if(p.ydistortion_x-col_s*seed) {","if(seed_x>0.){","p.y = 1. - (p.y + distortion_y);","}","else {","p.y = distortion_y;","}","}","if(p.xdistortion_y-col_s*seed) {","if(seed_y>0.){","p.x=distortion_x;","}","else {","p.x = 1. - (p.x + distortion_x);","}","}","p.x+=normal.x*seed_x*(seed/5.);","p.y+=normal.y*seed_y*(seed/5.);","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, p + offset);","vec4 cga = texture2D(tDiffuse, p);","vec4 cb = texture2D(tDiffuse, p - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","gl_FragColor = gl_FragColor+ snow;","}","else {","gl_FragColor=texture2D (tDiffuse, vUv);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","vUV = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","return a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","return sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","float dist = hypot( coord.x - p.x, coord.y - p.y );","float rad = channel;","if ( shape == SHAPE_DOT ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","} else if ( shape == SHAPE_ELLIPSE ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","if ( dist != 0.0 ) {","float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","}","} else if ( shape == SHAPE_LINE ) {","rad = pow( abs( rad ), 1.5) * rad_max;","float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","dist = hypot( normal.x * dot_p, normal.y * dot_p );","} else if ( shape == SHAPE_SQUARE ) {","float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","float sin_t = abs( sin( theta ) );","float cos_t = abs( cos( theta ) );","rad = pow( abs( rad ), 1.4 );","rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","}","return rad - dist;","}","struct Cell {","vec2 normal;","vec2 p1;","vec2 p2;","vec2 p3;","vec2 p4;","float samp2;","float samp1;","float samp3;","float samp4;","};","vec4 getSample( vec2 point ) {","vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","float step = PI2 / float( samples );","float dist = radius * 0.66;","for ( int i = 0; i < samples; ++i ) {","float r = base + step * float( i );","vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","}","tex /= float( samples ) + 1.0;","return tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","if ( channel == 0 ) {","c.samp1 = getSample( c.p1 ).r;","c.samp2 = getSample( c.p2 ).r;","c.samp3 = getSample( c.p3 ).r;","c.samp4 = getSample( c.p4 ).r;","} else if (channel == 1) {","c.samp1 = getSample( c.p1 ).g;","c.samp2 = getSample( c.p2 ).g;","c.samp3 = getSample( c.p3 ).g;","c.samp4 = getSample( c.p4 ).g;","} else {","c.samp1 = getSample( c.p1 ).b;","c.samp3 = getSample( c.p3 ).b;","c.samp2 = getSample( c.p2 ).b;","c.samp4 = getSample( c.p4 ).b;","}","dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","res = clamp( res, 0.0, 1.0 );","return res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","Cell c;","vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","float threshold = step * 0.5;","float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","float offset_normal = mod( hypot( offset.x, offset.y ), step );","float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","c.normal = n;","c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","if ( scatter != 0.0 ) {","float off_mag = scatter * threshold * 0.5;","float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","c.p1.x += cos( off_angle ) * off_mag;","c.p1.y += sin( off_angle ) * off_mag;","}","float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","c.p2.x = c.p1.x - n.x * normal_step;","c.p2.y = c.p1.y - n.y * normal_step;","c.p3.x = c.p1.x + n.y * line_step;","c.p3.y = c.p1.y - n.x * line_step;","c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","return c;","}","float blendColour( float a, float b, float t ) {","if ( blendingMode == BLENDING_LINEAR ) {","return blend( a, b, 1.0 - t );","} else if ( blendingMode == BLENDING_ADD ) {","return blend( a, min( 1.0, a + b ), t );","} else if ( blendingMode == BLENDING_MULTIPLY ) {","return blend( a, max( 0.0, a * b ), t );","} else if ( blendingMode == BLENDING_LIGHTER ) {","return blend( a, max( a, b ), t );","} else if ( blendingMode == BLENDING_DARKER ) {","return blend( a, min( a, b ), t );","} else {","return blend( a, b, 1.0 - t );","}","}","void main() {","if ( ! disable ) {","vec2 p = vec2( vUV.x * width, vUV.y * height );","vec2 origin = vec2( 0, 0 );","float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","Cell cell_r = getReferenceCell( p, origin, rotateR, radius );","Cell cell_g = getReferenceCell( p, origin, rotateG, radius );","Cell cell_b = getReferenceCell( p, origin, rotateB, radius );","float r = getDotColour( cell_r, p, 0, rotateR, aa );","float g = getDotColour( cell_g, p, 1, rotateG, aa );","float b = getDotColour( cell_b, p, 2, rotateB, aa );","vec4 colour = texture2D( tDiffuse, vUV );","r = blendColour( r, colour.r, blending );","g = blendColour( g, colour.g, blending );","b = blendColour( b, colour.b, blending );","if ( greyscale ) {","r = g = b = (r + b + g) / 3.0;","}","gl_FragColor = vec4( r, g, b, 1.0 );","} else {","gl_FragColor = texture2D( tDiffuse, vUV );","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{type:"t",value:null},tDiffuse:{type:"t",value:null},tNormal:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},cameraProjectionMatrix:{type:"m4",value:new a.Matrix4},cameraInverseProjectionMatrix:{type:"m4",value:new a.Matrix4},scale:{type:"f",value:1},intensity:{type:"f",value:.1},bias:{type:"f",value:.5},minResolution:{type:"f",value:0},kernelRadius:{type:"f",value:100},randomSeed:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},sampleUvOffsets:{type:"v2v",value:[new a.Vector2(0,0)]},sampleWeights:{type:"1fv",value:[1]},tDepth:{type:"t",value:null},cameraNear:{type:"f",value:10},cameraFar:{type:"f",value:1e3},depthCutoff:{type:"f",value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","float depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={createSampleWeights:function(e,t){for(var r=function(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)},a=[],n=0;n<=e;n++)a.push(r(n,t));return a},createSampleOffsets:function(e,t){for(var r=[],a=0;a<=e;a++)r.push(t.clone().multiplyScalar(a));return r},configure:function(e,t,r,n){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=a.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=a.createSampleWeights(t,r),e.needsUpdate=!0}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","t = abs( C - Ctop );","delta.y = max( max( t.r, t.g ), t.b );","vec2 edges = step( threshold, delta.xy );","if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){n.default.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==o?o:0,void 0===i.default&&console.error("THREE.SSAARenderPass relies on THREE.CopyShader");var s=i.default;this.copyUniforms=a.UniformsUtils.clone(s.uniforms),this.copyMaterial=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.camera2=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene2=new a.Scene,this.quad2=new a.Mesh(new a.PlaneBufferGeometry(2,2),this.copyMaterial),this.quad2.frustumCulled=!1,this.scene2.add(this.quad2)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var n=s.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1;var o=e.getClearColor().getHex(),l=e.getClearAlpha(),u=1/n.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;for(var c=r.width,f=r.height,d=0;d","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );","float gg = fract( coord.t * ( size.y / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float readDepth( const in vec2 coord ) {","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","#ifdef USE_LOGDEPTHBUF","float logz = unpackRGBAToDepth( texture2D( tDepth, coord ) );","float w = pow(2.0, (logz / logDepthBufFC)) - 1.0;","float z = (logz / w) + 1.0;","#else","float z = unpackRGBAToDepth( texture2D( tDepth, coord ) );","#endif","return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 8.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + radius * vv;","vec2 coord2 = vUv - radius * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float ao = 0.0;","float dz = 1.0 / float( samples );","float l = 0.0;","float z = 1.0 - dz / 2.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","float pw = cos( l ) * r;","float ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{type:"t",value:null},luminosityThreshold:{type:"f",value:1},smoothWidth:{type:"f",value:1},defaultColor:{type:"c",value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(0)},defaultOpacity:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","gl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var n=r(40);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}));var i=r(48);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}));var o=r(90);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}));var s=r(112);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})}));var l=r(144);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VRControls=t.TransformControls=t.TrackballControls=t.PointerLockControls=t.OrthographicTrackballControls=t.OrbitControls=t.FlyControls=t.FirstPersonControls=t.EditorControls=t.DragControls=t.DeviceOrientationControls=void 0;var a=p(r(29)),n=p(r(30)),i=p(r(31)),o=p(r(32)),s=p(r(33)),l=p(r(34)),u=p(r(35)),c=p(r(36)),f=p(r(37)),d=p(r(38)),h=p(r(39));function p(e){return e&&e.__esModule?e:{default:e}}t.DeviceOrientationControls=a.default,t.DragControls=n.default,t.EditorControls=i.default,t.FirstPersonControls=o.default,t.FlyControls=s.default,t.OrbitControls=l.default,t.OrthographicTrackballControls=u.default,t.PointerLockControls=c.default,t.TrackballControls=f.default,t.TransformControls=d.default,t.VRControls=h.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r,n,i,o,s=function(e){t.deviceOrientation=e},l=function(){t.screenOrientation=window.orientation||0},u=(r=new a.Vector3(0,0,1),n=new a.Euler,i=new a.Quaternion,o=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),function(e,t,a,s,l){n.set(a,t,-s,"YXZ"),e.setFromEuler(n),e.multiply(o),e.multiply(i.setFromAxisAngle(r,-l))});this.connect=function(){l(),window.addEventListener("orientationchange",l,!1),window.addEventListener("deviceorientation",s,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",l,!1),window.removeEventListener("deviceorientation",s,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var r=e.alpha?a.Math.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?a.Math.degToRad(e.beta):0,i=e.gamma?a.Math.degToRad(e.gamma):0,o=t.screenOrientation?a.Math.degToRad(t.screenOrientation):0;u(t.object.quaternion,r,n,i,o)}}},this.dispose=function(){t.disconnect()},this.connect()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t,r){if(e instanceof a.Camera){console.warn("THREE.DragControls: Constructor now expects ( objects, camera, domElement )");var n=e;e=t,t=n}var i=new a.Plane,o=new a.Raycaster,s=new a.Vector2,l=new a.Vector3,u=new a.Vector3,c=null,f=null,d=this;function h(){r.addEventListener("mousemove",m,!1),r.addEventListener("mousedown",v,!1),r.addEventListener("mouseup",g,!1),r.addEventListener("mouseleave",g,!1),r.addEventListener("touchmove",y,!1),r.addEventListener("touchstart",b,!1),r.addEventListener("touchend",w,!1)}function p(){r.removeEventListener("mousemove",m,!1),r.removeEventListener("mousedown",v,!1),r.removeEventListener("mouseup",g,!1),r.removeEventListener("mouseleave",g,!1),r.removeEventListener("touchmove",y,!1),r.removeEventListener("touchstart",b,!1),r.removeEventListener("touchend",w,!1)}function m(a){a.preventDefault();var n=r.getBoundingClientRect();if(s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c});o.setFromCamera(s,t);var h=o.intersectObjects(e);if(h.length>0){var p=h[0].object;i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),p.position),f!==p&&(d.dispatchEvent({type:"hoveron",object:p}),r.style.cursor="pointer",f=p)}else null!==f&&(d.dispatchEvent({type:"hoveroff",object:f}),r.style.cursor="auto",f=null)}function v(a){a.preventDefault(),o.setFromCamera(s,t);var n=o.intersectObjects(e);n.length>0&&(c=n[0].object,o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function g(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}function y(e){e.preventDefault(),e=e.changedTouches[0];var a=r.getBoundingClientRect();if(s.x=(e.clientX-a.left)/a.width*2-1,s.y=-(e.clientY-a.top)/a.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c})}function b(a){a.preventDefault(),a=a.changedTouches[0];var n=r.getBoundingClientRect();s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t);var f=o.intersectObjects(e);f.length>0&&(c=f[0].object,i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),c.position),o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function w(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}h(),this.enabled=!0,this.activate=h,this.deactivate=p,this.dispose=function(){p()},this.setObjects=function(){console.error("THREE.DragControls: setObjects() has been removed.")},this.on=function(e,t){console.warn("THREE.DragControls: on() has been deprecated. Use addEventListener() instead."),d.addEventListener(e,t)},this.off=function(e,t){console.warn("THREE.DragControls: off() has been deprecated. Use removeEventListener() instead."),d.removeEventListener(e,t)},this.notify=function(e){console.error("THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead."),d.dispatchEvent({type:e})}};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){t=void 0!==t?t:document,this.enabled=!0,this.center=new a.Vector3,this.panSpeed=.001,this.zoomSpeed=.001,this.rotationSpeed=.005;var r=this,n=new a.Vector3,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2},o=i.NONE,s=this.center,l=new a.Matrix3,u=new a.Vector2,c=new a.Vector2,f=new a.Spherical,d={type:"change"};function h(e){!1!==r.enabled&&(0===e.button?o=i.ROTATE:1===e.button?o=i.ZOOM:2===e.button&&(o=i.PAN),c.set(e.clientX,e.clientY),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",m,!1),t.addEventListener("mouseout",m,!1),t.addEventListener("dblclick",m,!1))}function p(e){if(!1!==r.enabled){u.set(e.clientX,e.clientY);var t=u.x-c.x,n=u.y-c.y;o===i.ROTATE?r.rotate(new a.Vector3(-t*r.rotationSpeed,-n*r.rotationSpeed,0)):o===i.ZOOM?r.zoom(new a.Vector3(0,0,n)):o===i.PAN&&r.pan(new a.Vector3(-t,n,0)),c.set(e.clientX,e.clientY)}}function m(e){t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),o=i.NONE}function v(e){e.preventDefault(),r.zoom(new a.Vector3(0,0,e.deltaY))}function g(e){e.preventDefault()}this.focus=function(t){var n,i=(new a.Box3).setFromObject(t);!1===i.isEmpty()?(s.copy(i.getCenter()),n=i.getBoundingSphere().radius):(s.setFromMatrixPosition(t.matrixWorld),n=.1);var o=new a.Vector3(0,0,1);o.applyQuaternion(e.quaternion),o.multiplyScalar(4*n),e.position.copy(s).add(o),r.dispatchEvent(d)},this.pan=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.panSpeed),t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),s.add(t),r.dispatchEvent(d)},this.zoom=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.zoomSpeed),t.length()>a||(t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),r.dispatchEvent(d))},this.rotate=function(t){n.copy(e.position).sub(s),f.setFromVector3(n),f.theta+=t.x,f.phi+=t.y,f.makeSafe(),n.setFromSpherical(f),e.position.copy(s).add(n),e.lookAt(s),r.dispatchEvent(d)},this.dispose=function(){t.removeEventListener("contextmenu",g,!1),t.removeEventListener("mousedown",h,!1),t.removeEventListener("wheel",v,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),t.removeEventListener("touchstart",x,!1),t.removeEventListener("touchmove",_,!1)},t.addEventListener("contextmenu",g,!1),t.addEventListener("mousedown",h,!1),t.addEventListener("wheel",v,!1);var y=[new a.Vector3,new a.Vector3,new a.Vector3],b=[new a.Vector3,new a.Vector3,new a.Vector3],w=null;function x(e){if(!1!==r.enabled){switch(e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0);break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0),w=y[0].distanceTo(y[1])}b[0].copy(y[0]),b[1].copy(y[1])}}function _(e){if(!1!==r.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0),r.rotate(y[0].sub(o(y[0],b)).multiplyScalar(-r.rotationSpeed));break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0);var t=y[0].distanceTo(y[1]);r.zoom(new a.Vector3(0,0,w-t)),w=t;var n=y[0].clone().sub(o(y[0],b)),i=y[1].clone().sub(o(y[1],b));n.x=-n.x,i.x=-i.x,r.pan(n.add(i).multiplyScalar(.5))}b[0].copy(y[0]),b[1].copy(y[1])}function o(e,t){var r=t[0];for(var a in t)r.distanceTo(e)>t[a].distanceTo(e)&&(r=t[a]);return r}}t.addEventListener("touchstart",x,!1),t.addEventListener("touchmove",_,!1)};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e){e.preventDefault()}this.object=e,this.target=new a.Vector3(0,0,0),this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.lookSpeed=.005,this.lookVertical=!0,this.autoForward=!1,this.activeLook=!0,this.heightSpeed=!1,this.heightCoef=1,this.heightMin=0,this.heightMax=1,this.constrainVertical=!1,this.verticalMin=0,this.verticalMax=Math.PI,this.autoSpeedFactor=0,this.mouseX=0,this.mouseY=0,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.moveForward=!1,this.moveBackward=!1,this.moveLeft=!1,this.moveRight=!1,this.mouseDragOn=!1,this.viewHalfX=0,this.viewHalfY=0,this.domElement!==document&&this.domElement.setAttribute("tabindex",-1),this.handleResize=function(){this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)},this.onMouseDown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0},this.onMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1},this.onMouseMove=function(e){this.domElement===document?(this.mouseX=e.pageX-this.viewHalfX,this.mouseY=e.pageY-this.viewHalfY):(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)},this.onKeyDown=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0}},this.onKeyUp=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}},this.update=function(e){if(!1!==this.enabled){if(this.heightSpeed){var t=a.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;var r=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(r+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(r),this.moveLeft&&this.object.translateX(-r),this.moveRight&&this.object.translateX(r),this.moveUp&&this.object.translateY(r),this.moveDown&&this.object.translateY(-r);var n=e*this.lookSpeed;this.activeLook||(n=0);var i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon+=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*i),this.lat=Math.max(-85,Math.min(85,this.lat)),this.phi=a.Math.degToRad(90-this.lat),this.theta=a.Math.degToRad(this.lon),this.constrainVertical&&(this.phi=a.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax));var o=this.target,s=this.object.position;o.x=s.x+100*Math.sin(this.phi)*Math.cos(this.theta),o.y=s.y+100*Math.cos(this.phi),o.z=s.z+100*Math.sin(this.phi)*Math.sin(this.theta),this.object.lookAt(o)}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",r,!1),this.domElement.removeEventListener("mousedown",i,!1),this.domElement.removeEventListener("mousemove",n,!1),this.domElement.removeEventListener("mouseup",o,!1),window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",l,!1)};var n=u(this,this.onMouseMove),i=u(this,this.onMouseDown),o=u(this,this.onMouseUp),s=u(this,this.onKeyDown),l=u(this,this.onKeyUp);function u(e,t){return function(){t.apply(e,arguments)}}this.domElement.addEventListener("contextmenu",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mouseup",o,!1),window.addEventListener("keydown",s,!1),window.addEventListener("keyup",l,!1),this.handleResize()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e,t){return function(){t.apply(e,arguments)}}function n(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this.tmpQuaternion=new a.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new a.Vector3(0,0,0),this.rotationVector=new a.Vector3(0,0,0),this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)},this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),r=t.size[0]/2,a=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-a)/a,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){var t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order)},this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",n,!1),this.domElement.removeEventListener("mousedown",o,!1),this.domElement.removeEventListener("mousemove",i,!1),this.domElement.removeEventListener("mouseup",s,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",u,!1)};var i=r(this,this.mousemove),o=r(this,this.mousedown),s=r(this,this.mouseup),l=r(this,this.keydown),u=r(this,this.keyup);this.domElement.addEventListener("contextmenu",n,!1),this.domElement.addEventListener("mousemove",i,!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mouseup",s,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",u,!1),this.updateMovementVector(),this.updateRotationVector()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),h=d.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&h===d.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),y.set(0,0,0)),g=1,!!(b||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,k=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),R=function(){var e=new a.Vector3;return function(t,r){!0===l.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var a=l.domElement===document?l.domElement.body:l.domElement;if(l.object.isPerspectiveCamera){var n=l.object.position;e.copy(n).sub(l.target);var i=e.length();i*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*i/a.clientHeight,l.object.matrix),R(2*r*i/a.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/a.clientWidth,l.object.matrix),R(r*(l.object.top-l.object.bottom)/l.object.zoom/a.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object.isPerspectiveCamera?g/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object.isPerspectiveCamera?g*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(c),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);A.set(n,i)}}(e),h=d.TOUCH_DOLLY_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;if(h!==d.TOUCH_DOLLY_PAN)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.set(0,Math.pow(T.y/M.y,l.zoomSpeed)),N(P.y),M.copy(T)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);E.set(n,i),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E)}l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.radius=0,this.rotateSpeed=1,this.zoomSpeed=1.2,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.keys=[65,83,68],this.target=new a.Vector3;var i=!0,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector3,c=new a.Vector3,f=new a.Vector2,d=new a.Vector2,h=0,p=0,m=new a.Vector2,v=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom;var g={type:"change"},y={type:"start"},b={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}this.radius=.5*Math.min(this.screen.width,this.screen.height),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var w,x,_,A,E,S,M=(w=new a.Vector2,function(e,t){return w.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),w}),T=function(){var e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(a,i){n.set((a-.5*r.screen.width-r.screen.left)/r.radius,(.5*r.screen.height+r.screen.top-i)/r.radius,0);var o=n.length();return r.noRoll?o1?n.normalize():n.z=Math.sqrt(1-o*o),l.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(n.y),e.add(t.copy(r.object.up).cross(l).setLength(n.x)),e.add(l.setLength(n.z)),e}}();function P(e){!1!==r.enabled&&(window.removeEventListener("keydown",P),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function F(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",P,!1))}function O(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(m.copy(M(e.pageX,e.pageY)),v.copy(m)):(f.copy(M(e.pageX,e.pageY)),d.copy(f)):(u.copy(T(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",L,!1),document.addEventListener("mouseup",C,!1),r.dispatchEvent(y))}function L(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||v.copy(M(e.pageX,e.pageY)):d.copy(M(e.pageX,e.pageY)):c.copy(T(e.pageX,e.pageY)))}function C(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",C),r.dispatchEvent(b))}function k(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),f.y+=.01*e.deltaY,r.dispatchEvent(y),r.dispatchEvent(b))}function R(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,u.copy(T(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;case 2:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=h=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(M(i,s)),v.copy(m);break;default:o=n.NONE}r.dispatchEvent(y)}}function I(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(i,s));break;default:o=n.NONE}}function N(e){if(!1!==r.enabled){switch(e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;case 2:h=p=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,a=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(t,a)),m.copy(v)}o=n.NONE,r.dispatchEvent(b)}}function D(e){e.preventDefault()}this.rotateCamera=(x=new a.Vector3,_=new a.Quaternion,function(){var e=Math.acos(u.dot(c)/u.length()/c.length());e&&(x.crossVectors(u,c).normalize(),e*=r.rotateSpeed,_.setFromAxisAngle(x,-e),l.applyQuaternion(_),r.object.up.applyQuaternion(_),c.applyQuaternion(_),r.staticMoving?u.copy(c):(_.setFromAxisAngle(x,e*(r.dynamicDampingFactor-1)),u.applyQuaternion(_)),i=!0)}),this.zoomCamera=function(){if(o===n.TOUCH_ZOOM_PAN){var e=p/h;h=p,r.object.zoom*=e,i=!0}else{e=1+(d.y-f.y)*r.zoomSpeed;Math.abs(e-1)>1e-6&&e>0&&(r.object.zoom/=e,r.staticMoving?f.copy(d):f.y+=(d.y-f.y)*this.dynamicDampingFactor,i=!0)}},this.panCamera=(A=new a.Vector2,E=new a.Vector3,S=new a.Vector3,function(){if(A.copy(v).sub(m),A.lengthSq()){var e=(r.object.right-r.object.left)/r.object.zoom,t=(r.object.top-r.object.bottom)/r.object.zoom;A.x*=e,A.y*=t,S.copy(l).cross(r.object.up).setLength(A.x),S.add(E.copy(r.object.up).setLength(A.y)),r.object.position.add(S),r.target.add(S),r.staticMoving?m.copy(v):m.add(A.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)),i=!0}}),this.update=function(){l.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||(r.zoomCamera(),i&&r.object.updateProjectionMatrix()),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,l),r.object.lookAt(r.target),i&&(r.dispatchEvent(g),i=!1)},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.left=r.left0,r.object.right=r.right0,r.object.top=r.top0,r.object.bottom=r.bottom0,r.object.lookAt(r.target),r.dispatchEvent(g),i=!1},this.dispose=function(){this.domElement.removeEventListener("contextmenu",D,!1),this.domElement.removeEventListener("mousedown",O,!1),this.domElement.removeEventListener("wheel",k,!1),this.domElement.removeEventListener("touchstart",R,!1),this.domElement.removeEventListener("touchend",N,!1),this.domElement.removeEventListener("touchmove",I,!1),document.removeEventListener("mousemove",L,!1),document.removeEventListener("mouseup",C,!1),window.removeEventListener("keydown",P,!1),window.removeEventListener("keyup",F,!1)},this.domElement.addEventListener("contextmenu",D,!1),this.domElement.addEventListener("mousedown",O,!1),this.domElement.addEventListener("wheel",k,!1),this.domElement.addEventListener("touchstart",R,!1),this.domElement.addEventListener("touchend",N,!1),this.domElement.addEventListener("touchmove",I,!1),window.addEventListener("keydown",P,!1),window.addEventListener("keyup",F,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;e.rotation.set(0,0,0);var r=new a.Object3D;r.add(e);var n=new a.Object3D;n.position.y=10,n.add(r);var i,o,s=Math.PI/2,l=function(e){if(!1!==t.enabled){var a=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;n.rotation.y-=.002*a,r.rotation.x-=.002*i,r.rotation.x=Math.max(-s,Math.min(s,r.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",l,!1)},document.addEventListener("mousemove",l,!1),this.enabled=!1,this.getObject=function(){return n},this.getDirection=(i=new a.Vector3(0,0,-1),o=new a.Euler(0,0,0,"YXZ"),function(e){return o.set(r.rotation.x,n.rotation.y,0),e.copy(i).applyEuler(o),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new a.Vector3;var i=new a.Vector3,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector2,c=new a.Vector2,f=new a.Vector3,d=0,h=new a.Vector2,p=new a.Vector2,m=0,v=0,g=new a.Vector2,y=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var b={type:"change"},w={type:"start"},x={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var _,A,E,S,M,T,P,F,O,L,C,k=(_=new a.Vector2,function(e,t){return _.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),_}),R=function(){var e=new a.Vector2;return function(t,a){return e.set((t-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-a))/r.screen.width),e}}();function I(e){!1!==r.enabled&&(window.removeEventListener("keydown",I),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function N(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",I,!1))}function D(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(g.copy(k(e.pageX,e.pageY)),y.copy(g)):(h.copy(k(e.pageX,e.pageY)),p.copy(h)):(c.copy(R(e.pageX,e.pageY)),u.copy(c)),document.addEventListener("mousemove",U,!1),document.addEventListener("mouseup",j,!1),r.dispatchEvent(w))}function U(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||y.copy(k(e.pageX,e.pageY)):p.copy(k(e.pageX,e.pageY)):(u.copy(c),c.copy(R(e.pageX,e.pageY))))}function j(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",j),r.dispatchEvent(x))}function B(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:h.y-=.025*e.deltaY;break;case 1:h.y-=.01*e.deltaY;break;default:h.y-=25e-5*e.deltaY}r.dispatchEvent(w),r.dispatchEvent(x)}}function V(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,c.copy(R(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;default:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=m=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;g.copy(k(i,s)),y.copy(g)}r.dispatchEvent(w)}}function z(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:u.copy(c),c.copy(R(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=Math.sqrt(t*t+a*a);var n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;y.copy(k(n,i))}}function G(e){if(!1!==r.enabled){switch(e.touches.length){case 0:o=n.NONE;break;case 1:o=n.TOUCH_ROTATE,c.copy(R(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c)}r.dispatchEvent(x)}}function H(e){!1!==r.enabled&&e.preventDefault()}this.rotateCamera=(E=new a.Vector3,S=new a.Quaternion,M=new a.Vector3,T=new a.Vector3,P=new a.Vector3,F=new a.Vector3,function(){F.set(c.x-u.x,c.y-u.y,0),(A=F.length())?(l.copy(r.object.position).sub(r.target),M.copy(l).normalize(),T.copy(r.object.up).normalize(),P.crossVectors(T,M).normalize(),T.setLength(c.y-u.y),P.setLength(c.x-u.x),F.copy(T.add(P)),E.crossVectors(F,l).normalize(),A*=r.rotateSpeed,S.setFromAxisAngle(E,A),l.applyQuaternion(S),r.object.up.applyQuaternion(S),f.copy(E),d=A):!r.staticMoving&&d&&(d*=Math.sqrt(1-r.dynamicDampingFactor),l.copy(r.object.position).sub(r.target),S.setFromAxisAngle(f,d),l.applyQuaternion(S),r.object.up.applyQuaternion(S)),u.copy(c)}),this.zoomCamera=function(){var e;o===n.TOUCH_ZOOM_PAN?(e=m/v,m=v,l.multiplyScalar(e)):(1!==(e=1+(p.y-h.y)*r.zoomSpeed)&&e>0&&l.multiplyScalar(e),r.staticMoving?h.copy(p):h.y+=(p.y-h.y)*this.dynamicDampingFactor)},this.panCamera=(O=new a.Vector2,L=new a.Vector3,C=new a.Vector3,function(){O.copy(y).sub(g),O.lengthSq()&&(O.multiplyScalar(l.length()*r.panSpeed),C.copy(l).cross(r.object.up).setLength(O.x),C.add(L.copy(r.object.up).setLength(O.y)),r.object.position.add(C),r.target.add(C),r.staticMoving?g.copy(y):g.add(O.subVectors(y,g).multiplyScalar(r.dynamicDampingFactor)))}),this.checkDistances=function(){r.noZoom&&r.noPan||(l.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,l.setLength(r.maxDistance)),h.copy(p)),l.lengthSq()1e-6&&(r.dispatchEvent(b),i.copy(r.object.position))},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(b),i.copy(r.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",H,!1),this.domElement.removeEventListener("mousedown",D,!1),this.domElement.removeEventListener("wheel",B,!1),this.domElement.removeEventListener("touchstart",V,!1),this.domElement.removeEventListener("touchend",G,!1),this.domElement.removeEventListener("touchmove",z,!1),document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",I,!1),window.removeEventListener("keyup",N,!1)},this.domElement.addEventListener("contextmenu",H,!1),this.domElement.addEventListener("mousedown",D,!1),this.domElement.addEventListener("wheel",B,!1),this.domElement.addEventListener("touchstart",V,!1),this.domElement.addEventListener("touchend",G,!1),this.domElement.addEventListener("touchmove",z,!1),window.addEventListener("keydown",I,!1),window.addEventListener("keyup",N,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){var e=function(e){a.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.side=a.FrontSide,this.transparent=!0,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(e.prototype=Object.create(a.MeshBasicMaterial.prototype)).constructor=e;var t=function(e){a.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.transparent=!0,this.linewidth=1,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(t.prototype=Object.create(a.LineBasicMaterial.prototype)).constructor=t;var r=new e({visible:!1,transparent:!1}),n=function(){this.init=function(){a.Object3D.call(this),this.handles=new a.Object3D,this.pickers=new a.Object3D,this.planes=new a.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new a.PlaneBufferGeometry(50,50,2,2),t=new a.MeshBasicMaterial({visible:!1,side:a.DoubleSide}),r={XY:new a.Mesh(e,t),YZ:new a.Mesh(e,t),XZ:new a.Mesh(e,t),XYZE:new a.Mesh(e,t)};for(var n in this.activePlane=r.XYZE,r.YZ.rotation.set(0,Math.PI/2,0),r.XZ.rotation.set(-Math.PI/2,0,0),r)r[n].name=n,this.planes.add(r[n]),this.planes[n]=r[n];var i=function(e,t){for(var r in e)for(n=e[r].length;n--;){var a=e[r][n][0],i=e[r][n][1],o=e[r][n][2];a.name=r,a.renderOrder=1/0,i&&a.position.set(i[0],i[1],i[2]),o&&a.rotation.set(o[0],o[1],o[2]),t.add(a)}};i(this.handleGizmos,this.handles),i(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof a.Mesh){e.updateMatrix();var t=e.geometry.clone();t.applyMatrix(e.matrix),e.geometry=t,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))},this.highlight=function(e){this.traverse((function(t){t.material&&t.material.highlight&&(t.name===e?t.material.highlight(!0):t.material.highlight(!1))}))}};(n.prototype=Object.create(a.Object3D.prototype)).constructor=n,n.prototype.update=function(e,t){var r=new a.Vector3(0,0,0),n=new a.Vector3(0,1,0),i=new a.Matrix4;this.traverse((function(a){-1!==a.name.search("E")?a.quaternion.setFromRotationMatrix(i.lookAt(t,r,n)):-1===a.name.search("X")&&-1===a.name.search("Y")&&-1===a.name.search("Z")||a.quaternion.setFromEuler(e)}))};var i=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.CylinderGeometry(0,.05,.2,12,1,!1));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),new e({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),r)]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()};(i.prototype=Object.create(n.prototype)).constructor=i;var o=function(){n.call(this);var e=function(e,t,r){var n=new a.BufferGeometry,i=[];r=r||1;for(var o=0;o<=64*r;++o)"x"===t&&i.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&i.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&i.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return n.addAttribute("position",new a.Float32BufferAttribute(i,3)),n};this.handleGizmos={X:[[new a.Line(new e(1,"x",.5),new t({color:16711680}))]],Y:[[new a.Line(new e(1,"y",.5),new t({color:65280}))]],Z:[[new a.Line(new e(1,"z",.5),new t({color:255}))]],E:[[new a.Line(new e(1.25,"z",1),new t({color:13421568}))]],XYZE:[[new a.Line(new e(1,"z",1),new t({color:7895160}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusBufferGeometry(1.25,.12,2,24),r)]],XYZE:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,2,24),r)]]},this.pickerGizmos.XYZE[0][0].visible=!1,this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){n.prototype.update.apply(this,arguments);var r=new a.Matrix4,i=new a.Euler(0,0,1),o=new a.Quaternion,s=new a.Vector3(1,0,0),l=new a.Vector3(0,1,0),u=new a.Vector3(0,0,1),c=new a.Quaternion,f=new a.Quaternion,d=new a.Quaternion,h=t.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),r.makeRotationFromQuaternion(o).getInverse(r),h.applyMatrix4(r),this.traverse((function(e){o.setFromEuler(i),"X"===e.name&&(c.setFromAxisAngle(s,Math.atan2(-h.y,h.z)),o.multiplyQuaternions(o,c),e.quaternion.copy(o)),"Y"===e.name&&(f.setFromAxisAngle(l,Math.atan2(h.x,h.z)),o.multiplyQuaternions(o,f),e.quaternion.copy(o)),"Z"===e.name&&(d.setFromAxisAngle(u,Math.atan2(h.y,h.x)),o.multiplyQuaternions(o,d),e.quaternion.copy(o))}))},this.init()};(o.prototype=Object.create(n.prototype)).constructor=o;var s=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.BoxGeometry(.125,.125,.125));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.125,.125,.125),new e({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.4,.4,.4),r)]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()};(s.prototype=Object.create(n.prototype)).constructor=s;var l=function(e,t){a.Object3D.call(this),t=void 0!==t?t:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var r=this,n="translate",l=!1,u={translate:new i,rotate:new o,scale:new s};for(var c in u){var f=u[c];f.visible=c===n,this.add(f)}var d={type:"change"},h={type:"mouseDown"},p={type:"mouseUp",mode:n},m={type:"objectChange"},v=new a.Raycaster,g=new a.Vector2,y=new a.Vector3,b=new a.Vector3,w=new a.Vector3,x=new a.Vector3,_=1,A=new a.Matrix4,E=new a.Vector3,S=new a.Matrix4,M=new a.Vector3,T=new a.Quaternion,P=new a.Vector3(1,0,0),F=new a.Vector3(0,1,0),O=new a.Vector3(0,0,1),L=new a.Quaternion,C=new a.Quaternion,k=new a.Quaternion,R=new a.Quaternion,I=new a.Quaternion,N=new a.Vector3,D=new a.Vector3,U=new a.Matrix4,j=new a.Matrix4,B=new a.Vector3,V=new a.Vector3,z=new a.Euler,G=new a.Matrix4,H=new a.Vector3,X=new a.Euler;function Y(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,u[n].pickers.children),a=null;t&&(a=t.object.name,e.preventDefault()),r.axis!==a&&(r.axis=a,r.update(),r.dispatchEvent(d))}}function W(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=e.changedTouches?e.changedTouches[0]:e;if(0===t.button||void 0===t.button){var a=Z(t,u[n].pickers.children);if(a){e.preventDefault(),e.stopPropagation(),r.axis=a.object.name,r.dispatchEvent(h),r.update(),E.copy(H).sub(V).normalize(),u[n].setActivePlane(r.axis,E);var i=Z(t,[u[n].activePlane]);i&&(N.copy(r.object.position),D.copy(r.object.scale),U.extractRotation(r.object.matrix),G.extractRotation(r.object.matrixWorld),j.extractRotation(r.object.parent.matrixWorld),B.setFromMatrixScale(S.getInverse(r.object.parent.matrixWorld)),b.copy(i.point))}}l=!0}}function q(e){if(void 0!==r.object&&null!==r.axis&&!1!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,[u[n].activePlane]);!1!==t&&(e.preventDefault(),e.stopPropagation(),y.copy(t.point),"translate"===n?(y.sub(b),y.multiply(B),"local"===r.space&&(y.applyMatrix4(S.getInverse(G)),-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(U),r.object.position.copy(N),r.object.position.add(y)),"world"!==r.space&&-1===r.axis.search("XYZ")||(-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(S.getInverse(j)),r.object.position.copy(N),r.object.position.add(y)),null!==r.translationSnap&&("local"===r.space&&r.object.position.applyMatrix4(S.getInverse(G)),-1!==r.axis.search("X")&&(r.object.position.x=Math.round(r.object.position.x/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Y")&&(r.object.position.y=Math.round(r.object.position.y/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Z")&&(r.object.position.z=Math.round(r.object.position.z/r.translationSnap)*r.translationSnap),"local"===r.space&&r.object.position.applyMatrix4(G))):"scale"===n?(y.sub(b),y.multiply(B),"local"===r.space&&("XYZ"===r.axis?(_=1+y.y/Math.max(D.x,D.y,D.z),r.object.scale.x=D.x*_,r.object.scale.y=D.y*_,r.object.scale.z=D.z*_):(y.applyMatrix4(S.getInverse(G)),"X"===r.axis&&(r.object.scale.x=D.x*(1+y.x/D.x)),"Y"===r.axis&&(r.object.scale.y=D.y*(1+y.y/D.y)),"Z"===r.axis&&(r.object.scale.z=D.z*(1+y.z/D.z))))):"rotate"===n&&(y.sub(V),y.multiply(B),M.copy(b).sub(V),M.multiply(B),"E"===r.axis?(y.applyMatrix4(S.getInverse(A)),M.applyMatrix4(S.getInverse(A)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),I.setFromAxisAngle(E,w.z-x.z),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,I),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"XYZE"===r.axis?(I.setFromEuler(y.clone().cross(M).normalize()),T.setFromRotationMatrix(S.getInverse(j)),C.setFromAxisAngle(I,-y.clone().angleTo(M)),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,C),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"local"===r.space?(y.applyMatrix4(S.getInverse(G)),M.applyMatrix4(S.getInverse(G)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),L.setFromRotationMatrix(U),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),k.setFromAxisAngle(F,w.y-x.y),R.setFromAxisAngle(O,w.z-x.z)),"X"===r.axis&&L.multiplyQuaternions(L,C),"Y"===r.axis&&L.multiplyQuaternions(L,k),"Z"===r.axis&&L.multiplyQuaternions(L,R),r.object.quaternion.copy(L)):"world"===r.space&&(w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),k.setFromAxisAngle(F,w.y-x.y),R.setFromAxisAngle(O,w.z-x.z)),L.setFromRotationMatrix(G),"X"===r.axis&&T.multiplyQuaternions(T,C),"Y"===r.axis&&T.multiplyQuaternions(T,k),"Z"===r.axis&&T.multiplyQuaternions(T,R),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T))),r.update(),r.dispatchEvent(d),r.dispatchEvent(m))}}function Q(e){e.preventDefault(),void 0!==e.button&&0!==e.button||(l&&null!==r.axis&&(p.mode=n,r.dispatchEvent(p)),l=!1,"TouchEvent"in window&&e instanceof TouchEvent?(r.axis=null,r.update(),r.dispatchEvent(d)):Y(e))}function Z(r,a){var n=t.getBoundingClientRect(),i=(r.clientX-n.left)/n.width,o=(r.clientY-n.top)/n.height;g.set(2*i-1,-2*o+1),v.setFromCamera(g,e);var s=v.intersectObjects(a,!0);return!!s[0]&&s[0]}t.addEventListener("mousedown",W,!1),t.addEventListener("touchstart",W,!1),t.addEventListener("mousemove",Y,!1),t.addEventListener("touchmove",Y,!1),t.addEventListener("mousemove",q,!1),t.addEventListener("touchmove",q,!1),t.addEventListener("mouseup",Q,!1),t.addEventListener("mouseout",Q,!1),t.addEventListener("touchend",Q,!1),t.addEventListener("touchcancel",Q,!1),t.addEventListener("touchleave",Q,!1),this.dispose=function(){t.removeEventListener("mousedown",W),t.removeEventListener("touchstart",W),t.removeEventListener("mousemove",Y),t.removeEventListener("touchmove",Y),t.removeEventListener("mousemove",q),t.removeEventListener("touchmove",q),t.removeEventListener("mouseup",Q),t.removeEventListener("mouseout",Q),t.removeEventListener("touchend",Q),t.removeEventListener("touchcancel",Q),t.removeEventListener("touchleave",Q)},this.attach=function(e){this.object=e,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return n},this.setMode=function(e){for(var t in"scale"===(n=e||n)&&(r.space="local"),u)u[t].visible=t===n;this.update(),r.dispatchEvent(d)},this.setTranslationSnap=function(e){r.translationSnap=e},this.setRotationSnap=function(e){r.rotationSnap=e},this.setSize=function(e){r.size=e,this.update(),r.dispatchEvent(d)},this.setSpace=function(e){r.space=e,this.update(),r.dispatchEvent(d)},this.update=function(){void 0!==r.object&&(r.object.updateMatrixWorld(),V.setFromMatrixPosition(r.object.matrixWorld),z.setFromRotationMatrix(S.extractRotation(r.object.matrixWorld)),e.updateMatrixWorld(),H.setFromMatrixPosition(e.matrixWorld),X.setFromRotationMatrix(S.extractRotation(e.matrixWorld)),_=V.distanceTo(H)/6*r.size,this.position.copy(V),this.scale.set(_,_,_),e instanceof a.PerspectiveCamera?E.copy(H).sub(V).normalize():e instanceof a.OrthographicCamera&&E.copy(H).normalize(),"local"===r.space?u[n].update(z,E):"world"===r.space&&u[n].update(new a.Euler,E),u[n].highlight(r.axis))}};return(l.prototype=Object.create(a.Object3D.prototype)).constructor=l,l}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){var r,n,i=this,o=new a.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")})).catch((function(){console.warn("THREE.VRControls: Unable to get VR Displays")})),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return o},this.update=function(){var t;r&&(r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(i.scale))},this.dispose=function(){r=null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedGeometryExporter=t.STLExporter=t.STLBinaryExporter=t.PLYExporter=t.OBJExporter=t.MMDExporter=t.GLTFExporter=void 0;var a=c(r(41)),n=c(r(42)),i=c(r(43)),o=c(r(44)),s=c(r(45)),l=c(r(46)),u=c(r(47));function c(e){return e&&e.__esModule?e:{default:e}}t.GLTFExporter=a.default,t.MMDExporter=n.default,t.OBJExporter=i.default,t.PLYExporter=o.default,t.STLBinaryExporter=s.default,t.STLExporter=l.default,t.TypedGeometryExporter=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987},i={1003:n.NEAREST,1004:n.NEAREST_MIPMAP_NEAREST,1005:n.NEAREST_MIPMAP_LINEAR,1006:n.LINEAR,1007:n.LINEAR_MIPMAP_NEAREST,1008:n.LINEAR_MIPMAP_LINEAR},o={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},s=function(){};s.prototype={constructor:s,parse:function(e,t,r){(r=Object.assign({},{trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,animations:[],forceIndices:!1,forcePowerOfTwoTextures:!1},r)).animations.length>0&&(r.trs=!0);var s,l={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},u=0,c=[],f=[],d=new Map,h=[],p={},m={attributes:new Map,materials:new Map,textures:new Map};function v(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}function g(e){return 4*Math.ceil(e/4)}function y(e,t){t=t||0;var r=g(e.byteLength);if(r!==e.byteLength){var a=new Uint8Array(r);if(a.set(new Uint8Array(e)),0!==t)for(var n=e.byteLength;n0)&&(t.alphaMode=e.opacity<1?"BLEND":"MASK",e.alphaTest>0&&.5!==e.alphaTest&&(t.alphaCutoff=e.alphaTest)),e.side===a.DoubleSide&&(t.doubleSided=!0),""!==e.name&&(t.name=e.name),l.materials.push(t);var i=l.materials.length-1;return m.materials.set(e,i),i}function S(e){var t,i=e.geometry;if(e.isLineSegments)t=n.LINES;else if(e.isLineLoop)t=n.LINE_LOOP;else if(e.isLine)t=n.LINE_STRIP;else if(e.isPoints)t=n.POINTS;else{if(!i.isBufferGeometry){var o=new a.BufferGeometry;o.fromGeometry(i),i=o}e.drawMode===a.TriangleFanDrawMode?(console.warn("GLTFExporter: TriangleFanDrawMode and wireframe incompatible."),t=n.TRIANGLE_FAN):t=e.drawMode===a.TriangleStripDrawMode?e.material.wireframe?n.LINE_STRIP:n.TRIANGLE_STRIP:e.material.wireframe?n.LINES:n.TRIANGLES}var s={},u={},c=[],f=[],d={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},h=i.getAttribute("normal");for(var p in void 0===h||function(e){if(m.attributes.has(e))return!1;for(var t=new a.Vector3,r=0,n=e.count;r5e-4)return!1;return!0}(h)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.addAttribute("normal",function(e){if(m.attributes.has(e))return m.textures.get(e);for(var t=e.clone(),r=new a.Vector3,n=0,i=t.count;n0){var b=[],x=[],_={};if(void 0!==e.morphTargetDictionary)for(var A in e.morphTargetDictionary)_[e.morphTargetDictionary[A]]=A;for(var S=0;S0&&(s.extras={},s.extras.targetNames=x)}var C=r.forceIndices,k=Array.isArray(e.material);if(k&&0===e.geometry.groups.length)return null;!C&&null===i.index&&k&&(console.warn("THREE.GLTFExporter: Creating index for non-indexed multi-material mesh."),C=!0);var R=!1;if(null===i.index&&C){for(var I=[],N=(S=0,i.attributes.position.count);S0&&(j.targets=f),null!==i.index&&(j.indices=w(i.index,i,U[S].start,U[S].count));var B=E(D[U[S].materialIndex]);null!==B&&(j.material=B),c.push(j)}return R&&i.setIndex(null),s.primitives=c,l.meshes||(l.meshes=[]),l.meshes.push(s),l.meshes.length-1}function M(e,t){l.animations||(l.animations=[]);for(var r=[],n=[],i=0;i0)try{t.extras=JSON.parse(JSON.stringify(e.userData))}catch(e){throw new Error("THREE.GLTFExporter: userData can't be serialized")}if(e.isMesh||e.isLine||e.isPoints){var s=S(e);null!==s&&(t.mesh=s)}else e.isCamera&&(t.camera=function(e){l.cameras||(l.cameras=[]);var t=e.isOrthographicCamera,r={type:t?"orthographic":"perspective"};return t?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:a.Math.degToRad(e.fov)/e.aspect,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),l.cameras.push(r),l.cameras.length-1}(e));if(e.isSkinnedMesh&&h.push(e),e.children.length>0){for(var u=[],c=0,f=e.children.length;c0&&(t.children=u)}l.nodes.push(t);var g=l.nodes.length-1;return d.set(e,g),g}function F(e){l.scenes||(l.scenes=[],l.scene=0);var t={nodes:[]};""!==e.name&&(t.name=e.name),l.scenes.push(t);for(var a=[],n=0,i=e.children.length;n0&&(t.nodes=a)}!function(e){e=e instanceof Array?e:[e];for(var t=[],n=0;n0&&function(e){var t=new a.Scene;t.name="AuxScene";for(var r=0;r0&&(l.extensionsUsed=a),l.buffers&&l.buffers.length>0){l.buffers[0].byteLength=e.size;var n=new window.FileReader;if(!0===r.binary){n.readAsArrayBuffer(e),n.onloadend=function(){var e=y(n.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,e.byteLength,!0),r.setUint32(4,5130562,!0);var a=y(function(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0,a=e.length;r255?32:n}return t.buffer}(JSON.stringify(l)),32),i=new DataView(new ArrayBuffer(8));i.setUint32(0,a.byteLength,!0),i.setUint32(4,1313821514,!0);var o=new ArrayBuffer(12),s=new DataView(o);s.setUint32(0,1179937895,!0),s.setUint32(4,2,!0);var u=12+i.byteLength+a.byteLength+r.byteLength+e.byteLength;s.setUint32(8,u,!0);var c=new Blob([o,i,a,r,e],{type:"application/octet-stream"}),f=new window.FileReader;f.readAsArrayBuffer(c),f.onloadend=function(){t(f.result)}}}else n.readAsDataURL(e),n.onloadend=function(){var e=n.result;l.buffers[0].uri=e,t(l)}}else t(l)}))}},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(0)),n=i(r(4));function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.default=function(){var e;this.parseVpd=function(t,r,i){if(!0!==t.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);var t=e.toString();-1===t.indexOf(".")&&(t+=".");var r=(t+="000000").indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function s(e){for(var t=[],r=0,a=e.length;r255?(u.push(l>>8&255),u.push(255&l)):u.push(255&l)}return new Uint8Array(u)}(x):x}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(){};n.prototype={constructor:n,parse:function(e){var t,r,n,i,o,s="",l=0,u=0,c=0,f=new a.Vector3,d=new a.Vector3,h=new a.Vector2,p=[];return e.traverse((function(e){e instanceof a.Mesh&&function(e){var n=0,m=0,v=0,g=e.geometry,y=new a.Matrix3;if(g instanceof a.Geometry&&(g=(new a.BufferGeometry).setFromObject(e)),g instanceof a.BufferGeometry){var b=g.getAttribute("position"),w=g.getAttribute("normal"),x=g.getAttribute("uv"),_=g.getIndex();if(s+="o "+e.name+"\n",e.material&&e.material.name&&(s+="usemtl "+e.material.name+"\n"),void 0!==b)for(t=0,i=b.count;t=200)return void n("THREE.AssimpJSONLoader: Unsupported assimp2json file format version.")}t(i.parse(r,o))}),r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=new Array(e.length),a=0;a0&&i.addAttribute("normal",new a.Float32BufferAttribute(l,3)),u.length>0&&i.addAttribute("uv",new a.Float32BufferAttribute(u,2)),c.length>0&&i.addAttribute("color",new a.Float32BufferAttribute(c,3)),i.computeBoundingSphere(),i})),o=r(e.materials,(function(e){var t=new a.MeshPhongMaterial;for(var r in e.properties){var i=e.properties[r],o=i.key,s=i.value;switch(o){case"$tex.file":var l=i.semantic;if(1===l||2===l||5===l||6===l){var u;switch(l){case 1:u="map";break;case 2:u="specularMap";break;case 5:u="bumpMap";break;case 6:u="normalMap"}var c=n.load(s);c.wrapS=c.wrapT=a.RepeatWrapping,t[u]=c}break;case"?mat.name":t.name=s;break;case"$clr.diffuse":t.color.fromArray(s);break;case"$clr.specular":t.specular.fromArray(s);break;case"$clr.emissive":t.emissive.fromArray(s);break;case"$mat.shininess":t.shininess=s;break;case"$mat.shadingm":t.flatShading=1===s;break;case"$mat.opacity":s<1&&(t.opacity=s,t.transparent=!0)}}return t}));return function e(t,r,n,i){var o,s,l=new a.Object3D;for(l.name=r.name||"",l.matrix=(new a.Matrix4).fromArray(r.transformation).transpose(),l.matrix.decompose(l.position,l.quaternion,l.scale),o=0;r.meshes&&o0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(var e=0;e=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;for(var r=e.hierarchy[0].keys,a=0;ae){t=this.keys[a],r=this.keys[a+1];break}if(this.keys[a].time4&&(r.length=4);var n=0;for(a=0;a<4;a++)n+=r[a].w*r[a].w;n=Math.sqrt(n);for(a=0;a<4;a++)r[a].w=r[a].w/n,e[a]=r[a].i,t[a]=r[a].w}function R(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(var r in e.children){var a=R(e.children[r],t);if(a)return a}}function I(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e,t){if(0!=this.mBones.length){for(var r=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var o=C(u=i.toTHREE(e),e);this.threeNode.add(o);for(var s=0;s0&&n.addAttribute("normal",new a.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&n.addAttribute("color",new a.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&n.addAttribute("uv",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&n.addAttribute("uv1",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&n.addAttribute("tangents",new a.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&n.addAttribute("bitangents",new a.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){for(var i=[],o=[],s=0;s0&&(r=new a.SkinnedMesh(n,t)),this.threeNode=r,r}}function N(){this.mNumIndices=0,this.mIndices=[]}function D(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new a.Vector3(this.x,this.y,this.z)}}function U(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new a.Color(this.r,this.g,this.b,1)}}function j(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new a.Quaternion(this.x,this.y,this.z,this.w)}}function B(){this.mVertexId=0,this.mWeight=0}function V(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}function z(){this.mTime=0,this.mValue=null}function G(){this.mTime=0,this.mValue=null}function H(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new a.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(var r=0;r0)var r=this.mAnimations[0].toTHREE(this);return{object:e,animation:r}}}function ie(){this.elements=[[],[],[],[]],this.toTHREE=function(){for(var e=new a.Matrix4,t=0;t<4;++t)for(var r=0;r<4;++r)e.elements[4*t+r]=this.elements[r][t];return e}}var oe=!0;function se(e){var t=e.getFloat32(e.readOffset,oe);return e.readOffset+=4,t}function le(e){var t=e.getFloat64(e.readOffset,oe);return e.readOffset+=8,t}function ue(e){var t=e.getUint16(e.readOffset,oe);return e.readOffset+=2,t}function ce(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function fe(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function de(e){var t=new D;return t.x=se(e),t.y=se(e),t.z=se(e),t}function he(e){var t=new U;return t.r=se(e),t.g=se(e),t.b=se(e),t}function pe(e){var t=new V,r=ce(e);return e.ReadBytes(t.data,1,r),t.toString()}function me(e){var t=new B;return t.mVertexId=ce(e),t.mWeight=se(e),t}function ve(e){for(var t=new ie,r=0;r<4;++r)for(var a=0;a<4;++a)t.elements[r][a]=se(e);return t}function ge(e){var t=new z;return t.mTime=le(e),t.mValue=de(e),t}function ye(e){var t=new G;return t.mTime=le(e),t.mValue=function(e){var t=new j;return t.w=se(e),t.x=se(e),t.y=se(e),t.z=se(e),t}(e),t}function be(e,t,r){for(var a=0;a0,ke=ue(r)>0,Ce)throw"Shortened binaries are not supported!";if(r.Seek(256,Re),r.Seek(128,Re),r.Seek(64,Re),!ke)return Le(r,t),t.toTHREE();var a=fe(r),n=r.FileSize()-r.Tell(),i=[];r.Read(i,1,n);var o=[];uncompress(o,a,i,n),Le(new ArrayBuffer(o),t)}(e)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){function e(){this.id=0,this.data=null}function t(){}t.prototype={set:function(e,t){this[e]=t},get:function(e,t){return this.hasOwnProperty(e)?this[e]:t}};var r=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.trunk=new a.Object3D,this.materialFactory=void 0,this._url="",this._baseDir="",this._data=void 0,this._ptr=0,this._version=[],this._streaming=!1,this._optimized_for_accuracy=!1,this._compression=0,this._bodylen=4294967295,this._blocks=[new e],this._accuracyMatrix=!1,this._accuracyGeo=!1,this._accuracyProps=!1};return r.prototype={constructor:r,load:function(e,t,r,n){var i=this;this._url=e,this._baseDir=e.substr(0,e.lastIndexOf("/")+1);var o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){var t=e.byteLength;for(this._ptr=0,this._data=new DataView(e),this._parseHeader(),0!=this._compression&&console.error("compressed AWD not supported"),this._streaming||this._bodylen==e.byteLength-this._ptr||console.error("AWDLoader: body len does not match file length",this._bodylen,t-this._ptr);this._ptr1)for(r=new a.Object3D,p=0;p191&&a<224){var n=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((31&a)<<6|63&n)}else{n=this._data.getUint8(this._ptr++,!0);var i=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((15&a)<<12|(63&n)<<6|63&i)}}return t.join("")}},r}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),r,n)},parse:function(e){function t(e){var t=new a.BufferGeometry,r=e.indices,n=e.positions,i=e.normals,o=e.uvs;t.setIndex(r);for(var s=2,l=n.length;s0&&t.push(new a.VectorKeyframeTrack(n+".position",i,o)),s.length>0&&t.push(new a.QuaternionKeyframeTrack(n+".quaternion",i,s)),l.length>0&&t.push(new a.VectorKeyframeTrack(n+".scale",i,l)),t}function A(e,t,r){var a,n,i,o=!0;for(n=0,i=e.length;n=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function S(e,t,r){for(;t0&&t0&&h.addAttribute("position",new a.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&h.addAttribute("normal",new a.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&h.addAttribute("color",new a.Float32BufferAttribute(l.array,l.stride)),s.array.length>0&&h.addAttribute("uv",new a.Float32BufferAttribute(s.array,s.stride)),u.length>0&&h.addAttribute("skinIndex",new a.Float32BufferAttribute(u,c)),f.length>0&&h.addAttribute("skinWeight",new a.Float32BufferAttribute(f,d)),n.data=h,n.type=e[0].type,n.materialKeys=p,n}function fe(e,t,r,a){var n=e.p,i=e.stride,o=e.vcount;function s(e){for(var t=n[e+r]*u,i=t+u;t4)for(var g=1,y=h-2;g<=y;g++){p=c+i*g,m=c+i*(g+1);s(c+0*i),s(p),s(m)}c+=i*h}else for(f=0,d=n.length;f=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ge(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;rn.limits.max||t>8&255,d>>16&255,d>>24&255))),r;p=!0,o=64,r.format=a.RGBAFormat}r.mipmapCount=1,131072&f[2]&&!1!==t&&(r.mipmapCount=Math.max(1,f[7]));var m=f[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=f[4],r.height=f[3];for(var v=f[1]+4,g=r.isCubemap?6:1,y=0;y>1,1),w=Math.max(w>>1,1)}return r},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="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},n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var i=function(e){this.timeLoaded=0,this.manager=e||n.DefaultLoadingManager,this.materials=null,this.verbosity=0,this.attributeOptions={},this.drawMode=n.TrianglesDrawMode,this.nativeAttributeMap={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"}};i.prototype={constructor:i,load:function(e,t,r,a){var i=this,o=new n.FileLoader(i.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.load(e,(function(e){i.decodeDracoFile(e,t)}),r,a)},setPath:function(e){this.path=e},setCrossOrigin:function(e){this.crossOrigin=e},setVerbosity:function(e){this.verbosity=e},setDrawMode:function(e){this.drawMode=e},setSkipDequantization:function(e,t){var r=!0;void 0!==t&&(r=t),this.getAttributeOptions(e).skipDequantization=r},decodeDracoFile:function(e,t,r){var a=this;i.getDecoderModule().then((function(n){a.decodeDracoFileInternal(e,n.decoder,t,r||{})}))},decodeDracoFileInternal:function(e,t,r,a){var n=new t.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength);var i=new t.Decoder,o=i.GetEncodedGeometryType(n);if(o==t.TRIANGULAR_MESH)this.verbosity>0&&console.log("Loaded a mesh.");else{if(o!=t.POINT_CLOUD){var s="THREE.DRACOLoader: Unknown geometry type.";throw console.error(s),new Error(s)}this.verbosity>0&&console.log("Loaded a point cloud.")}r(this.convertDracoGeometryTo3JS(t,i,o,n,a))},addAttributeToGeometry:function(e,t,r,a,i,o,s){if(0===i.ptr){var l="THREE.DRACOLoader: No attribute "+a;throw console.error(l),new Error(l)}var u=i.num_components(),c=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,c);var f=r.num_points()*u;s[a]=new Float32Array(f);for(var d=0;d0&&console.log("Number of faces loaded: "+c.toString())):c=0;var d=o.num_points(),h=o.num_attributes();this.verbosity>0&&(console.log("Number of points loaded: "+d.toString()),console.log("Number of attributes loaded: "+h.toString()));var p=t.GetAttributeId(o,e.POSITION);if(-1==p){u="THREE.DRACOLoader: No position attribute found.";throw console.error(u),e.destroy(t),e.destroy(o),new Error(u)}var m=t.GetAttribute(o,p),v={},g=new n.BufferGeometry;for(var y in this.nativeAttributeMap)if(void 0===i[y]){var b=t.GetAttributeId(o,e[this.nativeAttributeMap[y]]);if(-1!==b){this.verbosity>0&&console.log("Loaded "+y+" attribute.");var w=t.GetAttribute(o,b);this.addAttributeToGeometry(e,t,o,y,w,g,v)}}for(var y in i){var x=i[y];w=t.GetAttributeByUniqueId(o,x);this.addAttributeToGeometry(e,t,o,y,w,g,v)}if(r==e.TRIANGULAR_MESH)if(this.drawMode===n.TriangleStripDrawMode){var _=new e.DracoInt32Array;t.GetTriangleStripsFromMesh(o,_);v.indices=new Uint32Array(_.size());for(var A=0;A<_.size();++A)v.indices[A]=_.GetValue(A);e.destroy(_)}else{var E=3*c;v.indices=new Uint32Array(E);var S=new e.DracoInt32Array;for(A=0;A65535?n.Uint32BufferAttribute:n.Uint16BufferAttribute)(v.indices,1));var T=new e.AttributeQuantizationTransform;if(T.InitFromAttribute(m)){g.attributes.position.isQuantized=!0,g.attributes.position.maxRange=T.range(),g.attributes.position.numQuantizationBits=T.quantization_bits(),g.attributes.position.minValues=new Float32Array(3);for(A=0;A<3;++A)g.attributes.position.minValues[A]=T.min_value(A)}return e.destroy(T),e.destroy(t),e.destroy(o),this.decode_time=f-l,this.import_time=performance.now()-f,this.verbosity>0&&(console.log("Decode time: "+this.decode_time),console.log("Import time: "+this.import_time)),g},isVersionSupported:function(e,t){i.getDecoderModule().then((function(r){t(r.decoder.isVersionSupported(e))}))},getAttributeOptions:function(e){return void 0===this.attributeOptions[e]&&(this.attributeOptions[e]={}),this.attributeOptions[e]}},i.decoderPath="./",i.decoderConfig={},i.decoderModulePromise=null,i.setDecoderPath=function(e){i.decoderPath=e},i.setDecoderConfig=function(e){var t=i.decoderConfig.wasmBinary;i.decoderConfig=e||{},i.releaseDecoderModule(),t&&(i.decoderConfig.wasmBinary=t)},i.releaseDecoderModule=function(){i.decoderModulePromise=null},i.getDecoderModule=function(){var e=this,t=i.decoderPath,r=i.decoderConfig,n=i.decoderModulePromise;return n||("undefined"!=typeof DracoDecoderModule?n=Promise.resolve():"object"!==("undefined"==typeof WebAssembly?"undefined":a(WebAssembly))||"js"===r.type?n=i._loadScript(t+"draco_decoder.js"):(r.wasmBinaryFile=t+"draco_decoder.wasm",n=i._loadScript(t+"draco_wasm_wrapper.js").then((function(){return i._loadArrayBuffer(r.wasmBinaryFile)})).then((function(e){r.wasmBinary=e}))),n=n.then((function(){return new Promise((function(t){r.onModuleLoaded=function(r){e.timeLoaded=performance.now(),t({decoder:r})},DracoDecoderModule(r)}))})),i.decoderModulePromise=n,n)},i._loadScript=function(e){var t=document.getElementById("decoder_script");null!==t&&t.parentNode.removeChild(t);var r=document.getElementsByTagName("head")[0],a=document.createElement("script");return a.id="decoder_script",a.type="text/javascript",a.src=e,new Promise((function(e){a.onload=e,r.appendChild(a)}))},i._loadArrayBuffer=function(e){var t=new n.FileLoader;return t.setResponseType("arraybuffer"),new Promise((function(r,a){t.load(e,r,void 0,a)}))},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.sourceTexture=e,this.resolution=t,this.views=[{t:[1,0,0],u:[0,-1,0]},{t:[-1,0,0],u:[0,-1,0]},{t:[0,1,0],u:[0,0,1]},{t:[0,-1,0],u:[0,0,-1]},{t:[0,0,1],u:[0,-1,0]},{t:[0,0,-1],u:[0,-1,0]}],this.camera=new a.PerspectiveCamera(90,1,.1,10),this.boxMesh=new a.Mesh(new a.BoxBufferGeometry(1,1,1),this.getShader()),this.boxMesh.material.side=a.BackSide,this.scene=new a.Scene,this.scene.add(this.boxMesh);var r={format:a.RGBAFormat,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.renderTarget=new a.WebGLRenderTargetCube(this.resolution,this.resolution,r)};n.prototype={constructor:n,update:function(e){for(var t=0;t<6;t++){this.renderTarget.activeCubeFace=t;var r=this.views[t];this.camera.position.set(0,0,0),this.camera.up.set(r.u[0],r.u[1],r.u[2]),this.camera.lookAt(r.t[0],r.t[1],r.t[2]),e.render(this.scene,this.camera,this.renderTarget,!0)}return this.renderTarget.texture},getShader:function(){var e=new a.ShaderMaterial({uniforms:{equirectangularMap:{value:this.sourceTexture}},vertexShader:"varying vec3 localPosition;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tlocalPosition = position;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \n\t\t\t\tvarying vec3 localPosition;\n\t\t\t\tuniform sampler2D equirectangularMap;\n\t\t\t\t\n\t\t\t\tvec2 EquiangularSampleUV(vec3 v) {\n\t\t\t vec2 uv = vec2(atan(v.z, v.x), asin(v.y));\n\t\t\t uv *= vec2(0.1591, 0.3183); // inverse atan\n\t\t\t uv += 0.5;\n\t\t\t return uv;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = EquiangularSampleUV(normalize(localPosition));\n \t\t\tvec3 color = texture2D(equirectangularMap, uv).rgb;\n \t\t\t\n\t\t\t\t\tgl_FragColor = vec4( color, 1.0 );\n\t\t\t\t}",blending:a.CustomBlending,premultipliedAlpha:!1,blendSrc:a.OneFactor,blendDst:a.ZeroFactor,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.ZeroFactor,blendEquation:a.AddEquation});return e.type="EquiangularToCubeGenerator",e},dispose:function(){this.boxMesh.geometry.dispose(),this.boxMesh.material.dispose(),this.renderTarget.dispose()}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};(n.prototype=Object.create(a.DataTextureLoader.prototype))._parser=function(e){var t=65536,r=t>>3,n=14,i=65537,o=1<>r&(1<a)return!1;g(6,d,h,e,f);var p=v.l;if(d=v.c,h=v.lc,s[n]=p,p==u){if(f.value-r.value>a)throw"Something wrong with hufUnpackEncTable";g(8,d,h,e,f);var m=v.l+c;if(d=v.c,h=v.lc,n+m>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}else if(p>=l){if(n+(m=p-l+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}}!function(e){for(var t=0;t<=58;++t)y[t]=0;for(t=0;t0;--t){var a=r+y[t]>>1;y[t]=r,r=a}for(t=0;t0&&(e[t]=n|y[n]++<<6)}}(s)}function w(e){return 63&e}function x(e){return e>>6}var _={c:0,lc:0};function A(e,t,r,a){e=e<<8|I(r,a),t+=8,_.c=e,_.lc=t}var E={c:0,lc:0};function S(e,t,r,a,n,i,o,s,l,u){if(e==t){a<8&&(A(r,a,n,o),r=_.c,a=_.lc);var c=r>>(a-=8);if(out+c>oe)throw"Issue with getCode";for(var f=out[-1];c-- >0;)s[l.value++]=f}else{if(!(l.value32767?t-65536:t}var T={a:0,b:0};function P(e,t){var r=M(e),a=M(t),n=r+(1&a)+(a>>1),i=n,o=n-a;T.a=i,T.b=o}function F(e,t,r,a,n,i,o){for(var s,l=r>n?n:r,u=1;u<=l;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var c,f,d,h,p=0,m=p+i*(n-s),v=i*u,g=i*s,y=a*u,b=a*s;p<=m;p+=g){for(var w=p,x=p+a*(r-s);w<=x;w+=b){var _=w+y,A=(E=w+v)+y;P(t[w+e],t[E+e]),c=T.a,d=T.b,P(t[_+e],t[A+e]),f=T.a,h=T.b,P(c,f),t[w+e]=T.a,t[_+e]=T.b,P(d,h),t[E+e]=T.a,t[A+e]=T.b}if(r&u){var E=w+v;P(t[w+e],t[E+e]),c=T.a,t[E+e]=T.b,t[w+e]=c}}if(n&u)for(w=p,x=p+a*(r-s);w<=x;w+=b){_=w+y;P(t[w+e],t[_+e]),c=T.a,t[_+e]=T.b,t[w+e]=c}s=u,u>>=1}return p}function O(e,t,r,a,l,u,c){var f=r.value,d=R(t,r),h=R(t,r);r.value+=4;var p=R(t,r);if(r.value+=4,d<0||d>=i||h<0||h>=i)throw"Something wrong with HUF_ENCSIZE";var m=new Array(i),v=new Array(o);if(function(e){for(var t=0;t8*(a-(r.value-f)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var i=x(e[t]),o=w(e[t]);if(i>>o)throw"Invalid table entry";if(o>n){if((c=a[i>>o-n]).len)throw"Invalid table entry";if(c.lit++,c.p){var s=c.p;c.p=new Array(c.lit);for(var l=0;l0;l--){var c;if((c=a[(i<=n;){if((b=t[d>>h-n&s]).len)h-=b.len,S(b.lit,l,d,h,r,0,i,c,f,p),d=E.c,h=E.lc;else{if(!b.p)throw"hufDecode issues";var v;for(v=0;v=g&&x(e[b.p[v]])==(d>>h-g&(1<>=y,h-=y;h>0;){var b;if(!(b=t[d<=r)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(h<=p)for(var m=0;m>3]&1<<(7&n))&&(r[a++]=n);for(var i=a-1;a>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function j(e,t){var r=e.getUint16(t.value,!0);return t.value+=p,r}function B(e,t){return U(j(e,t))}function V(e,t,r,a,n){if("string"===a||"iccProfile"===a)return function(e,t,r){var a=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,a}(t,r,n);if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value0&&void 0!==r[l[0].ID]&&(0!==(i=r[l[0].ID]).indexOf("blob:")&&0!==i.indexOf("data:")||t.setPath(void 0));o="tga"===e.FileName.slice(-3).toLowerCase()?n.Loader.Handlers.get(".tga").load(i):t.load(i);return t.setPath(s),o}(e,t,r,a);i.ID=e.id,i.name=e.attrName;var o=e.WrapModeU,s=e.WrapModeV,l=void 0!==o?o.value:0,u=void 0!==s?s.value:0;if(i.wrapS=0===l?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===u?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){var c=e.Scaling.value;i.repeat.x=c[0],i.repeat.y=c[1]}return i}function i(e,t,r,i){var s=t.id,l=t.attrName,u=t.ShadingModel;if("object"===(void 0===u?"undefined":a(u))&&(u=u.value),!i.has(s))return null;var c,f=function(e,t,r,a,i){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value);t.Diffuse?s.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new n.Color).fromArray(t.DiffuseColor.value));t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value);t.Emissive?s.emissive=(new n.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new n.Color).fromArray(t.EmissiveColor.value));t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value));t.Opacity&&(s.opacity=parseFloat(t.Opacity.value));s.opacity<1&&(s.transparent=!0);t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value);t.Shininess&&(s.shininess=t.Shininess.value);t.Specular?s.specular=(new n.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new n.Color).fromArray(t.SpecularColor.value));return i.get(a).children.forEach((function(t){var a=t.relationship;switch(a){case"Bump":s.bumpMap=r.get(t.ID);break;case"DiffuseColor":s.map=o(e,r,t.ID,i);break;case"DisplacementColor":s.displacementMap=o(e,r,t.ID,i);break;case"EmissiveColor":s.emissiveMap=o(e,r,t.ID,i);break;case"NormalMap":s.normalMap=o(e,r,t.ID,i);break;case"ReflectionColor":s.envMap=o(e,r,t.ID,i),s.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":s.specularMap=o(e,r,t.ID,i);break;case"TransparentColor":s.alphaMap=o(e,r,t.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a)}})),s}(e,t,r,s,i);switch(u.toLowerCase()){case"phong":c=new n.MeshPhongMaterial;break;case"lambert":c=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',u),c=new n.MeshPhongMaterial({color:3342591})}return c.setValues(f),c.name=l,c}function o(e,t,r,a){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=a.get(r).children[0].ID),t.get(r)}function s(e,t){var r=[];return e.children.forEach((function(e){var a=t[e.ID];if("Cluster"===a.attrType){var i={ID:e.ID,indices:[],weights:[],transform:(new n.Matrix4).fromArray(a.Transform.a),transformLink:(new n.Matrix4).fromArray(a.TransformLink.a),linkMode:a.Mode};"Indexes"in a&&(i.indices=a.Indexes.a,i.weights=a.Weights.a),r.push(i)}})),{rawBones:r,bones:[]}}function l(e,t,r,a){for(var n=[],i=0;i0&&o.addAttribute("color",new n.Float32BufferAttribute(l.colors,3));r&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(l.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(l.vertexWeights,4)),o.FBX_Deformer=r);if(l.normal.length>0){var d=new n.Float32BufferAttribute(l.normal,3);(new n.Matrix3).getNormalMatrix(i).applyToBufferAttribute(d),o.addAttribute("normal",d)}if(l.uvs.forEach((function(e,t){var r="uv"+(t+1).toString();0===t&&(r="uv"),o.addAttribute(r,new n.Float32BufferAttribute(l.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){var h=l.materialIndex[0],p=0;if(l.materialIndex.forEach((function(e,t){e!==h&&(o.addGroup(p,t-p,h),h=e,p=t)})),o.groups.length>0){var m=o.groups[o.groups.length-1],v=m.start+m.count;v!==l.materialIndex.length&&o.addGroup(v,l.materialIndex.length-v,h)}0===o.groups.length&&o.addGroup(0,l.materialIndex.length,l.materialIndex[0])}return function(e,t,r,a,i){if(null===a)return;t.morphAttributes.position=[],t.morphAttributes.normal=[],a.rawTargets.forEach((function(a){var o=e.Objects.Geometry[a.geoID];void 0!==o&&function(e,t,r,a){var i=new n.BufferGeometry;r.attrName&&(i.name=r.attrName);for(var o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],s=void 0!==t.Vertices?t.Vertices.a.slice():[],l=void 0!==r.Vertices?r.Vertices.a:[],u=void 0!==r.Indexes?r.Indexes.a:[],f=0;f4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);var y=[0,0,0,0],b=[0,0,0,0];v.forEach((function(e,t){var r=e,a=m[t];b.forEach((function(e,t,n){if(r>e){n[t]=r,r=e;var i=y[t];y[t]=a,a=i}}))})),m=y,v=b}for(;v.length<4;)v.push(0),m.push(0);for(var w=0;w<4;++w)u.push(v[w]),c.push(m[w])}if(e.normal){g=h(d,r,f,e.normal);o.push(g[0],g[1],g[2])}if(e.material&&"AllSame"!==e.material.mappingType)var x=h(d,r,f,e.material)[0];e.uv&&e.uv.forEach((function(e,t){var a=h(d,r,f,e);void 0===l[t]&&(l[t]=[]),l[t].push(a[0]),l[t].push(a[1])})),a++,p&&(!function(e,t,r,a,n,i,o,s,l,u){for(var c=2;c=f.length&&f===C(c,0,f.length))o=(new M).parse(e);else{var d=C(e);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;for(var a=0;a0,u="string"==typeof o.Content&&""!==o.Content;if(l||u){var c=t(n[i]);a[o.RelativeFilename||o.Filename]=c}}}}for(var s in r){var f=r[s];void 0!==a[f]?r[s]=a[f]:r[s]=r[s].split("\\").pop()}return r}(o),_=function(e,t,r){var a=new Map;if("Material"in e.Objects){var n=e.Objects.Material;for(var o in n){var s=i(e,n[o],t,r);null!==s&&a.set(parseInt(o),s)}}return a}(o,function(e,t,a,n){var i=new Map;if("Texture"in e.Objects){var o=e.Objects.Texture;for(var s in o){var l=r(o[s],t,a,n);i.set(parseInt(s),l)}}return i}(o,new n.TextureLoader(this.manager).setPath(a),x,h),h),A=function(e,t){var r={},a={};if("Deformer"in e.Objects){var n=e.Objects.Deformer;for(var i in n){var o=n[i],u=t.get(parseInt(i));if("Skin"===o.attrType){var c=s(u,n);c.ID=i,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),c.geometryID=u.parents[0].ID,r[i]=c}else if("BlendShape"===o.attrType){var f={id:i};f.rawTargets=l(u,o,n,t),f.id=i,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),f.parentGeoID=u.parents[0].ID,a[i]=f}}}return{skeletons:r,morphTargets:a}}(o,h),E=function(e,t,r){var a=new Map;if("Geometry"in e.Objects){var n=e.Objects.Geometry;for(var i in n){var o=t.get(parseInt(i)),s=u(e,o,n[i],r);a.set(parseInt(i),s)}}return a}(o,h,A);return function(e,t,r,a,i){var o=new n.Group,s=function(e,t,r,a,i){var o=new Map,s=e.Objects.Model;for(var l in s){var u=parseInt(l),c=s[l],f=i.get(u),d=p(f,t,u,c.attrName);if(!d){switch(c.attrType){case"Camera":d=m(e,f);break;case"Light":d=v(e,f);break;case"Mesh":d=g(e,f,r,a);break;case"NurbsCurve":d=y(f,r);break;case"LimbNode":case"Null":default:d=new n.Group}d.name=n.PropertyBinding.sanitizeNodeName(c.attrName),d.ID=u}b(e,d,c),o.set(u,d)}return o}(e,r,a,i,t),l=e.Objects.Model;return s.forEach((function(r){var a=l[r.ID];!function(e,t,r,a,i){if("LookAtProperty"in r){a.get(t.ID).children.forEach((function(r){if("LookAtProperty"===r.relationship){var a=e.Objects.Model[r.ID];if("Lcl_Translation"in a){var o=a.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(o),i.add(t.target)):t.lookAt((new n.Vector3).fromArray(o))}}}))}}(e,r,a,t,o),t.get(r.ID).parents.forEach((function(e){var t=s.get(e.ID);void 0!==t&&t.add(r)})),null===r.parent&&o.add(r)})),function(e,t,r,a,i){var o=function(e){var t={};if("Pose"in e.Objects){var r=e.Objects.Pose;for(var a in r)if("BindPose"===r[a].attrType){var i=r[a].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new n.Matrix4).fromArray(e.Matrix.a)})):t[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return t}(e);for(var s in t){var l=t[s];i.get(parseInt(l.ID)).parents.forEach((function(e){if(r.has(e.ID)){var t=e.ID;i.get(t).parents.forEach((function(e){a.has(e.ID)&&a.get(e.ID).bind(new n.Skeleton(l.bones),o[e.ID])}))}}))}}(e,r,a,s,t),function(e,t,r){r.animations=[];var a=function(e,t){if(void 0===e.Objects.AnimationCurve)return;var r=function(e){var t=e.Objects.AnimationCurveNode,r=new Map;for(var a in t){var n=t[a];if(null!==n.attrName.match(/S|R|T/)){var i={id:n.id,attr:n.attrName,curves:{}};r.set(i.id,i)}}return r}(e);!function(e,t,r){var a=e.Objects.AnimationCurve;for(var n in a){var i={id:a[n].id,times:a[n].KeyTime.a.map(O),values:a[n].KeyValueFloat.a},o=t.get(i.id);if(void 0!==o){var s=o.parents[0].ID,l=o.parents[0].relationship;l.match(/X/)?r.get(s).curves.x=i:l.match(/Y/)?r.get(s).curves.y=i:l.match(/Z/)&&(r.get(s).curves.z=i)}}}(e,t,r);var a=function(e,t,r){var a=e.Objects.AnimationLayer,i=new Map;for(var o in a){var s=[],l=t.get(parseInt(o));if(void 0!==l)l.children.forEach((function(a,i){if(r.has(a.ID)){var o=r.get(a.ID);if(void 0!==o.curves.x||void 0!==o.curves.y||void 0!==o.curves.z){if(void 0===s[i]){var l;t.get(a.ID).parents.forEach((function(e){void 0!==e.relationship&&(l=e.ID)}));var u=e.Objects.Model[l.toString()],c={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};"Lcl_Translation"in u&&(c.initialPosition=u.Lcl_Translation.value),"Lcl_Rotation"in u&&(c.initialRotation=u.Lcl_Rotation.value),"Lcl_Scaling"in u&&(c.initialScale=u.Lcl_Scaling.value),"PreRotation"in u&&(c.preRotations=u.PreRotation.value),s[i]=c}s[i][o.attr]=o}}})),i.set(parseInt(o),s)}return i}(e,t,r);return function(e,t,r){var a=e.Objects.AnimationStack,n={};for(var i in a){var o=t.get(parseInt(i)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=r.get(o[0].ID);n[i]={name:a[i].attrName,layer:s}}return n}(e,t,a)}(e,t);if(void 0===a)return;for(var i in a){var o=w(a[i]);r.animations.push(o)}}(e,t,o),function(e,t){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var r=e.GlobalSettings.AmbientColor.value,a=r[0],i=r[1],o=r[2];if(0!==a||0!==i||0!==o){var s=new n.Color(a,i,o);t.add(new n.AmbientLight(s,1))}}}(e,o),o}(o,h,A.skeletons,E,_)}});var d=[];function h(e,t,r,a){var n;switch(a.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=r;break;case"AllSame":n=a.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+a.mappingType)}"IndexToDirect"===a.referenceType&&(n=a.indices[n]);var i=n*a.dataSize,o=i+a.dataSize;return function(e,t,r,a){for(var n=r,i=0;n1?s=l:l.length>0?s=l[0]:(s=new n.MeshPhongMaterial({color:13421772}),l.push(s)),"color"in o.attributes&&l.forEach((function(e){e.vertexColors=n.VertexColors})),o.FBX_Deformer?(l.forEach((function(e){e.skinning=!0})),i=new n.SkinnedMesh(o,s)):i=new n.Mesh(o,s),i}function y(e,t){var r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),a=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,a)}function b(e,t,r){if("RotationOrder"in r){var a=parseInt(r.RotationOrder.value,10);a>0&&a<6?console.warn("THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.",["XYZ","XZY","YZX","ZXY","YXZ","ZYX","SphericXYZ"][a]):6===a&&console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.")}if("Lcl_Translation"in r&&t.position.fromArray(r.Lcl_Translation.value),"Lcl_Rotation"in r){var i=r.Lcl_Rotation.value.map(n.Math.degToRad);i.push("ZYX"),t.quaternion.setFromEuler((new n.Euler).fromArray(i))}if("Lcl_Scaling"in r&&t.scale.fromArray(r.Lcl_Scaling.value),"PreRotation"in r){var o=r.PreRotation.value.map(n.Math.degToRad);o[3]="ZYX";var s=(new n.Euler).fromArray(o);s=(new n.Quaternion).setFromEuler(s),t.quaternion.premultiply(s)}}function w(e){var t=[];return e.layer.forEach((function(e){t=t.concat(function(e){var t=[];if(void 0!==e.T&&Object.keys(e.T.curves).length>0){var r=x(e.modelName,e.T.curves,e.initialPosition,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=function(e,t,r,a){void 0!==t.x&&(E(t.x),t.x.values=t.x.values.map(n.Math.degToRad));void 0!==t.y&&(E(t.y),t.y.values=t.y.values.map(n.Math.degToRad));void 0!==t.z&&(E(t.z),t.z.values=t.z.values.map(n.Math.degToRad));var i=A(t),o=_(i,t,r);void 0!==a&&((a=a.map(n.Math.degToRad)).push("ZYX"),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a));for(var s=new n.Quaternion,l=new n.Euler,u=[],c=0;c0){var i=x(e.modelName,e.S.curves,e.initialScale,"scale");void 0!==i&&t.push(i)}return t}(e))})),new n.AnimationClip(e.name,-1,t)}function x(e,t,r,a){var i=A(t),o=_(i,t,r);return new n.VectorKeyframeTrack(e+"."+a,i,o)}function _(e,t,r){var a=r,n=[],i=-1,o=-1,s=-1;return e.forEach((function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(s=t.z.times.indexOf(e)),-1!==i){var r=t.x.values[i];n.push(r),a[0]=r}else n.push(a[0]);if(-1!==o){var l=t.y.values[o];n.push(l),a[1]=l}else n.push(a[1]);if(-1!==s){var u=t.z.values[s];n.push(u),a[2]=u}else n.push(a[2])})),n}function A(e){var t=[];return void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})).filter((function(e,t,r){return r.indexOf(e)==t}))}function E(e){for(var t=1;t=180){for(var i=n/180,o=a/i,s=r+o,l=e.times[t-1],u=(e.times[t]-l)/i,c=l+u,f=[],d=[];c1&&(r=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:r,type:a}},parseNodeProperty:function(e,t,r){var a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===a&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());var i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===a){var o=n.split(",").slice(1),s=parseInt(o[0]),l=parseInt(o[1]),u=n.split(",").slice(3);a="connections",function(e,t){for(var r=0,a=e.length,n=t.length;r=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var r={},a=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32(),i=(t>=7500?e.getUint64():e.getUint32(),e.getUint8()),o=e.getString(i);if(0===a)return null;for(var s=[],l=0;l0?s[0]:"",c=s.length>1?s[1]:"",f=s.length>2?s[2]:"";for(r.singleProperty=1===n&&e.getOffset()===a;a>e.getOffset();){var d=this.parseNode(e,t);null!==d&&this.parseSubNode(o,r,d)}return r.propertyList=s,"number"==typeof u&&(r.id=u),""!==c&&(r.attrName=c),""!==f&&(r.attrType=f),""!==o&&(r.name=o),r},parseSubNode:function(e,t,r){if(!0===r.singleProperty){var a=r.propertyList[0];Array.isArray(a)?(t[r.name]=r,r.a=a):t[r.name]=a}else if("Connections"===e&&"C"===r.name){var n=[];r.propertyList.forEach((function(e,t){0!==t&&n.push(e)})),void 0===t.connections&&(t.connections=[]),t.connections.push(n)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){var i,o=r.propertyList[0],s=r.propertyList[1],l=r.propertyList[2],u=r.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),i="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[o]={type:s,type2:l,flag:u,value:i}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var r=e.getUint32();return e.getArrayBuffer(r);case"S":r=e.getUint32();return e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var a=e.getUint32(),n=e.getUint32(),i=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}void 0===window.Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var o=new T(new Zlib.Inflate(new Uint8Array(e.getArrayBuffer(i))).decompress().buffer);switch(t){case"b":case"c":return o.getBooleanArray(a);case"d":return o.getFloat64Array(a);case"f":return o.getFloat32Array(a);case"i":return o.getInt32Array(a);case"l":return o.getInt64Array(a)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}),Object.assign(T.prototype,{getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],r=0;r=0&&(t=t.slice(0,a)),n.LoaderUtils.decodeText(t)}}),Object.assign(P.prototype,{add:function(e,t){this[e]=t}}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.splitLayer=!1};n.prototype.load=function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},n.prototype.parse=function(e){var t={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},r=[],n=void 0,i=new a.LineBasicMaterial({color:16711680});i.name="path";var o=new a.LineBasicMaterial({color:65280});function s(e){n={vertex:[],pathVertex:[],z:e.z},r.push(n)}function l(e,r){return t.relative?r:r-e}function u(e,r){return t.relative?e+r:r}o.name="extruded";for(var c,f,d=e.replace(/;.+/g,"").split("\n"),h=0;h0&&(g.extruding=l(t.e,g.e)>0,null!=n&&g.z==n.z||s(g)),c=t,f=g,void 0===n&&s(c),g.extruding?(n.vertex.push(c.x,c.y,c.z),n.vertex.push(f.x,f.y,f.z)):(n.pathVertex.push(c.x,c.y,c.z),n.pathVertex.push(f.x,f.y,f.z)),t=g}else if("G2"===m||"G3"===m)console.warn("THREE.GCodeLoader: Arc command not supported");else if("G90"===m)t.relative=!1;else if("G91"===m)t.relative=!0;else if("G92"===m){(g=t).x=void 0!==v.x?v.x:g.x,g.y=void 0!==v.y?v.y:g.y,g.z=void 0!==v.z?v.z:g.z,g.e=void 0!==v.e?v.e:g.e,t=g}else console.warn("THREE.GCodeLoader: Command not supported:"+m)}function y(e,t){var r=new a.BufferGeometry;r.addAttribute("position",new a.Float32BufferAttribute(e,3));var n=new a.LineSegments(r,t?o:i);n.name="layer"+h,b.add(n)}var b=new a.Group;if(b.name="gcode",this.splitLayer)for(h=0;h>16&32768,i=a>>12&2047,o=a>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&a):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)}return function(e,t,a,n){var i=e[t+3],o=Math.pow(2,i-128)/255;a[n+0]=r(e[t+0]*o),a[n+1]=r(e[t+1]*o),a[n+2]=r(e[t+2]*o)}}(),l=new n.CubeTexture;l.type=e,l.encoding=e===n.UnsignedByteType?n.RGBEEncoding:n.LinearEncoding,l.format=e===n.UnsignedByteType?n.RGBAFormat:n.RGBFormat,l.minFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.magFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.generateMipmaps=l.encoding!==n.RGBEEncoding,l.anisotropy=0;var u=this.hdrLoader,c=0;function f(r,a,i,f){var d=new n.FileLoader(this.manager);d.setResponseType("arraybuffer"),d.load(t[r],(function(t){c++;var i=u._parser(t);if(i){if(e===n.FloatType){for(var f=i.data.length/4*3,d=new Float32Array(f),h=0;h>8&65280|e>>24&255},e.prototype.mipmaps=function(t){for(var r=[],a=e.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight,o=t?this.numberOfMipmapLevels:1,s=0;s0?o():t(n.mergeVmds(i))}),r,a)}()},s.prototype.loadAudio=function(e,t,r,n){var i=new a.AudioListener,o=new a.Audio(i);new a.AudioLoader(this.manager).load(e,(function(e){o.setBuffer(e),t(o,i)}),r,n)},s.prototype.loadVpd=function(e,t,r,a,n){var i=this;(n&&"unicode"===n.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this)(e,(function(e){t(i.parseVpd(e))}),r,a)},s.prototype.parseModel=function(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}},s.prototype.parsePmd=function(e){return this.parser.parsePmd(e,!0)},s.prototype.parsePmx=function(e){return this.parser.parsePmx(e,!0)},s.prototype.parseVmd=function(e){return this.parser.parseVmd(e,!0)},s.prototype.parseVpd=function(e){return this.parser.parseVpd(e,!0)},s.prototype.mergeVmds=function(e){return this.parser.mergeVmds(e)},s.prototype.pourVmdIntoModel=function(e,t,r){this.createAnimation(e,t,r)},s.prototype.pourVmdIntoCamera=function(e,t,r){var n=new s.DataCreationHelper;!function(){for(var i,o,l=n.createOrderedMotionArray(t.cameras),u=[],c=[],f=[],d=[],h=[],p=[],m=[],v=[],g=[],y=new a.Quaternion,b=new a.Euler,w=new a.Vector3,x=new a.Vector3,_=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},A=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},E=function(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();for(var o=n.length/r.length,l=3===o?12:4,u=1,c=2,f=r.length;cu){r[u]=r[c];for(d=0;d=a?r.skinIndices[a]:0);for(a=0;a<4;a++)l.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t=0&&(l.limitation=new a.Vector3(1,0,0)),s.links.push(l)}t.push(s)}else for(r=0;r=0?c:u);var p=h.load(s,(function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,n=t.height;f.width=r,f.height=n,d.clearRect(0,0,r,n),d.translate(r/2,n/2),d.rotate(.5*Math.PI),d.translate(-r/2,-n/2),d.drawImage(t,0,0),e.image=d.getImageData(0,0,r,n)}e.flipY=!1,e.wrapS=a.RepeatWrapping,e.wrapT=a.RepeatWrapping;for(var i=0;i=0?(x.push(w.slice(0,_)),x.push(w.slice(_+1))):x.push(w);for(var A=0;A=0||E.indexOf(".spa")>=0?(b.envMap=m(E,{sphericalReflectionMapping:!0}),E.indexOf(".sph")>=0?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation):b.map=m(E)}}}else{if(-1!==y.textureIndex){var E=e.textures[y.textureIndex];b.map=m(E)}if(-1!==y.envTextureIndex&&(1===y.envFlag||2==y.envFlag)){E=e.textures[y.envTextureIndex];b.envMap=m(E,{sphericalReflectionMapping:!0}),1===y.envFlag?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation}}var S=void 0===b.map?1:.2;b.emissive=new a.Color(y.ambient[0]*S,y.ambient[1]*S,y.ambient[2]*S),p.push(b)}for(g=0;g0,y.morphTargets=o.morphTargets.length>0,y.lights=!0,y.side="pmx"===e.metadata.format&&1==(1&T.flag)?a.DoubleSide:M.side,y.transparent=M.transparent,y.fog=!0,y.blending=a.CustomBlending,y.blendSrc=a.SrcAlphaFactor,y.blendDst=a.OneMinusSrcAlphaFactor,y.blendSrcAlpha=a.SrcAlphaFactor,y.blendDstAlpha=a.DstAlphaFactor,void 0!==M.map){y.faceOffset=M.faceOffset,y.faceNum=M.faceNum,y.map=v(M.map,l),function(e){e.map.readyCallbacks.push((function(t){function r(e,t){var r=e.width,a=e.height,n=Math.round(t.x*r)%r,i=Math.round(t.y*a)%a;n<0&&(n+=r),i<0&&(i+=a);var o=i*r+n;return e.data[4*o+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),n=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var n=e.width,i=e.height;if(e.data.length/(n*i)!=4)return!1;for(var o=0;o=this.duration;)this.currentTime-=this.duration;return!(this.currentTime=this.duration}},a.MMDGrantSolver=function(e){this.mesh=e},a.MMDGrantSolver.prototype={constructor:a.MMDGrantSolver,update:(o=new a.Quaternion,function(){for(var e=0;e0)}},setAnimations:function(){for(var e=0;e0&&0!==e.action._clip.tracks[0].name.indexOf(".bones")||(e.target._root.looped=!0)}));for(var t=!1,r=!1,n=0;n0&&0===i.tracks[0].name.indexOf(".morphTargetInfluences")?r||(o.play(),r=!0):t||(o.play(),t=!0)}t&&(e.ikSolver=new a.CCDIKSolver(e),void 0!==e.geometry.grants&&(e.grantSolver=new a.MMDGrantSolver(e)))}},setCameraAnimation:function(e){void 0!==e.animations&&(e.mixer=new a.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())},unifyAnimationDuration:function(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,n=0;n0,i=!0,s={};var l=function(e,n){null==n&&(n=1);var o=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,o=2;break;case"sshort":s=Int16Array,o=2;break;case"uint":s=Uint32Array,o=4;break;case"sint":s=Int32Array,o=4;break;case"float":s=Float32Array,o=4;break;case"complex":case"double":s=Float64Array,o=8}var l=new s(t.slice(r,r+=n*o));return a!=i&&(l=function(e,t){for(var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=0;ai;n--,i++){var o=r[i];r[i]=r[n],r[n]=o}return e}(l,o)),1==n?l[0]:l}("uchar",e.byteLength),u=l.length,c=null,f=0;for(p=1;p13)&&32!==a?n+=String.fromCharCode(a):(""!==n&&(l[u]=c(n,o),u++),n="");return""!==n&&(l[u]=c(n,o),u++),l}(t);else if("raw"===s.encoding){for(var h=new Uint8Array(t.length),p=0;p0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,n=this.object.geometry.vertices;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){var a=this.normals,n=this.object.geometry.normals;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addColor:function(e,t,r){var a=this.colors,n=this.object.geometry.colors;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addUV:function(e,t,r){var a=this.uvs,n=this.object.geometry.uvs;n.push(a[e+0],a[e+1]),n.push(a[t+0],a[t+1]),n.push(a[r+0],a[r+1])},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,a,n,i,o,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),f=this.parseVertexIndex(t,u),d=this.parseVertexIndex(r,u);if(this.addVertex(c,f,d),void 0!==a&&""!==a){var h=this.uvs.length;c=this.parseUVIndex(a,h),f=this.parseUVIndex(n,h),d=this.parseUVIndex(i,h),this.addUV(c,f,d)}if(void 0!==o&&""!==o){var p=this.normals.length;c=this.parseNormalIndex(o,p),f=o===s?c:this.parseNormalIndex(s,p),d=o===l?c:this.parseNormalIndex(l,p),this.addNormal(c,f,d)}this.colors.length>0&&this.addColor(c,f,d)},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,r=0,a=e.length;r0){var w=b.split("/");v.push(w)}}var x=v[0];for(g=1,y=v.length-1;g1){var C=c[1].trim().toLowerCase();o.object.smooth="0"!==C&&"off"!==C}else o.object.smooth=!0;(Y=o.object.currentMaterial())&&(Y.smooth=o.object.smooth)}o.finalize();var k=new a.Group;k.materialLibraries=[].concat(o.materialLibraries);for(d=0,h=o.objects.length;d0?B.addAttribute("normal",new a.Float32BufferAttribute(I.normals,3)):B.computeVertexNormals(),I.colors.length>0&&(j=!0,B.addAttribute("color",new a.Float32BufferAttribute(I.colors,3))),I.uvs.length>0&&B.addAttribute("uv",new a.Float32BufferAttribute(I.uvs,2));for(var V,z=[],G=0,H=N.length;G1){for(G=0,H=N.length;Gf){f=d;var r='Download of "'+e.url+'": '+(100*d).toFixed(2)+"%";u.onProgress("progressLoad",r,d)}}}var h=new a.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.load(e.url,c,i,o)}},r.prototype.run=function(e,r){this._applyPrepData(e);var a=e.checkResourceDescriptorFiles(e.resources,[{ext:"obj",type:"ArrayBuffer",ignore:!1},{ext:"mtl",type:"String",ignore:!1},{ext:"zip",type:"String",ignore:!0}]);t.isValid(r)&&(this.terminateWorkerOnLoad=!1,this.workerSupport=r,this.logging.enabled=this.workerSupport.logging.enabled,this.logging.debug=this.workerSupport.logging.debug);var n=this;this._loadMtl(a.mtl,(function(t){null!==t&&n.meshBuilder.setMaterials(t),n._loadObj(a.obj,n.callbacks.onLoad,null,null,n.callbacks.onMeshAlter,e.useAsync)}),e.crossOrigin,e.materialOptions)},r.prototype._applyPrepData=function(e){t.isValid(e)&&(this.setLogging(e.logging.enabled,e.logging.debug),this.setModelName(e.modelName),this.setStreamMeshesTo(e.streamMeshesTo),this.meshBuilder.setMaterials(e.materials),this.setUseIndices(e.useIndices),this.setDisregardNormals(e.disregardNormals),this.setMaterialPerSmoothingGroup(e.materialPerSmoothingGroup),this._setCallbacks(e.getCallbacks()))},r.prototype.parse=function(e){if(!t.isValid(e))return console.warn("Provided content is not a valid ArrayBuffer or String."),this.loaderRootNode;this.logging.enabled&&console.time("OBJLoader2 parse: "+this.modelName),this.meshBuilder.init();var r=new o;r.setLogging(this.logging.enabled,this.logging.debug),r.setMaterialPerSmoothingGroup(this.materialPerSmoothingGroup),r.setUseIndices(this.useIndices),r.setDisregardNormals(this.disregardNormals),r.setMaterials(this.meshBuilder.getMaterials());var a=this;r.setCallbackMeshBuilder((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}));if(r.setCallbackProgress((function(e,t){a.onProgress("progressParse",e,t)})),e instanceof ArrayBuffer||e instanceof Uint8Array)this.logging.enabled&&console.info("Parsing arrayBuffer..."),r.parse(e);else{if(!("string"==typeof e||e instanceof String))throw"Provided content was neither of type String nor Uint8Array! Aborting...";this.logging.enabled&&console.info("Parsing text..."),r.parseText(e)}return this.logging.enabled&&console.timeEnd("OBJLoader2 parse: "+this.modelName),this.loaderRootNode},r.prototype.parseAsync=function(e,r){var a=this,n=!1,i=function(){r({detail:{loaderRootNode:a.loaderRootNode,modelName:a.modelName,instanceNo:a.instanceNo}}),n&&a.logging.enabled&&console.timeEnd("OBJLoader2 parseAsync: "+a.modelName)};t.isValid(e)?n=!0:(console.warn("Provided content is not a valid ArrayBuffer."),i()),n&&this.logging.enabled&&console.time("OBJLoader2 parseAsync: "+this.modelName),this.meshBuilder.init();this.workerSupport.validate((function(e,r){var a="";return a+="/**\n",a+=" * This code was constructed by OBJLoader2 buildCode.\n",a+=" */\n\n",a+="THREE = { LoaderSupport: {} };\n\n",a+=e("LoaderSupport.Validator",t),a+=r("Parser",o)}),"Parser"),this.workerSupport.setCallbacks((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}),i),a.terminateWorkerOnLoad&&this.workerSupport.setTerminateRequested(!0);var s={},l=this.meshBuilder.getMaterials();for(var u in l)s[u]=u;this.workerSupport.run({params:{useAsync:!0,materialPerSmoothingGroup:this.materialPerSmoothingGroup,useIndices:this.useIndices,disregardNormals:this.disregardNormals},logging:{enabled:this.logging.enabled,debug:this.logging.debug},materials:{materials:s},data:{input:e,options:null}})};var o=function(){function e(){this.callbackProgress=null,this.callbackMeshBuilder=null,this.contentRef=null,this.legacyMode=!1,this.materials={},this.useAsync=!1,this.materialPerSmoothingGroup=!1,this.useIndices=!1,this.disregardNormals=!1,this.vertices=[],this.colors=[],this.normals=[],this.uvs=[],this.rawMesh={objectName:"",groupName:"",activeMtlName:"",mtllibName:"",faceType:-1,subGroups:[],subGroupInUse:null,smoothingGroup:{splitMaterials:!1,normalized:-1,real:-1},counts:{doubleIndicesCount:0,faceCount:0,mtlCount:0,smoothingGroupCount:0}},this.inputObjectCount=1,this.outputObjectCount=1,this.globalCounts={vertices:0,faces:0,doubleIndicesCount:0,lineByte:0,currentByte:0,totalBytes:0},this.logging={enabled:!0,debug:!1}}return e.prototype.resetRawMesh=function(){this.rawMesh.subGroups=[],this.rawMesh.subGroupInUse=null,this.rawMesh.smoothingGroup.normalized=-1,this.rawMesh.smoothingGroup.real=-1,this.pushSmoothingGroup(1),this.rawMesh.counts.doubleIndicesCount=0,this.rawMesh.counts.faceCount=0,this.rawMesh.counts.mtlCount=0,this.rawMesh.counts.smoothingGroupCount=0},e.prototype.setUseAsync=function(e){this.useAsync=e},e.prototype.setMaterialPerSmoothingGroup=function(e){this.materialPerSmoothingGroup=e},e.prototype.setUseIndices=function(e){this.useIndices=e},e.prototype.setDisregardNormals=function(e){this.disregardNormals=e},e.prototype.setMaterials=function(e){this.materials=n.default.Validator.verifyInput(e,this.materials),this.materials=n.default.Validator.verifyInput(this.materials,{})},e.prototype.setCallbackMeshBuilder=function(e){if(!n.default.Validator.isValid(e))throw'Unable to run as no "MeshBuilder" callback is set.';this.callbackMeshBuilder=e},e.prototype.setCallbackProgress=function(e){this.callbackProgress=e},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.configure=function(){if(this.pushSmoothingGroup(1),this.logging.enabled){var e=Object.keys(this.materials),t="OBJLoader2.Parser configuration:"+(e.length>0?"\n\tmaterialNames:\n\t\t- "+e.join("\n\t\t- "):"\n\tmaterialNames: None")+"\n\tuseAsync: "+this.useAsync+"\n\tmaterialPerSmoothingGroup: "+this.materialPerSmoothingGroup+"\n\tuseIndices: "+this.useIndices+"\n\tdisregardNormals: "+this.disregardNormals+"\n\tcallbackMeshBuilderName: "+this.callbackMeshBuilder.name+"\n\tcallbackProgressName: "+this.callbackProgress.name;console.info(t)}},e.prototype.parse=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parse"),this.configure();var t=new Uint8Array(e);this.contentRef=t;var r=t.byteLength;this.globalCounts.totalBytes=r;for(var a,n=new Array(128),i="",o=0,s=0,l=0;l0&&(n[o++]=i),i="";break;case 47:i.length>0&&(n[o++]=i),s++,i="";break;case 10:i.length>0&&(n[o++]=i),i="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=l,this.processLine(n,o,s),o=0,s=0;break;case 13:break;default:i+=String.fromCharCode(a)}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parse")},e.prototype.parseText=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parseText"),this.configure(),this.legacyMode=!0,this.contentRef=e;var t=e.length;this.globalCounts.totalBytes=t;for(var r,a=new Array(128),n="",i=0,o=0,s=0;s0&&(a[i++]=n),n="";break;case"/":n.length>0&&(a[i++]=n),o++,n="";break;case"\n":n.length>0&&(a[i++]=n),n="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=s,this.processLine(a,i,o),i=0,o=0;break;case"\r":break;default:n+=r}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parseText")},e.prototype.processLine=function(e,t,r){if(!(t<1)){var a,n,i,o,s=function(e,t,r,a){var n="";if(a>r){var i;if(t)for(i=r;i4&&(this.colors.push(parseFloat(e[4])),this.colors.push(parseFloat(e[5])),this.colors.push(parseFloat(e[6])));break;case"vt":this.uvs.push(parseFloat(e[1])),this.uvs.push(parseFloat(e[2]));break;case"vn":this.normals.push(parseFloat(e[1])),this.normals.push(parseFloat(e[2])),this.normals.push(parseFloat(e[3]));break;case"f":if(a=t-1,0===r)for(this.checkFaceType(0),i=2,n=a;i0?n-1:n+a.vertices.length/3),o=a.rawMesh.subGroupInUse.vertices;o.push(a.vertices[i++]),o.push(a.vertices[i++]),o.push(a.vertices[i]);var s=a.colors.length>0?i:null;if(null!==s){var l=a.rawMesh.subGroupInUse.colors;l.push(a.colors[s++]),l.push(a.colors[s++]),l.push(a.colors[s])}if(t){var u=parseInt(t),c=2*(u>0?u-1:u+a.uvs.length/2),f=a.rawMesh.subGroupInUse.uvs;f.push(a.uvs[c++]),f.push(a.uvs[c])}if(r){var d=parseInt(r),h=3*(d>0?d-1:d+a.normals.length/3),p=a.rawMesh.subGroupInUse.normals;p.push(a.normals[h++]),p.push(a.normals[h++]),p.push(a.normals[h])}};if(this.useIndices){var o=e+(t?"_"+t:"_n")+(r?"_"+r:"_n"),s=this.rawMesh.subGroupInUse.indexMappings[o];n.default.Validator.isValid(s)?this.rawMesh.counts.doubleIndicesCount++:(s=this.rawMesh.subGroupInUse.vertices.length/3,i(),this.rawMesh.subGroupInUse.indexMappings[o]=s,this.rawMesh.subGroupInUse.indexMappingsCount++),this.rawMesh.subGroupInUse.indices.push(s)}else i();this.rawMesh.counts.faceCount++},e.prototype.createRawMeshReport=function(e){return"Input Object number: "+e+"\n\tObject name: "+this.rawMesh.objectName+"\n\tGroup name: "+this.rawMesh.groupName+"\n\tMtllib name: "+this.rawMesh.mtllibName+"\n\tVertex count: "+this.vertices.length/3+"\n\tNormal count: "+this.normals.length/3+"\n\tUV count: "+this.uvs.length/2+"\n\tSmoothingGroup count: "+this.rawMesh.counts.smoothingGroupCount+"\n\tMaterial count: "+this.rawMesh.counts.mtlCount+"\n\tReal MeshOutputGroup count: "+this.rawMesh.subGroups.length},e.prototype.finalizeRawMesh=function(){var e,t,r=[],a=0,n=0,i=0,o=0,s=0,l=0;for(var u in this.rawMesh.subGroups)if((e=this.rawMesh.subGroups[u]).vertices.length>0){if((t=e.indices).length>0&&n>0)for(var c in t)t[c]=t[c]+n;r.push(e),a+=e.vertices.length,n+=e.indexMappingsCount,i+=e.indices.length,o+=e.colors.length,l+=e.uvs.length,s+=e.normals.length}var f=null;return r.length>0&&(f={name:""!==this.rawMesh.groupName?this.rawMesh.groupName:this.rawMesh.objectName,subGroups:r,absoluteVertexCount:a,absoluteIndexCount:i,absoluteColorCount:o,absoluteNormalCount:s,absoluteUvCount:l,faceCount:this.rawMesh.counts.faceCount,doubleIndicesCount:this.rawMesh.counts.doubleIndicesCount}),f},e.prototype.processCompletedMesh=function(){var e=this.finalizeRawMesh();if(n.default.Validator.isValid(e)){if(this.colors.length>0&&this.colors.length!==this.vertices.length)throw"Vertex Colors were detected, but vertex count and color count do not match!";this.logging.enabled&&this.logging.debug&&console.debug(this.createRawMeshReport(this.inputObjectCount)),this.inputObjectCount++,this.buildMesh(e);var t=this.globalCounts.currentByte/this.globalCounts.totalBytes;return this.callbackProgress("Completed [o: "+this.rawMesh.objectName+" g:"+this.rawMesh.groupName+"] Total progress: "+(100*t).toFixed(2)+"%",t),this.resetRawMesh(),!0}return!1},e.prototype.buildMesh=function(e){var t=e.subGroups,r=new Float32Array(e.absoluteVertexCount);this.globalCounts.vertices+=e.absoluteVertexCount/3,this.globalCounts.faces+=e.faceCount,this.globalCounts.doubleIndicesCount+=e.doubleIndicesCount;var a,i,o,s,l,u,c,f=e.absoluteIndexCount>0?new Uint32Array(e.absoluteIndexCount):null,d=e.absoluteColorCount>0?new Float32Array(e.absoluteColorCount):null,h=e.absoluteNormalCount>0?new Float32Array(e.absoluteNormalCount):null,p=e.absoluteUvCount>0?new Float32Array(e.absoluteUvCount):null,m=n.default.Validator.isValid(d),v=[],g=t.length>1,y=0,b=[],w=[],x=0,_=0,A=0,E=0,S=0,M=0,T=0;for(var P in t)if(t.hasOwnProperty(P)){if(c=(a=t[P]).materialName,u=this.rawMesh.faceType<4?c+(m?"_vertexColor":"")+(0===a.smoothingGroup?"_flat":""):6===this.rawMesh.faceType?"defaultPointMaterial":"defaultLineMaterial",s=this.materials[c],l=this.materials[u],!n.default.Validator.isValid(s)&&!n.default.Validator.isValid(l)){var F=m?"defaultVertexColorMaterial":"defaultMaterial";s=this.materials[F],this.logging.enabled&&console.warn('object_group "'+a.objectName+"_"+a.groupName+'" was defined with unresolvable material "'+c+'"! Assigning "'+F+'".'),(c=F)===u&&(l=s,u=F)}if(!n.default.Validator.isValid(l)){var O={materialNameOrg:c,materialName:u,materialProperties:{vertexColors:m?2:0,flatShading:0===a.smoothingGroup}},L={cmd:"materialData",materials:{materialCloneInstructions:O}};this.callbackMeshBuilder(L),this.useAsync&&(this.materials[u]=O)}if(g?((i=b[u])||(i=y,b[u]=y,v.push(u),y++),o={start:M,count:T=this.useIndices?a.indices.length:a.vertices.length/3,index:i},w.push(o),M+=T):v.push(u),r.set(a.vertices,x),x+=a.vertices.length,f&&(f.set(a.indices,_),_+=a.indices.length),d&&(d.set(a.colors,A),A+=a.colors.length),h&&(h.set(a.normals,E),E+=a.normals.length),p&&(p.set(a.uvs,S),S+=a.uvs.length),this.logging.enabled&&this.logging.debug){var C=n.default.Validator.isValid(i)?"\n\t\tmaterialIndex: "+i:"",k="\tOutput Object no.: "+this.outputObjectCount+"\n\t\tgroupName: "+a.groupName+"\n\t\tIndex: "+a.index+"\n\t\tfaceType: "+this.rawMesh.faceType+"\n\t\tmaterialName: "+a.materialName+"\n\t\tsmoothingGroup: "+a.smoothingGroup+C+"\n\t\tobjectName: "+a.objectName+"\n\t\t#vertices: "+a.vertices.length/3+"\n\t\t#indices: "+a.indices.length+"\n\t\t#colors: "+a.colors.length/3+"\n\t\t#uvs: "+a.uvs.length/2+"\n\t\t#normals: "+a.normals.length/3;console.debug(k)}}this.outputObjectCount++,this.callbackMeshBuilder({cmd:"meshData",progress:{numericalValue:this.globalCounts.currentByte/this.globalCounts.totalBytes},params:{meshName:e.name},materials:{multiMaterial:g,materialNames:v,materialGroups:w},buffers:{vertices:r,indices:f,colors:d,normals:h,uvs:p},geometryType:this.rawMesh.faceType<4?0:6===this.rawMesh.faceType?2:1},[r.buffer],n.default.Validator.isValid(f)?[f.buffer]:null,n.default.Validator.isValid(d)?[d.buffer]:null,n.default.Validator.isValid(h)?[h.buffer]:null,n.default.Validator.isValid(p)?[p.buffer]:null)},e.prototype.finalizeParsing=function(){if(this.logging.enabled&&console.info("Global output object count: "+this.outputObjectCount),this.processCompletedMesh()&&this.logging.enabled){var e="Overall counts: \n\tVertices: "+this.globalCounts.vertices+"\n\tFaces: "+this.globalCounts.faces+"\n\tMultiple definitions: "+this.globalCounts.doubleIndicesCount;console.info(e)}},e}();return r.prototype.loadMtl=function(e,t,r,a,i){var o=new n.default.ResourceDescriptor(e,"MTL");o.setContent(t),this._loadMtl(o,r,a,i)},r.prototype._loadMtl=function(e,r,n,o){void 0===i.default&&console.error('"THREE.MTLLoader" is not available. "THREE.OBJLoader2" requires it for loading MTL files.'),t.isValid(e)&&this.logging.enabled&&console.time("Loading MTL: "+e.name);var s=[],l=this,u=function(a){var n=[];if(t.isValid(a))for(var i in a.preload(),n=a.materials)n.hasOwnProperty(i)&&(s[i]=n[i]);t.isValid(e)&&l.logging.enabled&&console.timeEnd("Loading MTL: "+e.name),r(s,a)};if(t.isValid(e)&&(t.isValid(e.content)||t.isValid(e.url))){var c=new i.default(this.manager);if(n=t.verifyInput(n,"anonymous"),c.setCrossOrigin(n),c.setPath(e.path),t.isValid(o)&&c.setMaterialOptions(o),t.isValid(e.content))u(t.isValid(e.content)?c.parse(e.content):null);else if(t.isValid(e.url)){new a.FileLoader(this.manager).load(e.url,(function(t){e.content=t,u(c.parse(t))}),this._onProgress,this._onError)}}else u()},r}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.littleEndian=!0};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(e,(function(r){t(i.parse(r,e))}),r,n)},parse:function(e,t){var r=a.LoaderUtils.decodeText(e),n=function(e){var t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),a=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=a[1],t.headerLen=a[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(var n=0,i=t.fields.length;n0&&v.addAttribute("position",new a.Float32BufferAttribute(i,3)),o.length>0&&v.addAttribute("normal",new a.Float32BufferAttribute(o,3)),s.length>0&&v.addAttribute("color",new a.Float32BufferAttribute(s,3)),v.computeBoundingSphere();var g=new a.PointsMaterial({size:.005});s.length>0?g.vertexColors=!0:g.color.setHex(16777215*Math.random());var y=new a.Points(v,g),b=t.split("").reverse().join("");return b=(b=/([^\/]*)/.exec(b))[1].split("").reverse().join(""),y.name=b,y}console.error("THREE.PCDLoader: binary_compressed files are not supported")}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function n(e,t){var r=parseInt(m[v].substr(e,t));if(r){var a=function(e,t){return"s"+Math.min(e,t)+"e"+Math.max(e,t)}(y,r);void 0===p[a]&&(d.push([y-1,r-1,1]),p[a]=d.length-1)}}for(var i,o,s,l,u,c={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},f=[],d=[],h={},p={},m=e.split("\n"),v=0,g=m.length;v=t.elements[u].count&&(u++,c=0);var h=n(t.elements[u].properties,d);s(a,t.elements[u].name,h),c++}}return o(a)}function o(e){var t=new a.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.addAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.addAttribute("normal",new a.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.addAttribute("uv",new a.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.addAttribute("color",new a.Float32BufferAttribute(e.colors,3)),t.computeBoundingSphere(),t}function s(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){var a=r.vertex_indices||r.vertex_index;3===a.length?e.indices.push(a[0],a[1],a[2]):4===a.length&&(e.indices.push(a[0],a[1],a[3]),e.indices.push(a[1],a[2],a[3]))}}function l(e,t,r,a){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,a),2];case"uint16":case"ushort":return[e.getUint16(t,a),2];case"int32":case"int":return[e.getInt32(t,a),4];case"uint32":case"uint":return[e.getUint32(t,a),4];case"float32":case"float":return[e.getFloat32(t,a),4];case"float64":case"double":return[e.getFloat64(t,a),8]}}function u(e,t,r,a){for(var n,i={},o=0,s=0;s>7&1),s=n>>6&1,l=1==(n>>5&1),u=31&n,c=0,f=0;if(l?(c=(t[2]<<16)+(t[3]<<8)+t[4],f=(t[5]<<16)+(t[6]<<8)+t[7]):(c=t[2]+(t[3]<<8)+(t[4]<<16),f=t[5]+(t[6]<<8)+(t[7]<<16)),0===a)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==a)throw new Error("PRWM decoder: Unsupported format version: "+a);if(!o){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==f)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}var d,h,p,m,v,g,y,b,w=8,x={};for(b=0;b>7&1,m=1+(n>>4&3),w++,g=i(e,v=r[15&n],w=4*Math.ceil(w/4),m*c,l),w+=v.BYTES_PER_ELEMENT*m*c,x[d]={type:p,cardinality:m,values:g}}return w=4*Math.ceil(w/4),y=null,o&&(y=i(e,1===s?Uint32Array:Uint16Array,w,f,l)),{version:a,attributes:x,indices:y}}(e),s=Object.keys(o.attributes),l=new a.BufferGeometry;for(n=0;n0;return 25===h?(r=p?a.RGBA_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,t=4):24===h?(r=p?a.RGBA_PVRTC_2BPPV1_Format:a.RGB_PVRTC_2BPPV1_Format,t=2):console.error("THREE.PVRLoader: Unknown PVR format:",h),e.dataPtr=o,e.bpp=t,e.format=r,e.width=l,e.height=s,e.numSurfaces=d,e.numMipmaps=u+1,e.isCubemap=6===d,n._extract(e)},n._extract=function(e){var t,r={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},a=e.buffer,n=e.dataPtr,i=e.bpp,o=e.numSurfaces,s=0,l=0,u=0,c=0,f=0;2===i?(l=8,u=4):(l=4,u=4),t=l*u*i/8,r.mipmaps.length=e.numMipmaps*o;for(var d=0;d>d,p=e.height>>d;(c=h/l)<2&&(c=2),(f=p/u)<2&&(f=2),s=c*f*t;for(var m=0;m>5&31)/31,n=(_>>10&31)/31):(t=o,r=s,n=l)}for(var A=1;A<=3;A++){var E=y+12*A;m.push(c.getFloat32(E,!0)),m.push(c.getFloat32(E+4,!0)),m.push(c.getFloat32(E+8,!0)),v.push(b,w,x),d&&i.push(t,r,n)}}return p.addAttribute("position",new a.BufferAttribute(new Float32Array(m),3)),p.addAttribute("normal",new a.BufferAttribute(new Float32Array(v),3)),d&&(p.addAttribute("color",new a.BufferAttribute(new Float32Array(i),3)),p.hasColors=!0,p.alpha=u),p}(r):function(e){for(var t,r=new a.BufferGeometry,n=/facet([\s\S]*?)endfacet/g,i=0,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+o+o+o,"g"),l=new RegExp("normal"+o+o+o,"g"),u=[],c=[],f=new a.Vector3;null!==(t=n.exec(e));){for(var d=0,h=0,p=t[0];null!==(t=l.exec(p));)f.x=parseFloat(t[1]),f.y=parseFloat(t[2]),f.z=parseFloat(t[3]),h++;for(;null!==(t=s.exec(p));)u.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),c.push(f.x,f.y,f.z),d++;1!==h&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==d&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}return r.addAttribute("position",new a.Float32BufferAttribute(u,3)),r.addAttribute("normal",new a.Float32BufferAttribute(c,3)),r}("string"!=typeof(t=e)?a.LoaderUtils.decodeText(new Uint8Array(t)):t)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e,t,a,n,i,o,s,l){n=n*Math.PI/180,t=Math.abs(t),a=Math.abs(a);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,f=Math.cos(n)*u+Math.sin(n)*c,d=-Math.sin(n)*u+Math.cos(n)*c,h=t*t,p=a*a,m=f*f,v=d*d,g=m/h+v/p;if(g>1){var y=Math.sqrt(g);h=(t*=y)*t,p=(a*=y)*a}var b=h*v+p*m,w=(h*p-b)/b,x=Math.sqrt(Math.max(0,w));i===o&&(x=-x);var _=x*t*d/a,A=-x*a*f/t,E=Math.cos(n)*_-Math.sin(n)*A+(s.x+l.x)/2,S=Math.sin(n)*_+Math.cos(n)*A+(s.y+l.y)/2,M=r(1,0,(f-_)/t,(d-A)/a),T=r((f-_)/t,(d-A)/a,(-f-_)/t,(-d-A)/a)%(2*Math.PI);e.currentPath.absellipse(E,S,t,a,M,M+T,0===o,n)}function r(e,t,r,a){var n=e*r+t*a,i=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+a*a),o=Math.acos(Math.max(-1,Math.min(1,n/i)));return e*a-t*r<0&&(o=-o),o}function n(e,t){return t=Object.assign({},t),e.hasAttribute("fill")&&(t.fill=e.getAttribute("fill")),""!==e.style.fill&&(t.fill=e.style.fill),t}function i(e){return"none"!==e.fill&&"transparent"!==e.fill}function o(e,t){return 2*e-(t-e)}function s(e){for(var t=e.split(/[\s,]+|(?=\s?[+\-])/),r=0;r0){var p=[];for(u=0;u=t.end)return 0;this.position=t.cur;try{var r=this.readChunk(e);return t.cur+=r.size,r.id}catch(e){return this.debugMessage("Unable to read chunk at "+this.position),0}},resetPosition:function(){this.position-=6},readByte:function(e){var t=e.getUint8(this.position,!0);return this.position+=1,t},readFloat:function(e){try{var t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}},readInt:function(e){var t=e.getInt32(this.position,!0);return this.position+=4,t},readShort:function(e){var t=e.getInt16(this.position,!0);return this.position+=2,t},readDWord:function(e){var t=e.getUint32(this.position,!0);return this.position+=4,t},readWord:function(e){var t=e.getUint16(this.position,!0);return this.position+=2,t},readString:function(e,t){for(var r="",a=0;a256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case a:case n:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;var g=!1,y=!1,b=!1;switch(v.image_type){case i:g=!0,y=!0;break;case r:y=!0;break;case o:g=!0;break;case a:break;case s:g=!0,b=!0;break;case n:b=!0}var w=document.createElement("canvas");w.width=v.width,w.height=v.height;var x=w.getContext("2d"),_=x.createImageData(v.width,v.height),A=function(e,t,r,a,n){var i,o,s,l;if(o=r.pixel_size>>3,s=r.width*r.height*o,t&&(l=n.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,c,f;i=new Uint8Array(s);for(var d=0,h=new Uint8Array(o);d>u){default:case d:i=0,s=1,m=t,o=0,p=1,g=r;break;case c:i=0,s=1,m=t,o=r-1,p=-1,g=-1;break;case h:i=t-1,s=-1,m=-1,o=0,p=1,g=r;break;case f:i=t-1,s=-1,m=-1,o=r-1,p=-1,g=-1}if(b)switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f++)l=s[f],e[4*(u+d*c)+0]=l,e[4*(u+d*c)+1]=l,e[4*(u+d*c)+2]=l,e[4*(u+d*c)+3]=255}(e,o,p,g,i,s,m,a);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=2)e[4*(l+f*u)+0]=s[c+0],e[4*(l+f*u)+1]=s[c+0],e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+3]=s[c+1]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s,l){var u,c,f,d=l,h=0,p=v.width;for(f=t;f!==a;f+=r)for(c=n;c!==o;c+=i,h++)u=s[h],e[4*(c+p*f)+3]=255,e[4*(c+p*f)+2]=d[3*u+0],e[4*(c+p*f)+1]=d[3*u+1],e[4*(c+p*f)+0]=d[3*u+2]}(e,o,p,g,i,s,m,a,n);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f+=2)l=s[f+0]+(s[f+1]<<8),e[4*(u+d*c)+0]=(31744&l)>>7,e[4*(u+d*c)+1]=(992&l)>>2,e[4*(u+d*c)+2]=(31&l)>>3,e[4*(u+d*c)+3]=32768&l?0:255}(e,o,p,g,i,s,m,a);break;case 24:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=3)e[4*(l+f*u)+3]=255,e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2]}(e,o,p,g,i,s,m,a);break;case 32:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=4)e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2],e[4*(l+f*u)+3]=s[c+3]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}}(_.data,v.width,v.height,A.pixel_data,A.palettes);return x.putImageData(_,0,0),w}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.reversed=!1};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){var t,r=[];e.forEach((function(e){"m"===e.type.toLowerCase()?(t=[e],r.push(t)):"z"!==e.type.toLowerCase()&&t.push(e)}));var a=[];return r.forEach((function(e){var t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};a.push(t);for(var r=e.length-1;r>0;r--){var n=e[r];t={type:n.type};void 0!==n.x2&&void 0!==n.y2?(t.x1=n.x2,t.y1=n.y2,t.x2=n.x1,t.y2=n.y1):void 0!==n.x1&&void 0!==n.y1&&(t.x1=n.x1,t.y1=n.y1),t.x=e[r-1].x,t.y=e[r-1].y,a.push(t)}})),a}return"undefined"==typeof opentype?(console.warn("THREE.TTFLoader: The loader requires opentype.js. Make sure it's included before using the loader."),null):function(e,r){for(var a=Math.round,n={},i=1e5/(72*(e.unitsPerEm||2048)),o=0;o-1;o--){var s=i[o];if(/{.*[{\[]/.test(s))(l=s.split("{").join("{\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);else if(/\].*}/.test(s)){var l;(l=s.split("]").join("]\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l)}if(/}.*}/.test(s))(l=s.split("}").join("}\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);/^\b[^\s]+\b$/.test(s.trim())?(i[o+1]=s+" "+i[o+1].trim(),i.splice(o,1)):s.indexOf("coord")>-1&&s.indexOf("[")<0&&s.indexOf("{")<0&&(i[o]+=" Coordinate {}")}var u=i.shift();return/V1.0/.exec(u)?console.warn("THREE.VRMLLoader: V1.0 not supported yet."):/V2.0/.exec(u)&&function(e,n){var i={},o=/(\b|\-|\+)([\d\.e]+)/,s=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g,l=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g;function u(e,t,r,n,i){for(var o=!0===i?1:-1,s=[],l={},u={},c=0;cu.y:m.y>=l.y&&m.y0)for(var d=0;d0&&this.indexes.push(c),c=[]):c.push(parseInt(i[d])));/]/.exec(t)&&(c.length>0&&this.indexes.push(c),c=[],this.isRecordingFaces=!1,e[this.recordingFieldname]=this.indexes)}else if(this.isRecordingPoints){if("Coordinate"==e.nodeType)for(;null!==(i=l.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2]),z:parseFloat(i[3])},this.points.push(n);if("TextureCoordinate"==e.nodeType)for(;null!==(i=s.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2])},this.points.push(n);/]/.exec(t)&&(this.isRecordingPoints=!1,e.points=this.points)}else if(this.isRecordingAngles){if(i.length>0)for(d=0;d-1&&"PointLight"===o.nodeType&&(o.nodeType="AmbientLight");var c=void 0===o.on||o.on,f=void 0!==o.intensity?o.intensity:1,d=new a.Color;if(o.color&&d.copy(o.color),"AmbientLight"===o.nodeType)(l=new a.AmbientLight(d,f)).visible=c,s.add(l);else if("PointLight"===o.nodeType){var h=0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),(l=new a.PointLight(d,f,h)).visible=c,s.add(l)}else if("SpotLight"===o.nodeType){f=1,h=0;var p=Math.PI/3;c=!0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),void 0!==o.cutOffAngle&&(p=o.cutOffAngle),(l=new a.SpotLight(d,f,h,p,0)).visible=c,s.add(l)}else if("Transform"===o.nodeType||"Group"===o.nodeType){if(l=new a.Object3D,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),void 0!==o.translation){var m=o.translation;l.position.set(m.x,m.y,m.z)}if(void 0!==o.rotation){var v=o.rotation;l.quaternion.setFromAxisAngle(new a.Vector3(v.x,v.y,v.z),v.w)}if(void 0!==o.scale){var g=o.scale;l.scale.set(g.x,g.y,g.z)}s.add(l)}else if("Shape"===o.nodeType)l=new a.Mesh,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),s.add(l);else if("Background"===o.nodeType){var y=2e4,b=new a.SphereBufferGeometry(y,20,20),w=new a.MeshBasicMaterial({fog:!1,side:a.BackSide});if(o.skyColor.length>1)u(b,y,o.skyAngle,o.skyColor,!0),w.vertexColors=a.VertexColors;else{var x=o.skyColor[0];w.color.setRGB(x.r,x.b,x.g)}if(n.add(new a.Mesh(b,w)),void 0!==o.groundColor){y=12e3;var _=new a.SphereBufferGeometry(y,20,20,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),A=new a.MeshBasicMaterial({fog:!1,side:a.BackSide,vertexColors:a.VertexColors});u(_,y,o.groundAngle,o.groundColor,!1),n.add(new a.Mesh(_,A))}}else{if(/geometry/.exec(o.string)){if("Box"===o.nodeType){g=o.size;s.geometry=new a.BoxBufferGeometry(g.x,g.y,g.z)}else if("Cylinder"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.radius,o.radius,o.height);else if("Cone"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.topRadius,o.bottomRadius,o.height);else if("Sphere"===o.nodeType)s.geometry=new a.SphereBufferGeometry(o.radius);else if("IndexedFaceSet"===o.nodeType){var E,S,M,T,P,F=new a.BufferGeometry,O=[],L=[];for(B=0,M=o.children.length;B-1){var C=/DEF\s+([^\s]+)/.exec(V.string)[1];i[C]=O.slice(0)}if(V.string.indexOf("USE")>-1){W=/USE\s+([^\s]+)/.exec(V.string)[1];O=i[W]}}}var k=0;if(o.coordIndex){var R=[],I=[];for(E=new a.Vector3,S=new a.Vector2,B=0,M=o.coordIndex.length;B=3&&k0&&F.addAttribute("uv",new a.Float32BufferAttribute(L,2)),F.computeVertexNormals(),F.computeBoundingSphere(),/DEF/.exec(o.string)&&(F.name=/DEF ([^\s]+)/.exec(o.string)[1],i[F.name]=F),s.geometry=F}return}if(/appearance/.exec(o.string)){for(var B=0;B>1^-(1&c),a[n]=s*(l+o),n+=i}},n.prototype.decompressIndices_=function(e,t,r,a,n){for(var i=0,o=0;o>1,p=e.charCodeAt(u+4)+1>>1,m=e.charCodeAt(u+5)+1>>1;l[s++]=n[0]*(c+h),l[s++]=n[1]*(f+p),l[s++]=n[2]*(d+m),l[s++]=n[0]*h,l[s++]=n[1]*p,l[s++]=n[2]*m}return l},n.prototype.decompressMesh=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=u,d=new Float32Array(o*c),h=0;h>1^-(1&f);l[c]+=d,s[t*u+c]=l[c],o[t*u+c]=a[c]*(l[c]+r[c])}},n.prototype.accumulateNormal=function(e,t,r,a,n){var i=a[8*e],o=a[8*e+1],s=a[8*e+2],l=a[8*t],u=a[8*t+1],c=a[8*t+2],f=a[8*r],d=a[8*r+1],h=a[8*r+2];l-=i,f-=i,i=(u-=o)*(h-=s)-(c-=s)*(d-=o),o=c*f-l*h,s=l*d-u*f,n[3*e]+=i,n[3*e+1]+=o,n[3*e+2]+=s,n[3*t]+=i,n[3*t+1]+=o,n[3*t+2]+=s,n[3*r]+=i,n[3*r+1]+=o,n[3*r+2]+=s},n.prototype.decompressMesh2=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=t.codeRange[0],d=3*t.codeRange[2],h=new Uint16Array(d),p=new Int32Array(3*c),m=new Uint16Array(o),v=new Uint16Array(o*c),g=new Float32Array(o*c),y=0,b=0,w=0;w>1^-(1&O))+v[o*A+F]+v[o*E+F]-v[o*S+F];m[F]=L,v[o*y+F]=L,g[o*y+F]=l[F]*(L+s[F])}y++}else this.copyAttrib(o,v,m,P);this.accumulateNormal(A,E,P,v,p)}else{var C=y-(x-_);h[b++]=C,x===_?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,C);var k=y-(x=e.charCodeAt(f++));h[b++]=k,0===x?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,k);var R=y-(x=e.charCodeAt(f++));if(h[b++]=R,0===x){for(F=0;F<5;F++)m[F]=(v[o*C+F]+v[o*k+F])/2;this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++)}else this.copyAttrib(o,v,m,R);this.accumulateNormal(C,k,R,v,p)}}for(w=0;w>1^-(1&j)),g[o*w+6]=U*N+(B>>1^-(1&B)),g[o*w+7]=U*D+(V>>1^-(1&V))}i(a,n,g,h,void 0,t)},n.prototype.downloadMesh=function(e,t,r,a,n){var i=this,s=0;o(e,(function(e){!function(e){for(;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=new s(3*f/4-(i="="===e[f-2]?2:"="===e[f-1]?1:0)),a=i>0?f-4:f;var d=0;for(t=0,r=0;t>16,o[d++]=(65280&n)>>8,o[d++]=255&n;return 2===i?(n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[d++]=255&n):1===i&&(n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[d++]=n>>8&255,o[d++]=255&n),o}function n(e,a){var n,i,s,l,u=0;if("UInt64"===o.attributes.header_type?u=8:"UInt32"===o.attributes.header_type&&(u=4),"binary"===e.attributes.format&&a){var c,f,d,h,p,m;if("Float32"===e.attributes.type)var v=new Float32Array;else if("Int64"===e.attributes.type)v=new Int32Array;f=(c=r(e["#text"]))[0];for(var g=1;g0?3-h%3:0,(p=[]).push(m),d=3*u;for(g=0;g0){r.attributes={};for(var a=0;a0&&(v[g].text=n(v[g],f)),g++;switch(d[h]){case"PointData":var b=parseInt(c.attributes.NumberOfPoints),w=m.attributes.Normals;if(b>0)for(var x=0,_=v.length;x<_;x++)if(w===v[x].attributes.Name){var A=v[x].attributes.NumberOfComponents;(l=new Float32Array(b*A)).set(v[x].text,0)}break;case"Points":if((b=parseInt(c.attributes.NumberOfPoints))>0){A=m.DataArray.attributes.NumberOfComponents;(s=new Float32Array(b*A)).set(m.DataArray.text,0)}break;case"Strips":var E=parseInt(c.attributes.NumberOfStrips);if(E>0){var S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);var T=E+S.length;u=new Uint32Array(3*T-9*E);var P=0;for(x=0,_=E;x<_;x++){for(var F=[],O=0,L=M[x],C=0;O0&&(C=M[x-1]);var k=0;for(L=M[x],C=0;k0&&(C=M[x-1])}}break;case"Polys":var R=parseInt(c.attributes.NumberOfPolys);if(R>0){S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);T=R+S.length;u=new Uint32Array(3*T-9*R);P=0;var I=0;for(x=0,_=R,C=0;x<_;){var N=[];for(O=0,L=M[x];O=3)for(var C=parseInt(L[0]),k=1,R=0;R=3){var I,N;for(R=0;R=u.byteLength)break}var A=new a.BufferGeometry;return A.setIndex(new a.BufferAttribute(h,1)),A.addAttribute("position",new a.BufferAttribute(f,3)),d.length===f.length&&A.addAttribute("normal",new a.BufferAttribute(d,3)),A}(e)}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(var r=t;r-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,a=0;a127)return!0;return!1}},{key:"ensureBinary",value:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),r=0;r0&&(this.baseDir=this.url.substr(0,this.url.lastIndexOf("/")+1));this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this.mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var a=this._data.indexOf("{",r)+1,n=this._data.indexOf("}",r),i=this._data.indexOf("{",a)+1;if(!(a>0&&n>a)){r=-1===a?this._data.length:n+1;break}var o={children:[]},s=this._readLine(this._data.substr(r,a-r-1)).trim(),l=s.split(/ /g);if(l.length>0?(o.type=l[0],l.length>=2?o.name=l[1]:o.name=l[0]+this.Hierarchies.children.length):(o.name=s,o.type=""),"Animation"===o.type){o.data=this._data.substr(i,n-i).trim();var u=this._hierarchieParse(o,n+1);r=u.end,o.children=u.parent.children}else{var c=this._data.lastIndexOf(";",i>0?Math.min(i,n):n);if(o.data=this._data.substr(a,c-a).trim(),i<=0||n0||!this._currentObject.worked?setTimeout((function(){e.mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.Geometry=new a.Geometry,this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new s,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new a.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new a.Bone;if(e.name=this._currentFrame.name,e.applyMatrix(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(var t in this.HieStack)this.HieStack[t].name===this._currentFrame.parentName&&this.HieStack[t].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,a=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,n=0,(a=this._currentObject.data.indexOf(";;",e)+1)<=0&&(a=this._currentObject.data.length)}else{var o=0;switch(t){case 0:o=this._currentObject.data.indexOf(",",e)+1;break;case 1:o=this._currentObject.data.indexOf(";,",e)+1}switch((0===o||o>a)&&(o=a,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,o-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,o-e))}break;case"MeshNormals":switch(t){case 0:this._readNormalVector1(this._currentObject.data.substr(e,o-e));break;case 1:this._readNormalFace1(this._currentObject.data.substr(e,o-e),n)}}e=o+1,n++,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.Geometry.vertices.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))),this._currentGeo.Geometry.skinIndices.push(new a.Vector4(0,0,0,0)),this._currentGeo.Geometry.skinWeights.push(new a.Vector4(1,0,0,0)),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.Geometry.faces.push(new a.Face3(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),new a.Vector3(1,1,1).normalize()))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.normalVectors.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])))}},{key:"_readNormalFace1",value:function(e,t){var r=this._readLine(e.trim()).substr(2,e.length-4).split(","),a=parseInt(r[0],10),n=this._currentGeo.normalVectors[a];a=parseInt(r[1],10);var i=this._currentGeo.normalVectors[a];a=parseInt(r[2],10);var o=this._currentGeo.normalVectors[a];this._currentGeo.Geometry.faces[t].vertexNormals=[n,i,o]}},{key:"_setMeshNormals",value:function(){for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var a=this._currentObject.data.indexOf(",",e)+1;-1===a&&(a=this._currentObject.data.indexOf(";;",e)+1,t=2,r=0);var n=this._currentObject.data.substr(e,a-e),i=this._readLine(n.trim()).split(";");this._currentGeo.normalVectors.push([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]),e=a+1}}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshTextureCoords",value:function(){this._tmpUvArray=[],this._currentGeo.Geometry.faceVertexUvs=[],this._currentGeo.Geometry.faceVertexUvs.push([]);for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),o=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),1-parseFloat(o[1]))):this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),parseFloat(o[1]))),e=n+1}}if(e>=this._currentObject.data.length)break}this._currentGeo.Geometry.faceVertexUvs[0]=[];for(var s=0;s=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new a.MeshPhongMaterial({color:16777215*Math.random()});e.side=a.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t),i=this._readLine(n.trim()).split(";");e.color.r=parseFloat(i[0]),e.color.g=parseFloat(i[1]),e.color.b=parseFloat(i[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(n)),t=r+1,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t);var o=this._readLine(n.trim()).split(";");e.specular.r=parseFloat(o[0]),e.specular.g=parseFloat(o[1]),e.specular.b=parseFloat(o[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),n=this._currentObject.data.substr(t,r-t);var s=this._readLine(n.trim()).split(";");e.emissive.r=parseFloat(s[0]),e.emissive.g=parseFloat(s[1]),e.emissive.b=parseFloat(s[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var u=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(this.baseDir+u);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(this.baseDir+u),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(this.baseDir+u),e.normalScale=new a.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(this.baseDir+u);break;case"LightMapFilename":e.lightMap=this.texloader.load(this.baseDir+u)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new o,t=0,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);t=r+1,e.boneName=n.substr(1,n.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(r=this._currentObject.data.indexOf(";",t))+1,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);for(var i=this._readLine(n.trim()).split(","),s=0;s0)for(var o=0;o0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(var r=0;r4&&console.log("warn! over 4 bone weight! :"+s)}}for(var u=0;u0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,i&&e.context.disable(e.context.STENCIL_TEST),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new a.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new a.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionX,e.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.context.enable(e.context.STENCIL_TEST),e.render(this.scene,this.camera,r,!1),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:new a.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),s.BlurDirectionX=new a.Vector2(1,0),s.BlurDirectionY=new a.Vector2(0,1),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=r(1),i=(a=n)&&a.__esModule?a:{default:a};var o=function(e,t,r,a,n){i.default.call(this),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=a,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};o.prototype=Object.assign(Object.create(i.default.prototype),{constructor:o,render:function(e,t,r,a,n){var i,o,s=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),o=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),this.clearColor&&e.setClearColor(i,o),this.scene.overrideMaterial=null,e.autoClear=s}}),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=c(r(1)),i=c(r(19)),o=c(r(20)),s=c(r(2)),l=c(r(21)),u=c(r(22));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e,t,r,u,c){(n.default.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==r&&r,this.supportsNormalTexture=void 0!==u&&u,this.oldClearColor=new a.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==c?new a.Vector2(c.x,c.y):new a.Vector2(256,256),this.saoRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.NearestFilter,magFilter:a.NearestFilter,format:a.RGBAFormat}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((r=new a.DepthTexture).type=a.UnsignedShortType,r.minFilter=a.NearestFilter,r.maxFilter=a.NearestFilter,this.beautyRenderTarget.depthTexture=r,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.normalMaterial=new a.MeshNormalMaterial,this.normalMaterial.blending=a.NoBlending,void 0===i.default&&console.error("THREE.SAOPass relies on THREE.SAOShader"),this.saoMaterial=new a.ShaderMaterial({defines:Object.assign({},i.default.defines),fragmentShader:i.default.fragmentShader,vertexShader:i.default.vertexShader,uniforms:a.UniformsUtils.clone(i.default.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=a.NoBlending,void 0===o.default&&console.error("THREE.SAOPass relies on THREE.DepthLimitedBlurShader"),this.vBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=a.NoBlending,this.hBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=a.NoBlending,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.CopyShader"),this.materialCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(s.default.uniforms),vertexShader:s.default.vertexShader,fragmentShader:s.default.fragmentShader,blending:a.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=a.CustomBlending,this.materialCopy.blendSrc=a.DstColorFactor,this.materialCopy.blendDst=a.ZeroFactor,this.materialCopy.blendEquation=a.AddEquation,this.materialCopy.blendSrcAlpha=a.DstAlphaFactor,this.materialCopy.blendDstAlpha=a.ZeroFactor,this.materialCopy.blendEquationAlpha=a.AddEquation,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.UnpackDepthRGBAShader"),this.depthCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(l.default.uniforms),vertexShader:l.default.vertexShader,fragmentShader:l.default.fragmentShader,blending:a.NoBlending}),this.quadCamera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.quadScene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quadScene.add(this.quad)};f.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},f.prototype=Object.assign(Object.create(n.default.prototype),{constructor:f,render:function(e,t,r,n,i){if(this.renderToScreen&&(this.materialCopy.blending=a.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,e.clearTarget(this.depthRenderTarget),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(u.default.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(0,1)),u.default.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.render(this.scene,this.camera,this.beautyRenderTarget,!0),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var l=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,l=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?l.blending=a.CustomBlending:l.blending=a.NoBlending,this.renderPass(e,l,this.renderToScreen?null:r),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}},renderPass:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.quad.material=t,e.render(this.quadScene,this.quadCamera,r,l),e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},renderOverride:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1,a=t.clearColor||a,n=t.clearAlpha||n;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.scene.overrideMaterial=t,e.render(this.scene,this.camera,r,l),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}}),t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){n.default.call(this),void 0===i.default&&console.error("THREE.SavePass relies on THREE.CopyShader");var t=i.default;this.textureID="tDiffuse",this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new a.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBFormat,stencilBuffer:!1}),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,e.render(this.scene,this.camera,this.renderTarget,this.clear)}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(23));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),this.edgesRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var r=new Image;r.src=this.getAreaTexture(),this.areaTexture=new a.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=a.RGBFormat,this.areaTexture.minFilter=a.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.needsUpdate=!0,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),this.searchTexture=new a.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=a.NearestFilter,this.searchTexture.minFilter=a.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.needsUpdate=!0,this.searchTexture.flipY=!1,void 0===i.default&&console.error("THREE.SMAAPass relies on THREE.SMAAShader"),this.uniformsEdges=a.UniformsUtils.clone(i.default[0].uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new a.ShaderMaterial({defines:Object.assign({},i.default[0].defines),uniforms:this.uniformsEdges,vertexShader:i.default[0].vertexShader,fragmentShader:i.default[0].fragmentShader}),this.uniformsWeights=a.UniformsUtils.clone(i.default[1].uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new a.ShaderMaterial({defines:Object.assign({},i.default[1].defines),uniforms:this.uniformsWeights,vertexShader:i.default[1].vertexShader,fragmentShader:i.default[1].fragmentShader}),this.uniformsBlend=a.UniformsUtils.clone(i.default[2].uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new a.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:i.default[2].vertexShader,fragmentShader:i.default[2].fragmentShader}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniformsEdges.tDiffuse.value=r.texture,this.quad.material=this.materialEdges,e.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,e.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=r.texture,this.quad.material=this.materialBlend,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAre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kN5Mb/nEHeK7d4IcDld6lmDW/iH9E+AH1MdOw/Jlu2T1xNmY98sv4wHnD7D3uNHu54WUuOsBTbQuvBsPT/UfzNxGYzwkP8c+Yz3C+r/i6DcyRL/rZ+utRwWH5PmfvcvYEt9jLDS/bg0/B64DWKrQM8AL8FPwS9beQCe6EMKNZYJol37jBMy35otdaz0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(3)),i=o(r(25));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){if(void 0===i.default)return console.warn("THREE.SSAOPass depends on THREE.SSAOShader"),new n.default;n.default.call(this,i.default),this.width=void 0!==r?r:512,this.height=void 0!==o?o:256,this.renderToScreen=!1,this.camera2=t,this.scene2=e,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.depthRenderTarget=new a.WebGLRenderTarget(this.width,this.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter}),this.uniforms.tDepth.value=this.depthRenderTarget.texture,this.uniforms.size.value.set(this.width,this.height),this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far,this.uniforms.radius.value=4,this.uniforms.onlyAO.value=!1,this.uniforms.aoClamp.value=.25,this.uniforms.lumInfluence.value=.7;Object.defineProperties(this,{radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},onlyAO:{get:function(){return this.uniforms.onlyAO.value},set:function(e){this.uniforms.onlyAO.value=e}},aoClamp:{get:function(){return this.uniforms.aoClamp.value},set:function(e){this.uniforms.aoClamp.value=e}},lumInfluence:{get:function(){return this.uniforms.lumInfluence.value},set:function(e){this.uniforms.lumInfluence.value=e}}})};(s.prototype=Object.create(n.default.prototype)).render=function(e,t,r,a,i){this.scene2.overrideMaterial=this.depthMaterial,e.render(this.scene2,this.camera2,this.depthRenderTarget,!0),this.scene2.overrideMaterial=null,n.default.prototype.render.call(this,e,t,r,a,i)},s.prototype.setScene=function(e){this.scene2=e},s.prototype.setCamera=function(e){this.camera2=e,this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far},s.prototype.setSize=function(e,t){this.width=e,this.height=t,this.uniforms.size.value.set(this.width,this.height),this.depthRenderTarget.setSize(this.width,this.height)},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(24),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t,r){void 0===o.default&&console.error("THREE.TAARenderPass relies on THREE.SSAARenderPass"),o.default.call(this,e,t,r),this.sampleLevel=0,this.accumulate=!1};s.JitterVectors=o.default.JitterVectors,s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a){if(!this.accumulate)return o.default.prototype.render.call(this,e,t,r,a),void(this.accumulateIndex=-1);var i=s.JitterVectors[5];this.sampleRenderTarget||(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),this.holdRenderTarget||(this.holdRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.holdRenderTarget.texture.name="TAARenderPass.hold"),this.accumulate&&-1===this.accumulateIndex&&(o.default.prototype.render.call(this,e,this.holdRenderTarget,r,a),this.accumulateIndex=0);var l=e.autoClear;e.autoClear=!1;var u=1/i.length;if(this.accumulateIndex>=0&&this.accumulateIndex=i.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}var h=this.accumulateIndex*u;h>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.render(this.scene2,this.camera2,t,!0)),h<1&&(this.copyUniforms.opacity.value=1-h,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.render(this.scene2,this.camera2,t,0===h)),e.autoClear=l}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),void 0===i.default&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=i.default;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=a.UniformsUtils.clone(r.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){var i=e.autoClear;e.autoClear=!1,this.quad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),e.autoClear=i}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=s(r(1)),i=s(r(2)),o=s(r(26));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e,t,r,s){n.default.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=s,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);var l={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var u=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new a.WebGLRenderTarget(u,c,l),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var f=0;f\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new a.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),l.BlurDirectionX=new a.Vector2(1,0),l.BlurDirectionY=new a.Vector2(0,1),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaterRefractionShader=t.VignetteShader=t.VerticalTiltShiftShader=t.VerticalBlurShader=t.UnpackDepthRGBAShader=t.TriangleBlurShader=t.ToneMapShader=t.TechnicolorShader=t.SSAOShader=t.SobelOperatorShader=t.SMAAShader=t.SepiaShader=t.SAOShader=t.RGBShiftShader=t.PixelShader=t.ParallaxShader=t.NormalMapShader=t.MirrorShader=t.LuminosityShader=t.LuminosityHighPassShader=t.KaleidoShader=t.HueSaturationShader=t.HorizontalTiltShiftShader=t.HorizontalBlurShader=t.HalftoneShader=t.GammaCorrectionShader=t.FXAAShader=t.FresnelShader=t.FreiChenShader=t.FocusShader=t.FilmShader=t.DotScreenShader=t.DOFMipMapShader=t.DigitalGlitch=t.DepthLimitedBlurShader=t.CopyShader=t.ConvolutionShader=t.ColorifyShader=t.ColorCorrectionShader=t.BrightnessContrastShader=t.BokehShader2=t.BokehShader=t.BlurShaderUtils=t.BlendShader=t.BleachBypassShader=t.BasicShader=void 0;var a=Q(r(113)),n=Q(r(114)),i=Q(r(115)),o=Q(r(22)),s=Q(r(14)),l=Q(r(116)),u=Q(r(117)),c=Q(r(118)),f=Q(r(119)),d=Q(r(13)),h=Q(r(2)),p=Q(r(20)),m=Q(r(17)),v=Q(r(120)),g=Q(r(15)),y=Q(r(16)),b=Q(r(121)),w=Q(r(122)),x=Q(r(123)),_=Q(r(124)),A=Q(r(125)),E=Q(r(18)),S=Q(r(126)),M=Q(r(127)),T=Q(r(128)),P=Q(r(129)),F=Q(r(26)),O=Q(r(11)),L=Q(r(130)),C=Q(r(131)),k=(Q(r(132)),Q(r(133))),R=Q(r(134)),I=Q(r(135)),N=Q(r(19)),D=Q(r(136)),U=Q(r(23)),j=Q(r(137)),B=Q(r(25)),V=Q(r(138)),z=Q(r(12)),G=Q(r(139)),H=Q(r(21)),X=Q(r(140)),Y=Q(r(141)),W=Q(r(142)),q=Q(r(143));function Q(e){return e&&e.__esModule?e:{default:e}}t.BasicShader=a.default,t.BleachBypassShader=n.default,t.BlendShader=i.default,t.BlurShaderUtils=o.default,t.BokehShader=s.default,t.BokehShader2=l.default,t.BrightnessContrastShader=u.default,t.ColorCorrectionShader=c.default,t.ColorifyShader=f.default,t.ConvolutionShader=d.default,t.CopyShader=h.default,t.DepthLimitedBlurShader=p.default,t.DigitalGlitch=m.default,t.DOFMipMapShader=v.default,t.DotScreenShader=g.default,t.FilmShader=y.default,t.FocusShader=b.default,t.FreiChenShader=w.default,t.FresnelShader=x.default,t.FXAAShader=_.default,t.GammaCorrectionShader=A.default,t.HalftoneShader=E.default,t.HorizontalBlurShader=S.default,t.HorizontalTiltShiftShader=M.default,t.HueSaturationShader=T.default,t.KaleidoShader=P.default,t.LuminosityHighPassShader=F.default,t.LuminosityShader=O.default,t.MirrorShader=L.default,t.NormalMapShader=C.default,t.ParallaxShader=k.default,t.PixelShader=R.default,t.RGBShiftShader=I.default,t.SAOShader=N.default,t.SepiaShader=D.default,t.SMAAShader=U.default,t.SobelOperatorShader=j.default,t.SSAOShader=B.default,t.TechnicolorShader=V.default,t.ToneMapShader=z.default,t.TriangleBlurShader=G.default,t.UnpackDepthRGBAShader=H.default,t.VerticalBlurShader=X.default,t.VerticalTiltShiftShader=Y.default,t.VignetteShader=W.default,t.WaterRefractionShader=q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","vec4 texel1 = texture2D( tDiffuse1, vUv );","vec4 texel2 = texture2D( tDiffuse2, vUv );","gl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float penta(vec2 coords) {","//pentagonal shape","float scale = float(rings) - 1.3;","vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","vec4 one = vec4( 1.0 );","vec4 P = vec4((coords),vec2(scale, scale));","vec4 dist = vec4(0.0);","float inorout = -4.0;","dist.x = dot( P, HS0 );","dist.y = dot( P, HS1 );","dist.z = dot( P, HS2 );","dist.w = dot( P, HS3 );","dist = smoothstep( -feather, feather, dist );","inorout += dot( dist, one );","dist.x = dot( P, HS4 );","dist.y = HS5.w - abs( P.z );","dist = smoothstep( -feather, feather, dist );","inorout += dist.x;","return clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","// Depth buffer blur","float d = 0.0;","float kernel[9];","vec2 offset[9];","vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","offset[0] = vec2(-wh.x,-wh.y);","offset[1] = vec2( 0.0, -wh.y);","offset[2] = vec2( wh.x -wh.y);","offset[3] = vec2(-wh.x, 0.0);","offset[4] = vec2( 0.0, 0.0);","offset[5] = vec2( wh.x, 0.0);","offset[6] = vec2(-wh.x, wh.y);","offset[7] = vec2( 0.0, wh.y);","offset[8] = vec2( wh.x, wh.y);","kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","for( int i=0; i<9; i++ ) {","float tmp = getDepth( coords + offset[ i ] );","d += tmp * kernel[i];","}","return d;","}","vec3 color(vec2 coords,float blur) {","//processing the sample","vec3 col = vec3(0.0);","vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","vec3 lumcoeff = vec3(0.299,0.587,0.114);","float lum = dot(col.rgb, lumcoeff);","float thresh = max((lum-threshold)*gain, 0.0);","return col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","float edge = 0.002*depth; //distance based edge smoothing","float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","return col;","}","float linearize(float depth) {","return -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","float dist = distance(vUv.xy, vec2(0.5,0.5));","dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","return clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","float rings2 = float(rings);","float step = PI*2.0 / float(ringsamples);","float pw = cos(j*step)*i;","float ph = sin(j*step)*i;","float p = 1.0;","if (pentagon) {","p = penta(vec2(pw,ph));","}","col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","return 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","//scene depth calculation","float depth = linearize( getDepth( vUv.xy ) );","// Blur depth?","if (depthblur) {","depth = linearize(bdepth(vUv.xy));","}","//focal plane calculation","float fDepth = focalDepth;","if (shaderFocus) {","fDepth = linearize( getDepth( focusCoords ) );","}","// dof blur factor calculation","float blur = 0.0;","if (manualdof) {","float a = depth-fDepth; // Focal plane","float b = (a-fdofstart)/fdofdist; // Far DoF","float c = (-a-ndofstart)/ndofdist; // Near Dof","blur = (a>0.0) ? b : c;","} else {","float f = focalLength; // focal length in mm","float d = fDepth*1000.0; // focal plane in mm","float o = depth*1000.0; // depth in mm","float a = (o*f)/(o-f);","float b = (d*f)/(d-f);","float c = (d-f)/(d*fstop*CoC);","blur = abs(a-b)*c;","}","blur = clamp(blur,0.0,1.0);","// calculation of pattern for dithering","vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","// getting blur x and y step factor","float w = (1.0/textureWidth)*blur*maxblur+noise.x;","float h = (1.0/textureHeight)*blur*maxblur+noise.y;","// calculation of final color","vec3 col = vec3(0.0);","if(blur < 0.05) {","//some optimization thingy","col = texture2D(tColor, vUv.xy).rgb;","} else {","col = texture2D(tColor, vUv.xy).rgb;","float s = 1.0;","int ringsamples;","for (int i = 1; i <= rings; i++) {","/*unboxstart*/","ringsamples = i * samples;","for (int j = 0 ; j < maxringsamples ; j++) {","if (j >= ringsamples) break;","s += gather(float(i), float(j), ringsamples, col, w, h, blur);","}","/*unboxend*/","}","col /= s; //divide by sample count","}","if (showFocus) {","col = debugFocus(col, blur, depth);","}","if (vignetting) {","col *= vignette();","}","gl_FragColor.rgb = col;","gl_FragColor.a = 1.0;","} "].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},powRGB:{value:new a.Vector3(2,2,2)},mulRGB:{value:new a.Vector3(1,1,1)},addRGB:{value:new a.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},color:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},aspect:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","G[0] = g0,","G[1] = g1,","G[2] = g2,","G[3] = g3,","G[4] = g4,","G[5] = g5,","G[6] = g6,","G[7] = g7,","G[8] = g8;","mat3 I;","float cnv[9];","vec3 sample;","for (float i=0.0; i<3.0; i++) {","for (float j=0.0; j<3.0; j++) {","sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","I[int(i)][int(j)] = length(sample);","}","}","for (int i=0; i<9; i++) {","float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","cnv[i] = dp3 * dp3;","}","float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","vec3 I = worldPosition.xyz - cameraPosition;","vReflect = reflect( I, worldNormal );","vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","vec4 refractedColor = vec4( 1.0 );","refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immedates."," // Immedates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","gl_FragColor = LinearToGamma( tex, float( GAMMA_FACTOR ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 p = vUv - 0.5;","float r = length(p);","float a = atan(p.y, p.x) + angle;","float tau = 2. * 3.1416 ;","a = mod(a, tau/sides);","a = abs(a - tau/sides/2.) ;","p = r * vec2(cos(a), sin(a));","vec4 color = texture2D(tDiffuse, p + 0.5);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","vec2 p = vUv;","if (side == 0){","if (p.x > 0.5) p.x = 1.0 - p.x;","}else if (side == 1){","if (p.x < 0.5) p.x = 1.0 - p.x;","}else if (side == 2){","if (p.y < 0.5) p.y = 1.0 - p.y;","}else if (side == 3){","if (p.y > 0.5) p.y = 1.0 - p.y;","} ","vec4 color = texture2D(tDiffuse, p);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{heightMap:{value:null},resolution:{value:new a.Vector2(512,512)},scale:{value:new a.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));a.ShaderLib.ocean_sim_vertex={vertexShader:["varying vec2 vUV;","void main (void) {","vUV = position.xy * 0.5 + 0.5;","gl_Position = vec4(position, 1.0 );","}"].join("\n")},a.ShaderLib.ocean_subtransform={uniforms:{u_input:{value:null},u_transformSize:{value:512},u_subtransformSize:{value:250}},fragmentShader:["precision highp float;","#include ","uniform sampler2D u_input;","uniform float u_transformSize;","uniform float u_subtransformSize;","varying vec2 vUV;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","void main (void) {","#ifdef HORIZONTAL","float index = vUV.x * u_transformSize - 0.5;","#else","float index = vUV.y * u_transformSize - 0.5;","#endif","float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);","#ifdef HORIZONTAL","vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","#else","vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;","#endif","float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);","vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));","vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);","vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);","gl_FragColor = vec4(outputA, outputB);","}"].join("\n")},a.ShaderLib.ocean_initial_spectrum={uniforms:{u_wind:{value:new a.Vector2(10,10)},u_resolution:{value:512},u_size:{value:250}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","const float CM = 0.23;","uniform vec2 u_wind;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + pow2(k / KM)));","}","float tanh (float x) {","return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 K = (2.0 * PI * vec2(n, m)) / u_size;","float k = length(K);","float l_wind = length(u_wind);","float Omega = 0.84;","float kp = G * pow2(Omega / l_wind);","float c = omega(k) / k;","float cp = omega(kp) / kp;","float Lpm = exp(-1.25 * pow2(kp / k));","float gamma = 1.7;","float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));","float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));","float Jp = pow(gamma, Gamma);","float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));","float alphap = 0.006 * sqrt(Omega);","float Bl = 0.5 * alphap * cp / c * Fp;","float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);","float uStar = 0.41 * l_wind / log(10.0 / z0);","float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));","float Fm = exp(-0.25 * pow2(k / KM - 1.0));","float Bh = 0.5 * alpham * CM / c * Fm * Lpm;","float a0 = log(2.0) / 4.0;","float am = 0.13 * uStar / CM;","float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));","float cosPhi = dot(normalize(u_wind), normalize(K));","float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));","float dk = 2.0 * PI / u_size;","float h = sqrt(S / 2.0) * dk;","if (K.x == 0.0 && K.y == 0.0) {","h = 0.0;","}","gl_FragColor = vec4(h, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_phase={uniforms:{u_phases:{value:null},u_deltaTime:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform sampler2D u_phases;","uniform float u_deltaTime;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","float deltaTime = 1.0 / 60.0;","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","float deltaPhase = omega(length(waveVector)) * u_deltaTime;","phase = mod(phase + deltaPhase, 2.0 * PI);","gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_spectrum={uniforms:{u_size:{value:null},u_resolution:{value:null},u_choppiness:{value:null},u_phases:{value:null},u_initialSpectrum:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform float u_size;","uniform float u_resolution;","uniform float u_choppiness;","uniform sampler2D u_phases;","uniform sampler2D u_initialSpectrum;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","vec2 multiplyByI (vec2 z) {","return vec2(-z[1], z[0]);","}","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","vec2 phaseVector = vec2(cos(phase), sin(phase));","vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;","vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;","h0Star.y *= -1.0;","vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));","vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;","vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;","if (waveVector.x == 0.0 && waveVector.y == 0.0) {","h = vec2(0.0);","hX = vec2(0.0);","hZ = vec2(0.0);","}","gl_FragColor = vec4(hX + multiplyByI(h), hZ);","}"].join("\n")},a.ShaderLib.ocean_normals={uniforms:{u_displacementMap:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform float u_resolution;","uniform float u_size;","void main (void) {","float texel = 1.0 / u_resolution;","float texelSize = u_size / u_resolution;","vec3 center = texture2D(u_displacementMap, vUV).rgb;","vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;","vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;","vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;","vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;","vec3 topRight = cross(right, top);","vec3 topLeft = cross(top, left);","vec3 bottomLeft = cross(left, bottom);","vec3 bottomRight = cross(bottom, right);","gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);","}"].join("\n")},a.ShaderLib.ocean_main={uniforms:{u_displacementMap:{value:null},u_normalMap:{value:null},u_geometrySize:{value:null},u_size:{value:null},u_projectionMatrix:{value:null},u_viewMatrix:{value:null},u_cameraPosition:{value:null},u_skyColor:{value:null},u_oceanColor:{value:null},u_sunDirection:{value:null},u_exposure:{value:null}},vertexShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform mat4 u_projectionMatrix;","uniform mat4 u_viewMatrix;","uniform float u_size;","uniform float u_geometrySize;","uniform sampler2D u_displacementMap;","void main (void) {","vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);","vPos = newPos;","vUV = uv;","gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);","}"].join("\n"),fragmentShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform sampler2D u_normalMap;","uniform vec3 u_cameraPosition;","uniform vec3 u_oceanColor;","uniform vec3 u_skyColor;","uniform vec3 u_sunDirection;","uniform float u_exposure;","vec3 hdr (vec3 color, float exposure) {","return 1.0 - exp(-color * exposure);","}","void main (void) {","vec3 normal = texture2D(u_normalMap, vUV).rgb;","vec3 view = normalize(u_cameraPosition - vPos);","float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);","vec3 sky = fresnel * u_skyColor;","float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);","vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;","vec3 color = sky + water;","gl_FragColor = vec4(hdr(color, u_exposure), 1.0);","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","vUv = uv;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vViewPosition = -mvPosition.xyz;","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","vec2 parallaxMap( in vec3 V ) {","float initialHeight = texture2D( bumpMap, vUv ).r;","vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","return vUv - texCoordOffset;","}","#else","vec2 parallaxMap( in vec3 V ) {","float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","float layerHeight = 1.0 / numLayers;","float currentLayerHeight = 0.0;","vec2 dtex = parallaxScale * V.xy / V.z / numLayers;","vec2 currentTextureCoords = vUv;","float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","for ( int i = 0; i < 30; i += 1 ) {","if ( heightFromTexture <= currentLayerHeight ) {","break;","}","currentLayerHeight += layerHeight;","currentTextureCoords -= dtex;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","}","#ifdef USE_STEEP_PARALLAX","return currentTextureCoords;","#elif defined( USE_RELIEF_PARALLAX )","vec2 deltaTexCoord = dtex / 2.0;","float deltaHeight = layerHeight / 2.0;","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","const int numSearches = 5;","for ( int i = 0; i < numSearches; i += 1 ) {","deltaTexCoord /= 2.0;","deltaHeight /= 2.0;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","if( heightFromTexture > currentLayerHeight ) {","currentTextureCoords -= deltaTexCoord;","currentLayerHeight += deltaHeight;","} else {","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","}","}","return currentTextureCoords;","#elif defined( USE_OCLUSION_PARALLAX )","vec2 prevTCoords = currentTextureCoords + dtex;","float nextH = heightFromTexture - currentLayerHeight;","float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","float weight = nextH / ( nextH - prevH );","return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","#else","return vUv;","#endif","}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","vec2 texDx = dFdx( vUv );","vec2 texDy = dFdy( vUv );","vec3 vSigmaX = dFdx( surfPosition );","vec3 vSigmaY = dFdy( surfPosition );","vec3 vR1 = cross( vSigmaY, surfNormal );","vec3 vR2 = cross( surfNormal, vSigmaX );","float fDet = dot( vSigmaX, vR1 );","vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","vec3 vProjVtex;","vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","vProjVtex.z = dot( surfNormal, viewPosition );","return parallaxMap( vProjVtex );","}","void main() {","vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","gl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, vUv + offset);","vec4 cga = texture2D(tDiffuse, vUv);","vec4 cb = texture2D(tDiffuse, vUv - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","gl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","gl_FragColor = newTex;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{texture:{value:null},delta:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = rand( vUv );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{color:{type:"c",value:null},time:{type:"f",value:0},tDiffuse:{type:"t",value:null},tDudv:{type:"t",value:null},textureMatrix:{type:"m4",value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Volume=void 0;var a,n=r(10),i=(a=n)&&a.__esModule?a:{default:a};t.Volume=i.default}]))},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,a,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,a)}));case 4:return t.nextTick((function(){e.call(null,r,a,n)}));default:for(i=new Array(s-1),o=0;o>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return n>0&&(e.lastNeed=n-1),n;if(--a=0)return n>0&&(e.lastNeed=n-2),n;if(--a=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";(function(t){var a=r(118); +!function(e,t){for(var r in t)e[r]=t[r]}(exports,function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){e.exports=__webpack_require__(0)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1};Object.assign(a.prototype,{setSize:function(e,t){},render:function(e,t,r,a,n){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(1),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t){o.default.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof n.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=n.UniformsUtils.clone(e.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new n.Scene,this.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)}}),t.default=s},function(e,t,r){!function(e){"use strict";function t(){}function r(e,r){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===r||r,this.encoder=new t}function a(){}function n(){}t.prototype.s2u=function(e){for(var t=this.s2uTable,r="",a=0;a=0&&n<=126||n>=161&&n<=223)&&a0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},a.prototype={constructor:a,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],a=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=a}},n.prototype.parsePmd=function(e,t){var a,n={},i=new r(e);return n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left",function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),function(){var e,t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r0&&(a.englishModelName=i.getSjisStringsAsUnicode(20),a.englishComment=i.getSjisStringsAsUnicode(256)),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneNames=[];for(var t=0;t=2.0 are supported. Use LegacyGLTFLoader instead.")):(m.extensionsUsed&&(m.extensionsUsed.indexOf(r.KHR_LIGHTS)>=0&&(p[r.KHR_LIGHTS]=new i(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_UNLIT)>=0&&(p[r.KHR_MATERIALS_UNLIT]=new o(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(p[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new d),m.extensionsUsed.indexOf(r.KHR_DRACO_MESH_COMPRESSION)>=0&&(p[r.KHR_DRACO_MESH_COMPRESSION]=new f(this.dracoLoader)),m.extensionsUsed.indexOf(r.MSFT_TEXTURE_DDS)>=0&&(p[r.MSFT_TEXTURE_DDS]=new n)),new U(m,p,{path:t||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse((function(e,t,r,a,n){l({scene:e,scenes:t,cameras:r,animations:a,asset:n})}),u))}};var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(){if(!a.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=new a.DDSLoader}function i(e){this.name=r.KHR_LIGHTS,this.lights={};var t=(e.extensions&&e.extensions[r.KHR_LIGHTS]||{}).lights||{};for(var n in t){var i,o=t[n],s=(new a.Color).fromArray(o.color);switch(o.type){case"directional":(i=new a.DirectionalLight(s)).target.position.set(0,0,1),i.add(i.target);break;case"point":i=new a.PointLight(s);break;case"spot":i=new a.SpotLight(s),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;case"ambient":i=new a.AmbientLight(s)}i&&(i.decay=2,void 0!==o.intensity&&(i.intensity=o.intensity),i.name=o.name||"light_"+n,this.lights[n]=i)}}function o(e){this.name=r.KHR_MATERIALS_UNLIT}o.prototype.getMaterialType=function(e){return a.MeshBasicMaterial},o.prototype.extendParams=function(e,t,r){var n=[];e.color=new a.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var o=i.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture.index))}return Promise.all(n)};var s="glTF",l=12,u={JSON:1313821514,BIN:5130562};function c(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,l);if(this.header={magic:a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,l),i=0;i",s).replace("#include ",l).replace("#include ",u).replace("#include ",c).replace("#include ",f);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new a.Color).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=d,e.uniforms=o,e.defines={STANDARD:""},e.color=new a.Color(1,1,1),e.opacity=1;var h=[];if(Array.isArray(n.diffuseFactor)){var p=n.diffuseFactor;e.color.fromArray(p),e.opacity=p[3]}if(void 0!==n.diffuseTexture&&h.push(r.assignTexture(e,"map",n.diffuseTexture.index)),e.emissive=new a.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new a.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var m=n.specularGlossinessTexture.index;h.push(r.assignTexture(e,"glossinessMap",m)),h.push(r.assignTexture(e,"specularMap",m))}return Promise.all(h)},createMaterial:function(e){var t=new a.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var r=this.specularGlossinessParams,a=0,n=r.length;a=2&&(n[i+1]=e.getY(i)),r>=3&&(n[i+2]=e.getZ(i)),r>=4&&(n[i+3]=e.getW(i));return new a.BufferAttribute(n,r,e.normalized)}return e.clone()}function U(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new t,this.primitiveCache=[],this.textureLoader=new a.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function j(e,t,r){var a=t.attributes;for(var n in a){var i=T[n],o=r[a[n]];i&&(i in e.attributes||e.addAttribute(i,o))}void 0===t.indices||e.index||e.setIndex(r[t.indices])}return U.prototype.parse=function(e,t){var r=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then((function(t){var a=t.scenes||[],n=a[r.scene||0],i=t.animations||[],o=r.asset,s=t.cameras||[];e(n,a,s,i,o)})).catch(t)},U.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},i=0,o=t.length;i=2&&o.setY(T,A[E*l+1]),l>=3&&o.setZ(T,A[E*l+2]),l>=4&&o.setW(T,A[E*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},U.prototype.loadTexture=function(e){var t,n=this,i=this.json,o=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=i.textures[e],c=u.extensions||{},f=(t=c[r.MSFT_TEXTURE_DDS]?i.images[c[r.MSFT_TEXTURE_DDS].source]:i.images[u.source]).uri,d=!1;return void 0!==t.bufferView&&(f=n.getDependency("bufferView",t.bufferView).then((function(e){d=!0;var r=new Blob([e],{type:t.mimeType});return f=l.createObjectURL(r)}))),Promise.resolve(f).then((function(e){var t=a.Loader.Handlers.get(e);return t||(t=c[r.MSFT_TEXTURE_DDS]?n.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(r,a){t.load(k(e,o.path),r,void 0,a)}))})).then((function(e){!0===d&&l.revokeObjectURL(f),e.flipY=!1,void 0!==u.name&&(e.name=u.name),c[r.MSFT_TEXTURE_DDS]||(e.format=void 0!==u.format?E[u.format]:a.RGBAFormat),void 0!==u.internalFormat&&e.format!==E[u.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==u.type?S[u.type]:a.UnsignedByteType;var t=(i.samplers||{})[u.sampler]||{};return e.magFilter=_[t.magFilter]||a.LinearFilter,e.minFilter=_[t.minFilter]||a.LinearMipMapLinearFilter,e.wrapS=A[t.wrapS]||a.RepeatWrapping,e.wrapT=A[t.wrapT]||a.RepeatWrapping,e}))},U.prototype.assignTexture=function(e,t,r){return this.getDependency("texture",r).then((function(r){e[t]=r}))},U.prototype.loadMaterial=function(e){this.json;var t,n=this.extensions,i=this.json.materials[e],o={},s=i.extensions||{},l=[];if(s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(i),l.push(u.extendParams(o,i,this))}else if(s[r.KHR_MATERIALS_UNLIT]){var c=n[r.KHR_MATERIALS_UNLIT];t=c.getMaterialType(i),l.push(c.extendParams(o,i,this))}else{t=a.MeshStandardMaterial;var f=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(f.baseColorFactor)){var d=f.baseColorFactor;o.color.fromArray(d),o.opacity=d[3]}if(void 0!==f.baseColorTexture&&l.push(this.assignTexture(o,"map",f.baseColorTexture.index)),o.metalness=void 0!==f.metallicFactor?f.metallicFactor:1,o.roughness=void 0!==f.roughnessFactor?f.roughnessFactor:1,void 0!==f.metallicRoughnessTexture){var h=f.metallicRoughnessTexture.index;l.push(this.assignTexture(o,"metalnessMap",h)),l.push(this.assignTexture(o,"roughnessMap",h))}}!0===i.doubleSided&&(o.side=a.DoubleSide);var p=i.alphaMode||O;return p===C?o.transparent=!0:(o.transparent=!1,p===L&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"normalMap",i.normalTexture.index)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale&&o.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"aoMap",i.occlusionTexture.index)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==a.MeshBasicMaterial&&l.push(this.assignTexture(o,"emissiveMap",i.emissiveTexture.index)),Promise.all(l).then((function(){var e;return e=t===a.ShaderMaterial?n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==i.name&&(e.name=i.name),e.normalScale&&(e.normalScale.y=-e.normalScale.y),e.map&&(e.map.encoding=a.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=a.sRGBEncoding),i.extras&&(e.userData=i.extras),e}))},U.prototype.loadGeometries=function(e){var t=this,n=this.extensions,i=this.primitiveCache;return this.getDependencies("accessor").then((function(o){for(var s=[],l=0,u=e.length;l1))return _;_.name+="_"+c,s.add(_)}return s}))}))},U.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new a.PerspectiveCamera(a.Math.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new a.OrthographicCamera(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar)),void 0!==r.name&&(t.name=r.name),r.extras&&(t.userData=r.extras),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},U.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},U.prototype.loadAnimation=function(e){this.json;var t=this.json.animations[e];return this.getMultiDependencies(["accessor","node"]).then((function(r){for(var n=[],i=0,o=t.channels.length;i1&&(s.name+="_instance_"+i[o.mesh]++)}else if(void 0!==o.camera)s=e.cameras[o.camera];else if(o.extensions&&o.extensions[r.KHR_LIGHTS]&&void 0!==o.extensions[r.KHR_LIGHTS].light){s=t[r.KHR_LIGHTS].lights[o.extensions[r.KHR_LIGHTS].light]}else s=new a.Object3D;if(void 0!==o.name&&(s.name=a.PropertyBinding.sanitizeNodeName(o.name)),o.extras&&(s.userData=o.extras),void 0!==o.matrix){var d=new a.Matrix4;d.fromArray(o.matrix),s.applyMatrix(d)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return s}))},U.prototype.loadScene=function(){function e(t,r,n,i,o){var s=i[t],l=n.nodes[t];if(void 0!==l.skin)for(var u=!0===s.isGroup?s.children:[s],c=0,f=u.length;c(n=s.indexOf("\n"))&&i=e.byteLength||!(a=r(e)))return t(1,"no header found");if(!(n=a.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(u.valid|=1,u.programtype=n[1],u.string+=a+"\n";!1!==(a=r(e));)if(u.string+=a+"\n","#"!==a.charAt(0)){if((n=a.match(i))&&(u.gamma=parseFloat(n[1],10)),(n=a.match(o))&&(u.exposure=parseFloat(n[1],10)),(n=a.match(s))&&(u.valid|=2,u.format=n[1]),(n=a.match(l))&&(u.valid|=4,u.height=parseInt(n[1],10),u.width=parseInt(n[2],10)),2&u.valid&&4&u.valid)break}else u.comments+=a+"\n";return 2&u.valid?4&u.valid?u:t(3,"missing image size specifier"):t(3,"missing format specifier")}(n);if(-1!==i){var o=i.width,s=i.height,l=function(e,r,a){var n,i,o,s,l,u,c,f,d,h,p,m,v,g=r,y=a;if(g<8||g>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(g!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(n=new Uint8Array(4*r*a))||!n.length)return t(4,"unable to allocate buffer space");for(i=0,o=0,f=4*g,v=new Uint8Array(4),u=new Uint8Array(f);y>0&&oe.byteLength)return t(1);if(v[0]=e[o++],v[1]=e[o++],v[2]=e[o++],v[3]=e[o++],2!=v[0]||2!=v[1]||(v[2]<<8|v[3])!=g)return t(3,"bad rgbe scanline format");for(c=0;c128)&&(s-=128),0===s||c+s>f)return t(3,"bad scanline data");if(m)for(l=e[o++],d=0;d0){var x=[];for(var w in v)h=v[w],x[w]=h.name;m="Adding mesh(es) ("+x.length+": "+x+") from input mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)"}else m="Not adding mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)";var _=this.callbacks.onProgress;t.isValid(_)&&_(new CustomEvent("MeshBuilderEvent",{detail:{type:"progress",modelName:e.params.meshName,text:m,numericalValue:e.progress.numericalValue}}));return v},r.prototype.updateMaterials=function(e){var r,a,i=e.materials.materialCloneInstructions;if(t.isValid(i)){var o=i.materialNameOrg,s=this.materials[o];if(t.isValid(o)){r=s.clone(),a=i.materialName,r.name=a;var l=i.materialProperties;for(var u in l)r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&(r[u]=l[u]);this.materials[a]=r}else console.warn('Requested material "'+o+'" is not available!')}var c=e.materials.serializedMaterials;if(t.isValid(c)&&Object.keys(c).length>0){var f,d=new n.MaterialLoader;for(a in c)f=c[a],t.isValid(f)&&(r=d.parse(f),this.logging.enabled&&console.info('De-serialized material with name "'+a+'" will be added.'),this.materials[a]=r)}if(c=e.materials.runtimeMaterials,t.isValid(c)&&Object.keys(c).length>0)for(a in c)r=c[a],this.logging.enabled&&console.info('Material with name "'+a+'" will be added.'),this.materials[a]=r},r.prototype.getMaterialsJSON=function(){var e,t={};for(var r in this.materials)e=this.materials[r],t[r]=e.toJSON();return t},r.prototype.getMaterials=function(){return this.materials},r}(),s.WorkerRunnerRefImpl=function(){function e(){var e=this;self.addEventListener("message",(function(t){e.processMessage(t.data)}),!1)}return e.prototype.applyProperties=function(e,t){var r,a,n;for(r in t)a="set"+r.substring(0,1).toLocaleUpperCase()+r.substring(1),n=t[r],"function"==typeof e[a]?e[a](n):e.hasOwnProperty(r)&&(e[r]=n)},e.prototype.processMessage=function(e){if("run"===e.cmd){var t={callbackMeshBuilder:function(e){self.postMessage(e)},callbackProgress:function(t){e.logging.enabled&&e.logging.debug&&console.debug("WorkerRunner: progress: "+t)}},r=new Parser;"function"==typeof r.setLogging&&r.setLogging(e.logging.enabled,e.logging.debug),this.applyProperties(r,e.params),this.applyProperties(r,e.materials),this.applyProperties(r,t),r.workerScope=self,r.parse(e.data.input,e.data.options),e.logging.enabled&&console.log("WorkerRunner: Run complete!"),t.callbackMeshBuilder({cmd:"complete",msg:"WorkerRunner completed run."})}else console.error("WorkerRunner: Received unknown command: "+e.cmd)},e}(),s.WorkerSupport=function(){var e="2.2.0",t=s.Validator,r=function(){function e(){this._reset()}return e.prototype._reset=function(){this.logging={enabled:!0,debug:!1},this.worker=null,this.runnerImplName=null,this.callbacks={meshBuilder:null,onLoad:null},this.terminateRequested=!1,this.queuedMessage=null,this.started=!1,this.forceCopy=!1},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.setForceCopy=function(e){this.forceCopy=!0===e},e.prototype.initWorker=function(e,t){this.runnerImplName=t;var r=new Blob([e],{type:"application/javascript"});this.worker=new Worker(o.URL.createObjectURL(r)),this.worker.onmessage=this._receiveWorkerMessage,this.worker.runtimeRef=this,this._postMessage()},e.prototype._receiveWorkerMessage=function(e){var t=e.data;switch(t.cmd){case"meshData":case"materialData":case"imageData":this.runtimeRef.callbacks.meshBuilder(t);break;case"complete":this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run is complete. Terminating application on request!"),this.runtimeRef._terminate());break;case"error":console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Reported error: "+t.msg),this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run reported error. Terminating application on request!"),this.runtimeRef._terminate());break;default:console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Received unknown command: "+t.cmd)}},e.prototype.setCallbacks=function(e,r){this.callbacks.meshBuilder=t.verifyInput(e,this.callbacks.meshBuilder),this.callbacks.onLoad=t.verifyInput(r,this.callbacks.onLoad)},e.prototype.run=function(e){if(t.isValid(this.queuedMessage))console.warn("Already processing message. Rejecting new run instruction");else{if(this.queuedMessage=e,this.started=!0,!t.isValid(this.callbacks.meshBuilder))throw'Unable to run as no "MeshBuilder" callback is set.';if(!t.isValid(this.callbacks.onLoad))throw'Unable to run as no "onLoad" callback is set.';"run"!==e.cmd&&(e.cmd="run"),t.isValid(e.logging)?(e.logging.enabled=!0===e.logging.enabled,e.logging.debug=!0===e.logging.debug):e.logging={enabled:!0,debug:!1},this._postMessage()}},e.prototype._postMessage=function(){var e;t.isValid(this.queuedMessage)&&t.isValid(this.worker)&&(this.queuedMessage.data.input instanceof ArrayBuffer?(e=this.forceCopy?this.queuedMessage.data.input.slice(0):this.queuedMessage.data.input,this.worker.postMessage(this.queuedMessage,[e])):this.worker.postMessage(this.queuedMessage))},e.prototype.setTerminateRequested=function(e){this.terminateRequested=!0===e,this.terminateRequested&&t.isValid(this.worker)&&!t.isValid(this.queuedMessage)&&this.started&&(this.logging.enabled&&console.info("Worker is terminated immediately as it is not running!"),this._terminate())},e.prototype._terminate=function(){this.worker.terminate(),this._reset()},e}();function a(){if(console.info("Using THREE.LoaderSupport.WorkerSupport version: "+e),this.logging={enabled:!0,debug:!1},void 0===o.Worker)throw"This browser does not support web workers!";if(void 0===o.Blob)throw"This browser does not support Blob!";if("function"!=typeof o.URL.createObjectURL)throw"This browser does not support Object creation from URL!";this.loaderWorker=new r}a.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t,this.loaderWorker.setLogging(this.logging.enabled,this.logging.debug)},a.prototype.setForceWorkerDataCopy=function(e){this.loaderWorker.setForceCopy(e)},a.prototype.validate=function(e,r,a,o,u){if(!t.isValid(this.loaderWorker.worker)){this.logging.enabled&&(console.info("WorkerSupport: Building worker code..."),console.time("buildWebWorkerCode")),t.isValid(u)?this.logging.enabled&&console.info('WorkerSupport: Using "'+u.name+'" as Runner class for worker.'):(u=s.WorkerRunnerRefImpl,this.logging.enabled&&console.info('WorkerSupport: Using DEFAULT "THREE.LoaderSupport.WorkerRunnerRefImpl" as Runner class for worker.'));var c=e(i,l);c+="var Parser = "+r+";\n\n",c+=l(u.name,u),c+="new "+u.name+"();\n\n";var f=this;if(t.isValid(a)&&a.length>0){var d="";!function e(t,r){if(0===r.length)f.loaderWorker.initWorker(d+c,u.name),f.logging.enabled&&console.timeEnd("buildWebWorkerCode");else{var a=new n.FileLoader;a.setPath(t),a.setResponseType("text"),a.load(r[0],(function(a){d+=a,e(t,r)})),r.shift()}}(o,a)}else this.loaderWorker.initWorker(c,u.name),this.logging.enabled&&console.timeEnd("buildWebWorkerCode")}},a.prototype.setCallbacks=function(e,t){this.loaderWorker.setCallbacks(e,t)},a.prototype.run=function(e){this.loaderWorker.run(e)},a.prototype.setTerminateRequested=function(e){this.loaderWorker.setTerminateRequested(e)};var i=function(e,t){var r,a=e+" = {\n";for(var n in t)"string"==typeof(r=t[n])||r instanceof String?a+="\t"+n+': "'+(r=(r=r.replace("\n","\\n")).replace("\r","\\r"))+'",\n':r instanceof Array?a+="\t"+n+": ["+r+"],\n":Number.isInteger(r)?a+="\t"+n+": "+r+",\n":"function"==typeof r&&(a+="\t"+n+": "+r+",\n");return a+="}\n\n"},l=function(e,r,a,n,i){var o,s,l="",u=t.isValid(a)?a:r.name;for(var c in i=t.verifyInput(i,[]),r.prototype)o=r.prototype[c],"constructor"===c?s="\tfunction "+u+o.toString().replace("function","")+";\n\n":"function"==typeof o&&i.indexOf(c)<0&&(l+="\t"+u+".prototype."+c+" = "+o.toString()+";\n\n");l+="\treturn "+u+";\n",l+="})();\n\n";var f="";return t.isValid(n)&&(f+="\n",f+=u+".prototype = Object.create( "+n+".prototype );\n",f+=u+".constructor = "+u+";\n",f+="\n"),t.isValid(s)?l=e+" = (function () {\n\n"+f+s+l:(s=e+" = (function () {\n\n",l=(s+=f+"\t"+r.prototype.constructor.toString()+"\n\n")+l),l};return a}(),s.WorkerDirector=function(){var e="2.2.0",t=s.Validator,r=16,a=8192;function i(n){if(console.info("Using THREE.LoaderSupport.WorkerDirector version: "+e),this.logging={enabled:!0,debug:!1},this.maxQueueSize=a,this.maxWebWorkers=r,this.crossOrigin=null,!t.isValid(n))throw"Provided invalid classDef: "+n;this.workerDescription={classDef:n,globalCallbacks:{},workerSupports:{},forceWorkerDataCopy:!0},this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0,this.callbackOnFinishedProcessing=null}return i.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},i.prototype.getMaxQueueSize=function(){return this.maxQueueSize},i.prototype.getMaxWebWorkers=function(){return this.maxWebWorkers},i.prototype.setCrossOrigin=function(e){this.crossOrigin=e},i.prototype.setForceWorkerDataCopy=function(e){this.workerDescription.forceWorkerDataCopy=!0===e},i.prototype.prepareWorkers=function(e,i,o){t.isValid(e)&&(this.workerDescription.globalCallbacks=e),this.maxQueueSize=Math.min(i,a),this.maxWebWorkers=Math.min(o,r),this.maxWebWorkers=Math.min(this.maxWebWorkers,this.maxQueueSize),this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0;for(var s=0;s0&&this.instructionQueuePointer0},i.prototype.processQueue=function(){var e,t;for(var r in this.workerDescription.workerSupports)(t=this.workerDescription.workerSupports[r]).inUse||(this.instructionQueuePointer=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},i[c]=r;else if(r)if("ka"===u||"kd"===u||"ks"===u){var f=c.split(a,3);r[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else r[u]=c}}var d=new n.MaterialCreator(this.texturePath||this.path,this.materialOptions);return d.setCrossOrigin(this.crossOrigin),d.setManager(this.manager),d.setMaterials(i),d}},(n.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:a.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:a.RepeatWrapping}).prototype={constructor:n.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var r in e){var a=e[r],n={};for(var i in t[r]=n,a){var o=!0,s=a[i],l=i.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(n[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,r=this.materialsInfo[e],n={name:e,side:this.side};function i(e,r){if(!n[e]){var a,i,o=t.getTextureParams(r,n),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(i=o.url)||""===i?"":/^https?:\/\//i.test(i)?i:a+i));s.repeat.copy(o.scale),s.offset.copy(o.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,n[e]=s}}for(var o in r){var s,l=r[o];if(""!==l)switch(o.toLowerCase()){case"kd":n.color=(new a.Color).fromArray(l);break;case"ks":n.specular=(new a.Color).fromArray(l);break;case"map_kd":i("map",l);break;case"map_ks":i("specularMap",l);break;case"norm":i("normalMap",l);break;case"map_bump":case"bump":i("bumpMap",l);break;case"ns":n.shininess=parseFloat(l);break;case"d":(s=parseFloat(l))<1&&(n.opacity=s,n.transparent=!0);break;case"tr":s=parseFloat(l),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var r,n={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},i=e.split(/\s+/);return(r=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),(r=i.indexOf("-s"))>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),(r=i.indexOf("-o"))>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n},loadTexture:function(e,t,r,n,i){var o,s=a.Loader.Handlers.get(e),l=void 0!==this.manager?this.manager:a.DefaultLoadingManager;return null===s&&(s=new a.TextureLoader(l)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,r,n,i),void 0!==t&&(o.mapping=t),o}},t.default=n},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _three=__webpack_require__(0),THREE=_interopRequireWildcard(_three);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var Volume=function(e,t,r,a,n){if(arguments.length>0){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,a){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(n);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(n);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(n);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(n);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(n);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(n);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw"Error in THREE.Volume constructor : this type is not supported in JavaScript";case"Float32":case"float32":case"float":this.data=new Float32Array(n);break;case"Float64":case"float64":case"double":this.data=new Float64Array(n);break;default:this.data=new Uint8Array(n)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw"Error in THREE.Volume constructor, lengths are not matching arrayBuffer size"}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new THREE.Matrix3,this.matrix.identity();var i=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return i},set:function(e){i=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});var o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[]};Volume.prototype={constructor:Volume,getData:function(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]},access:function(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e},reverseAccess:function(e){var t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]},map:function(e,t){var r=this.data.length;t=t||this;for(var a=0;a.9})),jDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[1]))>.9})),kDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[2]))>.9})),argumentsWithInversion=["volume.xLength-1-","volume.yLength-1-","volume.zLength-1-"],argArray=[iDirection,jDirection,kDirection].map((function(e,t){return(e.dot(base[t])>0?"":argumentsWithInversion[t])+(e===axisInIJK?"IJKIndex":e.argVar)})),argString=argArray.join(",");return sliceAccess=eval("(function sliceAccess (i,j) {return volume.access( "+argString+");})"),{iLength:iLength,jLength:jLength,sliceAccess:sliceAccess,matrix:planeMatrix,planeWidth:planeWidth,planeHeight:planeHeight}},extractSlice:function(e,t){var r=new THREE.VolumeSlice(this,t,e);return this.sliceList.push(r),r},repaintAllSlices:function(){return this.sliceList.forEach((function(e){e.repaint()})),this},computeMinMax:function(){var e=1/0,t=-1/0,r=this.data.length,a=0;for(a=0;a","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","float l = linearToRelativeLuminance( texel.rgb );","gl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","uniform sampler2D luminanceMap;","#else","uniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","#ifdef ADAPTED_LUMINANCE","float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","#else","float fLumAvg = averageLuminance;","#endif","float fLumPixel = linearToRelativeLuminance( vColor );","float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","return fLumCompressed * vColor;","}","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-e*e/(2*t*t))}var r,a,n,i,o=2*Math.ceil(3*e)+1;for(o>25&&(o=25),i=.5*(o-1),a=new Array(o),n=0,r=0;r","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","vec2 aspectcorrect = vec2( 1.0, aspect );","float viewZ = getViewZ( getDepth( vUv ) );","float factor = ( focus + viewZ );","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},tSize:{value:new a.Vector2(256,256)},center:{value:new a.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float dx = rand( vUv + time );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","if(byp<1) {","vec2 p = vUv;","float xs = floor(gl_FragCoord.x / 0.5);","float ys = floor(gl_FragCoord.y / 0.5);","vec4 normal = texture2D (tDisp, p*seed*seed);","if(p.ydistortion_x-col_s*seed) {","if(seed_x>0.){","p.y = 1. - (p.y + distortion_y);","}","else {","p.y = distortion_y;","}","}","if(p.xdistortion_y-col_s*seed) {","if(seed_y>0.){","p.x=distortion_x;","}","else {","p.x = 1. - (p.x + distortion_x);","}","}","p.x+=normal.x*seed_x*(seed/5.);","p.y+=normal.y*seed_y*(seed/5.);","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, p + offset);","vec4 cga = texture2D(tDiffuse, p);","vec4 cb = texture2D(tDiffuse, p - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","gl_FragColor = gl_FragColor+ snow;","}","else {","gl_FragColor=texture2D (tDiffuse, vUv);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","vUV = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","return a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","return sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","float dist = hypot( coord.x - p.x, coord.y - p.y );","float rad = channel;","if ( shape == SHAPE_DOT ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","} else if ( shape == SHAPE_ELLIPSE ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","if ( dist != 0.0 ) {","float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","}","} else if ( shape == SHAPE_LINE ) {","rad = pow( abs( rad ), 1.5) * rad_max;","float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","dist = hypot( normal.x * dot_p, normal.y * dot_p );","} else if ( shape == SHAPE_SQUARE ) {","float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","float sin_t = abs( sin( theta ) );","float cos_t = abs( cos( theta ) );","rad = pow( abs( rad ), 1.4 );","rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","}","return rad - dist;","}","struct Cell {","vec2 normal;","vec2 p1;","vec2 p2;","vec2 p3;","vec2 p4;","float samp2;","float samp1;","float samp3;","float samp4;","};","vec4 getSample( vec2 point ) {","vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","float step = PI2 / float( samples );","float dist = radius * 0.66;","for ( int i = 0; i < samples; ++i ) {","float r = base + step * float( i );","vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","}","tex /= float( samples ) + 1.0;","return tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","if ( channel == 0 ) {","c.samp1 = getSample( c.p1 ).r;","c.samp2 = getSample( c.p2 ).r;","c.samp3 = getSample( c.p3 ).r;","c.samp4 = getSample( c.p4 ).r;","} else if (channel == 1) {","c.samp1 = getSample( c.p1 ).g;","c.samp2 = getSample( c.p2 ).g;","c.samp3 = getSample( c.p3 ).g;","c.samp4 = getSample( c.p4 ).g;","} else {","c.samp1 = getSample( c.p1 ).b;","c.samp3 = getSample( c.p3 ).b;","c.samp2 = getSample( c.p2 ).b;","c.samp4 = getSample( c.p4 ).b;","}","dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","res = clamp( res, 0.0, 1.0 );","return res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","Cell c;","vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","float threshold = step * 0.5;","float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","float offset_normal = mod( hypot( offset.x, offset.y ), step );","float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","c.normal = n;","c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","if ( scatter != 0.0 ) {","float off_mag = scatter * threshold * 0.5;","float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","c.p1.x += cos( off_angle ) * off_mag;","c.p1.y += sin( off_angle ) * off_mag;","}","float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","c.p2.x = c.p1.x - n.x * normal_step;","c.p2.y = c.p1.y - n.y * normal_step;","c.p3.x = c.p1.x + n.y * line_step;","c.p3.y = c.p1.y - n.x * line_step;","c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","return c;","}","float blendColour( float a, float b, float t ) {","if ( blendingMode == BLENDING_LINEAR ) {","return blend( a, b, 1.0 - t );","} else if ( blendingMode == BLENDING_ADD ) {","return blend( a, min( 1.0, a + b ), t );","} else if ( blendingMode == BLENDING_MULTIPLY ) {","return blend( a, max( 0.0, a * b ), t );","} else if ( blendingMode == BLENDING_LIGHTER ) {","return blend( a, max( a, b ), t );","} else if ( blendingMode == BLENDING_DARKER ) {","return blend( a, min( a, b ), t );","} else {","return blend( a, b, 1.0 - t );","}","}","void main() {","if ( ! disable ) {","vec2 p = vec2( vUV.x * width, vUV.y * height );","vec2 origin = vec2( 0, 0 );","float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","Cell cell_r = getReferenceCell( p, origin, rotateR, radius );","Cell cell_g = getReferenceCell( p, origin, rotateG, radius );","Cell cell_b = getReferenceCell( p, origin, rotateB, radius );","float r = getDotColour( cell_r, p, 0, rotateR, aa );","float g = getDotColour( cell_g, p, 1, rotateG, aa );","float b = getDotColour( cell_b, p, 2, rotateB, aa );","vec4 colour = texture2D( tDiffuse, vUV );","r = blendColour( r, colour.r, blending );","g = blendColour( g, colour.g, blending );","b = blendColour( b, colour.b, blending );","if ( greyscale ) {","r = g = b = (r + b + g) / 3.0;","}","gl_FragColor = vec4( r, g, b, 1.0 );","} else {","gl_FragColor = texture2D( tDiffuse, vUV );","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{type:"t",value:null},tDiffuse:{type:"t",value:null},tNormal:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},cameraProjectionMatrix:{type:"m4",value:new a.Matrix4},cameraInverseProjectionMatrix:{type:"m4",value:new a.Matrix4},scale:{type:"f",value:1},intensity:{type:"f",value:.1},bias:{type:"f",value:.5},minResolution:{type:"f",value:0},kernelRadius:{type:"f",value:100},randomSeed:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},sampleUvOffsets:{type:"v2v",value:[new a.Vector2(0,0)]},sampleWeights:{type:"1fv",value:[1]},tDepth:{type:"t",value:null},cameraNear:{type:"f",value:10},cameraFar:{type:"f",value:1e3},depthCutoff:{type:"f",value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","float depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={createSampleWeights:function(e,t){for(var r=function(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)},a=[],n=0;n<=e;n++)a.push(r(n,t));return a},createSampleOffsets:function(e,t){for(var r=[],a=0;a<=e;a++)r.push(t.clone().multiplyScalar(a));return r},configure:function(e,t,r,n){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=a.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=a.createSampleWeights(t,r),e.needsUpdate=!0}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","t = abs( C - Ctop );","delta.y = max( max( t.r, t.g ), t.b );","vec2 edges = step( threshold, delta.xy );","if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){n.default.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==o?o:0,void 0===i.default&&console.error("THREE.SSAARenderPass relies on THREE.CopyShader");var s=i.default;this.copyUniforms=a.UniformsUtils.clone(s.uniforms),this.copyMaterial=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.camera2=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene2=new a.Scene,this.quad2=new a.Mesh(new a.PlaneBufferGeometry(2,2),this.copyMaterial),this.quad2.frustumCulled=!1,this.scene2.add(this.quad2)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var n=s.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1;var o=e.getClearColor().getHex(),l=e.getClearAlpha(),u=1/n.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;for(var c=r.width,f=r.height,d=0;d","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );","float gg = fract( coord.t * ( size.y / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float readDepth( const in vec2 coord ) {","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","#ifdef USE_LOGDEPTHBUF","float logz = unpackRGBAToDepth( texture2D( tDepth, coord ) );","float w = pow(2.0, (logz / logDepthBufFC)) - 1.0;","float z = (logz / w) + 1.0;","#else","float z = unpackRGBAToDepth( texture2D( tDepth, coord ) );","#endif","return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 8.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + radius * vv;","vec2 coord2 = vUv - radius * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float ao = 0.0;","float dz = 1.0 / float( samples );","float l = 0.0;","float z = 1.0 - dz / 2.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","float pw = cos( l ) * r;","float ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{type:"t",value:null},luminosityThreshold:{type:"f",value:1},smoothWidth:{type:"f",value:1},defaultColor:{type:"c",value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(0)},defaultOpacity:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","gl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var n=r(40);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}));var i=r(48);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}));var o=r(90);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}));var s=r(112);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})}));var l=r(144);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VRControls=t.TransformControls=t.TrackballControls=t.PointerLockControls=t.OrthographicTrackballControls=t.OrbitControls=t.FlyControls=t.FirstPersonControls=t.EditorControls=t.DragControls=t.DeviceOrientationControls=void 0;var a=p(r(29)),n=p(r(30)),i=p(r(31)),o=p(r(32)),s=p(r(33)),l=p(r(34)),u=p(r(35)),c=p(r(36)),f=p(r(37)),d=p(r(38)),h=p(r(39));function p(e){return e&&e.__esModule?e:{default:e}}t.DeviceOrientationControls=a.default,t.DragControls=n.default,t.EditorControls=i.default,t.FirstPersonControls=o.default,t.FlyControls=s.default,t.OrbitControls=l.default,t.OrthographicTrackballControls=u.default,t.PointerLockControls=c.default,t.TrackballControls=f.default,t.TransformControls=d.default,t.VRControls=h.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r,n,i,o,s=function(e){t.deviceOrientation=e},l=function(){t.screenOrientation=window.orientation||0},u=(r=new a.Vector3(0,0,1),n=new a.Euler,i=new a.Quaternion,o=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),function(e,t,a,s,l){n.set(a,t,-s,"YXZ"),e.setFromEuler(n),e.multiply(o),e.multiply(i.setFromAxisAngle(r,-l))});this.connect=function(){l(),window.addEventListener("orientationchange",l,!1),window.addEventListener("deviceorientation",s,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",l,!1),window.removeEventListener("deviceorientation",s,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var r=e.alpha?a.Math.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?a.Math.degToRad(e.beta):0,i=e.gamma?a.Math.degToRad(e.gamma):0,o=t.screenOrientation?a.Math.degToRad(t.screenOrientation):0;u(t.object.quaternion,r,n,i,o)}}},this.dispose=function(){t.disconnect()},this.connect()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t,r){if(e instanceof a.Camera){console.warn("THREE.DragControls: Constructor now expects ( objects, camera, domElement )");var n=e;e=t,t=n}var i=new a.Plane,o=new a.Raycaster,s=new a.Vector2,l=new a.Vector3,u=new a.Vector3,c=null,f=null,d=this;function h(){r.addEventListener("mousemove",m,!1),r.addEventListener("mousedown",v,!1),r.addEventListener("mouseup",g,!1),r.addEventListener("mouseleave",g,!1),r.addEventListener("touchmove",y,!1),r.addEventListener("touchstart",b,!1),r.addEventListener("touchend",w,!1)}function p(){r.removeEventListener("mousemove",m,!1),r.removeEventListener("mousedown",v,!1),r.removeEventListener("mouseup",g,!1),r.removeEventListener("mouseleave",g,!1),r.removeEventListener("touchmove",y,!1),r.removeEventListener("touchstart",b,!1),r.removeEventListener("touchend",w,!1)}function m(a){a.preventDefault();var n=r.getBoundingClientRect();if(s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c});o.setFromCamera(s,t);var h=o.intersectObjects(e);if(h.length>0){var p=h[0].object;i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),p.position),f!==p&&(d.dispatchEvent({type:"hoveron",object:p}),r.style.cursor="pointer",f=p)}else null!==f&&(d.dispatchEvent({type:"hoveroff",object:f}),r.style.cursor="auto",f=null)}function v(a){a.preventDefault(),o.setFromCamera(s,t);var n=o.intersectObjects(e);n.length>0&&(c=n[0].object,o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function g(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}function y(e){e.preventDefault(),e=e.changedTouches[0];var a=r.getBoundingClientRect();if(s.x=(e.clientX-a.left)/a.width*2-1,s.y=-(e.clientY-a.top)/a.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c})}function b(a){a.preventDefault(),a=a.changedTouches[0];var n=r.getBoundingClientRect();s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t);var f=o.intersectObjects(e);f.length>0&&(c=f[0].object,i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),c.position),o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function w(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}h(),this.enabled=!0,this.activate=h,this.deactivate=p,this.dispose=function(){p()},this.setObjects=function(){console.error("THREE.DragControls: setObjects() has been removed.")},this.on=function(e,t){console.warn("THREE.DragControls: on() has been deprecated. Use addEventListener() instead."),d.addEventListener(e,t)},this.off=function(e,t){console.warn("THREE.DragControls: off() has been deprecated. Use removeEventListener() instead."),d.removeEventListener(e,t)},this.notify=function(e){console.error("THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead."),d.dispatchEvent({type:e})}};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){t=void 0!==t?t:document,this.enabled=!0,this.center=new a.Vector3,this.panSpeed=.001,this.zoomSpeed=.001,this.rotationSpeed=.005;var r=this,n=new a.Vector3,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2},o=i.NONE,s=this.center,l=new a.Matrix3,u=new a.Vector2,c=new a.Vector2,f=new a.Spherical,d={type:"change"};function h(e){!1!==r.enabled&&(0===e.button?o=i.ROTATE:1===e.button?o=i.ZOOM:2===e.button&&(o=i.PAN),c.set(e.clientX,e.clientY),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",m,!1),t.addEventListener("mouseout",m,!1),t.addEventListener("dblclick",m,!1))}function p(e){if(!1!==r.enabled){u.set(e.clientX,e.clientY);var t=u.x-c.x,n=u.y-c.y;o===i.ROTATE?r.rotate(new a.Vector3(-t*r.rotationSpeed,-n*r.rotationSpeed,0)):o===i.ZOOM?r.zoom(new a.Vector3(0,0,n)):o===i.PAN&&r.pan(new a.Vector3(-t,n,0)),c.set(e.clientX,e.clientY)}}function m(e){t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),o=i.NONE}function v(e){e.preventDefault(),r.zoom(new a.Vector3(0,0,e.deltaY))}function g(e){e.preventDefault()}this.focus=function(t){var n,i=(new a.Box3).setFromObject(t);!1===i.isEmpty()?(s.copy(i.getCenter()),n=i.getBoundingSphere().radius):(s.setFromMatrixPosition(t.matrixWorld),n=.1);var o=new a.Vector3(0,0,1);o.applyQuaternion(e.quaternion),o.multiplyScalar(4*n),e.position.copy(s).add(o),r.dispatchEvent(d)},this.pan=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.panSpeed),t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),s.add(t),r.dispatchEvent(d)},this.zoom=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.zoomSpeed),t.length()>a||(t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),r.dispatchEvent(d))},this.rotate=function(t){n.copy(e.position).sub(s),f.setFromVector3(n),f.theta+=t.x,f.phi+=t.y,f.makeSafe(),n.setFromSpherical(f),e.position.copy(s).add(n),e.lookAt(s),r.dispatchEvent(d)},this.dispose=function(){t.removeEventListener("contextmenu",g,!1),t.removeEventListener("mousedown",h,!1),t.removeEventListener("wheel",v,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),t.removeEventListener("touchstart",x,!1),t.removeEventListener("touchmove",_,!1)},t.addEventListener("contextmenu",g,!1),t.addEventListener("mousedown",h,!1),t.addEventListener("wheel",v,!1);var y=[new a.Vector3,new a.Vector3,new a.Vector3],b=[new a.Vector3,new a.Vector3,new a.Vector3],w=null;function x(e){if(!1!==r.enabled){switch(e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0);break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0),w=y[0].distanceTo(y[1])}b[0].copy(y[0]),b[1].copy(y[1])}}function _(e){if(!1!==r.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0),r.rotate(y[0].sub(o(y[0],b)).multiplyScalar(-r.rotationSpeed));break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0);var t=y[0].distanceTo(y[1]);r.zoom(new a.Vector3(0,0,w-t)),w=t;var n=y[0].clone().sub(o(y[0],b)),i=y[1].clone().sub(o(y[1],b));n.x=-n.x,i.x=-i.x,r.pan(n.add(i).multiplyScalar(.5))}b[0].copy(y[0]),b[1].copy(y[1])}function o(e,t){var r=t[0];for(var a in t)r.distanceTo(e)>t[a].distanceTo(e)&&(r=t[a]);return r}}t.addEventListener("touchstart",x,!1),t.addEventListener("touchmove",_,!1)};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e){e.preventDefault()}this.object=e,this.target=new a.Vector3(0,0,0),this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.lookSpeed=.005,this.lookVertical=!0,this.autoForward=!1,this.activeLook=!0,this.heightSpeed=!1,this.heightCoef=1,this.heightMin=0,this.heightMax=1,this.constrainVertical=!1,this.verticalMin=0,this.verticalMax=Math.PI,this.autoSpeedFactor=0,this.mouseX=0,this.mouseY=0,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.moveForward=!1,this.moveBackward=!1,this.moveLeft=!1,this.moveRight=!1,this.mouseDragOn=!1,this.viewHalfX=0,this.viewHalfY=0,this.domElement!==document&&this.domElement.setAttribute("tabindex",-1),this.handleResize=function(){this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)},this.onMouseDown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0},this.onMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1},this.onMouseMove=function(e){this.domElement===document?(this.mouseX=e.pageX-this.viewHalfX,this.mouseY=e.pageY-this.viewHalfY):(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)},this.onKeyDown=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0}},this.onKeyUp=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}},this.update=function(e){if(!1!==this.enabled){if(this.heightSpeed){var t=a.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;var r=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(r+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(r),this.moveLeft&&this.object.translateX(-r),this.moveRight&&this.object.translateX(r),this.moveUp&&this.object.translateY(r),this.moveDown&&this.object.translateY(-r);var n=e*this.lookSpeed;this.activeLook||(n=0);var i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon+=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*i),this.lat=Math.max(-85,Math.min(85,this.lat)),this.phi=a.Math.degToRad(90-this.lat),this.theta=a.Math.degToRad(this.lon),this.constrainVertical&&(this.phi=a.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax));var o=this.target,s=this.object.position;o.x=s.x+100*Math.sin(this.phi)*Math.cos(this.theta),o.y=s.y+100*Math.cos(this.phi),o.z=s.z+100*Math.sin(this.phi)*Math.sin(this.theta),this.object.lookAt(o)}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",r,!1),this.domElement.removeEventListener("mousedown",i,!1),this.domElement.removeEventListener("mousemove",n,!1),this.domElement.removeEventListener("mouseup",o,!1),window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",l,!1)};var n=u(this,this.onMouseMove),i=u(this,this.onMouseDown),o=u(this,this.onMouseUp),s=u(this,this.onKeyDown),l=u(this,this.onKeyUp);function u(e,t){return function(){t.apply(e,arguments)}}this.domElement.addEventListener("contextmenu",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mouseup",o,!1),window.addEventListener("keydown",s,!1),window.addEventListener("keyup",l,!1),this.handleResize()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e,t){return function(){t.apply(e,arguments)}}function n(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this.tmpQuaternion=new a.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new a.Vector3(0,0,0),this.rotationVector=new a.Vector3(0,0,0),this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)},this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),r=t.size[0]/2,a=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-a)/a,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){var t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order)},this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",n,!1),this.domElement.removeEventListener("mousedown",o,!1),this.domElement.removeEventListener("mousemove",i,!1),this.domElement.removeEventListener("mouseup",s,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",u,!1)};var i=r(this,this.mousemove),o=r(this,this.mousedown),s=r(this,this.mouseup),l=r(this,this.keydown),u=r(this,this.keyup);this.domElement.addEventListener("contextmenu",n,!1),this.domElement.addEventListener("mousemove",i,!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mouseup",s,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",u,!1),this.updateMovementVector(),this.updateRotationVector()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),h=d.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&h===d.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),y.set(0,0,0)),g=1,!!(b||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,k=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),R=function(){var e=new a.Vector3;return function(t,r){!0===l.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var a=l.domElement===document?l.domElement.body:l.domElement;if(l.object.isPerspectiveCamera){var n=l.object.position;e.copy(n).sub(l.target);var i=e.length();i*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*i/a.clientHeight,l.object.matrix),R(2*r*i/a.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/a.clientWidth,l.object.matrix),R(r*(l.object.top-l.object.bottom)/l.object.zoom/a.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object.isPerspectiveCamera?g/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object.isPerspectiveCamera?g*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(c),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);A.set(n,i)}}(e),h=d.TOUCH_DOLLY_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;if(h!==d.TOUCH_DOLLY_PAN)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.set(0,Math.pow(T.y/M.y,l.zoomSpeed)),N(P.y),M.copy(T)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);E.set(n,i),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E)}l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.radius=0,this.rotateSpeed=1,this.zoomSpeed=1.2,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.keys=[65,83,68],this.target=new a.Vector3;var i=!0,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector3,c=new a.Vector3,f=new a.Vector2,d=new a.Vector2,h=0,p=0,m=new a.Vector2,v=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom;var g={type:"change"},y={type:"start"},b={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}this.radius=.5*Math.min(this.screen.width,this.screen.height),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var w,x,_,A,E,S,M=(w=new a.Vector2,function(e,t){return w.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),w}),T=function(){var e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(a,i){n.set((a-.5*r.screen.width-r.screen.left)/r.radius,(.5*r.screen.height+r.screen.top-i)/r.radius,0);var o=n.length();return r.noRoll?o1?n.normalize():n.z=Math.sqrt(1-o*o),l.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(n.y),e.add(t.copy(r.object.up).cross(l).setLength(n.x)),e.add(l.setLength(n.z)),e}}();function P(e){!1!==r.enabled&&(window.removeEventListener("keydown",P),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function F(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",P,!1))}function O(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(m.copy(M(e.pageX,e.pageY)),v.copy(m)):(f.copy(M(e.pageX,e.pageY)),d.copy(f)):(u.copy(T(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",L,!1),document.addEventListener("mouseup",C,!1),r.dispatchEvent(y))}function L(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||v.copy(M(e.pageX,e.pageY)):d.copy(M(e.pageX,e.pageY)):c.copy(T(e.pageX,e.pageY)))}function C(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",C),r.dispatchEvent(b))}function k(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),f.y+=.01*e.deltaY,r.dispatchEvent(y),r.dispatchEvent(b))}function R(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,u.copy(T(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;case 2:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=h=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(M(i,s)),v.copy(m);break;default:o=n.NONE}r.dispatchEvent(y)}}function I(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(i,s));break;default:o=n.NONE}}function N(e){if(!1!==r.enabled){switch(e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;case 2:h=p=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,a=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(t,a)),m.copy(v)}o=n.NONE,r.dispatchEvent(b)}}function D(e){e.preventDefault()}this.rotateCamera=(x=new a.Vector3,_=new a.Quaternion,function(){var e=Math.acos(u.dot(c)/u.length()/c.length());e&&(x.crossVectors(u,c).normalize(),e*=r.rotateSpeed,_.setFromAxisAngle(x,-e),l.applyQuaternion(_),r.object.up.applyQuaternion(_),c.applyQuaternion(_),r.staticMoving?u.copy(c):(_.setFromAxisAngle(x,e*(r.dynamicDampingFactor-1)),u.applyQuaternion(_)),i=!0)}),this.zoomCamera=function(){if(o===n.TOUCH_ZOOM_PAN){var e=p/h;h=p,r.object.zoom*=e,i=!0}else{e=1+(d.y-f.y)*r.zoomSpeed;Math.abs(e-1)>1e-6&&e>0&&(r.object.zoom/=e,r.staticMoving?f.copy(d):f.y+=(d.y-f.y)*this.dynamicDampingFactor,i=!0)}},this.panCamera=(A=new a.Vector2,E=new a.Vector3,S=new a.Vector3,function(){if(A.copy(v).sub(m),A.lengthSq()){var e=(r.object.right-r.object.left)/r.object.zoom,t=(r.object.top-r.object.bottom)/r.object.zoom;A.x*=e,A.y*=t,S.copy(l).cross(r.object.up).setLength(A.x),S.add(E.copy(r.object.up).setLength(A.y)),r.object.position.add(S),r.target.add(S),r.staticMoving?m.copy(v):m.add(A.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)),i=!0}}),this.update=function(){l.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||(r.zoomCamera(),i&&r.object.updateProjectionMatrix()),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,l),r.object.lookAt(r.target),i&&(r.dispatchEvent(g),i=!1)},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.left=r.left0,r.object.right=r.right0,r.object.top=r.top0,r.object.bottom=r.bottom0,r.object.lookAt(r.target),r.dispatchEvent(g),i=!1},this.dispose=function(){this.domElement.removeEventListener("contextmenu",D,!1),this.domElement.removeEventListener("mousedown",O,!1),this.domElement.removeEventListener("wheel",k,!1),this.domElement.removeEventListener("touchstart",R,!1),this.domElement.removeEventListener("touchend",N,!1),this.domElement.removeEventListener("touchmove",I,!1),document.removeEventListener("mousemove",L,!1),document.removeEventListener("mouseup",C,!1),window.removeEventListener("keydown",P,!1),window.removeEventListener("keyup",F,!1)},this.domElement.addEventListener("contextmenu",D,!1),this.domElement.addEventListener("mousedown",O,!1),this.domElement.addEventListener("wheel",k,!1),this.domElement.addEventListener("touchstart",R,!1),this.domElement.addEventListener("touchend",N,!1),this.domElement.addEventListener("touchmove",I,!1),window.addEventListener("keydown",P,!1),window.addEventListener("keyup",F,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;e.rotation.set(0,0,0);var r=new a.Object3D;r.add(e);var n=new a.Object3D;n.position.y=10,n.add(r);var i,o,s=Math.PI/2,l=function(e){if(!1!==t.enabled){var a=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;n.rotation.y-=.002*a,r.rotation.x-=.002*i,r.rotation.x=Math.max(-s,Math.min(s,r.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",l,!1)},document.addEventListener("mousemove",l,!1),this.enabled=!1,this.getObject=function(){return n},this.getDirection=(i=new a.Vector3(0,0,-1),o=new a.Euler(0,0,0,"YXZ"),function(e){return o.set(r.rotation.x,n.rotation.y,0),e.copy(i).applyEuler(o),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new a.Vector3;var i=new a.Vector3,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector2,c=new a.Vector2,f=new a.Vector3,d=0,h=new a.Vector2,p=new a.Vector2,m=0,v=0,g=new a.Vector2,y=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var b={type:"change"},w={type:"start"},x={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var _,A,E,S,M,T,P,F,O,L,C,k=(_=new a.Vector2,function(e,t){return _.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),_}),R=function(){var e=new a.Vector2;return function(t,a){return e.set((t-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-a))/r.screen.width),e}}();function I(e){!1!==r.enabled&&(window.removeEventListener("keydown",I),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function N(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",I,!1))}function D(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(g.copy(k(e.pageX,e.pageY)),y.copy(g)):(h.copy(k(e.pageX,e.pageY)),p.copy(h)):(c.copy(R(e.pageX,e.pageY)),u.copy(c)),document.addEventListener("mousemove",U,!1),document.addEventListener("mouseup",j,!1),r.dispatchEvent(w))}function U(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||y.copy(k(e.pageX,e.pageY)):p.copy(k(e.pageX,e.pageY)):(u.copy(c),c.copy(R(e.pageX,e.pageY))))}function j(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",j),r.dispatchEvent(x))}function B(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:h.y-=.025*e.deltaY;break;case 1:h.y-=.01*e.deltaY;break;default:h.y-=25e-5*e.deltaY}r.dispatchEvent(w),r.dispatchEvent(x)}}function V(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,c.copy(R(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;default:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=m=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;g.copy(k(i,s)),y.copy(g)}r.dispatchEvent(w)}}function z(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:u.copy(c),c.copy(R(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=Math.sqrt(t*t+a*a);var n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;y.copy(k(n,i))}}function G(e){if(!1!==r.enabled){switch(e.touches.length){case 0:o=n.NONE;break;case 1:o=n.TOUCH_ROTATE,c.copy(R(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c)}r.dispatchEvent(x)}}function H(e){!1!==r.enabled&&e.preventDefault()}this.rotateCamera=(E=new a.Vector3,S=new a.Quaternion,M=new a.Vector3,T=new a.Vector3,P=new a.Vector3,F=new a.Vector3,function(){F.set(c.x-u.x,c.y-u.y,0),(A=F.length())?(l.copy(r.object.position).sub(r.target),M.copy(l).normalize(),T.copy(r.object.up).normalize(),P.crossVectors(T,M).normalize(),T.setLength(c.y-u.y),P.setLength(c.x-u.x),F.copy(T.add(P)),E.crossVectors(F,l).normalize(),A*=r.rotateSpeed,S.setFromAxisAngle(E,A),l.applyQuaternion(S),r.object.up.applyQuaternion(S),f.copy(E),d=A):!r.staticMoving&&d&&(d*=Math.sqrt(1-r.dynamicDampingFactor),l.copy(r.object.position).sub(r.target),S.setFromAxisAngle(f,d),l.applyQuaternion(S),r.object.up.applyQuaternion(S)),u.copy(c)}),this.zoomCamera=function(){var e;o===n.TOUCH_ZOOM_PAN?(e=m/v,m=v,l.multiplyScalar(e)):(1!==(e=1+(p.y-h.y)*r.zoomSpeed)&&e>0&&l.multiplyScalar(e),r.staticMoving?h.copy(p):h.y+=(p.y-h.y)*this.dynamicDampingFactor)},this.panCamera=(O=new a.Vector2,L=new a.Vector3,C=new a.Vector3,function(){O.copy(y).sub(g),O.lengthSq()&&(O.multiplyScalar(l.length()*r.panSpeed),C.copy(l).cross(r.object.up).setLength(O.x),C.add(L.copy(r.object.up).setLength(O.y)),r.object.position.add(C),r.target.add(C),r.staticMoving?g.copy(y):g.add(O.subVectors(y,g).multiplyScalar(r.dynamicDampingFactor)))}),this.checkDistances=function(){r.noZoom&&r.noPan||(l.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,l.setLength(r.maxDistance)),h.copy(p)),l.lengthSq()1e-6&&(r.dispatchEvent(b),i.copy(r.object.position))},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(b),i.copy(r.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",H,!1),this.domElement.removeEventListener("mousedown",D,!1),this.domElement.removeEventListener("wheel",B,!1),this.domElement.removeEventListener("touchstart",V,!1),this.domElement.removeEventListener("touchend",G,!1),this.domElement.removeEventListener("touchmove",z,!1),document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",I,!1),window.removeEventListener("keyup",N,!1)},this.domElement.addEventListener("contextmenu",H,!1),this.domElement.addEventListener("mousedown",D,!1),this.domElement.addEventListener("wheel",B,!1),this.domElement.addEventListener("touchstart",V,!1),this.domElement.addEventListener("touchend",G,!1),this.domElement.addEventListener("touchmove",z,!1),window.addEventListener("keydown",I,!1),window.addEventListener("keyup",N,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){var e=function(e){a.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.side=a.FrontSide,this.transparent=!0,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(e.prototype=Object.create(a.MeshBasicMaterial.prototype)).constructor=e;var t=function(e){a.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.transparent=!0,this.linewidth=1,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(t.prototype=Object.create(a.LineBasicMaterial.prototype)).constructor=t;var r=new e({visible:!1,transparent:!1}),n=function(){this.init=function(){a.Object3D.call(this),this.handles=new a.Object3D,this.pickers=new a.Object3D,this.planes=new a.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new a.PlaneBufferGeometry(50,50,2,2),t=new a.MeshBasicMaterial({visible:!1,side:a.DoubleSide}),r={XY:new a.Mesh(e,t),YZ:new a.Mesh(e,t),XZ:new a.Mesh(e,t),XYZE:new a.Mesh(e,t)};for(var n in this.activePlane=r.XYZE,r.YZ.rotation.set(0,Math.PI/2,0),r.XZ.rotation.set(-Math.PI/2,0,0),r)r[n].name=n,this.planes.add(r[n]),this.planes[n]=r[n];var i=function(e,t){for(var r in e)for(n=e[r].length;n--;){var a=e[r][n][0],i=e[r][n][1],o=e[r][n][2];a.name=r,a.renderOrder=1/0,i&&a.position.set(i[0],i[1],i[2]),o&&a.rotation.set(o[0],o[1],o[2]),t.add(a)}};i(this.handleGizmos,this.handles),i(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof a.Mesh){e.updateMatrix();var t=e.geometry.clone();t.applyMatrix(e.matrix),e.geometry=t,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))},this.highlight=function(e){this.traverse((function(t){t.material&&t.material.highlight&&(t.name===e?t.material.highlight(!0):t.material.highlight(!1))}))}};(n.prototype=Object.create(a.Object3D.prototype)).constructor=n,n.prototype.update=function(e,t){var r=new a.Vector3(0,0,0),n=new a.Vector3(0,1,0),i=new a.Matrix4;this.traverse((function(a){-1!==a.name.search("E")?a.quaternion.setFromRotationMatrix(i.lookAt(t,r,n)):-1===a.name.search("X")&&-1===a.name.search("Y")&&-1===a.name.search("Z")||a.quaternion.setFromEuler(e)}))};var i=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.CylinderGeometry(0,.05,.2,12,1,!1));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),new e({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),r)]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()};(i.prototype=Object.create(n.prototype)).constructor=i;var o=function(){n.call(this);var e=function(e,t,r){var n=new a.BufferGeometry,i=[];r=r||1;for(var o=0;o<=64*r;++o)"x"===t&&i.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&i.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&i.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return n.addAttribute("position",new a.Float32BufferAttribute(i,3)),n};this.handleGizmos={X:[[new a.Line(new e(1,"x",.5),new t({color:16711680}))]],Y:[[new a.Line(new e(1,"y",.5),new t({color:65280}))]],Z:[[new a.Line(new e(1,"z",.5),new t({color:255}))]],E:[[new a.Line(new e(1.25,"z",1),new t({color:13421568}))]],XYZE:[[new a.Line(new e(1,"z",1),new t({color:7895160}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusBufferGeometry(1.25,.12,2,24),r)]],XYZE:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,2,24),r)]]},this.pickerGizmos.XYZE[0][0].visible=!1,this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){n.prototype.update.apply(this,arguments);var r=new a.Matrix4,i=new a.Euler(0,0,1),o=new a.Quaternion,s=new a.Vector3(1,0,0),l=new a.Vector3(0,1,0),u=new a.Vector3(0,0,1),c=new a.Quaternion,f=new a.Quaternion,d=new a.Quaternion,h=t.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),r.makeRotationFromQuaternion(o).getInverse(r),h.applyMatrix4(r),this.traverse((function(e){o.setFromEuler(i),"X"===e.name&&(c.setFromAxisAngle(s,Math.atan2(-h.y,h.z)),o.multiplyQuaternions(o,c),e.quaternion.copy(o)),"Y"===e.name&&(f.setFromAxisAngle(l,Math.atan2(h.x,h.z)),o.multiplyQuaternions(o,f),e.quaternion.copy(o)),"Z"===e.name&&(d.setFromAxisAngle(u,Math.atan2(h.y,h.x)),o.multiplyQuaternions(o,d),e.quaternion.copy(o))}))},this.init()};(o.prototype=Object.create(n.prototype)).constructor=o;var s=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.BoxGeometry(.125,.125,.125));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.125,.125,.125),new e({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.4,.4,.4),r)]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()};(s.prototype=Object.create(n.prototype)).constructor=s;var l=function(e,t){a.Object3D.call(this),t=void 0!==t?t:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var r=this,n="translate",l=!1,u={translate:new i,rotate:new o,scale:new s};for(var c in u){var f=u[c];f.visible=c===n,this.add(f)}var d={type:"change"},h={type:"mouseDown"},p={type:"mouseUp",mode:n},m={type:"objectChange"},v=new a.Raycaster,g=new a.Vector2,y=new a.Vector3,b=new a.Vector3,w=new a.Vector3,x=new a.Vector3,_=1,A=new a.Matrix4,E=new a.Vector3,S=new a.Matrix4,M=new a.Vector3,T=new a.Quaternion,P=new a.Vector3(1,0,0),F=new a.Vector3(0,1,0),O=new a.Vector3(0,0,1),L=new a.Quaternion,C=new a.Quaternion,k=new a.Quaternion,R=new a.Quaternion,I=new a.Quaternion,N=new a.Vector3,D=new a.Vector3,U=new a.Matrix4,j=new a.Matrix4,B=new a.Vector3,V=new a.Vector3,z=new a.Euler,G=new a.Matrix4,H=new a.Vector3,X=new a.Euler;function Y(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,u[n].pickers.children),a=null;t&&(a=t.object.name,e.preventDefault()),r.axis!==a&&(r.axis=a,r.update(),r.dispatchEvent(d))}}function W(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=e.changedTouches?e.changedTouches[0]:e;if(0===t.button||void 0===t.button){var a=Z(t,u[n].pickers.children);if(a){e.preventDefault(),e.stopPropagation(),r.axis=a.object.name,r.dispatchEvent(h),r.update(),E.copy(H).sub(V).normalize(),u[n].setActivePlane(r.axis,E);var i=Z(t,[u[n].activePlane]);i&&(N.copy(r.object.position),D.copy(r.object.scale),U.extractRotation(r.object.matrix),G.extractRotation(r.object.matrixWorld),j.extractRotation(r.object.parent.matrixWorld),B.setFromMatrixScale(S.getInverse(r.object.parent.matrixWorld)),b.copy(i.point))}}l=!0}}function q(e){if(void 0!==r.object&&null!==r.axis&&!1!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,[u[n].activePlane]);!1!==t&&(e.preventDefault(),e.stopPropagation(),y.copy(t.point),"translate"===n?(y.sub(b),y.multiply(B),"local"===r.space&&(y.applyMatrix4(S.getInverse(G)),-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(U),r.object.position.copy(N),r.object.position.add(y)),"world"!==r.space&&-1===r.axis.search("XYZ")||(-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(S.getInverse(j)),r.object.position.copy(N),r.object.position.add(y)),null!==r.translationSnap&&("local"===r.space&&r.object.position.applyMatrix4(S.getInverse(G)),-1!==r.axis.search("X")&&(r.object.position.x=Math.round(r.object.position.x/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Y")&&(r.object.position.y=Math.round(r.object.position.y/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Z")&&(r.object.position.z=Math.round(r.object.position.z/r.translationSnap)*r.translationSnap),"local"===r.space&&r.object.position.applyMatrix4(G))):"scale"===n?(y.sub(b),y.multiply(B),"local"===r.space&&("XYZ"===r.axis?(_=1+y.y/Math.max(D.x,D.y,D.z),r.object.scale.x=D.x*_,r.object.scale.y=D.y*_,r.object.scale.z=D.z*_):(y.applyMatrix4(S.getInverse(G)),"X"===r.axis&&(r.object.scale.x=D.x*(1+y.x/D.x)),"Y"===r.axis&&(r.object.scale.y=D.y*(1+y.y/D.y)),"Z"===r.axis&&(r.object.scale.z=D.z*(1+y.z/D.z))))):"rotate"===n&&(y.sub(V),y.multiply(B),M.copy(b).sub(V),M.multiply(B),"E"===r.axis?(y.applyMatrix4(S.getInverse(A)),M.applyMatrix4(S.getInverse(A)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),I.setFromAxisAngle(E,w.z-x.z),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,I),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"XYZE"===r.axis?(I.setFromEuler(y.clone().cross(M).normalize()),T.setFromRotationMatrix(S.getInverse(j)),C.setFromAxisAngle(I,-y.clone().angleTo(M)),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,C),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"local"===r.space?(y.applyMatrix4(S.getInverse(G)),M.applyMatrix4(S.getInverse(G)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),L.setFromRotationMatrix(U),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),k.setFromAxisAngle(F,w.y-x.y),R.setFromAxisAngle(O,w.z-x.z)),"X"===r.axis&&L.multiplyQuaternions(L,C),"Y"===r.axis&&L.multiplyQuaternions(L,k),"Z"===r.axis&&L.multiplyQuaternions(L,R),r.object.quaternion.copy(L)):"world"===r.space&&(w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),k.setFromAxisAngle(F,w.y-x.y),R.setFromAxisAngle(O,w.z-x.z)),L.setFromRotationMatrix(G),"X"===r.axis&&T.multiplyQuaternions(T,C),"Y"===r.axis&&T.multiplyQuaternions(T,k),"Z"===r.axis&&T.multiplyQuaternions(T,R),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T))),r.update(),r.dispatchEvent(d),r.dispatchEvent(m))}}function Q(e){e.preventDefault(),void 0!==e.button&&0!==e.button||(l&&null!==r.axis&&(p.mode=n,r.dispatchEvent(p)),l=!1,"TouchEvent"in window&&e instanceof TouchEvent?(r.axis=null,r.update(),r.dispatchEvent(d)):Y(e))}function Z(r,a){var n=t.getBoundingClientRect(),i=(r.clientX-n.left)/n.width,o=(r.clientY-n.top)/n.height;g.set(2*i-1,-2*o+1),v.setFromCamera(g,e);var s=v.intersectObjects(a,!0);return!!s[0]&&s[0]}t.addEventListener("mousedown",W,!1),t.addEventListener("touchstart",W,!1),t.addEventListener("mousemove",Y,!1),t.addEventListener("touchmove",Y,!1),t.addEventListener("mousemove",q,!1),t.addEventListener("touchmove",q,!1),t.addEventListener("mouseup",Q,!1),t.addEventListener("mouseout",Q,!1),t.addEventListener("touchend",Q,!1),t.addEventListener("touchcancel",Q,!1),t.addEventListener("touchleave",Q,!1),this.dispose=function(){t.removeEventListener("mousedown",W),t.removeEventListener("touchstart",W),t.removeEventListener("mousemove",Y),t.removeEventListener("touchmove",Y),t.removeEventListener("mousemove",q),t.removeEventListener("touchmove",q),t.removeEventListener("mouseup",Q),t.removeEventListener("mouseout",Q),t.removeEventListener("touchend",Q),t.removeEventListener("touchcancel",Q),t.removeEventListener("touchleave",Q)},this.attach=function(e){this.object=e,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return n},this.setMode=function(e){for(var t in"scale"===(n=e||n)&&(r.space="local"),u)u[t].visible=t===n;this.update(),r.dispatchEvent(d)},this.setTranslationSnap=function(e){r.translationSnap=e},this.setRotationSnap=function(e){r.rotationSnap=e},this.setSize=function(e){r.size=e,this.update(),r.dispatchEvent(d)},this.setSpace=function(e){r.space=e,this.update(),r.dispatchEvent(d)},this.update=function(){void 0!==r.object&&(r.object.updateMatrixWorld(),V.setFromMatrixPosition(r.object.matrixWorld),z.setFromRotationMatrix(S.extractRotation(r.object.matrixWorld)),e.updateMatrixWorld(),H.setFromMatrixPosition(e.matrixWorld),X.setFromRotationMatrix(S.extractRotation(e.matrixWorld)),_=V.distanceTo(H)/6*r.size,this.position.copy(V),this.scale.set(_,_,_),e instanceof a.PerspectiveCamera?E.copy(H).sub(V).normalize():e instanceof a.OrthographicCamera&&E.copy(H).normalize(),"local"===r.space?u[n].update(z,E):"world"===r.space&&u[n].update(new a.Euler,E),u[n].highlight(r.axis))}};return(l.prototype=Object.create(a.Object3D.prototype)).constructor=l,l}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){var r,n,i=this,o=new a.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")})).catch((function(){console.warn("THREE.VRControls: Unable to get VR Displays")})),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return o},this.update=function(){var t;r&&(r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(i.scale))},this.dispose=function(){r=null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedGeometryExporter=t.STLExporter=t.STLBinaryExporter=t.PLYExporter=t.OBJExporter=t.MMDExporter=t.GLTFExporter=void 0;var a=c(r(41)),n=c(r(42)),i=c(r(43)),o=c(r(44)),s=c(r(45)),l=c(r(46)),u=c(r(47));function c(e){return e&&e.__esModule?e:{default:e}}t.GLTFExporter=a.default,t.MMDExporter=n.default,t.OBJExporter=i.default,t.PLYExporter=o.default,t.STLBinaryExporter=s.default,t.STLExporter=l.default,t.TypedGeometryExporter=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987},i={1003:n.NEAREST,1004:n.NEAREST_MIPMAP_NEAREST,1005:n.NEAREST_MIPMAP_LINEAR,1006:n.LINEAR,1007:n.LINEAR_MIPMAP_NEAREST,1008:n.LINEAR_MIPMAP_LINEAR},o={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},s=function(){};s.prototype={constructor:s,parse:function(e,t,r){(r=Object.assign({},{trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,animations:[],forceIndices:!1,forcePowerOfTwoTextures:!1},r)).animations.length>0&&(r.trs=!0);var s,l={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},u=0,c=[],f=[],d=new Map,h=[],p={},m={attributes:new Map,materials:new Map,textures:new Map};function v(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}function g(e){return 4*Math.ceil(e/4)}function y(e,t){t=t||0;var r=g(e.byteLength);if(r!==e.byteLength){var a=new Uint8Array(r);if(a.set(new Uint8Array(e)),0!==t)for(var n=e.byteLength;n0)&&(t.alphaMode=e.opacity<1?"BLEND":"MASK",e.alphaTest>0&&.5!==e.alphaTest&&(t.alphaCutoff=e.alphaTest)),e.side===a.DoubleSide&&(t.doubleSided=!0),""!==e.name&&(t.name=e.name),l.materials.push(t);var i=l.materials.length-1;return m.materials.set(e,i),i}function S(e){var t,i=e.geometry;if(e.isLineSegments)t=n.LINES;else if(e.isLineLoop)t=n.LINE_LOOP;else if(e.isLine)t=n.LINE_STRIP;else if(e.isPoints)t=n.POINTS;else{if(!i.isBufferGeometry){var o=new a.BufferGeometry;o.fromGeometry(i),i=o}e.drawMode===a.TriangleFanDrawMode?(console.warn("GLTFExporter: TriangleFanDrawMode and wireframe incompatible."),t=n.TRIANGLE_FAN):t=e.drawMode===a.TriangleStripDrawMode?e.material.wireframe?n.LINE_STRIP:n.TRIANGLE_STRIP:e.material.wireframe?n.LINES:n.TRIANGLES}var s={},u={},c=[],f=[],d={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},h=i.getAttribute("normal");for(var p in void 0===h||function(e){if(m.attributes.has(e))return!1;for(var t=new a.Vector3,r=0,n=e.count;r5e-4)return!1;return!0}(h)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.addAttribute("normal",function(e){if(m.attributes.has(e))return m.textures.get(e);for(var t=e.clone(),r=new a.Vector3,n=0,i=t.count;n0){var b=[],x=[],_={};if(void 0!==e.morphTargetDictionary)for(var A in e.morphTargetDictionary)_[e.morphTargetDictionary[A]]=A;for(var S=0;S0&&(s.extras={},s.extras.targetNames=x)}var C=r.forceIndices,k=Array.isArray(e.material);if(k&&0===e.geometry.groups.length)return null;!C&&null===i.index&&k&&(console.warn("THREE.GLTFExporter: Creating index for non-indexed multi-material mesh."),C=!0);var R=!1;if(null===i.index&&C){for(var I=[],N=(S=0,i.attributes.position.count);S0&&(j.targets=f),null!==i.index&&(j.indices=w(i.index,i,U[S].start,U[S].count));var B=E(D[U[S].materialIndex]);null!==B&&(j.material=B),c.push(j)}return R&&i.setIndex(null),s.primitives=c,l.meshes||(l.meshes=[]),l.meshes.push(s),l.meshes.length-1}function M(e,t){l.animations||(l.animations=[]);for(var r=[],n=[],i=0;i0)try{t.extras=JSON.parse(JSON.stringify(e.userData))}catch(e){throw new Error("THREE.GLTFExporter: userData can't be serialized")}if(e.isMesh||e.isLine||e.isPoints){var s=S(e);null!==s&&(t.mesh=s)}else e.isCamera&&(t.camera=function(e){l.cameras||(l.cameras=[]);var t=e.isOrthographicCamera,r={type:t?"orthographic":"perspective"};return t?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:a.Math.degToRad(e.fov)/e.aspect,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),l.cameras.push(r),l.cameras.length-1}(e));if(e.isSkinnedMesh&&h.push(e),e.children.length>0){for(var u=[],c=0,f=e.children.length;c0&&(t.children=u)}l.nodes.push(t);var g=l.nodes.length-1;return d.set(e,g),g}function F(e){l.scenes||(l.scenes=[],l.scene=0);var t={nodes:[]};""!==e.name&&(t.name=e.name),l.scenes.push(t);for(var a=[],n=0,i=e.children.length;n0&&(t.nodes=a)}!function(e){e=e instanceof Array?e:[e];for(var t=[],n=0;n0&&function(e){var t=new a.Scene;t.name="AuxScene";for(var r=0;r0&&(l.extensionsUsed=a),l.buffers&&l.buffers.length>0){l.buffers[0].byteLength=e.size;var n=new window.FileReader;if(!0===r.binary){n.readAsArrayBuffer(e),n.onloadend=function(){var e=y(n.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,e.byteLength,!0),r.setUint32(4,5130562,!0);var a=y(function(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0,a=e.length;r255?32:n}return t.buffer}(JSON.stringify(l)),32),i=new DataView(new ArrayBuffer(8));i.setUint32(0,a.byteLength,!0),i.setUint32(4,1313821514,!0);var o=new ArrayBuffer(12),s=new DataView(o);s.setUint32(0,1179937895,!0),s.setUint32(4,2,!0);var u=12+i.byteLength+a.byteLength+r.byteLength+e.byteLength;s.setUint32(8,u,!0);var c=new Blob([o,i,a,r,e],{type:"application/octet-stream"}),f=new window.FileReader;f.readAsArrayBuffer(c),f.onloadend=function(){t(f.result)}}}else n.readAsDataURL(e),n.onloadend=function(){var e=n.result;l.buffers[0].uri=e,t(l)}}else t(l)}))}},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(0)),n=i(r(4));function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.default=function(){var e;this.parseVpd=function(t,r,i){if(!0!==t.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);var t=e.toString();-1===t.indexOf(".")&&(t+=".");var r=(t+="000000").indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function s(e){for(var t=[],r=0,a=e.length;r255?(u.push(l>>8&255),u.push(255&l)):u.push(255&l)}return new Uint8Array(u)}(x):x}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(){};n.prototype={constructor:n,parse:function(e){var t,r,n,i,o,s="",l=0,u=0,c=0,f=new a.Vector3,d=new a.Vector3,h=new a.Vector2,p=[];return e.traverse((function(e){e instanceof a.Mesh&&function(e){var n=0,m=0,v=0,g=e.geometry,y=new a.Matrix3;if(g instanceof a.Geometry&&(g=(new a.BufferGeometry).setFromObject(e)),g instanceof a.BufferGeometry){var b=g.getAttribute("position"),w=g.getAttribute("normal"),x=g.getAttribute("uv"),_=g.getIndex();if(s+="o "+e.name+"\n",e.material&&e.material.name&&(s+="usemtl "+e.material.name+"\n"),void 0!==b)for(t=0,i=b.count;t=200)return void n("THREE.AssimpJSONLoader: Unsupported assimp2json file format version.")}t(i.parse(r,o))}),r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=new Array(e.length),a=0;a0&&i.addAttribute("normal",new a.Float32BufferAttribute(l,3)),u.length>0&&i.addAttribute("uv",new a.Float32BufferAttribute(u,2)),c.length>0&&i.addAttribute("color",new a.Float32BufferAttribute(c,3)),i.computeBoundingSphere(),i})),o=r(e.materials,(function(e){var t=new a.MeshPhongMaterial;for(var r in e.properties){var i=e.properties[r],o=i.key,s=i.value;switch(o){case"$tex.file":var l=i.semantic;if(1===l||2===l||5===l||6===l){var u;switch(l){case 1:u="map";break;case 2:u="specularMap";break;case 5:u="bumpMap";break;case 6:u="normalMap"}var c=n.load(s);c.wrapS=c.wrapT=a.RepeatWrapping,t[u]=c}break;case"?mat.name":t.name=s;break;case"$clr.diffuse":t.color.fromArray(s);break;case"$clr.specular":t.specular.fromArray(s);break;case"$clr.emissive":t.emissive.fromArray(s);break;case"$mat.shininess":t.shininess=s;break;case"$mat.shadingm":t.flatShading=1===s;break;case"$mat.opacity":s<1&&(t.opacity=s,t.transparent=!0)}}return t}));return function e(t,r,n,i){var o,s,l=new a.Object3D;for(l.name=r.name||"",l.matrix=(new a.Matrix4).fromArray(r.transformation).transpose(),l.matrix.decompose(l.position,l.quaternion,l.scale),o=0;r.meshes&&o0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(var e=0;e=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;for(var r=e.hierarchy[0].keys,a=0;ae){t=this.keys[a],r=this.keys[a+1];break}if(this.keys[a].time4&&(r.length=4);var n=0;for(a=0;a<4;a++)n+=r[a].w*r[a].w;n=Math.sqrt(n);for(a=0;a<4;a++)r[a].w=r[a].w/n,e[a]=r[a].i,t[a]=r[a].w}function R(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(var r in e.children){var a=R(e.children[r],t);if(a)return a}}function I(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e,t){if(0!=this.mBones.length){for(var r=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var o=C(u=i.toTHREE(e),e);this.threeNode.add(o);for(var s=0;s0&&n.addAttribute("normal",new a.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&n.addAttribute("color",new a.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&n.addAttribute("uv",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&n.addAttribute("uv1",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&n.addAttribute("tangents",new a.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&n.addAttribute("bitangents",new a.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){for(var i=[],o=[],s=0;s0&&(r=new a.SkinnedMesh(n,t)),this.threeNode=r,r}}function N(){this.mNumIndices=0,this.mIndices=[]}function D(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new a.Vector3(this.x,this.y,this.z)}}function U(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new a.Color(this.r,this.g,this.b,1)}}function j(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new a.Quaternion(this.x,this.y,this.z,this.w)}}function B(){this.mVertexId=0,this.mWeight=0}function V(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}function z(){this.mTime=0,this.mValue=null}function G(){this.mTime=0,this.mValue=null}function H(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new a.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(var r=0;r0)var r=this.mAnimations[0].toTHREE(this);return{object:e,animation:r}}}function ie(){this.elements=[[],[],[],[]],this.toTHREE=function(){for(var e=new a.Matrix4,t=0;t<4;++t)for(var r=0;r<4;++r)e.elements[4*t+r]=this.elements[r][t];return e}}var oe=!0;function se(e){var t=e.getFloat32(e.readOffset,oe);return e.readOffset+=4,t}function le(e){var t=e.getFloat64(e.readOffset,oe);return e.readOffset+=8,t}function ue(e){var t=e.getUint16(e.readOffset,oe);return e.readOffset+=2,t}function ce(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function fe(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function de(e){var t=new D;return t.x=se(e),t.y=se(e),t.z=se(e),t}function he(e){var t=new U;return t.r=se(e),t.g=se(e),t.b=se(e),t}function pe(e){var t=new V,r=ce(e);return e.ReadBytes(t.data,1,r),t.toString()}function me(e){var t=new B;return t.mVertexId=ce(e),t.mWeight=se(e),t}function ve(e){for(var t=new ie,r=0;r<4;++r)for(var a=0;a<4;++a)t.elements[r][a]=se(e);return t}function ge(e){var t=new z;return t.mTime=le(e),t.mValue=de(e),t}function ye(e){var t=new G;return t.mTime=le(e),t.mValue=function(e){var t=new j;return t.w=se(e),t.x=se(e),t.y=se(e),t.z=se(e),t}(e),t}function be(e,t,r){for(var a=0;a0,ke=ue(r)>0,Ce)throw"Shortened binaries are not supported!";if(r.Seek(256,Re),r.Seek(128,Re),r.Seek(64,Re),!ke)return Le(r,t),t.toTHREE();var a=fe(r),n=r.FileSize()-r.Tell(),i=[];r.Read(i,1,n);var o=[];uncompress(o,a,i,n),Le(new ArrayBuffer(o),t)}(e)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){function e(){this.id=0,this.data=null}function t(){}t.prototype={set:function(e,t){this[e]=t},get:function(e,t){return this.hasOwnProperty(e)?this[e]:t}};var r=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.trunk=new a.Object3D,this.materialFactory=void 0,this._url="",this._baseDir="",this._data=void 0,this._ptr=0,this._version=[],this._streaming=!1,this._optimized_for_accuracy=!1,this._compression=0,this._bodylen=4294967295,this._blocks=[new e],this._accuracyMatrix=!1,this._accuracyGeo=!1,this._accuracyProps=!1};return r.prototype={constructor:r,load:function(e,t,r,n){var i=this;this._url=e,this._baseDir=e.substr(0,e.lastIndexOf("/")+1);var o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){var t=e.byteLength;for(this._ptr=0,this._data=new DataView(e),this._parseHeader(),0!=this._compression&&console.error("compressed AWD not supported"),this._streaming||this._bodylen==e.byteLength-this._ptr||console.error("AWDLoader: body len does not match file length",this._bodylen,t-this._ptr);this._ptr1)for(r=new a.Object3D,p=0;p191&&a<224){var n=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((31&a)<<6|63&n)}else{n=this._data.getUint8(this._ptr++,!0);var i=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((15&a)<<12|(63&n)<<6|63&i)}}return t.join("")}},r}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),r,n)},parse:function(e){function t(e){var t=new a.BufferGeometry,r=e.indices,n=e.positions,i=e.normals,o=e.uvs;t.setIndex(r);for(var s=2,l=n.length;s0&&t.push(new a.VectorKeyframeTrack(n+".position",i,o)),s.length>0&&t.push(new a.QuaternionKeyframeTrack(n+".quaternion",i,s)),l.length>0&&t.push(new a.VectorKeyframeTrack(n+".scale",i,l)),t}function A(e,t,r){var a,n,i,o=!0;for(n=0,i=e.length;n=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function S(e,t,r){for(;t0&&t0&&h.addAttribute("position",new a.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&h.addAttribute("normal",new a.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&h.addAttribute("color",new a.Float32BufferAttribute(l.array,l.stride)),s.array.length>0&&h.addAttribute("uv",new a.Float32BufferAttribute(s.array,s.stride)),u.length>0&&h.addAttribute("skinIndex",new a.Float32BufferAttribute(u,c)),f.length>0&&h.addAttribute("skinWeight",new a.Float32BufferAttribute(f,d)),n.data=h,n.type=e[0].type,n.materialKeys=p,n}function fe(e,t,r,a){var n=e.p,i=e.stride,o=e.vcount;function s(e){for(var t=n[e+r]*u,i=t+u;t4)for(var g=1,y=h-2;g<=y;g++){p=c+i*g,m=c+i*(g+1);s(c+0*i),s(p),s(m)}c+=i*h}else for(f=0,d=n.length;f=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ge(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;rn.limits.max||t>8&255,d>>16&255,d>>24&255))),r;p=!0,o=64,r.format=a.RGBAFormat}r.mipmapCount=1,131072&f[2]&&!1!==t&&(r.mipmapCount=Math.max(1,f[7]));var m=f[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=f[4],r.height=f[3];for(var v=f[1]+4,g=r.isCubemap?6:1,y=0;y>1,1),w=Math.max(w>>1,1)}return r},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="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},n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var i=function(e){this.timeLoaded=0,this.manager=e||n.DefaultLoadingManager,this.materials=null,this.verbosity=0,this.attributeOptions={},this.drawMode=n.TrianglesDrawMode,this.nativeAttributeMap={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"}};i.prototype={constructor:i,load:function(e,t,r,a){var i=this,o=new n.FileLoader(i.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.load(e,(function(e){i.decodeDracoFile(e,t)}),r,a)},setPath:function(e){this.path=e},setCrossOrigin:function(e){this.crossOrigin=e},setVerbosity:function(e){this.verbosity=e},setDrawMode:function(e){this.drawMode=e},setSkipDequantization:function(e,t){var r=!0;void 0!==t&&(r=t),this.getAttributeOptions(e).skipDequantization=r},decodeDracoFile:function(e,t,r){var a=this;i.getDecoderModule().then((function(n){a.decodeDracoFileInternal(e,n.decoder,t,r||{})}))},decodeDracoFileInternal:function(e,t,r,a){var n=new t.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength);var i=new t.Decoder,o=i.GetEncodedGeometryType(n);if(o==t.TRIANGULAR_MESH)this.verbosity>0&&console.log("Loaded a mesh.");else{if(o!=t.POINT_CLOUD){var s="THREE.DRACOLoader: Unknown geometry type.";throw console.error(s),new Error(s)}this.verbosity>0&&console.log("Loaded a point cloud.")}r(this.convertDracoGeometryTo3JS(t,i,o,n,a))},addAttributeToGeometry:function(e,t,r,a,i,o,s){if(0===i.ptr){var l="THREE.DRACOLoader: No attribute "+a;throw console.error(l),new Error(l)}var u=i.num_components(),c=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,c);var f=r.num_points()*u;s[a]=new Float32Array(f);for(var d=0;d0&&console.log("Number of faces loaded: "+c.toString())):c=0;var d=o.num_points(),h=o.num_attributes();this.verbosity>0&&(console.log("Number of points loaded: "+d.toString()),console.log("Number of attributes loaded: "+h.toString()));var p=t.GetAttributeId(o,e.POSITION);if(-1==p){u="THREE.DRACOLoader: No position attribute found.";throw console.error(u),e.destroy(t),e.destroy(o),new Error(u)}var m=t.GetAttribute(o,p),v={},g=new n.BufferGeometry;for(var y in this.nativeAttributeMap)if(void 0===i[y]){var b=t.GetAttributeId(o,e[this.nativeAttributeMap[y]]);if(-1!==b){this.verbosity>0&&console.log("Loaded "+y+" attribute.");var w=t.GetAttribute(o,b);this.addAttributeToGeometry(e,t,o,y,w,g,v)}}for(var y in i){var x=i[y];w=t.GetAttributeByUniqueId(o,x);this.addAttributeToGeometry(e,t,o,y,w,g,v)}if(r==e.TRIANGULAR_MESH)if(this.drawMode===n.TriangleStripDrawMode){var _=new e.DracoInt32Array;t.GetTriangleStripsFromMesh(o,_);v.indices=new Uint32Array(_.size());for(var A=0;A<_.size();++A)v.indices[A]=_.GetValue(A);e.destroy(_)}else{var E=3*c;v.indices=new Uint32Array(E);var S=new e.DracoInt32Array;for(A=0;A65535?n.Uint32BufferAttribute:n.Uint16BufferAttribute)(v.indices,1));var T=new e.AttributeQuantizationTransform;if(T.InitFromAttribute(m)){g.attributes.position.isQuantized=!0,g.attributes.position.maxRange=T.range(),g.attributes.position.numQuantizationBits=T.quantization_bits(),g.attributes.position.minValues=new Float32Array(3);for(A=0;A<3;++A)g.attributes.position.minValues[A]=T.min_value(A)}return e.destroy(T),e.destroy(t),e.destroy(o),this.decode_time=f-l,this.import_time=performance.now()-f,this.verbosity>0&&(console.log("Decode time: "+this.decode_time),console.log("Import time: "+this.import_time)),g},isVersionSupported:function(e,t){i.getDecoderModule().then((function(r){t(r.decoder.isVersionSupported(e))}))},getAttributeOptions:function(e){return void 0===this.attributeOptions[e]&&(this.attributeOptions[e]={}),this.attributeOptions[e]}},i.decoderPath="./",i.decoderConfig={},i.decoderModulePromise=null,i.setDecoderPath=function(e){i.decoderPath=e},i.setDecoderConfig=function(e){var t=i.decoderConfig.wasmBinary;i.decoderConfig=e||{},i.releaseDecoderModule(),t&&(i.decoderConfig.wasmBinary=t)},i.releaseDecoderModule=function(){i.decoderModulePromise=null},i.getDecoderModule=function(){var e=this,t=i.decoderPath,r=i.decoderConfig,n=i.decoderModulePromise;return n||("undefined"!=typeof DracoDecoderModule?n=Promise.resolve():"object"!==("undefined"==typeof WebAssembly?"undefined":a(WebAssembly))||"js"===r.type?n=i._loadScript(t+"draco_decoder.js"):(r.wasmBinaryFile=t+"draco_decoder.wasm",n=i._loadScript(t+"draco_wasm_wrapper.js").then((function(){return i._loadArrayBuffer(r.wasmBinaryFile)})).then((function(e){r.wasmBinary=e}))),n=n.then((function(){return new Promise((function(t){r.onModuleLoaded=function(r){e.timeLoaded=performance.now(),t({decoder:r})},DracoDecoderModule(r)}))})),i.decoderModulePromise=n,n)},i._loadScript=function(e){var t=document.getElementById("decoder_script");null!==t&&t.parentNode.removeChild(t);var r=document.getElementsByTagName("head")[0],a=document.createElement("script");return a.id="decoder_script",a.type="text/javascript",a.src=e,new Promise((function(e){a.onload=e,r.appendChild(a)}))},i._loadArrayBuffer=function(e){var t=new n.FileLoader;return t.setResponseType("arraybuffer"),new Promise((function(r,a){t.load(e,r,void 0,a)}))},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.sourceTexture=e,this.resolution=t,this.views=[{t:[1,0,0],u:[0,-1,0]},{t:[-1,0,0],u:[0,-1,0]},{t:[0,1,0],u:[0,0,1]},{t:[0,-1,0],u:[0,0,-1]},{t:[0,0,1],u:[0,-1,0]},{t:[0,0,-1],u:[0,-1,0]}],this.camera=new a.PerspectiveCamera(90,1,.1,10),this.boxMesh=new a.Mesh(new a.BoxBufferGeometry(1,1,1),this.getShader()),this.boxMesh.material.side=a.BackSide,this.scene=new a.Scene,this.scene.add(this.boxMesh);var r={format:a.RGBAFormat,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.renderTarget=new a.WebGLRenderTargetCube(this.resolution,this.resolution,r)};n.prototype={constructor:n,update:function(e){for(var t=0;t<6;t++){this.renderTarget.activeCubeFace=t;var r=this.views[t];this.camera.position.set(0,0,0),this.camera.up.set(r.u[0],r.u[1],r.u[2]),this.camera.lookAt(r.t[0],r.t[1],r.t[2]),e.render(this.scene,this.camera,this.renderTarget,!0)}return this.renderTarget.texture},getShader:function(){var e=new a.ShaderMaterial({uniforms:{equirectangularMap:{value:this.sourceTexture}},vertexShader:"varying vec3 localPosition;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tlocalPosition = position;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \n\t\t\t\tvarying vec3 localPosition;\n\t\t\t\tuniform sampler2D equirectangularMap;\n\t\t\t\t\n\t\t\t\tvec2 EquiangularSampleUV(vec3 v) {\n\t\t\t vec2 uv = vec2(atan(v.z, v.x), asin(v.y));\n\t\t\t uv *= vec2(0.1591, 0.3183); // inverse atan\n\t\t\t uv += 0.5;\n\t\t\t return uv;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = EquiangularSampleUV(normalize(localPosition));\n \t\t\tvec3 color = texture2D(equirectangularMap, uv).rgb;\n \t\t\t\n\t\t\t\t\tgl_FragColor = vec4( color, 1.0 );\n\t\t\t\t}",blending:a.CustomBlending,premultipliedAlpha:!1,blendSrc:a.OneFactor,blendDst:a.ZeroFactor,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.ZeroFactor,blendEquation:a.AddEquation});return e.type="EquiangularToCubeGenerator",e},dispose:function(){this.boxMesh.geometry.dispose(),this.boxMesh.material.dispose(),this.renderTarget.dispose()}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};(n.prototype=Object.create(a.DataTextureLoader.prototype))._parser=function(e){var t=65536,r=t>>3,n=14,i=65537,o=1<>r&(1<a)return!1;g(6,d,h,e,f);var p=v.l;if(d=v.c,h=v.lc,s[n]=p,p==u){if(f.value-r.value>a)throw"Something wrong with hufUnpackEncTable";g(8,d,h,e,f);var m=v.l+c;if(d=v.c,h=v.lc,n+m>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}else if(p>=l){if(n+(m=p-l+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}}!function(e){for(var t=0;t<=58;++t)y[t]=0;for(t=0;t0;--t){var a=r+y[t]>>1;y[t]=r,r=a}for(t=0;t0&&(e[t]=n|y[n]++<<6)}}(s)}function w(e){return 63&e}function x(e){return e>>6}var _={c:0,lc:0};function A(e,t,r,a){e=e<<8|I(r,a),t+=8,_.c=e,_.lc=t}var E={c:0,lc:0};function S(e,t,r,a,n,i,o,s,l,u){if(e==t){a<8&&(A(r,a,n,o),r=_.c,a=_.lc);var c=r>>(a-=8);if(out+c>oe)throw"Issue with getCode";for(var f=out[-1];c-- >0;)s[l.value++]=f}else{if(!(l.value32767?t-65536:t}var T={a:0,b:0};function P(e,t){var r=M(e),a=M(t),n=r+(1&a)+(a>>1),i=n,o=n-a;T.a=i,T.b=o}function F(e,t,r,a,n,i,o){for(var s,l=r>n?n:r,u=1;u<=l;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var c,f,d,h,p=0,m=p+i*(n-s),v=i*u,g=i*s,y=a*u,b=a*s;p<=m;p+=g){for(var w=p,x=p+a*(r-s);w<=x;w+=b){var _=w+y,A=(E=w+v)+y;P(t[w+e],t[E+e]),c=T.a,d=T.b,P(t[_+e],t[A+e]),f=T.a,h=T.b,P(c,f),t[w+e]=T.a,t[_+e]=T.b,P(d,h),t[E+e]=T.a,t[A+e]=T.b}if(r&u){var E=w+v;P(t[w+e],t[E+e]),c=T.a,t[E+e]=T.b,t[w+e]=c}}if(n&u)for(w=p,x=p+a*(r-s);w<=x;w+=b){_=w+y;P(t[w+e],t[_+e]),c=T.a,t[_+e]=T.b,t[w+e]=c}s=u,u>>=1}return p}function O(e,t,r,a,l,u,c){var f=r.value,d=R(t,r),h=R(t,r);r.value+=4;var p=R(t,r);if(r.value+=4,d<0||d>=i||h<0||h>=i)throw"Something wrong with HUF_ENCSIZE";var m=new Array(i),v=new Array(o);if(function(e){for(var t=0;t8*(a-(r.value-f)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var i=x(e[t]),o=w(e[t]);if(i>>o)throw"Invalid table entry";if(o>n){if((c=a[i>>o-n]).len)throw"Invalid table entry";if(c.lit++,c.p){var s=c.p;c.p=new Array(c.lit);for(var l=0;l0;l--){var c;if((c=a[(i<=n;){if((b=t[d>>h-n&s]).len)h-=b.len,S(b.lit,l,d,h,r,0,i,c,f,p),d=E.c,h=E.lc;else{if(!b.p)throw"hufDecode issues";var v;for(v=0;v=g&&x(e[b.p[v]])==(d>>h-g&(1<>=y,h-=y;h>0;){var b;if(!(b=t[d<=r)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(h<=p)for(var m=0;m>3]&1<<(7&n))&&(r[a++]=n);for(var i=a-1;a>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function j(e,t){var r=e.getUint16(t.value,!0);return t.value+=p,r}function B(e,t){return U(j(e,t))}function V(e,t,r,a,n){if("string"===a||"iccProfile"===a)return function(e,t,r){var a=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,a}(t,r,n);if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value0&&void 0!==r[l[0].ID]&&(0!==(i=r[l[0].ID]).indexOf("blob:")&&0!==i.indexOf("data:")||t.setPath(void 0));o="tga"===e.FileName.slice(-3).toLowerCase()?n.Loader.Handlers.get(".tga").load(i):t.load(i);return t.setPath(s),o}(e,t,r,a);i.ID=e.id,i.name=e.attrName;var o=e.WrapModeU,s=e.WrapModeV,l=void 0!==o?o.value:0,u=void 0!==s?s.value:0;if(i.wrapS=0===l?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===u?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){var c=e.Scaling.value;i.repeat.x=c[0],i.repeat.y=c[1]}return i}function i(e,t,r,i){var s=t.id,l=t.attrName,u=t.ShadingModel;if("object"===(void 0===u?"undefined":a(u))&&(u=u.value),!i.has(s))return null;var c,f=function(e,t,r,a,i){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value);t.Diffuse?s.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new n.Color).fromArray(t.DiffuseColor.value));t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value);t.Emissive?s.emissive=(new n.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new n.Color).fromArray(t.EmissiveColor.value));t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value));t.Opacity&&(s.opacity=parseFloat(t.Opacity.value));s.opacity<1&&(s.transparent=!0);t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value);t.Shininess&&(s.shininess=t.Shininess.value);t.Specular?s.specular=(new n.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new n.Color).fromArray(t.SpecularColor.value));return i.get(a).children.forEach((function(t){var a=t.relationship;switch(a){case"Bump":s.bumpMap=r.get(t.ID);break;case"DiffuseColor":s.map=o(e,r,t.ID,i);break;case"DisplacementColor":s.displacementMap=o(e,r,t.ID,i);break;case"EmissiveColor":s.emissiveMap=o(e,r,t.ID,i);break;case"NormalMap":s.normalMap=o(e,r,t.ID,i);break;case"ReflectionColor":s.envMap=o(e,r,t.ID,i),s.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":s.specularMap=o(e,r,t.ID,i);break;case"TransparentColor":s.alphaMap=o(e,r,t.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a)}})),s}(e,t,r,s,i);switch(u.toLowerCase()){case"phong":c=new n.MeshPhongMaterial;break;case"lambert":c=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',u),c=new n.MeshPhongMaterial({color:3342591})}return c.setValues(f),c.name=l,c}function o(e,t,r,a){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=a.get(r).children[0].ID),t.get(r)}function s(e,t){var r=[];return e.children.forEach((function(e){var a=t[e.ID];if("Cluster"===a.attrType){var i={ID:e.ID,indices:[],weights:[],transform:(new n.Matrix4).fromArray(a.Transform.a),transformLink:(new n.Matrix4).fromArray(a.TransformLink.a),linkMode:a.Mode};"Indexes"in a&&(i.indices=a.Indexes.a,i.weights=a.Weights.a),r.push(i)}})),{rawBones:r,bones:[]}}function l(e,t,r,a){for(var n=[],i=0;i0&&o.addAttribute("color",new n.Float32BufferAttribute(l.colors,3));r&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(l.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(l.vertexWeights,4)),o.FBX_Deformer=r);if(l.normal.length>0){var d=new n.Float32BufferAttribute(l.normal,3);(new n.Matrix3).getNormalMatrix(i).applyToBufferAttribute(d),o.addAttribute("normal",d)}if(l.uvs.forEach((function(e,t){var r="uv"+(t+1).toString();0===t&&(r="uv"),o.addAttribute(r,new n.Float32BufferAttribute(l.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){var h=l.materialIndex[0],p=0;if(l.materialIndex.forEach((function(e,t){e!==h&&(o.addGroup(p,t-p,h),h=e,p=t)})),o.groups.length>0){var m=o.groups[o.groups.length-1],v=m.start+m.count;v!==l.materialIndex.length&&o.addGroup(v,l.materialIndex.length-v,h)}0===o.groups.length&&o.addGroup(0,l.materialIndex.length,l.materialIndex[0])}return function(e,t,r,a,i){if(null===a)return;t.morphAttributes.position=[],t.morphAttributes.normal=[],a.rawTargets.forEach((function(a){var o=e.Objects.Geometry[a.geoID];void 0!==o&&function(e,t,r,a){var i=new n.BufferGeometry;r.attrName&&(i.name=r.attrName);for(var o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],s=void 0!==t.Vertices?t.Vertices.a.slice():[],l=void 0!==r.Vertices?r.Vertices.a:[],u=void 0!==r.Indexes?r.Indexes.a:[],f=0;f4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);var y=[0,0,0,0],b=[0,0,0,0];v.forEach((function(e,t){var r=e,a=m[t];b.forEach((function(e,t,n){if(r>e){n[t]=r,r=e;var i=y[t];y[t]=a,a=i}}))})),m=y,v=b}for(;v.length<4;)v.push(0),m.push(0);for(var w=0;w<4;++w)u.push(v[w]),c.push(m[w])}if(e.normal){g=h(d,r,f,e.normal);o.push(g[0],g[1],g[2])}if(e.material&&"AllSame"!==e.material.mappingType)var x=h(d,r,f,e.material)[0];e.uv&&e.uv.forEach((function(e,t){var a=h(d,r,f,e);void 0===l[t]&&(l[t]=[]),l[t].push(a[0]),l[t].push(a[1])})),a++,p&&(!function(e,t,r,a,n,i,o,s,l,u){for(var c=2;c=f.length&&f===C(c,0,f.length))o=(new M).parse(e);else{var d=C(e);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;for(var a=0;a0,u="string"==typeof o.Content&&""!==o.Content;if(l||u){var c=t(n[i]);a[o.RelativeFilename||o.Filename]=c}}}}for(var s in r){var f=r[s];void 0!==a[f]?r[s]=a[f]:r[s]=r[s].split("\\").pop()}return r}(o),_=function(e,t,r){var a=new Map;if("Material"in e.Objects){var n=e.Objects.Material;for(var o in n){var s=i(e,n[o],t,r);null!==s&&a.set(parseInt(o),s)}}return a}(o,function(e,t,a,n){var i=new Map;if("Texture"in e.Objects){var o=e.Objects.Texture;for(var s in o){var l=r(o[s],t,a,n);i.set(parseInt(s),l)}}return i}(o,new n.TextureLoader(this.manager).setPath(a),x,h),h),A=function(e,t){var r={},a={};if("Deformer"in e.Objects){var n=e.Objects.Deformer;for(var i in n){var o=n[i],u=t.get(parseInt(i));if("Skin"===o.attrType){var c=s(u,n);c.ID=i,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),c.geometryID=u.parents[0].ID,r[i]=c}else if("BlendShape"===o.attrType){var f={id:i};f.rawTargets=l(u,o,n,t),f.id=i,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),f.parentGeoID=u.parents[0].ID,a[i]=f}}}return{skeletons:r,morphTargets:a}}(o,h),E=function(e,t,r){var a=new Map;if("Geometry"in e.Objects){var n=e.Objects.Geometry;for(var i in n){var o=t.get(parseInt(i)),s=u(e,o,n[i],r);a.set(parseInt(i),s)}}return a}(o,h,A);return function(e,t,r,a,i){var o=new n.Group,s=function(e,t,r,a,i){var o=new Map,s=e.Objects.Model;for(var l in s){var u=parseInt(l),c=s[l],f=i.get(u),d=p(f,t,u,c.attrName);if(!d){switch(c.attrType){case"Camera":d=m(e,f);break;case"Light":d=v(e,f);break;case"Mesh":d=g(e,f,r,a);break;case"NurbsCurve":d=y(f,r);break;case"LimbNode":case"Null":default:d=new n.Group}d.name=n.PropertyBinding.sanitizeNodeName(c.attrName),d.ID=u}b(e,d,c),o.set(u,d)}return o}(e,r,a,i,t),l=e.Objects.Model;return s.forEach((function(r){var a=l[r.ID];!function(e,t,r,a,i){if("LookAtProperty"in r){a.get(t.ID).children.forEach((function(r){if("LookAtProperty"===r.relationship){var a=e.Objects.Model[r.ID];if("Lcl_Translation"in a){var o=a.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(o),i.add(t.target)):t.lookAt((new n.Vector3).fromArray(o))}}}))}}(e,r,a,t,o),t.get(r.ID).parents.forEach((function(e){var t=s.get(e.ID);void 0!==t&&t.add(r)})),null===r.parent&&o.add(r)})),function(e,t,r,a,i){var o=function(e){var t={};if("Pose"in e.Objects){var r=e.Objects.Pose;for(var a in r)if("BindPose"===r[a].attrType){var i=r[a].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new n.Matrix4).fromArray(e.Matrix.a)})):t[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return t}(e);for(var s in t){var l=t[s];i.get(parseInt(l.ID)).parents.forEach((function(e){if(r.has(e.ID)){var t=e.ID;i.get(t).parents.forEach((function(e){a.has(e.ID)&&a.get(e.ID).bind(new n.Skeleton(l.bones),o[e.ID])}))}}))}}(e,r,a,s,t),function(e,t,r){r.animations=[];var a=function(e,t){if(void 0===e.Objects.AnimationCurve)return;var r=function(e){var t=e.Objects.AnimationCurveNode,r=new Map;for(var a in t){var n=t[a];if(null!==n.attrName.match(/S|R|T/)){var i={id:n.id,attr:n.attrName,curves:{}};r.set(i.id,i)}}return r}(e);!function(e,t,r){var a=e.Objects.AnimationCurve;for(var n in a){var i={id:a[n].id,times:a[n].KeyTime.a.map(O),values:a[n].KeyValueFloat.a},o=t.get(i.id);if(void 0!==o){var s=o.parents[0].ID,l=o.parents[0].relationship;l.match(/X/)?r.get(s).curves.x=i:l.match(/Y/)?r.get(s).curves.y=i:l.match(/Z/)&&(r.get(s).curves.z=i)}}}(e,t,r);var a=function(e,t,r){var a=e.Objects.AnimationLayer,i=new Map;for(var o in a){var s=[],l=t.get(parseInt(o));if(void 0!==l)l.children.forEach((function(a,i){if(r.has(a.ID)){var o=r.get(a.ID);if(void 0!==o.curves.x||void 0!==o.curves.y||void 0!==o.curves.z){if(void 0===s[i]){var l;t.get(a.ID).parents.forEach((function(e){void 0!==e.relationship&&(l=e.ID)}));var u=e.Objects.Model[l.toString()],c={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};"Lcl_Translation"in u&&(c.initialPosition=u.Lcl_Translation.value),"Lcl_Rotation"in u&&(c.initialRotation=u.Lcl_Rotation.value),"Lcl_Scaling"in u&&(c.initialScale=u.Lcl_Scaling.value),"PreRotation"in u&&(c.preRotations=u.PreRotation.value),s[i]=c}s[i][o.attr]=o}}})),i.set(parseInt(o),s)}return i}(e,t,r);return function(e,t,r){var a=e.Objects.AnimationStack,n={};for(var i in a){var o=t.get(parseInt(i)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=r.get(o[0].ID);n[i]={name:a[i].attrName,layer:s}}return n}(e,t,a)}(e,t);if(void 0===a)return;for(var i in a){var o=w(a[i]);r.animations.push(o)}}(e,t,o),function(e,t){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var r=e.GlobalSettings.AmbientColor.value,a=r[0],i=r[1],o=r[2];if(0!==a||0!==i||0!==o){var s=new n.Color(a,i,o);t.add(new n.AmbientLight(s,1))}}}(e,o),o}(o,h,A.skeletons,E,_)}});var d=[];function h(e,t,r,a){var n;switch(a.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=r;break;case"AllSame":n=a.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+a.mappingType)}"IndexToDirect"===a.referenceType&&(n=a.indices[n]);var i=n*a.dataSize,o=i+a.dataSize;return function(e,t,r,a){for(var n=r,i=0;n1?s=l:l.length>0?s=l[0]:(s=new n.MeshPhongMaterial({color:13421772}),l.push(s)),"color"in o.attributes&&l.forEach((function(e){e.vertexColors=n.VertexColors})),o.FBX_Deformer?(l.forEach((function(e){e.skinning=!0})),i=new n.SkinnedMesh(o,s)):i=new n.Mesh(o,s),i}function y(e,t){var r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),a=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,a)}function b(e,t,r){if("RotationOrder"in r){var a=parseInt(r.RotationOrder.value,10);a>0&&a<6?console.warn("THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.",["XYZ","XZY","YZX","ZXY","YXZ","ZYX","SphericXYZ"][a]):6===a&&console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.")}if("Lcl_Translation"in r&&t.position.fromArray(r.Lcl_Translation.value),"Lcl_Rotation"in r){var i=r.Lcl_Rotation.value.map(n.Math.degToRad);i.push("ZYX"),t.quaternion.setFromEuler((new n.Euler).fromArray(i))}if("Lcl_Scaling"in r&&t.scale.fromArray(r.Lcl_Scaling.value),"PreRotation"in r){var o=r.PreRotation.value.map(n.Math.degToRad);o[3]="ZYX";var s=(new n.Euler).fromArray(o);s=(new n.Quaternion).setFromEuler(s),t.quaternion.premultiply(s)}}function w(e){var t=[];return e.layer.forEach((function(e){t=t.concat(function(e){var t=[];if(void 0!==e.T&&Object.keys(e.T.curves).length>0){var r=x(e.modelName,e.T.curves,e.initialPosition,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=function(e,t,r,a){void 0!==t.x&&(E(t.x),t.x.values=t.x.values.map(n.Math.degToRad));void 0!==t.y&&(E(t.y),t.y.values=t.y.values.map(n.Math.degToRad));void 0!==t.z&&(E(t.z),t.z.values=t.z.values.map(n.Math.degToRad));var i=A(t),o=_(i,t,r);void 0!==a&&((a=a.map(n.Math.degToRad)).push("ZYX"),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a));for(var s=new n.Quaternion,l=new n.Euler,u=[],c=0;c0){var i=x(e.modelName,e.S.curves,e.initialScale,"scale");void 0!==i&&t.push(i)}return t}(e))})),new n.AnimationClip(e.name,-1,t)}function x(e,t,r,a){var i=A(t),o=_(i,t,r);return new n.VectorKeyframeTrack(e+"."+a,i,o)}function _(e,t,r){var a=r,n=[],i=-1,o=-1,s=-1;return e.forEach((function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(s=t.z.times.indexOf(e)),-1!==i){var r=t.x.values[i];n.push(r),a[0]=r}else n.push(a[0]);if(-1!==o){var l=t.y.values[o];n.push(l),a[1]=l}else n.push(a[1]);if(-1!==s){var u=t.z.values[s];n.push(u),a[2]=u}else n.push(a[2])})),n}function A(e){var t=[];return void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})).filter((function(e,t,r){return r.indexOf(e)==t}))}function E(e){for(var t=1;t=180){for(var i=n/180,o=a/i,s=r+o,l=e.times[t-1],u=(e.times[t]-l)/i,c=l+u,f=[],d=[];c1&&(r=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:r,type:a}},parseNodeProperty:function(e,t,r){var a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===a&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());var i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===a){var o=n.split(",").slice(1),s=parseInt(o[0]),l=parseInt(o[1]),u=n.split(",").slice(3);a="connections",function(e,t){for(var r=0,a=e.length,n=t.length;r=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var r={},a=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32(),i=(t>=7500?e.getUint64():e.getUint32(),e.getUint8()),o=e.getString(i);if(0===a)return null;for(var s=[],l=0;l0?s[0]:"",c=s.length>1?s[1]:"",f=s.length>2?s[2]:"";for(r.singleProperty=1===n&&e.getOffset()===a;a>e.getOffset();){var d=this.parseNode(e,t);null!==d&&this.parseSubNode(o,r,d)}return r.propertyList=s,"number"==typeof u&&(r.id=u),""!==c&&(r.attrName=c),""!==f&&(r.attrType=f),""!==o&&(r.name=o),r},parseSubNode:function(e,t,r){if(!0===r.singleProperty){var a=r.propertyList[0];Array.isArray(a)?(t[r.name]=r,r.a=a):t[r.name]=a}else if("Connections"===e&&"C"===r.name){var n=[];r.propertyList.forEach((function(e,t){0!==t&&n.push(e)})),void 0===t.connections&&(t.connections=[]),t.connections.push(n)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){var i,o=r.propertyList[0],s=r.propertyList[1],l=r.propertyList[2],u=r.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),i="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[o]={type:s,type2:l,flag:u,value:i}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var r=e.getUint32();return e.getArrayBuffer(r);case"S":r=e.getUint32();return e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var a=e.getUint32(),n=e.getUint32(),i=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}void 0===window.Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var o=new T(new Zlib.Inflate(new Uint8Array(e.getArrayBuffer(i))).decompress().buffer);switch(t){case"b":case"c":return o.getBooleanArray(a);case"d":return o.getFloat64Array(a);case"f":return o.getFloat32Array(a);case"i":return o.getInt32Array(a);case"l":return o.getInt64Array(a)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}),Object.assign(T.prototype,{getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],r=0;r=0&&(t=t.slice(0,a)),n.LoaderUtils.decodeText(t)}}),Object.assign(P.prototype,{add:function(e,t){this[e]=t}}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.splitLayer=!1};n.prototype.load=function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},n.prototype.parse=function(e){var t={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},r=[],n=void 0,i=new a.LineBasicMaterial({color:16711680});i.name="path";var o=new a.LineBasicMaterial({color:65280});function s(e){n={vertex:[],pathVertex:[],z:e.z},r.push(n)}function l(e,r){return t.relative?r:r-e}function u(e,r){return t.relative?e+r:r}o.name="extruded";for(var c,f,d=e.replace(/;.+/g,"").split("\n"),h=0;h0&&(g.extruding=l(t.e,g.e)>0,null!=n&&g.z==n.z||s(g)),c=t,f=g,void 0===n&&s(c),g.extruding?(n.vertex.push(c.x,c.y,c.z),n.vertex.push(f.x,f.y,f.z)):(n.pathVertex.push(c.x,c.y,c.z),n.pathVertex.push(f.x,f.y,f.z)),t=g}else if("G2"===m||"G3"===m)console.warn("THREE.GCodeLoader: Arc command not supported");else if("G90"===m)t.relative=!1;else if("G91"===m)t.relative=!0;else if("G92"===m){(g=t).x=void 0!==v.x?v.x:g.x,g.y=void 0!==v.y?v.y:g.y,g.z=void 0!==v.z?v.z:g.z,g.e=void 0!==v.e?v.e:g.e,t=g}else console.warn("THREE.GCodeLoader: Command not supported:"+m)}function y(e,t){var r=new a.BufferGeometry;r.addAttribute("position",new a.Float32BufferAttribute(e,3));var n=new a.LineSegments(r,t?o:i);n.name="layer"+h,b.add(n)}var b=new a.Group;if(b.name="gcode",this.splitLayer)for(h=0;h>16&32768,i=a>>12&2047,o=a>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&a):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)}return function(e,t,a,n){var i=e[t+3],o=Math.pow(2,i-128)/255;a[n+0]=r(e[t+0]*o),a[n+1]=r(e[t+1]*o),a[n+2]=r(e[t+2]*o)}}(),l=new n.CubeTexture;l.type=e,l.encoding=e===n.UnsignedByteType?n.RGBEEncoding:n.LinearEncoding,l.format=e===n.UnsignedByteType?n.RGBAFormat:n.RGBFormat,l.minFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.magFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.generateMipmaps=l.encoding!==n.RGBEEncoding,l.anisotropy=0;var u=this.hdrLoader,c=0;function f(r,a,i,f){var d=new n.FileLoader(this.manager);d.setResponseType("arraybuffer"),d.load(t[r],(function(t){c++;var i=u._parser(t);if(i){if(e===n.FloatType){for(var f=i.data.length/4*3,d=new Float32Array(f),h=0;h>8&65280|e>>24&255},e.prototype.mipmaps=function(t){for(var r=[],a=e.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight,o=t?this.numberOfMipmapLevels:1,s=0;s0?o():t(n.mergeVmds(i))}),r,a)}()},s.prototype.loadAudio=function(e,t,r,n){var i=new a.AudioListener,o=new a.Audio(i);new a.AudioLoader(this.manager).load(e,(function(e){o.setBuffer(e),t(o,i)}),r,n)},s.prototype.loadVpd=function(e,t,r,a,n){var i=this;(n&&"unicode"===n.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this)(e,(function(e){t(i.parseVpd(e))}),r,a)},s.prototype.parseModel=function(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}},s.prototype.parsePmd=function(e){return this.parser.parsePmd(e,!0)},s.prototype.parsePmx=function(e){return this.parser.parsePmx(e,!0)},s.prototype.parseVmd=function(e){return this.parser.parseVmd(e,!0)},s.prototype.parseVpd=function(e){return this.parser.parseVpd(e,!0)},s.prototype.mergeVmds=function(e){return this.parser.mergeVmds(e)},s.prototype.pourVmdIntoModel=function(e,t,r){this.createAnimation(e,t,r)},s.prototype.pourVmdIntoCamera=function(e,t,r){var n=new s.DataCreationHelper;!function(){for(var i,o,l=n.createOrderedMotionArray(t.cameras),u=[],c=[],f=[],d=[],h=[],p=[],m=[],v=[],g=[],y=new a.Quaternion,b=new a.Euler,w=new a.Vector3,x=new a.Vector3,_=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},A=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},E=function(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();for(var o=n.length/r.length,l=3===o?12:4,u=1,c=2,f=r.length;cu){r[u]=r[c];for(d=0;d=a?r.skinIndices[a]:0);for(a=0;a<4;a++)l.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t=0&&(l.limitation=new a.Vector3(1,0,0)),s.links.push(l)}t.push(s)}else for(r=0;r=0?c:u);var p=h.load(s,(function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,n=t.height;f.width=r,f.height=n,d.clearRect(0,0,r,n),d.translate(r/2,n/2),d.rotate(.5*Math.PI),d.translate(-r/2,-n/2),d.drawImage(t,0,0),e.image=d.getImageData(0,0,r,n)}e.flipY=!1,e.wrapS=a.RepeatWrapping,e.wrapT=a.RepeatWrapping;for(var i=0;i=0?(x.push(w.slice(0,_)),x.push(w.slice(_+1))):x.push(w);for(var A=0;A=0||E.indexOf(".spa")>=0?(b.envMap=m(E,{sphericalReflectionMapping:!0}),E.indexOf(".sph")>=0?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation):b.map=m(E)}}}else{if(-1!==y.textureIndex){var E=e.textures[y.textureIndex];b.map=m(E)}if(-1!==y.envTextureIndex&&(1===y.envFlag||2==y.envFlag)){E=e.textures[y.envTextureIndex];b.envMap=m(E,{sphericalReflectionMapping:!0}),1===y.envFlag?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation}}var S=void 0===b.map?1:.2;b.emissive=new a.Color(y.ambient[0]*S,y.ambient[1]*S,y.ambient[2]*S),p.push(b)}for(g=0;g0,y.morphTargets=o.morphTargets.length>0,y.lights=!0,y.side="pmx"===e.metadata.format&&1==(1&T.flag)?a.DoubleSide:M.side,y.transparent=M.transparent,y.fog=!0,y.blending=a.CustomBlending,y.blendSrc=a.SrcAlphaFactor,y.blendDst=a.OneMinusSrcAlphaFactor,y.blendSrcAlpha=a.SrcAlphaFactor,y.blendDstAlpha=a.DstAlphaFactor,void 0!==M.map){y.faceOffset=M.faceOffset,y.faceNum=M.faceNum,y.map=v(M.map,l),function(e){e.map.readyCallbacks.push((function(t){function r(e,t){var r=e.width,a=e.height,n=Math.round(t.x*r)%r,i=Math.round(t.y*a)%a;n<0&&(n+=r),i<0&&(i+=a);var o=i*r+n;return e.data[4*o+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),n=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var n=e.width,i=e.height;if(e.data.length/(n*i)!=4)return!1;for(var o=0;o=this.duration;)this.currentTime-=this.duration;return!(this.currentTime=this.duration}},a.MMDGrantSolver=function(e){this.mesh=e},a.MMDGrantSolver.prototype={constructor:a.MMDGrantSolver,update:(o=new a.Quaternion,function(){for(var e=0;e0)}},setAnimations:function(){for(var e=0;e0&&0!==e.action._clip.tracks[0].name.indexOf(".bones")||(e.target._root.looped=!0)}));for(var t=!1,r=!1,n=0;n0&&0===i.tracks[0].name.indexOf(".morphTargetInfluences")?r||(o.play(),r=!0):t||(o.play(),t=!0)}t&&(e.ikSolver=new a.CCDIKSolver(e),void 0!==e.geometry.grants&&(e.grantSolver=new a.MMDGrantSolver(e)))}},setCameraAnimation:function(e){void 0!==e.animations&&(e.mixer=new a.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())},unifyAnimationDuration:function(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,n=0;n0,i=!0,s={};var l=function(e,n){null==n&&(n=1);var o=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,o=2;break;case"sshort":s=Int16Array,o=2;break;case"uint":s=Uint32Array,o=4;break;case"sint":s=Int32Array,o=4;break;case"float":s=Float32Array,o=4;break;case"complex":case"double":s=Float64Array,o=8}var l=new s(t.slice(r,r+=n*o));return a!=i&&(l=function(e,t){for(var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=0;ai;n--,i++){var o=r[i];r[i]=r[n],r[n]=o}return e}(l,o)),1==n?l[0]:l}("uchar",e.byteLength),u=l.length,c=null,f=0;for(p=1;p13)&&32!==a?n+=String.fromCharCode(a):(""!==n&&(l[u]=c(n,o),u++),n="");return""!==n&&(l[u]=c(n,o),u++),l}(t);else if("raw"===s.encoding){for(var h=new Uint8Array(t.length),p=0;p0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,n=this.object.geometry.vertices;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){var a=this.normals,n=this.object.geometry.normals;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addColor:function(e,t,r){var a=this.colors,n=this.object.geometry.colors;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addUV:function(e,t,r){var a=this.uvs,n=this.object.geometry.uvs;n.push(a[e+0],a[e+1]),n.push(a[t+0],a[t+1]),n.push(a[r+0],a[r+1])},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,a,n,i,o,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),f=this.parseVertexIndex(t,u),d=this.parseVertexIndex(r,u);if(this.addVertex(c,f,d),void 0!==a&&""!==a){var h=this.uvs.length;c=this.parseUVIndex(a,h),f=this.parseUVIndex(n,h),d=this.parseUVIndex(i,h),this.addUV(c,f,d)}if(void 0!==o&&""!==o){var p=this.normals.length;c=this.parseNormalIndex(o,p),f=o===s?c:this.parseNormalIndex(s,p),d=o===l?c:this.parseNormalIndex(l,p),this.addNormal(c,f,d)}this.colors.length>0&&this.addColor(c,f,d)},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,r=0,a=e.length;r0){var w=b.split("/");v.push(w)}}var x=v[0];for(g=1,y=v.length-1;g1){var C=c[1].trim().toLowerCase();o.object.smooth="0"!==C&&"off"!==C}else o.object.smooth=!0;(Y=o.object.currentMaterial())&&(Y.smooth=o.object.smooth)}o.finalize();var k=new a.Group;k.materialLibraries=[].concat(o.materialLibraries);for(d=0,h=o.objects.length;d0?B.addAttribute("normal",new a.Float32BufferAttribute(I.normals,3)):B.computeVertexNormals(),I.colors.length>0&&(j=!0,B.addAttribute("color",new a.Float32BufferAttribute(I.colors,3))),I.uvs.length>0&&B.addAttribute("uv",new a.Float32BufferAttribute(I.uvs,2));for(var V,z=[],G=0,H=N.length;G1){for(G=0,H=N.length;Gf){f=d;var r='Download of "'+e.url+'": '+(100*d).toFixed(2)+"%";u.onProgress("progressLoad",r,d)}}}var h=new a.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.load(e.url,c,i,o)}},r.prototype.run=function(e,r){this._applyPrepData(e);var a=e.checkResourceDescriptorFiles(e.resources,[{ext:"obj",type:"ArrayBuffer",ignore:!1},{ext:"mtl",type:"String",ignore:!1},{ext:"zip",type:"String",ignore:!0}]);t.isValid(r)&&(this.terminateWorkerOnLoad=!1,this.workerSupport=r,this.logging.enabled=this.workerSupport.logging.enabled,this.logging.debug=this.workerSupport.logging.debug);var n=this;this._loadMtl(a.mtl,(function(t){null!==t&&n.meshBuilder.setMaterials(t),n._loadObj(a.obj,n.callbacks.onLoad,null,null,n.callbacks.onMeshAlter,e.useAsync)}),e.crossOrigin,e.materialOptions)},r.prototype._applyPrepData=function(e){t.isValid(e)&&(this.setLogging(e.logging.enabled,e.logging.debug),this.setModelName(e.modelName),this.setStreamMeshesTo(e.streamMeshesTo),this.meshBuilder.setMaterials(e.materials),this.setUseIndices(e.useIndices),this.setDisregardNormals(e.disregardNormals),this.setMaterialPerSmoothingGroup(e.materialPerSmoothingGroup),this._setCallbacks(e.getCallbacks()))},r.prototype.parse=function(e){if(!t.isValid(e))return console.warn("Provided content is not a valid ArrayBuffer or String."),this.loaderRootNode;this.logging.enabled&&console.time("OBJLoader2 parse: "+this.modelName),this.meshBuilder.init();var r=new o;r.setLogging(this.logging.enabled,this.logging.debug),r.setMaterialPerSmoothingGroup(this.materialPerSmoothingGroup),r.setUseIndices(this.useIndices),r.setDisregardNormals(this.disregardNormals),r.setMaterials(this.meshBuilder.getMaterials());var a=this;r.setCallbackMeshBuilder((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}));if(r.setCallbackProgress((function(e,t){a.onProgress("progressParse",e,t)})),e instanceof ArrayBuffer||e instanceof Uint8Array)this.logging.enabled&&console.info("Parsing arrayBuffer..."),r.parse(e);else{if(!("string"==typeof e||e instanceof String))throw"Provided content was neither of type String nor Uint8Array! Aborting...";this.logging.enabled&&console.info("Parsing text..."),r.parseText(e)}return this.logging.enabled&&console.timeEnd("OBJLoader2 parse: "+this.modelName),this.loaderRootNode},r.prototype.parseAsync=function(e,r){var a=this,n=!1,i=function(){r({detail:{loaderRootNode:a.loaderRootNode,modelName:a.modelName,instanceNo:a.instanceNo}}),n&&a.logging.enabled&&console.timeEnd("OBJLoader2 parseAsync: "+a.modelName)};t.isValid(e)?n=!0:(console.warn("Provided content is not a valid ArrayBuffer."),i()),n&&this.logging.enabled&&console.time("OBJLoader2 parseAsync: "+this.modelName),this.meshBuilder.init();this.workerSupport.validate((function(e,r){var a="";return a+="/**\n",a+=" * This code was constructed by OBJLoader2 buildCode.\n",a+=" */\n\n",a+="THREE = { LoaderSupport: {} };\n\n",a+=e("LoaderSupport.Validator",t),a+=r("Parser",o)}),"Parser"),this.workerSupport.setCallbacks((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}),i),a.terminateWorkerOnLoad&&this.workerSupport.setTerminateRequested(!0);var s={},l=this.meshBuilder.getMaterials();for(var u in l)s[u]=u;this.workerSupport.run({params:{useAsync:!0,materialPerSmoothingGroup:this.materialPerSmoothingGroup,useIndices:this.useIndices,disregardNormals:this.disregardNormals},logging:{enabled:this.logging.enabled,debug:this.logging.debug},materials:{materials:s},data:{input:e,options:null}})};var o=function(){function e(){this.callbackProgress=null,this.callbackMeshBuilder=null,this.contentRef=null,this.legacyMode=!1,this.materials={},this.useAsync=!1,this.materialPerSmoothingGroup=!1,this.useIndices=!1,this.disregardNormals=!1,this.vertices=[],this.colors=[],this.normals=[],this.uvs=[],this.rawMesh={objectName:"",groupName:"",activeMtlName:"",mtllibName:"",faceType:-1,subGroups:[],subGroupInUse:null,smoothingGroup:{splitMaterials:!1,normalized:-1,real:-1},counts:{doubleIndicesCount:0,faceCount:0,mtlCount:0,smoothingGroupCount:0}},this.inputObjectCount=1,this.outputObjectCount=1,this.globalCounts={vertices:0,faces:0,doubleIndicesCount:0,lineByte:0,currentByte:0,totalBytes:0},this.logging={enabled:!0,debug:!1}}return e.prototype.resetRawMesh=function(){this.rawMesh.subGroups=[],this.rawMesh.subGroupInUse=null,this.rawMesh.smoothingGroup.normalized=-1,this.rawMesh.smoothingGroup.real=-1,this.pushSmoothingGroup(1),this.rawMesh.counts.doubleIndicesCount=0,this.rawMesh.counts.faceCount=0,this.rawMesh.counts.mtlCount=0,this.rawMesh.counts.smoothingGroupCount=0},e.prototype.setUseAsync=function(e){this.useAsync=e},e.prototype.setMaterialPerSmoothingGroup=function(e){this.materialPerSmoothingGroup=e},e.prototype.setUseIndices=function(e){this.useIndices=e},e.prototype.setDisregardNormals=function(e){this.disregardNormals=e},e.prototype.setMaterials=function(e){this.materials=n.default.Validator.verifyInput(e,this.materials),this.materials=n.default.Validator.verifyInput(this.materials,{})},e.prototype.setCallbackMeshBuilder=function(e){if(!n.default.Validator.isValid(e))throw'Unable to run as no "MeshBuilder" callback is set.';this.callbackMeshBuilder=e},e.prototype.setCallbackProgress=function(e){this.callbackProgress=e},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.configure=function(){if(this.pushSmoothingGroup(1),this.logging.enabled){var e=Object.keys(this.materials),t="OBJLoader2.Parser configuration:"+(e.length>0?"\n\tmaterialNames:\n\t\t- "+e.join("\n\t\t- "):"\n\tmaterialNames: None")+"\n\tuseAsync: "+this.useAsync+"\n\tmaterialPerSmoothingGroup: "+this.materialPerSmoothingGroup+"\n\tuseIndices: "+this.useIndices+"\n\tdisregardNormals: "+this.disregardNormals+"\n\tcallbackMeshBuilderName: "+this.callbackMeshBuilder.name+"\n\tcallbackProgressName: "+this.callbackProgress.name;console.info(t)}},e.prototype.parse=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parse"),this.configure();var t=new Uint8Array(e);this.contentRef=t;var r=t.byteLength;this.globalCounts.totalBytes=r;for(var a,n=new Array(128),i="",o=0,s=0,l=0;l0&&(n[o++]=i),i="";break;case 47:i.length>0&&(n[o++]=i),s++,i="";break;case 10:i.length>0&&(n[o++]=i),i="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=l,this.processLine(n,o,s),o=0,s=0;break;case 13:break;default:i+=String.fromCharCode(a)}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parse")},e.prototype.parseText=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parseText"),this.configure(),this.legacyMode=!0,this.contentRef=e;var t=e.length;this.globalCounts.totalBytes=t;for(var r,a=new Array(128),n="",i=0,o=0,s=0;s0&&(a[i++]=n),n="";break;case"/":n.length>0&&(a[i++]=n),o++,n="";break;case"\n":n.length>0&&(a[i++]=n),n="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=s,this.processLine(a,i,o),i=0,o=0;break;case"\r":break;default:n+=r}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parseText")},e.prototype.processLine=function(e,t,r){if(!(t<1)){var a,n,i,o,s=function(e,t,r,a){var n="";if(a>r){var i;if(t)for(i=r;i4&&(this.colors.push(parseFloat(e[4])),this.colors.push(parseFloat(e[5])),this.colors.push(parseFloat(e[6])));break;case"vt":this.uvs.push(parseFloat(e[1])),this.uvs.push(parseFloat(e[2]));break;case"vn":this.normals.push(parseFloat(e[1])),this.normals.push(parseFloat(e[2])),this.normals.push(parseFloat(e[3]));break;case"f":if(a=t-1,0===r)for(this.checkFaceType(0),i=2,n=a;i0?n-1:n+a.vertices.length/3),o=a.rawMesh.subGroupInUse.vertices;o.push(a.vertices[i++]),o.push(a.vertices[i++]),o.push(a.vertices[i]);var s=a.colors.length>0?i:null;if(null!==s){var l=a.rawMesh.subGroupInUse.colors;l.push(a.colors[s++]),l.push(a.colors[s++]),l.push(a.colors[s])}if(t){var u=parseInt(t),c=2*(u>0?u-1:u+a.uvs.length/2),f=a.rawMesh.subGroupInUse.uvs;f.push(a.uvs[c++]),f.push(a.uvs[c])}if(r){var d=parseInt(r),h=3*(d>0?d-1:d+a.normals.length/3),p=a.rawMesh.subGroupInUse.normals;p.push(a.normals[h++]),p.push(a.normals[h++]),p.push(a.normals[h])}};if(this.useIndices){var o=e+(t?"_"+t:"_n")+(r?"_"+r:"_n"),s=this.rawMesh.subGroupInUse.indexMappings[o];n.default.Validator.isValid(s)?this.rawMesh.counts.doubleIndicesCount++:(s=this.rawMesh.subGroupInUse.vertices.length/3,i(),this.rawMesh.subGroupInUse.indexMappings[o]=s,this.rawMesh.subGroupInUse.indexMappingsCount++),this.rawMesh.subGroupInUse.indices.push(s)}else i();this.rawMesh.counts.faceCount++},e.prototype.createRawMeshReport=function(e){return"Input Object number: "+e+"\n\tObject name: "+this.rawMesh.objectName+"\n\tGroup name: "+this.rawMesh.groupName+"\n\tMtllib name: "+this.rawMesh.mtllibName+"\n\tVertex count: "+this.vertices.length/3+"\n\tNormal count: "+this.normals.length/3+"\n\tUV count: "+this.uvs.length/2+"\n\tSmoothingGroup count: "+this.rawMesh.counts.smoothingGroupCount+"\n\tMaterial count: "+this.rawMesh.counts.mtlCount+"\n\tReal MeshOutputGroup count: "+this.rawMesh.subGroups.length},e.prototype.finalizeRawMesh=function(){var e,t,r=[],a=0,n=0,i=0,o=0,s=0,l=0;for(var u in this.rawMesh.subGroups)if((e=this.rawMesh.subGroups[u]).vertices.length>0){if((t=e.indices).length>0&&n>0)for(var c in t)t[c]=t[c]+n;r.push(e),a+=e.vertices.length,n+=e.indexMappingsCount,i+=e.indices.length,o+=e.colors.length,l+=e.uvs.length,s+=e.normals.length}var f=null;return r.length>0&&(f={name:""!==this.rawMesh.groupName?this.rawMesh.groupName:this.rawMesh.objectName,subGroups:r,absoluteVertexCount:a,absoluteIndexCount:i,absoluteColorCount:o,absoluteNormalCount:s,absoluteUvCount:l,faceCount:this.rawMesh.counts.faceCount,doubleIndicesCount:this.rawMesh.counts.doubleIndicesCount}),f},e.prototype.processCompletedMesh=function(){var e=this.finalizeRawMesh();if(n.default.Validator.isValid(e)){if(this.colors.length>0&&this.colors.length!==this.vertices.length)throw"Vertex Colors were detected, but vertex count and color count do not match!";this.logging.enabled&&this.logging.debug&&console.debug(this.createRawMeshReport(this.inputObjectCount)),this.inputObjectCount++,this.buildMesh(e);var t=this.globalCounts.currentByte/this.globalCounts.totalBytes;return this.callbackProgress("Completed [o: "+this.rawMesh.objectName+" g:"+this.rawMesh.groupName+"] Total progress: "+(100*t).toFixed(2)+"%",t),this.resetRawMesh(),!0}return!1},e.prototype.buildMesh=function(e){var t=e.subGroups,r=new Float32Array(e.absoluteVertexCount);this.globalCounts.vertices+=e.absoluteVertexCount/3,this.globalCounts.faces+=e.faceCount,this.globalCounts.doubleIndicesCount+=e.doubleIndicesCount;var a,i,o,s,l,u,c,f=e.absoluteIndexCount>0?new Uint32Array(e.absoluteIndexCount):null,d=e.absoluteColorCount>0?new Float32Array(e.absoluteColorCount):null,h=e.absoluteNormalCount>0?new Float32Array(e.absoluteNormalCount):null,p=e.absoluteUvCount>0?new Float32Array(e.absoluteUvCount):null,m=n.default.Validator.isValid(d),v=[],g=t.length>1,y=0,b=[],w=[],x=0,_=0,A=0,E=0,S=0,M=0,T=0;for(var P in t)if(t.hasOwnProperty(P)){if(c=(a=t[P]).materialName,u=this.rawMesh.faceType<4?c+(m?"_vertexColor":"")+(0===a.smoothingGroup?"_flat":""):6===this.rawMesh.faceType?"defaultPointMaterial":"defaultLineMaterial",s=this.materials[c],l=this.materials[u],!n.default.Validator.isValid(s)&&!n.default.Validator.isValid(l)){var F=m?"defaultVertexColorMaterial":"defaultMaterial";s=this.materials[F],this.logging.enabled&&console.warn('object_group "'+a.objectName+"_"+a.groupName+'" was defined with unresolvable material "'+c+'"! Assigning "'+F+'".'),(c=F)===u&&(l=s,u=F)}if(!n.default.Validator.isValid(l)){var O={materialNameOrg:c,materialName:u,materialProperties:{vertexColors:m?2:0,flatShading:0===a.smoothingGroup}},L={cmd:"materialData",materials:{materialCloneInstructions:O}};this.callbackMeshBuilder(L),this.useAsync&&(this.materials[u]=O)}if(g?((i=b[u])||(i=y,b[u]=y,v.push(u),y++),o={start:M,count:T=this.useIndices?a.indices.length:a.vertices.length/3,index:i},w.push(o),M+=T):v.push(u),r.set(a.vertices,x),x+=a.vertices.length,f&&(f.set(a.indices,_),_+=a.indices.length),d&&(d.set(a.colors,A),A+=a.colors.length),h&&(h.set(a.normals,E),E+=a.normals.length),p&&(p.set(a.uvs,S),S+=a.uvs.length),this.logging.enabled&&this.logging.debug){var C=n.default.Validator.isValid(i)?"\n\t\tmaterialIndex: "+i:"",k="\tOutput Object no.: "+this.outputObjectCount+"\n\t\tgroupName: "+a.groupName+"\n\t\tIndex: "+a.index+"\n\t\tfaceType: "+this.rawMesh.faceType+"\n\t\tmaterialName: "+a.materialName+"\n\t\tsmoothingGroup: "+a.smoothingGroup+C+"\n\t\tobjectName: "+a.objectName+"\n\t\t#vertices: "+a.vertices.length/3+"\n\t\t#indices: "+a.indices.length+"\n\t\t#colors: "+a.colors.length/3+"\n\t\t#uvs: "+a.uvs.length/2+"\n\t\t#normals: "+a.normals.length/3;console.debug(k)}}this.outputObjectCount++,this.callbackMeshBuilder({cmd:"meshData",progress:{numericalValue:this.globalCounts.currentByte/this.globalCounts.totalBytes},params:{meshName:e.name},materials:{multiMaterial:g,materialNames:v,materialGroups:w},buffers:{vertices:r,indices:f,colors:d,normals:h,uvs:p},geometryType:this.rawMesh.faceType<4?0:6===this.rawMesh.faceType?2:1},[r.buffer],n.default.Validator.isValid(f)?[f.buffer]:null,n.default.Validator.isValid(d)?[d.buffer]:null,n.default.Validator.isValid(h)?[h.buffer]:null,n.default.Validator.isValid(p)?[p.buffer]:null)},e.prototype.finalizeParsing=function(){if(this.logging.enabled&&console.info("Global output object count: "+this.outputObjectCount),this.processCompletedMesh()&&this.logging.enabled){var e="Overall counts: \n\tVertices: "+this.globalCounts.vertices+"\n\tFaces: "+this.globalCounts.faces+"\n\tMultiple definitions: "+this.globalCounts.doubleIndicesCount;console.info(e)}},e}();return r.prototype.loadMtl=function(e,t,r,a,i){var o=new n.default.ResourceDescriptor(e,"MTL");o.setContent(t),this._loadMtl(o,r,a,i)},r.prototype._loadMtl=function(e,r,n,o){void 0===i.default&&console.error('"THREE.MTLLoader" is not available. "THREE.OBJLoader2" requires it for loading MTL files.'),t.isValid(e)&&this.logging.enabled&&console.time("Loading MTL: "+e.name);var s=[],l=this,u=function(a){var n=[];if(t.isValid(a))for(var i in a.preload(),n=a.materials)n.hasOwnProperty(i)&&(s[i]=n[i]);t.isValid(e)&&l.logging.enabled&&console.timeEnd("Loading MTL: "+e.name),r(s,a)};if(t.isValid(e)&&(t.isValid(e.content)||t.isValid(e.url))){var c=new i.default(this.manager);if(n=t.verifyInput(n,"anonymous"),c.setCrossOrigin(n),c.setPath(e.path),t.isValid(o)&&c.setMaterialOptions(o),t.isValid(e.content))u(t.isValid(e.content)?c.parse(e.content):null);else if(t.isValid(e.url)){new a.FileLoader(this.manager).load(e.url,(function(t){e.content=t,u(c.parse(t))}),this._onProgress,this._onError)}}else u()},r}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.littleEndian=!0};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(e,(function(r){t(i.parse(r,e))}),r,n)},parse:function(e,t){var r=a.LoaderUtils.decodeText(e),n=function(e){var t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),a=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=a[1],t.headerLen=a[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(var n=0,i=t.fields.length;n0&&v.addAttribute("position",new a.Float32BufferAttribute(i,3)),o.length>0&&v.addAttribute("normal",new a.Float32BufferAttribute(o,3)),s.length>0&&v.addAttribute("color",new a.Float32BufferAttribute(s,3)),v.computeBoundingSphere();var g=new a.PointsMaterial({size:.005});s.length>0?g.vertexColors=!0:g.color.setHex(16777215*Math.random());var y=new a.Points(v,g),b=t.split("").reverse().join("");return b=(b=/([^\/]*)/.exec(b))[1].split("").reverse().join(""),y.name=b,y}console.error("THREE.PCDLoader: binary_compressed files are not supported")}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function n(e,t){var r=parseInt(m[v].substr(e,t));if(r){var a=function(e,t){return"s"+Math.min(e,t)+"e"+Math.max(e,t)}(y,r);void 0===p[a]&&(d.push([y-1,r-1,1]),p[a]=d.length-1)}}for(var i,o,s,l,u,c={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},f=[],d=[],h={},p={},m=e.split("\n"),v=0,g=m.length;v=t.elements[u].count&&(u++,c=0);var h=n(t.elements[u].properties,d);s(a,t.elements[u].name,h),c++}}return o(a)}function o(e){var t=new a.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.addAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.addAttribute("normal",new a.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.addAttribute("uv",new a.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.addAttribute("color",new a.Float32BufferAttribute(e.colors,3)),t.computeBoundingSphere(),t}function s(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){var a=r.vertex_indices||r.vertex_index;3===a.length?e.indices.push(a[0],a[1],a[2]):4===a.length&&(e.indices.push(a[0],a[1],a[3]),e.indices.push(a[1],a[2],a[3]))}}function l(e,t,r,a){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,a),2];case"uint16":case"ushort":return[e.getUint16(t,a),2];case"int32":case"int":return[e.getInt32(t,a),4];case"uint32":case"uint":return[e.getUint32(t,a),4];case"float32":case"float":return[e.getFloat32(t,a),4];case"float64":case"double":return[e.getFloat64(t,a),8]}}function u(e,t,r,a){for(var n,i={},o=0,s=0;s>7&1),s=n>>6&1,l=1==(n>>5&1),u=31&n,c=0,f=0;if(l?(c=(t[2]<<16)+(t[3]<<8)+t[4],f=(t[5]<<16)+(t[6]<<8)+t[7]):(c=t[2]+(t[3]<<8)+(t[4]<<16),f=t[5]+(t[6]<<8)+(t[7]<<16)),0===a)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==a)throw new Error("PRWM decoder: Unsupported format version: "+a);if(!o){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==f)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}var d,h,p,m,v,g,y,b,w=8,x={};for(b=0;b>7&1,m=1+(n>>4&3),w++,g=i(e,v=r[15&n],w=4*Math.ceil(w/4),m*c,l),w+=v.BYTES_PER_ELEMENT*m*c,x[d]={type:p,cardinality:m,values:g}}return w=4*Math.ceil(w/4),y=null,o&&(y=i(e,1===s?Uint32Array:Uint16Array,w,f,l)),{version:a,attributes:x,indices:y}}(e),s=Object.keys(o.attributes),l=new a.BufferGeometry;for(n=0;n0;return 25===h?(r=p?a.RGBA_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,t=4):24===h?(r=p?a.RGBA_PVRTC_2BPPV1_Format:a.RGB_PVRTC_2BPPV1_Format,t=2):console.error("THREE.PVRLoader: Unknown PVR format:",h),e.dataPtr=o,e.bpp=t,e.format=r,e.width=l,e.height=s,e.numSurfaces=d,e.numMipmaps=u+1,e.isCubemap=6===d,n._extract(e)},n._extract=function(e){var t,r={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},a=e.buffer,n=e.dataPtr,i=e.bpp,o=e.numSurfaces,s=0,l=0,u=0,c=0,f=0;2===i?(l=8,u=4):(l=4,u=4),t=l*u*i/8,r.mipmaps.length=e.numMipmaps*o;for(var d=0;d>d,p=e.height>>d;(c=h/l)<2&&(c=2),(f=p/u)<2&&(f=2),s=c*f*t;for(var m=0;m>5&31)/31,n=(_>>10&31)/31):(t=o,r=s,n=l)}for(var A=1;A<=3;A++){var E=y+12*A;m.push(c.getFloat32(E,!0)),m.push(c.getFloat32(E+4,!0)),m.push(c.getFloat32(E+8,!0)),v.push(b,w,x),d&&i.push(t,r,n)}}return p.addAttribute("position",new a.BufferAttribute(new Float32Array(m),3)),p.addAttribute("normal",new a.BufferAttribute(new Float32Array(v),3)),d&&(p.addAttribute("color",new a.BufferAttribute(new Float32Array(i),3)),p.hasColors=!0,p.alpha=u),p}(r):function(e){for(var t,r=new a.BufferGeometry,n=/facet([\s\S]*?)endfacet/g,i=0,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+o+o+o,"g"),l=new RegExp("normal"+o+o+o,"g"),u=[],c=[],f=new a.Vector3;null!==(t=n.exec(e));){for(var d=0,h=0,p=t[0];null!==(t=l.exec(p));)f.x=parseFloat(t[1]),f.y=parseFloat(t[2]),f.z=parseFloat(t[3]),h++;for(;null!==(t=s.exec(p));)u.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),c.push(f.x,f.y,f.z),d++;1!==h&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==d&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}return r.addAttribute("position",new a.Float32BufferAttribute(u,3)),r.addAttribute("normal",new a.Float32BufferAttribute(c,3)),r}("string"!=typeof(t=e)?a.LoaderUtils.decodeText(new Uint8Array(t)):t)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e,t,a,n,i,o,s,l){n=n*Math.PI/180,t=Math.abs(t),a=Math.abs(a);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,f=Math.cos(n)*u+Math.sin(n)*c,d=-Math.sin(n)*u+Math.cos(n)*c,h=t*t,p=a*a,m=f*f,v=d*d,g=m/h+v/p;if(g>1){var y=Math.sqrt(g);h=(t*=y)*t,p=(a*=y)*a}var b=h*v+p*m,w=(h*p-b)/b,x=Math.sqrt(Math.max(0,w));i===o&&(x=-x);var _=x*t*d/a,A=-x*a*f/t,E=Math.cos(n)*_-Math.sin(n)*A+(s.x+l.x)/2,S=Math.sin(n)*_+Math.cos(n)*A+(s.y+l.y)/2,M=r(1,0,(f-_)/t,(d-A)/a),T=r((f-_)/t,(d-A)/a,(-f-_)/t,(-d-A)/a)%(2*Math.PI);e.currentPath.absellipse(E,S,t,a,M,M+T,0===o,n)}function r(e,t,r,a){var n=e*r+t*a,i=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+a*a),o=Math.acos(Math.max(-1,Math.min(1,n/i)));return e*a-t*r<0&&(o=-o),o}function n(e,t){return t=Object.assign({},t),e.hasAttribute("fill")&&(t.fill=e.getAttribute("fill")),""!==e.style.fill&&(t.fill=e.style.fill),t}function i(e){return"none"!==e.fill&&"transparent"!==e.fill}function o(e,t){return 2*e-(t-e)}function s(e){for(var t=e.split(/[\s,]+|(?=\s?[+\-])/),r=0;r0){var p=[];for(u=0;u=t.end)return 0;this.position=t.cur;try{var r=this.readChunk(e);return t.cur+=r.size,r.id}catch(e){return this.debugMessage("Unable to read chunk at "+this.position),0}},resetPosition:function(){this.position-=6},readByte:function(e){var t=e.getUint8(this.position,!0);return this.position+=1,t},readFloat:function(e){try{var t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}},readInt:function(e){var t=e.getInt32(this.position,!0);return this.position+=4,t},readShort:function(e){var t=e.getInt16(this.position,!0);return this.position+=2,t},readDWord:function(e){var t=e.getUint32(this.position,!0);return this.position+=4,t},readWord:function(e){var t=e.getUint16(this.position,!0);return this.position+=2,t},readString:function(e,t){for(var r="",a=0;a256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case a:case n:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;var g=!1,y=!1,b=!1;switch(v.image_type){case i:g=!0,y=!0;break;case r:y=!0;break;case o:g=!0;break;case a:break;case s:g=!0,b=!0;break;case n:b=!0}var w=document.createElement("canvas");w.width=v.width,w.height=v.height;var x=w.getContext("2d"),_=x.createImageData(v.width,v.height),A=function(e,t,r,a,n){var i,o,s,l;if(o=r.pixel_size>>3,s=r.width*r.height*o,t&&(l=n.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,c,f;i=new Uint8Array(s);for(var d=0,h=new Uint8Array(o);d>u){default:case d:i=0,s=1,m=t,o=0,p=1,g=r;break;case c:i=0,s=1,m=t,o=r-1,p=-1,g=-1;break;case h:i=t-1,s=-1,m=-1,o=0,p=1,g=r;break;case f:i=t-1,s=-1,m=-1,o=r-1,p=-1,g=-1}if(b)switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f++)l=s[f],e[4*(u+d*c)+0]=l,e[4*(u+d*c)+1]=l,e[4*(u+d*c)+2]=l,e[4*(u+d*c)+3]=255}(e,o,p,g,i,s,m,a);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=2)e[4*(l+f*u)+0]=s[c+0],e[4*(l+f*u)+1]=s[c+0],e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+3]=s[c+1]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s,l){var u,c,f,d=l,h=0,p=v.width;for(f=t;f!==a;f+=r)for(c=n;c!==o;c+=i,h++)u=s[h],e[4*(c+p*f)+3]=255,e[4*(c+p*f)+2]=d[3*u+0],e[4*(c+p*f)+1]=d[3*u+1],e[4*(c+p*f)+0]=d[3*u+2]}(e,o,p,g,i,s,m,a,n);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f+=2)l=s[f+0]+(s[f+1]<<8),e[4*(u+d*c)+0]=(31744&l)>>7,e[4*(u+d*c)+1]=(992&l)>>2,e[4*(u+d*c)+2]=(31&l)>>3,e[4*(u+d*c)+3]=32768&l?0:255}(e,o,p,g,i,s,m,a);break;case 24:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=3)e[4*(l+f*u)+3]=255,e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2]}(e,o,p,g,i,s,m,a);break;case 32:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=4)e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2],e[4*(l+f*u)+3]=s[c+3]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}}(_.data,v.width,v.height,A.pixel_data,A.palettes);return x.putImageData(_,0,0),w}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.reversed=!1};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){var t,r=[];e.forEach((function(e){"m"===e.type.toLowerCase()?(t=[e],r.push(t)):"z"!==e.type.toLowerCase()&&t.push(e)}));var a=[];return r.forEach((function(e){var t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};a.push(t);for(var r=e.length-1;r>0;r--){var n=e[r];t={type:n.type};void 0!==n.x2&&void 0!==n.y2?(t.x1=n.x2,t.y1=n.y2,t.x2=n.x1,t.y2=n.y1):void 0!==n.x1&&void 0!==n.y1&&(t.x1=n.x1,t.y1=n.y1),t.x=e[r-1].x,t.y=e[r-1].y,a.push(t)}})),a}return"undefined"==typeof opentype?(console.warn("THREE.TTFLoader: The loader requires opentype.js. Make sure it's included before using the loader."),null):function(e,r){for(var a=Math.round,n={},i=1e5/(72*(e.unitsPerEm||2048)),o=0;o-1;o--){var s=i[o];if(/{.*[{\[]/.test(s))(l=s.split("{").join("{\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);else if(/\].*}/.test(s)){var l;(l=s.split("]").join("]\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l)}if(/}.*}/.test(s))(l=s.split("}").join("}\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);/^\b[^\s]+\b$/.test(s.trim())?(i[o+1]=s+" "+i[o+1].trim(),i.splice(o,1)):s.indexOf("coord")>-1&&s.indexOf("[")<0&&s.indexOf("{")<0&&(i[o]+=" Coordinate {}")}var u=i.shift();return/V1.0/.exec(u)?console.warn("THREE.VRMLLoader: V1.0 not supported yet."):/V2.0/.exec(u)&&function(e,n){var i={},o=/(\b|\-|\+)([\d\.e]+)/,s=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g,l=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g;function u(e,t,r,n,i){for(var o=!0===i?1:-1,s=[],l={},u={},c=0;cu.y:m.y>=l.y&&m.y0)for(var d=0;d0&&this.indexes.push(c),c=[]):c.push(parseInt(i[d])));/]/.exec(t)&&(c.length>0&&this.indexes.push(c),c=[],this.isRecordingFaces=!1,e[this.recordingFieldname]=this.indexes)}else if(this.isRecordingPoints){if("Coordinate"==e.nodeType)for(;null!==(i=l.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2]),z:parseFloat(i[3])},this.points.push(n);if("TextureCoordinate"==e.nodeType)for(;null!==(i=s.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2])},this.points.push(n);/]/.exec(t)&&(this.isRecordingPoints=!1,e.points=this.points)}else if(this.isRecordingAngles){if(i.length>0)for(d=0;d-1&&"PointLight"===o.nodeType&&(o.nodeType="AmbientLight");var c=void 0===o.on||o.on,f=void 0!==o.intensity?o.intensity:1,d=new a.Color;if(o.color&&d.copy(o.color),"AmbientLight"===o.nodeType)(l=new a.AmbientLight(d,f)).visible=c,s.add(l);else if("PointLight"===o.nodeType){var h=0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),(l=new a.PointLight(d,f,h)).visible=c,s.add(l)}else if("SpotLight"===o.nodeType){f=1,h=0;var p=Math.PI/3;c=!0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),void 0!==o.cutOffAngle&&(p=o.cutOffAngle),(l=new a.SpotLight(d,f,h,p,0)).visible=c,s.add(l)}else if("Transform"===o.nodeType||"Group"===o.nodeType){if(l=new a.Object3D,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),void 0!==o.translation){var m=o.translation;l.position.set(m.x,m.y,m.z)}if(void 0!==o.rotation){var v=o.rotation;l.quaternion.setFromAxisAngle(new a.Vector3(v.x,v.y,v.z),v.w)}if(void 0!==o.scale){var g=o.scale;l.scale.set(g.x,g.y,g.z)}s.add(l)}else if("Shape"===o.nodeType)l=new a.Mesh,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),s.add(l);else if("Background"===o.nodeType){var y=2e4,b=new a.SphereBufferGeometry(y,20,20),w=new a.MeshBasicMaterial({fog:!1,side:a.BackSide});if(o.skyColor.length>1)u(b,y,o.skyAngle,o.skyColor,!0),w.vertexColors=a.VertexColors;else{var x=o.skyColor[0];w.color.setRGB(x.r,x.b,x.g)}if(n.add(new a.Mesh(b,w)),void 0!==o.groundColor){y=12e3;var _=new a.SphereBufferGeometry(y,20,20,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),A=new a.MeshBasicMaterial({fog:!1,side:a.BackSide,vertexColors:a.VertexColors});u(_,y,o.groundAngle,o.groundColor,!1),n.add(new a.Mesh(_,A))}}else{if(/geometry/.exec(o.string)){if("Box"===o.nodeType){g=o.size;s.geometry=new a.BoxBufferGeometry(g.x,g.y,g.z)}else if("Cylinder"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.radius,o.radius,o.height);else if("Cone"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.topRadius,o.bottomRadius,o.height);else if("Sphere"===o.nodeType)s.geometry=new a.SphereBufferGeometry(o.radius);else if("IndexedFaceSet"===o.nodeType){var E,S,M,T,P,F=new a.BufferGeometry,O=[],L=[];for(B=0,M=o.children.length;B-1){var C=/DEF\s+([^\s]+)/.exec(V.string)[1];i[C]=O.slice(0)}if(V.string.indexOf("USE")>-1){W=/USE\s+([^\s]+)/.exec(V.string)[1];O=i[W]}}}var k=0;if(o.coordIndex){var R=[],I=[];for(E=new a.Vector3,S=new a.Vector2,B=0,M=o.coordIndex.length;B=3&&k0&&F.addAttribute("uv",new a.Float32BufferAttribute(L,2)),F.computeVertexNormals(),F.computeBoundingSphere(),/DEF/.exec(o.string)&&(F.name=/DEF ([^\s]+)/.exec(o.string)[1],i[F.name]=F),s.geometry=F}return}if(/appearance/.exec(o.string)){for(var B=0;B>1^-(1&c),a[n]=s*(l+o),n+=i}},n.prototype.decompressIndices_=function(e,t,r,a,n){for(var i=0,o=0;o>1,p=e.charCodeAt(u+4)+1>>1,m=e.charCodeAt(u+5)+1>>1;l[s++]=n[0]*(c+h),l[s++]=n[1]*(f+p),l[s++]=n[2]*(d+m),l[s++]=n[0]*h,l[s++]=n[1]*p,l[s++]=n[2]*m}return l},n.prototype.decompressMesh=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=u,d=new Float32Array(o*c),h=0;h>1^-(1&f);l[c]+=d,s[t*u+c]=l[c],o[t*u+c]=a[c]*(l[c]+r[c])}},n.prototype.accumulateNormal=function(e,t,r,a,n){var i=a[8*e],o=a[8*e+1],s=a[8*e+2],l=a[8*t],u=a[8*t+1],c=a[8*t+2],f=a[8*r],d=a[8*r+1],h=a[8*r+2];l-=i,f-=i,i=(u-=o)*(h-=s)-(c-=s)*(d-=o),o=c*f-l*h,s=l*d-u*f,n[3*e]+=i,n[3*e+1]+=o,n[3*e+2]+=s,n[3*t]+=i,n[3*t+1]+=o,n[3*t+2]+=s,n[3*r]+=i,n[3*r+1]+=o,n[3*r+2]+=s},n.prototype.decompressMesh2=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=t.codeRange[0],d=3*t.codeRange[2],h=new Uint16Array(d),p=new Int32Array(3*c),m=new Uint16Array(o),v=new Uint16Array(o*c),g=new Float32Array(o*c),y=0,b=0,w=0;w>1^-(1&O))+v[o*A+F]+v[o*E+F]-v[o*S+F];m[F]=L,v[o*y+F]=L,g[o*y+F]=l[F]*(L+s[F])}y++}else this.copyAttrib(o,v,m,P);this.accumulateNormal(A,E,P,v,p)}else{var C=y-(x-_);h[b++]=C,x===_?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,C);var k=y-(x=e.charCodeAt(f++));h[b++]=k,0===x?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,k);var R=y-(x=e.charCodeAt(f++));if(h[b++]=R,0===x){for(F=0;F<5;F++)m[F]=(v[o*C+F]+v[o*k+F])/2;this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++)}else this.copyAttrib(o,v,m,R);this.accumulateNormal(C,k,R,v,p)}}for(w=0;w>1^-(1&j)),g[o*w+6]=U*N+(B>>1^-(1&B)),g[o*w+7]=U*D+(V>>1^-(1&V))}i(a,n,g,h,void 0,t)},n.prototype.downloadMesh=function(e,t,r,a,n){var i=this,s=0;o(e,(function(e){!function(e){for(;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=new s(3*f/4-(i="="===e[f-2]?2:"="===e[f-1]?1:0)),a=i>0?f-4:f;var d=0;for(t=0,r=0;t>16,o[d++]=(65280&n)>>8,o[d++]=255&n;return 2===i?(n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[d++]=255&n):1===i&&(n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[d++]=n>>8&255,o[d++]=255&n),o}function n(e,a){var n,i,s,l,u=0;if("UInt64"===o.attributes.header_type?u=8:"UInt32"===o.attributes.header_type&&(u=4),"binary"===e.attributes.format&&a){var c,f,d,h,p,m;if("Float32"===e.attributes.type)var v=new Float32Array;else if("Int64"===e.attributes.type)v=new Int32Array;f=(c=r(e["#text"]))[0];for(var g=1;g0?3-h%3:0,(p=[]).push(m),d=3*u;for(g=0;g0){r.attributes={};for(var a=0;a0&&(v[g].text=n(v[g],f)),g++;switch(d[h]){case"PointData":var b=parseInt(c.attributes.NumberOfPoints),w=m.attributes.Normals;if(b>0)for(var x=0,_=v.length;x<_;x++)if(w===v[x].attributes.Name){var A=v[x].attributes.NumberOfComponents;(l=new Float32Array(b*A)).set(v[x].text,0)}break;case"Points":if((b=parseInt(c.attributes.NumberOfPoints))>0){A=m.DataArray.attributes.NumberOfComponents;(s=new Float32Array(b*A)).set(m.DataArray.text,0)}break;case"Strips":var E=parseInt(c.attributes.NumberOfStrips);if(E>0){var S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);var T=E+S.length;u=new Uint32Array(3*T-9*E);var P=0;for(x=0,_=E;x<_;x++){for(var F=[],O=0,L=M[x],C=0;O0&&(C=M[x-1]);var k=0;for(L=M[x],C=0;k0&&(C=M[x-1])}}break;case"Polys":var R=parseInt(c.attributes.NumberOfPolys);if(R>0){S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);T=R+S.length;u=new Uint32Array(3*T-9*R);P=0;var I=0;for(x=0,_=R,C=0;x<_;){var N=[];for(O=0,L=M[x];O=3)for(var C=parseInt(L[0]),k=1,R=0;R=3){var I,N;for(R=0;R=u.byteLength)break}var A=new a.BufferGeometry;return A.setIndex(new a.BufferAttribute(h,1)),A.addAttribute("position",new a.BufferAttribute(f,3)),d.length===f.length&&A.addAttribute("normal",new a.BufferAttribute(d,3)),A}(e)}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(var r=t;r-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,a=0;a127)return!0;return!1}},{key:"ensureBinary",value:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),r=0;r0&&(this.baseDir=this.url.substr(0,this.url.lastIndexOf("/")+1));this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this.mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var a=this._data.indexOf("{",r)+1,n=this._data.indexOf("}",r),i=this._data.indexOf("{",a)+1;if(!(a>0&&n>a)){r=-1===a?this._data.length:n+1;break}var o={children:[]},s=this._readLine(this._data.substr(r,a-r-1)).trim(),l=s.split(/ /g);if(l.length>0?(o.type=l[0],l.length>=2?o.name=l[1]:o.name=l[0]+this.Hierarchies.children.length):(o.name=s,o.type=""),"Animation"===o.type){o.data=this._data.substr(i,n-i).trim();var u=this._hierarchieParse(o,n+1);r=u.end,o.children=u.parent.children}else{var c=this._data.lastIndexOf(";",i>0?Math.min(i,n):n);if(o.data=this._data.substr(a,c-a).trim(),i<=0||n0||!this._currentObject.worked?setTimeout((function(){e.mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.Geometry=new a.Geometry,this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new s,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new a.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new a.Bone;if(e.name=this._currentFrame.name,e.applyMatrix(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(var t in this.HieStack)this.HieStack[t].name===this._currentFrame.parentName&&this.HieStack[t].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,a=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,n=0,(a=this._currentObject.data.indexOf(";;",e)+1)<=0&&(a=this._currentObject.data.length)}else{var o=0;switch(t){case 0:o=this._currentObject.data.indexOf(",",e)+1;break;case 1:o=this._currentObject.data.indexOf(";,",e)+1}switch((0===o||o>a)&&(o=a,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,o-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,o-e))}break;case"MeshNormals":switch(t){case 0:this._readNormalVector1(this._currentObject.data.substr(e,o-e));break;case 1:this._readNormalFace1(this._currentObject.data.substr(e,o-e),n)}}e=o+1,n++,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.Geometry.vertices.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))),this._currentGeo.Geometry.skinIndices.push(new a.Vector4(0,0,0,0)),this._currentGeo.Geometry.skinWeights.push(new a.Vector4(1,0,0,0)),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.Geometry.faces.push(new a.Face3(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),new a.Vector3(1,1,1).normalize()))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.normalVectors.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])))}},{key:"_readNormalFace1",value:function(e,t){var r=this._readLine(e.trim()).substr(2,e.length-4).split(","),a=parseInt(r[0],10),n=this._currentGeo.normalVectors[a];a=parseInt(r[1],10);var i=this._currentGeo.normalVectors[a];a=parseInt(r[2],10);var o=this._currentGeo.normalVectors[a];this._currentGeo.Geometry.faces[t].vertexNormals=[n,i,o]}},{key:"_setMeshNormals",value:function(){for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var a=this._currentObject.data.indexOf(",",e)+1;-1===a&&(a=this._currentObject.data.indexOf(";;",e)+1,t=2,r=0);var n=this._currentObject.data.substr(e,a-e),i=this._readLine(n.trim()).split(";");this._currentGeo.normalVectors.push([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]),e=a+1}}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshTextureCoords",value:function(){this._tmpUvArray=[],this._currentGeo.Geometry.faceVertexUvs=[],this._currentGeo.Geometry.faceVertexUvs.push([]);for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),o=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),1-parseFloat(o[1]))):this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),parseFloat(o[1]))),e=n+1}}if(e>=this._currentObject.data.length)break}this._currentGeo.Geometry.faceVertexUvs[0]=[];for(var s=0;s=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new a.MeshPhongMaterial({color:16777215*Math.random()});e.side=a.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t),i=this._readLine(n.trim()).split(";");e.color.r=parseFloat(i[0]),e.color.g=parseFloat(i[1]),e.color.b=parseFloat(i[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(n)),t=r+1,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t);var o=this._readLine(n.trim()).split(";");e.specular.r=parseFloat(o[0]),e.specular.g=parseFloat(o[1]),e.specular.b=parseFloat(o[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),n=this._currentObject.data.substr(t,r-t);var s=this._readLine(n.trim()).split(";");e.emissive.r=parseFloat(s[0]),e.emissive.g=parseFloat(s[1]),e.emissive.b=parseFloat(s[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var u=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(this.baseDir+u);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(this.baseDir+u),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(this.baseDir+u),e.normalScale=new a.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(this.baseDir+u);break;case"LightMapFilename":e.lightMap=this.texloader.load(this.baseDir+u)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new o,t=0,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);t=r+1,e.boneName=n.substr(1,n.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(r=this._currentObject.data.indexOf(";",t))+1,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);for(var i=this._readLine(n.trim()).split(","),s=0;s0)for(var o=0;o0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(var r=0;r4&&console.log("warn! over 4 bone weight! :"+s)}}for(var u=0;u0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,i&&e.context.disable(e.context.STENCIL_TEST),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new a.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new a.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionX,e.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.context.enable(e.context.STENCIL_TEST),e.render(this.scene,this.camera,r,!1),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:new a.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),s.BlurDirectionX=new a.Vector2(1,0),s.BlurDirectionY=new a.Vector2(0,1),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=r(1),i=(a=n)&&a.__esModule?a:{default:a};var o=function(e,t,r,a,n){i.default.call(this),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=a,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};o.prototype=Object.assign(Object.create(i.default.prototype),{constructor:o,render:function(e,t,r,a,n){var i,o,s=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),o=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),this.clearColor&&e.setClearColor(i,o),this.scene.overrideMaterial=null,e.autoClear=s}}),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=c(r(1)),i=c(r(19)),o=c(r(20)),s=c(r(2)),l=c(r(21)),u=c(r(22));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e,t,r,u,c){(n.default.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==r&&r,this.supportsNormalTexture=void 0!==u&&u,this.oldClearColor=new a.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==c?new a.Vector2(c.x,c.y):new a.Vector2(256,256),this.saoRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.NearestFilter,magFilter:a.NearestFilter,format:a.RGBAFormat}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((r=new a.DepthTexture).type=a.UnsignedShortType,r.minFilter=a.NearestFilter,r.maxFilter=a.NearestFilter,this.beautyRenderTarget.depthTexture=r,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.normalMaterial=new a.MeshNormalMaterial,this.normalMaterial.blending=a.NoBlending,void 0===i.default&&console.error("THREE.SAOPass relies on THREE.SAOShader"),this.saoMaterial=new a.ShaderMaterial({defines:Object.assign({},i.default.defines),fragmentShader:i.default.fragmentShader,vertexShader:i.default.vertexShader,uniforms:a.UniformsUtils.clone(i.default.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=a.NoBlending,void 0===o.default&&console.error("THREE.SAOPass relies on THREE.DepthLimitedBlurShader"),this.vBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=a.NoBlending,this.hBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=a.NoBlending,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.CopyShader"),this.materialCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(s.default.uniforms),vertexShader:s.default.vertexShader,fragmentShader:s.default.fragmentShader,blending:a.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=a.CustomBlending,this.materialCopy.blendSrc=a.DstColorFactor,this.materialCopy.blendDst=a.ZeroFactor,this.materialCopy.blendEquation=a.AddEquation,this.materialCopy.blendSrcAlpha=a.DstAlphaFactor,this.materialCopy.blendDstAlpha=a.ZeroFactor,this.materialCopy.blendEquationAlpha=a.AddEquation,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.UnpackDepthRGBAShader"),this.depthCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(l.default.uniforms),vertexShader:l.default.vertexShader,fragmentShader:l.default.fragmentShader,blending:a.NoBlending}),this.quadCamera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.quadScene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quadScene.add(this.quad)};f.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},f.prototype=Object.assign(Object.create(n.default.prototype),{constructor:f,render:function(e,t,r,n,i){if(this.renderToScreen&&(this.materialCopy.blending=a.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,e.clearTarget(this.depthRenderTarget),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(u.default.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(0,1)),u.default.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.render(this.scene,this.camera,this.beautyRenderTarget,!0),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var l=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,l=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?l.blending=a.CustomBlending:l.blending=a.NoBlending,this.renderPass(e,l,this.renderToScreen?null:r),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}},renderPass:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.quad.material=t,e.render(this.quadScene,this.quadCamera,r,l),e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},renderOverride:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1,a=t.clearColor||a,n=t.clearAlpha||n;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.scene.overrideMaterial=t,e.render(this.scene,this.camera,r,l),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}}),t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){n.default.call(this),void 0===i.default&&console.error("THREE.SavePass relies on THREE.CopyShader");var t=i.default;this.textureID="tDiffuse",this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new a.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBFormat,stencilBuffer:!1}),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,e.render(this.scene,this.camera,this.renderTarget,this.clear)}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(23));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),this.edgesRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var r=new Image;r.src=this.getAreaTexture(),this.areaTexture=new a.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=a.RGBFormat,this.areaTexture.minFilter=a.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.needsUpdate=!0,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),this.searchTexture=new a.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=a.NearestFilter,this.searchTexture.minFilter=a.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.needsUpdate=!0,this.searchTexture.flipY=!1,void 0===i.default&&console.error("THREE.SMAAPass relies on THREE.SMAAShader"),this.uniformsEdges=a.UniformsUtils.clone(i.default[0].uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new a.ShaderMaterial({defines:Object.assign({},i.default[0].defines),uniforms:this.uniformsEdges,vertexShader:i.default[0].vertexShader,fragmentShader:i.default[0].fragmentShader}),this.uniformsWeights=a.UniformsUtils.clone(i.default[1].uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new a.ShaderMaterial({defines:Object.assign({},i.default[1].defines),uniforms:this.uniformsWeights,vertexShader:i.default[1].vertexShader,fragmentShader:i.default[1].fragmentShader}),this.uniformsBlend=a.UniformsUtils.clone(i.default[2].uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new a.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:i.default[2].vertexShader,fragmentShader:i.default[2].fragmentShader}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniformsEdges.tDiffuse.value=r.texture,this.quad.material=this.materialEdges,e.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,e.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=r.texture,this.quad.material=this.materialBlend,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUpLjJYNJkM+IRzQ+PQvIeAMTrBS2LEiaiR9b/5PuT6Ap/AcfAFO4Y3dA3DFH7/VS+M8k4baEAQfMI4QfbVDDGIRg7GKaIY52qAjTAgTvGBAPGIIghOCYAUrGFNgzA7Q3QhgCwfwAnw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HFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(3)),i=o(r(25));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){if(void 0===i.default)return console.warn("THREE.SSAOPass depends on THREE.SSAOShader"),new n.default;n.default.call(this,i.default),this.width=void 0!==r?r:512,this.height=void 0!==o?o:256,this.renderToScreen=!1,this.camera2=t,this.scene2=e,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.depthRenderTarget=new a.WebGLRenderTarget(this.width,this.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter}),this.uniforms.tDepth.value=this.depthRenderTarget.texture,this.uniforms.size.value.set(this.width,this.height),this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far,this.uniforms.radius.value=4,this.uniforms.onlyAO.value=!1,this.uniforms.aoClamp.value=.25,this.uniforms.lumInfluence.value=.7;Object.defineProperties(this,{radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},onlyAO:{get:function(){return this.uniforms.onlyAO.value},set:function(e){this.uniforms.onlyAO.value=e}},aoClamp:{get:function(){return this.uniforms.aoClamp.value},set:function(e){this.uniforms.aoClamp.value=e}},lumInfluence:{get:function(){return this.uniforms.lumInfluence.value},set:function(e){this.uniforms.lumInfluence.value=e}}})};(s.prototype=Object.create(n.default.prototype)).render=function(e,t,r,a,i){this.scene2.overrideMaterial=this.depthMaterial,e.render(this.scene2,this.camera2,this.depthRenderTarget,!0),this.scene2.overrideMaterial=null,n.default.prototype.render.call(this,e,t,r,a,i)},s.prototype.setScene=function(e){this.scene2=e},s.prototype.setCamera=function(e){this.camera2=e,this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far},s.prototype.setSize=function(e,t){this.width=e,this.height=t,this.uniforms.size.value.set(this.width,this.height),this.depthRenderTarget.setSize(this.width,this.height)},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(24),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t,r){void 0===o.default&&console.error("THREE.TAARenderPass relies on THREE.SSAARenderPass"),o.default.call(this,e,t,r),this.sampleLevel=0,this.accumulate=!1};s.JitterVectors=o.default.JitterVectors,s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a){if(!this.accumulate)return o.default.prototype.render.call(this,e,t,r,a),void(this.accumulateIndex=-1);var i=s.JitterVectors[5];this.sampleRenderTarget||(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),this.holdRenderTarget||(this.holdRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.holdRenderTarget.texture.name="TAARenderPass.hold"),this.accumulate&&-1===this.accumulateIndex&&(o.default.prototype.render.call(this,e,this.holdRenderTarget,r,a),this.accumulateIndex=0);var l=e.autoClear;e.autoClear=!1;var u=1/i.length;if(this.accumulateIndex>=0&&this.accumulateIndex=i.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}var h=this.accumulateIndex*u;h>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.render(this.scene2,this.camera2,t,!0)),h<1&&(this.copyUniforms.opacity.value=1-h,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.render(this.scene2,this.camera2,t,0===h)),e.autoClear=l}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),void 0===i.default&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=i.default;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=a.UniformsUtils.clone(r.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){var i=e.autoClear;e.autoClear=!1,this.quad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),e.autoClear=i}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=s(r(1)),i=s(r(2)),o=s(r(26));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e,t,r,s){n.default.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=s,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);var l={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var u=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new a.WebGLRenderTarget(u,c,l),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var f=0;f\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new a.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),l.BlurDirectionX=new a.Vector2(1,0),l.BlurDirectionY=new a.Vector2(0,1),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaterRefractionShader=t.VignetteShader=t.VerticalTiltShiftShader=t.VerticalBlurShader=t.UnpackDepthRGBAShader=t.TriangleBlurShader=t.ToneMapShader=t.TechnicolorShader=t.SSAOShader=t.SobelOperatorShader=t.SMAAShader=t.SepiaShader=t.SAOShader=t.RGBShiftShader=t.PixelShader=t.ParallaxShader=t.NormalMapShader=t.MirrorShader=t.LuminosityShader=t.LuminosityHighPassShader=t.KaleidoShader=t.HueSaturationShader=t.HorizontalTiltShiftShader=t.HorizontalBlurShader=t.HalftoneShader=t.GammaCorrectionShader=t.FXAAShader=t.FresnelShader=t.FreiChenShader=t.FocusShader=t.FilmShader=t.DotScreenShader=t.DOFMipMapShader=t.DigitalGlitch=t.DepthLimitedBlurShader=t.CopyShader=t.ConvolutionShader=t.ColorifyShader=t.ColorCorrectionShader=t.BrightnessContrastShader=t.BokehShader2=t.BokehShader=t.BlurShaderUtils=t.BlendShader=t.BleachBypassShader=t.BasicShader=void 0;var a=Q(r(113)),n=Q(r(114)),i=Q(r(115)),o=Q(r(22)),s=Q(r(14)),l=Q(r(116)),u=Q(r(117)),c=Q(r(118)),f=Q(r(119)),d=Q(r(13)),h=Q(r(2)),p=Q(r(20)),m=Q(r(17)),v=Q(r(120)),g=Q(r(15)),y=Q(r(16)),b=Q(r(121)),w=Q(r(122)),x=Q(r(123)),_=Q(r(124)),A=Q(r(125)),E=Q(r(18)),S=Q(r(126)),M=Q(r(127)),T=Q(r(128)),P=Q(r(129)),F=Q(r(26)),O=Q(r(11)),L=Q(r(130)),C=Q(r(131)),k=(Q(r(132)),Q(r(133))),R=Q(r(134)),I=Q(r(135)),N=Q(r(19)),D=Q(r(136)),U=Q(r(23)),j=Q(r(137)),B=Q(r(25)),V=Q(r(138)),z=Q(r(12)),G=Q(r(139)),H=Q(r(21)),X=Q(r(140)),Y=Q(r(141)),W=Q(r(142)),q=Q(r(143));function Q(e){return e&&e.__esModule?e:{default:e}}t.BasicShader=a.default,t.BleachBypassShader=n.default,t.BlendShader=i.default,t.BlurShaderUtils=o.default,t.BokehShader=s.default,t.BokehShader2=l.default,t.BrightnessContrastShader=u.default,t.ColorCorrectionShader=c.default,t.ColorifyShader=f.default,t.ConvolutionShader=d.default,t.CopyShader=h.default,t.DepthLimitedBlurShader=p.default,t.DigitalGlitch=m.default,t.DOFMipMapShader=v.default,t.DotScreenShader=g.default,t.FilmShader=y.default,t.FocusShader=b.default,t.FreiChenShader=w.default,t.FresnelShader=x.default,t.FXAAShader=_.default,t.GammaCorrectionShader=A.default,t.HalftoneShader=E.default,t.HorizontalBlurShader=S.default,t.HorizontalTiltShiftShader=M.default,t.HueSaturationShader=T.default,t.KaleidoShader=P.default,t.LuminosityHighPassShader=F.default,t.LuminosityShader=O.default,t.MirrorShader=L.default,t.NormalMapShader=C.default,t.ParallaxShader=k.default,t.PixelShader=R.default,t.RGBShiftShader=I.default,t.SAOShader=N.default,t.SepiaShader=D.default,t.SMAAShader=U.default,t.SobelOperatorShader=j.default,t.SSAOShader=B.default,t.TechnicolorShader=V.default,t.ToneMapShader=z.default,t.TriangleBlurShader=G.default,t.UnpackDepthRGBAShader=H.default,t.VerticalBlurShader=X.default,t.VerticalTiltShiftShader=Y.default,t.VignetteShader=W.default,t.WaterRefractionShader=q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","vec4 texel1 = texture2D( tDiffuse1, vUv );","vec4 texel2 = texture2D( tDiffuse2, vUv );","gl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float penta(vec2 coords) {","//pentagonal shape","float scale = float(rings) - 1.3;","vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","vec4 one = vec4( 1.0 );","vec4 P = vec4((coords),vec2(scale, scale));","vec4 dist = vec4(0.0);","float inorout = -4.0;","dist.x = dot( P, HS0 );","dist.y = dot( P, HS1 );","dist.z = dot( P, HS2 );","dist.w = dot( P, HS3 );","dist = smoothstep( -feather, feather, dist );","inorout += dot( dist, one );","dist.x = dot( P, HS4 );","dist.y = HS5.w - abs( P.z );","dist = smoothstep( -feather, feather, dist );","inorout += dist.x;","return clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","// Depth buffer blur","float d = 0.0;","float kernel[9];","vec2 offset[9];","vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","offset[0] = vec2(-wh.x,-wh.y);","offset[1] = vec2( 0.0, -wh.y);","offset[2] = vec2( wh.x -wh.y);","offset[3] = vec2(-wh.x, 0.0);","offset[4] = vec2( 0.0, 0.0);","offset[5] = vec2( wh.x, 0.0);","offset[6] = vec2(-wh.x, wh.y);","offset[7] = vec2( 0.0, wh.y);","offset[8] = vec2( wh.x, wh.y);","kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","for( int i=0; i<9; i++ ) {","float tmp = getDepth( coords + offset[ i ] );","d += tmp * kernel[i];","}","return d;","}","vec3 color(vec2 coords,float blur) {","//processing the sample","vec3 col = vec3(0.0);","vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","vec3 lumcoeff = vec3(0.299,0.587,0.114);","float lum = dot(col.rgb, lumcoeff);","float thresh = max((lum-threshold)*gain, 0.0);","return col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","float edge = 0.002*depth; //distance based edge smoothing","float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","return col;","}","float linearize(float depth) {","return -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","float dist = distance(vUv.xy, vec2(0.5,0.5));","dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","return clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","float rings2 = float(rings);","float step = PI*2.0 / float(ringsamples);","float pw = cos(j*step)*i;","float ph = sin(j*step)*i;","float p = 1.0;","if (pentagon) {","p = penta(vec2(pw,ph));","}","col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","return 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","//scene depth calculation","float depth = linearize( getDepth( vUv.xy ) );","// Blur depth?","if (depthblur) {","depth = linearize(bdepth(vUv.xy));","}","//focal plane calculation","float fDepth = focalDepth;","if (shaderFocus) {","fDepth = linearize( getDepth( focusCoords ) );","}","// dof blur factor calculation","float blur = 0.0;","if (manualdof) {","float a = depth-fDepth; // Focal plane","float b = (a-fdofstart)/fdofdist; // Far DoF","float c = (-a-ndofstart)/ndofdist; // Near Dof","blur = (a>0.0) ? b : c;","} else {","float f = focalLength; // focal length in mm","float d = fDepth*1000.0; // focal plane in mm","float o = depth*1000.0; // depth in mm","float a = (o*f)/(o-f);","float b = (d*f)/(d-f);","float c = (d-f)/(d*fstop*CoC);","blur = abs(a-b)*c;","}","blur = clamp(blur,0.0,1.0);","// calculation of pattern for dithering","vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","// getting blur x and y step factor","float w = (1.0/textureWidth)*blur*maxblur+noise.x;","float h = (1.0/textureHeight)*blur*maxblur+noise.y;","// calculation of final color","vec3 col = vec3(0.0);","if(blur < 0.05) {","//some optimization thingy","col = texture2D(tColor, vUv.xy).rgb;","} else {","col = texture2D(tColor, vUv.xy).rgb;","float s = 1.0;","int ringsamples;","for (int i = 1; i <= rings; i++) {","/*unboxstart*/","ringsamples = i * samples;","for (int j = 0 ; j < maxringsamples ; j++) {","if (j >= ringsamples) break;","s += gather(float(i), float(j), ringsamples, col, w, h, blur);","}","/*unboxend*/","}","col /= s; //divide by sample count","}","if (showFocus) {","col = debugFocus(col, blur, depth);","}","if (vignetting) {","col *= vignette();","}","gl_FragColor.rgb = col;","gl_FragColor.a = 1.0;","} "].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},powRGB:{value:new a.Vector3(2,2,2)},mulRGB:{value:new a.Vector3(1,1,1)},addRGB:{value:new a.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},color:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},aspect:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","G[0] = g0,","G[1] = g1,","G[2] = g2,","G[3] = g3,","G[4] = g4,","G[5] = g5,","G[6] = g6,","G[7] = g7,","G[8] = g8;","mat3 I;","float cnv[9];","vec3 sample;","for (float i=0.0; i<3.0; i++) {","for (float j=0.0; j<3.0; j++) {","sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","I[int(i)][int(j)] = length(sample);","}","}","for (int i=0; i<9; i++) {","float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","cnv[i] = dp3 * dp3;","}","float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","vec3 I = worldPosition.xyz - cameraPosition;","vReflect = reflect( I, worldNormal );","vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","vec4 refractedColor = vec4( 1.0 );","refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immedates."," // Immedates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","gl_FragColor = LinearToGamma( tex, float( GAMMA_FACTOR ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 p = vUv - 0.5;","float r = length(p);","float a = atan(p.y, p.x) + angle;","float tau = 2. * 3.1416 ;","a = mod(a, tau/sides);","a = abs(a - tau/sides/2.) ;","p = r * vec2(cos(a), sin(a));","vec4 color = texture2D(tDiffuse, p + 0.5);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","vec2 p = vUv;","if (side == 0){","if (p.x > 0.5) p.x = 1.0 - p.x;","}else if (side == 1){","if (p.x < 0.5) p.x = 1.0 - p.x;","}else if (side == 2){","if (p.y < 0.5) p.y = 1.0 - p.y;","}else if (side == 3){","if (p.y > 0.5) p.y = 1.0 - p.y;","} ","vec4 color = texture2D(tDiffuse, p);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{heightMap:{value:null},resolution:{value:new a.Vector2(512,512)},scale:{value:new a.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));a.ShaderLib.ocean_sim_vertex={vertexShader:["varying vec2 vUV;","void main (void) {","vUV = position.xy * 0.5 + 0.5;","gl_Position = vec4(position, 1.0 );","}"].join("\n")},a.ShaderLib.ocean_subtransform={uniforms:{u_input:{value:null},u_transformSize:{value:512},u_subtransformSize:{value:250}},fragmentShader:["precision highp float;","#include ","uniform sampler2D u_input;","uniform float u_transformSize;","uniform float u_subtransformSize;","varying vec2 vUV;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","void main (void) {","#ifdef HORIZONTAL","float index = vUV.x * u_transformSize - 0.5;","#else","float index = vUV.y * u_transformSize - 0.5;","#endif","float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);","#ifdef HORIZONTAL","vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","#else","vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;","#endif","float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);","vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));","vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);","vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);","gl_FragColor = vec4(outputA, outputB);","}"].join("\n")},a.ShaderLib.ocean_initial_spectrum={uniforms:{u_wind:{value:new a.Vector2(10,10)},u_resolution:{value:512},u_size:{value:250}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","const float CM = 0.23;","uniform vec2 u_wind;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + pow2(k / KM)));","}","float tanh (float x) {","return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 K = (2.0 * PI * vec2(n, m)) / u_size;","float k = length(K);","float l_wind = length(u_wind);","float Omega = 0.84;","float kp = G * pow2(Omega / l_wind);","float c = omega(k) / k;","float cp = omega(kp) / kp;","float Lpm = exp(-1.25 * pow2(kp / k));","float gamma = 1.7;","float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));","float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));","float Jp = pow(gamma, Gamma);","float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));","float alphap = 0.006 * sqrt(Omega);","float Bl = 0.5 * alphap * cp / c * Fp;","float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);","float uStar = 0.41 * l_wind / log(10.0 / z0);","float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));","float Fm = exp(-0.25 * pow2(k / KM - 1.0));","float Bh = 0.5 * alpham * CM / c * Fm * Lpm;","float a0 = log(2.0) / 4.0;","float am = 0.13 * uStar / CM;","float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));","float cosPhi = dot(normalize(u_wind), normalize(K));","float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));","float dk = 2.0 * PI / u_size;","float h = sqrt(S / 2.0) * dk;","if (K.x == 0.0 && K.y == 0.0) {","h = 0.0;","}","gl_FragColor = vec4(h, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_phase={uniforms:{u_phases:{value:null},u_deltaTime:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform sampler2D u_phases;","uniform float u_deltaTime;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","float deltaTime = 1.0 / 60.0;","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","float deltaPhase = omega(length(waveVector)) * u_deltaTime;","phase = mod(phase + deltaPhase, 2.0 * PI);","gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_spectrum={uniforms:{u_size:{value:null},u_resolution:{value:null},u_choppiness:{value:null},u_phases:{value:null},u_initialSpectrum:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform float u_size;","uniform float u_resolution;","uniform float u_choppiness;","uniform sampler2D u_phases;","uniform sampler2D u_initialSpectrum;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","vec2 multiplyByI (vec2 z) {","return vec2(-z[1], z[0]);","}","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","vec2 phaseVector = vec2(cos(phase), sin(phase));","vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;","vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;","h0Star.y *= -1.0;","vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));","vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;","vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;","if (waveVector.x == 0.0 && waveVector.y == 0.0) {","h = vec2(0.0);","hX = vec2(0.0);","hZ = vec2(0.0);","}","gl_FragColor = vec4(hX + multiplyByI(h), hZ);","}"].join("\n")},a.ShaderLib.ocean_normals={uniforms:{u_displacementMap:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform float u_resolution;","uniform float u_size;","void main (void) {","float texel = 1.0 / u_resolution;","float texelSize = u_size / u_resolution;","vec3 center = texture2D(u_displacementMap, vUV).rgb;","vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;","vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;","vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;","vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;","vec3 topRight = cross(right, top);","vec3 topLeft = cross(top, left);","vec3 bottomLeft = cross(left, bottom);","vec3 bottomRight = cross(bottom, right);","gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);","}"].join("\n")},a.ShaderLib.ocean_main={uniforms:{u_displacementMap:{value:null},u_normalMap:{value:null},u_geometrySize:{value:null},u_size:{value:null},u_projectionMatrix:{value:null},u_viewMatrix:{value:null},u_cameraPosition:{value:null},u_skyColor:{value:null},u_oceanColor:{value:null},u_sunDirection:{value:null},u_exposure:{value:null}},vertexShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform mat4 u_projectionMatrix;","uniform mat4 u_viewMatrix;","uniform float u_size;","uniform float u_geometrySize;","uniform sampler2D u_displacementMap;","void main (void) {","vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);","vPos = newPos;","vUV = uv;","gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);","}"].join("\n"),fragmentShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform sampler2D u_normalMap;","uniform vec3 u_cameraPosition;","uniform vec3 u_oceanColor;","uniform vec3 u_skyColor;","uniform vec3 u_sunDirection;","uniform float u_exposure;","vec3 hdr (vec3 color, float exposure) {","return 1.0 - exp(-color * exposure);","}","void main (void) {","vec3 normal = texture2D(u_normalMap, vUV).rgb;","vec3 view = normalize(u_cameraPosition - vPos);","float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);","vec3 sky = fresnel * u_skyColor;","float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);","vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;","vec3 color = sky + water;","gl_FragColor = vec4(hdr(color, u_exposure), 1.0);","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","vUv = uv;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vViewPosition = -mvPosition.xyz;","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","vec2 parallaxMap( in vec3 V ) {","float initialHeight = texture2D( bumpMap, vUv ).r;","vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","return vUv - texCoordOffset;","}","#else","vec2 parallaxMap( in vec3 V ) {","float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","float layerHeight = 1.0 / numLayers;","float currentLayerHeight = 0.0;","vec2 dtex = parallaxScale * V.xy / V.z / numLayers;","vec2 currentTextureCoords = vUv;","float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","for ( int i = 0; i < 30; i += 1 ) {","if ( heightFromTexture <= currentLayerHeight ) {","break;","}","currentLayerHeight += layerHeight;","currentTextureCoords -= dtex;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","}","#ifdef USE_STEEP_PARALLAX","return currentTextureCoords;","#elif defined( USE_RELIEF_PARALLAX )","vec2 deltaTexCoord = dtex / 2.0;","float deltaHeight = layerHeight / 2.0;","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","const int numSearches = 5;","for ( int i = 0; i < numSearches; i += 1 ) {","deltaTexCoord /= 2.0;","deltaHeight /= 2.0;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","if( heightFromTexture > currentLayerHeight ) {","currentTextureCoords -= deltaTexCoord;","currentLayerHeight += deltaHeight;","} else {","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","}","}","return currentTextureCoords;","#elif defined( USE_OCLUSION_PARALLAX )","vec2 prevTCoords = currentTextureCoords + dtex;","float nextH = heightFromTexture - currentLayerHeight;","float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","float weight = nextH / ( nextH - prevH );","return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","#else","return vUv;","#endif","}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","vec2 texDx = dFdx( vUv );","vec2 texDy = dFdy( vUv );","vec3 vSigmaX = dFdx( surfPosition );","vec3 vSigmaY = dFdy( surfPosition );","vec3 vR1 = cross( vSigmaY, surfNormal );","vec3 vR2 = cross( surfNormal, vSigmaX );","float fDet = dot( vSigmaX, vR1 );","vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","vec3 vProjVtex;","vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","vProjVtex.z = dot( surfNormal, viewPosition );","return parallaxMap( vProjVtex );","}","void main() {","vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","gl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, vUv + offset);","vec4 cga = texture2D(tDiffuse, vUv);","vec4 cb = texture2D(tDiffuse, vUv - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","gl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","gl_FragColor = newTex;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{texture:{value:null},delta:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = rand( vUv );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{color:{type:"c",value:null},time:{type:"f",value:0},tDiffuse:{type:"t",value:null},tDudv:{type:"t",value:null},textureMatrix:{type:"m4",value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Volume=void 0;var a,n=r(10),i=(a=n)&&a.__esModule?a:{default:a};t.Volume=i.default}]))},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,a,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,a)}));case 4:return t.nextTick((function(){e.call(null,r,a,n)}));default:for(i=new Array(s-1),o=0;o>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return n>0&&(e.lastNeed=n-1),n;if(--a=0)return n>0&&(e.lastNeed=n-2),n;if(--a=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";(function(t){var a=r(121); /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */function n(e,t){if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);n=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(e[s],t[s],r,a))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function x(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,a){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(a=r,r=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),a=(r&&r.name?" ("+r.name+").":".")+(a?" "+a:"."),e&&!n&&g(n,r,"Missing expected exception"+a);var i="string"==typeof a,s=!e&&n&&!r;if((!e&&o.isError(n)&&i&&x(n,r)||s)&&g(n,r,"Got unwanted exception"+a),e&&n&&r&&!x(n,r)||!e&&n)throw n}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(v(e.actual),128)+" "+e.operator+" "+m(v(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var a=r.stack,n=p(t),i=a.indexOf("\n"+n);if(i>=0){var o=a.indexOf("\n",i+1);a=a.substring(o+1)}this.stack=a}}},o.inherits(d.AssertionError,Error),d.fail=g,d.ok=y,d.equal=function(e,t,r){e!=t&&g(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){b(e,t,!1)||g(e,t,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,r){b(e,t,!0)||g(e,t,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,r){b(e,t,!1)&&g(e,t,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,r,a){b(t,r,!0)&&g(t,r,a,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",d.notStrictEqual)},d.throws=function(e,t,r){_(!0,e,t,r)},d.doesNotThrow=function(e,t,r){_(!1,e,t,r)},d.ifError=function(e){if(e)throw e},d.strict=a((function e(t,r){t||g(t,!0,r,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var A=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(31);Object.defineProperty(t,"CopyShader",{enumerable:!0,get:function(){return h(a).default}});var n=r(10);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return h(n).default}});var i=r(45);Object.defineProperty(t,"ShaderPass",{enumerable:!0,get:function(){return h(i).default}});var o=r(80);Object.defineProperty(t,"RenderingPass",{enumerable:!0,get:function(){return h(o).default}});var s=r(81);Object.defineProperty(t,"TexturePass",{enumerable:!0,get:function(){return h(s).default}});var l=r(82);Object.defineProperty(t,"RenderPass",{enumerable:!0,get:function(){return h(l).default}});var u=r(46);Object.defineProperty(t,"MaskPass",{enumerable:!0,get:function(){return h(u).default}});var c=r(47);Object.defineProperty(t,"ClearMaskPass",{enumerable:!0,get:function(){return h(c).default}});var f=r(83);Object.defineProperty(t,"ClearPass",{enumerable:!0,get:function(){return h(f).default}});var d=r(84);function h(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h(d).default}})},function(e,t,r){var a,n,i,o,s;a=r(181),n=r(76).utf8,i=r(182),o=r(76).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):n.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var r=a.bytesToWords(e),l=8*e.length,u=1732584193,c=-271733879,f=-1732584194,d=271733878,h=0;h>>24)|4278255360&(r[h]<<24|r[h]>>>8);r[l>>>5]|=128<>>9<<4)]=l;var p=s._ff,m=s._gg,v=s._hh,g=s._ii;for(h=0;h>>0,c=c+b>>>0,f=f+w>>>0,d=d+x>>>0}return a.endian([u,c,f,d])})._ff=function(e,t,r,a,n,i,o){var s=e+(t&r|~t&a)+(n>>>0)+o;return(s<>>32-i)+t},s._gg=function(e,t,r,a,n,i,o){var s=e+(t&a|r&~a)+(n>>>0)+o;return(s<>>32-i)+t},s._hh=function(e,t,r,a,n,i,o){var s=e+(t^r^a)+(n>>>0)+o;return(s<>>32-i)+t},s._ii=function(e,t,r,a,n,i,o){var s=e+(r^(t|~a))+(n>>>0)+o;return(s<>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=a.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?o.bytesToString(r):a.bytesToHex(r)}},function(e,t,r){function a(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var a=r(r.s=ENTRY_MODULE);return a.default||a}var n="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+n+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e,t,a){var s={};s[a]=[];var l=t.toString(),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return s;for(var c,f=u[1],d=new RegExp("(\\\\n|\\W)"+o(f)+i,"g");c=d.exec(l);)"dll-reference"!==c[3]&&s[a].push(c[3]);for(d=new RegExp("\\("+o(f)+'\\("(dll-reference\\s('+n+'))"\\)\\)'+i,"g");c=d.exec(l);)e[c[2]]||(s[a].push(c[1]),e[c[2]]=r(c[1]).m),s[c[2]]=s[c[2]]||[],s[c[2]].push(c[4]);for(var h,p=Object.keys(s),m=0;m0}),!1)}e.exports=function(e,t){t=t||{};var n={main:r.m},i=t.all?{main:Object.keys(n.main)}:function(e,t){for(var r={main:[t]},a={main:[]},n={main:{}};l(r);)for(var i=Object.keys(r),o=0;o-1?a:i.nextTick;y.WritableState=g;var u=r(19);u.inherits=r(6);var c={deprecate:r(57)},f=r(55),d=r(25).Buffer,h=n.Uint8Array||function(){};var p,m=r(56);function v(){}function g(e,t){s=s||r(13),e=e||{};var a=t instanceof s;this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:a&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,a=r.sync,n=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,a,n){--t.pendingcb,r?(i.nextTick(n,a),i.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",a)):(n(a),e._writableState.errorEmitted=!0,e.emit("error",a),E(e,t))}(e,r,a,t,n);else{var o=_(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),a?l(w,e,r,o,n):w(e,r,o,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(s=s||r(13),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,r,a,n,i,o){t.writelen=a,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,i,t.onwrite),t.sync=!1}function w(e,t,r,a){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,a(),E(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var a=t.bufferedRequestCount,n=new Array(a),i=t.corkedRequestsFree;i.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,b(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),E(e,t)}))}function E(e,t){var r=_(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(A,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(y,f),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var a,n=this._writableState,o=!1,s=!n.objectMode&&(a=e,d.isBuffer(a)||a instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}(this,r):(s||function(e,t,r,a){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),i.nextTick(a,o),n=!1),n}(this,n,e,r))&&(n.pendingcb++,o=function(e,t,r,a,n,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,a,n);a!==o&&(r=!0,n="buffer",a=o)}var s=t.objectMode?1:a.length;t.length+=s;var l=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var a=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||a.finished||function(e,t,r){t.ending=!0,E(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,a,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(5),r(110).setImmediate,r(4))},function(e,t,r){"use strict";var a=r(129),n=r(38),i=r(15),o=r(60),s=r(131);function l(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof o)return p(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var n,i,s,c=u.call(this,t,r);return c&&(n=c.schema,t=c.root,s=c.baseId),n instanceof o?i=n.validate||e.call(this,n.schema,t,void 0,s):void 0!==n&&(i=p(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,s)),i}function u(e,t){var r=a.parse(t),n=v(r),i=m(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==i){var s=y(n),l=this._refs[s];if("string"==typeof l)return c.call(this,e,l,r);if(l instanceof o)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[s])instanceof o))return;if(l.validate||this._compile(l),s==y(t))return{schema:l,root:e,baseId:i};e=l}if(!e.schema)return;i=m(this._getId(e.schema))}return d.call(this,r,i,e.schema,e)}function c(e,t,r){var a=u.call(this,e,t);if(a){var n=a.schema,i=a.baseId;e=a.root;var o=this._getId(n);return o&&(i=b(i,o)),d.call(this,r,i,n,e)}}e.exports=l,l.normalizeId=y,l.fullPath=m,l.url=b,l.ids=function(e){var t=y(this._getId(e)),r={"":t},o={"":m(t,!1)},l={},u=this;return s(e,{allKeys:!0},(function(e,t,s,c,f,d,h){if(""!==t){var p=u._getId(e),m=r[c],v=o[c]+"/"+f;if(void 0!==h&&(v+="/"+("number"==typeof h?h:i.escapeFragment(h))),"string"==typeof p){p=m=y(m?a.resolve(m,p):p);var g=u._refs[p];if("string"==typeof g&&(g=u._refs[g]),g&&g.schema){if(!n(e,g.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=y(v))if("#"==p[0]){if(l[p]&&!n(e,l[p]))throw new Error('id "'+p+'" resolves to more than one schema');l[p]=e}else u._refs[p]=v}r[t]=m,o[t]=v}})),l},l.inlineRef=p,l.schema=u;var f=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var n=e.fragment.split("/"),o=1;o{if(e.file){let r=new FileReader;r.onload=function(){let e=this.result,r=new Uint8Array(e);t(r)},r.readAsArrayBuffer(e.file)}else if(e.url){let r=new XMLHttpRequest;r.open("GET",e.url,!0),r.responseType="arraybuffer",r.onloadend=function(){if(200===r.status){let e=new Uint8Array(r.response||r.responseText);t(e)}},r.send()}else e.raw?e.raw instanceof Uint8Array?t(e.raw):t(new Uint8Array(e.raw)):r()})}function o(e,t){return new Promise((r,a)=>{if("compound"===e.type)if(e.value.hasOwnProperty("blocks")&&(e.value.hasOwnProperty("palette")||e.value.hasOwnProperty("palettes"))){let a;if(e.value.hasOwnProperty("palette"))a=e.value.palette.value.value;else{if(void 0===t&&(t=0),t>=e.value.palettes.value.value.length||!e.value.palettes.value.value[t])return void console.warn("Specified palette index ("+t+") is outside of available palettes ("+e.value.palettes.value.value.length+")");a=e.value.palettes.value.value[t].value}let n=[];for(let e=0;e{let n=e.value.Width.value,i=e.value.Height.value,o=e.value.Length.value,s=function(t,r,a){let i=(r*o+a)*n+t;return{id:255&(e.value.Blocks.value[i]||0),data:e.value.Data.value[i]||0}},l=function(e,r){let a=t.blocks[e+":"+r];return a||(console.warn("Missing legacy mapping for "+e+":"+r),"minecraft:air")},u=[];for(let e=0;e{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);o(r).then(e=>{t(e)})})})},n.prototype.schematicToModels=function(e,t){i(e).then(e=>{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);let a=new XMLHttpRequest;a.open("GET","https://minerender.org/res/idsToNames.json",!0),a.onloadend=function(){if(200===a.status){console.log(a.response||a.responseText);let e=JSON.parse(a.response||a.responseText);s(r,e).then(e=>t(e))}},a.send()})})},n.loadNBT=i,n.parseStructureData=o,n.parseSchematicData=s;let l={stained_glass:function(e){return e.color.value+"_stained_glass"},planks:function(e){return e.variant.value+"_planks"}};n.prototype.constructor=n,window.ModelConverter=n,t.a=n},function(e,t,r){const a=r(103),n=r(120).ProtoDef,i=r(179).compound,o=JSON.stringify(r(180)),s=o.replace(/(i[0-9]+)/g,"l$1");function l(e){const t=new n;return t.addType("compound",i),t.addTypes(JSON.parse(e?s:o)),t}const u=l(!1),c=l(!0);function f(e,t){return(t?c:u).parsePacketBuffer("nbt",e).data}const d=function(e){let t=!0;return 31!==e[0]&&(t=!1),139!==e[1]&&(t=!1),t};e.exports={writeUncompressed:function(e,t){return(t?c:u).createPacketBuffer("nbt",e)},parseUncompressed:f,simplify:function e(t){return function t(r,a){return"compound"===a?Object.keys(r).reduce((function(t,a){return t[a]=e(r[a]),t}),{}):"list"===a?r.value.map((function(e){return t(e,r.type)})):r}(t.value,t.type)},parse:function(e,t,r){let n=!1;"function"==typeof t?r=t:n=t,d(e)?a.gunzip(e,(function(t,a){t?r(t,e):r(null,f(a,n))})):r(null,f(e,n))},proto:u,protoLE:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(){function e(e,t){for(var r=0;r4?9:0)}function $(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ae(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ne(e,t){var r,a,n=e.max_chain_length,i=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-D?e.strstart-(e.w_size-D):0,u=e.window,c=e.w_mask,f=e.prev,d=e.strstart+N,h=u[i+o-1],p=u[i+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===h&&u[r]===u[i]&&u[++r]===u[i+1]){i+=2,r++;do{}while(u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&io){if(e.match_start=t,o=a,a>=s)break;h=u[i+o-1],p=u[i+o]}}}while((t=f[t&c])>l&&0!=--n);return o<=e.lookahead?o:e.lookahead}function ie(e){var t,r,a,i,l,u,c,f,d,h,p=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-D)){n.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;do{a=e.head[--t],e.head[t]=a>=p?a-p:0}while(--r);t=r=p;do{a=e.prev[--t],e.prev[t]=a>=p?a-p:0}while(--r);i+=p}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,f=e.strstart+e.lookahead,d=i,h=void 0,(h=u.avail_in)>d&&(h=d),r=0===h?0:(u.avail_in-=h,n.arraySet(c,u.input,u.next_in,h,f),1===u.state.wrap?u.adler=o(u.adler,c,h,f):2===u.state.wrap&&(u.adler=s(u.adler,c,h,f)),u.next_in+=h,u.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=I)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I)if(a=i._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-I,a=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<15&&(s=2,a-=16),i<1||i>T||r!==M||a<8||a>15||t<0||t>9||o<0||o>A)return K(e,v);8===a&&(a=9);var l=new ue;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=a,l.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ie(e),0===e.lookahead&&t===u)return Y;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+r;if((0===e.strstart||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,te(e,!1),0===e.strm.avail_out))return Y;if(e.strstart-e.block_start>=e.w_size-D&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),Y)})),new le(4,4,8,4,oe),new le(4,5,16,8,oe),new le(4,6,32,32,oe),new le(4,4,16,16,se),new le(8,16,32,32,se),new le(8,16,128,128,se),new le(8,32,128,256,se),new le(32,128,258,1024,se),new le(32,258,258,4096,se)],t.deflateInit=function(e,t){return de(e,t,M,P,F,E)},t.deflateInit2=de,t.deflateReset=fe,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?v:(e.state.gzhead=t,p):v},t.deflate=function(e,t){var r,n,o,l;if(!e||!e.state||t>h||t<0)return e?K(e,v):v;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===X&&t!==d)return K(e,0===e.avail_out?y:v);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===j)if(2===n.wrap)e.adler=0,re(n,31),re(n,139),re(n,8),n.gzhead?(re(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),re(n,255&n.gzhead.time),re(n,n.gzhead.time>>8&255),re(n,n.gzhead.time>>16&255),re(n,n.gzhead.time>>24&255),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(re(n,255&n.gzhead.extra.length),re(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=s(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=B):(re(n,0),re(n,0),re(n,0),re(n,0),re(n,0),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,Z),n.status=H);else{var g=M+(n.w_bits-8<<4)<<8;g|=(n.strategy>=x||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(g|=U),g+=31-g%31,n.status=H,ae(n,g),0!==n.strstart&&(ae(n,e.adler>>>16),ae(n,65535&e.adler)),e.adler=1}if(n.status===B)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending!==n.pending_buf_size));)re(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=V)}else n.status=V;if(n.status===V)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=z)}else n.status=z;if(n.status===z)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=G)}else n.status=G;if(n.status===G&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ee(e),n.pending+2<=n.pending_buf_size&&(re(n,255&e.adler),re(n,e.adler>>8&255),e.adler=0,n.status=H)):n.status=H),0!==n.pending){if(ee(e),0===e.avail_out)return n.last_flush=-1,p}else if(0===e.avail_in&&J(t)<=J(r)&&t!==d)return K(e,y);if(n.status===X&&0!==e.avail_in)return K(e,y);if(0!==e.avail_in||0!==n.lookahead||t!==u&&n.status!==X){var b=n.strategy===x?function(e,t){for(var r;;){if(0===e.lookahead&&(ie(e),0===e.lookahead)){if(t===u)return Y;break}if(e.match_length=0,r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):n.strategy===_?function(e,t){for(var r,a,n,o,s=e.window;;){if(e.lookahead<=N){if(ie(e),e.lookahead<=N&&t===u)return Y;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(a=s[n=e.strstart-1])===s[++n]&&a===s[++n]&&a===s[++n]){o=e.strstart+N;do{}while(a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&ne.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=i._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):a[n.level].func(n,t);if(b!==q&&b!==Q||(n.status=X),b===Y||b===q)return 0===e.avail_out&&(n.last_flush=-1),p;if(b===W&&(t===c?i._tr_align(n):t!==h&&(i._tr_stored_block(n,0,0,!1),t===f&&($(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),ee(e),0===e.avail_out))return n.last_flush=-1,p}return t!==d?p:n.wrap<=0?m:(2===n.wrap?(re(n,255&e.adler),re(n,e.adler>>8&255),re(n,e.adler>>16&255),re(n,e.adler>>24&255),re(n,255&e.total_in),re(n,e.total_in>>8&255),re(n,e.total_in>>16&255),re(n,e.total_in>>24&255)):(ae(n,e.adler>>>16),ae(n,65535&e.adler)),ee(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?p:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==j&&t!==B&&t!==V&&t!==z&&t!==G&&t!==H&&t!==X?K(e,v):(e.state=null,t===H?K(e,g):p):v},t.deflateSetDictionary=function(e,t){var r,a,i,s,l,u,c,f,d=t.length;if(!e||!e.state)return v;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==j||r.lookahead)return v;for(1===s&&(e.adler=o(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&($(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new n.Buf8(r.w_size),n.arraySet(f,t,d-r.w_size,r.w_size,0),t=f,d=r.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,ie(r);r.lookahead>=I;){a=r.strstart,i=r.lookahead-(I-1);do{r.ins_h=(r.ins_h<>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{i=i+(n=n+t[a++]|0)|0}while(--o);n%=65521,i%=65521}return n|i<<16|0}},function(e,t,r){"use strict";var a=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,n){var i=a,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}},function(e,t,r){"use strict";var a=r(11),n=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var o=new a.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&i||!e.subarray&&n))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var r="",o=0;o>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new a.Buf8(e.length),r=0,n=t.length;r4)u[a++]=65533,r+=i-1;else{for(n&=2===i?31:3===i?15:7;i>1&&r1?u[a++]=65533:n<65536?u[a++]=n:(n-=65536,u[a++]=55296|n>>10&1023,u[a++]=56320|1023&n)}return l(u,a)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+o[e[r]]>t?r:t}},function(e,t,r){"use strict";var a=r(11),n=r(49),i=r(50),o=r(100),s=r(101),l=0,u=1,c=2,f=4,d=5,h=6,p=0,m=1,v=2,g=-2,y=-3,b=-4,w=-5,x=8,_=1,A=2,E=3,S=4,M=5,T=6,P=7,F=8,O=9,L=10,C=11,k=12,R=13,I=14,N=15,D=16,U=17,j=18,B=19,V=20,z=21,G=22,H=23,X=24,Y=25,W=26,q=27,Q=28,Z=29,K=30,J=31,$=32,ee=852,te=592,re=15;function ae(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ne(){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 a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(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=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new a.Buf32(ee),t.distcode=t.distdyn=new a.Buf32(te),t.sane=1,t.back=-1,p):g}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):g}function se(e,t){var r,a;return e&&e.state?(a=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?g:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=r,a.wbits=t,oe(e))):g}function le(e,t){var r,a;return e?(a=new ne,e.state=a,a.window=null,(r=se(e,t))!==p&&(e.state=null),r):g}var ue,ce,fe=!0;function de(e){if(fe){var t;for(ue=new a.Buf32(512),ce=new a.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,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,ce,0,e.work,{bits:5}),fe=!1}e.lencode=ue,e.lenbits=9,e.distcode=ce,e.distbits=5}function he(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(a.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),a.arraySet(o.window,t,r-n,i,o.wnext),(n-=i)?(a.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=i(r.check,Te,2,0),se=0,le=0,r.mode=A;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=K;break}if((15&se)!==x){e.msg="unknown compression method",r.mode=K;break}if(le-=4,_e=8+(15&(se>>>=4)),0===r.wbits)r.wbits=_e;else if(_e>r.wbits){e.msg="invalid window size",r.mode=K;break}r.dmax=1<<_e,e.adler=r.check=1,r.mode=512&se?L:k,se=0,le=0;break;case A:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8&1),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=E;case E:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,Te[2]=se>>>16&255,Te[3]=se>>>24&255,r.check=i(r.check,Te,4,0)),se=0,le=0,r.mode=S;case S:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=M;case M:if(1024&r.flags){for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0}else r.head&&(r.head.extra=null);r.mode=T;case T:if(1024&r.flags&&((fe=r.length)>ie&&(fe=ie),fe&&(r.head&&(_e=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),a.arraySet(r.head.extra,ee,re,fe,_e)),512&r.flags&&(r.check=i(r.check,ee,fe,re)),ie-=fe,re+=fe,r.length-=fe),r.length))break e;r.length=0,r.mode=P;case P:if(2048&r.flags){if(0===ie)break e;fe=0;do{_e=ee[re+fe++],r.head&&_e&&r.length<65536&&(r.head.name+=String.fromCharCode(_e))}while(_e&&fe>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=k;break;case L:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>=7&le,le-=7&le,r.mode=q;break}for(;le<3;){if(0===ie)break e;ie--,se+=ee[re++]<>>=1)){case 0:r.mode=I;break;case 1:if(de(r),r.mode=V,t===h){se>>>=2,le-=2;break e}break;case 2:r.mode=U;break;case 3:e.msg="invalid block type",r.mode=K}se>>>=2,le-=2;break;case I:for(se>>>=7&le,le-=7≤le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=K;break}if(r.length=65535&se,se=0,le=0,r.mode=N,t===h)break e;case N:r.mode=D;case D:if(fe=r.length){if(fe>ie&&(fe=ie),fe>oe&&(fe=oe),0===fe)break e;a.arraySet(te,ee,re,fe,ne),ie-=fe,re+=fe,oe-=fe,ne+=fe,r.length-=fe;break}r.mode=k;break;case U:for(;le<14;){if(0===ie)break e;ie--,se+=ee[re++]<>>=5,le-=5,r.ndist=1+(31&se),se>>>=5,le-=5,r.ncode=4+(15&se),se>>>=4,le-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=K;break}r.have=0,r.mode=j;case j:for(;r.have>>=3,le-=3}for(;r.have<19;)r.lens[Pe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},Ae=s(l,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid code lengths set",r.mode=K;break}r.have=0,r.mode=B;case B:for(;r.have>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=ve,le-=ve,r.lens[r.have++]=ye;else{if(16===ye){for(Se=ve+2;le>>=ve,le-=ve,0===r.have){e.msg="invalid bit length repeat",r.mode=K;break}_e=r.lens[r.have-1],fe=3+(3&se),se>>>=2,le-=2}else if(17===ye){for(Se=ve+3;le>>=ve)),se>>>=3,le-=3}else{for(Se=ve+7;le>>=ve)),se>>>=7,le-=7}if(r.have+fe>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=K;break}for(;fe--;)r.lens[r.have++]=_e}}if(r.mode===K)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=K;break}if(r.lenbits=9,Ee={bits:r.lenbits},Ae=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid literal/lengths set",r.mode=K;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},Ae=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,Ae){e.msg="invalid distances set",r.mode=K;break}if(r.mode=V,t===h)break e;case V:r.mode=z;case z:if(ie>=6&&oe>=258){e.next_out=ne,e.avail_out=oe,e.next_in=re,e.avail_in=ie,r.hold=se,r.bits=le,o(e,ce),ne=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,ie=e.avail_in,se=r.hold,le=r.bits,r.mode===k&&(r.back=-1);break}for(r.back=0;ge=(Me=r.lencode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,r.length=ye,0===ge){r.mode=W;break}if(32&ge){r.back=-1,r.mode=k;break}if(64&ge){e.msg="invalid literal/length code",r.mode=K;break}r.extra=15&ge,r.mode=G;case G:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=H;case H:for(;ge=(Me=r.distcode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,64&ge){e.msg="invalid distance code",r.mode=K;break}r.offset=ye,r.extra=15&ge,r.mode=X;case X:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=K;break}r.mode=Y;case Y:if(0===oe)break e;if(fe=ce-oe,r.offset>fe){if((fe=r.offset-fe)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=K;break}fe>r.wnext?(fe-=r.wnext,pe=r.wsize-fe):pe=r.wnext-fe,fe>r.length&&(fe=r.length),me=r.window}else me=te,pe=ne-r.offset,fe=r.length;fe>oe&&(fe=oe),oe-=fe,r.length-=fe;do{te[ne++]=me[pe++]}while(--fe);0===r.length&&(r.mode=z);break;case W:if(0===oe)break e;te[ne++]=r.length,oe--,r.mode=z;break;case q:if(r.wrap){for(;le<32;){if(0===ie)break e;ie--,se|=ee[re++]<0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),a?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?x(e,o,t,!1):M(e,o)):x(e,o,t,!1))):a||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),O(e)}function M(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var a;ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++a}return t.length-=a,n}(e,t):function(e,t){var r=u.allocUnsafe(e),a=t.head,n=1;a.data.copy(r),e-=a.data.length;for(;a=a.next;){var i=a.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++n,a.next?t.head=a.next:t.head=t.tail=null):(t.head=a,a.data=i.slice(o));break}++n}return t.length-=n,r}(e,t);return a}(e,t.buffer,t.decoder),r);var r}function C(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(k,t,e))}function k(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var r=0,a=e.length;r=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):E(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&C(this),null;var a,n=t.needReadable;return h("need readable",n),(0===t.length||t.length-e0?L(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&C(this)),null!==a&&this.emit("data",a),a},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var l=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?c:b;function u(t,a){h("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",v),e.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",b),r.removeListener("data",m),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){h("onend"),e.end()}i.endEmitted?n.nextTick(l):r.once("end",l),e.on("unpipe",u);var f=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",f);var d=!1;var p=!1;function m(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==R(i.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(t){h("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){h("onfinish"),e.removeListener("close",g),b()}function b(){h("unpipe"),r.unpipe(e)}return r.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i=i)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(e){return"[Circular]"}default:return e}})),l=a[r];r=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),p(r)?a.showHidden=r:r&&t._extend(a,r),y(a.showHidden)&&(a.showHidden=!1),y(a.depth)&&(a.depth=2),y(a.colors)&&(a.colors=!1),y(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=l),c(a,e,a.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function c(e,r,a){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(a,e);return g(n)||(n=c(e,n,a)),n}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(A(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return f(r)}var u,w="",E=!1,S=["{","}"];(h(r)&&(E=!0,S=["[","]"]),A(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),x(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+f(r)),0!==o.length||E&&0!=r.length?a<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=E?function(e,t,r,a,n){for(var i=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,w,S)):S[0]+w+S[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,a,n,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),P(a,n)||(o="["+n+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(i&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===E(e)}function _(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function A(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(y(i)&&(i=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var a=e.pid;o[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,a,e)}}else o[r]=function(){};return o[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=b,t.isObject=w,t.isDate=x,t.isError=_,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(119);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(6),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),a=r.length;a--;)e[r[a]]=t[r[a]];return e};var F="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(F&&e[F]){var t;if("function"!=typeof(t=e[F]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,F,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,a=new Promise((function(e,a){t=e,r=a})),n=[],i=0;i",y=h?">":"<",b=void 0;if(v){var w=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+i,_="exclType"+i,A="exclIsNumber"+i,E="' + "+(T="op"+i)+" + '";n+=" var schemaExcl"+i+" = "+w+"; ",n+=" var "+x+"; var "+_+" = typeof "+(w="schemaExcl"+i)+"; if ("+_+" != 'boolean' && "+_+" != 'undefined' && "+_+" != 'number') { ";var S;b=p;(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var M=n;n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+_+" == 'number' ? ( ("+x+" = "+a+" === undefined || "+w+" "+g+"= "+a+") ? "+f+" "+y+"= "+w+" : "+f+" "+y+" "+a+" ) : ( ("+x+" = "+w+" === true) ? "+f+" "+y+"= "+a+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { var op"+i+" = "+x+" ? '"+g+"' : '"+g+"='; ",void 0===s&&(b=p,u=e.errSchemaPath+"/"+p,a=w,d=v)}else{E=g;if((A="number"==typeof m)&&d){var T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" ( "+a+" === undefined || "+m+" "+g+"= "+a+" ? "+f+" "+y+"= "+m+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { "}else{A&&void 0===s?(x=!0,b=p,u=e.errSchemaPath+"/"+p,a=m,y+="="):(A&&(a=Math[h?"min":"max"](m,s)),m===(!A||a)?(x=!0,b=p,u=e.errSchemaPath+"/"+p,y+="="):(x=!1,E+="="));T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+" "+y+" "+a+" || "+f+" !== "+f+") { "}}b=b||t,(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+T+", limit: "+a+", exclusive: "+x+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+E+" ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";M=n;return n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+".length "+("maxItems"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s;var h="maxLength"==t?">":"<";n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?n+=" "+f+".length ":n+=" ucs2length("+f+") ",n+=" "+h+" "+a+") { ";var p=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" Object.keys("+f+").length "+("maxProperties"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},function(e){e.exports=JSON.parse('{"switch":{"title":"switch","type":"array","items":[{"enum":["switch"]},{"type":"object","properties":{"compareTo":{"$ref":"definitions#/definitions/contextualizedFieldName"},"compareToValue":{"type":"string"},"fields":{"type":"object","patternProperties":{"^[-a-zA-Z0-9 _:]+$":{"$ref":"dataType"}},"additionalProperties":false},"default":{"$ref":"dataType"}},"oneOf":[{"required":["compareTo","fields"]},{"required":["compareToValue","fields"]}],"additionalProperties":false}],"additionalItems":false},"option":{"title":"option","type":"array","items":[{"enum":["option"]},{"$ref":"dataType"}],"additionalItems":false}}')},function(e,t,r){"use strict";(function(t,a){var n;e.exports=S,S.ReadableState=E;r(18).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(70),s=r(7).Buffer,l=t.Uint8Array||function(){};var u,c=r(172);u=c&&c.debuglog?c.debuglog("stream"):function(){};var f,d,h,p=r(173),m=r(71),v=r(72).getHighWaterMark,g=r(16).codes,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,x=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6)(S,o);var _=m.errorOrDestroy,A=["error","close","destroy","pause","resume"];function E(e,t,a){n=n||r(17),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",a),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(26).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(17),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function M(e,t,r,a,n){u("readableAddChunk",t);var i,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}(e,o);else if(n||(i=function(e,t){var r;a=t,s.isBuffer(a)||a instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var a;return r}(o,t)),i)_(e,i);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),a)o.endEmitted?_(e,new x):T(e,o,t,!0);else if(o.ended)_(e,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):C(e,o)):T(e,o,t,!1)}else a||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,a.nextTick(L,e))}function L(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function C(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(k,e,t))}function k(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){u("readable nexttick read 0"),e.read(0)}function N(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,a.nextTick(B,t,e))}function B(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function V(e,t){for(var r=0,a=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=F(e,t))&&t.ended)return 0===t.length&&j(this),null;var a,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==a&&this.emit("data",a),a},S.prototype._read=function(e){_(this,new w("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?l:v;function s(t,a){u("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",v),r.removeListener("data",d),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){u("onend"),e.end()}n.endEmitted?a.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var f=!1;function d(t){u("ondata");var a=e.write(t);u("dest.write",a),!1===a&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!f&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){u("onerror",t),v(),e.removeListener("error",h),0===i(e,"error")&&_(e,t)}function p(){e.removeListener("finish",m),v()}function m(){u("onfinish"),e.removeListener("close",p),v()}function v(){u("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",m),e.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?O(this):n.reading||a.nextTick(I,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&a.nextTick(R,this),r},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||a.nextTick(R,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(N,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(a=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,L(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=f.destroy,S.prototype._undestroy=f.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this,r(4),r(5))},function(e,t,r){"use strict";e.exports=c;var a=r(16).codes,n=a.ERR_METHOD_NOT_IMPLEMENTED,i=a.ERR_MULTIPLE_CALLBACK,o=a.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=a.ERR_TRANSFORM_WITH_LENGTH_0,l=r(17);function u(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(null===a)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),a(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{i=!0,o.needsUpdate=!0,u&&(u.needsUpdate=!0);let c=-1;32===o.image.height?c=0:64===o.image.height?c=1:console.error("Couldn't detect texture version. Invalid dimensions: "+o.image.width+"x"+o.image.height),console.log("Skin Texture Version: "+c),o.magFilter=t.NearestFilter,o.minFilter=t.NearestFilter,o.anisotropy=0,u&&(u.magFilter=t.NearestFilter,u.minFilter=t.NearestFilter,u.anisotropy=0,u.format=t.RGBFormat),32===o.image.height&&(o.format=t.RGBFormat),n.attached||n._scene?console.log("[SkinRender] is attached - skipping scene init"):super.initScene((function(){n.element.dispatchEvent(new CustomEvent("skinRender",{detail:{playerModel:n.playerModel}}))})),console.log("Slim: "+f);let d=function(e,r,n,i,o){console.log("capeType: "+o);let u=new t.Object3D;u.name="headGroup",u.position.x=0,u.position.y=28,u.position.z=0,u.translateOnAxis(new t.Vector3(0,1,0),-4);let c=s(e,8,8,8,a.a.head[n],i,"head");if(c.translateOnAxis(new t.Vector3(0,1,0),4),u.add(c),n>=1){let r=s(e,8.504,8.504,8.504,a.a.hat,i,"hat",!0);r.translateOnAxis(new t.Vector3(0,1,0),4),u.add(r)}let f=new t.Object3D;f.name="bodyGroup",f.position.x=0,f.position.y=18,f.position.z=0;let d=s(e,8,12,4,a.a.body[n],i,"body");if(f.add(d),n>=1){let t=s(e,8.504,12.504,4.504,a.a.jacket,i,"jacket",!0);f.add(t)}let h=new t.Object3D;h.name="leftArmGroup",h.position.x=i?-5.5:-6,h.position.y=18,h.position.z=0,h.translateOnAxis(new t.Vector3(0,1,0),4);let p=s(e,i?3:4,12,4,a.a.leftArm[n],i,"leftArm");if(p.translateOnAxis(new t.Vector3(0,1,0),-4),h.add(p),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.leftSleeve,i,"leftSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),h.add(r)}let m=new t.Object3D;m.name="rightArmGroup",m.position.x=i?5.5:6,m.position.y=18,m.position.z=0,m.translateOnAxis(new t.Vector3(0,1,0),4);let v=s(e,i?3:4,12,4,a.a.rightArm[n],i,"rightArm");if(v.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(v),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.rightSleeve,i,"rightSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(r)}let g=new t.Object3D;g.name="leftLegGroup",g.position.x=-2,g.position.y=6,g.position.z=0,g.translateOnAxis(new t.Vector3(0,1,0),4);let y=s(e,4,12,4,a.a.leftLeg[n],i,"leftLeg");if(y.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(y),n>=1){let r=s(e,4.504,12.504,4.504,a.a.leftTrousers,i,"leftTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(r)}let b=new t.Object3D;b.name="rightLegGroup",b.position.x=2,b.position.y=6,b.position.z=0,b.translateOnAxis(new t.Vector3(0,1,0),4);let w=s(e,4,12,4,a.a.rightLeg[n],i,"rightLeg");if(w.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(w),n>=1){let r=s(e,4.504,12.504,4.504,a.a.rightTrousers,i,"rightTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(r)}let x=new t.Object3D;if(x.add(u),x.add(f),x.add(h),x.add(m),x.add(g),x.add(b),r){console.log(a.a);let e=a.a.capeRelative;"optifine"===o&&(e=a.a.capeOptifineRelative),"labymod"===o&&(e=a.a.capeLabymodRelative),e=JSON.parse(JSON.stringify(e)),console.log(e);for(let t in e)e[t].x*=r.image.width,e[t].w*=r.image.width,e[t].y*=r.image.height,e[t].h*=r.image.height;console.log(e);let n=new t.Object3D;n.name="capeGroup",n.position.x=0,n.position.y=16,n.position.z=-2.5,n.translateOnAxis(new t.Vector3(0,1,0),8),n.translateOnAxis(new t.Vector3(0,0,1),.5);let i=s(r,10,16,1,e,!1,"cape");i.rotation.x=l(10),i.translateOnAxis(new t.Vector3(0,1,0),-8),i.translateOnAxis(new t.Vector3(0,0,1),-.5),i.rotation.y=l(180),n.add(i),x.add(n)}return x}(o,u,c,f,e._capeType?e._capeType:e.optifine?"optifine":"minecraft");n.addToScene(d),n.playerModel=d,"function"==typeof r&&r()};n._skinImage=new Image,n._skinImage.crossOrigin="anonymous",n._capeImage=new Image,n._capeImage.crossOrigin="anonymous";let c=void 0!==e.cape||void 0!==e.capeUrl||void 0!==e.capeData||void 0!==e.mineskin,f=!1,d=!1,h=!1,p=new t.Texture,m=new t.Texture;if(p.image=n._skinImage,n._skinImage.onload=function(){if(n._skinImage){if(d=!0,console.log("Skin Image Loaded"),void 0===e.slim&&32!==n._skinImage.height){let e=document.createElement("canvas"),t=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,t.drawImage(n._skinImage,0,0),console.log("Slim Detection:");let r=t.getImageData(46,52,1,12).data,a=t.getImageData(54,20,1,12).data,i=!0;for(let e=3;e<48;e+=4){if(255===r[e]){i=!1;break}if(255===a[e]){i=!1;break}}console.log(i),i&&(f=!0)}if(n.options.makeNonTransparentOpaque&&32!==n._skinImage.height){let e=document.createElement("canvas"),a=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,a.drawImage(n._skinImage,0,0);let i=document.createElement("canvas"),o=i.getContext("2d");i.width=n._skinImage.width,i.height=n._skinImage.height;let s=a.getImageData(0,0,e.width,e.height),l=s.data;function r(e,t){return e>0&&t>0&&e<32&&t<32||(e>32&&t>16&&e<64&&t<32||e>16&&t>48&&e<48&&t<64)}for(let t=0;t178||r(n,i))&&(l[t+3]=255)}o.putImageData(s,0,0),console.log(i.toDataURL()),p=new t.CanvasTexture(i)}!d||!h&&c||i||o(p,m)}},n._skinImage.onerror=function(e){console.warn("Skin Image Error"),console.warn(e)},console.log("Has Cape: "+c),c?(m.image=n._capeImage,n._capeImage.onload=function(){n._capeImage&&(h=!0,console.log("Cape Image Loaded"),h&&d&&(i||o(p,m)))},n._capeImage.onerror=function(e){console.warn("Cape Image Error"),console.warn(e),h=!0,d&&(i||o(p))}):(m=null,n._capeImage=null),"string"==typeof e)0===e.indexOf("http")?n._skinImage.src=e:e.length<=16?u("https://minerender.org/nameToUuid.php?name="+e,(function(t,r){if(t)return console.log(t);console.log(r),n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e)})):e.length<=36?image.src="https://crafatar.com/skins/"+e+"?overlay":n._skinImage.src=e;else{if("object"!=typeof e)throw new Error("Invalid texture value");if(e.url?n._skinImage.src=e.url:e.data?n._skinImage.src=e.data:e.username?u("https://minerender.org/nameToUuid.php?name="+e.username,(function(t,r){if(t)return console.log(t);n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e.username)+"?overlay"})):e.uuid?n._skinImage.src="https://crafatar.com/skins/"+e.uuid+"?overlay":e.mineskin&&(n._skinImage.src="https://api.mineskin.org/render/texture/"+e.mineskin),e.cape)if(e.cape.length>36){u(e.cape.startsWith("http")?e.cape:"https://api.capes.dev/get/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else{let t="https://api.capes.dev/load/";e.capeUser?t+=e.capeUser:e.username?t+=e.username:e.uuid?t+=e.uuid:console.warn("Couldn't find a user to get a cape from"),u(t+="/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else e.capeUrl?n._capeImage.src=e.capeUrl:e.capeData?n._capeImage.src=e.capeData:e.mineskin&&(n._capeImage.src="https://api.mineskin.org/render/texture/"+e.mineskin+"/cape");f=e.slim}}resize(e,t){return this._resize(e,t)}reset(){this._skinImage=null,this._capeImage=null,this._animId&&cancelAnimationFrame(this._animId),this._canvas&&this._canvas.remove()}getPlayerModel(){return this.playerModel}getModelByName(e){return this._scene.getObjectByName(e,!0)}toggleSkinPart(e,t){this._scene.getObjectByName(e,!0).visible=t}}function s(e,r,a,n,i,o,s,l){let u=e.image.width,c=e.image.height,f=new t.BoxGeometry(r,a,n),d=new t.MeshBasicMaterial({map:e,transparent:l||!1,alphaTest:.1,side:l?t.DoubleSide:t.FrontSide});f.computeBoundingBox(),f.faceVertexUvs[0]=[];let h=["right","left","top","bottom","front","back"],p=[];for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{tolerance:0};if(!e)throw new Error("You should specify the element you want to test");"string"==typeof e&&(e=document.querySelector(e));var r=e.getBoundingClientRect();return(r.bottom-t.tolerance>0&&r.right-t.tolerance>0&&r.left+t.tolerance<(window.innerWidth||document.documentElement.clientWidth)&&r.top+t.tolerance<(window.innerHeight||document.documentElement.clientHeight))}function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0,container:""};if(!e)throw new Error("You should specify the element you want to test");if("string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={tolerance:0,container:document.querySelector(t)}),"string"==typeof t.container&&(t.container=document.querySelector(t.container)),t instanceof HTMLElement&&(t={tolerance:0,container:t}),!t.container)throw new Error("You should specify a container element");var r=t.container.getBoundingClientRect();return(e.offsetTop+e.clientHeight-t.tolerance>t.container.scrollTop&&e.offsetLeft+e.clientWidth-t.tolerance>t.container.scrollLeft&&e.offsetLeft+t.tolerance0&&void 0!==arguments[0]?arguments[0]:{tolerance:0,debounce:100,container:window};this.options={},this.trackedElements={},Object.defineProperties(this.options,{container:{configurable:!1,enumerable:!1,get:function(){var e=void 0;return"string"==typeof n.container?e=document.querySelector(n.container):n.container instanceof HTMLElement&&(e=n.container),e||window},set:function(e){n.container=e}},debounce:{get:function(){return parseInt(n.debounce,10)||100},set:function(e){n.debounce=e}},tolerance:{get:function(){return parseInt(n.tolerance,10)||0},set:function(e){n.tolerance=e}}}),Object.defineProperty(this,"_scroll",{enumerable:!1,configurable:!1,writable:!1,value:this._debouncedScroll.call(this)}),e=document.querySelector("body"),t=function(){Object.keys(a.trackedElements).forEach((function(e){a.on("enter",e),a.on("leave",e)}))},(r=window.MutationObserver||window.WebKitMutationObserver)?new r(t).observe(e,{childList:!0,subtree:!0}):(e.addEventListener("DOMNodeInserted",t,!1),e.addEventListener("DOMNodeRemoved",t,!1)),this.attach()}return Object.defineProperties(r.prototype,{_debouncedScroll:{configurable:!1,writable:!1,enumerable:!1,value:function(){var r=this,a=void 0;return function(){clearTimeout(a),a=setTimeout((function(){!function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0},n=Object.keys(r),i=void 0;n.length&&(i=a.container===window?e:t,n.forEach((function(e){r[e].nodes.forEach((function(t){if(i(t.node,a)?(t.wasVisible=t.isVisible,t.isVisible=!0):(t.wasVisible=t.isVisible,t.isVisible=!1),!0===t.isVisible&&!1===t.wasVisible){if(!r[e].enter)return;Object.keys(r[e].enter).forEach((function(a){"function"==typeof r[e].enter[a]&&r[e].enter[a](t.node,"enter")}))}if(!1===t.isVisible&&!0===t.wasVisible){if(!r[e].leave)return;Object.keys(r[e].leave).forEach((function(a){"function"==typeof r[e].leave[a]&&r[e].leave[a](t.node,"leave")}))}}))})))}(r.trackedElements,r.options)}),r.options.debounce)}}},attach:{configurable:!1,writable:!1,enumerable:!1,value:function(){var e=this.options.container;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.addEventListener("scroll",this._scroll,{passive:!0}),window.addEventListener("resize",this._scroll,{passive:!0}),this._scroll(),this.attached=!0}},destroy:{configurable:!1,writable:!1,enumerable:!1,value:function(){this.options.container.removeEventListener("scroll",this._scroll),window.removeEventListener("resize",this._scroll),this.attached=!1}},off:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){var a=Object.keys(this.trackedElements[t].enter||{}),n=Object.keys(this.trackedElements[t].leave||{});if({}.hasOwnProperty.call(this.trackedElements,t))if(r){if(this.trackedElements[t][e]){var i="function"==typeof r?r.name:r;delete this.trackedElements[t][e][i]}}else delete this.trackedElements[t][e];a.length||n.length||delete this.trackedElements[t]}},on:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){if(!e)throw new Error("No event given. Choose either enter or leave");if(!t)throw new Error("No selector to track");if(["enter","leave"].indexOf(e)<0)throw new Error(e+" event is not supported");({}).hasOwnProperty.call(this.trackedElements,t)||(this.trackedElements[t]={}),this.trackedElements[t].nodes=[];for(var a=0,n=document.querySelectorAll(t);a{let i=e[t];console.log(i),"object"!=typeof i&&(i={model:i,texture:i,textureScale:1}),i.textureScale||(i.textureScale=1),m(i.model).then(e=>g(e)).then(e=>{console.log("Merged:"),console.log(e),Object(l.d)(r.options.assetRoot,"minecraft","/entity/",i.texture).then(t=>{(new a.TextureLoader).load(t,(function(t){t.magFilter=a.NearestFilter,t.minFilter=a.NearestFilter,t.anisotropy=0,t.needsUpdate=!0,d(r,e,t,i.textureScale).then(e=>{r.addToScene(e),r.entities.push(e),n()})}))}).catch(()=>{console.warn("Missing texture for entity "+i.texture)})}).catch(()=>{console.warn("No model file found for entity "+i.model)})}));Promise.all(n).then(()=>{"function"==typeof t&&t()})}}function d(e,t,r,n){return console.log(t),new Promise(i=>{let o=new a.Object3D;for(let i in t.groups)if(t.groups.hasOwnProperty(i)){let s=t.groups[i],l=new a.Object3D;l.name=s.name,s.pivot&&l.applyMatrix((new a.Matrix4).makeTranslation(s.pivot[0],s.pivot[1],s.pivot[2])),s.pos,s.rotation&&3===s.rotation.length&&(l.rotation.x=s.rotation[0],l.rotation.y=s.rotation[1],l.rotation.z=s.rotation[2]);for(let t=0;t{n.ajax("https://minerender.org/res/models/entities/"+e+".json").done(e=>{t(e)}).fail(()=>{r()})})}const v=(e,t,r)=>t;let g=function(e){return new Promise((t,r)=>{y(e,[],t,r)})},y=function(e,t,r,a){if(console.log(t),t.push(e),!e.hasOwnProperty("parent")){t.reverse();let e={};for(let r=0;r{y(e,t,r,a)})};"undefined"!=typeof window&&(window.EntityRender=f),void 0!==e&&(e.EntityRender=f),t.default=f}.call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(10);var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),e.scene=new n.Scene,e.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),e.quad.frustumCulled=!1,e.scene.add(e.quad),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((a=i)&&a.__esModule?a:{default:a}).default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:this.clock.getDelta(),t=this.renderer.getRenderTarget(),r=!1,a=void 0,n=void 0,i=this.passes.length;for(n=0;n{let s=e[r];"string"==typeof s&&(s={texture:s}),s.textureScale||(s.textureScale=1),Object(n.d)(a.options.assetRoot,"minecraft","",s.texture).then(e=>{let r=function(e){let r=(new t.TextureLoader).load(e,(function(){r.magFilter=t.NearestFilter,r.minFilter=t.NearestFilter,r.anisotropy=0,r.needsUpdate=!0;let e=new t.MeshBasicMaterial({map:r,transparent:!0,side:t.DoubleSide,alphaTest:.5});e.userData.layer=s,i(e)}))};if(s.uv){s.uv=[s.uv[0]*s.textureScale,s.uv[1]*s.textureScale,s.uv[2]*s.textureScale,s.uv[3]*s.textureScale];let t=new Image;t.onload=function(){let e=document.createElement("canvas");e.width=s.uv[2]-s.uv[0],e.height=s.uv[3]-s.uv[1],e.getContext("2d").drawImage(t,s.uv[0],s.uv[1],s.uv[2]-s.uv[0],s.uv[3]-s.uv[1],0,0,s.uv[2]-s.uv[0],s.uv[3]-s.uv[1]),r(e.toDataURL("image/png"))},t.crossOrigin="anonymous",t.src=e}else r(e)})}));Promise.all(i).then(e=>{let n=new t.Object3D,i=0,o=0;for(let r=0;ri&&(i=f),d>o&&(o=d);let h=new t.PlaneGeometry(f,d),p=new t.Mesh(h,s);if(p.name=s.userData.layer.texture.toLowerCase()+(s.userData.layer.name?"_"+s.userData.layer.name.toLowerCase():""),p.position.set(0,0,0),p.applyMatrix((new t.Matrix4).makeTranslation(f/2,d/2,0)),s.userData.layer.pos?p.applyMatrix((new t.Matrix4).makeTranslation(s.userData.layer.pos[0],-d-s.userData.layer.pos[1],0)):p.applyMatrix((new t.Matrix4).makeTranslation(0,-d,0)),s.userData.layer.layer&&(p.layers.set(s.userData.layer.layer),a._camera.layers.enable(s.userData.layer.layer)),n.add(p),a.options.showOutlines){let e=new t.BoxHelper(p,16711680);n.add(e),s.userData.layer.layer&&e.layers.set(s.userData.layer.layer)}}n.applyMatrix((new t.Matrix4).makeTranslation(-i/2,o/2,0)),a.addToScene(n),a.gui=n,a.attached||(a._camera.position.set(0,0,Math.max(i,o)),a._camera.fov=2*Math.atan(Math.max(i,o)/(2*Math.max(i,o)))*(180/Math.PI),a._camera.updateProjectionMatrix()),"function"==typeof r&&r()})}}l.Positions=i.a,l.Helper=o.a,"undefined"!=typeof window&&(window.GuiRender=l),void 0!==e&&(e.GuiRender=l)}).call(this,r(4))},function(e,t,r){"use strict";(function(e){var t=r(0),a=(r(21),r(22),r(8)),n=r(2),i=r(43),o=r(29),s=r(1),l=r(30),u=r.n(l);r(75),r(183);r(87)(t);const c=184;String.prototype.replaceAll=function(e,t){return this.replace(new RegExp(e,"g"),t)};const f=[16711680,65535,255,128,16711935,8388736,8421376,65280,32768,16776960,8388608,32896],d=["east","west","up","down","south","north"],h=["lightgreen"],p={},m={},v={},g={},y={},b={},w={},x={},_=[];let A={camera:{type:"perspective",x:35,y:25,z:20,target:[0,0,0]},type:"block",centerCubes:!1,assetRoot:n.a,useWebWorkers:!1};class E extends a.b{constructor(e,t){super(e,A,t),this.renderType="ModelRender",this.models=[],this.instancePositionMap={},this.attached=!1}render(e,r){let a=this;a.attached||a._scene?console.log("[ModelRender] is attached - skipping scene init"):super.initScene((function(){for(let e=0;e<_.length;e++)_[e]();a.element.dispatchEvent(new CustomEvent("modelRender",{detail:{models:a.models}}))}));let n=[];(function(e,t,r){console.time("parseModels"),console.log("Parsing Models...");let a=[];for(let n=0;n{if(e.options.useWebWorkers){let a=u()(c);a.addEventListener("message",e=>{r.push(...e.data.parsedModelList),t()}),a.postMessage({func:"parseModel",model:i,modelOptions:i,parsedModelList:r,assetRoot:e.options.assetRoot})}else Object(s.e)(i,i,r,e.options.assetRoot).then(()=>{t()})}))}return Promise.all(a)})(a,e,n).then(()=>(function(e,t){console.timeEnd("parseModels"),console.time("loadAndMergeModels");let r=[];console.log("Loading Model JSON data & merging...");let a={};for(let e=0;e{let a=n[t],i=Object(s.d)(a);if(console.debug("loadAndMerge "+i),p.hasOwnProperty(i))r();else if(e.options.useWebWorkers){let t=u()(c);t.addEventListener("message",e=>{p[i]=e.data.mergedModel,r()}),t.postMessage({func:"loadAndMergeModel",model:a,assetRoot:e.options.assetRoot})}else Object(s.b)(a,e.options.assetRoot).then(e=>{p[i]=e,r()})}));return Promise.all(r)})(a,n)).then(()=>(function(e,t){console.timeEnd("loadAndMergeModels"),console.time("loadModelTextures");let r=[];console.log("Loading Textures...");let a={};for(let e=0;e{let a=n[t],i=Object(s.d)(a);console.debug("loadTexture "+i);let o=p[i];if(m.hasOwnProperty(i))r();else{if(!o)return console.warn("Missing merged model"),console.warn(a.name),void r();if(!o.textures)return console.warn("The model doesn't have any textures!"),console.warn("Please make sure you're using the proper file."),console.warn(a.name),void r();if(e.options.useWebWorkers){let t=u()(c);t.addEventListener("message",e=>{m[i]=e.data.textures,r()}),t.postMessage({func:"loadTextures",textures:o.textures,assetRoot:e.options.assetRoot})}else Object(s.c)(o.textures,e.options.assetRoot).then(e=>{m[i]=e,r()})}}));return Promise.all(r)})(a,n)).then(()=>(function(e,r){console.timeEnd("loadModelTextures"),console.time("doModelRender"),console.log("Rendering Models...");let a=[];for(let n=0;n{let i=r[n],o=p[Object(s.d)(i)],l=m[Object(s.d)(i)],u=i.offset||[0,0,0],c=i.rotation||[0,0,0],f=i.scale||[1,1,1];if(i.options.hasOwnProperty("display")&&o.hasOwnProperty("display")&&o.display.hasOwnProperty(i.options.display)){let e=o.display[i.options.display];e.hasOwnProperty("translation")&&(u=[u[0]+e.translation[0],u[1]+e.translation[1],u[2]+e.translation[2]]),e.hasOwnProperty("rotation")&&(c=[c[0]+e.rotation[0],c[1]+e.rotation[1],c[2]+e.rotation[2]]),e.hasOwnProperty("scale")&&(f=[e.scale[0],e.scale[1],e.scale[2]])}S(e,o,l,o.textures,i.type,i.name,i.variant,u,c,f).then(r=>{if(r.firstInstance){let a=new t.Object3D;a.add(r.mesh),e.models.push(a),e.addToScene(a)}a(r)})}));return Promise.all(a)})(a,n)).then(e=>{console.timeEnd("doModelRender"),console.debug(e),"function"==typeof r&&r()})}}let S=function(e,r,n,i,o,l,u,c,f,d){return new Promise(h=>{if(r.hasOwnProperty("elements")){let p=Object(s.d)({type:o,name:l,variant:u}),m=v[p],g=function(r,a){r.userData.modelType=o,r.userData.modelName=l;let n=new t.Vector3,i=new t.Vector3,u=new t.Quaternion,m={key:p,index:a,offset:c,scale:d,rotation:f};f&&r.setQuaternionAt(a,u.setFromEuler(new t.Euler(Object(s.f)(f[0]),Object(s.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(s.f)(f[2])))),c&&(r.setPositionAt(a,n.set(c[0],c[1],c[2])),e.instancePositionMap[c[0]+"_"+c[1]+"_"+c[2]]=m),d&&r.setScaleAt(a,i.set(d[0],d[1],d[2])),r.needsUpdate(),h({mesh:r,firstInstance:0===a})},y=function(e,r){let a;if(e.translate(-8,-8,-8),x.hasOwnProperty(p))console.debug("Using cached instance ("+p+")"),a=x[p];else{console.debug("Caching new model instance "+p+" (with "+m+" instances)");let n=new t.InstancedMesh(e,r,m,!1,!1,!1);a={instance:n,index:0},x[p]=a;let i=new t.Vector3,o=new t.Vector3(1,1,1),s=new t.Quaternion;for(let e=0;e{let a=l.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_"+(o.__comment?o.__comment.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_":"");F(o.to[0]-o.from[0],o.to[1]-o.from[1],o.to[2]-o.from[2],a+Date.now(),o.faces,u,n,i,e.options.assetRoot,a).then(e=>{e.applyMatrix((new t.Matrix4).makeTranslation((o.to[0]-o.from[0])/2,(o.to[1]-o.from[1])/2,(o.to[2]-o.from[2])/2)),e.applyMatrix((new t.Matrix4).makeTranslation(o.from[0],o.from[1],o.from[2])),o.rotation&&O(e,new t.Vector3(o.rotation.origin[0],o.rotation.origin[1],o.rotation.origin[2]),new t.Vector3("x"===o.rotation.axis?1:0,"y"===o.rotation.axis?1:0,"z"===o.rotation.axis?1:0),Object(s.f)(o.rotation.angle)),r(e)})}))}Promise.all(b).then(e=>{let t=Object(a.c)(e,!0);t.sourceSize=e.length,y(t.geometry,t.materials,e.length);for(let t=0;t{c&&e.applyMatrix((new t.Matrix4).makeTranslation(c[0],c[1],c[2])),f&&e.rotation.set(Object(s.f)(f[0]),Object(s.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(s.f)(f[2])),d&&e.scale.set(d[0],d[1],d[2]),h({mesh:e,firstInstance:!0})})})};function M(e,r,a,n){let i=x[e];if(i&&i.instance){let e,o=i.instance;e=n?r||[1,1,1]:[0,0,0];let s=new t.Vector3;return o.setScaleAt(a,s.set(e[0],e[1],e[2])),o}}function T(e,t){let r={};for(let a of e){let e=this.instancePositionMap[a[0]+"_"+a[1]+"_"+a[2]];if(e){let a=M(e.key,e.scale,e.index,t);a&&(r[e.key]=a)}}for(let e of Object.values(r))e.needsUpdate()}E.prototype.setVisibilityAtMulti=T,E.prototype.setVisibilityAt=function(e,t,r,a){T([[e,t,r]],a)},E.prototype.setVisibilityOfType=function(e,t,r,a){let n=x[Object(s.d)({type:e,name:t,variant:r})];if(n&&n.instance){n.instance.visible=a}};let P=function(e,r){return new Promise(a=>{let n=function(r,n,i){let o=new t.PlaneGeometry(n,i),s=new t.Mesh(o,r);s.name=e,s.receiveShadow=!0,a(s)};if(r){let a=0,i=0,s=[];for(let e in r)r.hasOwnProperty(e)&&s.push(new Promise(t=>{let n=new Image;n.onload=function(){n.width>a&&(a=n.width),n.height>i&&(i=n.height),t(n)},n.src=r[e]}));Promise.all(s).then(r=>{let s=document.createElement("canvas");s.width=a,s.height=i;let l=s.getContext("2d");for(let e=0;e{let A,E=e+"_"+r+"_"+a;w.hasOwnProperty(E)?(console.debug("Using cached Geometry ("+E+")"),A=w[E]):(A=new t.BoxGeometry(e,r,a),console.debug("Caching Geometry "+E),w[E]=A);let S=function(e){let r=new t.Mesh(A,e);r.name=i,r.receiveShadow=!0,x(r)};if(c){let e=[];for(let r=0;r<6;r++)e.push(new Promise(e=>{let a=d[r];if(!l.hasOwnProperty(a))return void e(null);let f=l[a],w=f.texture.substr(1);if(!c.hasOwnProperty(w)||!c[w])return console.warn("Missing texture '"+w+"' for face "+a+" in model "+i),void e(null);let x=w+"_"+a+"_"+v,A=r=>{let l=function(r){let n=r.dataUrl,o=r.dataUrlHash,l=r.hasTransparency;if(b.hasOwnProperty(o))return console.debug("Using cached Material ("+o+", without meta)"),void e(b[o]);let u=p[w];u.startsWith("#")&&(u=p[i.substr(1)]),console.debug("Pre-Caching Material "+o+", without meta"),b[o]=new t.MeshBasicMaterial({map:null,transparent:l,side:l?t.DoubleSide:t.FrontSide,alphaTest:.5,name:a+"_"+w+"_"+u});let c=function(t){console.debug("Finalizing Cached Material "+o+", without meta"),b[o].map=t,b[o].needsUpdate=!0,e(b[o])};if(g.hasOwnProperty(o))return console.debug("Using cached Texture ("+o+")"),void c(g[o]);console.debug("Pre-Caching Texture "+o),g[o]=(new t.TextureLoader).load(n,(function(e){e.magFilter=t.NearestFilter,e.minFilter=t.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,f.hasOwnProperty("rotation")&&(e.center.x=.5,e.center.y=.5,e.rotation=Object(s.f)(f.rotation)),console.debug("Caching Texture "+o),g[o]=e,c(e)}))};if(r.height>r.width&&r.height%r.width==0){let a=p[w];a.startsWith("#")&&(a=p[a.substr(1)]),-1!==a.indexOf("/")&&(a=a.substr(a.indexOf("/")+1)),Object(n.e)(a,m).then(a=>{!function(r,a){let n=r.dataUrlHash,i=r.hasTransparency;if(b.hasOwnProperty(n))return console.debug("Using cached Material ("+n+", with meta)"),void e(b[n]);console.debug("Pre-Caching Material "+n+", with meta"),b[n]=new t.MeshBasicMaterial({map:null,transparent:i,side:i?t.DoubleSide:t.FrontSide,alphaTest:.5});let s=1;a.hasOwnProperty("animation")&&a.animation.hasOwnProperty("frametime")&&(s=a.animation.frametime);let l=Math.floor(r.height/r.width);console.log("Generating animated texture...");let u=[];for(let e=0;e{let n=document.createElement("canvas");n.width=r.width,n.height=r.width,n.getContext("2d").drawImage(r.canvas,0,e*r.width,r.width,r.width,0,0,r.width,r.width);let i=n.toDataURL("image/png"),s=o(i);if(g.hasOwnProperty(s))return console.debug("Using cached Texture ("+s+")"),void a(g[s]);console.debug("Pre-Caching Texture "+s),g[s]=(new t.TextureLoader).load(i,(function(e){e.magFilter=t.NearestFilter,e.minFilter=t.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,console.debug("Caching Texture "+s+", without meta"),g[s]=e,a(e)}))}));Promise.all(u).then(t=>{let r=0,a=0;_.push(()=>{r>=s&&(r=0,b[n].map=t[a],a++),a>=t.length&&(a=0),r+=.1}),console.debug("Finalizing Cached Material "+n+", with meta"),b[n].map=t[0],b[n].needsUpdate=!0,e(b[n])})}(r,a)}).catch(()=>{l(r)})}else l(r)};if(y.hasOwnProperty(x)){let e=y[x];if(e.hasOwnProperty("img")){console.debug("Waiting for canvas image that's already loading ("+x+")"),e.img.waitingForCanvas.push((function(e){A(e)}))}else console.debug("Using cached canvas ("+x+")"),A(y[x])}else{let t=new Image;t.onerror=function(t){console.warn(t),e(null)},t.waitingForCanvas=[],t.onload=function(){let e=(e=>{let t=f.uv;t||(t=u[a].uv),t=[Object(n.f)(t[0],e.width),Object(n.f)(t[1],e.height),Object(n.f)(t[2],e.width),Object(n.f)(t[3],e.height)];let r=document.createElement("canvas");r.width=Math.abs(t[2]-t[0]),r.height=Math.abs(t[3]-t[1]);let i,s=r.getContext("2d");s.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),r.width,r.height,0,0,r.width,r.height),f.hasOwnProperty("tintindex")?i=h[f.tintindex]:v.startsWith("water_")&&(i="blue"),i&&(s.fillStyle=i,s.globalCompositeOperation="multiply",s.fillRect(0,0,r.width,r.height),s.globalAlpha=1,s.globalCompositeOperation="destination-in",s.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),r.width,r.height,0,0,r.width,r.height));let l=s.getImageData(0,0,r.width,r.height).data,c=!1;for(let e=3;eS(e))}else{let e=[];for(let r=0;r<6;r++)e.push(new t.MeshBasicMaterial({color:f[r+2],wireframe:!0}));S(e)}})};function O(e,t,r,a){e.position.sub(t),e.position.applyAxisAngle(r,a),e.position.add(t),e.rotateOnAxis(r,a)}E.cache={loadedTextures:m,mergedModels:p,instanceCount:v,texture:g,canvas:y,material:b,geometry:w,instances:x,animated:_,resetInstances:function(){Object(s.a)(v),Object(s.a)(x)},clearAll:function(){Object(s.a)(m),Object(s.a)(p),Object(s.a)(v),Object(s.a)(g),Object(s.a)(y),Object(s.a)(b),Object(s.a)(w),Object(s.a)(x),_.splice(0,_.length)}},E.ModelConverter=i.a,"undefined"!=typeof window&&(window.ModelRender=E,window.ModelConverter=i.a),void 0!==e&&(e.ModelRender=E)}).call(this,r(4))},function(e,t,r){e.exports=function(e){const t=parseInt(e.REVISION)>=96;r(88)(e);var a=new e.MeshDepthMaterial;a.depthPacking=e.RGBADepthPacking,a.clipping=!0,a.defines={INSTANCE_TRANSFORM:""};var n=e.ShaderLib.distanceRGBA,i=e.UniformsUtils.clone(n.uniforms),o=new e.ShaderMaterial({defines:{USE_SHADOWMAP:"",INSTANCE_TRANSFORM:""},uniforms:i,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,clipping:!0});return e.InstancedMesh=function(t,r,n,i,s,l){e.Mesh.call(this,(new e.InstancedBufferGeometry).copy(t)),this._dynamic=!!i,this._uniformScale=!!l,this._colors=!!s,this.numInstances=n,this._setAttributes(),this.material=r,this.frustumCulled=!1,this.customDepthMaterial=a,this.customDistanceMaterial=o},e.InstancedMesh.prototype=Object.create(e.Mesh.prototype),e.InstancedMesh.constructor=e.InstancedMesh,Object.defineProperties(e.InstancedMesh.prototype,{material:{set:function(e){let t=function(e){e.defines?(e.defines.INSTANCE_TRANSFORM="",this._uniformScale?e.defines.INSTANCE_UNIFORM="":delete e.defines.INSTANCE_UNIFORM,this._colors?e.defines.INSTANCE_COLOR="":delete e.defines.INSTANCE_COLOR):(e.defines={INSTANCE_TRANSFORM:""},this._uniformScale&&(e.defines.INSTANCE_UNIFORM=""),this._colors&&(e.defines.INSTANCE_COLOR=""))};if(Array.isArray(e)){e=e.slice(0);for(let r=0;r{const n=r[a];let i;t?i=new e.InstancedBufferAttribute(...n):(i=new e.InstancedBufferAttribute(n[0],n[1],n[3])).normalized=n[2],i.dynamic=this._dynamic,this.geometry.addAttribute(a,i)})},e.InstancedMesh}},function(e,t,r){e.exports=function(e){return/InstancedMesh/.test(e.REVISION)?e:(r(89)(e),e.REVISION+="_InstancedMesh",e)}},function(e,t,r){e.exports=function(e){e.ShaderChunk.begin_vertex=r(90),e.ShaderChunk.color_fragment=r(91),e.ShaderChunk.color_pars_fragment=r(92),e.ShaderChunk.color_vertex=r(93),e.ShaderChunk.defaultnormal_vertex=r(94),e.ShaderChunk.uv_pars_vertex=r(95)}},function(e,t){e.exports=["#ifndef INSTANCE_TRANSFORM","vec3 transformed = vec3( position );","#else","#ifndef INSTANCE_MATRIX","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","vec3 transformed = ( _instanceMatrix * vec4( position , 1. )).xyz;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","diffuseColor.rgb *= vColor;","#endif","#if defined(INSTANCE_COLOR)","diffuseColor.rgb *= vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","varying vec3 vColor;","#endif","#if defined( INSTANCE_COLOR )","varying vec3 vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","vColor.xyz = color.xyz;","#endif","#if defined( INSTANCE_COLOR ) && defined( INSTANCE_TRANSFORM )","vInstanceColor = instanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef FLIP_SIDED","objectNormal = -objectNormal;","#endif","#ifndef INSTANCE_TRANSFORM","vec3 transformedNormal = normalMatrix * objectNormal;","#else","#ifndef INSTANCE_MATRIX ","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","#ifndef INSTANCE_UNIFORM","vec3 transformedNormal = transposeMat3( inverse( mat3( modelViewMatrix * _instanceMatrix ) ) ) * objectNormal ;","#else","vec3 transformedNormal = ( modelViewMatrix * _instanceMatrix * vec4( objectNormal , 0.0 ) ).xyz;","#endif","#endif"].join("\n")},function(e,t){e.exports=["#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )","varying vec2 vUv;","uniform mat3 uvTransform;","#endif","#ifdef INSTANCE_TRANSFORM","mat3 inverse(mat3 m) {","float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];","float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];","float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];","float b01 = a22 * a11 - a12 * a21;","float b11 = -a22 * a10 + a12 * a20;","float b21 = a21 * a10 - a11 * a20;","float det = a00 * b01 + a01 * b11 + a02 * b21;","return mat3(b01, (-a22 * a01 + a02 * a21), ( a12 * a01 - a02 * a11),","b11, ( a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),","b21, (-a21 * a00 + a01 * a20), ( a11 * a00 - a01 * a10)) / det;","}","attribute vec3 instancePosition;","attribute vec4 instanceQuaternion;","attribute vec3 instanceScale;","#if defined( INSTANCE_COLOR )","attribute vec3 instanceColor;","varying vec3 vInstanceColor;","#endif","mat4 getInstanceMatrix(){","vec4 q = instanceQuaternion;","vec3 s = instanceScale;","vec3 v = instancePosition;","vec3 q2 = q.xyz + q.xyz;","vec3 a = q.xxx * q2.xyz;","vec3 b = q.yyz * q2.yzz;","vec3 c = q.www * q2.xyz;","vec3 r0 = vec3( 1.0 - (b.x + b.z) , a.y + c.z , a.z - c.y ) * s.xxx;","vec3 r1 = vec3( a.y - c.z , 1.0 - (a.x + b.z) , b.y + c.x ) * s.yyy;","vec3 r2 = vec3( a.z + c.y , b.y - c.x , 1.0 - (a.x + b.x) ) * s.zzz;","return mat4(","r0 , 0.0,","r1 , 0.0,","r2 , 0.0,","v , 1.0",");","}","#endif"].join("\n")},function(e,t,r){"use strict";var a={};(0,r(11).assign)(a,r(97),r(99),r(34)),e.exports=a},function(e,t,r){"use strict";var a=r(48),n=r(11),i=r(51),o=r(32),s=r(33),l=Object.prototype.toString,u=0,c=-1,f=0,d=8;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({level:c,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&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 r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==u)throw new Error(o[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,p))!==u)throw new Error(o[r]);this._dict_set=!0}}function p(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}h.prototype.push=function(e,t){var r,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=i.string2buf(e):"[object ArrayBuffer]"===l.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 n.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=a.deflate(s,o))&&r!==u)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(n.shrinkBuf(s.output,s.next_out))):this.onData(n.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u):2!==o||(this.onEnd(u),s.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=h,t.deflate=p,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},function(e,t,r){"use strict";var a=r(11),n=4,i=0,o=1,s=2;function l(e){for(var t=e.length;--t>=0;)e[t]=0}var u=0,c=1,f=2,d=29,h=256,p=h+1+d,m=30,v=19,g=2*p+1,y=15,b=16,w=7,x=256,_=16,A=17,E=18,S=[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],M=[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],T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(p+2));l(F);var O=new Array(2*m);l(O);var L=new Array(512);l(L);var C=new Array(256);l(C);var k=new Array(d);l(k);var R,I,N,D=new Array(m);function U(e,t,r,a,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=a,this.max_length=n,this.has_stree=e&&e.length}function j(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function B(e){return e<256?L[e]:L[256+(e>>>7)]}function V(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function z(e,t,r){e.bi_valid>b-r?(e.bi_buf|=t<>b-e.bi_valid,e.bi_valid+=r-b):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function X(e,t,r){var a,n,i=new Array(y+1),o=0;for(a=1;a<=y;a++)i[a]=o=o+r[a-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=H(i[s]++,s))}}function Y(e){var t;for(t=0;t8?V(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,a){var n=2*t,i=2*r;return e[n]>1;r>=1;r--)Q(e,i,r);n=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Q(e,i,1),a=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=a,i[2*n]=i[2*r]+i[2*a],e.depth[n]=(e.depth[r]>=e.depth[a]?e.depth[r]:e.depth[a])+1,i[2*r+1]=i[2*a+1]=n,e.heap[1]=n++,Q(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,a,n,i,o,s,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(i=0;i<=y;i++)e.bl_count[i]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(i=p,m++),l[2*a+1]=i,a>u||(e.bl_count[i]++,o=0,a>=h&&(o=d[a-h]),s=l[2*a],e.opt_len+=s*(i+o),f&&(e.static_len+=s*(c[2*a+1]+o)));if(0!==m){do{for(i=p-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(i=p;0!==i;i--)for(a=e.bl_count[i];0!==a;)(n=e.heap[--r])>u||(l[2*n+1]!==i&&(e.opt_len+=(i-l[2*n+1])*l[2*n],l[2*n+1]=i),a--)}}(e,t),X(i,u,e.bl_count)}function J(e,t,r){var a,n,i=-1,o=t[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(r+1)+1]=65535,a=0;a<=r;a++)n=o,o=t[2*(a+1)+1],++s>=7;a0?(e.strm.data_type===s&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&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 o;for(t=32;t=3&&0===e.bl_tree[2*P[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),l=e.opt_len+3+7>>>3,(u=e.static_len+3+7>>>3)<=l&&(l=u)):l=u=r+5,r+4<=l&&-1!==t?te(e,t,r,a):e.strategy===n||u===l?(z(e,(c<<1)+(a?1:0),3),Z(e,F,O)):(z(e,(f<<1)+(a?1:0),3),function(e,t,r,a){var n;for(z(e,t-257,5),z(e,r-1,5),z(e,a-4,4),n=0;n>>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&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(C[r]+h+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){z(e,c<<1,3),G(e,x,F),function(e){16===e.bi_valid?(V(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,r){"use strict";var a=r(52),n=r(11),i=r(51),o=r(34),s=r(32),l=r(33),u=r(102),c=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new u,a.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=i.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=a.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function d(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,l,u,f,d=this.strm,h=this.options.chunkSize,p=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?d.input=i.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new n.Buf8(h),d.next_out=0,d.avail_out=h),(r=a.inflate(d,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(r=a.inflateSetDictionary(this.strm,p)),r===o.Z_BUF_ERROR&&!0===m&&(r=o.Z_OK,m=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==o.Z_STREAM_END&&(0!==d.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=i.utf8border(d.output,d.next_out),u=d.next_out-l,f=i.buf2string(d.output,l),d.next_out=u,d.avail_out=h-u,u&&n.arraySet(d.output,d.output,l,u,0),this.onData(f)):this.onData(n.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),d.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=d,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.ungzip=d},function(e,t,r){"use strict";e.exports=function(e,t){var r,a,n,i,o,s,l,u,c,f,d,h,p,m,v,g,y,b,w,x,_,A,E,S,M;r=e.state,a=e.next_in,S=e.input,n=a+(e.avail_in-5),i=e.next_out,M=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,f=r.wnext,d=r.window,h=r.hold,p=r.bits,m=r.lencode,v=r.distcode,g=(1<>>=w=b>>>24,p-=w,0===(w=b>>>16&255))M[i++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(h&(1<>>=w,p-=w),p<15&&(h+=S[a++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=v[(65535&b)+(h&(1<l){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,p-=w,_>(w=i-o)){if((w=_-w)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(A=0,E=d,0===f){if(A+=u-w,w2;)M[i++]=E[A++],M[i++]=E[A++],M[i++]=E[A++],x-=3;x&&(M[i++]=E[A++],x>1&&(M[i++]=E[A++]))}else{A=i-_;do{M[i++]=M[A++],M[i++]=M[A++],M[i++]=M[A++],x-=3}while(x>2);x&&(M[i++]=M[A++],x>1&&(M[i++]=M[A++]))}break}}break}}while(a>3,h&=(1<<(p-=x<<3))-1,e.next_in=a,e.next_out=i,e.avail_in=a=1&&0===I[M];M--);if(T>M&&(T=M),0===M)return u[c++]=20971520,u[c++]=20971520,d.bits=1,0;for(S=1;S0&&(0===e||1!==M))return-1;for(N[1]=0,A=1;A<15;A++)N[A+1]=N[A]+I[A];for(E=0;E852||2===e&&L>592)return 1;for(;;){b=A-F,f[E]y?(w=D[U+f[E]],x=k[R+f[E]]):(w=96,x=0),h=1<>F)+(p-=h)]=b<<24|w<<16|x|0}while(0!==p);for(h=1<>=1;if(0!==h?(C&=h-1,C+=h):C=0,E++,0==--I[A]){if(A===M)break;A=t[r+f[E]]}if(A>T&&(C&v)!==m){for(0===F&&(F=T),g+=S,O=1<<(P=A-F);P+F852||2===e&&L>592)return 1;u[m=C&v]=T<<24|P<<16|g-c|0}}return 0!==C&&(u[g+C]=A-F<<24|64<<16|0),d.bits=T,0}},function(e,t,r){"use strict";e.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}},function(e,t,r){"use strict";(function(e){var a=r(7).Buffer,n=r(106).Transform,i=r(117),o=r(59),s=r(27).ok,l=r(7).kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";i.Z_MIN_WINDOWBITS=8,i.Z_MAX_WINDOWBITS=15,i.Z_DEFAULT_WINDOWBITS=15,i.Z_MIN_CHUNK=64,i.Z_MAX_CHUNK=1/0,i.Z_DEFAULT_CHUNK=16384,i.Z_MIN_MEMLEVEL=1,i.Z_MAX_MEMLEVEL=9,i.Z_DEFAULT_MEMLEVEL=8,i.Z_MIN_LEVEL=-1,i.Z_MAX_LEVEL=9,i.Z_DEFAULT_LEVEL=i.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(i),f=0;f=l?o=new RangeError(u):t=a.concat(n,i),n=[],e.close(),r(o,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)})),e.on("end",s),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=a.from(t)),!a.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function b(e){if(!(this instanceof b))return new b(e);T.call(this,e,i.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);T.call(this,e,i.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,i.GZIP)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,i.GUNZIP)}function A(e){if(!(this instanceof A))return new A(e);T.call(this,e,i.DEFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);T.call(this,e,i.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,i.UNZIP)}function M(e){return e===i.Z_NO_FLUSH||e===i.Z_PARTIAL_FLUSH||e===i.Z_SYNC_FLUSH||e===i.Z_FULL_FLUSH||e===i.Z_FINISH||e===i.Z_BLOCK}function T(e,r){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,n.call(this,e),e.flush&&!M(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!M(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||i.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:i.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!a.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new i.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){P(s),s._hadError=!0;var a=new Error(e);a.errno=r,a.code=t.codes[r],s.emit("error",a)};var l=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(l=e.level);var u=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,l,e.memLevel||t.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=a.allocUnsafe(this._chunkSize),this._offset=0,this._level=l,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function P(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function F(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),t.Deflate=b,t.Inflate=w,t.Gzip=x,t.Gunzip=_,t.DeflateRaw=A,t.InflateRaw=E,t.Unzip=S,t.createDeflate=function(e){return new b(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new A(e)},t.createInflateRaw=function(e){return new E(e)},t.createGzip=function(e){return new x(e)},t.createGunzip=function(e){return new _(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new b(t),e,r)},t.deflateSync=function(e,t){return y(new b(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new x(t),e,r)},t.gzipSync=function(e,t){return y(new x(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new A(t),e,r)},t.deflateRawSync=function(e,t){return y(new A(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new S(t),e,r)},t.unzipSync=function(e,t){return y(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new w(t),e,r)},t.inflateSync=function(e,t){return y(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new _(t),e,r)},t.gunzipSync=function(e,t){return y(new _(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new E(t),e,r)},t.inflateRawSync=function(e,t){return y(new E(t),e)},o.inherits(T,n),T.prototype.params=function(r,a,n){if(rt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(a!=t.Z_FILTERED&&a!=t.Z_HUFFMAN_ONLY&&a!=t.Z_RLE&&a!=t.Z_FIXED&&a!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+a);if(this._level!==r||this._strategy!==a){var o=this;this.flush(i.Z_SYNC_FLUSH,(function(){s(o._handle,"zlib binding closed"),o._handle.params(r,a),o._hadError||(o._level=r,o._strategy=a,n&&n())}))}else e.nextTick(n)},T.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},T.prototype._flush=function(e){this._transform(a.alloc(0),"",e)},T.prototype.flush=function(t,r){var n=this,o=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=i.Z_FULL_FLUSH),o.ended?r&&e.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",(function(){return n.flush(t,r)})):(this._flushFlag=t,this.write(a.alloc(0),"",r))},T.prototype.close=function(t){P(this,t),e.nextTick(F,this)},T.prototype._transform=function(e,t,r){var n,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||a.isBuffer(e)?this._handle?(s?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||i.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},T.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,c=this,f="function"==typeof r;if(!f){var d,h=[],p=0;this.on("error",(function(e){d=e})),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw d;if(p>=l)throw P(this),new RangeError(u);var v=a.concat(h,p);return P(this),v}s(this._handle,"zlib binding closed");var g=this._handle.write(t,e,o,n,this._buffer,this._offset,i);function y(l,u){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var d=i-u;if(s(d>=0,"have should not go down"),d>0){var m=c._buffer.slice(c._offset,c._offset+d);c._offset+=d,f?c.push(m):(h.push(m),p+=m.length)}if((0===u||c._offset>=c._chunkSize)&&(i=c._chunkSize,c._offset=0,c._buffer=a.allocUnsafe(c._chunkSize)),0===u){if(o+=n-l,n=l,!f)return!0;var v=c._handle.write(t,e,o,n,c._buffer,c._offset,c._chunkSize);return v.callback=y,void(v.buffer=e)}if(!f)return!1;r()}}g.buffer=e,g.callback=y},o.inherits(b,T),o.inherits(w,T),o.inherits(x,T),o.inherits(_,T),o.inherits(A,T),o.inherits(E,T),o.inherits(S,T)}).call(this,r(5))},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],a=t[1];return 3*(r+a)/4-a},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));1===n?(t=e[r-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var n,i,o=[],s=t;s>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,a,n){var i,o,s=8*n-a-1,l=(1<>1,c=-7,f=r?n-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=d,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=a;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,a),i-=u}return(h?-1:1)*o*Math.pow(2,i-a)},t.write=function(e,t,r,a,n,i){var o,s,l,u=8*i-n-1,c=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=a?0:i-1,p=a?1:-1,m=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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,n),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;e[r+h]=255&s,h+=p,s/=256,n-=8);for(o=o<0;e[r+h]=255&o,h+=p,o/=256,u-=8);e[r+h-p]|=128*m}},function(e,t,r){e.exports=n;var a=r(18).EventEmitter;function n(){a.call(this)}r(6)(n,a),n.Readable=r(35),n.Writable=r(113),n.Duplex=r(114),n.Transform=r(115),n.PassThrough=r(116),n.Stream=n,n.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===a.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var a=r(25).Buffer,n=r(109);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,t.copy(r,n),s+=o.data.length,o=o.next;return i},e}(),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var a=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(n.call(setTimeout,a,arguments),clearTimeout)},t.setInterval=function(){return new i(n.call(setInterval,a,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(a,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(111),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(4))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var a,n,i,o,s,l=1,u={},c=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?a=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},a=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(n=f.documentElement,a=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):a=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),a=function(t){e.postMessage(o+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;rt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,n(this.init_done,"close before init"),n(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,a,n,i,o){return this._write(!0,e,t,r,a,n,i,o)},c.prototype.writeSync=function(e,t,r,a,n,i,o){return this._write(!1,e,t,r,a,n,i,o)},c.prototype._write=function(r,i,o,s,l,u,c,f){if(n.equal(arguments.length,8),n(this.init_done,"write before init"),n(this.mode!==t.NONE,"already finalized"),n.equal(!1,this.write_in_progress,"write already in progress"),n.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,n.equal(!1,void 0===i,"must provide flush value"),this.write_in_progress=!0,i!==t.Z_NO_FLUSH&&i!==t.Z_PARTIAL_FLUSH&&i!==t.Z_SYNC_FLUSH&&i!==t.Z_FULL_FLUSH&&i!==t.Z_FINISH&&i!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=e.alloc(0),l=0,s=0),this.strm.avail_in=l,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=u,this.strm.next_out=c,this.flush=i,!r)return this._process(),this._checkError()?this._afterSync():void 0;var d=this;return a.nextTick((function(){d._process(),d._after()})),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,r,a,i,o){n(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),n(e>=8&&e<=15,"invalid windowBits"),n(r>=-1&&r<=9,"invalid compression level"),n(a>=1&&a<=9,"invalid memlevel"),n(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,a,i,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,r,a,n,l){switch(this.level=e,this.windowBits=r,this.memLevel=a,this.strategy=n,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new i,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=l,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=o.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=c}).call(this,r(7).Buffer,r(5))},function(e,t,r){"use strict"; + */function n(e,t){if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);n=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(e[s],t[s],r,a))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function x(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,a){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(a=r,r=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),a=(r&&r.name?" ("+r.name+").":".")+(a?" "+a:"."),e&&!n&&g(n,r,"Missing expected exception"+a);var i="string"==typeof a,s=!e&&n&&!r;if((!e&&o.isError(n)&&i&&x(n,r)||s)&&g(n,r,"Got unwanted exception"+a),e&&n&&r&&!x(n,r)||!e&&n)throw n}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(v(e.actual),128)+" "+e.operator+" "+m(v(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var a=r.stack,n=p(t),i=a.indexOf("\n"+n);if(i>=0){var o=a.indexOf("\n",i+1);a=a.substring(o+1)}this.stack=a}}},o.inherits(d.AssertionError,Error),d.fail=g,d.ok=y,d.equal=function(e,t,r){e!=t&&g(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){b(e,t,!1)||g(e,t,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,r){b(e,t,!0)||g(e,t,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,r){b(e,t,!1)&&g(e,t,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,r,a){b(t,r,!0)&&g(t,r,a,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",d.notStrictEqual)},d.throws=function(e,t,r){_(!0,e,t,r)},d.doesNotThrow=function(e,t,r){_(!1,e,t,r)},d.ifError=function(e){if(e)throw e},d.strict=a((function e(t,r){t||g(t,!0,r,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var A=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(32);Object.defineProperty(t,"CopyShader",{enumerable:!0,get:function(){return h(a).default}});var n=r(10);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return h(n).default}});var i=r(46);Object.defineProperty(t,"ShaderPass",{enumerable:!0,get:function(){return h(i).default}});var o=r(81);Object.defineProperty(t,"RenderingPass",{enumerable:!0,get:function(){return h(o).default}});var s=r(82);Object.defineProperty(t,"TexturePass",{enumerable:!0,get:function(){return h(s).default}});var l=r(83);Object.defineProperty(t,"RenderPass",{enumerable:!0,get:function(){return h(l).default}});var u=r(47);Object.defineProperty(t,"MaskPass",{enumerable:!0,get:function(){return h(u).default}});var c=r(48);Object.defineProperty(t,"ClearMaskPass",{enumerable:!0,get:function(){return h(c).default}});var f=r(84);Object.defineProperty(t,"ClearPass",{enumerable:!0,get:function(){return h(f).default}});var d=r(85);function h(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h(d).default}})},function(e,t,r){var a,n,i,o,s;a=r(184),n=r(77).utf8,i=r(185),o=r(77).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):n.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var r=a.bytesToWords(e),l=8*e.length,u=1732584193,c=-271733879,f=-1732584194,d=271733878,h=0;h>>24)|4278255360&(r[h]<<24|r[h]>>>8);r[l>>>5]|=128<>>9<<4)]=l;var p=s._ff,m=s._gg,v=s._hh,g=s._ii;for(h=0;h>>0,c=c+b>>>0,f=f+w>>>0,d=d+x>>>0}return a.endian([u,c,f,d])})._ff=function(e,t,r,a,n,i,o){var s=e+(t&r|~t&a)+(n>>>0)+o;return(s<>>32-i)+t},s._gg=function(e,t,r,a,n,i,o){var s=e+(t&a|r&~a)+(n>>>0)+o;return(s<>>32-i)+t},s._hh=function(e,t,r,a,n,i,o){var s=e+(t^r^a)+(n>>>0)+o;return(s<>>32-i)+t},s._ii=function(e,t,r,a,n,i,o){var s=e+(r^(t|~a))+(n>>>0)+o;return(s<>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=a.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?o.bytesToString(r):a.bytesToHex(r)}},function(e,t,r){function a(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var a=r(r.s=ENTRY_MODULE);return a.default||a}var n="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+n+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e,t,a){var s={};s[a]=[];var l=t.toString(),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return s;for(var c,f=u[1],d=new RegExp("(\\\\n|\\W)"+o(f)+i,"g");c=d.exec(l);)"dll-reference"!==c[3]&&s[a].push(c[3]);for(d=new RegExp("\\("+o(f)+'\\("(dll-reference\\s('+n+'))"\\)\\)'+i,"g");c=d.exec(l);)e[c[2]]||(s[a].push(c[1]),e[c[2]]=r(c[1]).m),s[c[2]]=s[c[2]]||[],s[c[2]].push(c[4]);for(var h,p=Object.keys(s),m=0;m0}),!1)}e.exports=function(e,t){t=t||{};var n={main:r.m},i=t.all?{main:Object.keys(n.main)}:function(e,t){for(var r={main:[t]},a={main:[]},n={main:{}};l(r);)for(var i=Object.keys(r),o=0;o-1?a:i.nextTick;y.WritableState=g;var u=r(20);u.inherits=r(6);var c={deprecate:r(58)},f=r(56),d=r(26).Buffer,h=n.Uint8Array||function(){};var p,m=r(57);function v(){}function g(e,t){s=s||r(14),e=e||{};var a=t instanceof s;this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:a&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,a=r.sync,n=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,a,n){--t.pendingcb,r?(i.nextTick(n,a),i.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",a)):(n(a),e._writableState.errorEmitted=!0,e.emit("error",a),E(e,t))}(e,r,a,t,n);else{var o=_(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),a?l(w,e,r,o,n):w(e,r,o,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(s=s||r(14),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,r,a,n,i,o){t.writelen=a,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,i,t.onwrite),t.sync=!1}function w(e,t,r,a){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,a(),E(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var a=t.bufferedRequestCount,n=new Array(a),i=t.corkedRequestsFree;i.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,b(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),E(e,t)}))}function E(e,t){var r=_(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(A,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(y,f),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var a,n=this._writableState,o=!1,s=!n.objectMode&&(a=e,d.isBuffer(a)||a instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}(this,r):(s||function(e,t,r,a){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),i.nextTick(a,o),n=!1),n}(this,n,e,r))&&(n.pendingcb++,o=function(e,t,r,a,n,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,a,n);a!==o&&(r=!0,n="buffer",a=o)}var s=t.objectMode?1:a.length;t.length+=s;var l=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var a=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||a.finished||function(e,t,r){t.ending=!0,E(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,a,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(5),r(113).setImmediate,r(4))},function(e,t,r){"use strict";var a=r(132),n=r(39),i=r(16),o=r(61),s=r(134);function l(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof o)return p(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var n,i,s,c=u.call(this,t,r);return c&&(n=c.schema,t=c.root,s=c.baseId),n instanceof o?i=n.validate||e.call(this,n.schema,t,void 0,s):void 0!==n&&(i=p(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,s)),i}function u(e,t){var r=a.parse(t),n=v(r),i=m(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==i){var s=y(n),l=this._refs[s];if("string"==typeof l)return c.call(this,e,l,r);if(l instanceof o)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[s])instanceof o))return;if(l.validate||this._compile(l),s==y(t))return{schema:l,root:e,baseId:i};e=l}if(!e.schema)return;i=m(this._getId(e.schema))}return d.call(this,r,i,e.schema,e)}function c(e,t,r){var a=u.call(this,e,t);if(a){var n=a.schema,i=a.baseId;e=a.root;var o=this._getId(n);return o&&(i=b(i,o)),d.call(this,r,i,n,e)}}e.exports=l,l.normalizeId=y,l.fullPath=m,l.url=b,l.ids=function(e){var t=y(this._getId(e)),r={"":t},o={"":m(t,!1)},l={},u=this;return s(e,{allKeys:!0},(function(e,t,s,c,f,d,h){if(""!==t){var p=u._getId(e),m=r[c],v=o[c]+"/"+f;if(void 0!==h&&(v+="/"+("number"==typeof h?h:i.escapeFragment(h))),"string"==typeof p){p=m=y(m?a.resolve(m,p):p);var g=u._refs[p];if("string"==typeof g&&(g=u._refs[g]),g&&g.schema){if(!n(e,g.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=y(v))if("#"==p[0]){if(l[p]&&!n(e,l[p]))throw new Error('id "'+p+'" resolves to more than one schema');l[p]=e}else u._refs[p]=v}r[t]=m,o[t]=v}})),l},l.inlineRef=p,l.schema=u;var f=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var n=e.fragment.split("/"),o=1;o{if(e.file){let r=new FileReader;r.onload=function(){let e=this.result,r=new Uint8Array(e);t(r)},r.readAsArrayBuffer(e.file)}else if(e.url){let r=new XMLHttpRequest;r.open("GET",e.url,!0),r.responseType="arraybuffer",r.onloadend=function(){if(200===r.status){let e=new Uint8Array(r.response||r.responseText);t(e)}},r.send()}else e.raw?e.raw instanceof Uint8Array?t(e.raw):t(new Uint8Array(e.raw)):r()})}function o(e,t){return new Promise((r,a)=>{if("compound"===e.type)if(e.value.hasOwnProperty("blocks")&&(e.value.hasOwnProperty("palette")||e.value.hasOwnProperty("palettes"))){let a;if(e.value.hasOwnProperty("palette"))a=e.value.palette.value.value;else{if(void 0===t&&(t=0),t>=e.value.palettes.value.value.length||!e.value.palettes.value.value[t])return void console.warn("Specified palette index ("+t+") is outside of available palettes ("+e.value.palettes.value.value.length+")");a=e.value.palettes.value.value[t].value}let n=[];for(let e=0;e{let n=e.value.Width.value,i=e.value.Height.value,o=e.value.Length.value,s=function(t,r,a){let i=(r*o+a)*n+t;return{id:255&(e.value.Blocks.value[i]||0),data:e.value.Data.value[i]||0}},l=function(e,r){let a=t.blocks[e+":"+r];return a||(console.warn("Missing legacy mapping for "+e+":"+r),"minecraft:air")},u=[];for(let e=0;e{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);o(r).then(e=>{t(e)})})})},n.prototype.schematicToModels=function(e,t){i(e).then(e=>{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);let a=new XMLHttpRequest;a.open("GET","https://minerender.org/res/idsToNames.json",!0),a.onloadend=function(){if(200===a.status){console.log(a.response||a.responseText);let e=JSON.parse(a.response||a.responseText);s(r,e).then(e=>t(e))}},a.send()})})},n.loadNBT=i,n.parseStructureData=o,n.parseSchematicData=s;let l={stained_glass:function(e){return e.color.value+"_stained_glass"},planks:function(e){return e.variant.value+"_planks"}};n.prototype.constructor=n,window.ModelConverter=n,t.a=n},function(e,t,r){const a=r(106),n=r(123).ProtoDef,i=r(182).compound,o=JSON.stringify(r(183)),s=o.replace(/(i[0-9]+)/g,"l$1");function l(e){const t=new n;return t.addType("compound",i),t.addTypes(JSON.parse(e?s:o)),t}const u=l(!1),c=l(!0);function f(e,t){return(t?c:u).parsePacketBuffer("nbt",e).data}const d=function(e){let t=!0;return 31!==e[0]&&(t=!1),139!==e[1]&&(t=!1),t};e.exports={writeUncompressed:function(e,t){return(t?c:u).createPacketBuffer("nbt",e)},parseUncompressed:f,simplify:function e(t){return function t(r,a){return"compound"===a?Object.keys(r).reduce((function(t,a){return t[a]=e(r[a]),t}),{}):"list"===a?r.value.map((function(e){return t(e,r.type)})):r}(t.value,t.type)},parse:function(e,t,r){let n=!1;"function"==typeof t?r=t:n=t,d(e)?a.gunzip(e,(function(t,a){t?r(t,e):r(null,f(a,n))})):r(null,f(e,n))},proto:u,protoLE:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(){function e(e,t){for(var r=0;r4?9:0)}function $(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ae(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ne(e,t){var r,a,n=e.max_chain_length,i=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-D?e.strstart-(e.w_size-D):0,u=e.window,c=e.w_mask,f=e.prev,d=e.strstart+N,h=u[i+o-1],p=u[i+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===h&&u[r]===u[i]&&u[++r]===u[i+1]){i+=2,r++;do{}while(u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&io){if(e.match_start=t,o=a,a>=s)break;h=u[i+o-1],p=u[i+o]}}}while((t=f[t&c])>l&&0!=--n);return o<=e.lookahead?o:e.lookahead}function ie(e){var t,r,a,i,l,u,c,f,d,h,p=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-D)){n.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;do{a=e.head[--t],e.head[t]=a>=p?a-p:0}while(--r);t=r=p;do{a=e.prev[--t],e.prev[t]=a>=p?a-p:0}while(--r);i+=p}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,f=e.strstart+e.lookahead,d=i,h=void 0,(h=u.avail_in)>d&&(h=d),r=0===h?0:(u.avail_in-=h,n.arraySet(c,u.input,u.next_in,h,f),1===u.state.wrap?u.adler=o(u.adler,c,h,f):2===u.state.wrap&&(u.adler=s(u.adler,c,h,f)),u.next_in+=h,u.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=I)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I)if(a=i._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-I,a=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<15&&(s=2,a-=16),i<1||i>T||r!==M||a<8||a>15||t<0||t>9||o<0||o>A)return K(e,v);8===a&&(a=9);var l=new ue;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=a,l.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ie(e),0===e.lookahead&&t===u)return Y;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+r;if((0===e.strstart||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,te(e,!1),0===e.strm.avail_out))return Y;if(e.strstart-e.block_start>=e.w_size-D&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),Y)})),new le(4,4,8,4,oe),new le(4,5,16,8,oe),new le(4,6,32,32,oe),new le(4,4,16,16,se),new le(8,16,32,32,se),new le(8,16,128,128,se),new le(8,32,128,256,se),new le(32,128,258,1024,se),new le(32,258,258,4096,se)],t.deflateInit=function(e,t){return de(e,t,M,P,F,E)},t.deflateInit2=de,t.deflateReset=fe,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?v:(e.state.gzhead=t,p):v},t.deflate=function(e,t){var r,n,o,l;if(!e||!e.state||t>h||t<0)return e?K(e,v):v;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===X&&t!==d)return K(e,0===e.avail_out?y:v);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===j)if(2===n.wrap)e.adler=0,re(n,31),re(n,139),re(n,8),n.gzhead?(re(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),re(n,255&n.gzhead.time),re(n,n.gzhead.time>>8&255),re(n,n.gzhead.time>>16&255),re(n,n.gzhead.time>>24&255),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(re(n,255&n.gzhead.extra.length),re(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=s(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=B):(re(n,0),re(n,0),re(n,0),re(n,0),re(n,0),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,Z),n.status=H);else{var g=M+(n.w_bits-8<<4)<<8;g|=(n.strategy>=x||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(g|=U),g+=31-g%31,n.status=H,ae(n,g),0!==n.strstart&&(ae(n,e.adler>>>16),ae(n,65535&e.adler)),e.adler=1}if(n.status===B)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending!==n.pending_buf_size));)re(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=V)}else n.status=V;if(n.status===V)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=z)}else n.status=z;if(n.status===z)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=G)}else n.status=G;if(n.status===G&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ee(e),n.pending+2<=n.pending_buf_size&&(re(n,255&e.adler),re(n,e.adler>>8&255),e.adler=0,n.status=H)):n.status=H),0!==n.pending){if(ee(e),0===e.avail_out)return n.last_flush=-1,p}else if(0===e.avail_in&&J(t)<=J(r)&&t!==d)return K(e,y);if(n.status===X&&0!==e.avail_in)return K(e,y);if(0!==e.avail_in||0!==n.lookahead||t!==u&&n.status!==X){var b=n.strategy===x?function(e,t){for(var r;;){if(0===e.lookahead&&(ie(e),0===e.lookahead)){if(t===u)return Y;break}if(e.match_length=0,r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):n.strategy===_?function(e,t){for(var r,a,n,o,s=e.window;;){if(e.lookahead<=N){if(ie(e),e.lookahead<=N&&t===u)return Y;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(a=s[n=e.strstart-1])===s[++n]&&a===s[++n]&&a===s[++n]){o=e.strstart+N;do{}while(a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&ne.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=i._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):a[n.level].func(n,t);if(b!==q&&b!==Q||(n.status=X),b===Y||b===q)return 0===e.avail_out&&(n.last_flush=-1),p;if(b===W&&(t===c?i._tr_align(n):t!==h&&(i._tr_stored_block(n,0,0,!1),t===f&&($(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),ee(e),0===e.avail_out))return n.last_flush=-1,p}return t!==d?p:n.wrap<=0?m:(2===n.wrap?(re(n,255&e.adler),re(n,e.adler>>8&255),re(n,e.adler>>16&255),re(n,e.adler>>24&255),re(n,255&e.total_in),re(n,e.total_in>>8&255),re(n,e.total_in>>16&255),re(n,e.total_in>>24&255)):(ae(n,e.adler>>>16),ae(n,65535&e.adler)),ee(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?p:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==j&&t!==B&&t!==V&&t!==z&&t!==G&&t!==H&&t!==X?K(e,v):(e.state=null,t===H?K(e,g):p):v},t.deflateSetDictionary=function(e,t){var r,a,i,s,l,u,c,f,d=t.length;if(!e||!e.state)return v;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==j||r.lookahead)return v;for(1===s&&(e.adler=o(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&($(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new n.Buf8(r.w_size),n.arraySet(f,t,d-r.w_size,r.w_size,0),t=f,d=r.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,ie(r);r.lookahead>=I;){a=r.strstart,i=r.lookahead-(I-1);do{r.ins_h=(r.ins_h<>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{i=i+(n=n+t[a++]|0)|0}while(--o);n%=65521,i%=65521}return n|i<<16|0}},function(e,t,r){"use strict";var a=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,n){var i=a,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}},function(e,t,r){"use strict";var a=r(11),n=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var o=new a.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&i||!e.subarray&&n))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var r="",o=0;o>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new a.Buf8(e.length),r=0,n=t.length;r4)u[a++]=65533,r+=i-1;else{for(n&=2===i?31:3===i?15:7;i>1&&r1?u[a++]=65533:n<65536?u[a++]=n:(n-=65536,u[a++]=55296|n>>10&1023,u[a++]=56320|1023&n)}return l(u,a)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+o[e[r]]>t?r:t}},function(e,t,r){"use strict";var a=r(11),n=r(50),i=r(51),o=r(103),s=r(104),l=0,u=1,c=2,f=4,d=5,h=6,p=0,m=1,v=2,g=-2,y=-3,b=-4,w=-5,x=8,_=1,A=2,E=3,S=4,M=5,T=6,P=7,F=8,O=9,L=10,C=11,k=12,R=13,I=14,N=15,D=16,U=17,j=18,B=19,V=20,z=21,G=22,H=23,X=24,Y=25,W=26,q=27,Q=28,Z=29,K=30,J=31,$=32,ee=852,te=592,re=15;function ae(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ne(){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 a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(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=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new a.Buf32(ee),t.distcode=t.distdyn=new a.Buf32(te),t.sane=1,t.back=-1,p):g}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):g}function se(e,t){var r,a;return e&&e.state?(a=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?g:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=r,a.wbits=t,oe(e))):g}function le(e,t){var r,a;return e?(a=new ne,e.state=a,a.window=null,(r=se(e,t))!==p&&(e.state=null),r):g}var ue,ce,fe=!0;function de(e){if(fe){var t;for(ue=new a.Buf32(512),ce=new a.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,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,ce,0,e.work,{bits:5}),fe=!1}e.lencode=ue,e.lenbits=9,e.distcode=ce,e.distbits=5}function he(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(a.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),a.arraySet(o.window,t,r-n,i,o.wnext),(n-=i)?(a.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=i(r.check,Te,2,0),se=0,le=0,r.mode=A;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=K;break}if((15&se)!==x){e.msg="unknown compression method",r.mode=K;break}if(le-=4,_e=8+(15&(se>>>=4)),0===r.wbits)r.wbits=_e;else if(_e>r.wbits){e.msg="invalid window size",r.mode=K;break}r.dmax=1<<_e,e.adler=r.check=1,r.mode=512&se?L:k,se=0,le=0;break;case A:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8&1),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=E;case E:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,Te[2]=se>>>16&255,Te[3]=se>>>24&255,r.check=i(r.check,Te,4,0)),se=0,le=0,r.mode=S;case S:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=M;case M:if(1024&r.flags){for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0}else r.head&&(r.head.extra=null);r.mode=T;case T:if(1024&r.flags&&((fe=r.length)>ie&&(fe=ie),fe&&(r.head&&(_e=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),a.arraySet(r.head.extra,ee,re,fe,_e)),512&r.flags&&(r.check=i(r.check,ee,fe,re)),ie-=fe,re+=fe,r.length-=fe),r.length))break e;r.length=0,r.mode=P;case P:if(2048&r.flags){if(0===ie)break e;fe=0;do{_e=ee[re+fe++],r.head&&_e&&r.length<65536&&(r.head.name+=String.fromCharCode(_e))}while(_e&&fe>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=k;break;case L:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>=7&le,le-=7&le,r.mode=q;break}for(;le<3;){if(0===ie)break e;ie--,se+=ee[re++]<>>=1)){case 0:r.mode=I;break;case 1:if(de(r),r.mode=V,t===h){se>>>=2,le-=2;break e}break;case 2:r.mode=U;break;case 3:e.msg="invalid block type",r.mode=K}se>>>=2,le-=2;break;case I:for(se>>>=7&le,le-=7≤le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=K;break}if(r.length=65535&se,se=0,le=0,r.mode=N,t===h)break e;case N:r.mode=D;case D:if(fe=r.length){if(fe>ie&&(fe=ie),fe>oe&&(fe=oe),0===fe)break e;a.arraySet(te,ee,re,fe,ne),ie-=fe,re+=fe,oe-=fe,ne+=fe,r.length-=fe;break}r.mode=k;break;case U:for(;le<14;){if(0===ie)break e;ie--,se+=ee[re++]<>>=5,le-=5,r.ndist=1+(31&se),se>>>=5,le-=5,r.ncode=4+(15&se),se>>>=4,le-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=K;break}r.have=0,r.mode=j;case j:for(;r.have>>=3,le-=3}for(;r.have<19;)r.lens[Pe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},Ae=s(l,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid code lengths set",r.mode=K;break}r.have=0,r.mode=B;case B:for(;r.have>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=ve,le-=ve,r.lens[r.have++]=ye;else{if(16===ye){for(Se=ve+2;le>>=ve,le-=ve,0===r.have){e.msg="invalid bit length repeat",r.mode=K;break}_e=r.lens[r.have-1],fe=3+(3&se),se>>>=2,le-=2}else if(17===ye){for(Se=ve+3;le>>=ve)),se>>>=3,le-=3}else{for(Se=ve+7;le>>=ve)),se>>>=7,le-=7}if(r.have+fe>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=K;break}for(;fe--;)r.lens[r.have++]=_e}}if(r.mode===K)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=K;break}if(r.lenbits=9,Ee={bits:r.lenbits},Ae=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid literal/lengths set",r.mode=K;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},Ae=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,Ae){e.msg="invalid distances set",r.mode=K;break}if(r.mode=V,t===h)break e;case V:r.mode=z;case z:if(ie>=6&&oe>=258){e.next_out=ne,e.avail_out=oe,e.next_in=re,e.avail_in=ie,r.hold=se,r.bits=le,o(e,ce),ne=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,ie=e.avail_in,se=r.hold,le=r.bits,r.mode===k&&(r.back=-1);break}for(r.back=0;ge=(Me=r.lencode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,r.length=ye,0===ge){r.mode=W;break}if(32&ge){r.back=-1,r.mode=k;break}if(64&ge){e.msg="invalid literal/length code",r.mode=K;break}r.extra=15&ge,r.mode=G;case G:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=H;case H:for(;ge=(Me=r.distcode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,64&ge){e.msg="invalid distance code",r.mode=K;break}r.offset=ye,r.extra=15&ge,r.mode=X;case X:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=K;break}r.mode=Y;case Y:if(0===oe)break e;if(fe=ce-oe,r.offset>fe){if((fe=r.offset-fe)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=K;break}fe>r.wnext?(fe-=r.wnext,pe=r.wsize-fe):pe=r.wnext-fe,fe>r.length&&(fe=r.length),me=r.window}else me=te,pe=ne-r.offset,fe=r.length;fe>oe&&(fe=oe),oe-=fe,r.length-=fe;do{te[ne++]=me[pe++]}while(--fe);0===r.length&&(r.mode=z);break;case W:if(0===oe)break e;te[ne++]=r.length,oe--,r.mode=z;break;case q:if(r.wrap){for(;le<32;){if(0===ie)break e;ie--,se|=ee[re++]<0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),a?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?x(e,o,t,!1):M(e,o)):x(e,o,t,!1))):a||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),O(e)}function M(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var a;ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++a}return t.length-=a,n}(e,t):function(e,t){var r=u.allocUnsafe(e),a=t.head,n=1;a.data.copy(r),e-=a.data.length;for(;a=a.next;){var i=a.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++n,a.next?t.head=a.next:t.head=t.tail=null):(t.head=a,a.data=i.slice(o));break}++n}return t.length-=n,r}(e,t);return a}(e,t.buffer,t.decoder),r);var r}function C(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(k,t,e))}function k(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var r=0,a=e.length;r=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):E(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&C(this),null;var a,n=t.needReadable;return h("need readable",n),(0===t.length||t.length-e0?L(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&C(this)),null!==a&&this.emit("data",a),a},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var l=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?c:b;function u(t,a){h("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",v),e.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",b),r.removeListener("data",m),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){h("onend"),e.end()}i.endEmitted?n.nextTick(l):r.once("end",l),e.on("unpipe",u);var f=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",f);var d=!1;var p=!1;function m(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==R(i.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(t){h("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){h("onfinish"),e.removeListener("close",g),b()}function b(){h("unpipe"),r.unpipe(e)}return r.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i=i)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(e){return"[Circular]"}default:return e}})),l=a[r];r=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),p(r)?a.showHidden=r:r&&t._extend(a,r),y(a.showHidden)&&(a.showHidden=!1),y(a.depth)&&(a.depth=2),y(a.colors)&&(a.colors=!1),y(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=l),c(a,e,a.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function c(e,r,a){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(a,e);return g(n)||(n=c(e,n,a)),n}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(A(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return f(r)}var u,w="",E=!1,S=["{","}"];(h(r)&&(E=!0,S=["[","]"]),A(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),x(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+f(r)),0!==o.length||E&&0!=r.length?a<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=E?function(e,t,r,a,n){for(var i=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,w,S)):S[0]+w+S[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,a,n,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),P(a,n)||(o="["+n+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(i&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===E(e)}function _(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function A(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(y(i)&&(i=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var a=e.pid;o[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,a,e)}}else o[r]=function(){};return o[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=b,t.isObject=w,t.isDate=x,t.isError=_,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(122);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(6),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),a=r.length;a--;)e[r[a]]=t[r[a]];return e};var F="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(F&&e[F]){var t;if("function"!=typeof(t=e[F]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,F,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,a=new Promise((function(e,a){t=e,r=a})),n=[],i=0;i",y=h?">":"<",b=void 0;if(v){var w=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+i,_="exclType"+i,A="exclIsNumber"+i,E="' + "+(T="op"+i)+" + '";n+=" var schemaExcl"+i+" = "+w+"; ",n+=" var "+x+"; var "+_+" = typeof "+(w="schemaExcl"+i)+"; if ("+_+" != 'boolean' && "+_+" != 'undefined' && "+_+" != 'number') { ";var S;b=p;(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var M=n;n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+_+" == 'number' ? ( ("+x+" = "+a+" === undefined || "+w+" "+g+"= "+a+") ? "+f+" "+y+"= "+w+" : "+f+" "+y+" "+a+" ) : ( ("+x+" = "+w+" === true) ? "+f+" "+y+"= "+a+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { var op"+i+" = "+x+" ? '"+g+"' : '"+g+"='; ",void 0===s&&(b=p,u=e.errSchemaPath+"/"+p,a=w,d=v)}else{E=g;if((A="number"==typeof m)&&d){var T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" ( "+a+" === undefined || "+m+" "+g+"= "+a+" ? "+f+" "+y+"= "+m+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { "}else{A&&void 0===s?(x=!0,b=p,u=e.errSchemaPath+"/"+p,a=m,y+="="):(A&&(a=Math[h?"min":"max"](m,s)),m===(!A||a)?(x=!0,b=p,u=e.errSchemaPath+"/"+p,y+="="):(x=!1,E+="="));T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+" "+y+" "+a+" || "+f+" !== "+f+") { "}}b=b||t,(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+T+", limit: "+a+", exclusive: "+x+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+E+" ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";M=n;return n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+".length "+("maxItems"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s;var h="maxLength"==t?">":"<";n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?n+=" "+f+".length ":n+=" ucs2length("+f+") ",n+=" "+h+" "+a+") { ";var p=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" Object.keys("+f+").length "+("maxProperties"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},function(e){e.exports=JSON.parse('{"switch":{"title":"switch","type":"array","items":[{"enum":["switch"]},{"type":"object","properties":{"compareTo":{"$ref":"definitions#/definitions/contextualizedFieldName"},"compareToValue":{"type":"string"},"fields":{"type":"object","patternProperties":{"^[-a-zA-Z0-9 _:]+$":{"$ref":"dataType"}},"additionalProperties":false},"default":{"$ref":"dataType"}},"oneOf":[{"required":["compareTo","fields"]},{"required":["compareToValue","fields"]}],"additionalProperties":false}],"additionalItems":false},"option":{"title":"option","type":"array","items":[{"enum":["option"]},{"$ref":"dataType"}],"additionalItems":false}}')},function(e,t,r){"use strict";(function(t,a){var n;e.exports=S,S.ReadableState=E;r(19).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(71),s=r(7).Buffer,l=t.Uint8Array||function(){};var u,c=r(175);u=c&&c.debuglog?c.debuglog("stream"):function(){};var f,d,h,p=r(176),m=r(72),v=r(73).getHighWaterMark,g=r(17).codes,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,x=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6)(S,o);var _=m.errorOrDestroy,A=["error","close","destroy","pause","resume"];function E(e,t,a){n=n||r(18),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",a),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(27).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(18),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function M(e,t,r,a,n){u("readableAddChunk",t);var i,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}(e,o);else if(n||(i=function(e,t){var r;a=t,s.isBuffer(a)||a instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var a;return r}(o,t)),i)_(e,i);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),a)o.endEmitted?_(e,new x):T(e,o,t,!0);else if(o.ended)_(e,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):C(e,o)):T(e,o,t,!1)}else a||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,a.nextTick(L,e))}function L(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function C(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(k,e,t))}function k(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){u("readable nexttick read 0"),e.read(0)}function N(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,a.nextTick(B,t,e))}function B(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function V(e,t){for(var r=0,a=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=F(e,t))&&t.ended)return 0===t.length&&j(this),null;var a,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==a&&this.emit("data",a),a},S.prototype._read=function(e){_(this,new w("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?l:v;function s(t,a){u("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",v),r.removeListener("data",d),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){u("onend"),e.end()}n.endEmitted?a.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var f=!1;function d(t){u("ondata");var a=e.write(t);u("dest.write",a),!1===a&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!f&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){u("onerror",t),v(),e.removeListener("error",h),0===i(e,"error")&&_(e,t)}function p(){e.removeListener("finish",m),v()}function m(){u("onfinish"),e.removeListener("close",p),v()}function v(){u("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",m),e.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?O(this):n.reading||a.nextTick(I,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&a.nextTick(R,this),r},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||a.nextTick(R,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(N,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(a=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,L(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=f.destroy,S.prototype._undestroy=f.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this,r(4),r(5))},function(e,t,r){"use strict";e.exports=c;var a=r(17).codes,n=a.ERR_METHOD_NOT_IMPLEMENTED,i=a.ERR_MULTIPLE_CALLBACK,o=a.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=a.ERR_TRANSFORM_WITH_LENGTH_0,l=r(18);function u(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(null===a)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),a(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{i=!0,o.needsUpdate=!0,u&&(u.needsUpdate=!0);let c=-1;32===o.image.height?c=0:64===o.image.height?c=1:console.error("Couldn't detect texture version. Invalid dimensions: "+o.image.width+"x"+o.image.height),console.log("Skin Texture Version: "+c),o.magFilter=t.NearestFilter,o.minFilter=t.NearestFilter,o.anisotropy=0,u&&(u.magFilter=t.NearestFilter,u.minFilter=t.NearestFilter,u.anisotropy=0,u.format=t.RGBFormat),32===o.image.height&&(o.format=t.RGBFormat),n.attached||n._scene?console.log("[SkinRender] is attached - skipping scene init"):super.initScene((function(){n.element.dispatchEvent(new CustomEvent("skinRender",{detail:{playerModel:n.playerModel}}))})),console.log("Slim: "+f);let d=function(e,r,n,i,o){console.log("capeType: "+o);let u=new t.Object3D;u.name="headGroup",u.position.x=0,u.position.y=28,u.position.z=0,u.translateOnAxis(new t.Vector3(0,1,0),-4);let c=s(e,8,8,8,a.a.head[n],i,"head");if(c.translateOnAxis(new t.Vector3(0,1,0),4),u.add(c),n>=1){let r=s(e,8.504,8.504,8.504,a.a.hat,i,"hat",!0);r.translateOnAxis(new t.Vector3(0,1,0),4),u.add(r)}let f=new t.Object3D;f.name="bodyGroup",f.position.x=0,f.position.y=18,f.position.z=0;let d=s(e,8,12,4,a.a.body[n],i,"body");if(f.add(d),n>=1){let t=s(e,8.504,12.504,4.504,a.a.jacket,i,"jacket",!0);f.add(t)}let h=new t.Object3D;h.name="leftArmGroup",h.position.x=i?-5.5:-6,h.position.y=18,h.position.z=0,h.translateOnAxis(new t.Vector3(0,1,0),4);let p=s(e,i?3:4,12,4,a.a.leftArm[n],i,"leftArm");if(p.translateOnAxis(new t.Vector3(0,1,0),-4),h.add(p),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.leftSleeve,i,"leftSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),h.add(r)}let m=new t.Object3D;m.name="rightArmGroup",m.position.x=i?5.5:6,m.position.y=18,m.position.z=0,m.translateOnAxis(new t.Vector3(0,1,0),4);let v=s(e,i?3:4,12,4,a.a.rightArm[n],i,"rightArm");if(v.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(v),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.rightSleeve,i,"rightSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(r)}let g=new t.Object3D;g.name="leftLegGroup",g.position.x=-2,g.position.y=6,g.position.z=0,g.translateOnAxis(new t.Vector3(0,1,0),4);let y=s(e,4,12,4,a.a.leftLeg[n],i,"leftLeg");if(y.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(y),n>=1){let r=s(e,4.504,12.504,4.504,a.a.leftTrousers,i,"leftTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(r)}let b=new t.Object3D;b.name="rightLegGroup",b.position.x=2,b.position.y=6,b.position.z=0,b.translateOnAxis(new t.Vector3(0,1,0),4);let w=s(e,4,12,4,a.a.rightLeg[n],i,"rightLeg");if(w.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(w),n>=1){let r=s(e,4.504,12.504,4.504,a.a.rightTrousers,i,"rightTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(r)}let x=new t.Object3D;if(x.add(u),x.add(f),x.add(h),x.add(m),x.add(g),x.add(b),r){console.log(a.a);let e=a.a.capeRelative;"optifine"===o&&(e=a.a.capeOptifineRelative),"labymod"===o&&(e=a.a.capeLabymodRelative),e=JSON.parse(JSON.stringify(e)),console.log(e);for(let t in e)e[t].x*=r.image.width,e[t].w*=r.image.width,e[t].y*=r.image.height,e[t].h*=r.image.height;console.log(e);let n=new t.Object3D;n.name="capeGroup",n.position.x=0,n.position.y=16,n.position.z=-2.5,n.translateOnAxis(new t.Vector3(0,1,0),8),n.translateOnAxis(new t.Vector3(0,0,1),.5);let i=s(r,10,16,1,e,!1,"cape");i.rotation.x=l(10),i.translateOnAxis(new t.Vector3(0,1,0),-8),i.translateOnAxis(new t.Vector3(0,0,1),-.5),i.rotation.y=l(180),n.add(i),x.add(n)}return x}(o,u,c,f,e._capeType?e._capeType:e.optifine?"optifine":"minecraft");n.addToScene(d),n.playerModel=d,"function"==typeof r&&r()};n._skinImage=new Image,n._skinImage.crossOrigin="anonymous",n._capeImage=new Image,n._capeImage.crossOrigin="anonymous";let c=void 0!==e.cape||void 0!==e.capeUrl||void 0!==e.capeData||void 0!==e.mineskin,f=!1,d=!1,h=!1,p=new t.Texture,m=new t.Texture;if(p.image=n._skinImage,n._skinImage.onload=function(){if(n._skinImage){if(d=!0,console.log("Skin Image Loaded"),void 0===e.slim&&32!==n._skinImage.height){let e=document.createElement("canvas"),t=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,t.drawImage(n._skinImage,0,0),console.log("Slim Detection:");let r=t.getImageData(46,52,1,12).data,a=t.getImageData(54,20,1,12).data,i=!0;for(let e=3;e<48;e+=4){if(255===r[e]){i=!1;break}if(255===a[e]){i=!1;break}}console.log(i),i&&(f=!0)}if(n.options.makeNonTransparentOpaque&&32!==n._skinImage.height){let e=document.createElement("canvas"),a=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,a.drawImage(n._skinImage,0,0);let i=document.createElement("canvas"),o=i.getContext("2d");i.width=n._skinImage.width,i.height=n._skinImage.height;let s=a.getImageData(0,0,e.width,e.height),l=s.data;function r(e,t){return e>0&&t>0&&e<32&&t<32||(e>32&&t>16&&e<64&&t<32||e>16&&t>48&&e<48&&t<64)}for(let t=0;t178||r(n,i))&&(l[t+3]=255)}o.putImageData(s,0,0),console.log(i.toDataURL()),p=new t.CanvasTexture(i)}!d||!h&&c||i||o(p,m)}},n._skinImage.onerror=function(e){console.warn("Skin Image Error"),console.warn(e)},console.log("Has Cape: "+c),c?(m.image=n._capeImage,n._capeImage.onload=function(){n._capeImage&&(h=!0,console.log("Cape Image Loaded"),h&&d&&(i||o(p,m)))},n._capeImage.onerror=function(e){console.warn("Cape Image Error"),console.warn(e),h=!0,d&&(i||o(p))}):(m=null,n._capeImage=null),"string"==typeof e)0===e.indexOf("http")?n._skinImage.src=e:e.length<=16?u("https://minerender.org/nameToUuid.php?name="+e,(function(t,r){if(t)return console.log(t);console.log(r),n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e)})):e.length<=36?image.src="https://crafatar.com/skins/"+e+"?overlay":n._skinImage.src=e;else{if("object"!=typeof e)throw new Error("Invalid texture value");if(e.url?n._skinImage.src=e.url:e.data?n._skinImage.src=e.data:e.username?u("https://minerender.org/nameToUuid.php?name="+e.username,(function(t,r){if(t)return console.log(t);n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e.username)+"?overlay"})):e.uuid?n._skinImage.src="https://crafatar.com/skins/"+e.uuid+"?overlay":e.mineskin&&(n._skinImage.src="https://api.mineskin.org/render/texture/"+e.mineskin),e.cape)if(e.cape.length>36){u(e.cape.startsWith("http")?e.cape:"https://api.capes.dev/get/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else{let t="https://api.capes.dev/load/";e.capeUser?t+=e.capeUser:e.username?t+=e.username:e.uuid?t+=e.uuid:console.warn("Couldn't find a user to get a cape from"),u(t+="/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else e.capeUrl?n._capeImage.src=e.capeUrl:e.capeData?n._capeImage.src=e.capeData:e.mineskin&&(n._capeImage.src="https://api.mineskin.org/render/texture/"+e.mineskin+"/cape");f=e.slim}}resize(e,t){return this._resize(e,t)}reset(){this._skinImage=null,this._capeImage=null,this._animId&&cancelAnimationFrame(this._animId),this._canvas&&this._canvas.remove()}getPlayerModel(){return this.playerModel}getModelByName(e){return this._scene.getObjectByName(e,!0)}toggleSkinPart(e,t){this._scene.getObjectByName(e,!0).visible=t}}function s(e,r,a,n,i,o,s,l){let u=e.image.width,c=e.image.height,f=new t.BoxGeometry(r,a,n),d=new t.MeshBasicMaterial({map:e,transparent:l||!1,alphaTest:.1,side:l?t.DoubleSide:t.FrontSide});f.computeBoundingBox(),f.faceVertexUvs[0]=[];let h=["right","left","top","bottom","front","back"],p=[];for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{tolerance:0};if(!e)throw new Error("You should specify the element you want to test");"string"==typeof e&&(e=document.querySelector(e));var r=e.getBoundingClientRect();return(r.bottom-t.tolerance>0&&r.right-t.tolerance>0&&r.left+t.tolerance<(window.innerWidth||document.documentElement.clientWidth)&&r.top+t.tolerance<(window.innerHeight||document.documentElement.clientHeight))}function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0,container:""};if(!e)throw new Error("You should specify the element you want to test");if("string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={tolerance:0,container:document.querySelector(t)}),"string"==typeof t.container&&(t.container=document.querySelector(t.container)),t instanceof HTMLElement&&(t={tolerance:0,container:t}),!t.container)throw new Error("You should specify a container element");var r=t.container.getBoundingClientRect();return(e.offsetTop+e.clientHeight-t.tolerance>t.container.scrollTop&&e.offsetLeft+e.clientWidth-t.tolerance>t.container.scrollLeft&&e.offsetLeft+t.tolerance0&&void 0!==arguments[0]?arguments[0]:{tolerance:0,debounce:100,container:window};this.options={},this.trackedElements={},Object.defineProperties(this.options,{container:{configurable:!1,enumerable:!1,get:function(){var e=void 0;return"string"==typeof n.container?e=document.querySelector(n.container):n.container instanceof HTMLElement&&(e=n.container),e||window},set:function(e){n.container=e}},debounce:{get:function(){return parseInt(n.debounce,10)||100},set:function(e){n.debounce=e}},tolerance:{get:function(){return parseInt(n.tolerance,10)||0},set:function(e){n.tolerance=e}}}),Object.defineProperty(this,"_scroll",{enumerable:!1,configurable:!1,writable:!1,value:this._debouncedScroll.call(this)}),e=document.querySelector("body"),t=function(){Object.keys(a.trackedElements).forEach((function(e){a.on("enter",e),a.on("leave",e)}))},(r=window.MutationObserver||window.WebKitMutationObserver)?new r(t).observe(e,{childList:!0,subtree:!0}):(e.addEventListener("DOMNodeInserted",t,!1),e.addEventListener("DOMNodeRemoved",t,!1)),this.attach()}return Object.defineProperties(r.prototype,{_debouncedScroll:{configurable:!1,writable:!1,enumerable:!1,value:function(){var r=this,a=void 0;return function(){clearTimeout(a),a=setTimeout((function(){!function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0},n=Object.keys(r),i=void 0;n.length&&(i=a.container===window?e:t,n.forEach((function(e){r[e].nodes.forEach((function(t){if(i(t.node,a)?(t.wasVisible=t.isVisible,t.isVisible=!0):(t.wasVisible=t.isVisible,t.isVisible=!1),!0===t.isVisible&&!1===t.wasVisible){if(!r[e].enter)return;Object.keys(r[e].enter).forEach((function(a){"function"==typeof r[e].enter[a]&&r[e].enter[a](t.node,"enter")}))}if(!1===t.isVisible&&!0===t.wasVisible){if(!r[e].leave)return;Object.keys(r[e].leave).forEach((function(a){"function"==typeof r[e].leave[a]&&r[e].leave[a](t.node,"leave")}))}}))})))}(r.trackedElements,r.options)}),r.options.debounce)}}},attach:{configurable:!1,writable:!1,enumerable:!1,value:function(){var e=this.options.container;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.addEventListener("scroll",this._scroll,{passive:!0}),window.addEventListener("resize",this._scroll,{passive:!0}),this._scroll(),this.attached=!0}},destroy:{configurable:!1,writable:!1,enumerable:!1,value:function(){this.options.container.removeEventListener("scroll",this._scroll),window.removeEventListener("resize",this._scroll),this.attached=!1}},off:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){var a=Object.keys(this.trackedElements[t].enter||{}),n=Object.keys(this.trackedElements[t].leave||{});if({}.hasOwnProperty.call(this.trackedElements,t))if(r){if(this.trackedElements[t][e]){var i="function"==typeof r?r.name:r;delete this.trackedElements[t][e][i]}}else delete this.trackedElements[t][e];a.length||n.length||delete this.trackedElements[t]}},on:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){if(!e)throw new Error("No event given. Choose either enter or leave");if(!t)throw new Error("No selector to track");if(["enter","leave"].indexOf(e)<0)throw new Error(e+" event is not supported");({}).hasOwnProperty.call(this.trackedElements,t)||(this.trackedElements[t]={}),this.trackedElements[t].nodes=[];for(var a=0,n=document.querySelectorAll(t);a{let i=e[t];console.log(i),"object"!=typeof i&&(i={model:i,texture:i,textureScale:1}),i.textureScale||(i.textureScale=1),m(i.model).then(e=>g(e)).then(e=>{console.log("Merged:"),console.log(e),Object(l.d)(r.options.assetRoot,"minecraft","/entity/",i.texture).then(t=>{(new a.TextureLoader).load(t,(function(t){t.magFilter=a.NearestFilter,t.minFilter=a.NearestFilter,t.anisotropy=0,t.needsUpdate=!0,d(r,e,t,i.textureScale).then(e=>{r.addToScene(e),r.entities.push(e),n()})}))}).catch(()=>{console.warn("Missing texture for entity "+i.texture)})}).catch(()=>{console.warn("No model file found for entity "+i.model)})}));Promise.all(n).then(()=>{"function"==typeof t&&t()})}}function d(e,t,r,n){return console.log(t),new Promise(i=>{let o=new a.Object3D;for(let i in t.groups)if(t.groups.hasOwnProperty(i)){let s=t.groups[i],l=new a.Object3D;l.name=s.name,s.pivot&&l.applyMatrix((new a.Matrix4).makeTranslation(s.pivot[0],s.pivot[1],s.pivot[2])),s.pos,s.rotation&&3===s.rotation.length&&(l.rotation.x=s.rotation[0],l.rotation.y=s.rotation[1],l.rotation.z=s.rotation[2]);for(let t=0;t{n.ajax("https://minerender.org/res/models/entities/"+e+".json").done(e=>{t(e)}).fail(()=>{r()})})}const v=(e,t,r)=>t;let g=function(e){return new Promise((t,r)=>{y(e,[],t,r)})},y=function(e,t,r,a){if(console.log(t),t.push(e),!e.hasOwnProperty("parent")){t.reverse();let e={};for(let r=0;r{y(e,t,r,a)})};"undefined"!=typeof window&&(window.EntityRender=f),void 0!==e&&(e.EntityRender=f),t.default=f}.call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(10);var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),e.scene=new n.Scene,e.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),e.quad.frustumCulled=!1,e.scene.add(e.quad),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((a=i)&&a.__esModule?a:{default:a}).default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:this.clock.getDelta(),t=this.renderer.getRenderTarget(),r=!1,a=void 0,n=void 0,i=this.passes.length;for(n=0;n0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*a;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?s(l=e,i,"day")||s(l,n,"hour")||s(l,a,"minute")||s(l,r,"second")||l+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=n)return Math.round(e/n)+"h";if(e>=a)return Math.round(e/a)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";(function(e){var t=r(0),a=r(8),n=r(2),i=r(9),o=r(79);r(89);let s={controls:{enabled:!0,zoom:!0,rotate:!1,pan:!0},camera:{type:"perspective",x:0,y:0,z:50,target:[0,0,0]},assetRoot:n.a};class l extends a.b{constructor(e,t){super(e,s,t),this.renderType="GuiRender",this.gui=null,this.attached=!1}render(e,r){let a=this;a.attached||a._scene?console.log("[GuiRender] is attached - skipping scene init"):(super.initScene((function(){a.element.dispatchEvent(new CustomEvent("guiRender",{detail:{gui:a.gui}}))})),a._controls.target.set(0,0,0),a._camera.lookAt(new t.Vector3(0,0,0)));let i=[];for(let r=0;r{let s=e[r];"string"==typeof s&&(s={texture:s}),s.textureScale||(s.textureScale=1),Object(n.d)(a.options.assetRoot,"minecraft","",s.texture).then(e=>{let r=function(e){let r=(new t.TextureLoader).load(e,(function(){r.magFilter=t.NearestFilter,r.minFilter=t.NearestFilter,r.anisotropy=0,r.needsUpdate=!0;let e=new t.MeshBasicMaterial({map:r,transparent:!0,side:t.DoubleSide,alphaTest:.5});e.userData.layer=s,i(e)}))};if(s.uv){s.uv=[s.uv[0]*s.textureScale,s.uv[1]*s.textureScale,s.uv[2]*s.textureScale,s.uv[3]*s.textureScale];let t=new Image;t.onload=function(){let e=document.createElement("canvas");e.width=s.uv[2]-s.uv[0],e.height=s.uv[3]-s.uv[1],e.getContext("2d").drawImage(t,s.uv[0],s.uv[1],s.uv[2]-s.uv[0],s.uv[3]-s.uv[1],0,0,s.uv[2]-s.uv[0],s.uv[3]-s.uv[1]),r(e.toDataURL("image/png"))},t.crossOrigin="anonymous",t.src=e}else r(e)})}));Promise.all(i).then(e=>{let n=new t.Object3D,i=0,o=0;for(let r=0;ri&&(i=f),d>o&&(o=d);let h=new t.PlaneGeometry(f,d),p=new t.Mesh(h,s);if(p.name=s.userData.layer.texture.toLowerCase()+(s.userData.layer.name?"_"+s.userData.layer.name.toLowerCase():""),p.position.set(0,0,0),p.applyMatrix((new t.Matrix4).makeTranslation(f/2,d/2,0)),s.userData.layer.pos?p.applyMatrix((new t.Matrix4).makeTranslation(s.userData.layer.pos[0],-d-s.userData.layer.pos[1],0)):p.applyMatrix((new t.Matrix4).makeTranslation(0,-d,0)),s.userData.layer.layer&&(p.layers.set(s.userData.layer.layer),a._camera.layers.enable(s.userData.layer.layer)),n.add(p),a.options.showOutlines){let e=new t.BoxHelper(p,16711680);n.add(e),s.userData.layer.layer&&e.layers.set(s.userData.layer.layer)}}n.applyMatrix((new t.Matrix4).makeTranslation(-i/2,o/2,0)),a.addToScene(n),a.gui=n,a.attached||(a._camera.position.set(0,0,Math.max(i,o)),a._camera.fov=2*Math.atan(Math.max(i,o)/(2*Math.max(i,o)))*(180/Math.PI),a._camera.updateProjectionMatrix()),"function"==typeof r&&r()})}}l.Positions=i.a,l.Helper=o.a,"undefined"!=typeof window&&(window.GuiRender=l),void 0!==e&&(e.GuiRender=l)}).call(this,r(4))},function(e,t,r){"use strict";(function(e){var t=r(0),a=(r(22),r(23),r(8)),n=r(2),i=r(44),o=r(30),s=r(1),l=r(31),u=r.n(l),c=(r(76),r(186),r(13));r(90)(t);const f=c("minerender"),d=187;String.prototype.replaceAll=function(e,t){return this.replace(new RegExp(e,"g"),t)};const h=[16711680,65535,255,128,16711935,8388736,8421376,65280,32768,16776960,8388608,32896],p=["east","west","up","down","south","north"],m=["lightgreen"],v={},g={},y={},b={},w={},x={},_={},A={},E=[];let S={camera:{type:"perspective",x:35,y:25,z:20,target:[0,0,0]},type:"block",centerCubes:!1,assetRoot:n.a,useWebWorkers:!1};class M extends a.b{constructor(e,t){super(e,S,t),this.renderType="ModelRender",this.models=[],this.instancePositionMap={},this.attached=!1}render(e,r){let a=this;a.attached||a._scene?console.log("[ModelRender] is attached - skipping scene init"):super.initScene((function(){for(let e=0;e{if(e.options.useWebWorkers){let a=u()(d);a.addEventListener("message",e=>{r.push(...e.data.parsedModelList),t()}),a.postMessage({func:"parseModel",model:i,modelOptions:i,parsedModelList:r,assetRoot:e.options.assetRoot})}else Object(s.e)(i,i,r,e.options.assetRoot).then(()=>{t()})}))}return Promise.all(a)})(a,e,n).then(()=>(function(e,t){console.timeEnd("parseModels"),console.time("loadAndMergeModels");let r=[];console.log("Loading Model JSON data & merging...");let a={};for(let e=0;e{let a=n[t],i=Object(s.d)(a);if(f("loadAndMerge "+i),v.hasOwnProperty(i))r();else if(e.options.useWebWorkers){let t=u()(d);t.addEventListener("message",e=>{v[i]=e.data.mergedModel,r()}),t.postMessage({func:"loadAndMergeModel",model:a,assetRoot:e.options.assetRoot})}else Object(s.b)(a,e.options.assetRoot).then(e=>{v[i]=e,r()})}));return Promise.all(r)})(a,n)).then(()=>(function(e,t){console.timeEnd("loadAndMergeModels"),console.time("loadModelTextures");let r=[];console.log("Loading Textures...");let a={};for(let e=0;e{let a=n[t],i=Object(s.d)(a);f("loadTexture "+i);let o=v[i];if(g.hasOwnProperty(i))r();else{if(!o)return console.warn("Missing merged model"),console.warn(a.name),void r();if(!o.textures)return console.warn("The model doesn't have any textures!"),console.warn("Please make sure you're using the proper file."),console.warn(a.name),void r();if(e.options.useWebWorkers){let t=u()(d);t.addEventListener("message",e=>{g[i]=e.data.textures,r()}),t.postMessage({func:"loadTextures",textures:o.textures,assetRoot:e.options.assetRoot})}else Object(s.c)(o.textures,e.options.assetRoot).then(e=>{g[i]=e,r()})}}));return Promise.all(r)})(a,n)).then(()=>(function(e,r){console.timeEnd("loadModelTextures"),console.time("doModelRender"),console.log("Rendering Models...");let a=[];for(let n=0;n{let i=r[n],o=v[Object(s.d)(i)],l=g[Object(s.d)(i)],u=i.offset||[0,0,0],c=i.rotation||[0,0,0],f=i.scale||[1,1,1];if(i.options.hasOwnProperty("display")&&o.hasOwnProperty("display")&&o.display.hasOwnProperty(i.options.display)){let e=o.display[i.options.display];e.hasOwnProperty("translation")&&(u=[u[0]+e.translation[0],u[1]+e.translation[1],u[2]+e.translation[2]]),e.hasOwnProperty("rotation")&&(c=[c[0]+e.rotation[0],c[1]+e.rotation[1],c[2]+e.rotation[2]]),e.hasOwnProperty("scale")&&(f=[e.scale[0],e.scale[1],e.scale[2]])}T(e,o,l,o.textures,i.type,i.name,i.variant,u,c,f).then(r=>{if(r.firstInstance){let a=new t.Object3D;a.add(r.mesh),e.models.push(a),e.addToScene(a)}a(r)})}));return Promise.all(a)})(a,n)).then(e=>{console.timeEnd("doModelRender"),f(e),"function"==typeof r&&r()})}}let T=function(e,r,n,i,o,l,u,c,d,h){return new Promise(p=>{if(r.hasOwnProperty("elements")){let m=Object(s.d)({type:o,name:l,variant:u}),v=y[m],g=function(r,a){r.userData.modelType=o,r.userData.modelName=l;let n=new t.Vector3,i=new t.Vector3,u=new t.Quaternion,f={key:m,index:a,offset:c,scale:h,rotation:d};d&&r.setQuaternionAt(a,u.setFromEuler(new t.Euler(Object(s.f)(d[0]),Object(s.f)(Math.abs(d[0])>0?d[1]:-d[1]),Object(s.f)(d[2])))),c&&(r.setPositionAt(a,n.set(c[0],c[1],c[2])),e.instancePositionMap[c[0]+"_"+c[1]+"_"+c[2]]=f),h&&r.setScaleAt(a,i.set(h[0],h[1],h[2])),r.needsUpdate(),p({mesh:r,firstInstance:0===a})},b=function(e,r){let a;if(e.translate(-8,-8,-8),A.hasOwnProperty(m))f("Using cached instance ("+m+")"),a=A[m];else{f("Caching new model instance "+m+" (with "+v+" instances)");let n=new t.InstancedMesh(e,r,v,!1,!1,!1);a={instance:n,index:0},A[m]=a;let i=new t.Vector3,o=new t.Vector3(1,1,1),s=new t.Quaternion;for(let e=0;e{let a=l.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_"+(o.__comment?o.__comment.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_":"");L(o.to[0]-o.from[0],o.to[1]-o.from[1],o.to[2]-o.from[2],a+Date.now(),o.faces,u,n,i,e.options.assetRoot,a).then(e=>{e.applyMatrix((new t.Matrix4).makeTranslation((o.to[0]-o.from[0])/2,(o.to[1]-o.from[1])/2,(o.to[2]-o.from[2])/2)),e.applyMatrix((new t.Matrix4).makeTranslation(o.from[0],o.from[1],o.from[2])),o.rotation&&C(e,new t.Vector3(o.rotation.origin[0],o.rotation.origin[1],o.rotation.origin[2]),new t.Vector3("x"===o.rotation.axis?1:0,"y"===o.rotation.axis?1:0,"z"===o.rotation.axis?1:0),Object(s.f)(o.rotation.angle)),r(e)})}))}Promise.all(w).then(e=>{let t=Object(a.c)(e,!0);t.sourceSize=e.length,b(t.geometry,t.materials,e.length);for(let t=0;t{c&&e.applyMatrix((new t.Matrix4).makeTranslation(c[0],c[1],c[2])),d&&e.rotation.set(Object(s.f)(d[0]),Object(s.f)(Math.abs(d[0])>0?d[1]:-d[1]),Object(s.f)(d[2])),h&&e.scale.set(h[0],h[1],h[2]),p({mesh:e,firstInstance:!0})})})};function P(e,r,a,n){let i=A[e];if(i&&i.instance){let e,o=i.instance;e=n?r||[1,1,1]:[0,0,0];let s=new t.Vector3;return o.setScaleAt(a,s.set(e[0],e[1],e[2])),o}}function F(e,t){let r={};for(let a of e){let e=this.instancePositionMap[a[0]+"_"+a[1]+"_"+a[2]];if(e){let a=P(e.key,e.scale,e.index,t);a&&(r[e.key]=a)}}for(let e of Object.values(r))e.needsUpdate()}M.prototype.setVisibilityAtMulti=F,M.prototype.setVisibilityAt=function(e,t,r,a){F([[e,t,r]],a)},M.prototype.setVisibilityOfType=function(e,t,r,a){let n=A[Object(s.d)({type:e,name:t,variant:r})];if(n&&n.instance){n.instance.visible=a}};let O=function(e,r){return new Promise(a=>{let n=function(r,n,i){let o=new t.PlaneGeometry(n,i),s=new t.Mesh(o,r);s.name=e,s.receiveShadow=!0,a(s)};if(r){let a=0,i=0,s=[];for(let e in r)r.hasOwnProperty(e)&&s.push(new Promise(t=>{let n=new Image;n.onload=function(){n.width>a&&(a=n.width),n.height>i&&(i=n.height),t(n)},n.src=r[e]}));Promise.all(s).then(r=>{let s=document.createElement("canvas");s.width=a,s.height=i;let l=s.getContext("2d");for(let e=0;e{let A,S=e+"_"+r+"_"+a;_.hasOwnProperty(S)?(f("Using cached Geometry ("+S+")"),A=_[S]):(A=new t.BoxGeometry(e,r,a),f("Caching Geometry "+S),_[S]=A);let M=function(e){let r=new t.Mesh(A,e);r.name=i,r.receiveShadow=!0,y(r)};if(c){let e=[];for(let r=0;r<6;r++)e.push(new Promise(e=>{let a=p[r];if(!l.hasOwnProperty(a))return void e(null);let h=l[a],y=h.texture.substr(1);if(!c.hasOwnProperty(y)||!c[y])return console.warn("Missing texture '"+y+"' for face "+a+" in model "+i),void e(null);let _=y+"_"+a+"_"+g,A=r=>{let l=function(r){let n=r.dataUrl,o=r.dataUrlHash,l=r.hasTransparency;if(x.hasOwnProperty(o))return f("Using cached Material ("+o+", without meta)"),void e(x[o]);let u=d[y];u.startsWith("#")&&(u=d[i.substr(1)]),f("Pre-Caching Material "+o+", without meta"),x[o]=new t.MeshBasicMaterial({map:null,transparent:l,side:l?t.DoubleSide:t.FrontSide,alphaTest:.5,name:a+"_"+y+"_"+u});let c=function(t){f("Finalizing Cached Material "+o+", without meta"),x[o].map=t,x[o].needsUpdate=!0,e(x[o])};if(b.hasOwnProperty(o))return f("Using cached Texture ("+o+")"),void c(b[o]);f("Pre-Caching Texture "+o),b[o]=(new t.TextureLoader).load(n,(function(e){e.magFilter=t.NearestFilter,e.minFilter=t.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,h.hasOwnProperty("rotation")&&(e.center.x=.5,e.center.y=.5,e.rotation=Object(s.f)(h.rotation)),f("Caching Texture "+o),b[o]=e,c(e)}))};if(r.height>r.width&&r.height%r.width==0){let a=d[y];a.startsWith("#")&&(a=d[a.substr(1)]),-1!==a.indexOf("/")&&(a=a.substr(a.indexOf("/")+1)),Object(n.e)(a,v).then(a=>{!function(r,a){let n=r.dataUrlHash,i=r.hasTransparency;if(x.hasOwnProperty(n))return f("Using cached Material ("+n+", with meta)"),void e(x[n]);f("Pre-Caching Material "+n+", with meta"),x[n]=new t.MeshBasicMaterial({map:null,transparent:i,side:i?t.DoubleSide:t.FrontSide,alphaTest:.5});let s=1;a.hasOwnProperty("animation")&&a.animation.hasOwnProperty("frametime")&&(s=a.animation.frametime);let l=Math.floor(r.height/r.width);console.log("Generating animated texture...");let u=[];for(let e=0;e{let n=document.createElement("canvas");n.width=r.width,n.height=r.width,n.getContext("2d").drawImage(r.canvas,0,e*r.width,r.width,r.width,0,0,r.width,r.width);let i=n.toDataURL("image/png"),s=o(i);if(b.hasOwnProperty(s))return f("Using cached Texture ("+s+")"),void a(b[s]);f("Pre-Caching Texture "+s),b[s]=(new t.TextureLoader).load(i,(function(e){e.magFilter=t.NearestFilter,e.minFilter=t.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,f("Caching Texture "+s+", without meta"),b[s]=e,a(e)}))}));Promise.all(u).then(t=>{let r=0,a=0;E.push(()=>{r>=s&&(r=0,x[n].map=t[a],a++),a>=t.length&&(a=0),r+=.1}),f("Finalizing Cached Material "+n+", with meta"),x[n].map=t[0],x[n].needsUpdate=!0,e(x[n])})}(r,a)}).catch(()=>{l(r)})}else l(r)};if(w.hasOwnProperty(_)){let e=w[_];if(e.hasOwnProperty("img")){f("Waiting for canvas image that's already loading ("+_+")"),e.img.waitingForCanvas.push((function(e){A(e)}))}else f("Using cached canvas ("+_+")"),A(w[_])}else{let t=new Image;t.onerror=function(t){console.warn(t),e(null)},t.waitingForCanvas=[],t.onload=function(){let e=(e=>{let t=h.uv;t||(t=u[a].uv),t=[Object(n.f)(t[0],e.width),Object(n.f)(t[1],e.height),Object(n.f)(t[2],e.width),Object(n.f)(t[3],e.height)];let r=document.createElement("canvas");r.width=Math.abs(t[2]-t[0]),r.height=Math.abs(t[3]-t[1]);let i,s=r.getContext("2d");s.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),r.width,r.height,0,0,r.width,r.height),h.hasOwnProperty("tintindex")?i=m[h.tintindex]:g.startsWith("water_")&&(i="blue"),i&&(s.fillStyle=i,s.globalCompositeOperation="multiply",s.fillRect(0,0,r.width,r.height),s.globalAlpha=1,s.globalCompositeOperation="destination-in",s.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),r.width,r.height,0,0,r.width,r.height));let l=s.getImageData(0,0,r.width,r.height).data,c=!1;for(let e=3;eM(e))}else{let e=[];for(let r=0;r<6;r++)e.push(new t.MeshBasicMaterial({color:h[r+2],wireframe:!0}));M(e)}})};function C(e,t,r,a){e.position.sub(t),e.position.applyAxisAngle(r,a),e.position.add(t),e.rotateOnAxis(r,a)}M.cache={loadedTextures:g,mergedModels:v,instanceCount:y,texture:b,canvas:w,material:x,geometry:_,instances:A,animated:E,resetInstances:function(){Object(s.a)(y),Object(s.a)(A)},clearAll:function(){Object(s.a)(g),Object(s.a)(v),Object(s.a)(y),Object(s.a)(b),Object(s.a)(w),Object(s.a)(x),Object(s.a)(_),Object(s.a)(A),E.splice(0,E.length)}},M.ModelConverter=i.a,"undefined"!=typeof window&&(window.ModelRender=M,window.ModelConverter=i.a),void 0!==e&&(e.ModelRender=M)}).call(this,r(4))},function(e,t,r){e.exports=function(e){const t=parseInt(e.REVISION)>=96;r(91)(e);var a=new e.MeshDepthMaterial;a.depthPacking=e.RGBADepthPacking,a.clipping=!0,a.defines={INSTANCE_TRANSFORM:""};var n=e.ShaderLib.distanceRGBA,i=e.UniformsUtils.clone(n.uniforms),o=new e.ShaderMaterial({defines:{USE_SHADOWMAP:"",INSTANCE_TRANSFORM:""},uniforms:i,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,clipping:!0});return e.InstancedMesh=function(t,r,n,i,s,l){e.Mesh.call(this,(new e.InstancedBufferGeometry).copy(t)),this._dynamic=!!i,this._uniformScale=!!l,this._colors=!!s,this.numInstances=n,this._setAttributes(),this.material=r,this.frustumCulled=!1,this.customDepthMaterial=a,this.customDistanceMaterial=o},e.InstancedMesh.prototype=Object.create(e.Mesh.prototype),e.InstancedMesh.constructor=e.InstancedMesh,Object.defineProperties(e.InstancedMesh.prototype,{material:{set:function(e){let t=function(e){e.defines?(e.defines.INSTANCE_TRANSFORM="",this._uniformScale?e.defines.INSTANCE_UNIFORM="":delete e.defines.INSTANCE_UNIFORM,this._colors?e.defines.INSTANCE_COLOR="":delete e.defines.INSTANCE_COLOR):(e.defines={INSTANCE_TRANSFORM:""},this._uniformScale&&(e.defines.INSTANCE_UNIFORM=""),this._colors&&(e.defines.INSTANCE_COLOR=""))};if(Array.isArray(e)){e=e.slice(0);for(let r=0;r{const n=r[a];let i;t?i=new e.InstancedBufferAttribute(...n):(i=new e.InstancedBufferAttribute(n[0],n[1],n[3])).normalized=n[2],i.dynamic=this._dynamic,this.geometry.addAttribute(a,i)})},e.InstancedMesh}},function(e,t,r){e.exports=function(e){return/InstancedMesh/.test(e.REVISION)?e:(r(92)(e),e.REVISION+="_InstancedMesh",e)}},function(e,t,r){e.exports=function(e){e.ShaderChunk.begin_vertex=r(93),e.ShaderChunk.color_fragment=r(94),e.ShaderChunk.color_pars_fragment=r(95),e.ShaderChunk.color_vertex=r(96),e.ShaderChunk.defaultnormal_vertex=r(97),e.ShaderChunk.uv_pars_vertex=r(98)}},function(e,t){e.exports=["#ifndef INSTANCE_TRANSFORM","vec3 transformed = vec3( position );","#else","#ifndef INSTANCE_MATRIX","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","vec3 transformed = ( _instanceMatrix * vec4( position , 1. )).xyz;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","diffuseColor.rgb *= vColor;","#endif","#if defined(INSTANCE_COLOR)","diffuseColor.rgb *= vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","varying vec3 vColor;","#endif","#if defined( INSTANCE_COLOR )","varying vec3 vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","vColor.xyz = color.xyz;","#endif","#if defined( INSTANCE_COLOR ) && defined( INSTANCE_TRANSFORM )","vInstanceColor = instanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef FLIP_SIDED","objectNormal = -objectNormal;","#endif","#ifndef INSTANCE_TRANSFORM","vec3 transformedNormal = normalMatrix * objectNormal;","#else","#ifndef INSTANCE_MATRIX ","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","#ifndef INSTANCE_UNIFORM","vec3 transformedNormal = transposeMat3( inverse( mat3( modelViewMatrix * _instanceMatrix ) ) ) * objectNormal ;","#else","vec3 transformedNormal = ( modelViewMatrix * _instanceMatrix * vec4( objectNormal , 0.0 ) ).xyz;","#endif","#endif"].join("\n")},function(e,t){e.exports=["#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )","varying vec2 vUv;","uniform mat3 uvTransform;","#endif","#ifdef INSTANCE_TRANSFORM","mat3 inverse(mat3 m) {","float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];","float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];","float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];","float b01 = a22 * a11 - a12 * a21;","float b11 = -a22 * a10 + a12 * a20;","float b21 = a21 * a10 - a11 * a20;","float det = a00 * b01 + a01 * b11 + a02 * b21;","return mat3(b01, (-a22 * a01 + a02 * a21), ( a12 * a01 - a02 * a11),","b11, ( a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),","b21, (-a21 * a00 + a01 * a20), ( a11 * a00 - a01 * a10)) / det;","}","attribute vec3 instancePosition;","attribute vec4 instanceQuaternion;","attribute vec3 instanceScale;","#if defined( INSTANCE_COLOR )","attribute vec3 instanceColor;","varying vec3 vInstanceColor;","#endif","mat4 getInstanceMatrix(){","vec4 q = instanceQuaternion;","vec3 s = instanceScale;","vec3 v = instancePosition;","vec3 q2 = q.xyz + q.xyz;","vec3 a = q.xxx * q2.xyz;","vec3 b = q.yyz * q2.yzz;","vec3 c = q.www * q2.xyz;","vec3 r0 = vec3( 1.0 - (b.x + b.z) , a.y + c.z , a.z - c.y ) * s.xxx;","vec3 r1 = vec3( a.y - c.z , 1.0 - (a.x + b.z) , b.y + c.x ) * s.yyy;","vec3 r2 = vec3( a.z + c.y , b.y - c.x , 1.0 - (a.x + b.x) ) * s.zzz;","return mat4(","r0 , 0.0,","r1 , 0.0,","r2 , 0.0,","v , 1.0",");","}","#endif"].join("\n")},function(e,t,r){"use strict";var a={};(0,r(11).assign)(a,r(100),r(102),r(35)),e.exports=a},function(e,t,r){"use strict";var a=r(49),n=r(11),i=r(52),o=r(33),s=r(34),l=Object.prototype.toString,u=0,c=-1,f=0,d=8;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({level:c,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&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 r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==u)throw new Error(o[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,p))!==u)throw new Error(o[r]);this._dict_set=!0}}function p(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}h.prototype.push=function(e,t){var r,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=i.string2buf(e):"[object ArrayBuffer]"===l.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 n.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=a.deflate(s,o))&&r!==u)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(n.shrinkBuf(s.output,s.next_out))):this.onData(n.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u):2!==o||(this.onEnd(u),s.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=h,t.deflate=p,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},function(e,t,r){"use strict";var a=r(11),n=4,i=0,o=1,s=2;function l(e){for(var t=e.length;--t>=0;)e[t]=0}var u=0,c=1,f=2,d=29,h=256,p=h+1+d,m=30,v=19,g=2*p+1,y=15,b=16,w=7,x=256,_=16,A=17,E=18,S=[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],M=[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],T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(p+2));l(F);var O=new Array(2*m);l(O);var L=new Array(512);l(L);var C=new Array(256);l(C);var k=new Array(d);l(k);var R,I,N,D=new Array(m);function U(e,t,r,a,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=a,this.max_length=n,this.has_stree=e&&e.length}function j(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function B(e){return e<256?L[e]:L[256+(e>>>7)]}function V(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function z(e,t,r){e.bi_valid>b-r?(e.bi_buf|=t<>b-e.bi_valid,e.bi_valid+=r-b):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function X(e,t,r){var a,n,i=new Array(y+1),o=0;for(a=1;a<=y;a++)i[a]=o=o+r[a-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=H(i[s]++,s))}}function Y(e){var t;for(t=0;t8?V(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,a){var n=2*t,i=2*r;return e[n]>1;r>=1;r--)Q(e,i,r);n=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Q(e,i,1),a=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=a,i[2*n]=i[2*r]+i[2*a],e.depth[n]=(e.depth[r]>=e.depth[a]?e.depth[r]:e.depth[a])+1,i[2*r+1]=i[2*a+1]=n,e.heap[1]=n++,Q(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,a,n,i,o,s,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(i=0;i<=y;i++)e.bl_count[i]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(i=p,m++),l[2*a+1]=i,a>u||(e.bl_count[i]++,o=0,a>=h&&(o=d[a-h]),s=l[2*a],e.opt_len+=s*(i+o),f&&(e.static_len+=s*(c[2*a+1]+o)));if(0!==m){do{for(i=p-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(i=p;0!==i;i--)for(a=e.bl_count[i];0!==a;)(n=e.heap[--r])>u||(l[2*n+1]!==i&&(e.opt_len+=(i-l[2*n+1])*l[2*n],l[2*n+1]=i),a--)}}(e,t),X(i,u,e.bl_count)}function J(e,t,r){var a,n,i=-1,o=t[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(r+1)+1]=65535,a=0;a<=r;a++)n=o,o=t[2*(a+1)+1],++s>=7;a0?(e.strm.data_type===s&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&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 o;for(t=32;t=3&&0===e.bl_tree[2*P[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),l=e.opt_len+3+7>>>3,(u=e.static_len+3+7>>>3)<=l&&(l=u)):l=u=r+5,r+4<=l&&-1!==t?te(e,t,r,a):e.strategy===n||u===l?(z(e,(c<<1)+(a?1:0),3),Z(e,F,O)):(z(e,(f<<1)+(a?1:0),3),function(e,t,r,a){var n;for(z(e,t-257,5),z(e,r-1,5),z(e,a-4,4),n=0;n>>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&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(C[r]+h+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){z(e,c<<1,3),G(e,x,F),function(e){16===e.bi_valid?(V(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,r){"use strict";var a=r(53),n=r(11),i=r(52),o=r(35),s=r(33),l=r(34),u=r(105),c=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new u,a.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=i.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=a.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function d(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,l,u,f,d=this.strm,h=this.options.chunkSize,p=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?d.input=i.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new n.Buf8(h),d.next_out=0,d.avail_out=h),(r=a.inflate(d,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(r=a.inflateSetDictionary(this.strm,p)),r===o.Z_BUF_ERROR&&!0===m&&(r=o.Z_OK,m=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==o.Z_STREAM_END&&(0!==d.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=i.utf8border(d.output,d.next_out),u=d.next_out-l,f=i.buf2string(d.output,l),d.next_out=u,d.avail_out=h-u,u&&n.arraySet(d.output,d.output,l,u,0),this.onData(f)):this.onData(n.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),d.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=d,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.ungzip=d},function(e,t,r){"use strict";e.exports=function(e,t){var r,a,n,i,o,s,l,u,c,f,d,h,p,m,v,g,y,b,w,x,_,A,E,S,M;r=e.state,a=e.next_in,S=e.input,n=a+(e.avail_in-5),i=e.next_out,M=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,f=r.wnext,d=r.window,h=r.hold,p=r.bits,m=r.lencode,v=r.distcode,g=(1<>>=w=b>>>24,p-=w,0===(w=b>>>16&255))M[i++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(h&(1<>>=w,p-=w),p<15&&(h+=S[a++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=v[(65535&b)+(h&(1<l){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,p-=w,_>(w=i-o)){if((w=_-w)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(A=0,E=d,0===f){if(A+=u-w,w2;)M[i++]=E[A++],M[i++]=E[A++],M[i++]=E[A++],x-=3;x&&(M[i++]=E[A++],x>1&&(M[i++]=E[A++]))}else{A=i-_;do{M[i++]=M[A++],M[i++]=M[A++],M[i++]=M[A++],x-=3}while(x>2);x&&(M[i++]=M[A++],x>1&&(M[i++]=M[A++]))}break}}break}}while(a>3,h&=(1<<(p-=x<<3))-1,e.next_in=a,e.next_out=i,e.avail_in=a=1&&0===I[M];M--);if(T>M&&(T=M),0===M)return u[c++]=20971520,u[c++]=20971520,d.bits=1,0;for(S=1;S0&&(0===e||1!==M))return-1;for(N[1]=0,A=1;A<15;A++)N[A+1]=N[A]+I[A];for(E=0;E852||2===e&&L>592)return 1;for(;;){b=A-F,f[E]y?(w=D[U+f[E]],x=k[R+f[E]]):(w=96,x=0),h=1<>F)+(p-=h)]=b<<24|w<<16|x|0}while(0!==p);for(h=1<>=1;if(0!==h?(C&=h-1,C+=h):C=0,E++,0==--I[A]){if(A===M)break;A=t[r+f[E]]}if(A>T&&(C&v)!==m){for(0===F&&(F=T),g+=S,O=1<<(P=A-F);P+F852||2===e&&L>592)return 1;u[m=C&v]=T<<24|P<<16|g-c|0}}return 0!==C&&(u[g+C]=A-F<<24|64<<16|0),d.bits=T,0}},function(e,t,r){"use strict";e.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}},function(e,t,r){"use strict";(function(e){var a=r(7).Buffer,n=r(109).Transform,i=r(120),o=r(60),s=r(28).ok,l=r(7).kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";i.Z_MIN_WINDOWBITS=8,i.Z_MAX_WINDOWBITS=15,i.Z_DEFAULT_WINDOWBITS=15,i.Z_MIN_CHUNK=64,i.Z_MAX_CHUNK=1/0,i.Z_DEFAULT_CHUNK=16384,i.Z_MIN_MEMLEVEL=1,i.Z_MAX_MEMLEVEL=9,i.Z_DEFAULT_MEMLEVEL=8,i.Z_MIN_LEVEL=-1,i.Z_MAX_LEVEL=9,i.Z_DEFAULT_LEVEL=i.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(i),f=0;f=l?o=new RangeError(u):t=a.concat(n,i),n=[],e.close(),r(o,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)})),e.on("end",s),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=a.from(t)),!a.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function b(e){if(!(this instanceof b))return new b(e);T.call(this,e,i.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);T.call(this,e,i.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,i.GZIP)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,i.GUNZIP)}function A(e){if(!(this instanceof A))return new A(e);T.call(this,e,i.DEFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);T.call(this,e,i.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,i.UNZIP)}function M(e){return e===i.Z_NO_FLUSH||e===i.Z_PARTIAL_FLUSH||e===i.Z_SYNC_FLUSH||e===i.Z_FULL_FLUSH||e===i.Z_FINISH||e===i.Z_BLOCK}function T(e,r){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,n.call(this,e),e.flush&&!M(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!M(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||i.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:i.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!a.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new i.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){P(s),s._hadError=!0;var a=new Error(e);a.errno=r,a.code=t.codes[r],s.emit("error",a)};var l=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(l=e.level);var u=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,l,e.memLevel||t.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=a.allocUnsafe(this._chunkSize),this._offset=0,this._level=l,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function P(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function F(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),t.Deflate=b,t.Inflate=w,t.Gzip=x,t.Gunzip=_,t.DeflateRaw=A,t.InflateRaw=E,t.Unzip=S,t.createDeflate=function(e){return new b(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new A(e)},t.createInflateRaw=function(e){return new E(e)},t.createGzip=function(e){return new x(e)},t.createGunzip=function(e){return new _(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new b(t),e,r)},t.deflateSync=function(e,t){return y(new b(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new x(t),e,r)},t.gzipSync=function(e,t){return y(new x(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new A(t),e,r)},t.deflateRawSync=function(e,t){return y(new A(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new S(t),e,r)},t.unzipSync=function(e,t){return y(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new w(t),e,r)},t.inflateSync=function(e,t){return y(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new _(t),e,r)},t.gunzipSync=function(e,t){return y(new _(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new E(t),e,r)},t.inflateRawSync=function(e,t){return y(new E(t),e)},o.inherits(T,n),T.prototype.params=function(r,a,n){if(rt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(a!=t.Z_FILTERED&&a!=t.Z_HUFFMAN_ONLY&&a!=t.Z_RLE&&a!=t.Z_FIXED&&a!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+a);if(this._level!==r||this._strategy!==a){var o=this;this.flush(i.Z_SYNC_FLUSH,(function(){s(o._handle,"zlib binding closed"),o._handle.params(r,a),o._hadError||(o._level=r,o._strategy=a,n&&n())}))}else e.nextTick(n)},T.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},T.prototype._flush=function(e){this._transform(a.alloc(0),"",e)},T.prototype.flush=function(t,r){var n=this,o=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=i.Z_FULL_FLUSH),o.ended?r&&e.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",(function(){return n.flush(t,r)})):(this._flushFlag=t,this.write(a.alloc(0),"",r))},T.prototype.close=function(t){P(this,t),e.nextTick(F,this)},T.prototype._transform=function(e,t,r){var n,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||a.isBuffer(e)?this._handle?(s?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||i.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},T.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,c=this,f="function"==typeof r;if(!f){var d,h=[],p=0;this.on("error",(function(e){d=e})),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw d;if(p>=l)throw P(this),new RangeError(u);var v=a.concat(h,p);return P(this),v}s(this._handle,"zlib binding closed");var g=this._handle.write(t,e,o,n,this._buffer,this._offset,i);function y(l,u){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var d=i-u;if(s(d>=0,"have should not go down"),d>0){var m=c._buffer.slice(c._offset,c._offset+d);c._offset+=d,f?c.push(m):(h.push(m),p+=m.length)}if((0===u||c._offset>=c._chunkSize)&&(i=c._chunkSize,c._offset=0,c._buffer=a.allocUnsafe(c._chunkSize)),0===u){if(o+=n-l,n=l,!f)return!0;var v=c._handle.write(t,e,o,n,c._buffer,c._offset,c._chunkSize);return v.callback=y,void(v.buffer=e)}if(!f)return!1;r()}}g.buffer=e,g.callback=y},o.inherits(b,T),o.inherits(w,T),o.inherits(x,T),o.inherits(_,T),o.inherits(A,T),o.inherits(E,T),o.inherits(S,T)}).call(this,r(5))},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],a=t[1];return 3*(r+a)/4-a},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));1===n?(t=e[r-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var n,i,o=[],s=t;s>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,a,n){var i,o,s=8*n-a-1,l=(1<>1,c=-7,f=r?n-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=d,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=a;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,a),i-=u}return(h?-1:1)*o*Math.pow(2,i-a)},t.write=function(e,t,r,a,n,i){var o,s,l,u=8*i-n-1,c=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=a?0:i-1,p=a?1:-1,m=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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,n),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;e[r+h]=255&s,h+=p,s/=256,n-=8);for(o=o<0;e[r+h]=255&o,h+=p,o/=256,u-=8);e[r+h-p]|=128*m}},function(e,t,r){e.exports=n;var a=r(19).EventEmitter;function n(){a.call(this)}r(6)(n,a),n.Readable=r(36),n.Writable=r(116),n.Duplex=r(117),n.Transform=r(118),n.PassThrough=r(119),n.Stream=n,n.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===a.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var a=r(26).Buffer,n=r(112);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,t.copy(r,n),s+=o.data.length,o=o.next;return i},e}(),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var a=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(n.call(setTimeout,a,arguments),clearTimeout)},t.setInterval=function(){return new i(n.call(setInterval,a,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(a,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(114),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(4))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var a,n,i,o,s,l=1,u={},c=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?a=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},a=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(n=f.documentElement,a=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):a=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),a=function(t){e.postMessage(o+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;rt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,n(this.init_done,"close before init"),n(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,a,n,i,o){return this._write(!0,e,t,r,a,n,i,o)},c.prototype.writeSync=function(e,t,r,a,n,i,o){return this._write(!1,e,t,r,a,n,i,o)},c.prototype._write=function(r,i,o,s,l,u,c,f){if(n.equal(arguments.length,8),n(this.init_done,"write before init"),n(this.mode!==t.NONE,"already finalized"),n.equal(!1,this.write_in_progress,"write already in progress"),n.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,n.equal(!1,void 0===i,"must provide flush value"),this.write_in_progress=!0,i!==t.Z_NO_FLUSH&&i!==t.Z_PARTIAL_FLUSH&&i!==t.Z_SYNC_FLUSH&&i!==t.Z_FULL_FLUSH&&i!==t.Z_FINISH&&i!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=e.alloc(0),l=0,s=0),this.strm.avail_in=l,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=u,this.strm.next_out=c,this.flush=i,!r)return this._process(),this._checkError()?this._afterSync():void 0;var d=this;return a.nextTick((function(){d._process(),d._after()})),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,r,a,i,o){n(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),n(e>=8&&e<=15,"invalid windowBits"),n(r>=-1&&r<=9,"invalid compression level"),n(a>=1&&a<=9,"invalid memlevel"),n(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,a,i,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,r,a,n,l){switch(this.level=e,this.windowBits=r,this.memLevel=a,this.strategy=n,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new i,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=l,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=o.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=c}).call(this,r(7).Buffer,r(5))},function(e,t,r){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT -*/var a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach((function(e){a[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,l=o(e),u=1;u({path:r+"."+e.path,val:e.val})))),e}e.exports=class{constructor(e=!0){this.types={},this.validator=e?new s:null,this.addDefaultTypes()}addDefaultTypes(){this.addTypes(r(167)),this.addTypes(r(168)),this.addTypes(r(169)),this.addTypes(r(170))}addProtocol(e,t){const r=this;this.validator&&this.validator.validateProtocol(e),function e(t,a){void 0!==t&&(t.types&&r.addTypes(t.types),e(o(t,a.shift()),a))}(e,t)}addType(e,t,r=!0){if("native"!==t)if(l(t)){this.validator&&(r&&this.validator.validateType(t),this.validator.addType(e));let{type:n,typeArgs:o}=a(t);this.types[e]=o?function(e,t){const r=JSON.stringify(t),a=i(t,u,[]);function n(e){const t=JSON.parse(r);return a.forEach(r=>{!function(e,t,r){const a=e.split(".").reverse();for(;a.length>1;)r=r[a.pop()];r[a.pop()]=t}(r.path,e[r.val],t)}),t}return[function(t,r,a,i){return e[0].call(this,t,r,n(a),i)},function(t,r,a,i,o){return e[1].call(this,t,r,a,n(i),o)},function(t,r,a){return"function"==typeof e[2]?e[2].call(this,t,n(r),a):e[2]}]}(this.types[n],o):this.types[n]}else this.validator&&(t[3]?this.validator.addType(e,t[3]):this.validator.addType(e)),this.types[e]=t;else this.validator&&this.validator.addType(e)}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t],!1)),this.validator&&Object.keys(e).forEach(t=>{l(e[t])&&this.validator.validateType(e[t])})}read(e,t,r,n){let{type:i,typeArgs:o}=a(r);const s=this.types[i];if(!s)throw new Error("missing data type: "+i);return s[0].call(this,e,t,o,n)}write(e,t,r,n,i){let{type:o,typeArgs:s}=a(n);const l=this.types[o];if(!l)throw new Error("missing data type: "+o);return l[1].call(this,e,t,r,s,i)}sizeOf(e,t,r){let{type:n,typeArgs:i}=a(t);const o=this.types[n];if(!o)throw new Error("missing data type: "+n);return"function"==typeof o[2]?o[2].call(this,e,i,r):o[2]}createPacketBuffer(e,r){const a=n(()=>this.sizeOf(r,e,{}),e=>{throw e.message=`SizeOf error for ${e.field} : ${e.message}`,e}),i=t.allocUnsafe(a);return n(()=>this.write(r,i,0,e,{}),e=>{throw e.message=`Write error for ${e.field} : ${e.message}`,e}),i}parsePacketBuffer(e,t){const{value:r,size:a}=n(()=>this.read(t,0,e,{}),e=>{throw e.message=`Read error for ${e.field} : ${e.message}`,e});return{data:r,metadata:{size:a},buffer:t.slice(0,a)}}}}).call(this,r(7).Buffer)},function(e,t,r){(function(e,r){var a=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,l=1/0,u=9007199254740991,c="[object Arguments]",f="[object Array]",d="[object Boolean]",h="[object Date]",p="[object Error]",m="[object Function]",v="[object GeneratorFunction]",g="[object Map]",y="[object Number]",b="[object Object]",w="[object RegExp]",x="[object Set]",_="[object String]",A="[object Symbol]",E="[object ArrayBuffer]",S="[object DataView]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,P=/^\./,F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,L=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[c]=k[f]=k[E]=k[d]=k[S]=k[h]=k[p]=k[m]=k[g]=k[y]=k[b]=k[w]=k[x]=k[_]=k["[object WeakMap]"]=!1;var R="object"==typeof e&&e&&e.Object===Object&&e,I="object"==typeof self&&self&&self.Object===Object&&self,N=R||I||Function("return this")(),D=t&&!t.nodeType&&t,U=D&&"object"==typeof r&&r&&!r.nodeType&&r,j=U&&U.exports===D&&R.process,B=function(){try{return j&&j.binding("util")}catch(e){}}(),V=B&&B.isTypedArray;function z(e,t,r,a){var n=-1,i=e?e.length:0;for(a&&i&&(r=e[++n]);++n-1},Me.prototype.set=function(e,t){var r=this.__data__,a=Le(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},Te.prototype.clear=function(){this.__data__={hash:new Se,map:new(de||Me),string:new Se}},Te.prototype.delete=function(e){return He(this,e).delete(e)},Te.prototype.get=function(e){return He(this,e).get(e)},Te.prototype.has=function(e){return He(this,e).has(e)},Te.prototype.set=function(e,t){return He(this,e).set(e,t),this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,i),this},Pe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.clear=function(){this.__data__=new Me},Fe.prototype.delete=function(e){return this.__data__.delete(e)},Fe.prototype.get=function(e){return this.__data__.get(e)},Fe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Me){var n=r.__data__;if(!de||n.lengthu))return!1;var f=i.get(e);if(f&&i.get(t))return f==t;var d=-1,h=!0,p=n&o?new Pe:void 0;for(i.set(e,t),i.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=u}function st(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function lt(e){return!!e&&"object"==typeof e}function ut(e){return"symbol"==typeof e||lt(e)&&ne.call(e)==A}var ct=V?function(e){return function(t){return e(t)}}(V):function(e){return lt(e)&&ot(e.length)&&!!k[ne.call(e)]};function ft(e){return nt(e)?Oe(e):Ve(e)}function dt(e){return e}r.exports=function(e,t,r){var a=at(e)?z:H,n=arguments.length<3;return a(e,Be(t),r,n,Re)}}).call(this,r(4),r(124)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){(function(t){var r="Expected a function",a="__lodash_hash_undefined__",n=1/0,i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,c=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p="object"==typeof t&&t&&t.Object===Object&&t,m="object"==typeof self&&self&&self.Object===Object&&self,v=p||m||Function("return this")();var g,y=Array.prototype,b=Function.prototype,w=Object.prototype,x=v["__core-js_shared__"],_=(g=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",A=b.toString,E=w.hasOwnProperty,S=w.toString,M=RegExp("^"+A.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=v.Symbol,P=y.splice,F=B(v,"Map"),O=B(Object,"create"),L=T?T.prototype:void 0,C=L?L.toString:void 0;function k(e){var t=-1,r=e?e.length:0;for(this.clear();++t-1},R.prototype.set=function(e,t){var r=this.__data__,a=N(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},I.prototype.clear=function(){this.__data__={hash:new k,map:new(F||R),string:new k}},I.prototype.delete=function(e){return j(this,e).delete(e)},I.prototype.get=function(e){return j(this,e).get(e)},I.prototype.has=function(e){return j(this,e).has(e)},I.prototype.set=function(e,t){return j(this,e).set(e,t),this};var V=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}(t);var r=[];return c.test(e)&&r.push(""),e.replace(f,(function(e,t,a,n){r.push(a?n.replace(d,"$1"):t||e)})),r}));function z(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-n?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(r);var a=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=a.cache;if(i.has(n))return i.get(n);var o=e.apply(this,r);return a.cache=i.set(n,o),o};return a.cache=new(G.Cache||I),a}G.Cache=I;var H=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==s}e.exports=function(e,t,r){var a=null==e?void 0:D(e,t);return void 0===a?r:a}}).call(this,r(4))},function(e,t,r){const a=r(127),n=r(27);class i{constructor(e){this.createAjvInstance(e),this.addDefaultTypes()}createAjvInstance(e){this.typesSchemas={},this.compiled=!1,this.ajv=new a({verbose:!0}),this.ajv.addSchema(r(161),"definitions"),this.ajv.addSchema(r(162),"protocol"),e&&Object.keys(e).forEach(t=>this.addType(t,e[t]))}addDefaultTypes(){this.addTypes(r(163)),this.addTypes(r(164)),this.addTypes(r(165)),this.addTypes(r(166))}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t]))}typeToSchemaName(e){return e.replace("|","_")}addType(e,t){const r=this.typeToSchemaName(e);null==this.typesSchemas[r]&&(t||(t={oneOf:[{enum:[e]},{type:"array",items:[{enum:[e]},{oneOf:[{type:"object"},{type:"array"}]}]}]}),this.typesSchemas[r]=t,this.compiled?this.createAjvInstance(this.typesSchemas):this.ajv.addSchema(t,r),this.ajv.removeSchema("dataType"),this.ajv.addSchema({title:"dataType",oneOf:[{enum:["native"]}].concat(Object.keys(this.typesSchemas).map(e=>({$ref:this.typeToSchemaName(e)})))},"dataType"))}validateType(e){let t=this.ajv.validate("dataType",e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}validateTypeGoingInside(e){if(Array.isArray(e)){n.ok(null!=this.typesSchemas[this.typeToSchemaName(e[0])],e+" is an undefined type");let t=this.ajv.validate(e[0],e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}else{if("native"==e)return;n.ok(null!=this.typesSchemas[this.typeToSchemaName(e)],e+" is an undefined type")}}validateProtocol(e){let t=this.ajv.validate("protocol",e);n.ok(t,JSON.stringify(this.ajv.errors,null,2)),function e(t,r,a){const n=new i(r.typesSchemas);Object.keys(t).forEach(r=>{"types"==r?(Object.keys(t[r]).forEach(e=>n.addType(e)),Object.keys(t[r]).forEach(e=>{try{n.validateType(t[r][e],a+"."+r+"."+e)}catch(t){throw new Error("Error at "+a+"."+r+"."+e)}})):e(t[r],n,a+"."+r)})}(e,this,"root")}}e.exports=i},function(e,t,r){"use strict";var a=r(128),n=r(37),i=r(132),o=r(60),s=r(61),l=r(133),u=r(134),c=r(155),f=r(15);e.exports=g,g.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var n=r(t);!0!==r.$async&&(this.errors=r.errors);return n},g.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},g.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var i=0;i=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:t,baseId:r},{index:a,compiling:!1})}function d(e,t,r){var a=h.call(this,e,t,r);a>=0&&this._compilations.splice(a,1)}function h(e,t,r){for(var a=0;a({path:r+"."+e.path,val:e.val})))),e}e.exports=class{constructor(e=!0){this.types={},this.validator=e?new s:null,this.addDefaultTypes()}addDefaultTypes(){this.addTypes(r(170)),this.addTypes(r(171)),this.addTypes(r(172)),this.addTypes(r(173))}addProtocol(e,t){const r=this;this.validator&&this.validator.validateProtocol(e),function e(t,a){void 0!==t&&(t.types&&r.addTypes(t.types),e(o(t,a.shift()),a))}(e,t)}addType(e,t,r=!0){if("native"!==t)if(l(t)){this.validator&&(r&&this.validator.validateType(t),this.validator.addType(e));let{type:n,typeArgs:o}=a(t);this.types[e]=o?function(e,t){const r=JSON.stringify(t),a=i(t,u,[]);function n(e){const t=JSON.parse(r);return a.forEach(r=>{!function(e,t,r){const a=e.split(".").reverse();for(;a.length>1;)r=r[a.pop()];r[a.pop()]=t}(r.path,e[r.val],t)}),t}return[function(t,r,a,i){return e[0].call(this,t,r,n(a),i)},function(t,r,a,i,o){return e[1].call(this,t,r,a,n(i),o)},function(t,r,a){return"function"==typeof e[2]?e[2].call(this,t,n(r),a):e[2]}]}(this.types[n],o):this.types[n]}else this.validator&&(t[3]?this.validator.addType(e,t[3]):this.validator.addType(e)),this.types[e]=t;else this.validator&&this.validator.addType(e)}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t],!1)),this.validator&&Object.keys(e).forEach(t=>{l(e[t])&&this.validator.validateType(e[t])})}read(e,t,r,n){let{type:i,typeArgs:o}=a(r);const s=this.types[i];if(!s)throw new Error("missing data type: "+i);return s[0].call(this,e,t,o,n)}write(e,t,r,n,i){let{type:o,typeArgs:s}=a(n);const l=this.types[o];if(!l)throw new Error("missing data type: "+o);return l[1].call(this,e,t,r,s,i)}sizeOf(e,t,r){let{type:n,typeArgs:i}=a(t);const o=this.types[n];if(!o)throw new Error("missing data type: "+n);return"function"==typeof o[2]?o[2].call(this,e,i,r):o[2]}createPacketBuffer(e,r){const a=n(()=>this.sizeOf(r,e,{}),e=>{throw e.message=`SizeOf error for ${e.field} : ${e.message}`,e}),i=t.allocUnsafe(a);return n(()=>this.write(r,i,0,e,{}),e=>{throw e.message=`Write error for ${e.field} : ${e.message}`,e}),i}parsePacketBuffer(e,t){const{value:r,size:a}=n(()=>this.read(t,0,e,{}),e=>{throw e.message=`Read error for ${e.field} : ${e.message}`,e});return{data:r,metadata:{size:a},buffer:t.slice(0,a)}}}}).call(this,r(7).Buffer)},function(e,t,r){(function(e,r){var a=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,l=1/0,u=9007199254740991,c="[object Arguments]",f="[object Array]",d="[object Boolean]",h="[object Date]",p="[object Error]",m="[object Function]",v="[object GeneratorFunction]",g="[object Map]",y="[object Number]",b="[object Object]",w="[object RegExp]",x="[object Set]",_="[object String]",A="[object Symbol]",E="[object ArrayBuffer]",S="[object DataView]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,P=/^\./,F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,L=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[c]=k[f]=k[E]=k[d]=k[S]=k[h]=k[p]=k[m]=k[g]=k[y]=k[b]=k[w]=k[x]=k[_]=k["[object WeakMap]"]=!1;var R="object"==typeof e&&e&&e.Object===Object&&e,I="object"==typeof self&&self&&self.Object===Object&&self,N=R||I||Function("return this")(),D=t&&!t.nodeType&&t,U=D&&"object"==typeof r&&r&&!r.nodeType&&r,j=U&&U.exports===D&&R.process,B=function(){try{return j&&j.binding("util")}catch(e){}}(),V=B&&B.isTypedArray;function z(e,t,r,a){var n=-1,i=e?e.length:0;for(a&&i&&(r=e[++n]);++n-1},Me.prototype.set=function(e,t){var r=this.__data__,a=Le(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},Te.prototype.clear=function(){this.__data__={hash:new Se,map:new(de||Me),string:new Se}},Te.prototype.delete=function(e){return He(this,e).delete(e)},Te.prototype.get=function(e){return He(this,e).get(e)},Te.prototype.has=function(e){return He(this,e).has(e)},Te.prototype.set=function(e,t){return He(this,e).set(e,t),this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,i),this},Pe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.clear=function(){this.__data__=new Me},Fe.prototype.delete=function(e){return this.__data__.delete(e)},Fe.prototype.get=function(e){return this.__data__.get(e)},Fe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Me){var n=r.__data__;if(!de||n.lengthu))return!1;var f=i.get(e);if(f&&i.get(t))return f==t;var d=-1,h=!0,p=n&o?new Pe:void 0;for(i.set(e,t),i.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=u}function st(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function lt(e){return!!e&&"object"==typeof e}function ut(e){return"symbol"==typeof e||lt(e)&&ne.call(e)==A}var ct=V?function(e){return function(t){return e(t)}}(V):function(e){return lt(e)&&ot(e.length)&&!!k[ne.call(e)]};function ft(e){return nt(e)?Oe(e):Ve(e)}function dt(e){return e}r.exports=function(e,t,r){var a=at(e)?z:H,n=arguments.length<3;return a(e,Be(t),r,n,Re)}}).call(this,r(4),r(127)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){(function(t){var r="Expected a function",a="__lodash_hash_undefined__",n=1/0,i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,c=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p="object"==typeof t&&t&&t.Object===Object&&t,m="object"==typeof self&&self&&self.Object===Object&&self,v=p||m||Function("return this")();var g,y=Array.prototype,b=Function.prototype,w=Object.prototype,x=v["__core-js_shared__"],_=(g=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",A=b.toString,E=w.hasOwnProperty,S=w.toString,M=RegExp("^"+A.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=v.Symbol,P=y.splice,F=B(v,"Map"),O=B(Object,"create"),L=T?T.prototype:void 0,C=L?L.toString:void 0;function k(e){var t=-1,r=e?e.length:0;for(this.clear();++t-1},R.prototype.set=function(e,t){var r=this.__data__,a=N(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},I.prototype.clear=function(){this.__data__={hash:new k,map:new(F||R),string:new k}},I.prototype.delete=function(e){return j(this,e).delete(e)},I.prototype.get=function(e){return j(this,e).get(e)},I.prototype.has=function(e){return j(this,e).has(e)},I.prototype.set=function(e,t){return j(this,e).set(e,t),this};var V=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}(t);var r=[];return c.test(e)&&r.push(""),e.replace(f,(function(e,t,a,n){r.push(a?n.replace(d,"$1"):t||e)})),r}));function z(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-n?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(r);var a=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=a.cache;if(i.has(n))return i.get(n);var o=e.apply(this,r);return a.cache=i.set(n,o),o};return a.cache=new(G.Cache||I),a}G.Cache=I;var H=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==s}e.exports=function(e,t,r){var a=null==e?void 0:D(e,t);return void 0===a?r:a}}).call(this,r(4))},function(e,t,r){const a=r(130),n=r(28);class i{constructor(e){this.createAjvInstance(e),this.addDefaultTypes()}createAjvInstance(e){this.typesSchemas={},this.compiled=!1,this.ajv=new a({verbose:!0}),this.ajv.addSchema(r(164),"definitions"),this.ajv.addSchema(r(165),"protocol"),e&&Object.keys(e).forEach(t=>this.addType(t,e[t]))}addDefaultTypes(){this.addTypes(r(166)),this.addTypes(r(167)),this.addTypes(r(168)),this.addTypes(r(169))}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t]))}typeToSchemaName(e){return e.replace("|","_")}addType(e,t){const r=this.typeToSchemaName(e);null==this.typesSchemas[r]&&(t||(t={oneOf:[{enum:[e]},{type:"array",items:[{enum:[e]},{oneOf:[{type:"object"},{type:"array"}]}]}]}),this.typesSchemas[r]=t,this.compiled?this.createAjvInstance(this.typesSchemas):this.ajv.addSchema(t,r),this.ajv.removeSchema("dataType"),this.ajv.addSchema({title:"dataType",oneOf:[{enum:["native"]}].concat(Object.keys(this.typesSchemas).map(e=>({$ref:this.typeToSchemaName(e)})))},"dataType"))}validateType(e){let t=this.ajv.validate("dataType",e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}validateTypeGoingInside(e){if(Array.isArray(e)){n.ok(null!=this.typesSchemas[this.typeToSchemaName(e[0])],e+" is an undefined type");let t=this.ajv.validate(e[0],e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}else{if("native"==e)return;n.ok(null!=this.typesSchemas[this.typeToSchemaName(e)],e+" is an undefined type")}}validateProtocol(e){let t=this.ajv.validate("protocol",e);n.ok(t,JSON.stringify(this.ajv.errors,null,2)),function e(t,r,a){const n=new i(r.typesSchemas);Object.keys(t).forEach(r=>{"types"==r?(Object.keys(t[r]).forEach(e=>n.addType(e)),Object.keys(t[r]).forEach(e=>{try{n.validateType(t[r][e],a+"."+r+"."+e)}catch(t){throw new Error("Error at "+a+"."+r+"."+e)}})):e(t[r],n,a+"."+r)})}(e,this,"root")}}e.exports=i},function(e,t,r){"use strict";var a=r(131),n=r(38),i=r(135),o=r(61),s=r(62),l=r(136),u=r(137),c=r(158),f=r(16);e.exports=g,g.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var n=r(t);!0!==r.$async&&(this.errors=r.errors);return n},g.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},g.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var i=0;i=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:t,baseId:r},{index:a,compiling:!1})}function d(e,t,r){var a=h.call(this,e,t,r);a>=0&&this._compilations.splice(a,1)}function h(e,t,r){for(var a=0;a1){t[0]=t[0].slice(0,-1);for(var a=t.length-1,n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(e){throw new RangeError(h[e])}function g(e,t){var r=e.split("@"),a="";r.length>1&&(a=r[0]+"@",e=r[1]);var n=function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(d,".")).split("."),t).join(".");return a+n}function y(e){for(var t=[],r=0,a=e.length;r=55296&&n<=56319&&r>1,e+=p(e/t);e>455;a+=36)e=p(e/35);return p(a+36*e/(e+38))},x=function(e){var t,r=[],a=e.length,n=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var l=0;l=128&&v("not-basic"),r.push(e.charCodeAt(l));for(var c=s>0?s+1:0;c=a&&v("invalid-input");var m=(t=e.charCodeAt(c++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>p((u-n)/d))&&v("overflow"),n+=m*d;var g=h<=o?1:h>=o+26?26:h-o;if(mp(u/y)&&v("overflow"),d*=y}var b=r.length+1;o=w(n-f,b,0==f),p(n/b)>u-i&&v("overflow"),i+=p(n/b),n%=b,r.splice(n++,0,i)}return String.fromCodePoint.apply(String,r)},_=function(e){var t=[],r=(e=y(e)).length,a=128,n=0,i=72,o=!0,s=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(o=(c=f.next()).done);o=!0){var d=c.value;d<128&&t.push(m(d))}}catch(e){s=!0,l=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw l}}var h=t.length,g=h;for(h&&t.push("-");g=a&&Tp((u-n)/P)&&v("overflow"),n+=(x-a)*P,a=x;var F=!0,O=!1,L=void 0;try{for(var C,k=e[Symbol.iterator]();!(F=(C=k.next()).done);F=!0){var R=C.value;if(Ru&&v("overflow"),R==a){for(var I=n,N=36;;N+=36){var D=N<=i?1:N>=i+26?26:N-i;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function M(e){for(var t="",r=0,a=e.length;r=194&&n<224){if(a-r>=6){var i=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&n)<<6|63&i)}else t+=e.substr(r,6);r+=6}else if(n>=224){if(a-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function T(e,t){function r(e){var r=M(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,n)),e}function P(e){return e.replace(/^0*(.*)/,"$1")||"0"}function F(e,t){var r=e.match(t.IPV4ADDRESS)||[],a=l(r,2)[1];return a?a.split(".").map(P).join("."):e}function O(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=l(r,3),n=a[1],i=a[2];if(n){for(var o=n.toLowerCase().split("::").reverse(),s=l(o,2),u=s[0],c=s[1],f=c?c.split(":").map(P):[],d=u.split(":").map(P),h=t.IPV4ADDRESS.test(d[d.length-1]),p=h?7:8,m=d.length-p,v=Array(p),g=0;g1){var w=v.slice(0,y.index),x=v.slice(y.index+y.length);b=w.join(":")+"::"+x.join(":")}else b=v.join(":");return i&&(b+="%"+i),b}return e}var L=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,C=void 0==="".match(/(){0}/)[1];function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(L);if(n){C?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=O(F(r.host,a),a)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var i=E[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)T(r,a);else{if(r.host&&(t.domainHost||i&&i.domainHost))try{r.host=A.toASCII(r.host.replace(a.PCT_ENCODED,M).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}T(r,o)}i&&i.parse&&i.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var R=/^\.\.?\//,I=/^\/\.(\/|$)/,N=/^\/\.\.(\/|$)/,D=/^\/?(?:.|\n)*?(?=\/|$)/;function U(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(I))e=e.replace(I,"/");else if(e.match(N))e=e.replace(N,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(D);if(!r)throw new Error("Unexpected dot segment condition");var a=r[0];e=e.slice(a.length),t.push(a)}return t.join("")}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,a=[],n=E[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||n&&n.domainHost)try{e.host=t.iri?A.toUnicode(e.host):A.toASCII(e.host.replace(r.PCT_ENCODED,M).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}T(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var i=function(e,t){var r=!1!==t.iri?s:o,a=[];return void 0!==e.userinfo&&(a.push(e.userinfo),a.push("@")),void 0!==e.host&&a.push(O(F(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"==typeof e.port&&(a.push(":"),a.push(e.port.toString(10))),a.length?a.join(""):void 0}(e,t);if(void 0!==i&&("suffix"!==t.reference&&a.push("//"),a.push(i),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||n&&n.absolutePath||(l=U(l)),void 0===i&&(l=l.replace(/^\/\//,"/%2F")),a.push(l)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function B(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=k(j(e,r),r),t=k(j(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=U(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=U(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function V(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,M)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},G={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},H={},X="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",W=r(r("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+r("%"+Y+Y)),q=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Q=new RegExp(X,"g"),Z=new RegExp(W,"g"),K=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',q),"g"),J=new RegExp(t("[^]",X,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),$=J;function ee(e){var t=M(e);return t.match(Q)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,i={},o=r.query.split("&"),s=0,l=o.length;s=55296&&t<=56319&&n%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",a.copy(m[e])}function v(e){var t=e.match(n);if(!t)return!1;var r=+t[1],a=+t[2],o=+t[3];return a>=1&&a<=12&&o>=1&&o<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[a])}function g(e,t){var r=e.match(o);if(!r)return!1;var a=r[1],n=r[2],i=r[3],s=r[5];return(a<=23&&n<=59&&i<=59||23==a&&59==n&&60==i)&&(!t||s)}e.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9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(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p},m.full={date:v,time:g,"date-time":function(e){var t=e.split(y);return 2==t.length&&v(t[0])&&g(t[1],!0)},uri:function(e){return b.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=: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[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p};var y=/t|\s/i;var b=/\/|:/;var w=/[^\\]\\Z/;function x(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},function(e,t,r){"use strict";var a=r(135),n=r(15).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=n(t),e.types=n(["number","integer","string","array","object","boolean","null"]),e.forEach((function(r){r.rules=r.rules.map((function(r){var n;if("object"==typeof r){var i=Object.keys(r)[0];n=r[i],r=i,n.forEach((function(r){t.push(r),e.all[r]=!0}))}return t.push(r),e.all[r]={keyword:r,code:a[r],implements:n}})),e.all.$comment={keyword:"$comment",code:a.$comment},r.type&&(e.types[r.type]=r)})),e.keywords=n(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},function(e,t,r){"use strict";e.exports={$ref:r(136),allOf:r(137),anyOf:r(138),$comment:r(139),const:r(140),contains:r(141),dependencies:r(142),enum:r(143),format:r(144),if:r(145),items:r(146),maximum:r(63),minimum:r(63),maxItems:r(64),minItems:r(64),maxLength:r(65),minLength:r(65),maxProperties:r(66),minProperties:r(66),multipleOf:r(147),not:r(148),oneOf:r(149),pattern:r(150),properties:r(151),propertyNames:r(152),required:r(153),uniqueItems:r(154),validate:r(62)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n,i=" ",o=e.level,s=e.dataLevel,l=e.schema[t],u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(s||""),d="valid"+o;if("#"==l||"#/"==l)e.isRoot?(a=e.async,n="validate"):(a=!0===e.root.schema.$async,n="root.refVal[0]");else{var h=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===h){var p=e.MissingRefError.message(e.baseId,l);if("fail"==e.opts.missingRefs){e.logger.error(p),(y=y||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,l,p);e.logger.warn(p),c&&(i+=" if (true) { ")}}else if(h.inline){var v=e.util.copy(e);v.level++;var g="valid"+v.level;v.schema=h.schema,v.schemaPath="",v.errSchemaPath=l,i+=" "+e.validate(v).replace(/validate\.schema/g,h.code)+" ",c&&(i+=" if ("+g+") { ")}else a=!0===h.$async||e.async&&!1!==h.$async,n=h.code}if(n){var y;(y=y||[]).push(i),i="",e.opts.passContext?i+=" "+n+".call(this, ":i+=" "+n+"( ",i+=" "+f+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var b=i+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(i=y.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(i+=" var "+d+"; "),i+=" try { await "+b+"; ",c&&(i+=" "+d+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(i+=" "+d+" = false; "),i+=" } ",c&&(i+=" if ("+d+") { ")}else i+=" if (!"+b+") { if (vErrors === null) vErrors = "+n+".errors; else vErrors = vErrors.concat("+n+".errors); errors = vErrors.length; } ",c&&(i+=" else { ")}return i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.schema[t],i=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,l=e.util.copy(e),u="";l.level++;var c="valid"+l.level,f=l.baseId,d=!0,h=n;if(h)for(var p,m=-1,v=h.length-1;m0:e.util.schemaHasRules(p,e.RULES.all))&&(d=!1,l.schema=p,l.schemaPath=i+"["+m+"]",l.errSchemaPath=o+"/"+m,a+=" "+e.validate(l)+" ",l.baseId=f,s&&(a+=" if ("+c+") { ",u+="}"));return s&&(a+=d?" if (true) { ":" "+u.slice(0,-1)+" "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level;if(o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var v=h.baseId;a+=" var "+d+" = errors; var "+f+" = false; ";var g=e.compositeRule;e.compositeRule=h.compositeRule=!0;var y=o;if(y)for(var b,w=-1,x=y.length-1;w0:e.util.schemaHasRules(o,e.RULES.all);if(a+="var "+d+" = errors;var "+f+";",b){var w=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+p+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var x=c+"["+m+"]";h.dataPathArr[v]=m;var _=e.validate(h);h.baseId=y,e.util.varOccurences(_,g)<2?a+=" "+e.util.varReplace(_,g,x)+" ":a+=" var "+g+" = "+x+"; "+_+" ",a+=" if ("+p+") break; } ",e.compositeRule=h.compositeRule=w,a+=" if (!"+p+") {"}else a+=" if ("+c+".length == 0) {";var A=A||[];A.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;return a=A.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",b&&(a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m={},v={},g=e.opts.ownProperties;for(x in o){var y=o[x],b=Array.isArray(y)?v:m;b[x]=y}a+="var "+f+" = errors;";var w=e.errorPath;for(var x in a+="var missing"+n+";",v)if((b=v[x]).length){if(a+=" if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),u){a+=" && ( ";var _=b;if(_)for(var A=-1,E=_.length-1;A0:e.util.schemaHasRules(y,e.RULES.all))&&(a+=" "+p+" = true; if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),a+=") { ",d.schema=y,d.schemaPath=s+e.util.getProperty(x),d.errSchemaPath=l+"/"+e.util.escapeFragment(x),a+=" "+e.validate(d)+" ",d.baseId=I,a+=" } ",u&&(a+=" if ("+p+") { ",h+="}"))}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d=e.opts.$data&&o&&o.$data;d&&(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var h="i"+n,p="schema"+n;d||(a+=" var "+p+" = validate.schema"+s+";"),a+="var "+f+";",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=f+" = false;for (var "+h+"=0; "+h+"<"+p+".length; "+h+"++) if (equal("+c+", "+p+"["+h+"])) { "+f+" = true; break; }",d&&(a+=" } "),a+=" if (!"+f+") { ";var m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var v=a;return a=m.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||"");if(!1===e.opts.format)return u&&(a+=" if (true) { "),a;var f,d=e.opts.$data&&o&&o.$data;d?(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",f="schema"+n):f=o;var h=e.opts.unknownFormats,p=Array.isArray(h);if(d){a+=" var "+(m="format"+n)+" = formats["+f+"]; var "+(v="isObject"+n)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(g="formatType"+n)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+n+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",d&&(a+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),a+=" (","ignore"!=h&&(a+=" ("+f+" && !"+m+" ",p&&(a+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),a+=") || "),a+=" ("+m+" && "+g+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?a+=" (async"+n+" ? await "+m+"("+c+") : "+m+"("+c+")) ":a+=" "+m+"("+c+") ",a+=" : "+m+".test("+c+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==h)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(a+=" if (true) { "),a;if(p&&h.indexOf(o)>=0)return u&&(a+=" if (true) { "),a;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,g=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var y=!0===m.async;m=m.validate}if(g!=r)return u&&(a+=" if (true) { "),a;if(y){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(b="formats"+e.util.getProperty(o)+".validate")+"("+c+"))) { "}else{a+=" if (! ";var b="formats"+e.util.getProperty(o);v&&(b+=".validate"),a+="function"==typeof m?" "+b+"("+c+") ":" "+b+".test("+c+") ",a+=") { "}}var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=d?""+f:""+e.util.toQuotedString(o),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=d?"' + "+f+" + '":""+e.util.escapeQuotes(o),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=d?"validate.schema"+s:""+e.util.toQuotedString(o),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var x=a;return a=w.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e);h.level++;var p="valid"+h.level,m=e.schema.then,v=e.schema.else,g=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),b=h.baseId;if(g||y){var w;h.createErrors=!1,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+d+" = errors; var "+f+" = true; ";var x=e.compositeRule;e.compositeRule=h.compositeRule=!0,a+=" "+e.validate(h)+" ",h.baseId=b,h.createErrors=!0,a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=x,g?(a+=" if ("+p+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'then'; ":w="'then'",a+=" } ",y&&(a+=" else { ")):a+=" if (!"+p+") { ",y&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'else'; ":w="'else'",a+=" } "),a+=" if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",u&&(a+=" else { "),a=e.util.cleanUpCode(a)}else u&&(a+=" if (true) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v="i"+n,g=h.dataLevel=e.dataLevel+1,y="data"+g,b=e.baseId;if(a+="var "+d+" = errors;var "+f+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){a+=" "+f+" = "+c+".length <= "+o.length+"; ";var x=l;l=e.errSchemaPath+"/additionalItems",a+=" if (!"+f+") { ";var _=_||[];_.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var A=a;a=_.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+A+"]); ":a+=" validate.errors = ["+A+"]; return false; ":a+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l=x,u&&(p+="}",a+=" else { ")}var E=o;if(E)for(var S,M=-1,T=E.length-1;M0:e.util.schemaHasRules(S,e.RULES.all)){a+=" "+m+" = true; if ("+c+".length > "+M+") { ";var P=c+"["+M+"]";h.schema=S,h.schemaPath=s+"["+M+"]",h.errSchemaPath=l+"/"+M,h.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,!0),h.dataPathArr[g]=M;var F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",a+=" } ",u&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){h.schema=w,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+c+".length > "+o.length+") { for (var "+v+" = "+o.length+"; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" } } ",u&&(a+=" if ("+m+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" }"}return u&&(a+=" "+p+" if ("+d+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="var division"+i+";if (",d&&(n+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),n+=" (division"+i+" = "+f+" / "+a+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+i+" !== parseInt(division"+i+") ",n+=" ) ",d&&(n+=" ) "),n+=" ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" var "+f+" = errors; ";var p,m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(p=d.opts.allErrors,d.opts.allErrors=!1),a+=" "+e.validate(d)+" ",d.createErrors=!0,p&&(d.opts.allErrors=p),e.compositeRule=d.compositeRule=m,a+=" if ("+h+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(a+=" if (false) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v=h.baseId,g="prevValid"+n,y="passingSchemas"+n;a+="var "+d+" = errors , "+g+" = false , "+f+" = false , "+y+" = null; ";var b=e.compositeRule;e.compositeRule=h.compositeRule=!0;var w=o;if(w)for(var x,_=-1,A=w.length-1;_0:e.util.schemaHasRules(x,e.RULES.all))?(h.schema=x,h.schemaPath=s+"["+_+"]",h.errSchemaPath=l+"/"+_,a+=" "+e.validate(h)+" ",h.baseId=v):a+=" var "+m+" = true; ",_&&(a+=" if ("+m+" && "+g+") { "+f+" = false; "+y+" = ["+y+", "+_+"]; } else { ",p+="}"),a+=" if ("+m+") { "+f+" = "+g+" = true; "+y+" = "+_+"; }";return e.compositeRule=h.compositeRule=b,a+=p+"if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'string') || "),n+=" !"+(d?"(new RegExp("+a+"))":e.usePattern(s))+".test("+f+") ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",n+=d?""+a:""+e.util.toQuotedString(s),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match pattern \"",n+=d?"' + "+a+" + '":""+e.util.escapeQuotes(s),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+e.util.toQuotedString(s),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m="key"+n,v="idx"+n,g=d.dataLevel=e.dataLevel+1,y="data"+g,b="dataProperties"+n,w=Object.keys(o||{}),x=e.schema.patternProperties||{},_=Object.keys(x),A=e.schema.additionalProperties,E=w.length||_.length,S=!1===A,M="object"==typeof A&&Object.keys(A).length,T=e.opts.removeAdditional,P=S||M||T,F=e.opts.ownProperties,O=e.baseId,L=e.schema.required;if(L&&(!e.opts.$data||!L.$data)&&L.length8)a+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var k=w;if(k)for(var R=-1,I=k.length-1;R0:e.util.schemaHasRules(K,e.RULES.all)){var J=e.util.getProperty(q),$=(H=c+J,Y&&void 0!==K.default);d.schema=K,d.schemaPath=s+J,d.errSchemaPath=l+"/"+e.util.escapeFragment(q),d.errorPath=e.util.getPath(e.errorPath,q,e.opts.jsonPointers),d.dataPathArr[g]=e.util.toQuotedString(q);X=e.validate(d);if(d.baseId=O,e.util.varOccurences(X,y)<2){X=e.util.varReplace(X,y,H);var ee=H}else{ee=y;a+=" var "+y+" = "+H+"; "}if($)a+=" "+X+" ";else{if(C&&C[q]){a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = false; ";j=e.errorPath,V=l;var te,re=e.util.escapeQuotes(q);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,q,e.opts.jsonPointers)),l=e.errSchemaPath+"/required",(te=te||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+re+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";z=a;a=te.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+z+"]); ":a+=" validate.errors = ["+z+"]; return false; ":a+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=V,e.errorPath=j,a+=" } else { "}else u?(a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = true; } else { "):(a+=" if ("+ee+" !== undefined ",F&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=" ) { ");a+=" "+X+" } "}}u&&(a+=" if ("+p+") { ",h+="}")}}if(_.length){var ae=_;if(ae)for(var ne,ie=-1,oe=ae.length-1;ie0:e.util.schemaHasRules(K,e.RULES.all)){d.schema=K,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ne),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ne),a+=F?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+b+".length; "+v+"++) { var "+m+" = "+b+"["+v+"]; ":" for (var "+m+" in "+c+") { ",a+=" if ("+e.usePattern(ne)+".test("+m+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);H=c+"["+m+"]";d.dataPathArr[g]=m;X=e.validate(d);d.baseId=O,e.util.varOccurences(X,y)<2?a+=" "+e.util.varReplace(X,y,H)+" ":a+=" var "+y+" = "+H+"; "+X+" ",u&&(a+=" if (!"+p+") break; "),a+=" } ",u&&(a+=" else "+p+" = true; "),a+=" } ",u&&(a+=" if ("+p+") { ",h+="}")}}}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(a+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l;var p="key"+n,m="idx"+n,v="i"+n,g="' + "+p+" + '",y="data"+(d.dataLevel=e.dataLevel+1),b="dataProperties"+n,w=e.opts.ownProperties,x=e.baseId;w&&(a+=" var "+b+" = undefined; "),a+=w?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+b+".length; "+m+"++) { var "+p+" = "+b+"["+m+"]; ":" for (var "+p+" in "+c+") { ",a+=" var startErrs"+n+" = errors; ";var _=p,A=e.compositeRule;e.compositeRule=d.compositeRule=!0;var E=e.validate(d);d.baseId=x,e.util.varOccurences(E,y)<2?a+=" "+e.util.varReplace(E,y,_)+" ":a+=" var "+y+" = "+_+"; "+E+" ",e.compositeRule=d.compositeRule=A,a+=" if (!"+h+") { for (var "+v+"=startErrs"+n+"; "+v+"0:e.util.schemaHasRules(b,e.RULES.all))||(p[p.length]=v)}}else p=o;if(d||p.length){var w=e.errorPath,x=d||p.length>=e.opts.loopRequired,_=e.opts.ownProperties;if(u)if(a+=" var missing"+n+"; ",x){d||(a+=" var "+h+" = validate.schema"+s+"; ");var A="' + "+(F="schema"+n+"["+(M="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),a+=" var "+f+" = true; ",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=" for (var "+M+" = 0; "+M+" < "+h+".length; "+M+"++) { "+f+" = "+c+"["+h+"["+M+"]] !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", "+h+"["+M+"]) "),a+="; if (!"+f+") break; } ",d&&(a+=" } "),a+=" if (!"+f+") { ",(P=P||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+A+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;a=P.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var S=p;if(S)for(var M=-1,T=S.length-1;M 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(p.indexOf("object")>=0||p.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+d+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var v="checkDataType"+(m?"s":"");n+=" if ("+e.util[v](p,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",h&&(n+=" } "),n+=" if (!"+d+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var y=n;n=g.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { ")}else c&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";var a=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,t){for(var r=0;r(e[t]=function(e,t,r,n){return[(t,n)=>{if(n+r>t.length)throw new a;return{value:t[e](n),size:r}},(e,a,n)=>(a[t](e,n),n+r),r,n]}(n[t][0],n[t][1],n[t][2],r(20)[t]),e),{});i.i64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32BE(t),e.readInt32BE(t+4)],size:8}},function(e,t,r){return t.writeInt32BE(e[0],r),t.writeInt32BE(e[1],r+4),r+8},8,r(20).i64],i.li64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32LE(t+4),e.readInt32LE(t)],size:8}},function(e,t,r){return t.writeInt32LE(e[0],r+4),t.writeInt32LE(e[1],r),r+8},8,r(20).li64],i.u64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32BE(t),e.readUInt32BE(t+4)],size:8}},function(e,t,r){return t.writeUInt32BE(e[0],r),t.writeUInt32BE(e[1],r+4),r+8},8,r(20).u64],i.lu64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32LE(t+4),e.readUInt32LE(t)],size:8}},function(e,t,r){return t.writeUInt32LE(e[0],r+4),t.writeUInt32LE(e[1],r),r+8},8,r(20).lu64],e.exports=i},function(e,t,r){(function(t){const a=r(27),{getCount:n,sendCount:i,calcCount:o,PartialReadError:s}=r(14);function l(e,t){return e===t||parseInt(e)===parseInt(t)}function u(e){return(1<e.length)throw new s;const o=e.readUInt8(i);if(r|=(127&o)<>>=7;return t.writeUInt8(e,r+a),r+a+1},function(e){let t=0;for(;-128&e;)e>>>=7,t++;return t+1},r(12).varint],bool:[function(e,t){if(t+1>e.length)throw new s;return{value:!!e.readInt8(t),size:1}},function(e,t,r){return t.writeInt8(+e,r),r+1},1,r(12).bool],pstring:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a),l=t+i,u=l+o;if(u>e.length)throw new s("Missing characters in string, found size is "+e.length+" expected size was "+u);return{value:e.toString("utf8",l,u),size:u-t}},function(e,r,a,n,o){const s=t.byteLength(e,"utf8");return a=i.call(this,s,r,a,n,o),r.write(e,a,s,"utf8"),a+s},function(e,r,a){const n=t.byteLength(e,"utf8");return o.call(this,n,r,a)+n},r(12).pstring],buffer:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a);if((t+=i)+o>e.length)throw new s;return{value:e.slice(t,t+o),size:i+o}},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.copy(t,r),r+e.length},function(e,t,r){return o.call(this,e.length,t,r)+e.length},r(12).buffer],void:[function(){return{value:void 0,size:0}},function(e,t,r){return r},0,r(12).void],bitfield:[function(e,t,r){const a=t;let n=null,i=0;const o={};return o.value=r.reduce((r,{size:a,signed:o,name:l})=>{let c=a,f=0;for(;c>0;){if(0===i){if(e.length>i-r,i-=r,c-=r}return o&&f>=1<{const l=e[s];if(!o&&l<0||o&&l<-(1<=1<=(1<= "+o?1<0;){const e=Math.min(8-i,a);n=n<>a-e&u(e),a-=e,8===(i+=e)&&(t[r++]=n,i=0,n=0)}}),0!==i&&(t[r++]=n<<8-i);return r},function(e,t){return Math.ceil(t.reduce((e,{size:t})=>e+t,0)/8)},r(12).bitfield],cstring:[function(e,t){let r=0;for(;t+rthis.read(e,t,r.type,a),n)),i.size+=u,t+=u,i.value.push(o);return i},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.reduce((e,r,i)=>s(()=>this.write(r,t,e,a.type,n),i),r)},function(e,t,r){let a=o.call(this,e.length,t,r);return a=e.reduce((e,a,n)=>s(()=>e+this.sizeOf(a,t.type,r),n),a)},r(40).array],count:[function(e,t,{type:r},a){return this.read(e,t,r,a)},function(e,t,r,{countFor:n,type:i},o){return this.write(a(n,o).length,t,r,i,o)},function(e,{countFor:t,type:r},n){return this.sizeOf(a(t,n).length,r,n)},r(40).count],container:[function(e,t,r,a){const n={value:{"..":a},size:0};return r.forEach(({type:r,name:a,anon:i})=>{s(()=>{const o=this.read(e,t,r,n.value);n.size+=o.size,t+=o.size,i?void 0!==o.value&&Object.keys(o.value).forEach(e=>{n.value[e]=o.value[e]}):n.value[a]=o.value},a||"unknown")}),delete n.value[".."],n},function(e,t,r,a,n){return e[".."]=n,r=a.reduce((r,{type:a,name:n,anon:i})=>s(()=>this.write(i?e:e[n],t,r,a,e),n||"unknown"),r),delete e[".."],r},function(e,t,r){e[".."]=r;const a=t.reduce((t,{type:r,name:a,anon:n})=>t+s(()=>this.sizeOf(n?e:e[a],r,e),a||"unknown"),0);return delete e[".."],a},r(40).container]}},function(e,t,r){const{getField:a,getFieldInfo:n,tryDoc:i,PartialReadError:o}=r(14);e.exports={switch:[function(e,t,{compareTo:r,fields:o,compareToValue:s,default:l},u){if(r=void 0!==s?s:a(r,u),void 0===o[r]&&void 0===l)throw new Error(r+" has no associated fieldInfo in switch");const c=void 0===o[r],f=c?l:o[r],d=n(f);return i(()=>this.read(e,t,d,u),c?"default":r)},function(e,t,r,{compareTo:o,fields:s,compareToValue:l,default:u},c){if(o=void 0!==l?l:a(o,c),void 0===s[o]&&void 0===u)throw new Error(o+" has no associated fieldInfo in switch");const f=void 0===s[o],d=n(f?u:s[o]);return i(()=>this.write(e,t,r,d,c),f?"default":o)},function(e,{compareTo:t,fields:r,compareToValue:o,default:s},l){if(t=void 0!==o?o:a(t,l),void 0===r[t]&&void 0===s)throw new Error(t+" has no associated fieldInfo in switch");const u=void 0===r[t],c=n(u?s:r[t]);return i(()=>this.sizeOf(e,c,l),u?"default":t)},r(68).switch],option:[function(e,t,r,a){if(e.length0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,a,n=o.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=n,a=s,o.prototype.copy.call(t,r,a),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(i===n.length?a+=n:a+=n.slice(0,e),0==(e-=i)){i===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(i));break}++r}return this.length-=r,a}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,i=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,i),0==(e-=i)){i===n.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(i));break}++a}return this.length-=a,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&d.forEach(l),i||(d.forEach(l),f(c))}))}));return t.reduce(u)}},function(e,t){e.exports={compound:[function(e,t,r,a){const n={value:{},size:0};for(;;){const r=this.read(e,t,"i8",a);if(0===r.value){t+=r.size,n.size+=r.size;break}const i=this.read(e,t,"nbt",a);t+=i.size,n.size+=i.size,n.value[i.value.name]={type:i.value.type,value:i.value.value}}return n},function(e,t,r,a,n){const i=this;return Object.keys(e).map((function(a){r=i.write({name:a,type:e[a].type,value:e[a].value},t,r,"nbt",n)})),r=this.write(0,t,r,"i8",n)},function(e,t,r){const a=this;return 1+Object.keys(e).reduce((function(t,n){return t+a.sizeOf({name:n,type:e[n].type,value:e[n].value},"nbt",r)}),0)}]}},function(e){e.exports=JSON.parse('{"container":"native","i8":"native","switch":"native","compound":"native","i16":"native","i32":"native","i64":"native","f32":"native","f64":"native","pstring":"native","shortString":["pstring",{"countType":"i16"}],"byteArray":["array",{"countType":"i32","type":"i8"}],"list":["container",[{"name":"type","type":"nbtMapper"},{"name":"value","type":["array",{"countType":"i32","type":["nbtSwitch",{"type":"type"}]}]}]],"intArray":["array",{"countType":"i32","type":"i32"}],"longArray":["array",{"countType":"i32","type":"i64"}],"nbtMapper":["mapper",{"type":"i8","mappings":{"0":"end","1":"byte","2":"short","3":"int","4":"long","5":"float","6":"double","7":"byteArray","8":"string","9":"list","10":"compound","11":"intArray","12":"longArray"}}],"nbtSwitch":["switch",{"compareTo":"$type","fields":{"end":"void","byte":"i8","short":"i16","int":"i32","long":"i64","float":"f32","double":"f64","byteArray":"byteArray","string":"shortString","list":"list","compound":"compound","intArray":"intArray","longArray":"longArray"}}],"nbt":["container",[{"name":"type","type":"nbtMapper"},{"name":"name","type":"shortString"},{"name":"value","type":["nbtSwitch",{"type":"type"}]}]]}')},function(e,t){var r,a;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&a.rotl(e,8)|4278255360&a.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,a=0;r>>5]|=e[r]<<24-a%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],a=0,n=0;a>>6-2*n);return t}},e.exports=a},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} +!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var a=t.length-1,n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(e){throw new RangeError(h[e])}function g(e,t){var r=e.split("@"),a="";r.length>1&&(a=r[0]+"@",e=r[1]);var n=function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(d,".")).split("."),t).join(".");return a+n}function y(e){for(var t=[],r=0,a=e.length;r=55296&&n<=56319&&r>1,e+=p(e/t);e>455;a+=36)e=p(e/35);return p(a+36*e/(e+38))},x=function(e){var t,r=[],a=e.length,n=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var l=0;l=128&&v("not-basic"),r.push(e.charCodeAt(l));for(var c=s>0?s+1:0;c=a&&v("invalid-input");var m=(t=e.charCodeAt(c++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>p((u-n)/d))&&v("overflow"),n+=m*d;var g=h<=o?1:h>=o+26?26:h-o;if(mp(u/y)&&v("overflow"),d*=y}var b=r.length+1;o=w(n-f,b,0==f),p(n/b)>u-i&&v("overflow"),i+=p(n/b),n%=b,r.splice(n++,0,i)}return String.fromCodePoint.apply(String,r)},_=function(e){var t=[],r=(e=y(e)).length,a=128,n=0,i=72,o=!0,s=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(o=(c=f.next()).done);o=!0){var d=c.value;d<128&&t.push(m(d))}}catch(e){s=!0,l=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw l}}var h=t.length,g=h;for(h&&t.push("-");g=a&&Tp((u-n)/P)&&v("overflow"),n+=(x-a)*P,a=x;var F=!0,O=!1,L=void 0;try{for(var C,k=e[Symbol.iterator]();!(F=(C=k.next()).done);F=!0){var R=C.value;if(Ru&&v("overflow"),R==a){for(var I=n,N=36;;N+=36){var D=N<=i?1:N>=i+26?26:N-i;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function M(e){for(var t="",r=0,a=e.length;r=194&&n<224){if(a-r>=6){var i=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&n)<<6|63&i)}else t+=e.substr(r,6);r+=6}else if(n>=224){if(a-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function T(e,t){function r(e){var r=M(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,n)),e}function P(e){return e.replace(/^0*(.*)/,"$1")||"0"}function F(e,t){var r=e.match(t.IPV4ADDRESS)||[],a=l(r,2)[1];return a?a.split(".").map(P).join("."):e}function O(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=l(r,3),n=a[1],i=a[2];if(n){for(var o=n.toLowerCase().split("::").reverse(),s=l(o,2),u=s[0],c=s[1],f=c?c.split(":").map(P):[],d=u.split(":").map(P),h=t.IPV4ADDRESS.test(d[d.length-1]),p=h?7:8,m=d.length-p,v=Array(p),g=0;g1){var w=v.slice(0,y.index),x=v.slice(y.index+y.length);b=w.join(":")+"::"+x.join(":")}else b=v.join(":");return i&&(b+="%"+i),b}return e}var L=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,C=void 0==="".match(/(){0}/)[1];function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(L);if(n){C?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=O(F(r.host,a),a)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var i=E[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)T(r,a);else{if(r.host&&(t.domainHost||i&&i.domainHost))try{r.host=A.toASCII(r.host.replace(a.PCT_ENCODED,M).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}T(r,o)}i&&i.parse&&i.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var R=/^\.\.?\//,I=/^\/\.(\/|$)/,N=/^\/\.\.(\/|$)/,D=/^\/?(?:.|\n)*?(?=\/|$)/;function U(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(I))e=e.replace(I,"/");else if(e.match(N))e=e.replace(N,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(D);if(!r)throw new Error("Unexpected dot segment condition");var a=r[0];e=e.slice(a.length),t.push(a)}return t.join("")}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,a=[],n=E[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||n&&n.domainHost)try{e.host=t.iri?A.toUnicode(e.host):A.toASCII(e.host.replace(r.PCT_ENCODED,M).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}T(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var i=function(e,t){var r=!1!==t.iri?s:o,a=[];return void 0!==e.userinfo&&(a.push(e.userinfo),a.push("@")),void 0!==e.host&&a.push(O(F(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"==typeof e.port&&(a.push(":"),a.push(e.port.toString(10))),a.length?a.join(""):void 0}(e,t);if(void 0!==i&&("suffix"!==t.reference&&a.push("//"),a.push(i),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||n&&n.absolutePath||(l=U(l)),void 0===i&&(l=l.replace(/^\/\//,"/%2F")),a.push(l)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function B(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=k(j(e,r),r),t=k(j(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=U(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=U(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function V(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,M)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},G={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},H={},X="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",W=r(r("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+r("%"+Y+Y)),q=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Q=new RegExp(X,"g"),Z=new RegExp(W,"g"),K=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',q),"g"),J=new RegExp(t("[^]",X,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),$=J;function ee(e){var t=M(e);return t.match(Q)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,i={},o=r.query.split("&"),s=0,l=o.length;s=55296&&t<=56319&&n%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",a.copy(m[e])}function v(e){var t=e.match(n);if(!t)return!1;var r=+t[1],a=+t[2],o=+t[3];return a>=1&&a<=12&&o>=1&&o<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[a])}function g(e,t){var r=e.match(o);if(!r)return!1;var a=r[1],n=r[2],i=r[3],s=r[5];return(a<=23&&n<=59&&i<=59||23==a&&59==n&&60==i)&&(!t||s)}e.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p},m.full={date:v,time:g,"date-time":function(e){var t=e.split(y);return 2==t.length&&v(t[0])&&g(t[1],!0)},uri:function(e){return b.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]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:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p};var y=/t|\s/i;var b=/\/|:/;var w=/[^\\]\\Z/;function x(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},function(e,t,r){"use strict";var a=r(138),n=r(16).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=n(t),e.types=n(["number","integer","string","array","object","boolean","null"]),e.forEach((function(r){r.rules=r.rules.map((function(r){var n;if("object"==typeof r){var i=Object.keys(r)[0];n=r[i],r=i,n.forEach((function(r){t.push(r),e.all[r]=!0}))}return t.push(r),e.all[r]={keyword:r,code:a[r],implements:n}})),e.all.$comment={keyword:"$comment",code:a.$comment},r.type&&(e.types[r.type]=r)})),e.keywords=n(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},function(e,t,r){"use strict";e.exports={$ref:r(139),allOf:r(140),anyOf:r(141),$comment:r(142),const:r(143),contains:r(144),dependencies:r(145),enum:r(146),format:r(147),if:r(148),items:r(149),maximum:r(64),minimum:r(64),maxItems:r(65),minItems:r(65),maxLength:r(66),minLength:r(66),maxProperties:r(67),minProperties:r(67),multipleOf:r(150),not:r(151),oneOf:r(152),pattern:r(153),properties:r(154),propertyNames:r(155),required:r(156),uniqueItems:r(157),validate:r(63)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n,i=" ",o=e.level,s=e.dataLevel,l=e.schema[t],u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(s||""),d="valid"+o;if("#"==l||"#/"==l)e.isRoot?(a=e.async,n="validate"):(a=!0===e.root.schema.$async,n="root.refVal[0]");else{var h=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===h){var p=e.MissingRefError.message(e.baseId,l);if("fail"==e.opts.missingRefs){e.logger.error(p),(y=y||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,l,p);e.logger.warn(p),c&&(i+=" if (true) { ")}}else if(h.inline){var v=e.util.copy(e);v.level++;var g="valid"+v.level;v.schema=h.schema,v.schemaPath="",v.errSchemaPath=l,i+=" "+e.validate(v).replace(/validate\.schema/g,h.code)+" ",c&&(i+=" if ("+g+") { ")}else a=!0===h.$async||e.async&&!1!==h.$async,n=h.code}if(n){var y;(y=y||[]).push(i),i="",e.opts.passContext?i+=" "+n+".call(this, ":i+=" "+n+"( ",i+=" "+f+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var b=i+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(i=y.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(i+=" var "+d+"; "),i+=" try { await "+b+"; ",c&&(i+=" "+d+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(i+=" "+d+" = false; "),i+=" } ",c&&(i+=" if ("+d+") { ")}else i+=" if (!"+b+") { if (vErrors === null) vErrors = "+n+".errors; else vErrors = vErrors.concat("+n+".errors); errors = vErrors.length; } ",c&&(i+=" else { ")}return i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.schema[t],i=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,l=e.util.copy(e),u="";l.level++;var c="valid"+l.level,f=l.baseId,d=!0,h=n;if(h)for(var p,m=-1,v=h.length-1;m0:e.util.schemaHasRules(p,e.RULES.all))&&(d=!1,l.schema=p,l.schemaPath=i+"["+m+"]",l.errSchemaPath=o+"/"+m,a+=" "+e.validate(l)+" ",l.baseId=f,s&&(a+=" if ("+c+") { ",u+="}"));return s&&(a+=d?" if (true) { ":" "+u.slice(0,-1)+" "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level;if(o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var v=h.baseId;a+=" var "+d+" = errors; var "+f+" = false; ";var g=e.compositeRule;e.compositeRule=h.compositeRule=!0;var y=o;if(y)for(var b,w=-1,x=y.length-1;w0:e.util.schemaHasRules(o,e.RULES.all);if(a+="var "+d+" = errors;var "+f+";",b){var w=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+p+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var x=c+"["+m+"]";h.dataPathArr[v]=m;var _=e.validate(h);h.baseId=y,e.util.varOccurences(_,g)<2?a+=" "+e.util.varReplace(_,g,x)+" ":a+=" var "+g+" = "+x+"; "+_+" ",a+=" if ("+p+") break; } ",e.compositeRule=h.compositeRule=w,a+=" if (!"+p+") {"}else a+=" if ("+c+".length == 0) {";var A=A||[];A.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;return a=A.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",b&&(a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m={},v={},g=e.opts.ownProperties;for(x in o){var y=o[x],b=Array.isArray(y)?v:m;b[x]=y}a+="var "+f+" = errors;";var w=e.errorPath;for(var x in a+="var missing"+n+";",v)if((b=v[x]).length){if(a+=" if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),u){a+=" && ( ";var _=b;if(_)for(var A=-1,E=_.length-1;A0:e.util.schemaHasRules(y,e.RULES.all))&&(a+=" "+p+" = true; if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),a+=") { ",d.schema=y,d.schemaPath=s+e.util.getProperty(x),d.errSchemaPath=l+"/"+e.util.escapeFragment(x),a+=" "+e.validate(d)+" ",d.baseId=I,a+=" } ",u&&(a+=" if ("+p+") { ",h+="}"))}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d=e.opts.$data&&o&&o.$data;d&&(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var h="i"+n,p="schema"+n;d||(a+=" var "+p+" = validate.schema"+s+";"),a+="var "+f+";",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=f+" = false;for (var "+h+"=0; "+h+"<"+p+".length; "+h+"++) if (equal("+c+", "+p+"["+h+"])) { "+f+" = true; break; }",d&&(a+=" } "),a+=" if (!"+f+") { ";var m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var v=a;return a=m.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||"");if(!1===e.opts.format)return u&&(a+=" if (true) { "),a;var f,d=e.opts.$data&&o&&o.$data;d?(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",f="schema"+n):f=o;var h=e.opts.unknownFormats,p=Array.isArray(h);if(d){a+=" var "+(m="format"+n)+" = formats["+f+"]; var "+(v="isObject"+n)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(g="formatType"+n)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+n+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",d&&(a+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),a+=" (","ignore"!=h&&(a+=" ("+f+" && !"+m+" ",p&&(a+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),a+=") || "),a+=" ("+m+" && "+g+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?a+=" (async"+n+" ? await "+m+"("+c+") : "+m+"("+c+")) ":a+=" "+m+"("+c+") ",a+=" : "+m+".test("+c+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==h)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(a+=" if (true) { "),a;if(p&&h.indexOf(o)>=0)return u&&(a+=" if (true) { "),a;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,g=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var y=!0===m.async;m=m.validate}if(g!=r)return u&&(a+=" if (true) { "),a;if(y){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(b="formats"+e.util.getProperty(o)+".validate")+"("+c+"))) { "}else{a+=" if (! ";var b="formats"+e.util.getProperty(o);v&&(b+=".validate"),a+="function"==typeof m?" "+b+"("+c+") ":" "+b+".test("+c+") ",a+=") { "}}var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=d?""+f:""+e.util.toQuotedString(o),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=d?"' + "+f+" + '":""+e.util.escapeQuotes(o),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=d?"validate.schema"+s:""+e.util.toQuotedString(o),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var x=a;return a=w.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e);h.level++;var p="valid"+h.level,m=e.schema.then,v=e.schema.else,g=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),b=h.baseId;if(g||y){var w;h.createErrors=!1,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+d+" = errors; var "+f+" = true; ";var x=e.compositeRule;e.compositeRule=h.compositeRule=!0,a+=" "+e.validate(h)+" ",h.baseId=b,h.createErrors=!0,a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=x,g?(a+=" if ("+p+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'then'; ":w="'then'",a+=" } ",y&&(a+=" else { ")):a+=" if (!"+p+") { ",y&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'else'; ":w="'else'",a+=" } "),a+=" if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",u&&(a+=" else { "),a=e.util.cleanUpCode(a)}else u&&(a+=" if (true) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v="i"+n,g=h.dataLevel=e.dataLevel+1,y="data"+g,b=e.baseId;if(a+="var "+d+" = errors;var "+f+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){a+=" "+f+" = "+c+".length <= "+o.length+"; ";var x=l;l=e.errSchemaPath+"/additionalItems",a+=" if (!"+f+") { ";var _=_||[];_.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var A=a;a=_.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+A+"]); ":a+=" validate.errors = ["+A+"]; return false; ":a+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l=x,u&&(p+="}",a+=" else { ")}var E=o;if(E)for(var S,M=-1,T=E.length-1;M0:e.util.schemaHasRules(S,e.RULES.all)){a+=" "+m+" = true; if ("+c+".length > "+M+") { ";var P=c+"["+M+"]";h.schema=S,h.schemaPath=s+"["+M+"]",h.errSchemaPath=l+"/"+M,h.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,!0),h.dataPathArr[g]=M;var F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",a+=" } ",u&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){h.schema=w,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+c+".length > "+o.length+") { for (var "+v+" = "+o.length+"; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" } } ",u&&(a+=" if ("+m+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" }"}return u&&(a+=" "+p+" if ("+d+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="var division"+i+";if (",d&&(n+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),n+=" (division"+i+" = "+f+" / "+a+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+i+" !== parseInt(division"+i+") ",n+=" ) ",d&&(n+=" ) "),n+=" ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" var "+f+" = errors; ";var p,m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(p=d.opts.allErrors,d.opts.allErrors=!1),a+=" "+e.validate(d)+" ",d.createErrors=!0,p&&(d.opts.allErrors=p),e.compositeRule=d.compositeRule=m,a+=" if ("+h+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(a+=" if (false) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v=h.baseId,g="prevValid"+n,y="passingSchemas"+n;a+="var "+d+" = errors , "+g+" = false , "+f+" = false , "+y+" = null; ";var b=e.compositeRule;e.compositeRule=h.compositeRule=!0;var w=o;if(w)for(var x,_=-1,A=w.length-1;_0:e.util.schemaHasRules(x,e.RULES.all))?(h.schema=x,h.schemaPath=s+"["+_+"]",h.errSchemaPath=l+"/"+_,a+=" "+e.validate(h)+" ",h.baseId=v):a+=" var "+m+" = true; ",_&&(a+=" if ("+m+" && "+g+") { "+f+" = false; "+y+" = ["+y+", "+_+"]; } else { ",p+="}"),a+=" if ("+m+") { "+f+" = "+g+" = true; "+y+" = "+_+"; }";return e.compositeRule=h.compositeRule=b,a+=p+"if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'string') || "),n+=" !"+(d?"(new RegExp("+a+"))":e.usePattern(s))+".test("+f+") ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",n+=d?""+a:""+e.util.toQuotedString(s),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match pattern \"",n+=d?"' + "+a+" + '":""+e.util.escapeQuotes(s),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+e.util.toQuotedString(s),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m="key"+n,v="idx"+n,g=d.dataLevel=e.dataLevel+1,y="data"+g,b="dataProperties"+n,w=Object.keys(o||{}),x=e.schema.patternProperties||{},_=Object.keys(x),A=e.schema.additionalProperties,E=w.length||_.length,S=!1===A,M="object"==typeof A&&Object.keys(A).length,T=e.opts.removeAdditional,P=S||M||T,F=e.opts.ownProperties,O=e.baseId,L=e.schema.required;if(L&&(!e.opts.$data||!L.$data)&&L.length8)a+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var k=w;if(k)for(var R=-1,I=k.length-1;R0:e.util.schemaHasRules(K,e.RULES.all)){var J=e.util.getProperty(q),$=(H=c+J,Y&&void 0!==K.default);d.schema=K,d.schemaPath=s+J,d.errSchemaPath=l+"/"+e.util.escapeFragment(q),d.errorPath=e.util.getPath(e.errorPath,q,e.opts.jsonPointers),d.dataPathArr[g]=e.util.toQuotedString(q);X=e.validate(d);if(d.baseId=O,e.util.varOccurences(X,y)<2){X=e.util.varReplace(X,y,H);var ee=H}else{ee=y;a+=" var "+y+" = "+H+"; "}if($)a+=" "+X+" ";else{if(C&&C[q]){a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = false; ";j=e.errorPath,V=l;var te,re=e.util.escapeQuotes(q);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,q,e.opts.jsonPointers)),l=e.errSchemaPath+"/required",(te=te||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+re+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";z=a;a=te.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+z+"]); ":a+=" validate.errors = ["+z+"]; return false; ":a+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=V,e.errorPath=j,a+=" } else { "}else u?(a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = true; } else { "):(a+=" if ("+ee+" !== undefined ",F&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=" ) { ");a+=" "+X+" } "}}u&&(a+=" if ("+p+") { ",h+="}")}}if(_.length){var ae=_;if(ae)for(var ne,ie=-1,oe=ae.length-1;ie0:e.util.schemaHasRules(K,e.RULES.all)){d.schema=K,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ne),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ne),a+=F?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+b+".length; "+v+"++) { var "+m+" = "+b+"["+v+"]; ":" for (var "+m+" in "+c+") { ",a+=" if ("+e.usePattern(ne)+".test("+m+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);H=c+"["+m+"]";d.dataPathArr[g]=m;X=e.validate(d);d.baseId=O,e.util.varOccurences(X,y)<2?a+=" "+e.util.varReplace(X,y,H)+" ":a+=" var "+y+" = "+H+"; "+X+" ",u&&(a+=" if (!"+p+") break; "),a+=" } ",u&&(a+=" else "+p+" = true; "),a+=" } ",u&&(a+=" if ("+p+") { ",h+="}")}}}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(a+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l;var p="key"+n,m="idx"+n,v="i"+n,g="' + "+p+" + '",y="data"+(d.dataLevel=e.dataLevel+1),b="dataProperties"+n,w=e.opts.ownProperties,x=e.baseId;w&&(a+=" var "+b+" = undefined; "),a+=w?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+b+".length; "+m+"++) { var "+p+" = "+b+"["+m+"]; ":" for (var "+p+" in "+c+") { ",a+=" var startErrs"+n+" = errors; ";var _=p,A=e.compositeRule;e.compositeRule=d.compositeRule=!0;var E=e.validate(d);d.baseId=x,e.util.varOccurences(E,y)<2?a+=" "+e.util.varReplace(E,y,_)+" ":a+=" var "+y+" = "+_+"; "+E+" ",e.compositeRule=d.compositeRule=A,a+=" if (!"+h+") { for (var "+v+"=startErrs"+n+"; "+v+"0:e.util.schemaHasRules(b,e.RULES.all))||(p[p.length]=v)}}else p=o;if(d||p.length){var w=e.errorPath,x=d||p.length>=e.opts.loopRequired,_=e.opts.ownProperties;if(u)if(a+=" var missing"+n+"; ",x){d||(a+=" var "+h+" = validate.schema"+s+"; ");var A="' + "+(F="schema"+n+"["+(M="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),a+=" var "+f+" = true; ",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=" for (var "+M+" = 0; "+M+" < "+h+".length; "+M+"++) { "+f+" = "+c+"["+h+"["+M+"]] !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", "+h+"["+M+"]) "),a+="; if (!"+f+") break; } ",d&&(a+=" } "),a+=" if (!"+f+") { ",(P=P||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+A+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;a=P.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var S=p;if(S)for(var M=-1,T=S.length-1;M 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(p.indexOf("object")>=0||p.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+d+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var v="checkDataType"+(m?"s":"");n+=" if ("+e.util[v](p,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",h&&(n+=" } "),n+=" if (!"+d+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var y=n;n=g.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { ")}else c&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";var a=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,t){for(var r=0;r(e[t]=function(e,t,r,n){return[(t,n)=>{if(n+r>t.length)throw new a;return{value:t[e](n),size:r}},(e,a,n)=>(a[t](e,n),n+r),r,n]}(n[t][0],n[t][1],n[t][2],r(21)[t]),e),{});i.i64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32BE(t),e.readInt32BE(t+4)],size:8}},function(e,t,r){return t.writeInt32BE(e[0],r),t.writeInt32BE(e[1],r+4),r+8},8,r(21).i64],i.li64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32LE(t+4),e.readInt32LE(t)],size:8}},function(e,t,r){return t.writeInt32LE(e[0],r+4),t.writeInt32LE(e[1],r),r+8},8,r(21).li64],i.u64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32BE(t),e.readUInt32BE(t+4)],size:8}},function(e,t,r){return t.writeUInt32BE(e[0],r),t.writeUInt32BE(e[1],r+4),r+8},8,r(21).u64],i.lu64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32LE(t+4),e.readUInt32LE(t)],size:8}},function(e,t,r){return t.writeUInt32LE(e[0],r+4),t.writeUInt32LE(e[1],r),r+8},8,r(21).lu64],e.exports=i},function(e,t,r){(function(t){const a=r(28),{getCount:n,sendCount:i,calcCount:o,PartialReadError:s}=r(15);function l(e,t){return e===t||parseInt(e)===parseInt(t)}function u(e){return(1<e.length)throw new s;const o=e.readUInt8(i);if(r|=(127&o)<>>=7;return t.writeUInt8(e,r+a),r+a+1},function(e){let t=0;for(;-128&e;)e>>>=7,t++;return t+1},r(12).varint],bool:[function(e,t){if(t+1>e.length)throw new s;return{value:!!e.readInt8(t),size:1}},function(e,t,r){return t.writeInt8(+e,r),r+1},1,r(12).bool],pstring:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a),l=t+i,u=l+o;if(u>e.length)throw new s("Missing characters in string, found size is "+e.length+" expected size was "+u);return{value:e.toString("utf8",l,u),size:u-t}},function(e,r,a,n,o){const s=t.byteLength(e,"utf8");return a=i.call(this,s,r,a,n,o),r.write(e,a,s,"utf8"),a+s},function(e,r,a){const n=t.byteLength(e,"utf8");return o.call(this,n,r,a)+n},r(12).pstring],buffer:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a);if((t+=i)+o>e.length)throw new s;return{value:e.slice(t,t+o),size:i+o}},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.copy(t,r),r+e.length},function(e,t,r){return o.call(this,e.length,t,r)+e.length},r(12).buffer],void:[function(){return{value:void 0,size:0}},function(e,t,r){return r},0,r(12).void],bitfield:[function(e,t,r){const a=t;let n=null,i=0;const o={};return o.value=r.reduce((r,{size:a,signed:o,name:l})=>{let c=a,f=0;for(;c>0;){if(0===i){if(e.length>i-r,i-=r,c-=r}return o&&f>=1<{const l=e[s];if(!o&&l<0||o&&l<-(1<=1<=(1<= "+o?1<0;){const e=Math.min(8-i,a);n=n<>a-e&u(e),a-=e,8===(i+=e)&&(t[r++]=n,i=0,n=0)}}),0!==i&&(t[r++]=n<<8-i);return r},function(e,t){return Math.ceil(t.reduce((e,{size:t})=>e+t,0)/8)},r(12).bitfield],cstring:[function(e,t){let r=0;for(;t+rthis.read(e,t,r.type,a),n)),i.size+=u,t+=u,i.value.push(o);return i},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.reduce((e,r,i)=>s(()=>this.write(r,t,e,a.type,n),i),r)},function(e,t,r){let a=o.call(this,e.length,t,r);return a=e.reduce((e,a,n)=>s(()=>e+this.sizeOf(a,t.type,r),n),a)},r(41).array],count:[function(e,t,{type:r},a){return this.read(e,t,r,a)},function(e,t,r,{countFor:n,type:i},o){return this.write(a(n,o).length,t,r,i,o)},function(e,{countFor:t,type:r},n){return this.sizeOf(a(t,n).length,r,n)},r(41).count],container:[function(e,t,r,a){const n={value:{"..":a},size:0};return r.forEach(({type:r,name:a,anon:i})=>{s(()=>{const o=this.read(e,t,r,n.value);n.size+=o.size,t+=o.size,i?void 0!==o.value&&Object.keys(o.value).forEach(e=>{n.value[e]=o.value[e]}):n.value[a]=o.value},a||"unknown")}),delete n.value[".."],n},function(e,t,r,a,n){return e[".."]=n,r=a.reduce((r,{type:a,name:n,anon:i})=>s(()=>this.write(i?e:e[n],t,r,a,e),n||"unknown"),r),delete e[".."],r},function(e,t,r){e[".."]=r;const a=t.reduce((t,{type:r,name:a,anon:n})=>t+s(()=>this.sizeOf(n?e:e[a],r,e),a||"unknown"),0);return delete e[".."],a},r(41).container]}},function(e,t,r){const{getField:a,getFieldInfo:n,tryDoc:i,PartialReadError:o}=r(15);e.exports={switch:[function(e,t,{compareTo:r,fields:o,compareToValue:s,default:l},u){if(r=void 0!==s?s:a(r,u),void 0===o[r]&&void 0===l)throw new Error(r+" has no associated fieldInfo in switch");const c=void 0===o[r],f=c?l:o[r],d=n(f);return i(()=>this.read(e,t,d,u),c?"default":r)},function(e,t,r,{compareTo:o,fields:s,compareToValue:l,default:u},c){if(o=void 0!==l?l:a(o,c),void 0===s[o]&&void 0===u)throw new Error(o+" has no associated fieldInfo in switch");const f=void 0===s[o],d=n(f?u:s[o]);return i(()=>this.write(e,t,r,d,c),f?"default":o)},function(e,{compareTo:t,fields:r,compareToValue:o,default:s},l){if(t=void 0!==o?o:a(t,l),void 0===r[t]&&void 0===s)throw new Error(t+" has no associated fieldInfo in switch");const u=void 0===r[t],c=n(u?s:r[t]);return i(()=>this.sizeOf(e,c,l),u?"default":t)},r(69).switch],option:[function(e,t,r,a){if(e.length0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,a,n=o.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=n,a=s,o.prototype.copy.call(t,r,a),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(i===n.length?a+=n:a+=n.slice(0,e),0==(e-=i)){i===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(i));break}++r}return this.length-=r,a}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,i=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,i),0==(e-=i)){i===n.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(i));break}++a}return this.length-=a,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&d.forEach(l),i||(d.forEach(l),f(c))}))}));return t.reduce(u)}},function(e,t){e.exports={compound:[function(e,t,r,a){const n={value:{},size:0};for(;;){const r=this.read(e,t,"i8",a);if(0===r.value){t+=r.size,n.size+=r.size;break}const i=this.read(e,t,"nbt",a);t+=i.size,n.size+=i.size,n.value[i.value.name]={type:i.value.type,value:i.value.value}}return n},function(e,t,r,a,n){const i=this;return Object.keys(e).map((function(a){r=i.write({name:a,type:e[a].type,value:e[a].value},t,r,"nbt",n)})),r=this.write(0,t,r,"i8",n)},function(e,t,r){const a=this;return 1+Object.keys(e).reduce((function(t,n){return t+a.sizeOf({name:n,type:e[n].type,value:e[n].value},"nbt",r)}),0)}]}},function(e){e.exports=JSON.parse('{"container":"native","i8":"native","switch":"native","compound":"native","i16":"native","i32":"native","i64":"native","f32":"native","f64":"native","pstring":"native","shortString":["pstring",{"countType":"i16"}],"byteArray":["array",{"countType":"i32","type":"i8"}],"list":["container",[{"name":"type","type":"nbtMapper"},{"name":"value","type":["array",{"countType":"i32","type":["nbtSwitch",{"type":"type"}]}]}]],"intArray":["array",{"countType":"i32","type":"i32"}],"longArray":["array",{"countType":"i32","type":"i64"}],"nbtMapper":["mapper",{"type":"i8","mappings":{"0":"end","1":"byte","2":"short","3":"int","4":"long","5":"float","6":"double","7":"byteArray","8":"string","9":"list","10":"compound","11":"intArray","12":"longArray"}}],"nbtSwitch":["switch",{"compareTo":"$type","fields":{"end":"void","byte":"i8","short":"i16","int":"i32","long":"i64","float":"f32","double":"f64","byteArray":"byteArray","string":"shortString","list":"list","compound":"compound","intArray":"intArray","longArray":"longArray"}}],"nbt":["container",[{"name":"type","type":"nbtMapper"},{"name":"name","type":"shortString"},{"name":"value","type":["nbtSwitch",{"type":"type"}]}]]}')},function(e,t){var r,a;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&a.rotl(e,8)|4278255360&a.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,a=0;r>>5]|=e[r]<<24-a%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],a=0,n=0;a>>6-2*n);return t}},e.exports=a},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ -e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict"},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return n}));var a=r(1);function n(e){console.debug("New Worker!"),e.addEventListener("message",t=>{let r=t.data;"parseModel"===r.func?Object(a.e)(r.model,r.modelOptions,[],r.assetRoot).then(t=>{e.postMessage({msg:"done",parsedModelList:t}),close()}):"loadAndMergeModel"===r.func?Object(a.b)(r.model,r.assetRoot).then(t=>{e.postMessage({msg:"done",mergedModel:t}),close()}):"loadTextures"===r.func?Object(a.c)(r.textures,r.assetRoot).then(t=>{e.postMessage({msg:"done",textures:t}),close()}):(console.warn("Unknown function '"+r.func+"' for ModelWorker"),console.warn(r),close())})}}]); \ No newline at end of file +e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict"},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return o}));var a=r(1),n=r(13);const i=n("minerender");function o(e){i("New Worker!"),e.addEventListener("message",t=>{let r=t.data;"parseModel"===r.func?Object(a.e)(r.model,r.modelOptions,[],r.assetRoot).then(t=>{e.postMessage({msg:"done",parsedModelList:t}),close()}):"loadAndMergeModel"===r.func?Object(a.b)(r.model,r.assetRoot).then(t=>{e.postMessage({msg:"done",mergedModel:t}),close()}):"loadTextures"===r.func?Object(a.c)(r.textures,r.assetRoot).then(t=>{e.postMessage({msg:"done",textures:t}),close()}):(console.warn("Unknown function '"+r.func+"' for ModelWorker"),console.warn(r),close())})}}]); \ No newline at end of file diff --git a/dist/gui.js b/dist/gui.js index efd9cd72..5c23e091 100644 --- a/dist/gui.js +++ b/dist/gui.js @@ -1,8 +1,8 @@ /*! - * MineRender 1.4.6 + * MineRender 1.4.7 * (c) 2018, Haylee Schäfer (inventivetalent) / MIT License * https://minerender.org - * Build #1612195849082 / Mon Feb 01 2021 17:10:49 GMT+0100 (GMT+01:00) + * Build #1612197069607 / Mon Feb 01 2021 17:31:09 GMT+0100 (GMT+01:00) */ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache @@ -317,6 +317,28 @@ eval("(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefg /***/ }), +/***/ "./node_modules/debug/src/browser.js": +/*!*******************************************!*\ + !*** ./node_modules/debug/src/browser.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(/*! ./debug */ \"./node_modules/debug/src/debug.js\");\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/process/browser.js */ \"./node_modules/node-libs-browser/node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/debug/src/browser.js?"); + +/***/ }), + +/***/ "./node_modules/debug/src/debug.js": +/*!*****************************************!*\ + !*** ./node_modules/debug/src/debug.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n\n//# sourceURL=webpack:///./node_modules/debug/src/debug.js?"); + +/***/ }), + /***/ "./node_modules/deepmerge/dist/cjs.js": /*!********************************************!*\ !*** ./node_modules/deepmerge/dist/cjs.js ***! @@ -442,6 +464,17 @@ eval("(function(){\r\n var crypt = __webpack_require__(/*! crypt */ \"./node_mo /***/ }), +/***/ "./node_modules/ms/index.js": +/*!**********************************!*\ + !*** ./node_modules/ms/index.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n\n//# sourceURL=webpack:///./node_modules/ms/index.js?"); + +/***/ }), + /***/ "./node_modules/node-libs-browser/node_modules/process/browser.js": /*!************************************************************************!*\ !*** ./node_modules/node-libs-browser/node_modules/process/browser.js ***! @@ -2037,7 +2070,7 @@ eval("function webpackBootstrapFunc (modules) {\n/******/ // The module cache\n /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_ROOT\", function() { return DEFAULT_ROOT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureAsBase64\", function() { return loadTextureAsBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadBlockState\", function() { return loadBlockState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureMeta\", function() { return loadTextureMeta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath\", function() { return loadJsonFromPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath_\", function() { return loadJsonFromPath_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleUv\", function() { return scaleUv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trimCanvas\", function() { return trimCanvas; });\n/**\r\n * Default asset root\r\n * @type {string}\r\n */\r\nconst DEFAULT_ROOT = \"https://assets.mcasset.cloud/1.13\";\r\n/**\r\n * Texture cache\r\n * @type {Object.}\r\n */\r\nconst textureCache = {};\r\n/**\r\n * Texture callbacks\r\n * @type {Object.}\r\n */\r\nconst textureCallbacks = {};\r\n\r\n/**\r\n * Model cache\r\n * @type {Object.}\r\n */\r\nconst modelCache = {};\r\n/**\r\n * Model callbacks\r\n * @type {Object.}\r\n */\r\nconst modelCallbacks = {};\r\n\r\n\r\n/**\r\n * Loads a Mincraft texture an returns it as Base64\r\n *\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} namespace Namespace, usually 'minecraft'\r\n * @param {string} dir Directory of the texture\r\n * @param {string} name Name of the texture\r\n * @returns {Promise}\r\n */\r\nfunction loadTextureAsBase64(root, namespace, dir, name) {\r\n return new Promise((resolve, reject) => {\r\n loadTexture(root, namespace, dir, name, resolve, reject);\r\n })\r\n};\r\n\r\n/**\r\n * Load a texture as base64 - shouldn't be used directly\r\n * @see loadTextureAsBase64\r\n * @ignore\r\n */\r\nfunction loadTexture(root, namespace, dir, name, resolve, reject, forceLoad) {\r\n let path = \"/assets/\" + namespace + \"/textures\" + dir + name + \".png\";\r\n\r\n if (textureCache.hasOwnProperty(path)) {\r\n if (textureCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(textureCache[path]);\r\n return;\r\n }\r\n\r\n if (!textureCallbacks.hasOwnProperty(path) || textureCallbacks[path].length === 0 || forceLoad) {\r\n // https://gist.github.com/oliyh/db3d1a582aefe6d8fee9 / https://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', root + path, true);\r\n xhr.responseType = 'arraybuffer';\r\n xhr.onloadend = function () {\r\n if (xhr.status === 200) {\r\n let arr = new Uint8Array(xhr.response || xhr.responseText);\r\n let raw = String.fromCharCode.apply(null, arr);\r\n let b64 = btoa(raw);\r\n let dataURL = \"data:image/png;base64,\" + b64;\r\n\r\n textureCache[path] = dataURL;\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[0](dataURL);\r\n }\r\n }\r\n } else {\r\n if (DEFAULT_ROOT === root) {\r\n textureCache[path] = \"__invalid\";\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n loadTexture(DEFAULT_ROOT, namespace, dir, name, resolve, reject, true)\r\n }\r\n }\r\n };\r\n xhr.send();\r\n\r\n // init array\r\n if (!textureCallbacks.hasOwnProperty(path))\r\n textureCallbacks[path] = [];\r\n }\r\n\r\n // add the promise callback\r\n textureCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n\r\n/**\r\n * Loads a blockstate file and returns the contained JSON\r\n * @param {string} state Name of the blockstate\r\n * @param {string} assetRoot Asset root, see {@link DEFAULT_ROOT}\r\n * @returns {Promise}\r\n */\r\nfunction loadBlockState(state, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/blockstates/\" + state + \".json\")\r\n};\r\n\r\nfunction loadTextureMeta(texture, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/textures/block/\" + texture + \".png.mcmeta\")\r\n}\r\n\r\n/**\r\n * Loads a model file and returns the contained JSON\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} path Path to the model file\r\n * @returns {Promise}\r\n */\r\nfunction loadJsonFromPath(root, path) {\r\n return new Promise((resolve, reject) => {\r\n loadJsonFromPath_(root, path, resolve, reject);\r\n })\r\n}\r\n\r\n/**\r\n * Load a model - shouldn't used directly\r\n * @see loadJsonFromPath\r\n * @ignore\r\n */\r\nfunction loadJsonFromPath_(root, path, resolve, reject, forceLoad) {\r\n if (modelCache.hasOwnProperty(path)) {\r\n if (modelCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(Object.assign({}, modelCache[path]));\r\n return;\r\n }\r\n\r\n if (!modelCallbacks.hasOwnProperty(path) || modelCallbacks[path].length === 0 || forceLoad) {\r\n console.log(root + path)\r\n fetch(root + path, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"json data:\", data);\r\n modelCache[path] = data;\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let dataCopy = Object.assign({}, data);\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[0](dataCopy);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n console.warn(err);\r\n if (DEFAULT_ROOT === root) {\r\n modelCache[path] = \"__invalid\";\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n // Try again with default root\r\n loadJsonFromPath_(DEFAULT_ROOT, path, resolve, reject, true);\r\n }\r\n });\r\n\r\n if (!modelCallbacks.hasOwnProperty(path))\r\n modelCallbacks[path] = [];\r\n }\r\n\r\n modelCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n/**\r\n * Scales UV values\r\n * @param {number} uv UV value\r\n * @param {number} size\r\n * @param {number} [scale=16]\r\n * @returns {number}\r\n */\r\nfunction scaleUv(uv, size, scale) {\r\n if (uv === 0) return 0;\r\n return size / (scale || 16) * uv;\r\n}\r\n\r\n\r\n// https://gist.github.com/remy/784508\r\nfunction trimCanvas(c) {\r\n let ctx = c.getContext('2d'),\r\n copy = document.createElement('canvas').getContext('2d'),\r\n pixels = ctx.getImageData(0, 0, c.width, c.height),\r\n l = pixels.data.length,\r\n i,\r\n bound = {\r\n top: null,\r\n left: null,\r\n right: null,\r\n bottom: null\r\n },\r\n x, y;\r\n\r\n for (i = 0; i < l; i += 4) {\r\n if (pixels.data[i + 3] !== 0) {\r\n x = (i / 4) % c.width;\r\n y = ~~((i / 4) / c.width);\r\n\r\n if (bound.top === null) {\r\n bound.top = y;\r\n }\r\n\r\n if (bound.left === null) {\r\n bound.left = x;\r\n } else if (x < bound.left) {\r\n bound.left = x;\r\n }\r\n\r\n if (bound.right === null) {\r\n bound.right = x;\r\n } else if (bound.right < x) {\r\n bound.right = x;\r\n }\r\n\r\n if (bound.bottom === null) {\r\n bound.bottom = y;\r\n } else if (bound.bottom < y) {\r\n bound.bottom = y;\r\n }\r\n }\r\n }\r\n\r\n let trimHeight = bound.bottom - bound.top,\r\n trimWidth = bound.right - bound.left,\r\n trimmed = ctx.getImageData(bound.left, bound.top, trimWidth, trimHeight);\r\n\r\n copy.canvas.width = trimWidth;\r\n copy.canvas.height = trimHeight;\r\n copy.putImageData(trimmed, 0, 0);\r\n\r\n // open new window with trimmed image:\r\n return copy.canvas;\r\n}\n\n//# sourceURL=webpack:///./src/functions.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_ROOT\", function() { return DEFAULT_ROOT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureAsBase64\", function() { return loadTextureAsBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadBlockState\", function() { return loadBlockState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureMeta\", function() { return loadTextureMeta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath\", function() { return loadJsonFromPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath_\", function() { return loadJsonFromPath_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleUv\", function() { return scaleUv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trimCanvas\", function() { return trimCanvas; });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_0__);\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__(\"minerender\");\r\n\r\n/**\r\n * Default asset root\r\n * @type {string}\r\n */\r\nconst DEFAULT_ROOT = \"https://assets.mcasset.cloud/1.13\";\r\n/**\r\n * Texture cache\r\n * @type {Object.}\r\n */\r\nconst textureCache = {};\r\n/**\r\n * Texture callbacks\r\n * @type {Object.}\r\n */\r\nconst textureCallbacks = {};\r\n\r\n/**\r\n * Model cache\r\n * @type {Object.}\r\n */\r\nconst modelCache = {};\r\n/**\r\n * Model callbacks\r\n * @type {Object.}\r\n */\r\nconst modelCallbacks = {};\r\n\r\n\r\n/**\r\n * Loads a Mincraft texture an returns it as Base64\r\n *\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} namespace Namespace, usually 'minecraft'\r\n * @param {string} dir Directory of the texture\r\n * @param {string} name Name of the texture\r\n * @returns {Promise}\r\n */\r\nfunction loadTextureAsBase64(root, namespace, dir, name) {\r\n return new Promise((resolve, reject) => {\r\n loadTexture(root, namespace, dir, name, resolve, reject);\r\n })\r\n};\r\n\r\n/**\r\n * Load a texture as base64 - shouldn't be used directly\r\n * @see loadTextureAsBase64\r\n * @ignore\r\n */\r\nfunction loadTexture(root, namespace, dir, name, resolve, reject, forceLoad) {\r\n let path = \"/assets/\" + namespace + \"/textures\" + dir + name + \".png\";\r\n\r\n if (textureCache.hasOwnProperty(path)) {\r\n if (textureCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(textureCache[path]);\r\n return;\r\n }\r\n\r\n if (!textureCallbacks.hasOwnProperty(path) || textureCallbacks[path].length === 0 || forceLoad) {\r\n // https://gist.github.com/oliyh/db3d1a582aefe6d8fee9 / https://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', root + path, true);\r\n xhr.responseType = 'arraybuffer';\r\n xhr.onloadend = function () {\r\n if (xhr.status === 200) {\r\n let arr = new Uint8Array(xhr.response || xhr.responseText);\r\n let raw = String.fromCharCode.apply(null, arr);\r\n let b64 = btoa(raw);\r\n let dataURL = \"data:image/png;base64,\" + b64;\r\n\r\n textureCache[path] = dataURL;\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[0](dataURL);\r\n }\r\n }\r\n } else {\r\n if (DEFAULT_ROOT === root) {\r\n textureCache[path] = \"__invalid\";\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n loadTexture(DEFAULT_ROOT, namespace, dir, name, resolve, reject, true)\r\n }\r\n }\r\n };\r\n xhr.send();\r\n\r\n // init array\r\n if (!textureCallbacks.hasOwnProperty(path))\r\n textureCallbacks[path] = [];\r\n }\r\n\r\n // add the promise callback\r\n textureCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n\r\n/**\r\n * Loads a blockstate file and returns the contained JSON\r\n * @param {string} state Name of the blockstate\r\n * @param {string} assetRoot Asset root, see {@link DEFAULT_ROOT}\r\n * @returns {Promise}\r\n */\r\nfunction loadBlockState(state, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/blockstates/\" + state + \".json\")\r\n};\r\n\r\nfunction loadTextureMeta(texture, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/textures/block/\" + texture + \".png.mcmeta\")\r\n}\r\n\r\n/**\r\n * Loads a model file and returns the contained JSON\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} path Path to the model file\r\n * @returns {Promise}\r\n */\r\nfunction loadJsonFromPath(root, path) {\r\n return new Promise((resolve, reject) => {\r\n loadJsonFromPath_(root, path, resolve, reject);\r\n })\r\n}\r\n\r\n/**\r\n * Load a model - shouldn't used directly\r\n * @see loadJsonFromPath\r\n * @ignore\r\n */\r\nfunction loadJsonFromPath_(root, path, resolve, reject, forceLoad) {\r\n if (modelCache.hasOwnProperty(path)) {\r\n if (modelCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(Object.assign({}, modelCache[path]));\r\n return;\r\n }\r\n\r\n if (!modelCallbacks.hasOwnProperty(path) || modelCallbacks[path].length === 0 || forceLoad) {\r\n debug(root + path)\r\n fetch(root + path, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n debug(\"json data:\", data);\r\n modelCache[path] = data;\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let dataCopy = Object.assign({}, data);\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[0](dataCopy);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n console.warn(err);\r\n if (DEFAULT_ROOT === root) {\r\n modelCache[path] = \"__invalid\";\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n // Try again with default root\r\n loadJsonFromPath_(DEFAULT_ROOT, path, resolve, reject, true);\r\n }\r\n });\r\n\r\n if (!modelCallbacks.hasOwnProperty(path))\r\n modelCallbacks[path] = [];\r\n }\r\n\r\n modelCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n/**\r\n * Scales UV values\r\n * @param {number} uv UV value\r\n * @param {number} size\r\n * @param {number} [scale=16]\r\n * @returns {number}\r\n */\r\nfunction scaleUv(uv, size, scale) {\r\n if (uv === 0) return 0;\r\n return size / (scale || 16) * uv;\r\n}\r\n\r\n\r\n// https://gist.github.com/remy/784508\r\nfunction trimCanvas(c) {\r\n let ctx = c.getContext('2d'),\r\n copy = document.createElement('canvas').getContext('2d'),\r\n pixels = ctx.getImageData(0, 0, c.width, c.height),\r\n l = pixels.data.length,\r\n i,\r\n bound = {\r\n top: null,\r\n left: null,\r\n right: null,\r\n bottom: null\r\n },\r\n x, y;\r\n\r\n for (i = 0; i < l; i += 4) {\r\n if (pixels.data[i + 3] !== 0) {\r\n x = (i / 4) % c.width;\r\n y = ~~((i / 4) / c.width);\r\n\r\n if (bound.top === null) {\r\n bound.top = y;\r\n }\r\n\r\n if (bound.left === null) {\r\n bound.left = x;\r\n } else if (x < bound.left) {\r\n bound.left = x;\r\n }\r\n\r\n if (bound.right === null) {\r\n bound.right = x;\r\n } else if (bound.right < x) {\r\n bound.right = x;\r\n }\r\n\r\n if (bound.bottom === null) {\r\n bound.bottom = y;\r\n } else if (bound.bottom < y) {\r\n bound.bottom = y;\r\n }\r\n }\r\n }\r\n\r\n let trimHeight = bound.bottom - bound.top,\r\n trimWidth = bound.right - bound.left,\r\n trimmed = ctx.getImageData(bound.left, bound.top, trimWidth, trimHeight);\r\n\r\n copy.canvas.width = trimWidth;\r\n copy.canvas.height = trimHeight;\r\n copy.putImageData(trimmed, 0, 0);\r\n\r\n // open new window with trimmed image:\r\n return copy.canvas;\r\n}\r\n\n\n//# sourceURL=webpack:///./src/functions.js?"); /***/ }), @@ -2097,7 +2130,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return worker; });\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n\r\n\r\nfunction worker(self) {\r\n console.debug(\"New Worker!\")\r\n self.addEventListener(\"message\", event => {\r\n let msg = event.data;\r\n\r\n if (msg.func === \"parseModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"parseModel\"])(msg.model, msg.modelOptions, [], msg.assetRoot).then((parsedModelList) => {\r\n self.postMessage({msg: \"done\",parsedModelList:parsedModelList})\r\n close();\r\n })\r\n } else if (msg.func === \"loadAndMergeModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadAndMergeModel\"])(msg.model, msg.assetRoot).then((mergedModel) => {\r\n self.postMessage({msg: \"done\",mergedModel:mergedModel});\r\n close();\r\n })\r\n } else if (msg.func === \"loadTextures\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextures\"])(msg.textures, msg.assetRoot).then((textures) => {\r\n self.postMessage({msg: \"done\",textures:textures});\r\n close();\r\n })\r\n } else {\r\n console.warn(\"Unknown function '\" + msg.func + \"' for ModelWorker\");\r\n console.warn(msg);\r\n close();\r\n }\r\n })\r\n};\r\n\n\n//# sourceURL=webpack:///./src/model/ModelWorker.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return worker; });\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_1__(\"minerender\");\r\n\r\nfunction worker(self) {\r\n debug(\"New Worker!\")\r\n self.addEventListener(\"message\", event => {\r\n let msg = event.data;\r\n\r\n if (msg.func === \"parseModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"parseModel\"])(msg.model, msg.modelOptions, [], msg.assetRoot).then((parsedModelList) => {\r\n self.postMessage({msg: \"done\",parsedModelList:parsedModelList})\r\n close();\r\n })\r\n } else if (msg.func === \"loadAndMergeModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadAndMergeModel\"])(msg.model, msg.assetRoot).then((mergedModel) => {\r\n self.postMessage({msg: \"done\",mergedModel:mergedModel});\r\n close();\r\n })\r\n } else if (msg.func === \"loadTextures\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextures\"])(msg.textures, msg.assetRoot).then((textures) => {\r\n self.postMessage({msg: \"done\",textures:textures});\r\n close();\r\n })\r\n } else {\r\n console.warn(\"Unknown function '\" + msg.func + \"' for ModelWorker\");\r\n console.warn(msg);\r\n close();\r\n }\r\n })\r\n};\r\n\n\n//# sourceURL=webpack:///./src/model/ModelWorker.js?"); /***/ }), @@ -2109,7 +2142,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _renderBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../renderBase */ \"./src/renderBase.js\");\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var _modelConverter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modelConverter */ \"./src/model/modelConverter.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! md5 */ \"./node_modules/md5/md5.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! webworkify-webpack */ \"./node_modules/webworkify-webpack/index.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _skin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../skin */ \"./src/skin/index.js\");\n/* harmony import */ var onscreen_lib_methods_off__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! onscreen/lib/methods/off */ \"./node_modules/onscreen/lib/methods/off.js\");\n\r\n\r\n__webpack_require__(/*! three-instanced-mesh */ \"./node_modules/three-instanced-mesh/index.js\")(three__WEBPACK_IMPORTED_MODULE_0__);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst ModelWorker = /*require.resolve*/(/*! ./ModelWorker.js */ \"./src/model/ModelWorker.js\");\r\n\r\n\r\nString.prototype.replaceAll = function (search, replacement) {\r\n let target = this;\r\n return target.replace(new RegExp(search, 'g'), replacement);\r\n};\r\n\r\nconst colors = [\r\n 0xFF0000,\r\n 0x00FFFF,\r\n 0x0000FF,\r\n 0x000080,\r\n 0xFF00FF,\r\n 0x800080,\r\n 0x808000,\r\n 0x00FF00,\r\n 0x008000,\r\n 0xFFFF00,\r\n 0x800000,\r\n 0x008080,\r\n];\r\n\r\nconst FACE_ORDER = [\"east\", \"west\", \"up\", \"down\", \"south\", \"north\"];\r\nconst TINTS = [\"lightgreen\"];\r\n\r\nconst mergedModelCache = {};\r\nconst loadedTextureCache = {};\r\nconst modelInstances = {};\r\n\r\nconst textureCache = {};\r\nconst canvasCache = {};\r\nconst materialCache = {};\r\nconst geometryCache = {};\r\nconst instanceCache = {};\r\n\r\nconst animatedTextures = [];\r\n\r\n/**\r\n * @see defaultOptions\r\n * @property {string} type alternative way to specify the model type (block/item)\r\n * @property {boolean} [centerCubes=false] center the cube's rotation point\r\n * @property {string} [assetRoot=DEFAULT_ROOT] root to get asset files from\r\n */\r\nlet defOptions = {\r\n camera: {\r\n type: \"perspective\",\r\n x: 35,\r\n y: 25,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n type: \"block\",\r\n centerCubes: false,\r\n assetRoot: _functions__WEBPACK_IMPORTED_MODULE_4__[\"DEFAULT_ROOT\"],\r\n useWebWorkers: false\r\n};\r\n\r\n/**\r\n * A renderer for Minecraft models, i.e. blocks & items\r\n */\r\nclass ModelRender extends _renderBase__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\r\n\r\n /**\r\n * @param {Object} [options] The options for this renderer, see {@link defaultOptions}\r\n * @param {string} [options.assetRoot=DEFAULT_ROOT] root to get asset files from\r\n *\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, element) {\r\n super(options, defOptions, element);\r\n\r\n this.renderType = \"ModelRender\";\r\n\r\n this.models = [];\r\n this.instancePositionMap = {};\r\n this.attached = false;\r\n }\r\n\r\n /**\r\n * Does the actual rendering\r\n * @param {(string[]|Object[])} models Array of models to render - Either strings in the format / or objects\r\n * @param {string} [models[].type=block] either 'block' or 'item'\r\n * @param {string} models[].model if 'type' is given, just the block/item name otherwise '/'\r\n * @param {number[]} [models[].offset] [x,y,z] array of the offset\r\n * @param {number[]} [models[].rotation] [x,y,z] array of the rotation\r\n * @param {string} [models[].blockstate] name of a blockstate to be used to determine the models (only for blocks)\r\n * @param {string} [models[].variant=normal] if 'blockstate' is given, the block variant to use\r\n * @param {function} [cb] Callback when rendering finished\r\n */\r\n render(models, cb) {\r\n let modelRender = this;\r\n\r\n if (!modelRender.attached && !modelRender._scene) {// Don't init scene if attached, since we already have an available scene\r\n super.initScene(function () {\r\n // Animate textures\r\n for (let i = 0; i < animatedTextures.length; i++) {\r\n animatedTextures[i]();\r\n }\r\n\r\n modelRender.element.dispatchEvent(new CustomEvent(\"modelRender\", {detail: {models: modelRender.models}}));\r\n });\r\n } else {\r\n console.log(\"[ModelRender] is attached - skipping scene init\");\r\n }\r\n\r\n let parsedModelList = [];\r\n\r\n parseModels(modelRender, models, parsedModelList)\r\n .then(() => loadAndMergeModels(modelRender, parsedModelList))\r\n .then(() => loadModelTextures(modelRender, parsedModelList))\r\n .then(() => doModelRender(modelRender, parsedModelList))\r\n .then((renderedModels) => {\r\n console.timeEnd(\"doModelRender\");\r\n console.debug(renderedModels)\r\n if (typeof cb === \"function\") cb();\r\n })\r\n\r\n }\r\n\r\n}\r\n\r\n\r\nfunction parseModels(modelRender, models, parsedModelList) {\r\n console.time(\"parseModels\");\r\n console.log(\"Parsing Models...\");\r\n let parsePromises = [];\r\n for (let i = 0; i < models.length; i++) {\r\n let model = models[i];\r\n\r\n // parsePromises.push(parseModel(model, model, parsedModelList, modelRender.options.assetRoot))\r\n parsePromises.push(new Promise(resolve => {\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n parsedModelList.push(...event.data.parsedModelList);\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"parseModel\",\r\n model: model,\r\n modelOptions: model,\r\n parsedModelList: parsedModelList,\r\n assetRoot: modelRender.options.assetRoot\r\n })\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"parseModel\"])(model, model, parsedModelList, modelRender.options.assetRoot).then(() => {\r\n resolve();\r\n })\r\n }\r\n }))\r\n\r\n }\r\n\r\n return Promise.all(parsePromises);\r\n}\r\n\r\n\r\nfunction loadAndMergeModels(modelRender, parsedModelList) {\r\n console.timeEnd(\"parseModels\");\r\n console.time(\"loadAndMergeModels\");\r\n\r\n let jsonPromises = [];\r\n\r\n console.log(\"Loading Model JSON data & merging...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i]);\r\n modelInstances[cacheKey] = (modelInstances[cacheKey] || 0) + 1;\r\n uniqueModels[cacheKey] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n console.debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n jsonPromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n console.debug(\"loadAndMerge \" + cacheKey);\r\n\r\n\r\n if (mergedModelCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n mergedModelCache[cacheKey] = event.data.mergedModel;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadAndMergeModel\",\r\n model: model,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadAndMergeModel\"])(model, modelRender.options.assetRoot).then((mergedModel) => {\r\n mergedModelCache[cacheKey] = mergedModel;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n return Promise.all(jsonPromises);\r\n}\r\n\r\nfunction loadModelTextures(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadAndMergeModels\");\r\n console.time(\"loadModelTextures\");\r\n\r\n let texturePromises = [];\r\n\r\n console.log(\"Loading Textures...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n uniqueModels[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i])] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n console.debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n texturePromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n console.debug(\"loadTexture \" + cacheKey);\r\n let mergedModel = mergedModelCache[cacheKey];\r\n\r\n if (loadedTextureCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel) {\r\n console.warn(\"Missing merged model\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel.textures) {\r\n console.warn(\"The model doesn't have any textures!\");\r\n console.warn(\"Please make sure you're using the proper file.\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n loadedTextureCache[cacheKey] = event.data.textures;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadTextures\",\r\n textures: mergedModel.textures,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadTextures\"])(mergedModel.textures, modelRender.options.assetRoot).then((textures) => {\r\n loadedTextureCache[cacheKey] = textures;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n\r\n return Promise.all(texturePromises);\r\n}\r\n\r\nfunction doModelRender(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadModelTextures\");\r\n console.time(\"doModelRender\");\r\n\r\n console.log(\"Rendering Models...\");\r\n\r\n let renderPromises = [];\r\n\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n renderPromises.push(new Promise(resolve => {\r\n let model = parsedModelList[i];\r\n\r\n let mergedModel = mergedModelCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n let textures = loadedTextureCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n\r\n let offset = model.offset || [0, 0, 0];\r\n let rotation = model.rotation || [0, 0, 0];\r\n let scale = model.scale || [1, 1, 1];\r\n\r\n if (model.options.hasOwnProperty(\"display\")) {\r\n if (mergedModel.hasOwnProperty(\"display\")) {\r\n if (mergedModel.display.hasOwnProperty(model.options.display)) {\r\n let displayData = mergedModel.display[model.options.display];\r\n\r\n if (displayData.hasOwnProperty(\"translation\")) {\r\n offset = [offset[0] + displayData.translation[0], offset[1] + displayData.translation[1], offset[2] + displayData.translation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"rotation\")) {\r\n rotation = [rotation[0] + displayData.rotation[0], rotation[1] + displayData.rotation[1], rotation[2] + displayData.rotation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"scale\")) {\r\n scale = [displayData.scale[0], displayData.scale[1], displayData.scale[2]];\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n\r\n renderModel(modelRender, mergedModel, textures, mergedModel.textures, model.type, model.name, model.variant, offset, rotation, scale).then((renderedModel) => {\r\n\r\n if (renderedModel.firstInstance) {\r\n let container = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\r\n container.add(renderedModel.mesh);\r\n\r\n modelRender.models.push(container);\r\n modelRender.addToScene(container);\r\n }\r\n\r\n resolve(renderedModel);\r\n })\r\n }))\r\n }\r\n\r\n return Promise.all(renderPromises);\r\n}\r\n\r\n\r\nlet renderModel = function (modelRender, model, textures, textureNames, type, name, variant, offset, rotation, scale) {\r\n return new Promise((resolve) => {\r\n if (model.hasOwnProperty(\"elements\")) {// block OR item with block parent\r\n let modelKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant});\r\n let instanceCount = modelInstances[modelKey];\r\n\r\n let applyModelTransforms = function (mesh, instanceIndex) {\r\n mesh.userData.modelType = type;\r\n mesh.userData.modelName = name;\r\n\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n let instanceInfo = {\r\n key: modelKey,\r\n index: instanceIndex,\r\n offset: offset,\r\n scale: scale,\r\n rotation: rotation\r\n };\r\n\r\n if (rotation) {\r\n mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new three__WEBPACK_IMPORTED_MODULE_0__[\"Euler\"](Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]))));\r\n }\r\n if (offset) {\r\n mesh.setPositionAt(instanceIndex, _v3o.set(offset[0], offset[1], offset[2]));\r\n modelRender.instancePositionMap[offset[0] + \"_\" + offset[1] + \"_\" + offset[2]] = instanceInfo;\r\n }\r\n if (scale) {\r\n mesh.setScaleAt(instanceIndex, _v3s.set(scale[0], scale[1], scale[2]));\r\n }\r\n\r\n mesh.needsUpdate();\r\n\r\n // mesh.position = _v3o;\r\n // Object.defineProperty(mesh.position,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(x, this.y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, this.y, z));\r\n // }\r\n // })\r\n //\r\n // mesh.rotation = new THREE.Euler(toRadians(rotation[0]), toRadians(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), toRadians(rotation[2]));\r\n // Object.defineProperty(mesh.rotation,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(x), toRadians(this.y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(this.y), toRadians(z))));\r\n // }\r\n // });\r\n //\r\n // mesh.scale = _v3s;\r\n\r\n resolve({\r\n mesh: mesh,\r\n firstInstance: instanceIndex === 0\r\n });\r\n };\r\n\r\n let finalizeCubeModel = function (geometry, materials) {\r\n geometry.translate(-8, -8, -8);\r\n\r\n\r\n let cachedInstance;\r\n\r\n if (!instanceCache.hasOwnProperty(modelKey)) {\r\n console.debug(\"Caching new model instance \" + modelKey + \" (with \" + instanceCount + \" instances)\");\r\n let newInstance = new three__WEBPACK_IMPORTED_MODULE_0__[\"InstancedMesh\"](\r\n geometry,\r\n materials,\r\n instanceCount,\r\n false,\r\n false,\r\n false);\r\n cachedInstance = {\r\n instance: newInstance,\r\n index: 0\r\n };\r\n instanceCache[modelKey] = cachedInstance;\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](1, 1, 1);\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n for (let i = 0; i < instanceCount; i++) {\r\n\r\n newInstance.setQuaternionAt(i, _q);\r\n newInstance.setPositionAt(i, _v3o);\r\n newInstance.setScaleAt(i, _v3s);\r\n\r\n }\r\n } else {\r\n console.debug(\"Using cached instance (\" + modelKey + \")\");\r\n cachedInstance = instanceCache[modelKey];\r\n\r\n }\r\n\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n };\r\n\r\n if (instanceCache.hasOwnProperty(modelKey)) {\r\n console.debug(\"Using cached model instance (\" + modelKey + \")\");\r\n let cachedInstance = instanceCache[modelKey];\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n return;\r\n }\r\n\r\n // Render the elements\r\n let promises = [];\r\n for (let i = 0; i < model.elements.length; i++) {\r\n let element = model.elements[i];\r\n\r\n // // From net.minecraft.client.renderer.block.model.BlockPart.java#47 - https://yeleha.co/2JcqSr4\r\n let fallbackFaces = {\r\n down: {\r\n uv: [element.from[0], 16 - element.to[2], element.to[0], 16 - element.from[2]],\r\n texture: \"#down\"\r\n },\r\n up: {\r\n uv: [element.from[0], element.from[2], element.to[0], element.to[2]],\r\n texture: \"#up\"\r\n },\r\n north: {\r\n uv: [16 - element.to[0], 16 - element.to[1], 16 - element.from[0], 16 - element.from[1]],\r\n texture: \"#north\"\r\n },\r\n south: {\r\n uv: [element.from[0], 16 - element.to[1], element.to[0], 16 - element.from[1]],\r\n texture: \"#south\"\r\n },\r\n west: {\r\n uv: [element.from[2], 16 - element.to[1], element.to[2], 16 - element.from[2]],\r\n texture: \"#west\"\r\n },\r\n east: {\r\n uv: [16 - element.to[2], 16 - element.to[1], 16 - element.from[2], 16 - element.from[1]],\r\n texture: \"#east\"\r\n }\r\n };\r\n\r\n promises.push(new Promise((resolve) => {\r\n let baseName = name.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" + (element.__comment ? element.__comment.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" : \"\");\r\n createCube(element.to[0] - element.from[0], element.to[1] - element.from[1], element.to[2] - element.from[2],\r\n baseName + Date.now(),\r\n element.faces, fallbackFaces, textures, textureNames, modelRender.options.assetRoot, baseName)\r\n .then((cube) => {\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation((element.to[0] - element.from[0]) / 2, (element.to[1] - element.from[1]) / 2, (element.to[2] - element.from[2]) / 2));\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(element.from[0], element.from[1], element.from[2]));\r\n\r\n if (element.rotation) {\r\n rotateAboutPoint(cube,\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.origin[0], element.rotation.origin[1], element.rotation.origin[2]),\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.axis === \"x\" ? 1 : 0, element.rotation.axis === \"y\" ? 1 : 0, element.rotation.axis === \"z\" ? 1 : 0),\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(element.rotation.angle));\r\n }\r\n\r\n resolve(cube);\r\n })\r\n }));\r\n\r\n\r\n }\r\n\r\n Promise.all(promises).then((cubes) => {\r\n let mergedCubes = Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"mergeCubeMeshes\"])(cubes, true);\r\n mergedCubes.sourceSize = cubes.length;\r\n finalizeCubeModel(mergedCubes.geometry, mergedCubes.materials, cubes.length);\r\n for (let i = 0; i < cubes.length; i++) {\r\n Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"deepDisposeMesh\"])(cubes[i], true);\r\n }\r\n })\r\n } else {// 2d item\r\n createPlane(name + \"_\" + Date.now(), textures).then((plane) => {\r\n if (offset) {\r\n plane.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(offset[0], offset[1], offset[2]))\r\n }\r\n if (rotation) {\r\n plane.rotation.set(Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]));\r\n }\r\n if (scale) {\r\n plane.scale.set(scale[0], scale[1], scale[2]);\r\n }\r\n\r\n resolve({\r\n mesh: plane,\r\n firstInstance: true\r\n });\r\n })\r\n }\r\n })\r\n};\r\n\r\nfunction setVisibilityOfInstance(meshKey, visibleScale, instanceIndex, visible) {\r\n let instance = instanceCache[meshKey];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n let newScale;\r\n if (visible) {\r\n if (visibleScale) {\r\n newScale = visibleScale;\r\n } else {\r\n newScale = [1, 1, 1];\r\n }\r\n } else {\r\n newScale = [0, 0, 0];\r\n }\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n mesh.setScaleAt(instanceIndex, _v3s.set(newScale[0], newScale[1], newScale[2]));\r\n return mesh;\r\n }\r\n}\r\n\r\nfunction setVisibilityAtMulti(positions, visible) {\r\n let updatedMeshes = {};\r\n for (let pos of positions) {\r\n let info = this.instancePositionMap[pos[0] + \"_\" + pos[1] + \"_\" + pos[2]];\r\n if (info) {\r\n let mesh = setVisibilityOfInstance(info.key, info.scale, info.index, visible);\r\n if (mesh) {\r\n updatedMeshes[info.key] = mesh;\r\n }\r\n }\r\n }\r\n for (let mesh of Object.values(updatedMeshes)) {\r\n mesh.needsUpdate();\r\n }\r\n}\r\n\r\nfunction setVisibilityAt(x, y, z, visible) {\r\n setVisibilityAtMulti([[x, y, z]], visible);\r\n}\r\n\r\nModelRender.prototype.setVisibilityAtMulti = setVisibilityAtMulti;\r\nModelRender.prototype.setVisibilityAt = setVisibilityAt;\r\n\r\nfunction setVisibilityOfType(type, name, variant, visible) {\r\n let instance = instanceCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant})];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n mesh.visible = visible;\r\n }\r\n}\r\n\r\nModelRender.prototype.setVisibilityOfType = setVisibilityOfType;\r\n\r\nlet createDot = function (c) {\r\n let dotGeometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"Geometry\"]();\r\n dotGeometry.vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]());\r\n let dotMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"PointsMaterial\"]({size: 5, sizeAttenuation: false, color: c});\r\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Points\"](dotGeometry, dotMaterial);\r\n};\r\n\r\nlet createPlane = function (name, textures) {\r\n return new Promise((resolve) => {\r\n\r\n let materialLoaded = function (material, width, height) {\r\n let geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"PlaneGeometry\"](width, height);\r\n let plane = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, material);\r\n plane.name = name;\r\n plane.receiveShadow = true;\r\n\r\n resolve(plane);\r\n };\r\n\r\n if (textures) {\r\n let w = 0, h = 0;\r\n let promises = [];\r\n for (let t in textures) {\r\n if (textures.hasOwnProperty(t)) {\r\n promises.push(new Promise((resolve) => {\r\n let img = new Image();\r\n img.onload = function () {\r\n if (img.width > w) w = img.width;\r\n if (img.height > h) h = img.height;\r\n resolve(img);\r\n };\r\n img.src = textures[t];\r\n }))\r\n }\r\n }\r\n Promise.all(promises).then((images) => {\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = w;\r\n canvas.height = h;\r\n let context = canvas.getContext(\"2d\");\r\n\r\n for (let i = 0; i < images.length; i++) {\r\n let img = images[i];\r\n context.drawImage(img, 0, 0);\r\n }\r\n\r\n let data = canvas.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \")\");\r\n materialLoaded(materialCache[hash], w, h);\r\n return;\r\n }\r\n\r\n let textureLoaded = function (texture) {\r\n let material = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: texture,\r\n transparent: true,\r\n side: three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"],\r\n alphaTest: 0.5,\r\n name: name\r\n });\r\n\r\n // Add material to cache\r\n console.debug(\"Caching Material \" + hash);\r\n materialCache[hash] = material;\r\n\r\n materialLoaded(material, w, h);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n console.debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n });\r\n }\r\n\r\n })\r\n};\r\n\r\n\r\n/// From https://github.com/InventivetalentDev/SkinRender/blob/master/js/render/skin.js#L353\r\nlet createCube = function (width, height, depth, name, faces, fallbackFaces, textures, textureNames, assetRoot, baseName) {\r\n return new Promise((resolve) => {\r\n let geometryKey = width + \"_\" + height + \"_\" + depth;\r\n let geometry;\r\n if (geometryCache.hasOwnProperty(geometryKey)) {\r\n console.debug(\"Using cached Geometry (\" + geometryKey + \")\");\r\n geometry = geometryCache[geometryKey];\r\n } else {\r\n geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BoxGeometry\"](width, height, depth);\r\n console.debug(\"Caching Geometry \" + geometryKey);\r\n geometryCache[geometryKey] = geometry;\r\n }\r\n\r\n let materialsLoaded = function (materials) {\r\n let cube = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, materials);\r\n cube.name = name;\r\n cube.receiveShadow = true;\r\n\r\n resolve(cube);\r\n };\r\n if (textures) {\r\n let promises = [];\r\n for (let i = 0; i < 6; i++) {\r\n promises.push(new Promise((resolve) => {\r\n let f = FACE_ORDER[i];\r\n if (!faces.hasOwnProperty(f)) {\r\n // console.warn(\"Missing face: \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n let face = faces[f];\r\n let textureRef = face.texture.substr(1);\r\n if (!textures.hasOwnProperty(textureRef) || !textures[textureRef]) {\r\n console.warn(\"Missing texture '\" + textureRef + \"' for face \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let canvasKey = textureRef + \"_\" + f + \"_\" + baseName;\r\n\r\n let processImgToCanvasData = (img) => {\r\n let uv = face.uv;\r\n if (!uv) {\r\n // console.warn(\"Missing UV mapping for face \" + f + \" in model \" + name + \". Using defaults\");\r\n uv = fallbackFaces[f].uv;\r\n }\r\n\r\n // Scale the uv values to match the image width, so we can support resource packs with higher-resolution textures\r\n uv = [\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[0], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[1], img.height),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[2], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[3], img.height)\r\n ];\r\n\r\n\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = Math.abs(uv[2] - uv[0]);\r\n canvas.height = Math.abs(uv[3] - uv[1]);\r\n\r\n let context = canvas.getContext(\"2d\");\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n let tintColor;\r\n if (face.hasOwnProperty(\"tintindex\")) {\r\n tintColor = TINTS[face.tintindex];\r\n } else if (baseName.startsWith(\"water_\")) {\r\n tintColor = \"blue\";\r\n }\r\n\r\n if (tintColor) {\r\n context.fillStyle = tintColor;\r\n context.globalCompositeOperation = 'multiply';\r\n context.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n context.globalAlpha = 1;\r\n context.globalCompositeOperation = 'destination-in';\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n // context.globalAlpha = 0.5;\r\n // context.beginPath();\r\n // context.fillStyle = \"green\";\r\n // context.rect(0, 0, uv[2] - uv[0], uv[3] - uv[1]);\r\n // context.fill();\r\n // context.globalAlpha = 1.0;\r\n }\r\n\r\n let canvasData = context.getImageData(0, 0, canvas.width, canvas.height).data;\r\n let hasTransparency = false;\r\n for (let i = 3; i < (canvas.width * canvas.height); i += 4) {\r\n if (canvasData[i] < 255) {\r\n hasTransparency = true;\r\n break;\r\n }\r\n }\r\n\r\n let dataUrl = canvas.toDataURL(\"image/png\");\r\n let dataHash = md5__WEBPACK_IMPORTED_MODULE_6__(dataUrl);\r\n\r\n let d = {\r\n canvas: canvas,\r\n data: canvasData,\r\n dataUrl: dataUrl,\r\n dataUrlHash: dataHash,\r\n hasTransparency: hasTransparency,\r\n width: canvas.width,\r\n height: canvas.height\r\n };\r\n console.debug(\"Caching new canvas (\" + canvasKey + \"/\" + dataHash + \")\")\r\n canvasCache[canvasKey] = d;\r\n return d;\r\n };\r\n\r\n let loadTextureFromCanvas = (canvas) => {\r\n\r\n\r\n let loadTextureDefault = function (canvas) {\r\n let data = canvas.dataUrl;\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \", without meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n let n = textureNames[textureRef];\r\n if (n.startsWith(\"#\")) {\r\n n = textureNames[name.substr(1)];\r\n }\r\n console.debug(\"Pre-Caching Material \" + hash + \", without meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5,\r\n name: f + \"_\" + textureRef + \"_\" + n\r\n });\r\n\r\n let textureLoaded = function (texture) {\r\n // Add material to cache\r\n console.debug(\"Finalizing Cached Material \" + hash + \", without meta\");\r\n materialCache[hash].map = texture;\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture from cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n if (face.hasOwnProperty(\"rotation\")) {\r\n texture.center.x = .5;\r\n texture.center.y = .5;\r\n texture.rotation = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(face.rotation);\r\n }\r\n\r\n console.debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n };\r\n\r\n let loadTextureWithMeta = function (canvas, meta) {\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \", with meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Material \" + hash + \", with meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5\r\n });\r\n\r\n let frametime = 1;\r\n if (meta.hasOwnProperty(\"animation\")) {\r\n if (meta.animation.hasOwnProperty(\"frametime\")) {\r\n frametime = meta.animation.frametime;\r\n }\r\n }\r\n\r\n let parts = Math.floor(canvas.height / canvas.width);\r\n\r\n console.log(\"Generating animated texture...\");\r\n\r\n let promises1 = [];\r\n for (let i = 0; i < parts; i++) {\r\n promises1.push(new Promise((resolve) => {\r\n let canvas1 = document.createElement(\"canvas\");\r\n canvas1.width = canvas.width;\r\n canvas1.height = canvas.width;\r\n let context1 = canvas1.getContext(\"2d\");\r\n context1.drawImage(canvas.canvas, 0, i * canvas.width, canvas.width, canvas.width, 0, 0, canvas.width, canvas.width);\r\n\r\n let data = canvas1.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n resolve(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n console.debug(\"Caching Texture \" + hash + \", without meta\");\r\n // add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n resolve(texture);\r\n });\r\n }));\r\n }\r\n\r\n Promise.all(promises1).then((textures) => {\r\n\r\n let frameCounter = 0;\r\n let textureIndex = 0;\r\n animatedTextures.push(() => {// called on render\r\n if (frameCounter >= frametime) {\r\n frameCounter = 0;\r\n\r\n // Set new texture\r\n materialCache[hash].map = textures[textureIndex];\r\n\r\n textureIndex++;\r\n }\r\n if (textureIndex >= textures.length) {\r\n textureIndex = 0;\r\n }\r\n frameCounter += 0.1;// game ticks TODO: figure out the proper value for this\r\n })\r\n\r\n // Add material to cache\r\n console.debug(\"Finalizing Cached Material \" + hash + \", with meta\");\r\n materialCache[hash].map = textures[0];\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n });\r\n };\r\n\r\n if ((canvas.height > canvas.width) && (canvas.height % canvas.width === 0)) {// Taking a guess that this is an animated texture\r\n let name = textureNames[textureRef];\r\n if (name.startsWith(\"#\")) {\r\n name = textureNames[name.substr(1)];\r\n }\r\n if (name.indexOf(\"/\") !== -1) {\r\n name = name.substr(name.indexOf(\"/\") + 1);\r\n }\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"loadTextureMeta\"])(name, assetRoot).then((meta) => {\r\n loadTextureWithMeta(canvas, meta);\r\n }).catch(() => {// Guessed wrong :shrug:\r\n loadTextureDefault(canvas);\r\n })\r\n } else {\r\n loadTextureDefault(canvas);\r\n }\r\n };\r\n\r\n\r\n if (canvasCache.hasOwnProperty(canvasKey)) {\r\n let cachedCanvas = canvasCache[canvasKey];\r\n\r\n if (cachedCanvas.hasOwnProperty(\"img\")) {\r\n console.debug(\"Waiting for canvas image that's already loading (\" + canvasKey + \")\")\r\n let img = cachedCanvas.img;\r\n img.waitingForCanvas.push(function (canvas) {\r\n loadTextureFromCanvas(canvas);\r\n });\r\n } else {\r\n console.debug(\"Using cached canvas (\" + canvasKey + \")\")\r\n loadTextureFromCanvas(canvasCache[canvasKey]);\r\n }\r\n } else {\r\n let img = new Image();\r\n img.onerror = function (err) {\r\n console.warn(err);\r\n resolve(null);\r\n };\r\n img.waitingForCanvas = [];\r\n img.onload = function () {\r\n let canvasData = processImgToCanvasData(img);\r\n loadTextureFromCanvas(canvasData);\r\n\r\n for (let c = 0; c < img.waitingForCanvas.length; c++) {\r\n img.waitingForCanvas[c](canvasData);\r\n }\r\n };\r\n console.debug(\"Pre-caching canvas (\" + canvasKey + \")\");\r\n canvasCache[canvasKey] = {\r\n img: img\r\n };\r\n img.src = textures[textureRef];\r\n }\r\n }));\r\n }\r\n Promise.all(promises).then(materials => materialsLoaded(materials))\r\n } else {\r\n let materials = [];\r\n for (let i = 0; i < 6; i++) {\r\n materials.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n color: colors[i + 2],\r\n wireframe: true\r\n }))\r\n }\r\n materialsLoaded(materials);\r\n }\r\n\r\n // if (textures) {\r\n // applyCubeTextureToGeometry(geometry, texture, uv, width, height, depth);\r\n // }\r\n\r\n\r\n })\r\n};\r\n\r\n/// https://stackoverflow.com/questions/42812861/three-js-pivot-point/42866733#42866733\r\n// obj - your object (THREE.Object3D or derived)\r\n// point - the point of rotation (THREE.Vector3)\r\n// axis - the axis of rotation (normalized THREE.Vector3)\r\n// theta - radian value of rotation\r\nfunction rotateAboutPoint(obj, point, axis, theta) {\r\n obj.position.sub(point); // remove the offset\r\n obj.position.applyAxisAngle(axis, theta); // rotate the POSITION\r\n obj.position.add(point); // re-add the offset\r\n\r\n obj.rotateOnAxis(axis, theta); // rotate the OBJECT\r\n}\r\n\r\nModelRender.cache = {\r\n loadedTextures: loadedTextureCache,\r\n mergedModels: mergedModelCache,\r\n instanceCount: modelInstances,\r\n\r\n texture: textureCache,\r\n canvas: canvasCache,\r\n material: materialCache,\r\n geometry: geometryCache,\r\n instances: instanceCache,\r\n\r\n animated: animatedTextures,\r\n\r\n\r\n resetInstances: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n },\r\n clearAll: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(loadedTextureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(mergedModelCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(textureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(canvasCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(materialCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(geometryCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n animatedTextures.splice(0, animatedTextures.length);\r\n }\r\n};\r\nModelRender.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n\r\nif (typeof window !== \"undefined\") {\r\n window.ModelRender = ModelRender;\r\n window.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n}\r\nif (typeof global !== \"undefined\")\r\n global.ModelRender = ModelRender;\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (ModelRender);\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./src/model/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _renderBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../renderBase */ \"./src/renderBase.js\");\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var _modelConverter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modelConverter */ \"./src/model/modelConverter.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! md5 */ \"./node_modules/md5/md5.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! webworkify-webpack */ \"./node_modules/webworkify-webpack/index.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _skin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../skin */ \"./src/skin/index.js\");\n/* harmony import */ var onscreen_lib_methods_off__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! onscreen/lib/methods/off */ \"./node_modules/onscreen/lib/methods/off.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_11__);\n\r\n\r\n__webpack_require__(/*! three-instanced-mesh */ \"./node_modules/three-instanced-mesh/index.js\")(three__WEBPACK_IMPORTED_MODULE_0__);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_11__(\"minerender\");\r\n\r\nconst ModelWorker = /*require.resolve*/(/*! ./ModelWorker.js */ \"./src/model/ModelWorker.js\");\r\n\r\n\r\nString.prototype.replaceAll = function (search, replacement) {\r\n let target = this;\r\n return target.replace(new RegExp(search, 'g'), replacement);\r\n};\r\n\r\nconst colors = [\r\n 0xFF0000,\r\n 0x00FFFF,\r\n 0x0000FF,\r\n 0x000080,\r\n 0xFF00FF,\r\n 0x800080,\r\n 0x808000,\r\n 0x00FF00,\r\n 0x008000,\r\n 0xFFFF00,\r\n 0x800000,\r\n 0x008080,\r\n];\r\n\r\nconst FACE_ORDER = [\"east\", \"west\", \"up\", \"down\", \"south\", \"north\"];\r\nconst TINTS = [\"lightgreen\"];\r\n\r\nconst mergedModelCache = {};\r\nconst loadedTextureCache = {};\r\nconst modelInstances = {};\r\n\r\nconst textureCache = {};\r\nconst canvasCache = {};\r\nconst materialCache = {};\r\nconst geometryCache = {};\r\nconst instanceCache = {};\r\n\r\nconst animatedTextures = [];\r\n\r\n/**\r\n * @see defaultOptions\r\n * @property {string} type alternative way to specify the model type (block/item)\r\n * @property {boolean} [centerCubes=false] center the cube's rotation point\r\n * @property {string} [assetRoot=DEFAULT_ROOT] root to get asset files from\r\n */\r\nlet defOptions = {\r\n camera: {\r\n type: \"perspective\",\r\n x: 35,\r\n y: 25,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n type: \"block\",\r\n centerCubes: false,\r\n assetRoot: _functions__WEBPACK_IMPORTED_MODULE_4__[\"DEFAULT_ROOT\"],\r\n useWebWorkers: false\r\n};\r\n\r\n/**\r\n * A renderer for Minecraft models, i.e. blocks & items\r\n */\r\nclass ModelRender extends _renderBase__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\r\n\r\n /**\r\n * @param {Object} [options] The options for this renderer, see {@link defaultOptions}\r\n * @param {string} [options.assetRoot=DEFAULT_ROOT] root to get asset files from\r\n *\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, element) {\r\n super(options, defOptions, element);\r\n\r\n this.renderType = \"ModelRender\";\r\n\r\n this.models = [];\r\n this.instancePositionMap = {};\r\n this.attached = false;\r\n }\r\n\r\n /**\r\n * Does the actual rendering\r\n * @param {(string[]|Object[])} models Array of models to render - Either strings in the format / or objects\r\n * @param {string} [models[].type=block] either 'block' or 'item'\r\n * @param {string} models[].model if 'type' is given, just the block/item name otherwise '/'\r\n * @param {number[]} [models[].offset] [x,y,z] array of the offset\r\n * @param {number[]} [models[].rotation] [x,y,z] array of the rotation\r\n * @param {string} [models[].blockstate] name of a blockstate to be used to determine the models (only for blocks)\r\n * @param {string} [models[].variant=normal] if 'blockstate' is given, the block variant to use\r\n * @param {function} [cb] Callback when rendering finished\r\n */\r\n render(models, cb) {\r\n let modelRender = this;\r\n\r\n if (!modelRender.attached && !modelRender._scene) {// Don't init scene if attached, since we already have an available scene\r\n super.initScene(function () {\r\n // Animate textures\r\n for (let i = 0; i < animatedTextures.length; i++) {\r\n animatedTextures[i]();\r\n }\r\n\r\n modelRender.element.dispatchEvent(new CustomEvent(\"modelRender\", {detail: {models: modelRender.models}}));\r\n });\r\n } else {\r\n console.log(\"[ModelRender] is attached - skipping scene init\");\r\n }\r\n\r\n let parsedModelList = [];\r\n\r\n parseModels(modelRender, models, parsedModelList)\r\n .then(() => loadAndMergeModels(modelRender, parsedModelList))\r\n .then(() => loadModelTextures(modelRender, parsedModelList))\r\n .then(() => doModelRender(modelRender, parsedModelList))\r\n .then((renderedModels) => {\r\n console.timeEnd(\"doModelRender\");\r\n debug(renderedModels)\r\n if (typeof cb === \"function\") cb();\r\n })\r\n\r\n }\r\n\r\n}\r\n\r\n\r\nfunction parseModels(modelRender, models, parsedModelList) {\r\n console.time(\"parseModels\");\r\n console.log(\"Parsing Models...\");\r\n let parsePromises = [];\r\n for (let i = 0; i < models.length; i++) {\r\n let model = models[i];\r\n\r\n // parsePromises.push(parseModel(model, model, parsedModelList, modelRender.options.assetRoot))\r\n parsePromises.push(new Promise(resolve => {\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n parsedModelList.push(...event.data.parsedModelList);\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"parseModel\",\r\n model: model,\r\n modelOptions: model,\r\n parsedModelList: parsedModelList,\r\n assetRoot: modelRender.options.assetRoot\r\n })\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"parseModel\"])(model, model, parsedModelList, modelRender.options.assetRoot).then(() => {\r\n resolve();\r\n })\r\n }\r\n }))\r\n\r\n }\r\n\r\n return Promise.all(parsePromises);\r\n}\r\n\r\n\r\nfunction loadAndMergeModels(modelRender, parsedModelList) {\r\n console.timeEnd(\"parseModels\");\r\n console.time(\"loadAndMergeModels\");\r\n\r\n let jsonPromises = [];\r\n\r\n console.log(\"Loading Model JSON data & merging...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i]);\r\n modelInstances[cacheKey] = (modelInstances[cacheKey] || 0) + 1;\r\n uniqueModels[cacheKey] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n jsonPromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n debug(\"loadAndMerge \" + cacheKey);\r\n\r\n\r\n if (mergedModelCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n mergedModelCache[cacheKey] = event.data.mergedModel;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadAndMergeModel\",\r\n model: model,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadAndMergeModel\"])(model, modelRender.options.assetRoot).then((mergedModel) => {\r\n mergedModelCache[cacheKey] = mergedModel;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n return Promise.all(jsonPromises);\r\n}\r\n\r\nfunction loadModelTextures(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadAndMergeModels\");\r\n console.time(\"loadModelTextures\");\r\n\r\n let texturePromises = [];\r\n\r\n console.log(\"Loading Textures...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n uniqueModels[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i])] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n texturePromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n debug(\"loadTexture \" + cacheKey);\r\n let mergedModel = mergedModelCache[cacheKey];\r\n\r\n if (loadedTextureCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel) {\r\n console.warn(\"Missing merged model\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel.textures) {\r\n console.warn(\"The model doesn't have any textures!\");\r\n console.warn(\"Please make sure you're using the proper file.\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n loadedTextureCache[cacheKey] = event.data.textures;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadTextures\",\r\n textures: mergedModel.textures,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadTextures\"])(mergedModel.textures, modelRender.options.assetRoot).then((textures) => {\r\n loadedTextureCache[cacheKey] = textures;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n\r\n return Promise.all(texturePromises);\r\n}\r\n\r\nfunction doModelRender(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadModelTextures\");\r\n console.time(\"doModelRender\");\r\n\r\n console.log(\"Rendering Models...\");\r\n\r\n let renderPromises = [];\r\n\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n renderPromises.push(new Promise(resolve => {\r\n let model = parsedModelList[i];\r\n\r\n let mergedModel = mergedModelCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n let textures = loadedTextureCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n\r\n let offset = model.offset || [0, 0, 0];\r\n let rotation = model.rotation || [0, 0, 0];\r\n let scale = model.scale || [1, 1, 1];\r\n\r\n if (model.options.hasOwnProperty(\"display\")) {\r\n if (mergedModel.hasOwnProperty(\"display\")) {\r\n if (mergedModel.display.hasOwnProperty(model.options.display)) {\r\n let displayData = mergedModel.display[model.options.display];\r\n\r\n if (displayData.hasOwnProperty(\"translation\")) {\r\n offset = [offset[0] + displayData.translation[0], offset[1] + displayData.translation[1], offset[2] + displayData.translation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"rotation\")) {\r\n rotation = [rotation[0] + displayData.rotation[0], rotation[1] + displayData.rotation[1], rotation[2] + displayData.rotation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"scale\")) {\r\n scale = [displayData.scale[0], displayData.scale[1], displayData.scale[2]];\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n\r\n renderModel(modelRender, mergedModel, textures, mergedModel.textures, model.type, model.name, model.variant, offset, rotation, scale).then((renderedModel) => {\r\n\r\n if (renderedModel.firstInstance) {\r\n let container = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\r\n container.add(renderedModel.mesh);\r\n\r\n modelRender.models.push(container);\r\n modelRender.addToScene(container);\r\n }\r\n\r\n resolve(renderedModel);\r\n })\r\n }))\r\n }\r\n\r\n return Promise.all(renderPromises);\r\n}\r\n\r\n\r\nlet renderModel = function (modelRender, model, textures, textureNames, type, name, variant, offset, rotation, scale) {\r\n return new Promise((resolve) => {\r\n if (model.hasOwnProperty(\"elements\")) {// block OR item with block parent\r\n let modelKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant});\r\n let instanceCount = modelInstances[modelKey];\r\n\r\n let applyModelTransforms = function (mesh, instanceIndex) {\r\n mesh.userData.modelType = type;\r\n mesh.userData.modelName = name;\r\n\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n let instanceInfo = {\r\n key: modelKey,\r\n index: instanceIndex,\r\n offset: offset,\r\n scale: scale,\r\n rotation: rotation\r\n };\r\n\r\n if (rotation) {\r\n mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new three__WEBPACK_IMPORTED_MODULE_0__[\"Euler\"](Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]))));\r\n }\r\n if (offset) {\r\n mesh.setPositionAt(instanceIndex, _v3o.set(offset[0], offset[1], offset[2]));\r\n modelRender.instancePositionMap[offset[0] + \"_\" + offset[1] + \"_\" + offset[2]] = instanceInfo;\r\n }\r\n if (scale) {\r\n mesh.setScaleAt(instanceIndex, _v3s.set(scale[0], scale[1], scale[2]));\r\n }\r\n\r\n mesh.needsUpdate();\r\n\r\n // mesh.position = _v3o;\r\n // Object.defineProperty(mesh.position,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(x, this.y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, this.y, z));\r\n // }\r\n // })\r\n //\r\n // mesh.rotation = new THREE.Euler(toRadians(rotation[0]), toRadians(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), toRadians(rotation[2]));\r\n // Object.defineProperty(mesh.rotation,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(x), toRadians(this.y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(this.y), toRadians(z))));\r\n // }\r\n // });\r\n //\r\n // mesh.scale = _v3s;\r\n\r\n resolve({\r\n mesh: mesh,\r\n firstInstance: instanceIndex === 0\r\n });\r\n };\r\n\r\n let finalizeCubeModel = function (geometry, materials) {\r\n geometry.translate(-8, -8, -8);\r\n\r\n\r\n let cachedInstance;\r\n\r\n if (!instanceCache.hasOwnProperty(modelKey)) {\r\n debug(\"Caching new model instance \" + modelKey + \" (with \" + instanceCount + \" instances)\");\r\n let newInstance = new three__WEBPACK_IMPORTED_MODULE_0__[\"InstancedMesh\"](\r\n geometry,\r\n materials,\r\n instanceCount,\r\n false,\r\n false,\r\n false);\r\n cachedInstance = {\r\n instance: newInstance,\r\n index: 0\r\n };\r\n instanceCache[modelKey] = cachedInstance;\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](1, 1, 1);\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n for (let i = 0; i < instanceCount; i++) {\r\n\r\n newInstance.setQuaternionAt(i, _q);\r\n newInstance.setPositionAt(i, _v3o);\r\n newInstance.setScaleAt(i, _v3s);\r\n\r\n }\r\n } else {\r\n debug(\"Using cached instance (\" + modelKey + \")\");\r\n cachedInstance = instanceCache[modelKey];\r\n\r\n }\r\n\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n };\r\n\r\n if (instanceCache.hasOwnProperty(modelKey)) {\r\n debug(\"Using cached model instance (\" + modelKey + \")\");\r\n let cachedInstance = instanceCache[modelKey];\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n return;\r\n }\r\n\r\n // Render the elements\r\n let promises = [];\r\n for (let i = 0; i < model.elements.length; i++) {\r\n let element = model.elements[i];\r\n\r\n // // From net.minecraft.client.renderer.block.model.BlockPart.java#47 - https://yeleha.co/2JcqSr4\r\n let fallbackFaces = {\r\n down: {\r\n uv: [element.from[0], 16 - element.to[2], element.to[0], 16 - element.from[2]],\r\n texture: \"#down\"\r\n },\r\n up: {\r\n uv: [element.from[0], element.from[2], element.to[0], element.to[2]],\r\n texture: \"#up\"\r\n },\r\n north: {\r\n uv: [16 - element.to[0], 16 - element.to[1], 16 - element.from[0], 16 - element.from[1]],\r\n texture: \"#north\"\r\n },\r\n south: {\r\n uv: [element.from[0], 16 - element.to[1], element.to[0], 16 - element.from[1]],\r\n texture: \"#south\"\r\n },\r\n west: {\r\n uv: [element.from[2], 16 - element.to[1], element.to[2], 16 - element.from[2]],\r\n texture: \"#west\"\r\n },\r\n east: {\r\n uv: [16 - element.to[2], 16 - element.to[1], 16 - element.from[2], 16 - element.from[1]],\r\n texture: \"#east\"\r\n }\r\n };\r\n\r\n promises.push(new Promise((resolve) => {\r\n let baseName = name.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" + (element.__comment ? element.__comment.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" : \"\");\r\n createCube(element.to[0] - element.from[0], element.to[1] - element.from[1], element.to[2] - element.from[2],\r\n baseName + Date.now(),\r\n element.faces, fallbackFaces, textures, textureNames, modelRender.options.assetRoot, baseName)\r\n .then((cube) => {\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation((element.to[0] - element.from[0]) / 2, (element.to[1] - element.from[1]) / 2, (element.to[2] - element.from[2]) / 2));\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(element.from[0], element.from[1], element.from[2]));\r\n\r\n if (element.rotation) {\r\n rotateAboutPoint(cube,\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.origin[0], element.rotation.origin[1], element.rotation.origin[2]),\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.axis === \"x\" ? 1 : 0, element.rotation.axis === \"y\" ? 1 : 0, element.rotation.axis === \"z\" ? 1 : 0),\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(element.rotation.angle));\r\n }\r\n\r\n resolve(cube);\r\n })\r\n }));\r\n\r\n\r\n }\r\n\r\n Promise.all(promises).then((cubes) => {\r\n let mergedCubes = Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"mergeCubeMeshes\"])(cubes, true);\r\n mergedCubes.sourceSize = cubes.length;\r\n finalizeCubeModel(mergedCubes.geometry, mergedCubes.materials, cubes.length);\r\n for (let i = 0; i < cubes.length; i++) {\r\n Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"deepDisposeMesh\"])(cubes[i], true);\r\n }\r\n })\r\n } else {// 2d item\r\n createPlane(name + \"_\" + Date.now(), textures).then((plane) => {\r\n if (offset) {\r\n plane.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(offset[0], offset[1], offset[2]))\r\n }\r\n if (rotation) {\r\n plane.rotation.set(Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]));\r\n }\r\n if (scale) {\r\n plane.scale.set(scale[0], scale[1], scale[2]);\r\n }\r\n\r\n resolve({\r\n mesh: plane,\r\n firstInstance: true\r\n });\r\n })\r\n }\r\n })\r\n};\r\n\r\nfunction setVisibilityOfInstance(meshKey, visibleScale, instanceIndex, visible) {\r\n let instance = instanceCache[meshKey];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n let newScale;\r\n if (visible) {\r\n if (visibleScale) {\r\n newScale = visibleScale;\r\n } else {\r\n newScale = [1, 1, 1];\r\n }\r\n } else {\r\n newScale = [0, 0, 0];\r\n }\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n mesh.setScaleAt(instanceIndex, _v3s.set(newScale[0], newScale[1], newScale[2]));\r\n return mesh;\r\n }\r\n}\r\n\r\nfunction setVisibilityAtMulti(positions, visible) {\r\n let updatedMeshes = {};\r\n for (let pos of positions) {\r\n let info = this.instancePositionMap[pos[0] + \"_\" + pos[1] + \"_\" + pos[2]];\r\n if (info) {\r\n let mesh = setVisibilityOfInstance(info.key, info.scale, info.index, visible);\r\n if (mesh) {\r\n updatedMeshes[info.key] = mesh;\r\n }\r\n }\r\n }\r\n for (let mesh of Object.values(updatedMeshes)) {\r\n mesh.needsUpdate();\r\n }\r\n}\r\n\r\nfunction setVisibilityAt(x, y, z, visible) {\r\n setVisibilityAtMulti([[x, y, z]], visible);\r\n}\r\n\r\nModelRender.prototype.setVisibilityAtMulti = setVisibilityAtMulti;\r\nModelRender.prototype.setVisibilityAt = setVisibilityAt;\r\n\r\nfunction setVisibilityOfType(type, name, variant, visible) {\r\n let instance = instanceCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant})];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n mesh.visible = visible;\r\n }\r\n}\r\n\r\nModelRender.prototype.setVisibilityOfType = setVisibilityOfType;\r\n\r\nlet createDot = function (c) {\r\n let dotGeometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"Geometry\"]();\r\n dotGeometry.vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]());\r\n let dotMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"PointsMaterial\"]({size: 5, sizeAttenuation: false, color: c});\r\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Points\"](dotGeometry, dotMaterial);\r\n};\r\n\r\nlet createPlane = function (name, textures) {\r\n return new Promise((resolve) => {\r\n\r\n let materialLoaded = function (material, width, height) {\r\n let geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"PlaneGeometry\"](width, height);\r\n let plane = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, material);\r\n plane.name = name;\r\n plane.receiveShadow = true;\r\n\r\n resolve(plane);\r\n };\r\n\r\n if (textures) {\r\n let w = 0, h = 0;\r\n let promises = [];\r\n for (let t in textures) {\r\n if (textures.hasOwnProperty(t)) {\r\n promises.push(new Promise((resolve) => {\r\n let img = new Image();\r\n img.onload = function () {\r\n if (img.width > w) w = img.width;\r\n if (img.height > h) h = img.height;\r\n resolve(img);\r\n };\r\n img.src = textures[t];\r\n }))\r\n }\r\n }\r\n Promise.all(promises).then((images) => {\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = w;\r\n canvas.height = h;\r\n let context = canvas.getContext(\"2d\");\r\n\r\n for (let i = 0; i < images.length; i++) {\r\n let img = images[i];\r\n context.drawImage(img, 0, 0);\r\n }\r\n\r\n let data = canvas.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \")\");\r\n materialLoaded(materialCache[hash], w, h);\r\n return;\r\n }\r\n\r\n let textureLoaded = function (texture) {\r\n let material = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: texture,\r\n transparent: true,\r\n side: three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"],\r\n alphaTest: 0.5,\r\n name: name\r\n });\r\n\r\n // Add material to cache\r\n debug(\"Caching Material \" + hash);\r\n materialCache[hash] = material;\r\n\r\n materialLoaded(material, w, h);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n });\r\n }\r\n\r\n })\r\n};\r\n\r\n\r\n/// From https://github.com/InventivetalentDev/SkinRender/blob/master/js/render/skin.js#L353\r\nlet createCube = function (width, height, depth, name, faces, fallbackFaces, textures, textureNames, assetRoot, baseName) {\r\n return new Promise((resolve) => {\r\n let geometryKey = width + \"_\" + height + \"_\" + depth;\r\n let geometry;\r\n if (geometryCache.hasOwnProperty(geometryKey)) {\r\n debug(\"Using cached Geometry (\" + geometryKey + \")\");\r\n geometry = geometryCache[geometryKey];\r\n } else {\r\n geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BoxGeometry\"](width, height, depth);\r\n debug(\"Caching Geometry \" + geometryKey);\r\n geometryCache[geometryKey] = geometry;\r\n }\r\n\r\n let materialsLoaded = function (materials) {\r\n let cube = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, materials);\r\n cube.name = name;\r\n cube.receiveShadow = true;\r\n\r\n resolve(cube);\r\n };\r\n if (textures) {\r\n let promises = [];\r\n for (let i = 0; i < 6; i++) {\r\n promises.push(new Promise((resolve) => {\r\n let f = FACE_ORDER[i];\r\n if (!faces.hasOwnProperty(f)) {\r\n // console.warn(\"Missing face: \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n let face = faces[f];\r\n let textureRef = face.texture.substr(1);\r\n if (!textures.hasOwnProperty(textureRef) || !textures[textureRef]) {\r\n console.warn(\"Missing texture '\" + textureRef + \"' for face \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let canvasKey = textureRef + \"_\" + f + \"_\" + baseName;\r\n\r\n let processImgToCanvasData = (img) => {\r\n let uv = face.uv;\r\n if (!uv) {\r\n // console.warn(\"Missing UV mapping for face \" + f + \" in model \" + name + \". Using defaults\");\r\n uv = fallbackFaces[f].uv;\r\n }\r\n\r\n // Scale the uv values to match the image width, so we can support resource packs with higher-resolution textures\r\n uv = [\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[0], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[1], img.height),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[2], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[3], img.height)\r\n ];\r\n\r\n\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = Math.abs(uv[2] - uv[0]);\r\n canvas.height = Math.abs(uv[3] - uv[1]);\r\n\r\n let context = canvas.getContext(\"2d\");\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n let tintColor;\r\n if (face.hasOwnProperty(\"tintindex\")) {\r\n tintColor = TINTS[face.tintindex];\r\n } else if (baseName.startsWith(\"water_\")) {\r\n tintColor = \"blue\";\r\n }\r\n\r\n if (tintColor) {\r\n context.fillStyle = tintColor;\r\n context.globalCompositeOperation = 'multiply';\r\n context.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n context.globalAlpha = 1;\r\n context.globalCompositeOperation = 'destination-in';\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n // context.globalAlpha = 0.5;\r\n // context.beginPath();\r\n // context.fillStyle = \"green\";\r\n // context.rect(0, 0, uv[2] - uv[0], uv[3] - uv[1]);\r\n // context.fill();\r\n // context.globalAlpha = 1.0;\r\n }\r\n\r\n let canvasData = context.getImageData(0, 0, canvas.width, canvas.height).data;\r\n let hasTransparency = false;\r\n for (let i = 3; i < (canvas.width * canvas.height); i += 4) {\r\n if (canvasData[i] < 255) {\r\n hasTransparency = true;\r\n break;\r\n }\r\n }\r\n\r\n let dataUrl = canvas.toDataURL(\"image/png\");\r\n let dataHash = md5__WEBPACK_IMPORTED_MODULE_6__(dataUrl);\r\n\r\n let d = {\r\n canvas: canvas,\r\n data: canvasData,\r\n dataUrl: dataUrl,\r\n dataUrlHash: dataHash,\r\n hasTransparency: hasTransparency,\r\n width: canvas.width,\r\n height: canvas.height\r\n };\r\n debug(\"Caching new canvas (\" + canvasKey + \"/\" + dataHash + \")\")\r\n canvasCache[canvasKey] = d;\r\n return d;\r\n };\r\n\r\n let loadTextureFromCanvas = (canvas) => {\r\n\r\n\r\n let loadTextureDefault = function (canvas) {\r\n let data = canvas.dataUrl;\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \", without meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n let n = textureNames[textureRef];\r\n if (n.startsWith(\"#\")) {\r\n n = textureNames[name.substr(1)];\r\n }\r\n debug(\"Pre-Caching Material \" + hash + \", without meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5,\r\n name: f + \"_\" + textureRef + \"_\" + n\r\n });\r\n\r\n let textureLoaded = function (texture) {\r\n // Add material to cache\r\n debug(\"Finalizing Cached Material \" + hash + \", without meta\");\r\n materialCache[hash].map = texture;\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture from cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n if (face.hasOwnProperty(\"rotation\")) {\r\n texture.center.x = .5;\r\n texture.center.y = .5;\r\n texture.rotation = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(face.rotation);\r\n }\r\n\r\n debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n };\r\n\r\n let loadTextureWithMeta = function (canvas, meta) {\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \", with meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Material \" + hash + \", with meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5\r\n });\r\n\r\n let frametime = 1;\r\n if (meta.hasOwnProperty(\"animation\")) {\r\n if (meta.animation.hasOwnProperty(\"frametime\")) {\r\n frametime = meta.animation.frametime;\r\n }\r\n }\r\n\r\n let parts = Math.floor(canvas.height / canvas.width);\r\n\r\n console.log(\"Generating animated texture...\");\r\n\r\n let promises1 = [];\r\n for (let i = 0; i < parts; i++) {\r\n promises1.push(new Promise((resolve) => {\r\n let canvas1 = document.createElement(\"canvas\");\r\n canvas1.width = canvas.width;\r\n canvas1.height = canvas.width;\r\n let context1 = canvas1.getContext(\"2d\");\r\n context1.drawImage(canvas.canvas, 0, i * canvas.width, canvas.width, canvas.width, 0, 0, canvas.width, canvas.width);\r\n\r\n let data = canvas1.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n resolve(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n debug(\"Caching Texture \" + hash + \", without meta\");\r\n // add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n resolve(texture);\r\n });\r\n }));\r\n }\r\n\r\n Promise.all(promises1).then((textures) => {\r\n\r\n let frameCounter = 0;\r\n let textureIndex = 0;\r\n animatedTextures.push(() => {// called on render\r\n if (frameCounter >= frametime) {\r\n frameCounter = 0;\r\n\r\n // Set new texture\r\n materialCache[hash].map = textures[textureIndex];\r\n\r\n textureIndex++;\r\n }\r\n if (textureIndex >= textures.length) {\r\n textureIndex = 0;\r\n }\r\n frameCounter += 0.1;// game ticks TODO: figure out the proper value for this\r\n })\r\n\r\n // Add material to cache\r\n debug(\"Finalizing Cached Material \" + hash + \", with meta\");\r\n materialCache[hash].map = textures[0];\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n });\r\n };\r\n\r\n if ((canvas.height > canvas.width) && (canvas.height % canvas.width === 0)) {// Taking a guess that this is an animated texture\r\n let name = textureNames[textureRef];\r\n if (name.startsWith(\"#\")) {\r\n name = textureNames[name.substr(1)];\r\n }\r\n if (name.indexOf(\"/\") !== -1) {\r\n name = name.substr(name.indexOf(\"/\") + 1);\r\n }\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"loadTextureMeta\"])(name, assetRoot).then((meta) => {\r\n loadTextureWithMeta(canvas, meta);\r\n }).catch(() => {// Guessed wrong :shrug:\r\n loadTextureDefault(canvas);\r\n })\r\n } else {\r\n loadTextureDefault(canvas);\r\n }\r\n };\r\n\r\n\r\n if (canvasCache.hasOwnProperty(canvasKey)) {\r\n let cachedCanvas = canvasCache[canvasKey];\r\n\r\n if (cachedCanvas.hasOwnProperty(\"img\")) {\r\n debug(\"Waiting for canvas image that's already loading (\" + canvasKey + \")\")\r\n let img = cachedCanvas.img;\r\n img.waitingForCanvas.push(function (canvas) {\r\n loadTextureFromCanvas(canvas);\r\n });\r\n } else {\r\n debug(\"Using cached canvas (\" + canvasKey + \")\")\r\n loadTextureFromCanvas(canvasCache[canvasKey]);\r\n }\r\n } else {\r\n let img = new Image();\r\n img.onerror = function (err) {\r\n console.warn(err);\r\n resolve(null);\r\n };\r\n img.waitingForCanvas = [];\r\n img.onload = function () {\r\n let canvasData = processImgToCanvasData(img);\r\n loadTextureFromCanvas(canvasData);\r\n\r\n for (let c = 0; c < img.waitingForCanvas.length; c++) {\r\n img.waitingForCanvas[c](canvasData);\r\n }\r\n };\r\n debug(\"Pre-caching canvas (\" + canvasKey + \")\");\r\n canvasCache[canvasKey] = {\r\n img: img\r\n };\r\n img.src = textures[textureRef];\r\n }\r\n }));\r\n }\r\n Promise.all(promises).then(materials => materialsLoaded(materials))\r\n } else {\r\n let materials = [];\r\n for (let i = 0; i < 6; i++) {\r\n materials.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n color: colors[i + 2],\r\n wireframe: true\r\n }))\r\n }\r\n materialsLoaded(materials);\r\n }\r\n\r\n // if (textures) {\r\n // applyCubeTextureToGeometry(geometry, texture, uv, width, height, depth);\r\n // }\r\n\r\n\r\n })\r\n};\r\n\r\n/// https://stackoverflow.com/questions/42812861/three-js-pivot-point/42866733#42866733\r\n// obj - your object (THREE.Object3D or derived)\r\n// point - the point of rotation (THREE.Vector3)\r\n// axis - the axis of rotation (normalized THREE.Vector3)\r\n// theta - radian value of rotation\r\nfunction rotateAboutPoint(obj, point, axis, theta) {\r\n obj.position.sub(point); // remove the offset\r\n obj.position.applyAxisAngle(axis, theta); // rotate the POSITION\r\n obj.position.add(point); // re-add the offset\r\n\r\n obj.rotateOnAxis(axis, theta); // rotate the OBJECT\r\n}\r\n\r\nModelRender.cache = {\r\n loadedTextures: loadedTextureCache,\r\n mergedModels: mergedModelCache,\r\n instanceCount: modelInstances,\r\n\r\n texture: textureCache,\r\n canvas: canvasCache,\r\n material: materialCache,\r\n geometry: geometryCache,\r\n instances: instanceCache,\r\n\r\n animated: animatedTextures,\r\n\r\n\r\n resetInstances: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n },\r\n clearAll: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(loadedTextureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(mergedModelCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(textureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(canvasCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(materialCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(geometryCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n animatedTextures.splice(0, animatedTextures.length);\r\n }\r\n};\r\nModelRender.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n\r\nif (typeof window !== \"undefined\") {\r\n window.ModelRender = ModelRender;\r\n window.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n}\r\nif (typeof global !== \"undefined\")\r\n global.ModelRender = ModelRender;\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (ModelRender);\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./src/model/index.js?"); /***/ }), @@ -2133,7 +2166,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var pako /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModel\", function() { return parseModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadAndMergeModel\", function() { return loadAndMergeModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modelCacheKey\", function() { return modelCacheKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findMatchingVariant\", function() { return findMatchingVariant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"variantStringToObject\", function() { return variantStringToObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModelType\", function() { return parseModelType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadModel\", function() { return loadModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextures\", function() { return loadTextures; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeParents\", function() { return mergeParents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadians\", function() { return toRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deleteObjectProperties\", function() { return deleteObjectProperties; });\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\n\r\nfunction parseModel(model, modelOptions, parsedModelList, assetRoot) {\r\n return new Promise(resolve => {\r\n let type = \"block\";\r\n let offset;\r\n let rotation;\r\n let scale;\r\n\r\n if (typeof model === \"string\") {\r\n let parsed = parseModelType(model);\r\n model = parsed.model;\r\n type = parsed.type;\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (typeof model === \"object\") {\r\n if (model.hasOwnProperty(\"offset\")) {\r\n offset = model[\"offset\"];\r\n }\r\n if (model.hasOwnProperty(\"rotation\")) {\r\n rotation = model[\"rotation\"];\r\n }\r\n if (model.hasOwnProperty(\"scale\")) {\r\n scale = model[\"scale\"];\r\n }\r\n\r\n if (model.hasOwnProperty(\"model\")) {\r\n if (model.hasOwnProperty(\"type\")) {\r\n type = model[\"type\"];\r\n model = model[\"model\"];\r\n } else {\r\n let parsed = parseModelType(model[\"model\"]);\r\n model = parsed.model;\r\n type = parsed.type;\r\n }\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (model.hasOwnProperty(\"blockstate\")) {\r\n type = \"block\";\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadBlockState\"])(model.blockstate, assetRoot).then((blockstate) => {\r\n if (blockstate.hasOwnProperty(\"variants\")) {\r\n\r\n if (model.hasOwnProperty(\"variant\")) {\r\n let variantKey = findMatchingVariant(blockstate.variants, model.variant);\r\n if (variantKey === null) {\r\n console.warn(\"Missing variant key for \" + model.blockstate + \": \" + model.variant);\r\n console.warn(blockstate.variants);\r\n resolve(null);\r\n return;\r\n }\r\n let variant = blockstate.variants[variantKey];\r\n if (!variant) {\r\n console.warn(\"Missing variant for \" + model.blockstate + \": \" + model.variant);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else {\r\n let variant;\r\n if (blockstate.variants.hasOwnProperty(\"normal\")) {\r\n variant = blockstate.variants.normal;\r\n } else if (blockstate.variants.hasOwnProperty(\"\")) {\r\n variant = blockstate.variants[\"\"];\r\n } else {\r\n variant = blockstate.variants[Object.keys(blockstate.variants)[0]]\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n resolve(parsedModelList);\r\n }\r\n } else if (blockstate.hasOwnProperty(\"multipart\")) {\r\n for (let j = 0; j < blockstate.multipart.length; j++) {\r\n let cond = blockstate.multipart[j];\r\n let apply = cond.apply;\r\n let when = cond.when;\r\n\r\n rotation = [0, 0, 0];\r\n\r\n if (!when) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n } else if (model.hasOwnProperty(\"multipart\")) {\r\n let multipartConditions = model.multipart;\r\n\r\n let applies = false;\r\n if (when.hasOwnProperty(\"OR\")) {\r\n for (let k = 0; k < when.OR.length; k++) {\r\n if (applies) break;\r\n for (let c in when.OR[k]) {\r\n if (applies) break;\r\n if (when.OR[k].hasOwnProperty(c)) {\r\n let expected = when.OR[k][c];\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n for (let c in when) {// this SHOULD be a single case, but iterating makes it a bit easier\r\n if (applies) break;\r\n if (when.hasOwnProperty(c)) {\r\n let expected = String(when[c]);\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (applies) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n }\r\n }\r\n }\r\n\r\n resolve(parsedModelList);\r\n }\r\n }).catch(()=>{\r\n resolve(parsedModelList);\r\n })\r\n }\r\n\r\n }\r\n })\r\n}\r\n\r\nfunction loadAndMergeModel(model, assetRoot) {\r\n return loadModel(model.name, model.type, assetRoot)\r\n .then(modelData => mergeParents(modelData, model.name, assetRoot))\r\n .then(merged => {\r\n console.debug(model.name + \" merged:\");\r\n console.debug(merged);\r\n if (!merged.hasOwnProperty(\"elements\")) {\r\n if (model.name === \"lava\" || model.name === \"water\") {\r\n merged.elements = [\r\n {\r\n \"from\": [0, 0, 0],\r\n \"to\": [16, 16, 16],\r\n \"faces\": {\r\n \"down\": {\"texture\": \"#particle\", \"cullface\": \"down\"},\r\n \"up\": {\"texture\": \"#particle\", \"cullface\": \"up\"},\r\n \"north\": {\"texture\": \"#particle\", \"cullface\": \"north\"},\r\n \"south\": {\"texture\": \"#particle\", \"cullface\": \"south\"},\r\n \"west\": {\"texture\": \"#particle\", \"cullface\": \"west\"},\r\n \"east\": {\"texture\": \"#particle\", \"cullface\": \"east\"}\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n return merged;\r\n })\r\n}\r\n\r\n\r\n\r\n// Utils\r\n\r\nfunction modelCacheKey(model) {\r\n return model.type + \"__\" + model.name /*+ \"[\" + (model.variant || \"default\") + \"]\"*/;\r\n}\r\n\r\nfunction findMatchingVariant(variants, selector) {\r\n if (!Array.isArray(variants)) variants = Object.keys(variants);\r\n\r\n if (!selector || selector === \"\" || selector.length === 0) return \"\";\r\n let selectorObj = variantStringToObject(selector);\r\n for (let i = 0; i < variants.length; i++) {\r\n let variantObj = variantStringToObject(variants[i]);\r\n\r\n let matches = true;\r\n for (let k in selectorObj) {\r\n if (selectorObj.hasOwnProperty(k)) {\r\n if (variantObj.hasOwnProperty(k)) {\r\n if (selectorObj[k] !== variantObj[k]) {\r\n matches = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (matches) return variants[i];\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction variantStringToObject(str) {\r\n let split = str.split(\",\");\r\n let obj = {};\r\n for (let i = 0; i < split.length; i++) {\r\n let spl = split[i];\r\n let split1 = spl.split(\"=\");\r\n obj[split1[0]] = split1[1];\r\n }\r\n return obj;\r\n}\r\n\r\nfunction parseModelType(string) {\r\n if (string.startsWith(\"block/\")) {\r\n // if (type === \"item\") {\r\n // throw new Error(\"Tried to mix block/item models\");\r\n // }\r\n return {\r\n type: \"block\",\r\n model: string.substr(\"block/\".length)\r\n }\r\n } else if (string.startsWith(\"item/\")) {\r\n // if (type === \"block\") {\r\n // throw new Error(\"Tried to mix item/block models\");\r\n // }\r\n return {\r\n type: \"item\",\r\n model: string.substr(\"item/\".length)\r\n }\r\n }\r\n return {\r\n type: \"block\",\r\n model: \"string\"\r\n }\r\n}\r\n\r\nfunction loadModel(model, type/* block OR item */, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n if (typeof model === \"string\") {\r\n if (model.startsWith(\"{\") && model.endsWith(\"}\")) {// JSON string\r\n resolve(JSON.parse(model));\r\n } else if (model.startsWith(\"http\")) {// URL\r\n fetch(model, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"model data:\", data);\r\n resolve(data);\r\n })\r\n } else {// model name -> use local data\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + (type || \"block\") + \"/\" + model + \".json\").then((data) => {\r\n resolve(data);\r\n })\r\n }\r\n } else if (typeof model === \"object\") {// JSON object\r\n resolve(model);\r\n } else {\r\n console.warn(\"Invalid model\");\r\n reject();\r\n }\r\n });\r\n};\r\n\r\nfunction loadTextures(textureNames, assetRoot) {\r\n return new Promise((resolve) => {\r\n let promises = [];\r\n let filteredNames = [];\r\n\r\n let names = Object.keys(textureNames);\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n let texture = textureNames[name];\r\n if (texture.startsWith(\"#\")) {// reference to another texture, no need to load\r\n continue;\r\n }\r\n filteredNames.push(name);\r\n promises.push(Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextureAsBase64\"])(assetRoot, \"minecraft\", \"/\", texture));\r\n }\r\n Promise.all(promises).then((textures) => {\r\n let mappedTextures = {};\r\n for (let i = 0; i < textures.length; i++) {\r\n mappedTextures[filteredNames[i]] = textures[i];\r\n }\r\n\r\n // Fill in the referenced textures\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n if (!mappedTextures.hasOwnProperty(name) && textureNames.hasOwnProperty(name)) {\r\n let ref = textureNames[name].substr(1);\r\n mappedTextures[name] = mappedTextures[ref];\r\n }\r\n }\r\n\r\n resolve(mappedTextures);\r\n });\r\n })\r\n};\r\n\r\n\r\nfunction mergeParents(model, modelName, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n mergeParents_(model, modelName, [], [], assetRoot, resolve, reject);\r\n });\r\n};\r\nlet mergeParents_ = function (model, name, stack, hierarchy, assetRoot, resolve, reject) {\r\n stack.push(model);\r\n\r\n if (!model.hasOwnProperty(\"parent\") || model[\"parent\"] === \"builtin/generated\" || model[\"parent\"] === \"builtin/entity\") {// already at the highest parent OR we reach the builtin parent which seems to be the hardcoded stuff that's not in the json files\r\n let merged = {};\r\n for (let i = stack.length - 1; i >= 0; i--) {\r\n merged = deepmerge__WEBPACK_IMPORTED_MODULE_1___default()(merged, stack[i]);\r\n }\r\n\r\n hierarchy.unshift(name);\r\n merged.hierarchy = hierarchy;\r\n resolve(merged);\r\n return;\r\n }\r\n\r\n let parent = model[\"parent\"];\r\n delete model[\"parent\"];// remove the child's parent so it will be replaced by the parent's parent\r\n hierarchy.push(parent);\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + parent + \".json\").then((parentData) => {\r\n let mergedModel = Object.assign({}, model, parentData);\r\n mergeParents_(mergedModel, name, stack, hierarchy, assetRoot, resolve, reject);\r\n }).catch(reject);\r\n\r\n};\r\n\r\nfunction toRadians(angle) {\r\n return angle * (Math.PI / 180);\r\n}\r\n\r\nfunction deleteObjectProperties(obj) {\r\n Object.keys(obj).forEach(function (key) {\r\n delete obj[key];\r\n });\r\n}\r\n\n\n//# sourceURL=webpack:///./src/model/modelFunctions.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModel\", function() { return parseModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadAndMergeModel\", function() { return loadAndMergeModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modelCacheKey\", function() { return modelCacheKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findMatchingVariant\", function() { return findMatchingVariant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"variantStringToObject\", function() { return variantStringToObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModelType\", function() { return parseModelType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadModel\", function() { return loadModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextures\", function() { return loadTextures; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeParents\", function() { return mergeParents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadians\", function() { return toRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deleteObjectProperties\", function() { return deleteObjectProperties; });\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_2__);\n\r\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_2__(\"minerender\");\r\n\r\nfunction parseModel(model, modelOptions, parsedModelList, assetRoot) {\r\n return new Promise(resolve => {\r\n let type = \"block\";\r\n let offset;\r\n let rotation;\r\n let scale;\r\n\r\n if (typeof model === \"string\") {\r\n let parsed = parseModelType(model);\r\n model = parsed.model;\r\n type = parsed.type;\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (typeof model === \"object\") {\r\n if (model.hasOwnProperty(\"offset\")) {\r\n offset = model[\"offset\"];\r\n }\r\n if (model.hasOwnProperty(\"rotation\")) {\r\n rotation = model[\"rotation\"];\r\n }\r\n if (model.hasOwnProperty(\"scale\")) {\r\n scale = model[\"scale\"];\r\n }\r\n\r\n if (model.hasOwnProperty(\"model\")) {\r\n if (model.hasOwnProperty(\"type\")) {\r\n type = model[\"type\"];\r\n model = model[\"model\"];\r\n } else {\r\n let parsed = parseModelType(model[\"model\"]);\r\n model = parsed.model;\r\n type = parsed.type;\r\n }\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (model.hasOwnProperty(\"blockstate\")) {\r\n type = \"block\";\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadBlockState\"])(model.blockstate, assetRoot).then((blockstate) => {\r\n if (blockstate.hasOwnProperty(\"variants\")) {\r\n\r\n if (model.hasOwnProperty(\"variant\")) {\r\n let variantKey = findMatchingVariant(blockstate.variants, model.variant);\r\n if (variantKey === null) {\r\n console.warn(\"Missing variant key for \" + model.blockstate + \": \" + model.variant);\r\n console.warn(blockstate.variants);\r\n resolve(null);\r\n return;\r\n }\r\n let variant = blockstate.variants[variantKey];\r\n if (!variant) {\r\n console.warn(\"Missing variant for \" + model.blockstate + \": \" + model.variant);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else {\r\n let variant;\r\n if (blockstate.variants.hasOwnProperty(\"normal\")) {\r\n variant = blockstate.variants.normal;\r\n } else if (blockstate.variants.hasOwnProperty(\"\")) {\r\n variant = blockstate.variants[\"\"];\r\n } else {\r\n variant = blockstate.variants[Object.keys(blockstate.variants)[0]]\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n resolve(parsedModelList);\r\n }\r\n } else if (blockstate.hasOwnProperty(\"multipart\")) {\r\n for (let j = 0; j < blockstate.multipart.length; j++) {\r\n let cond = blockstate.multipart[j];\r\n let apply = cond.apply;\r\n let when = cond.when;\r\n\r\n rotation = [0, 0, 0];\r\n\r\n if (!when) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n } else if (model.hasOwnProperty(\"multipart\")) {\r\n let multipartConditions = model.multipart;\r\n\r\n let applies = false;\r\n if (when.hasOwnProperty(\"OR\")) {\r\n for (let k = 0; k < when.OR.length; k++) {\r\n if (applies) break;\r\n for (let c in when.OR[k]) {\r\n if (applies) break;\r\n if (when.OR[k].hasOwnProperty(c)) {\r\n let expected = when.OR[k][c];\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n for (let c in when) {// this SHOULD be a single case, but iterating makes it a bit easier\r\n if (applies) break;\r\n if (when.hasOwnProperty(c)) {\r\n let expected = String(when[c]);\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (applies) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n }\r\n }\r\n }\r\n\r\n resolve(parsedModelList);\r\n }\r\n }).catch(()=>{\r\n resolve(parsedModelList);\r\n })\r\n }\r\n\r\n }\r\n })\r\n}\r\n\r\nfunction loadAndMergeModel(model, assetRoot) {\r\n return loadModel(model.name, model.type, assetRoot)\r\n .then(modelData => mergeParents(modelData, model.name, assetRoot))\r\n .then(merged => {\r\n debug(model.name + \" merged:\");\r\n debug(merged);\r\n if (!merged.hasOwnProperty(\"elements\")) {\r\n if (model.name === \"lava\" || model.name === \"water\") {\r\n merged.elements = [\r\n {\r\n \"from\": [0, 0, 0],\r\n \"to\": [16, 16, 16],\r\n \"faces\": {\r\n \"down\": {\"texture\": \"#particle\", \"cullface\": \"down\"},\r\n \"up\": {\"texture\": \"#particle\", \"cullface\": \"up\"},\r\n \"north\": {\"texture\": \"#particle\", \"cullface\": \"north\"},\r\n \"south\": {\"texture\": \"#particle\", \"cullface\": \"south\"},\r\n \"west\": {\"texture\": \"#particle\", \"cullface\": \"west\"},\r\n \"east\": {\"texture\": \"#particle\", \"cullface\": \"east\"}\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n return merged;\r\n })\r\n}\r\n\r\n\r\n\r\n// Utils\r\n\r\nfunction modelCacheKey(model) {\r\n return model.type + \"__\" + model.name /*+ \"[\" + (model.variant || \"default\") + \"]\"*/;\r\n}\r\n\r\nfunction findMatchingVariant(variants, selector) {\r\n if (!Array.isArray(variants)) variants = Object.keys(variants);\r\n\r\n if (!selector || selector === \"\" || selector.length === 0) return \"\";\r\n let selectorObj = variantStringToObject(selector);\r\n for (let i = 0; i < variants.length; i++) {\r\n let variantObj = variantStringToObject(variants[i]);\r\n\r\n let matches = true;\r\n for (let k in selectorObj) {\r\n if (selectorObj.hasOwnProperty(k)) {\r\n if (variantObj.hasOwnProperty(k)) {\r\n if (selectorObj[k] !== variantObj[k]) {\r\n matches = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (matches) return variants[i];\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction variantStringToObject(str) {\r\n let split = str.split(\",\");\r\n let obj = {};\r\n for (let i = 0; i < split.length; i++) {\r\n let spl = split[i];\r\n let split1 = spl.split(\"=\");\r\n obj[split1[0]] = split1[1];\r\n }\r\n return obj;\r\n}\r\n\r\nfunction parseModelType(string) {\r\n if (string.startsWith(\"block/\")) {\r\n // if (type === \"item\") {\r\n // throw new Error(\"Tried to mix block/item models\");\r\n // }\r\n return {\r\n type: \"block\",\r\n model: string.substr(\"block/\".length)\r\n }\r\n } else if (string.startsWith(\"item/\")) {\r\n // if (type === \"block\") {\r\n // throw new Error(\"Tried to mix item/block models\");\r\n // }\r\n return {\r\n type: \"item\",\r\n model: string.substr(\"item/\".length)\r\n }\r\n }\r\n return {\r\n type: \"block\",\r\n model: \"string\"\r\n }\r\n}\r\n\r\nfunction loadModel(model, type/* block OR item */, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n if (typeof model === \"string\") {\r\n if (model.startsWith(\"{\") && model.endsWith(\"}\")) {// JSON string\r\n resolve(JSON.parse(model));\r\n } else if (model.startsWith(\"http\")) {// URL\r\n fetch(model, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"model data:\", data);\r\n resolve(data);\r\n })\r\n } else {// model name -> use local data\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + (type || \"block\") + \"/\" + model + \".json\").then((data) => {\r\n resolve(data);\r\n })\r\n }\r\n } else if (typeof model === \"object\") {// JSON object\r\n resolve(model);\r\n } else {\r\n console.warn(\"Invalid model\");\r\n reject();\r\n }\r\n });\r\n};\r\n\r\nfunction loadTextures(textureNames, assetRoot) {\r\n return new Promise((resolve) => {\r\n let promises = [];\r\n let filteredNames = [];\r\n\r\n let names = Object.keys(textureNames);\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n let texture = textureNames[name];\r\n if (texture.startsWith(\"#\")) {// reference to another texture, no need to load\r\n continue;\r\n }\r\n filteredNames.push(name);\r\n promises.push(Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextureAsBase64\"])(assetRoot, \"minecraft\", \"/\", texture));\r\n }\r\n Promise.all(promises).then((textures) => {\r\n let mappedTextures = {};\r\n for (let i = 0; i < textures.length; i++) {\r\n mappedTextures[filteredNames[i]] = textures[i];\r\n }\r\n\r\n // Fill in the referenced textures\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n if (!mappedTextures.hasOwnProperty(name) && textureNames.hasOwnProperty(name)) {\r\n let ref = textureNames[name].substr(1);\r\n mappedTextures[name] = mappedTextures[ref];\r\n }\r\n }\r\n\r\n resolve(mappedTextures);\r\n });\r\n })\r\n};\r\n\r\n\r\nfunction mergeParents(model, modelName, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n mergeParents_(model, modelName, [], [], assetRoot, resolve, reject);\r\n });\r\n};\r\nlet mergeParents_ = function (model, name, stack, hierarchy, assetRoot, resolve, reject) {\r\n stack.push(model);\r\n\r\n if (!model.hasOwnProperty(\"parent\") || model[\"parent\"] === \"builtin/generated\" || model[\"parent\"] === \"builtin/entity\") {// already at the highest parent OR we reach the builtin parent which seems to be the hardcoded stuff that's not in the json files\r\n let merged = {};\r\n for (let i = stack.length - 1; i >= 0; i--) {\r\n merged = deepmerge__WEBPACK_IMPORTED_MODULE_1___default()(merged, stack[i]);\r\n }\r\n\r\n hierarchy.unshift(name);\r\n merged.hierarchy = hierarchy;\r\n resolve(merged);\r\n return;\r\n }\r\n\r\n let parent = model[\"parent\"];\r\n delete model[\"parent\"];// remove the child's parent so it will be replaced by the parent's parent\r\n hierarchy.push(parent);\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + parent + \".json\").then((parentData) => {\r\n let mergedModel = Object.assign({}, model, parentData);\r\n mergeParents_(mergedModel, name, stack, hierarchy, assetRoot, resolve, reject);\r\n }).catch(reject);\r\n\r\n};\r\n\r\nfunction toRadians(angle) {\r\n return angle * (Math.PI / 180);\r\n}\r\n\r\nfunction deleteObjectProperties(obj) {\r\n Object.keys(obj).forEach(function (key) {\r\n delete obj[key];\r\n });\r\n}\r\n\n\n//# sourceURL=webpack:///./src/model/modelFunctions.js?"); /***/ }), @@ -2145,7 +2178,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultOptions\", function() { return defaultOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepDisposeMesh\", function() { return deepDisposeMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeMeshes__\", function() { return mergeMeshes__; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeCubeMeshes\", function() { return mergeCubeMeshes; });\n/* harmony import */ var _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/OrbitControls */ \"./src/lib/OrbitControls.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! threejs-ext */ \"./node_modules/threejs-ext/dist/index.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(threejs_ext__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @johh/three-effectcomposer */ \"./node_modules/@johh/three-effectcomposer/dist/index.js\");\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! onscreen */ \"./node_modules/onscreen/dist/on-screen.umd.js\");\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(onscreen__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions */ \"./src/functions.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @property {boolean} showAxes Debugging - Show the scene's axes\r\n * @property {boolean} showOutlines Debugging - Show bounding boxes\r\n * @property {boolean} showGrid Debugging - Show coordinate grid\r\n *\r\n * @property {object} controls Controls settings\r\n * @property {boolean} [controls.enabled=true] Toggle controls\r\n * @property {boolean} [controls.zoom=true] Toggle zoom\r\n * @property {boolean} [controls.rotate=true] Toggle rotation\r\n * @property {boolean} [controls.pan=true] Toggle panning\r\n *\r\n * @property {object} camera Camera settings\r\n * @property {string} [camera.type=perspective] Camera type\r\n * @property {number} camera.x Camera X-position\r\n * @property {number} camera.y Camera Y-Position\r\n * @property {number} camera.z Camera Z-Position\r\n * @property {number[]} camera.target [x,y,z] array where the camera should look\r\n */\r\nconst defaultOptions = {\r\n showAxes: false,\r\n showGrid: false,\r\n autoResize: false,\r\n controls: {\r\n enabled: true,\r\n zoom: true,\r\n rotate: true,\r\n pan: true,\r\n keys: true\r\n },\r\n camera: {\r\n type: \"perspective\",\r\n x: 20,\r\n y: 35,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n canvas: {\r\n width: undefined,\r\n height: undefined\r\n },\r\n pauseHidden: true,\r\n forceContext: false,\r\n sendStats: true\r\n};\r\n\r\n/**\r\n * Base class for all Renders\r\n */\r\nclass Render {\r\n\r\n /**\r\n * @param {object} options The options for this renderer, see {@link defaultOptions}\r\n * @param {object} defOptions Additional default options, provided by the individual renders\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, defOptions, element) {\r\n /**\r\n * DOM Element to attach the renderer to\r\n * @type {HTMLElement}\r\n */\r\n this.element = element || document.body;\r\n /**\r\n * Combined options\r\n * @type {{} & defaultOptions & defOptions & options}\r\n */\r\n this.options = Object.assign({}, defaultOptions, defOptions, options);\r\n\r\n this.renderType = \"_Base_\";\r\n }\r\n\r\n /**\r\n * @param {boolean} [trim=false] whether to trim transparent pixels\r\n * @param {string} [mime=image/png] mime type of the image\r\n * @returns {string} The content of the renderer's canvas as a Base64 encoded image\r\n */\r\n toImage(trim, mime) {\r\n if (!mime) mime = \"image/png\";\r\n if (this._renderer) {\r\n if (!trim) {\r\n return this._renderer.domElement.toDataURL(mime);\r\n } else {\r\n // Clone the canvas onto a 2d context, so we can trim it properly\r\n let newCanvas = document.createElement('canvas');\r\n let context = newCanvas.getContext('2d');\r\n\r\n newCanvas.width = this._renderer.domElement.width;\r\n newCanvas.height = this._renderer.domElement.height;\r\n\r\n context.drawImage(this._renderer.domElement, 0, 0);\r\n\r\n let trimmed = Object(_functions__WEBPACK_IMPORTED_MODULE_6__[\"trimCanvas\"])(newCanvas);\r\n return trimmed.toDataURL(mime);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Export the current scene content in the .obj format (only geometries, no textures)\r\n * @returns {string} the .obj file content\r\n */\r\n toObj() {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"OBJExporter\"]();\r\n return exporter.parse(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Export the current scene content in the .gltf format (geometries + textures)\r\n * @returns {Promise} a promise which resolves with the .gltf file content\r\n */\r\n toGLTF(exportOptions) {\r\n return new Promise((resolve, reject) => {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"GLTFExporter\"]();\r\n exporter.parse(this._scene, (gltf) => {\r\n resolve(gltf);\r\n }, exportOptions)\r\n } else {\r\n reject();\r\n }\r\n })\r\n }\r\n\r\n toPLY(exportOptions) {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"PLYExporter\"]();\r\n return exporter.parse(this._scene, exportOptions);\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the scene\r\n * @param renderCb\r\n * @param doNotAnimate\r\n * @protected\r\n */\r\n initScene(renderCb, doNotAnimate) {\r\n let renderObj = this;\r\n\r\n console.log(\" \");\r\n console.log('%c ', 'font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;');\r\n console.log(\"MineRender/\" + (renderObj.renderType || renderObj.constructor.name) + \"/\" + \"1.4.6\");\r\n console.log(( false ? undefined : \"DEVELOPMENT\") + \" build\");\r\n console.log(\"Built @ \" + \"2021-02-01T16:10:49.094Z\");\r\n console.log(\" \");\r\n\r\n if (renderObj.options.sendStats) {\r\n // Send stats\r\n\r\n let iframe = false;\r\n try {\r\n iframe = window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n let hostname;\r\n try{\r\n hostname = new URL(iframe ? document.referrer : window.location).hostname;\r\n }catch (e) {\r\n console.warn(\"Failed to get hostname\");\r\n }\r\n\r\n jquery__WEBPACK_IMPORTED_MODULE_5__[\"post\"]({\r\n url: \"https://minerender.org/stats.php\",\r\n data: {\r\n action: \"init\",\r\n type: renderObj.renderType,\r\n host: hostname,\r\n source: (iframe ? \"iframe\" : \"javascript\")\r\n }\r\n });\r\n }\r\n\r\n // Scene INIT\r\n let scene = new three__WEBPACK_IMPORTED_MODULE_3__[\"Scene\"]();\r\n renderObj._scene = scene;\r\n let camera;\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"OrthographicCamera\"]((renderObj.options.canvas.width || window.innerWidth) / -2, (renderObj.options.canvas.width || window.innerWidth) / 2, (renderObj.options.canvas.height || window.innerHeight) / 2, (renderObj.options.canvas.height || window.innerHeight) / -2, 1, 1000);\r\n } else {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"PerspectiveCamera\"](75, (renderObj.options.canvas.width || window.innerWidth) / (renderObj.options.canvas.height || window.innerHeight), 5, 1000);\r\n }\r\n renderObj._camera = camera;\r\n\r\n if (renderObj.options.camera.zoom) {\r\n camera.zoom = renderObj.options.camera.zoom;\r\n }\r\n\r\n let renderer = new three__WEBPACK_IMPORTED_MODULE_3__[\"WebGLRenderer\"]({alpha: true, antialias: true, preserveDrawingBuffer: true});\r\n renderObj._renderer = renderer;\r\n renderer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderer.setClearColor(0x000000, 0);\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.shadowMap.enabled = true;\r\n renderer.shadowMap.type = three__WEBPACK_IMPORTED_MODULE_3__[\"PCFSoftShadowMap\"];\r\n renderObj.element.appendChild(renderObj._canvas = renderer.domElement);\r\n\r\n let composer = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default.a(renderer);\r\n composer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderObj._composer = composer;\r\n let ssaaRenderPass = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"SSAARenderPass\"](scene, camera);\r\n ssaaRenderPass.unbiased = true;\r\n composer.addPass(ssaaRenderPass);\r\n // let renderPass = new RenderPass(scene, camera);\r\n // renderPass.enabled = false;\r\n // composer.addPass(renderPass);\r\n let copyPass = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"ShaderPass\"](_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"CopyShader\"]);\r\n copyPass.renderToScreen = true;\r\n composer.addPass(copyPass);\r\n\r\n if (renderObj.options.autoResize) {\r\n renderObj._resizeListener = function () {\r\n let width = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetWidth : window.innerWidth;\r\n let height = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetHeight : window.innerHeight;\r\n\r\n renderObj._resize(width, height);\r\n };\r\n window.addEventListener(\"resize\", renderObj._resizeListener);\r\n }\r\n renderObj._resize = function (width, height) {\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera.left = width / -2;\r\n camera.right = width / 2;\r\n camera.top = height / 2;\r\n camera.bottom = height / -2;\r\n } else {\r\n camera.aspect = width / height;\r\n }\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(width, height);\r\n composer.setSize(width, height);\r\n };\r\n\r\n // Helpers\r\n if (renderObj.options.showAxes) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"AxesHelper\"](50));\r\n }\r\n if (renderObj.options.showGrid) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"GridHelper\"](100, 100));\r\n }\r\n\r\n let light = new three__WEBPACK_IMPORTED_MODULE_3__[\"AmbientLight\"](0xFFFFFF); // soft white light\r\n scene.add(light);\r\n\r\n // Init controls\r\n let controls = new _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__[\"default\"](camera, renderer.domElement);\r\n renderObj._controls = controls;\r\n controls.enableZoom = renderObj.options.controls.zoom;\r\n controls.enableRotate = renderObj.options.controls.rotate;\r\n controls.enablePan = renderObj.options.controls.pan;\r\n controls.enableKeys = renderObj.options.controls.keys;\r\n controls.target.set(renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]);\r\n\r\n // Set camera location & target\r\n camera.position.x = renderObj.options.camera.x;\r\n camera.position.y = renderObj.options.camera.y;\r\n camera.position.z = renderObj.options.camera.z;\r\n camera.lookAt(new three__WEBPACK_IMPORTED_MODULE_3__[\"Vector3\"](renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]));\r\n\r\n // Do the render!\r\n let animate = function () {\r\n renderObj._animId = requestAnimationFrame(animate);\r\n\r\n if (renderObj.onScreen) {\r\n if (typeof renderCb === \"function\") renderCb();\r\n\r\n composer.render();\r\n }\r\n };\r\n renderObj._animate = animate;\r\n\r\n if (!doNotAnimate) {\r\n animate();\r\n }\r\n\r\n renderObj.onScreen = true;// default to true, in case the checking is disabled\r\n let id = \"minerender-canvas-\" + renderObj._scene.uuid + \"-\" + Date.now();\r\n renderObj._canvas.id = id;\r\n if (renderObj.options.pauseHidden) {\r\n renderObj.onScreen = false;// set to false if the check is enabled\r\n let os = new onscreen__WEBPACK_IMPORTED_MODULE_4___default.a();\r\n renderObj._onScreenObserver = os;\r\n\r\n os.on(\"enter\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = true;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextRestore();\r\n }\r\n })\r\n os.on(\"leave\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = false;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextLoss();\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Adds an object to the scene & sets userData.renderType to this renderer's type\r\n * @param toAdd object to add\r\n */\r\n addToScene(toAdd) {\r\n let renderObj = this;\r\n if (renderObj._scene && toAdd) {\r\n toAdd.userData.renderType = renderObj.renderType;\r\n renderObj._scene.add(toAdd);\r\n }\r\n }\r\n\r\n /**\r\n * Clears the scene\r\n * @param onlySelfType whether to remove only objects whose type is equal to this renderer's type (useful for combined render)\r\n * @param filterFn Filter function to check which children of the scene to remove\r\n */\r\n clearScene(onlySelfType, filterFn) {\r\n if (onlySelfType || filterFn) {\r\n for (let i = this._scene.children.length - 1; i >= 0; i--) {\r\n let child = this._scene.children[i];\r\n if (filterFn) {\r\n let shouldKeep = filterFn(child);\r\n if (shouldKeep) {\r\n continue;\r\n }\r\n }\r\n if (onlySelfType) {\r\n if (child.userData.renderType !== this.renderType) {\r\n continue;\r\n }\r\n }\r\n deepDisposeMesh(child, true);\r\n this._scene.remove(child);\r\n }\r\n } else {\r\n while (this._scene.children.length > 0) {\r\n this._scene.remove(this._scene.children[0]);\r\n }\r\n }\r\n };\r\n\r\n dispose() {\r\n cancelAnimationFrame(this._animId);\r\n if (this._onScreenObserver) {\r\n this._onScreenObserver.destroy();\r\n }\r\n\r\n this.clearScene();\r\n\r\n this._canvas.remove();\r\n let el = this.element;\r\n while (el.firstChild) {\r\n el.removeChild(el.firstChild);\r\n }\r\n\r\n if (this.options.autoResize) {\r\n window.removeEventListener(\"resize\", this._resizeListener);\r\n }\r\n };\r\n\r\n}\r\n\r\n// https://stackoverflow.com/questions/27217388/use-multiple-materials-for-merged-geometries-in-three-js/44485364#44485364\r\nfunction deepDisposeMesh(obj, removeChildren) {\r\n if (!obj) return;\r\n if (obj.geometry && obj.geometry.dispose) obj.geometry.dispose();\r\n if (obj.material && obj.material.dispose) obj.material.dispose();\r\n if (obj.texture && obj.texture.dispose) obj.texture.dispose();\r\n if (obj.children) {\r\n let children = obj.children;\r\n for (let i = 0; i < children.length; i++) {\r\n deepDisposeMesh(children[i], removeChildren);\r\n }\r\n\r\n if (removeChildren) {\r\n for (let i = obj.children.length - 1; i >= 0; i--) {\r\n obj.remove(children[i]);\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction mergeMeshes__(meshes, toBufferGeometry) {\r\n let finalGeometry,\r\n materials = [],\r\n mergedGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"](),\r\n mergedMesh;\r\n\r\n meshes.forEach(function (mesh, index) {\r\n mesh.updateMatrix();\r\n mesh.geometry.faces.forEach(function (face) {\r\n face.materialIndex = 0;\r\n });\r\n mergedGeometry.merge(mesh.geometry, mesh.matrix, index);\r\n materials.push(mesh.material);\r\n });\r\n\r\n mergedGeometry.groupsNeedUpdate = true;\r\n\r\n if (toBufferGeometry) {\r\n finalGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedGeometry);\r\n } else {\r\n finalGeometry = mergedGeometry;\r\n }\r\n\r\n mergedMesh = new three__WEBPACK_IMPORTED_MODULE_3__[\"Mesh\"](finalGeometry, materials);\r\n mergedMesh.geometry.computeFaceNormals();\r\n mergedMesh.geometry.computeVertexNormals();\r\n\r\n return mergedMesh;\r\n\r\n}\r\n\r\nfunction mergeCubeMeshes(cubes, toBuffer) {\r\n cubes = cubes.filter(c => !!c);\r\n\r\n let mergedCubes = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"]();\r\n let mergedMaterials = [];\r\n for (let i = 0; i < cubes.length; i++) {\r\n let offset = i * Math.max(cubes[i].material.length, 1);\r\n mergedCubes.merge(cubes[i].geometry, cubes[i].matrix, offset);\r\n for (let j = 0; j < cubes[i].material.length; j++) {\r\n mergedMaterials.push(cubes[i].material[j]);\r\n }\r\n // for (let j = 0; j < cubes[i].geometry.faces.length; j++) {\r\n // cubes[i].geometry.faces[j].materialIndex=offset-1+j;\r\n // }\r\n\r\n deepDisposeMesh(cubes[i], true);\r\n }\r\n mergedCubes.mergeVertices();\r\n return {\r\n geometry: toBuffer ? new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedCubes) : mergedCubes,\r\n materials: mergedMaterials\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./src/renderBase.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultOptions\", function() { return defaultOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepDisposeMesh\", function() { return deepDisposeMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeMeshes__\", function() { return mergeMeshes__; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeCubeMeshes\", function() { return mergeCubeMeshes; });\n/* harmony import */ var _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/OrbitControls */ \"./src/lib/OrbitControls.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! threejs-ext */ \"./node_modules/threejs-ext/dist/index.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(threejs_ext__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @johh/three-effectcomposer */ \"./node_modules/@johh/three-effectcomposer/dist/index.js\");\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! onscreen */ \"./node_modules/onscreen/dist/on-screen.umd.js\");\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(onscreen__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions */ \"./src/functions.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @property {boolean} showAxes Debugging - Show the scene's axes\r\n * @property {boolean} showOutlines Debugging - Show bounding boxes\r\n * @property {boolean} showGrid Debugging - Show coordinate grid\r\n *\r\n * @property {object} controls Controls settings\r\n * @property {boolean} [controls.enabled=true] Toggle controls\r\n * @property {boolean} [controls.zoom=true] Toggle zoom\r\n * @property {boolean} [controls.rotate=true] Toggle rotation\r\n * @property {boolean} [controls.pan=true] Toggle panning\r\n *\r\n * @property {object} camera Camera settings\r\n * @property {string} [camera.type=perspective] Camera type\r\n * @property {number} camera.x Camera X-position\r\n * @property {number} camera.y Camera Y-Position\r\n * @property {number} camera.z Camera Z-Position\r\n * @property {number[]} camera.target [x,y,z] array where the camera should look\r\n */\r\nconst defaultOptions = {\r\n showAxes: false,\r\n showGrid: false,\r\n autoResize: false,\r\n controls: {\r\n enabled: true,\r\n zoom: true,\r\n rotate: true,\r\n pan: true,\r\n keys: true\r\n },\r\n camera: {\r\n type: \"perspective\",\r\n x: 20,\r\n y: 35,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n canvas: {\r\n width: undefined,\r\n height: undefined\r\n },\r\n pauseHidden: true,\r\n forceContext: false,\r\n sendStats: true\r\n};\r\n\r\n/**\r\n * Base class for all Renders\r\n */\r\nclass Render {\r\n\r\n /**\r\n * @param {object} options The options for this renderer, see {@link defaultOptions}\r\n * @param {object} defOptions Additional default options, provided by the individual renders\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, defOptions, element) {\r\n /**\r\n * DOM Element to attach the renderer to\r\n * @type {HTMLElement}\r\n */\r\n this.element = element || document.body;\r\n /**\r\n * Combined options\r\n * @type {{} & defaultOptions & defOptions & options}\r\n */\r\n this.options = Object.assign({}, defaultOptions, defOptions, options);\r\n\r\n this.renderType = \"_Base_\";\r\n }\r\n\r\n /**\r\n * @param {boolean} [trim=false] whether to trim transparent pixels\r\n * @param {string} [mime=image/png] mime type of the image\r\n * @returns {string} The content of the renderer's canvas as a Base64 encoded image\r\n */\r\n toImage(trim, mime) {\r\n if (!mime) mime = \"image/png\";\r\n if (this._renderer) {\r\n if (!trim) {\r\n return this._renderer.domElement.toDataURL(mime);\r\n } else {\r\n // Clone the canvas onto a 2d context, so we can trim it properly\r\n let newCanvas = document.createElement('canvas');\r\n let context = newCanvas.getContext('2d');\r\n\r\n newCanvas.width = this._renderer.domElement.width;\r\n newCanvas.height = this._renderer.domElement.height;\r\n\r\n context.drawImage(this._renderer.domElement, 0, 0);\r\n\r\n let trimmed = Object(_functions__WEBPACK_IMPORTED_MODULE_6__[\"trimCanvas\"])(newCanvas);\r\n return trimmed.toDataURL(mime);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Export the current scene content in the .obj format (only geometries, no textures)\r\n * @returns {string} the .obj file content\r\n */\r\n toObj() {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"OBJExporter\"]();\r\n return exporter.parse(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Export the current scene content in the .gltf format (geometries + textures)\r\n * @returns {Promise} a promise which resolves with the .gltf file content\r\n */\r\n toGLTF(exportOptions) {\r\n return new Promise((resolve, reject) => {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"GLTFExporter\"]();\r\n exporter.parse(this._scene, (gltf) => {\r\n resolve(gltf);\r\n }, exportOptions)\r\n } else {\r\n reject();\r\n }\r\n })\r\n }\r\n\r\n toPLY(exportOptions) {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"PLYExporter\"]();\r\n return exporter.parse(this._scene, exportOptions);\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the scene\r\n * @param renderCb\r\n * @param doNotAnimate\r\n * @protected\r\n */\r\n initScene(renderCb, doNotAnimate) {\r\n let renderObj = this;\r\n\r\n console.log(\" \");\r\n console.log('%c ', 'font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;');\r\n console.log(\"MineRender/\" + (renderObj.renderType || renderObj.constructor.name) + \"/\" + \"1.4.7\");\r\n console.log(( false ? undefined : \"DEVELOPMENT\") + \" build\");\r\n console.log(\"Built @ \" + \"2021-02-01T16:31:09.608Z\");\r\n console.log(\" \");\r\n\r\n if (renderObj.options.sendStats) {\r\n // Send stats\r\n\r\n let iframe = false;\r\n try {\r\n iframe = window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n let hostname;\r\n try{\r\n hostname = new URL(iframe ? document.referrer : window.location).hostname;\r\n }catch (e) {\r\n console.warn(\"Failed to get hostname\");\r\n }\r\n\r\n jquery__WEBPACK_IMPORTED_MODULE_5__[\"post\"]({\r\n url: \"https://minerender.org/stats.php\",\r\n data: {\r\n action: \"init\",\r\n type: renderObj.renderType,\r\n host: hostname,\r\n source: (iframe ? \"iframe\" : \"javascript\")\r\n }\r\n });\r\n }\r\n\r\n // Scene INIT\r\n let scene = new three__WEBPACK_IMPORTED_MODULE_3__[\"Scene\"]();\r\n renderObj._scene = scene;\r\n let camera;\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"OrthographicCamera\"]((renderObj.options.canvas.width || window.innerWidth) / -2, (renderObj.options.canvas.width || window.innerWidth) / 2, (renderObj.options.canvas.height || window.innerHeight) / 2, (renderObj.options.canvas.height || window.innerHeight) / -2, 1, 1000);\r\n } else {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"PerspectiveCamera\"](75, (renderObj.options.canvas.width || window.innerWidth) / (renderObj.options.canvas.height || window.innerHeight), 5, 1000);\r\n }\r\n renderObj._camera = camera;\r\n\r\n if (renderObj.options.camera.zoom) {\r\n camera.zoom = renderObj.options.camera.zoom;\r\n }\r\n\r\n let renderer = new three__WEBPACK_IMPORTED_MODULE_3__[\"WebGLRenderer\"]({alpha: true, antialias: true, preserveDrawingBuffer: true});\r\n renderObj._renderer = renderer;\r\n renderer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderer.setClearColor(0x000000, 0);\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.shadowMap.enabled = true;\r\n renderer.shadowMap.type = three__WEBPACK_IMPORTED_MODULE_3__[\"PCFSoftShadowMap\"];\r\n renderObj.element.appendChild(renderObj._canvas = renderer.domElement);\r\n\r\n let composer = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default.a(renderer);\r\n composer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderObj._composer = composer;\r\n let ssaaRenderPass = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"SSAARenderPass\"](scene, camera);\r\n ssaaRenderPass.unbiased = true;\r\n composer.addPass(ssaaRenderPass);\r\n // let renderPass = new RenderPass(scene, camera);\r\n // renderPass.enabled = false;\r\n // composer.addPass(renderPass);\r\n let copyPass = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"ShaderPass\"](_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"CopyShader\"]);\r\n copyPass.renderToScreen = true;\r\n composer.addPass(copyPass);\r\n\r\n if (renderObj.options.autoResize) {\r\n renderObj._resizeListener = function () {\r\n let width = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetWidth : window.innerWidth;\r\n let height = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetHeight : window.innerHeight;\r\n\r\n renderObj._resize(width, height);\r\n };\r\n window.addEventListener(\"resize\", renderObj._resizeListener);\r\n }\r\n renderObj._resize = function (width, height) {\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera.left = width / -2;\r\n camera.right = width / 2;\r\n camera.top = height / 2;\r\n camera.bottom = height / -2;\r\n } else {\r\n camera.aspect = width / height;\r\n }\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(width, height);\r\n composer.setSize(width, height);\r\n };\r\n\r\n // Helpers\r\n if (renderObj.options.showAxes) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"AxesHelper\"](50));\r\n }\r\n if (renderObj.options.showGrid) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"GridHelper\"](100, 100));\r\n }\r\n\r\n let light = new three__WEBPACK_IMPORTED_MODULE_3__[\"AmbientLight\"](0xFFFFFF); // soft white light\r\n scene.add(light);\r\n\r\n // Init controls\r\n let controls = new _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__[\"default\"](camera, renderer.domElement);\r\n renderObj._controls = controls;\r\n controls.enableZoom = renderObj.options.controls.zoom;\r\n controls.enableRotate = renderObj.options.controls.rotate;\r\n controls.enablePan = renderObj.options.controls.pan;\r\n controls.enableKeys = renderObj.options.controls.keys;\r\n controls.target.set(renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]);\r\n\r\n // Set camera location & target\r\n camera.position.x = renderObj.options.camera.x;\r\n camera.position.y = renderObj.options.camera.y;\r\n camera.position.z = renderObj.options.camera.z;\r\n camera.lookAt(new three__WEBPACK_IMPORTED_MODULE_3__[\"Vector3\"](renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]));\r\n\r\n // Do the render!\r\n let animate = function () {\r\n renderObj._animId = requestAnimationFrame(animate);\r\n\r\n if (renderObj.onScreen) {\r\n if (typeof renderCb === \"function\") renderCb();\r\n\r\n composer.render();\r\n }\r\n };\r\n renderObj._animate = animate;\r\n\r\n if (!doNotAnimate) {\r\n animate();\r\n }\r\n\r\n renderObj.onScreen = true;// default to true, in case the checking is disabled\r\n let id = \"minerender-canvas-\" + renderObj._scene.uuid + \"-\" + Date.now();\r\n renderObj._canvas.id = id;\r\n if (renderObj.options.pauseHidden) {\r\n renderObj.onScreen = false;// set to false if the check is enabled\r\n let os = new onscreen__WEBPACK_IMPORTED_MODULE_4___default.a();\r\n renderObj._onScreenObserver = os;\r\n\r\n os.on(\"enter\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = true;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextRestore();\r\n }\r\n })\r\n os.on(\"leave\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = false;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextLoss();\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Adds an object to the scene & sets userData.renderType to this renderer's type\r\n * @param toAdd object to add\r\n */\r\n addToScene(toAdd) {\r\n let renderObj = this;\r\n if (renderObj._scene && toAdd) {\r\n toAdd.userData.renderType = renderObj.renderType;\r\n renderObj._scene.add(toAdd);\r\n }\r\n }\r\n\r\n /**\r\n * Clears the scene\r\n * @param onlySelfType whether to remove only objects whose type is equal to this renderer's type (useful for combined render)\r\n * @param filterFn Filter function to check which children of the scene to remove\r\n */\r\n clearScene(onlySelfType, filterFn) {\r\n if (onlySelfType || filterFn) {\r\n for (let i = this._scene.children.length - 1; i >= 0; i--) {\r\n let child = this._scene.children[i];\r\n if (filterFn) {\r\n let shouldKeep = filterFn(child);\r\n if (shouldKeep) {\r\n continue;\r\n }\r\n }\r\n if (onlySelfType) {\r\n if (child.userData.renderType !== this.renderType) {\r\n continue;\r\n }\r\n }\r\n deepDisposeMesh(child, true);\r\n this._scene.remove(child);\r\n }\r\n } else {\r\n while (this._scene.children.length > 0) {\r\n this._scene.remove(this._scene.children[0]);\r\n }\r\n }\r\n };\r\n\r\n dispose() {\r\n cancelAnimationFrame(this._animId);\r\n if (this._onScreenObserver) {\r\n this._onScreenObserver.destroy();\r\n }\r\n\r\n this.clearScene();\r\n\r\n this._canvas.remove();\r\n let el = this.element;\r\n while (el.firstChild) {\r\n el.removeChild(el.firstChild);\r\n }\r\n\r\n if (this.options.autoResize) {\r\n window.removeEventListener(\"resize\", this._resizeListener);\r\n }\r\n };\r\n\r\n}\r\n\r\n// https://stackoverflow.com/questions/27217388/use-multiple-materials-for-merged-geometries-in-three-js/44485364#44485364\r\nfunction deepDisposeMesh(obj, removeChildren) {\r\n if (!obj) return;\r\n if (obj.geometry && obj.geometry.dispose) obj.geometry.dispose();\r\n if (obj.material && obj.material.dispose) obj.material.dispose();\r\n if (obj.texture && obj.texture.dispose) obj.texture.dispose();\r\n if (obj.children) {\r\n let children = obj.children;\r\n for (let i = 0; i < children.length; i++) {\r\n deepDisposeMesh(children[i], removeChildren);\r\n }\r\n\r\n if (removeChildren) {\r\n for (let i = obj.children.length - 1; i >= 0; i--) {\r\n obj.remove(children[i]);\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction mergeMeshes__(meshes, toBufferGeometry) {\r\n let finalGeometry,\r\n materials = [],\r\n mergedGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"](),\r\n mergedMesh;\r\n\r\n meshes.forEach(function (mesh, index) {\r\n mesh.updateMatrix();\r\n mesh.geometry.faces.forEach(function (face) {\r\n face.materialIndex = 0;\r\n });\r\n mergedGeometry.merge(mesh.geometry, mesh.matrix, index);\r\n materials.push(mesh.material);\r\n });\r\n\r\n mergedGeometry.groupsNeedUpdate = true;\r\n\r\n if (toBufferGeometry) {\r\n finalGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedGeometry);\r\n } else {\r\n finalGeometry = mergedGeometry;\r\n }\r\n\r\n mergedMesh = new three__WEBPACK_IMPORTED_MODULE_3__[\"Mesh\"](finalGeometry, materials);\r\n mergedMesh.geometry.computeFaceNormals();\r\n mergedMesh.geometry.computeVertexNormals();\r\n\r\n return mergedMesh;\r\n\r\n}\r\n\r\nfunction mergeCubeMeshes(cubes, toBuffer) {\r\n cubes = cubes.filter(c => !!c);\r\n\r\n let mergedCubes = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"]();\r\n let mergedMaterials = [];\r\n for (let i = 0; i < cubes.length; i++) {\r\n let offset = i * Math.max(cubes[i].material.length, 1);\r\n mergedCubes.merge(cubes[i].geometry, cubes[i].matrix, offset);\r\n for (let j = 0; j < cubes[i].material.length; j++) {\r\n mergedMaterials.push(cubes[i].material[j]);\r\n }\r\n // for (let j = 0; j < cubes[i].geometry.faces.length; j++) {\r\n // cubes[i].geometry.faces[j].materialIndex=offset-1+j;\r\n // }\r\n\r\n deepDisposeMesh(cubes[i], true);\r\n }\r\n mergedCubes.mergeVertices();\r\n return {\r\n geometry: toBuffer ? new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedCubes) : mergedCubes,\r\n materials: mergedMaterials\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./src/renderBase.js?"); /***/ }), diff --git a/dist/gui.min.js b/dist/gui.min.js index e98fa5ac..1f19de90 100644 --- a/dist/gui.min.js +++ b/dist/gui.min.js @@ -1,16 +1,16 @@ /*! - * MineRender 1.4.6 + * MineRender 1.4.7 * (c) 2018, Haylee Schäfer (inventivetalent) / MIT License * https://minerender.org - * Build #1612195849082 / Mon Feb 01 2021 17:10:49 GMT+0100 (GMT+01:00) - */!function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=79)}([function(e,t){e.exports=THREE},function(e,t,r){"use strict";r.d(t,"e",(function(){return o})),r.d(t,"b",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"c",(function(){return f})),r.d(t,"f",(function(){return d})),r.d(t,"a",(function(){return p}));var a=r(2),n=r(42),i=r.n(n);function o(e,t,r,n){return new Promise(i=>{let o,s,l,f="block";if("string"==typeof e){let a=c(e);e=a.model,f=a.type,r.push({name:e,type:f,options:t}),i(r)}else if("object"==typeof e)if(e.hasOwnProperty("offset")&&(o=e.offset),e.hasOwnProperty("rotation")&&(s=e.rotation),e.hasOwnProperty("scale")&&(l=e.scale),e.hasOwnProperty("model")){if(e.hasOwnProperty("type"))f=e.type,e=e.model;else{let t=c(e.model);e=t.model,f=t.type}r.push({name:e,type:f,offset:o,rotation:s,scale:l,options:t}),i(r)}else e.hasOwnProperty("blockstate")&&(f="block",Object(a.b)(e.blockstate,n).then(a=>{if(a.hasOwnProperty("variants"))if(e.hasOwnProperty("variant")){let n=function(e,t){Array.isArray(e)||(e=Object.keys(e));if(!t||""===t||0===t.length)return"";let r=u(t);for(let t=0;t{i(r)}))})}function s(e,t){return function(e,t,r){return new Promise((n,i)=>{"string"==typeof e?e.startsWith("{")&&e.endsWith("}")?n(JSON.parse(e)):e.startsWith("http")?fetch(e,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{console.log("model data:",e),n(e)}):Object(a.c)(r,"/assets/minecraft/models/"+(t||"block")+"/"+e+".json").then(e=>{n(e)}):"object"==typeof e?n(e):(console.warn("Invalid model"),i())})}(e.name,e.type,t).then(r=>(function(e,t,r){return new Promise((a,n)=>{h(e,t,[],[],r,a,n)})})(r,e.name,t)).then(t=>(console.debug(e.name+" merged:"),console.debug(t),t.hasOwnProperty("elements")||"lava"!==e.name&&"water"!==e.name||(t.elements=[{from:[0,0,0],to:[16,16,16],faces:{down:{texture:"#particle",cullface:"down"},up:{texture:"#particle",cullface:"up"},north:{texture:"#particle",cullface:"north"},south:{texture:"#particle",cullface:"south"},west:{texture:"#particle",cullface:"west"},east:{texture:"#particle",cullface:"east"}}}]),t))}function l(e){return e.type+"__"+e.name}function u(e){let t=e.split(","),r={};for(let e=0;e{let n=[],i=[],o=Object.keys(e);for(let r=0;r{let a={};for(let e=0;e=0;t--)e=i()(e,r[t]);return n.unshift(t),e.hierarchy=n,void s(e)}let u=e.parent;delete e.parent,n.push(u),Object(a.c)(o,"/assets/minecraft/models/"+u+".json").then(a=>{let i=Object.assign({},e,a);h(i,t,r,n,o,s,l)}).catch(l)};function d(e){return e*(Math.PI/180)}function p(e){Object.keys(e).forEach((function(t){delete e[t]}))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return u})),r.d(t,"e",(function(){return c})),r.d(t,"c",(function(){return f})),r.d(t,"f",(function(){return h})),r.d(t,"g",(function(){return d}));const a="https://assets.mcasset.cloud/1.13",n={},i={},o={},s={};function l(e,t,r,o){return new Promise((s,l)=>{!function e(t,r,o,s,l,u,c){let f="/assets/"+r+"/textures"+o+s+".png";if(n.hasOwnProperty(f))return"__invalid"===n[f]?void u():void l(n[f]);if(!i.hasOwnProperty(f)||0===i[f].length||c){let c=new XMLHttpRequest;c.open("GET",t+f,!0),c.responseType="arraybuffer",c.onloadend=function(){if(200===c.status){let e=new Uint8Array(c.response||c.responseText),t=String.fromCharCode.apply(null,e),r="data:image/png;base64,"+btoa(t);if(n[f]=r,i.hasOwnProperty(f))for(;i[f].length>0;){i[f].shift(0)[0](r)}}else if(a===t){if(n[f]="__invalid",i.hasOwnProperty(f))for(;i[f].length>0;){i[f].shift(0)[1]()}}else e(a,r,o,s,l,u,!0)},c.send(),i.hasOwnProperty(f)||(i[f]=[])}i[f].push([l,u])}(e,t,r,o,s,l)})}function u(e,t){return f(t,"/assets/minecraft/blockstates/"+e+".json")}function c(e,t){return f(t,"/assets/minecraft/textures/block/"+e+".png.mcmeta")}function f(e,t){return new Promise((r,n)=>{!function e(t,r,n,i,l){if(o.hasOwnProperty(r))return"__invalid"===o[r]?void i():void n(Object.assign({},o[r]));s.hasOwnProperty(r)&&0!==s[r].length&&!l||(console.log(t+r),fetch(t+r,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{if(console.log("json data:",e),o[r]=e,s.hasOwnProperty(r))for(;s[r].length>0;){let t=Object.assign({},e);s[r].shift(0)[0](t)}}).catch(l=>{if(console.warn(l),a===t){if(o[r]="__invalid",s.hasOwnProperty(r))for(;s[r].length>0;){s[r].shift(0)[1]()}}else e(a,r,n,i,!0)}),s.hasOwnProperty(r)||(s[r]=[]));s[r].push([n,i])}(e,t,r,n)})}function h(e,t,r){return 0===e?0:t/(r||16)*e}function d(e){let t,r,a,n=e.getContext("2d"),i=document.createElement("canvas").getContext("2d"),o=n.getImageData(0,0,e.width,e.height),s=o.data.length,l={top:null,left:null,right:null,bottom:null};for(t=0;t1)for(var r=1;r{let o,s,l,u="block";if("string"==typeof e){let a=h(e);e=a.model,u=a.type,r.push({name:e,type:u,options:t}),i(r)}else if("object"==typeof e)if(e.hasOwnProperty("offset")&&(o=e.offset),e.hasOwnProperty("rotation")&&(s=e.rotation),e.hasOwnProperty("scale")&&(l=e.scale),e.hasOwnProperty("model")){if(e.hasOwnProperty("type"))u=e.type,e=e.model;else{let t=h(e.model);e=t.model,u=t.type}r.push({name:e,type:u,offset:o,rotation:s,scale:l,options:t}),i(r)}else e.hasOwnProperty("blockstate")&&(u="block",Object(a.b)(e.blockstate,n).then(a=>{if(a.hasOwnProperty("variants"))if(e.hasOwnProperty("variant")){let n=function(e,t){Array.isArray(e)||(e=Object.keys(e));if(!t||""===t||0===t.length)return"";let r=f(t);for(let t=0;t{i(r)}))})}function u(e,t){return function(e,t,r){return new Promise((n,i)=>{"string"==typeof e?e.startsWith("{")&&e.endsWith("}")?n(JSON.parse(e)):e.startsWith("http")?fetch(e,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{console.log("model data:",e),n(e)}):Object(a.c)(r,"/assets/minecraft/models/"+(t||"block")+"/"+e+".json").then(e=>{n(e)}):"object"==typeof e?n(e):(console.warn("Invalid model"),i())})}(e.name,e.type,t).then(r=>(function(e,t,r){return new Promise((a,n)=>{p(e,t,[],[],r,a,n)})})(r,e.name,t)).then(t=>(s(e.name+" merged:"),s(t),t.hasOwnProperty("elements")||"lava"!==e.name&&"water"!==e.name||(t.elements=[{from:[0,0,0],to:[16,16,16],faces:{down:{texture:"#particle",cullface:"down"},up:{texture:"#particle",cullface:"up"},north:{texture:"#particle",cullface:"north"},south:{texture:"#particle",cullface:"south"},west:{texture:"#particle",cullface:"west"},east:{texture:"#particle",cullface:"east"}}}]),t))}function c(e){return e.type+"__"+e.name}function f(e){let t=e.split(","),r={};for(let e=0;e{let n=[],i=[],o=Object.keys(e);for(let r=0;r{let a={};for(let e=0;e=0;t--)e=i()(e,r[t]);return n.unshift(t),e.hierarchy=n,void s(e)}let u=e.parent;delete e.parent,n.push(u),Object(a.c)(o,"/assets/minecraft/models/"+u+".json").then(a=>{let i=Object.assign({},e,a);p(i,t,r,n,o,s,l)}).catch(l)};function m(e){return e*(Math.PI/180)}function v(e){Object.keys(e).forEach((function(t){delete e[t]}))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"d",(function(){return c})),r.d(t,"b",(function(){return f})),r.d(t,"e",(function(){return h})),r.d(t,"c",(function(){return d})),r.d(t,"f",(function(){return p})),r.d(t,"g",(function(){return m}));var a=r(12);const n=a("minerender"),i="https://assets.mcasset.cloud/1.13",o={},s={},l={},u={};function c(e,t,r,a){return new Promise((n,l)=>{!function e(t,r,a,n,l,u,c){let f="/assets/"+r+"/textures"+a+n+".png";if(o.hasOwnProperty(f))return"__invalid"===o[f]?void u():void l(o[f]);if(!s.hasOwnProperty(f)||0===s[f].length||c){let c=new XMLHttpRequest;c.open("GET",t+f,!0),c.responseType="arraybuffer",c.onloadend=function(){if(200===c.status){let e=new Uint8Array(c.response||c.responseText),t=String.fromCharCode.apply(null,e),r="data:image/png;base64,"+btoa(t);if(o[f]=r,s.hasOwnProperty(f))for(;s[f].length>0;){s[f].shift(0)[0](r)}}else if(i===t){if(o[f]="__invalid",s.hasOwnProperty(f))for(;s[f].length>0;){s[f].shift(0)[1]()}}else e(i,r,a,n,l,u,!0)},c.send(),s.hasOwnProperty(f)||(s[f]=[])}s[f].push([l,u])}(e,t,r,a,n,l)})}function f(e,t){return d(t,"/assets/minecraft/blockstates/"+e+".json")}function h(e,t){return d(t,"/assets/minecraft/textures/block/"+e+".png.mcmeta")}function d(e,t){return new Promise((r,a)=>{!function e(t,r,a,o,s){if(l.hasOwnProperty(r))return"__invalid"===l[r]?void o():void a(Object.assign({},l[r]));u.hasOwnProperty(r)&&0!==u[r].length&&!s||(n(t+r),fetch(t+r,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{if(n("json data:",e),l[r]=e,u.hasOwnProperty(r))for(;u[r].length>0;){let t=Object.assign({},e);u[r].shift(0)[0](t)}}).catch(n=>{if(console.warn(n),i===t){if(l[r]="__invalid",u.hasOwnProperty(r))for(;u[r].length>0;){u[r].shift(0)[1]()}}else e(i,r,a,o,!0)}),u.hasOwnProperty(r)||(u[r]=[]));u[r].push([a,o])}(e,t,r,a)})}function p(e,t,r){return 0===e?0:t/(r||16)*e}function m(e){let t,r,a,n=e.getContext("2d"),i=document.createElement("canvas").getContext("2d"),o=n.getImageData(0,0,e.width,e.height),s=o.data.length,l={top:null,left:null,right:null,bottom:null};for(t=0;t1)for(var r=1;r * @license MIT */ -var a=r(103),n=r(104),i=r(53);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(a)return V(e).length;t=(""+t).toLowerCase(),a=!0}}function m(e,t,r){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function v(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function g(e,t,r,a,n){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,a)),l.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,n);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,a,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,a,n){var i,o=1,s=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,h=0;hn&&(a=n):a=n;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");a>i/2&&(a=i/2);for(var o=0;o>8,n=r%256,i.push(n),i.push(a);return i}(t,e.length-r),e,r,a)}function S(e,t,r){return 0===t&&r===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[n+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[n+1],o=e[n+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[n+1],o=e[n+2],s=e[n+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),n+=f}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var r="",a=0;for(;a0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,a,n){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(a>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(i,o),u=this.slice(a,n),c=e.slice(t,r),f=0;fn)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;na)&&(r=a);for(var n="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,a,n,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function R(e,t,r,a){t<0&&(t=65535+t+1);for(var n=0,i=Math.min(e.length-r,2);n>>8*(a?n:1-n)}function I(e,t,r,a){t<0&&(t=4294967295+t+1);for(var n=0,i=Math.min(e.length-r,4);n>>8*(a?n:3-n)&255}function N(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,a,i){return i||N(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function U(e,t,r,a,i){return i||N(e,0,r,8),n.write(e,t,r,a,52,8),r+8}l.prototype.slice=function(e,t){var r,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t0&&(n*=256);)a+=this[e+--t]*n;return a},l.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=this[e],n=1,i=0;++i=(n*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=t,n=1,i=this[e+--a];a>0&&(n*=256);)i+=this[e+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,a){(e=+e,t|=0,r|=0,a)||k(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+n]=e/i&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,a){if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return a.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,a){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,r(4))},function(e,t,r){"use strict";t.a={bars:{pink_empty:{uv:[0,0,182,5]},pink_full:{uv:[0,5,182,10]},cyan_empty:{uv:[0,10,182,15]},cyan_full:{uv:[0,15,182,20]},orange_empty:{uv:[0,20,182,25]},orange_full:{uv:[0,25,182,30]},green_empty:{uv:[0,30,182,35]},green_full:{uv:[0,35,182,40]},yellow_empty:{uv:[0,40,182,45]},yellow_full:{uv:[0,45,182,50]},purple_empty:{uv:[0,50,182,55]},purple_full:{uv:[0,55,182,60]},white_empty:{uv:[0,60,182,65]},white_full:{uv:[0,65,182,70]}},book:{base:{uv:[0,0,192,192]},button_next:{uv:[0,192,23,205],pos:[120,156]},button_next_hover:{uv:[23,192,46,205],pos:[120,156]},button_prev:{uv:[0,205,23,218],pos:[38,156]},button_prev_hover:{uv:[23,205,46,218],pos:[38,156]}},container:{generic_54:{uv:[0,0,176,222],top_origin:[8,18],item_offset:[18,18]},crafting_table:{uv:[0,0,176,166],left_origin:[30,17],right_origin:[124,35],item_offset:[18,18]}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;rp||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},d=h.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,k=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),R=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,1),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var n=l.domElement===document?l.domElement.body:l.domElement;if(l.object instanceof a.PerspectiveCamera){var i=l.object.position;e.copy(i).sub(l.target);var o=e.length();o*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*o/n.clientHeight,l.object.matrix),R(2*r*o/n.clientHeight,l.object.matrix)}else l.object instanceof a.OrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),R(r*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object instanceof a.PerspectiveCamera?g/=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object instanceof a.PerspectiveCamera?g*=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),d=h.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),d=h.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),d=h.PAN}d!==h.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),d){case h.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case h.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case h.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),d=h.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||d!==h.NONE&&d!==h.ROTATE||(e.preventDefault(),e.stopPropagation(),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(c),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}(e),d=h.TOUCH_DOLLY;break;case 3:if(!1===l.enablePan)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_PAN;break;default:d=h.NONE}d!==h.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(d!==h.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom)return;if(d!==h.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.subVectors(T,M),P.y>0?D(F()):P.y<0&&N(F()),M.copy(T),l.update()}(e);break;case 3:if(!1===l.enablePan)return;if(d!==h.TOUCH_PAN)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e);break;default:d=h.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),d=h.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()}n.prototype=Object.create(a.EventDispatcher.prototype),n.prototype.constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var i=r(21),o=r(26),s=r.n(o),l=r(77),u=r.n(l),c=r(41),f=r(2);r.d(t,"b",(function(){return d})),r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return m}));const h={showAxes:!1,showGrid:!1,autoResize:!1,controls:{enabled:!0,zoom:!0,rotate:!0,pan:!0,keys:!0},camera:{type:"perspective",x:20,y:35,z:20,target:[0,0,0]},canvas:{width:void 0,height:void 0},pauseHidden:!0,forceContext:!1,sendStats:!0};class d{constructor(e,t,r){this.element=r||document.body,this.options=Object.assign({},h,t,e),this.renderType="_Base_"}toImage(e,t){if(t||(t="image/png"),this._renderer){if(e){let e=document.createElement("canvas"),r=e.getContext("2d");return e.width=this._renderer.domElement.width,e.height=this._renderer.domElement.height,r.drawImage(this._renderer.domElement,0,0),Object(f.g)(e).toDataURL(t)}return this._renderer.domElement.toDataURL(t)}}toObj(){if(this._scene){return(new i.OBJExporter).parse(this._scene)}}toGLTF(e){return new Promise((t,r)=>{if(this._scene){(new i.GLTFExporter).parse(this._scene,e=>{t(e)},e)}else r()})}toPLY(e){if(this._scene){return(new i.PLYExporter).parse(this._scene,e)}}initScene(e,t){let r=this;if(console.log(" "),console.log("%c ","font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;"),console.log("MineRender/"+(r.renderType||r.constructor.name)+"/1.4.6"),console.log("PRODUCTION build"),console.log("Built @ 2021-02-01T16:10:49.105Z"),console.log(" "),r.options.sendStats){let e,t=!1;try{t=window.self!==window.top}catch(e){return!0}try{e=new URL(t?document.referrer:window.location).hostname}catch(e){console.warn("Failed to get hostname")}c.post({url:"https://minerender.org/stats.php",data:{action:"init",type:r.renderType,host:e,source:t?"iframe":"javascript"}})}let l,f=new a.Scene;r._scene=f,l="orthographic"===r.options.camera.type?new a.OrthographicCamera((r.options.canvas.width||window.innerWidth)/-2,(r.options.canvas.width||window.innerWidth)/2,(r.options.canvas.height||window.innerHeight)/2,(r.options.canvas.height||window.innerHeight)/-2,1,1e3):new a.PerspectiveCamera(75,(r.options.canvas.width||window.innerWidth)/(r.options.canvas.height||window.innerHeight),5,1e3),r._camera=l,r.options.camera.zoom&&(l.zoom=r.options.camera.zoom);let h=new a.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});r._renderer=h,h.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),h.setClearColor(0,0),h.setPixelRatio(window.devicePixelRatio),h.shadowMap.enabled=!0,h.shadowMap.type=a.PCFSoftShadowMap,r.element.appendChild(r._canvas=h.domElement);let d=new s.a(h);d.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),r._composer=d;let p=new i.SSAARenderPass(f,l);p.unbiased=!0,d.addPass(p);let m=new o.ShaderPass(o.CopyShader);m.renderToScreen=!0,d.addPass(m),r.options.autoResize&&(r._resizeListener=function(){let e=r.element&&r.element!==document.body?r.element.offsetWidth:window.innerWidth,t=r.element&&r.element!==document.body?r.element.offsetHeight:window.innerHeight;r._resize(e,t)},window.addEventListener("resize",r._resizeListener)),r._resize=function(e,t){"orthographic"===r.options.camera.type?(l.left=e/-2,l.right=e/2,l.top=t/2,l.bottom=t/-2):l.aspect=e/t,l.updateProjectionMatrix(),h.setSize(e,t),d.setSize(e,t)},r.options.showAxes&&f.add(new a.AxesHelper(50)),r.options.showGrid&&f.add(new a.GridHelper(100,100));let v=new a.AmbientLight(16777215);f.add(v);let g=new n(l,h.domElement);r._controls=g,g.enableZoom=r.options.controls.zoom,g.enableRotate=r.options.controls.rotate,g.enablePan=r.options.controls.pan,g.enableKeys=r.options.controls.keys,g.target.set(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]),l.position.x=r.options.camera.x,l.position.y=r.options.camera.y,l.position.z=r.options.camera.z,l.lookAt(new a.Vector3(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]));let y=function(){r._animId=requestAnimationFrame(y),r.onScreen&&("function"==typeof e&&e(),d.render())};r._animate=y,t||y(),r.onScreen=!0;let b="minerender-canvas-"+r._scene.uuid+"-"+Date.now();if(r._canvas.id=b,r.options.pauseHidden){r.onScreen=!1;let e=new u.a;r._onScreenObserver=e,e.on("enter","#"+b,(e,t)=>{r.onScreen=!0,r.options.forceContext&&r._renderer.forceContextRestore()}),e.on("leave","#"+b,(e,t)=>{r.onScreen=!1,r.options.forceContext&&r._renderer.forceContextLoss()})}}addToScene(e){let t=this;t._scene&&e&&(e.userData.renderType=t.renderType,t._scene.add(e))}clearScene(e,t){if(e||t)for(let r=this._scene.children.length-1;r>=0;r--){let a=this._scene.children[r];if(t){if(t(a))continue}e&&a.userData.renderType!==this.renderType||(p(a,!0),this._scene.remove(a))}else for(;this._scene.children.length>0;)this._scene.remove(this._scene.children[0])}dispose(){cancelAnimationFrame(this._animId),this._onScreenObserver&&this._onScreenObserver.destroy(),this.clearScene(),this._canvas.remove();let e=this.element;for(;e.firstChild;)e.removeChild(e.firstChild);this.options.autoResize&&window.removeEventListener("resize",this._resizeListener)}}function p(e,t){if(e&&(e.geometry&&e.geometry.dispose&&e.geometry.dispose(),e.material&&e.material.dispose&&e.material.dispose(),e.texture&&e.texture.dispose&&e.texture.dispose(),e.children)){let r=e.children;for(let e=0;e=0;t--)e.remove(r[t])}}function m(e,t){e=e.filter(e=>!!e);let r=new a.Geometry,n=[];for(let t=0;tn(e,t))}class s extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e,Error.captureStackTrace(this,this.constructor.name)}}e.exports={getField:r,getFieldInfo:a,addErrorField:n,getCount:function(e,t,{count:n,countType:i},s){let l=0,u=0;return"number"==typeof n?l=n:void 0!==n?l=r(n,s):void 0!==i?({size:u,value:l}=o(()=>this.read(e,t,a(i),s),"$count")):l=0,{count:l,size:u}},sendCount:function(e,t,r,{count:n,countType:i},o){return void 0!==n&&e!==n||void 0!==i&&(r=this.write(e,t,r,a(i),o)),r},calcCount:function(e,{count:t,countType:r},n){return void 0===t&&void 0!==r?o(()=>this.sizeOf(e,a(r),n),"$count"):0},tryCatch:i,tryDoc:o,PartialReadError:class extends s{constructor(e){super(e),this.partialReadError=!0}}}},function(e,t,r){"use strict";function a(e,t,r){var a=r?" !== ":" === ",n=r?" || ":" && ",i=r?"!":"",o=r?"":"!";switch(e){case"null":return t+a+"null";case"array":return i+"Array.isArray("+t+")";case"object":return"("+i+t+n+"typeof "+t+a+'"object"'+n+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+a+'"number"'+n+o+"("+t+" % 1)"+n+t+a+t+")";default:return"typeof "+t+a+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:a,checkDataTypes:function(e,t){switch(e.length){case 1:return a(e[0],t,!0);default:var r="",n=i(e);for(var o in n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)r+=(r?" && ":"")+a(o,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],a=0;a=t)throw new Error("Cannot access property/index "+a+" levels up, current level is "+t);return r[t-a]}if(a>t)throw new Error("Cannot access data "+a+" levels up, current level is "+t);if(i="data"+(t-a||""),!n)return i}for(var s=i,u=n.split("/"),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,n,o,s;if("string"==typeof t&&(n="not ",t.substr(!o||o<0?0:+o,n.length)===n)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(a," ").concat(i(t,"type"));else{var l=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(a," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var n=r(69),i=r(73);r(6)(u,n);for(var o=a(i.prototype),s=0;s0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function f(){for(var e=[],t=0;t0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=n[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=m(l,u);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;a--)this.removeListener(e,t[a]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(7).Buffer)},function(e){e.exports=JSON.parse('{"i8":{"enum":["i8"]},"u8":{"enum":["u8"]},"i16":{"enum":["i16"]},"u16":{"enum":["u16"]},"i32":{"enum":["i32"]},"u32":{"enum":["u32"]},"f32":{"enum":["f32"]},"f64":{"enum":["f64"]},"li8":{"enum":["li8"]},"lu8":{"enum":["lu8"]},"li16":{"enum":["li16"]},"lu16":{"enum":["lu16"]},"li32":{"enum":["li32"]},"lu32":{"enum":["lu32"]},"lf32":{"enum":["lf32"]},"lf64":{"enum":["lf64"]},"i64":{"enum":["i64"]},"li64":{"enum":["li64"]},"u64":{"enum":["u64"]},"lu64":{"enum":["lu64"]}}')},function(module,exports,__webpack_require__){ +var a=r(106),n=r(107),i=r(54);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(a)return V(e).length;t=(""+t).toLowerCase(),a=!0}}function m(e,t,r){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function v(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function g(e,t,r,a,n){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,a)),l.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,n);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,a,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,a,n){var i,o=1,s=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,h=0;hn&&(a=n):a=n;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");a>i/2&&(a=i/2);for(var o=0;o>8,n=r%256,i.push(n),i.push(a);return i}(t,e.length-r),e,r,a)}function S(e,t,r){return 0===t&&r===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[n+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[n+1],o=e[n+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[n+1],o=e[n+2],s=e[n+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),n+=f}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var r="",a=0;for(;a0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,a,n){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(a>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(i,o),u=this.slice(a,n),c=e.slice(t,r),f=0;fn)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;na)&&(r=a);for(var n="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,a,n,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function R(e,t,r,a){t<0&&(t=65535+t+1);for(var n=0,i=Math.min(e.length-r,2);n>>8*(a?n:1-n)}function I(e,t,r,a){t<0&&(t=4294967295+t+1);for(var n=0,i=Math.min(e.length-r,4);n>>8*(a?n:3-n)&255}function N(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,a,i){return i||N(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function U(e,t,r,a,i){return i||N(e,0,r,8),n.write(e,t,r,a,52,8),r+8}l.prototype.slice=function(e,t){var r,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t0&&(n*=256);)a+=this[e+--t]*n;return a},l.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=this[e],n=1,i=0;++i=(n*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=t,n=1,i=this[e+--a];a>0&&(n*=256);)i+=this[e+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,a){(e=+e,t|=0,r|=0,a)||k(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+n]=e/i&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,a){if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return a.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,a){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,r(4))},function(e,t,r){"use strict";t.a={bars:{pink_empty:{uv:[0,0,182,5]},pink_full:{uv:[0,5,182,10]},cyan_empty:{uv:[0,10,182,15]},cyan_full:{uv:[0,15,182,20]},orange_empty:{uv:[0,20,182,25]},orange_full:{uv:[0,25,182,30]},green_empty:{uv:[0,30,182,35]},green_full:{uv:[0,35,182,40]},yellow_empty:{uv:[0,40,182,45]},yellow_full:{uv:[0,45,182,50]},purple_empty:{uv:[0,50,182,55]},purple_full:{uv:[0,55,182,60]},white_empty:{uv:[0,60,182,65]},white_full:{uv:[0,65,182,70]}},book:{base:{uv:[0,0,192,192]},button_next:{uv:[0,192,23,205],pos:[120,156]},button_next_hover:{uv:[23,192,46,205],pos:[120,156]},button_prev:{uv:[0,205,23,218],pos:[38,156]},button_prev_hover:{uv:[23,205,46,218],pos:[38,156]}},container:{generic_54:{uv:[0,0,176,222],top_origin:[8,18],item_offset:[18,18]},crafting_table:{uv:[0,0,176,166],left_origin:[30,17],right_origin:[124,35],item_offset:[18,18]}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}).call(this,r(5))},function(e,t,r){"use strict";var a=r(0);function n(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),d=h.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&d===h.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor):v.set(0,0,0),g=1,y.set(0,0,0),!!(b||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},d=h.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,k=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),R=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,1),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var n=l.domElement===document?l.domElement.body:l.domElement;if(l.object instanceof a.PerspectiveCamera){var i=l.object.position;e.copy(i).sub(l.target);var o=e.length();o*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*o/n.clientHeight,l.object.matrix),R(2*r*o/n.clientHeight,l.object.matrix)}else l.object instanceof a.OrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),R(r*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object instanceof a.PerspectiveCamera?g/=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object instanceof a.PerspectiveCamera?g*=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),d=h.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),d=h.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),d=h.PAN}d!==h.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),d){case h.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case h.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case h.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),d=h.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||d!==h.NONE&&d!==h.ROTATE||(e.preventDefault(),e.stopPropagation(),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(c),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}(e),d=h.TOUCH_DOLLY;break;case 3:if(!1===l.enablePan)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_PAN;break;default:d=h.NONE}d!==h.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(d!==h.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom)return;if(d!==h.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.subVectors(T,M),P.y>0?D(F()):P.y<0&&N(F()),M.copy(T),l.update()}(e);break;case 3:if(!1===l.enablePan)return;if(d!==h.TOUCH_PAN)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e);break;default:d=h.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),d=h.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()}n.prototype=Object.create(a.EventDispatcher.prototype),n.prototype.constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var i=r(22),o=r(27),s=r.n(o),l=r(78),u=r.n(l),c=r(42),f=r(2);r.d(t,"b",(function(){return d})),r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return m}));const h={showAxes:!1,showGrid:!1,autoResize:!1,controls:{enabled:!0,zoom:!0,rotate:!0,pan:!0,keys:!0},camera:{type:"perspective",x:20,y:35,z:20,target:[0,0,0]},canvas:{width:void 0,height:void 0},pauseHidden:!0,forceContext:!1,sendStats:!0};class d{constructor(e,t,r){this.element=r||document.body,this.options=Object.assign({},h,t,e),this.renderType="_Base_"}toImage(e,t){if(t||(t="image/png"),this._renderer){if(e){let e=document.createElement("canvas"),r=e.getContext("2d");return e.width=this._renderer.domElement.width,e.height=this._renderer.domElement.height,r.drawImage(this._renderer.domElement,0,0),Object(f.g)(e).toDataURL(t)}return this._renderer.domElement.toDataURL(t)}}toObj(){if(this._scene){return(new i.OBJExporter).parse(this._scene)}}toGLTF(e){return new Promise((t,r)=>{if(this._scene){(new i.GLTFExporter).parse(this._scene,e=>{t(e)},e)}else r()})}toPLY(e){if(this._scene){return(new i.PLYExporter).parse(this._scene,e)}}initScene(e,t){let r=this;if(console.log(" "),console.log("%c ","font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;"),console.log("MineRender/"+(r.renderType||r.constructor.name)+"/1.4.7"),console.log("PRODUCTION build"),console.log("Built @ 2021-02-01T16:31:09.617Z"),console.log(" "),r.options.sendStats){let e,t=!1;try{t=window.self!==window.top}catch(e){return!0}try{e=new URL(t?document.referrer:window.location).hostname}catch(e){console.warn("Failed to get hostname")}c.post({url:"https://minerender.org/stats.php",data:{action:"init",type:r.renderType,host:e,source:t?"iframe":"javascript"}})}let l,f=new a.Scene;r._scene=f,l="orthographic"===r.options.camera.type?new a.OrthographicCamera((r.options.canvas.width||window.innerWidth)/-2,(r.options.canvas.width||window.innerWidth)/2,(r.options.canvas.height||window.innerHeight)/2,(r.options.canvas.height||window.innerHeight)/-2,1,1e3):new a.PerspectiveCamera(75,(r.options.canvas.width||window.innerWidth)/(r.options.canvas.height||window.innerHeight),5,1e3),r._camera=l,r.options.camera.zoom&&(l.zoom=r.options.camera.zoom);let h=new a.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});r._renderer=h,h.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),h.setClearColor(0,0),h.setPixelRatio(window.devicePixelRatio),h.shadowMap.enabled=!0,h.shadowMap.type=a.PCFSoftShadowMap,r.element.appendChild(r._canvas=h.domElement);let d=new s.a(h);d.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),r._composer=d;let p=new i.SSAARenderPass(f,l);p.unbiased=!0,d.addPass(p);let m=new o.ShaderPass(o.CopyShader);m.renderToScreen=!0,d.addPass(m),r.options.autoResize&&(r._resizeListener=function(){let e=r.element&&r.element!==document.body?r.element.offsetWidth:window.innerWidth,t=r.element&&r.element!==document.body?r.element.offsetHeight:window.innerHeight;r._resize(e,t)},window.addEventListener("resize",r._resizeListener)),r._resize=function(e,t){"orthographic"===r.options.camera.type?(l.left=e/-2,l.right=e/2,l.top=t/2,l.bottom=t/-2):l.aspect=e/t,l.updateProjectionMatrix(),h.setSize(e,t),d.setSize(e,t)},r.options.showAxes&&f.add(new a.AxesHelper(50)),r.options.showGrid&&f.add(new a.GridHelper(100,100));let v=new a.AmbientLight(16777215);f.add(v);let g=new n(l,h.domElement);r._controls=g,g.enableZoom=r.options.controls.zoom,g.enableRotate=r.options.controls.rotate,g.enablePan=r.options.controls.pan,g.enableKeys=r.options.controls.keys,g.target.set(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]),l.position.x=r.options.camera.x,l.position.y=r.options.camera.y,l.position.z=r.options.camera.z,l.lookAt(new a.Vector3(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]));let y=function(){r._animId=requestAnimationFrame(y),r.onScreen&&("function"==typeof e&&e(),d.render())};r._animate=y,t||y(),r.onScreen=!0;let b="minerender-canvas-"+r._scene.uuid+"-"+Date.now();if(r._canvas.id=b,r.options.pauseHidden){r.onScreen=!1;let e=new u.a;r._onScreenObserver=e,e.on("enter","#"+b,(e,t)=>{r.onScreen=!0,r.options.forceContext&&r._renderer.forceContextRestore()}),e.on("leave","#"+b,(e,t)=>{r.onScreen=!1,r.options.forceContext&&r._renderer.forceContextLoss()})}}addToScene(e){let t=this;t._scene&&e&&(e.userData.renderType=t.renderType,t._scene.add(e))}clearScene(e,t){if(e||t)for(let r=this._scene.children.length-1;r>=0;r--){let a=this._scene.children[r];if(t){if(t(a))continue}e&&a.userData.renderType!==this.renderType||(p(a,!0),this._scene.remove(a))}else for(;this._scene.children.length>0;)this._scene.remove(this._scene.children[0])}dispose(){cancelAnimationFrame(this._animId),this._onScreenObserver&&this._onScreenObserver.destroy(),this.clearScene(),this._canvas.remove();let e=this.element;for(;e.firstChild;)e.removeChild(e.firstChild);this.options.autoResize&&window.removeEventListener("resize",this._resizeListener)}}function p(e,t){if(e&&(e.geometry&&e.geometry.dispose&&e.geometry.dispose(),e.material&&e.material.dispose&&e.material.dispose(),e.texture&&e.texture.dispose&&e.texture.dispose(),e.children)){let r=e.children;for(let e=0;e=0;t--)e.remove(r[t])}}function m(e,t){e=e.filter(e=>!!e);let r=new a.Geometry,n=[];for(let t=0;tn(e,t))}class s extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e,Error.captureStackTrace(this,this.constructor.name)}}e.exports={getField:r,getFieldInfo:a,addErrorField:n,getCount:function(e,t,{count:n,countType:i},s){let l=0,u=0;return"number"==typeof n?l=n:void 0!==n?l=r(n,s):void 0!==i?({size:u,value:l}=o(()=>this.read(e,t,a(i),s),"$count")):l=0,{count:l,size:u}},sendCount:function(e,t,r,{count:n,countType:i},o){return void 0!==n&&e!==n||void 0!==i&&(r=this.write(e,t,r,a(i),o)),r},calcCount:function(e,{count:t,countType:r},n){return void 0===t&&void 0!==r?o(()=>this.sizeOf(e,a(r),n),"$count"):0},tryCatch:i,tryDoc:o,PartialReadError:class extends s{constructor(e){super(e),this.partialReadError=!0}}}},function(e,t,r){"use strict";function a(e,t,r){var a=r?" !== ":" === ",n=r?" || ":" && ",i=r?"!":"",o=r?"":"!";switch(e){case"null":return t+a+"null";case"array":return i+"Array.isArray("+t+")";case"object":return"("+i+t+n+"typeof "+t+a+'"object"'+n+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+a+'"number"'+n+o+"("+t+" % 1)"+n+t+a+t+")";default:return"typeof "+t+a+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:a,checkDataTypes:function(e,t){switch(e.length){case 1:return a(e[0],t,!0);default:var r="",n=i(e);for(var o in n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)r+=(r?" && ":"")+a(o,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],a=0;a=t)throw new Error("Cannot access property/index "+a+" levels up, current level is "+t);return r[t-a]}if(a>t)throw new Error("Cannot access data "+a+" levels up, current level is "+t);if(i="data"+(t-a||""),!n)return i}for(var s=i,u=n.split("/"),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,n,o,s;if("string"==typeof t&&(n="not ",t.substr(!o||o<0?0:+o,n.length)===n)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(a," ").concat(i(t,"type"));else{var l=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(a," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var n=r(70),i=r(74);r(6)(u,n);for(var o=a(i.prototype),s=0;s0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function f(){for(var e=[],t=0;t0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=n[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=m(l,u);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;a--)this.removeListener(e,t[a]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(7).Buffer)},function(e){e.exports=JSON.parse('{"i8":{"enum":["i8"]},"u8":{"enum":["u8"]},"i16":{"enum":["i16"]},"u16":{"enum":["u16"]},"i32":{"enum":["i32"]},"u32":{"enum":["u32"]},"f32":{"enum":["f32"]},"f64":{"enum":["f64"]},"li8":{"enum":["li8"]},"lu8":{"enum":["lu8"]},"li16":{"enum":["li16"]},"lu16":{"enum":["lu16"]},"li32":{"enum":["li32"]},"lu32":{"enum":["lu32"]},"lf32":{"enum":["lf32"]},"lf64":{"enum":["lf64"]},"i64":{"enum":["i64"]},"li64":{"enum":["li64"]},"u64":{"enum":["u64"]},"lu64":{"enum":["lu64"]}}')},function(module,exports,__webpack_require__){ /*! * The three.js expansion library v0.92.0 * Collected by Jusfoun Visualization Department @@ -28,24 +28,24 @@ var a=r(103),n=r(104),i=r(53);function o(){return l.TYPED_ARRAY_SUPPORT?21474836 * The three.js LICENSE * http://threejs.org/license */ -!function(e,t){for(var r in t)e[r]=t[r]}(exports,function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){e.exports=__webpack_require__(0)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1};Object.assign(a.prototype,{setSize:function(e,t){},render:function(e,t,r,a,n){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(1),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t){o.default.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof n.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=n.UniformsUtils.clone(e.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new n.Scene,this.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)}}),t.default=s},function(e,t,r){!function(e){"use strict";function t(){}function r(e,r){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===r||r,this.encoder=new t}function a(){}function n(){}t.prototype.s2u=function(e){for(var t=this.s2uTable,r="",a=0;a=0&&n<=126||n>=161&&n<=223)&&a0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},a.prototype={constructor:a,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],a=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=a}},n.prototype.parsePmd=function(e,t){var a,n={},i=new r(e);return n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left",function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),function(){var e,t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r0&&(a.englishModelName=i.getSjisStringsAsUnicode(20),a.englishComment=i.getSjisStringsAsUnicode(256)),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneNames=[];for(var t=0;t=2.0 are supported. Use LegacyGLTFLoader instead.")):(m.extensionsUsed&&(m.extensionsUsed.indexOf(r.KHR_LIGHTS)>=0&&(p[r.KHR_LIGHTS]=new i(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_UNLIT)>=0&&(p[r.KHR_MATERIALS_UNLIT]=new o(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(p[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new h),m.extensionsUsed.indexOf(r.KHR_DRACO_MESH_COMPRESSION)>=0&&(p[r.KHR_DRACO_MESH_COMPRESSION]=new f(this.dracoLoader)),m.extensionsUsed.indexOf(r.MSFT_TEXTURE_DDS)>=0&&(p[r.MSFT_TEXTURE_DDS]=new n)),new U(m,p,{path:t||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse((function(e,t,r,a,n){l({scene:e,scenes:t,cameras:r,animations:a,asset:n})}),u))}};var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(){if(!a.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=new a.DDSLoader}function i(e){this.name=r.KHR_LIGHTS,this.lights={};var t=(e.extensions&&e.extensions[r.KHR_LIGHTS]||{}).lights||{};for(var n in t){var i,o=t[n],s=(new a.Color).fromArray(o.color);switch(o.type){case"directional":(i=new a.DirectionalLight(s)).target.position.set(0,0,1),i.add(i.target);break;case"point":i=new a.PointLight(s);break;case"spot":i=new a.SpotLight(s),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;case"ambient":i=new a.AmbientLight(s)}i&&(i.decay=2,void 0!==o.intensity&&(i.intensity=o.intensity),i.name=o.name||"light_"+n,this.lights[n]=i)}}function o(e){this.name=r.KHR_MATERIALS_UNLIT}o.prototype.getMaterialType=function(e){return a.MeshBasicMaterial},o.prototype.extendParams=function(e,t,r){var n=[];e.color=new a.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var o=i.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture.index))}return Promise.all(n)};var s="glTF",l=12,u={JSON:1313821514,BIN:5130562};function c(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,l);if(this.header={magic:a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,l),i=0;i",s).replace("#include ",l).replace("#include ",u).replace("#include ",c).replace("#include ",f);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new a.Color).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=h,e.uniforms=o,e.defines={STANDARD:""},e.color=new a.Color(1,1,1),e.opacity=1;var d=[];if(Array.isArray(n.diffuseFactor)){var p=n.diffuseFactor;e.color.fromArray(p),e.opacity=p[3]}if(void 0!==n.diffuseTexture&&d.push(r.assignTexture(e,"map",n.diffuseTexture.index)),e.emissive=new a.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new a.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var m=n.specularGlossinessTexture.index;d.push(r.assignTexture(e,"glossinessMap",m)),d.push(r.assignTexture(e,"specularMap",m))}return Promise.all(d)},createMaterial:function(e){var t=new a.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var r=this.specularGlossinessParams,a=0,n=r.length;a=2&&(n[i+1]=e.getY(i)),r>=3&&(n[i+2]=e.getZ(i)),r>=4&&(n[i+3]=e.getW(i));return new a.BufferAttribute(n,r,e.normalized)}return e.clone()}function U(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new t,this.primitiveCache=[],this.textureLoader=new a.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function j(e,t,r){var a=t.attributes;for(var n in a){var i=T[n],o=r[a[n]];i&&(i in e.attributes||e.addAttribute(i,o))}void 0===t.indices||e.index||e.setIndex(r[t.indices])}return U.prototype.parse=function(e,t){var r=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then((function(t){var a=t.scenes||[],n=a[r.scene||0],i=t.animations||[],o=r.asset,s=t.cameras||[];e(n,a,s,i,o)})).catch(t)},U.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},i=0,o=t.length;i=2&&o.setY(T,A[E*l+1]),l>=3&&o.setZ(T,A[E*l+2]),l>=4&&o.setW(T,A[E*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},U.prototype.loadTexture=function(e){var t,n=this,i=this.json,o=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=i.textures[e],c=u.extensions||{},f=(t=c[r.MSFT_TEXTURE_DDS]?i.images[c[r.MSFT_TEXTURE_DDS].source]:i.images[u.source]).uri,h=!1;return void 0!==t.bufferView&&(f=n.getDependency("bufferView",t.bufferView).then((function(e){h=!0;var r=new Blob([e],{type:t.mimeType});return f=l.createObjectURL(r)}))),Promise.resolve(f).then((function(e){var t=a.Loader.Handlers.get(e);return t||(t=c[r.MSFT_TEXTURE_DDS]?n.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(r,a){t.load(k(e,o.path),r,void 0,a)}))})).then((function(e){!0===h&&l.revokeObjectURL(f),e.flipY=!1,void 0!==u.name&&(e.name=u.name),c[r.MSFT_TEXTURE_DDS]||(e.format=void 0!==u.format?E[u.format]:a.RGBAFormat),void 0!==u.internalFormat&&e.format!==E[u.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==u.type?S[u.type]:a.UnsignedByteType;var t=(i.samplers||{})[u.sampler]||{};return e.magFilter=_[t.magFilter]||a.LinearFilter,e.minFilter=_[t.minFilter]||a.LinearMipMapLinearFilter,e.wrapS=A[t.wrapS]||a.RepeatWrapping,e.wrapT=A[t.wrapT]||a.RepeatWrapping,e}))},U.prototype.assignTexture=function(e,t,r){return this.getDependency("texture",r).then((function(r){e[t]=r}))},U.prototype.loadMaterial=function(e){this.json;var t,n=this.extensions,i=this.json.materials[e],o={},s=i.extensions||{},l=[];if(s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(i),l.push(u.extendParams(o,i,this))}else if(s[r.KHR_MATERIALS_UNLIT]){var c=n[r.KHR_MATERIALS_UNLIT];t=c.getMaterialType(i),l.push(c.extendParams(o,i,this))}else{t=a.MeshStandardMaterial;var f=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(f.baseColorFactor)){var h=f.baseColorFactor;o.color.fromArray(h),o.opacity=h[3]}if(void 0!==f.baseColorTexture&&l.push(this.assignTexture(o,"map",f.baseColorTexture.index)),o.metalness=void 0!==f.metallicFactor?f.metallicFactor:1,o.roughness=void 0!==f.roughnessFactor?f.roughnessFactor:1,void 0!==f.metallicRoughnessTexture){var d=f.metallicRoughnessTexture.index;l.push(this.assignTexture(o,"metalnessMap",d)),l.push(this.assignTexture(o,"roughnessMap",d))}}!0===i.doubleSided&&(o.side=a.DoubleSide);var p=i.alphaMode||O;return p===C?o.transparent=!0:(o.transparent=!1,p===L&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"normalMap",i.normalTexture.index)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale&&o.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"aoMap",i.occlusionTexture.index)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==a.MeshBasicMaterial&&l.push(this.assignTexture(o,"emissiveMap",i.emissiveTexture.index)),Promise.all(l).then((function(){var e;return e=t===a.ShaderMaterial?n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==i.name&&(e.name=i.name),e.normalScale&&(e.normalScale.y=-e.normalScale.y),e.map&&(e.map.encoding=a.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=a.sRGBEncoding),i.extras&&(e.userData=i.extras),e}))},U.prototype.loadGeometries=function(e){var t=this,n=this.extensions,i=this.primitiveCache;return this.getDependencies("accessor").then((function(o){for(var s=[],l=0,u=e.length;l1))return _;_.name+="_"+c,s.add(_)}return s}))}))},U.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new a.PerspectiveCamera(a.Math.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new a.OrthographicCamera(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar)),void 0!==r.name&&(t.name=r.name),r.extras&&(t.userData=r.extras),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},U.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},U.prototype.loadAnimation=function(e){this.json;var t=this.json.animations[e];return this.getMultiDependencies(["accessor","node"]).then((function(r){for(var n=[],i=0,o=t.channels.length;i1&&(s.name+="_instance_"+i[o.mesh]++)}else if(void 0!==o.camera)s=e.cameras[o.camera];else if(o.extensions&&o.extensions[r.KHR_LIGHTS]&&void 0!==o.extensions[r.KHR_LIGHTS].light){s=t[r.KHR_LIGHTS].lights[o.extensions[r.KHR_LIGHTS].light]}else s=new a.Object3D;if(void 0!==o.name&&(s.name=a.PropertyBinding.sanitizeNodeName(o.name)),o.extras&&(s.userData=o.extras),void 0!==o.matrix){var h=new a.Matrix4;h.fromArray(o.matrix),s.applyMatrix(h)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return s}))},U.prototype.loadScene=function(){function e(t,r,n,i,o){var s=i[t],l=n.nodes[t];if(void 0!==l.skin)for(var u=!0===s.isGroup?s.children:[s],c=0,f=u.length;c(n=s.indexOf("\n"))&&i=e.byteLength||!(a=r(e)))return t(1,"no header found");if(!(n=a.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(u.valid|=1,u.programtype=n[1],u.string+=a+"\n";!1!==(a=r(e));)if(u.string+=a+"\n","#"!==a.charAt(0)){if((n=a.match(i))&&(u.gamma=parseFloat(n[1],10)),(n=a.match(o))&&(u.exposure=parseFloat(n[1],10)),(n=a.match(s))&&(u.valid|=2,u.format=n[1]),(n=a.match(l))&&(u.valid|=4,u.height=parseInt(n[1],10),u.width=parseInt(n[2],10)),2&u.valid&&4&u.valid)break}else u.comments+=a+"\n";return 2&u.valid?4&u.valid?u:t(3,"missing image size specifier"):t(3,"missing format specifier")}(n);if(-1!==i){var o=i.width,s=i.height,l=function(e,r,a){var n,i,o,s,l,u,c,f,h,d,p,m,v,g=r,y=a;if(g<8||g>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(g!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(n=new Uint8Array(4*r*a))||!n.length)return t(4,"unable to allocate buffer space");for(i=0,o=0,f=4*g,v=new Uint8Array(4),u=new Uint8Array(f);y>0&&oe.byteLength)return t(1);if(v[0]=e[o++],v[1]=e[o++],v[2]=e[o++],v[3]=e[o++],2!=v[0]||2!=v[1]||(v[2]<<8|v[3])!=g)return t(3,"bad rgbe scanline format");for(c=0;c128)&&(s-=128),0===s||c+s>f)return t(3,"bad scanline data");if(m)for(l=e[o++],h=0;h0){var x=[];for(var w in v)d=v[w],x[w]=d.name;m="Adding mesh(es) ("+x.length+": "+x+") from input mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)"}else m="Not adding mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)";var _=this.callbacks.onProgress;t.isValid(_)&&_(new CustomEvent("MeshBuilderEvent",{detail:{type:"progress",modelName:e.params.meshName,text:m,numericalValue:e.progress.numericalValue}}));return v},r.prototype.updateMaterials=function(e){var r,a,i=e.materials.materialCloneInstructions;if(t.isValid(i)){var o=i.materialNameOrg,s=this.materials[o];if(t.isValid(o)){r=s.clone(),a=i.materialName,r.name=a;var l=i.materialProperties;for(var u in l)r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&(r[u]=l[u]);this.materials[a]=r}else console.warn('Requested material "'+o+'" is not available!')}var c=e.materials.serializedMaterials;if(t.isValid(c)&&Object.keys(c).length>0){var f,h=new n.MaterialLoader;for(a in c)f=c[a],t.isValid(f)&&(r=h.parse(f),this.logging.enabled&&console.info('De-serialized material with name "'+a+'" will be added.'),this.materials[a]=r)}if(c=e.materials.runtimeMaterials,t.isValid(c)&&Object.keys(c).length>0)for(a in c)r=c[a],this.logging.enabled&&console.info('Material with name "'+a+'" will be added.'),this.materials[a]=r},r.prototype.getMaterialsJSON=function(){var e,t={};for(var r in this.materials)e=this.materials[r],t[r]=e.toJSON();return t},r.prototype.getMaterials=function(){return this.materials},r}(),s.WorkerRunnerRefImpl=function(){function e(){var e=this;self.addEventListener("message",(function(t){e.processMessage(t.data)}),!1)}return e.prototype.applyProperties=function(e,t){var r,a,n;for(r in t)a="set"+r.substring(0,1).toLocaleUpperCase()+r.substring(1),n=t[r],"function"==typeof e[a]?e[a](n):e.hasOwnProperty(r)&&(e[r]=n)},e.prototype.processMessage=function(e){if("run"===e.cmd){var t={callbackMeshBuilder:function(e){self.postMessage(e)},callbackProgress:function(t){e.logging.enabled&&e.logging.debug&&console.debug("WorkerRunner: progress: "+t)}},r=new Parser;"function"==typeof r.setLogging&&r.setLogging(e.logging.enabled,e.logging.debug),this.applyProperties(r,e.params),this.applyProperties(r,e.materials),this.applyProperties(r,t),r.workerScope=self,r.parse(e.data.input,e.data.options),e.logging.enabled&&console.log("WorkerRunner: Run complete!"),t.callbackMeshBuilder({cmd:"complete",msg:"WorkerRunner completed run."})}else console.error("WorkerRunner: Received unknown command: "+e.cmd)},e}(),s.WorkerSupport=function(){var e="2.2.0",t=s.Validator,r=function(){function e(){this._reset()}return e.prototype._reset=function(){this.logging={enabled:!0,debug:!1},this.worker=null,this.runnerImplName=null,this.callbacks={meshBuilder:null,onLoad:null},this.terminateRequested=!1,this.queuedMessage=null,this.started=!1,this.forceCopy=!1},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.setForceCopy=function(e){this.forceCopy=!0===e},e.prototype.initWorker=function(e,t){this.runnerImplName=t;var r=new Blob([e],{type:"application/javascript"});this.worker=new Worker(o.URL.createObjectURL(r)),this.worker.onmessage=this._receiveWorkerMessage,this.worker.runtimeRef=this,this._postMessage()},e.prototype._receiveWorkerMessage=function(e){var t=e.data;switch(t.cmd){case"meshData":case"materialData":case"imageData":this.runtimeRef.callbacks.meshBuilder(t);break;case"complete":this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run is complete. Terminating application on request!"),this.runtimeRef._terminate());break;case"error":console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Reported error: "+t.msg),this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run reported error. Terminating application on request!"),this.runtimeRef._terminate());break;default:console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Received unknown command: "+t.cmd)}},e.prototype.setCallbacks=function(e,r){this.callbacks.meshBuilder=t.verifyInput(e,this.callbacks.meshBuilder),this.callbacks.onLoad=t.verifyInput(r,this.callbacks.onLoad)},e.prototype.run=function(e){if(t.isValid(this.queuedMessage))console.warn("Already processing message. Rejecting new run instruction");else{if(this.queuedMessage=e,this.started=!0,!t.isValid(this.callbacks.meshBuilder))throw'Unable to run as no "MeshBuilder" callback is set.';if(!t.isValid(this.callbacks.onLoad))throw'Unable to run as no "onLoad" callback is set.';"run"!==e.cmd&&(e.cmd="run"),t.isValid(e.logging)?(e.logging.enabled=!0===e.logging.enabled,e.logging.debug=!0===e.logging.debug):e.logging={enabled:!0,debug:!1},this._postMessage()}},e.prototype._postMessage=function(){var e;t.isValid(this.queuedMessage)&&t.isValid(this.worker)&&(this.queuedMessage.data.input instanceof ArrayBuffer?(e=this.forceCopy?this.queuedMessage.data.input.slice(0):this.queuedMessage.data.input,this.worker.postMessage(this.queuedMessage,[e])):this.worker.postMessage(this.queuedMessage))},e.prototype.setTerminateRequested=function(e){this.terminateRequested=!0===e,this.terminateRequested&&t.isValid(this.worker)&&!t.isValid(this.queuedMessage)&&this.started&&(this.logging.enabled&&console.info("Worker is terminated immediately as it is not running!"),this._terminate())},e.prototype._terminate=function(){this.worker.terminate(),this._reset()},e}();function a(){if(console.info("Using THREE.LoaderSupport.WorkerSupport version: "+e),this.logging={enabled:!0,debug:!1},void 0===o.Worker)throw"This browser does not support web workers!";if(void 0===o.Blob)throw"This browser does not support Blob!";if("function"!=typeof o.URL.createObjectURL)throw"This browser does not support Object creation from URL!";this.loaderWorker=new r}a.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t,this.loaderWorker.setLogging(this.logging.enabled,this.logging.debug)},a.prototype.setForceWorkerDataCopy=function(e){this.loaderWorker.setForceCopy(e)},a.prototype.validate=function(e,r,a,o,u){if(!t.isValid(this.loaderWorker.worker)){this.logging.enabled&&(console.info("WorkerSupport: Building worker code..."),console.time("buildWebWorkerCode")),t.isValid(u)?this.logging.enabled&&console.info('WorkerSupport: Using "'+u.name+'" as Runner class for worker.'):(u=s.WorkerRunnerRefImpl,this.logging.enabled&&console.info('WorkerSupport: Using DEFAULT "THREE.LoaderSupport.WorkerRunnerRefImpl" as Runner class for worker.'));var c=e(i,l);c+="var Parser = "+r+";\n\n",c+=l(u.name,u),c+="new "+u.name+"();\n\n";var f=this;if(t.isValid(a)&&a.length>0){var h="";!function e(t,r){if(0===r.length)f.loaderWorker.initWorker(h+c,u.name),f.logging.enabled&&console.timeEnd("buildWebWorkerCode");else{var a=new n.FileLoader;a.setPath(t),a.setResponseType("text"),a.load(r[0],(function(a){h+=a,e(t,r)})),r.shift()}}(o,a)}else this.loaderWorker.initWorker(c,u.name),this.logging.enabled&&console.timeEnd("buildWebWorkerCode")}},a.prototype.setCallbacks=function(e,t){this.loaderWorker.setCallbacks(e,t)},a.prototype.run=function(e){this.loaderWorker.run(e)},a.prototype.setTerminateRequested=function(e){this.loaderWorker.setTerminateRequested(e)};var i=function(e,t){var r,a=e+" = {\n";for(var n in t)"string"==typeof(r=t[n])||r instanceof String?a+="\t"+n+': "'+(r=(r=r.replace("\n","\\n")).replace("\r","\\r"))+'",\n':r instanceof Array?a+="\t"+n+": ["+r+"],\n":Number.isInteger(r)?a+="\t"+n+": "+r+",\n":"function"==typeof r&&(a+="\t"+n+": "+r+",\n");return a+="}\n\n"},l=function(e,r,a,n,i){var o,s,l="",u=t.isValid(a)?a:r.name;for(var c in i=t.verifyInput(i,[]),r.prototype)o=r.prototype[c],"constructor"===c?s="\tfunction "+u+o.toString().replace("function","")+";\n\n":"function"==typeof o&&i.indexOf(c)<0&&(l+="\t"+u+".prototype."+c+" = "+o.toString()+";\n\n");l+="\treturn "+u+";\n",l+="})();\n\n";var f="";return t.isValid(n)&&(f+="\n",f+=u+".prototype = Object.create( "+n+".prototype );\n",f+=u+".constructor = "+u+";\n",f+="\n"),t.isValid(s)?l=e+" = (function () {\n\n"+f+s+l:(s=e+" = (function () {\n\n",l=(s+=f+"\t"+r.prototype.constructor.toString()+"\n\n")+l),l};return a}(),s.WorkerDirector=function(){var e="2.2.0",t=s.Validator,r=16,a=8192;function i(n){if(console.info("Using THREE.LoaderSupport.WorkerDirector version: "+e),this.logging={enabled:!0,debug:!1},this.maxQueueSize=a,this.maxWebWorkers=r,this.crossOrigin=null,!t.isValid(n))throw"Provided invalid classDef: "+n;this.workerDescription={classDef:n,globalCallbacks:{},workerSupports:{},forceWorkerDataCopy:!0},this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0,this.callbackOnFinishedProcessing=null}return i.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},i.prototype.getMaxQueueSize=function(){return this.maxQueueSize},i.prototype.getMaxWebWorkers=function(){return this.maxWebWorkers},i.prototype.setCrossOrigin=function(e){this.crossOrigin=e},i.prototype.setForceWorkerDataCopy=function(e){this.workerDescription.forceWorkerDataCopy=!0===e},i.prototype.prepareWorkers=function(e,i,o){t.isValid(e)&&(this.workerDescription.globalCallbacks=e),this.maxQueueSize=Math.min(i,a),this.maxWebWorkers=Math.min(o,r),this.maxWebWorkers=Math.min(this.maxWebWorkers,this.maxQueueSize),this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0;for(var s=0;s0&&this.instructionQueuePointer0},i.prototype.processQueue=function(){var e,t;for(var r in this.workerDescription.workerSupports)(t=this.workerDescription.workerSupports[r]).inUse||(this.instructionQueuePointer=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},i[c]=r;else if(r)if("ka"===u||"kd"===u||"ks"===u){var f=c.split(a,3);r[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else r[u]=c}}var h=new n.MaterialCreator(this.texturePath||this.path,this.materialOptions);return h.setCrossOrigin(this.crossOrigin),h.setManager(this.manager),h.setMaterials(i),h}},(n.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:a.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:a.RepeatWrapping}).prototype={constructor:n.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var r in e){var a=e[r],n={};for(var i in t[r]=n,a){var o=!0,s=a[i],l=i.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(n[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,r=this.materialsInfo[e],n={name:e,side:this.side};function i(e,r){if(!n[e]){var a,i,o=t.getTextureParams(r,n),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(i=o.url)||""===i?"":/^https?:\/\//i.test(i)?i:a+i));s.repeat.copy(o.scale),s.offset.copy(o.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,n[e]=s}}for(var o in r){var s,l=r[o];if(""!==l)switch(o.toLowerCase()){case"kd":n.color=(new a.Color).fromArray(l);break;case"ks":n.specular=(new a.Color).fromArray(l);break;case"map_kd":i("map",l);break;case"map_ks":i("specularMap",l);break;case"norm":i("normalMap",l);break;case"map_bump":case"bump":i("bumpMap",l);break;case"ns":n.shininess=parseFloat(l);break;case"d":(s=parseFloat(l))<1&&(n.opacity=s,n.transparent=!0);break;case"tr":s=parseFloat(l),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var r,n={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},i=e.split(/\s+/);return(r=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),(r=i.indexOf("-s"))>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),(r=i.indexOf("-o"))>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n},loadTexture:function(e,t,r,n,i){var o,s=a.Loader.Handlers.get(e),l=void 0!==this.manager?this.manager:a.DefaultLoadingManager;return null===s&&(s=new a.TextureLoader(l)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,r,n,i),void 0!==t&&(o.mapping=t),o}},t.default=n},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _three=__webpack_require__(0),THREE=_interopRequireWildcard(_three);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var Volume=function(e,t,r,a,n){if(arguments.length>0){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,a){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(n);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(n);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(n);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(n);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(n);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(n);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw"Error in THREE.Volume constructor : this type is not supported in JavaScript";case"Float32":case"float32":case"float":this.data=new Float32Array(n);break;case"Float64":case"float64":case"double":this.data=new Float64Array(n);break;default:this.data=new Uint8Array(n)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw"Error in THREE.Volume constructor, lengths are not matching arrayBuffer size"}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new THREE.Matrix3,this.matrix.identity();var i=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return i},set:function(e){i=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});var o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[]};Volume.prototype={constructor:Volume,getData:function(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]},access:function(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e},reverseAccess:function(e){var t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]},map:function(e,t){var r=this.data.length;t=t||this;for(var a=0;a.9})),jDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[1]))>.9})),kDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[2]))>.9})),argumentsWithInversion=["volume.xLength-1-","volume.yLength-1-","volume.zLength-1-"],argArray=[iDirection,jDirection,kDirection].map((function(e,t){return(e.dot(base[t])>0?"":argumentsWithInversion[t])+(e===axisInIJK?"IJKIndex":e.argVar)})),argString=argArray.join(",");return sliceAccess=eval("(function sliceAccess (i,j) {return volume.access( "+argString+");})"),{iLength:iLength,jLength:jLength,sliceAccess:sliceAccess,matrix:planeMatrix,planeWidth:planeWidth,planeHeight:planeHeight}},extractSlice:function(e,t){var r=new THREE.VolumeSlice(this,t,e);return this.sliceList.push(r),r},repaintAllSlices:function(){return this.sliceList.forEach((function(e){e.repaint()})),this},computeMinMax:function(){var e=1/0,t=-1/0,r=this.data.length,a=0;for(a=0;a","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","float l = linearToRelativeLuminance( texel.rgb );","gl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","uniform sampler2D luminanceMap;","#else","uniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","#ifdef ADAPTED_LUMINANCE","float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","#else","float fLumAvg = averageLuminance;","#endif","float fLumPixel = linearToRelativeLuminance( vColor );","float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","return fLumCompressed * vColor;","}","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-e*e/(2*t*t))}var r,a,n,i,o=2*Math.ceil(3*e)+1;for(o>25&&(o=25),i=.5*(o-1),a=new Array(o),n=0,r=0;r","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","vec2 aspectcorrect = vec2( 1.0, aspect );","float viewZ = getViewZ( getDepth( vUv ) );","float factor = ( focus + viewZ );","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},tSize:{value:new a.Vector2(256,256)},center:{value:new a.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float dx = rand( vUv + time );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","if(byp<1) {","vec2 p = vUv;","float xs = floor(gl_FragCoord.x / 0.5);","float ys = floor(gl_FragCoord.y / 0.5);","vec4 normal = texture2D (tDisp, p*seed*seed);","if(p.ydistortion_x-col_s*seed) {","if(seed_x>0.){","p.y = 1. - (p.y + distortion_y);","}","else {","p.y = distortion_y;","}","}","if(p.xdistortion_y-col_s*seed) {","if(seed_y>0.){","p.x=distortion_x;","}","else {","p.x = 1. - (p.x + distortion_x);","}","}","p.x+=normal.x*seed_x*(seed/5.);","p.y+=normal.y*seed_y*(seed/5.);","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, p + offset);","vec4 cga = texture2D(tDiffuse, p);","vec4 cb = texture2D(tDiffuse, p - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","gl_FragColor = gl_FragColor+ snow;","}","else {","gl_FragColor=texture2D (tDiffuse, vUv);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","vUV = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","return a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","return sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","float dist = hypot( coord.x - p.x, coord.y - p.y );","float rad = channel;","if ( shape == SHAPE_DOT ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","} else if ( shape == SHAPE_ELLIPSE ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","if ( dist != 0.0 ) {","float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","}","} else if ( shape == SHAPE_LINE ) {","rad = pow( abs( rad ), 1.5) * rad_max;","float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","dist = hypot( normal.x * dot_p, normal.y * dot_p );","} else if ( shape == SHAPE_SQUARE ) {","float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","float sin_t = abs( sin( theta ) );","float cos_t = abs( cos( theta ) );","rad = pow( abs( rad ), 1.4 );","rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","}","return rad - dist;","}","struct Cell {","vec2 normal;","vec2 p1;","vec2 p2;","vec2 p3;","vec2 p4;","float samp2;","float samp1;","float samp3;","float samp4;","};","vec4 getSample( vec2 point ) {","vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","float step = PI2 / float( samples );","float dist = radius * 0.66;","for ( int i = 0; i < samples; ++i ) {","float r = base + step * float( i );","vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","}","tex /= float( samples ) + 1.0;","return tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","if ( channel == 0 ) {","c.samp1 = getSample( c.p1 ).r;","c.samp2 = getSample( c.p2 ).r;","c.samp3 = getSample( c.p3 ).r;","c.samp4 = getSample( c.p4 ).r;","} else if (channel == 1) {","c.samp1 = getSample( c.p1 ).g;","c.samp2 = getSample( c.p2 ).g;","c.samp3 = getSample( c.p3 ).g;","c.samp4 = getSample( c.p4 ).g;","} else {","c.samp1 = getSample( c.p1 ).b;","c.samp3 = getSample( c.p3 ).b;","c.samp2 = getSample( c.p2 ).b;","c.samp4 = getSample( c.p4 ).b;","}","dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","res = clamp( res, 0.0, 1.0 );","return res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","Cell c;","vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","float threshold = step * 0.5;","float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","float offset_normal = mod( hypot( offset.x, offset.y ), step );","float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","c.normal = n;","c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","if ( scatter != 0.0 ) {","float off_mag = scatter * threshold * 0.5;","float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","c.p1.x += cos( off_angle ) * off_mag;","c.p1.y += sin( off_angle ) * off_mag;","}","float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","c.p2.x = c.p1.x - n.x * normal_step;","c.p2.y = c.p1.y - n.y * normal_step;","c.p3.x = c.p1.x + n.y * line_step;","c.p3.y = c.p1.y - n.x * line_step;","c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","return c;","}","float blendColour( float a, float b, float t ) {","if ( blendingMode == BLENDING_LINEAR ) {","return blend( a, b, 1.0 - t );","} else if ( blendingMode == BLENDING_ADD ) {","return blend( a, min( 1.0, a + b ), t );","} else if ( blendingMode == BLENDING_MULTIPLY ) {","return blend( a, max( 0.0, a * b ), t );","} else if ( blendingMode == BLENDING_LIGHTER ) {","return blend( a, max( a, b ), t );","} else if ( blendingMode == BLENDING_DARKER ) {","return blend( a, min( a, b ), t );","} else {","return blend( a, b, 1.0 - t );","}","}","void main() {","if ( ! disable ) {","vec2 p = vec2( vUV.x * width, vUV.y * height );","vec2 origin = vec2( 0, 0 );","float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","Cell cell_r = getReferenceCell( p, origin, rotateR, radius );","Cell cell_g = getReferenceCell( p, origin, rotateG, radius );","Cell cell_b = getReferenceCell( p, origin, rotateB, radius );","float r = getDotColour( cell_r, p, 0, rotateR, aa );","float g = getDotColour( cell_g, p, 1, rotateG, aa );","float b = getDotColour( cell_b, p, 2, rotateB, aa );","vec4 colour = texture2D( tDiffuse, vUV );","r = blendColour( r, colour.r, blending );","g = blendColour( g, colour.g, blending );","b = blendColour( b, colour.b, blending );","if ( greyscale ) {","r = g = b = (r + b + g) / 3.0;","}","gl_FragColor = vec4( r, g, b, 1.0 );","} else {","gl_FragColor = texture2D( tDiffuse, vUV );","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{type:"t",value:null},tDiffuse:{type:"t",value:null},tNormal:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},cameraProjectionMatrix:{type:"m4",value:new a.Matrix4},cameraInverseProjectionMatrix:{type:"m4",value:new a.Matrix4},scale:{type:"f",value:1},intensity:{type:"f",value:.1},bias:{type:"f",value:.5},minResolution:{type:"f",value:0},kernelRadius:{type:"f",value:100},randomSeed:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},sampleUvOffsets:{type:"v2v",value:[new a.Vector2(0,0)]},sampleWeights:{type:"1fv",value:[1]},tDepth:{type:"t",value:null},cameraNear:{type:"f",value:10},cameraFar:{type:"f",value:1e3},depthCutoff:{type:"f",value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","float depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={createSampleWeights:function(e,t){for(var r=function(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)},a=[],n=0;n<=e;n++)a.push(r(n,t));return a},createSampleOffsets:function(e,t){for(var r=[],a=0;a<=e;a++)r.push(t.clone().multiplyScalar(a));return r},configure:function(e,t,r,n){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=a.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=a.createSampleWeights(t,r),e.needsUpdate=!0}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","t = abs( C - Ctop );","delta.y = max( max( t.r, t.g ), t.b );","vec2 edges = step( threshold, delta.xy );","if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){n.default.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==o?o:0,void 0===i.default&&console.error("THREE.SSAARenderPass relies on THREE.CopyShader");var s=i.default;this.copyUniforms=a.UniformsUtils.clone(s.uniforms),this.copyMaterial=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.camera2=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene2=new a.Scene,this.quad2=new a.Mesh(new a.PlaneBufferGeometry(2,2),this.copyMaterial),this.quad2.frustumCulled=!1,this.scene2.add(this.quad2)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var n=s.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1;var o=e.getClearColor().getHex(),l=e.getClearAlpha(),u=1/n.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;for(var c=r.width,f=r.height,h=0;h","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );","float gg = fract( coord.t * ( size.y / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float readDepth( const in vec2 coord ) {","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","#ifdef USE_LOGDEPTHBUF","float logz = unpackRGBAToDepth( texture2D( tDepth, coord ) );","float w = pow(2.0, (logz / logDepthBufFC)) - 1.0;","float z = (logz / w) + 1.0;","#else","float z = unpackRGBAToDepth( texture2D( tDepth, coord ) );","#endif","return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 8.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + radius * vv;","vec2 coord2 = vUv - radius * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float ao = 0.0;","float dz = 1.0 / float( samples );","float l = 0.0;","float z = 1.0 - dz / 2.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","float pw = cos( l ) * r;","float ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{type:"t",value:null},luminosityThreshold:{type:"f",value:1},smoothWidth:{type:"f",value:1},defaultColor:{type:"c",value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(0)},defaultOpacity:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","gl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var n=r(40);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}));var i=r(48);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}));var o=r(90);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}));var s=r(112);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})}));var l=r(144);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VRControls=t.TransformControls=t.TrackballControls=t.PointerLockControls=t.OrthographicTrackballControls=t.OrbitControls=t.FlyControls=t.FirstPersonControls=t.EditorControls=t.DragControls=t.DeviceOrientationControls=void 0;var a=p(r(29)),n=p(r(30)),i=p(r(31)),o=p(r(32)),s=p(r(33)),l=p(r(34)),u=p(r(35)),c=p(r(36)),f=p(r(37)),h=p(r(38)),d=p(r(39));function p(e){return e&&e.__esModule?e:{default:e}}t.DeviceOrientationControls=a.default,t.DragControls=n.default,t.EditorControls=i.default,t.FirstPersonControls=o.default,t.FlyControls=s.default,t.OrbitControls=l.default,t.OrthographicTrackballControls=u.default,t.PointerLockControls=c.default,t.TrackballControls=f.default,t.TransformControls=h.default,t.VRControls=d.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r,n,i,o,s=function(e){t.deviceOrientation=e},l=function(){t.screenOrientation=window.orientation||0},u=(r=new a.Vector3(0,0,1),n=new a.Euler,i=new a.Quaternion,o=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),function(e,t,a,s,l){n.set(a,t,-s,"YXZ"),e.setFromEuler(n),e.multiply(o),e.multiply(i.setFromAxisAngle(r,-l))});this.connect=function(){l(),window.addEventListener("orientationchange",l,!1),window.addEventListener("deviceorientation",s,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",l,!1),window.removeEventListener("deviceorientation",s,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var r=e.alpha?a.Math.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?a.Math.degToRad(e.beta):0,i=e.gamma?a.Math.degToRad(e.gamma):0,o=t.screenOrientation?a.Math.degToRad(t.screenOrientation):0;u(t.object.quaternion,r,n,i,o)}}},this.dispose=function(){t.disconnect()},this.connect()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t,r){if(e instanceof a.Camera){console.warn("THREE.DragControls: Constructor now expects ( objects, camera, domElement )");var n=e;e=t,t=n}var i=new a.Plane,o=new a.Raycaster,s=new a.Vector2,l=new a.Vector3,u=new a.Vector3,c=null,f=null,h=this;function d(){r.addEventListener("mousemove",m,!1),r.addEventListener("mousedown",v,!1),r.addEventListener("mouseup",g,!1),r.addEventListener("mouseleave",g,!1),r.addEventListener("touchmove",y,!1),r.addEventListener("touchstart",b,!1),r.addEventListener("touchend",w,!1)}function p(){r.removeEventListener("mousemove",m,!1),r.removeEventListener("mousedown",v,!1),r.removeEventListener("mouseup",g,!1),r.removeEventListener("mouseleave",g,!1),r.removeEventListener("touchmove",y,!1),r.removeEventListener("touchstart",b,!1),r.removeEventListener("touchend",w,!1)}function m(a){a.preventDefault();var n=r.getBoundingClientRect();if(s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t),c&&h.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void h.dispatchEvent({type:"drag",object:c});o.setFromCamera(s,t);var d=o.intersectObjects(e);if(d.length>0){var p=d[0].object;i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),p.position),f!==p&&(h.dispatchEvent({type:"hoveron",object:p}),r.style.cursor="pointer",f=p)}else null!==f&&(h.dispatchEvent({type:"hoveroff",object:f}),r.style.cursor="auto",f=null)}function v(a){a.preventDefault(),o.setFromCamera(s,t);var n=o.intersectObjects(e);n.length>0&&(c=n[0].object,o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",h.dispatchEvent({type:"dragstart",object:c}))}function g(e){e.preventDefault(),c&&(h.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}function y(e){e.preventDefault(),e=e.changedTouches[0];var a=r.getBoundingClientRect();if(s.x=(e.clientX-a.left)/a.width*2-1,s.y=-(e.clientY-a.top)/a.height*2+1,o.setFromCamera(s,t),c&&h.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void h.dispatchEvent({type:"drag",object:c})}function b(a){a.preventDefault(),a=a.changedTouches[0];var n=r.getBoundingClientRect();s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t);var f=o.intersectObjects(e);f.length>0&&(c=f[0].object,i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),c.position),o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",h.dispatchEvent({type:"dragstart",object:c}))}function w(e){e.preventDefault(),c&&(h.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}d(),this.enabled=!0,this.activate=d,this.deactivate=p,this.dispose=function(){p()},this.setObjects=function(){console.error("THREE.DragControls: setObjects() has been removed.")},this.on=function(e,t){console.warn("THREE.DragControls: on() has been deprecated. Use addEventListener() instead."),h.addEventListener(e,t)},this.off=function(e,t){console.warn("THREE.DragControls: off() has been deprecated. Use removeEventListener() instead."),h.removeEventListener(e,t)},this.notify=function(e){console.error("THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead."),h.dispatchEvent({type:e})}};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){t=void 0!==t?t:document,this.enabled=!0,this.center=new a.Vector3,this.panSpeed=.001,this.zoomSpeed=.001,this.rotationSpeed=.005;var r=this,n=new a.Vector3,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2},o=i.NONE,s=this.center,l=new a.Matrix3,u=new a.Vector2,c=new a.Vector2,f=new a.Spherical,h={type:"change"};function d(e){!1!==r.enabled&&(0===e.button?o=i.ROTATE:1===e.button?o=i.ZOOM:2===e.button&&(o=i.PAN),c.set(e.clientX,e.clientY),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",m,!1),t.addEventListener("mouseout",m,!1),t.addEventListener("dblclick",m,!1))}function p(e){if(!1!==r.enabled){u.set(e.clientX,e.clientY);var t=u.x-c.x,n=u.y-c.y;o===i.ROTATE?r.rotate(new a.Vector3(-t*r.rotationSpeed,-n*r.rotationSpeed,0)):o===i.ZOOM?r.zoom(new a.Vector3(0,0,n)):o===i.PAN&&r.pan(new a.Vector3(-t,n,0)),c.set(e.clientX,e.clientY)}}function m(e){t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),o=i.NONE}function v(e){e.preventDefault(),r.zoom(new a.Vector3(0,0,e.deltaY))}function g(e){e.preventDefault()}this.focus=function(t){var n,i=(new a.Box3).setFromObject(t);!1===i.isEmpty()?(s.copy(i.getCenter()),n=i.getBoundingSphere().radius):(s.setFromMatrixPosition(t.matrixWorld),n=.1);var o=new a.Vector3(0,0,1);o.applyQuaternion(e.quaternion),o.multiplyScalar(4*n),e.position.copy(s).add(o),r.dispatchEvent(h)},this.pan=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.panSpeed),t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),s.add(t),r.dispatchEvent(h)},this.zoom=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.zoomSpeed),t.length()>a||(t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),r.dispatchEvent(h))},this.rotate=function(t){n.copy(e.position).sub(s),f.setFromVector3(n),f.theta+=t.x,f.phi+=t.y,f.makeSafe(),n.setFromSpherical(f),e.position.copy(s).add(n),e.lookAt(s),r.dispatchEvent(h)},this.dispose=function(){t.removeEventListener("contextmenu",g,!1),t.removeEventListener("mousedown",d,!1),t.removeEventListener("wheel",v,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),t.removeEventListener("touchstart",x,!1),t.removeEventListener("touchmove",_,!1)},t.addEventListener("contextmenu",g,!1),t.addEventListener("mousedown",d,!1),t.addEventListener("wheel",v,!1);var y=[new a.Vector3,new a.Vector3,new a.Vector3],b=[new a.Vector3,new a.Vector3,new a.Vector3],w=null;function x(e){if(!1!==r.enabled){switch(e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0);break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0),w=y[0].distanceTo(y[1])}b[0].copy(y[0]),b[1].copy(y[1])}}function _(e){if(!1!==r.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0),r.rotate(y[0].sub(o(y[0],b)).multiplyScalar(-r.rotationSpeed));break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0);var t=y[0].distanceTo(y[1]);r.zoom(new a.Vector3(0,0,w-t)),w=t;var n=y[0].clone().sub(o(y[0],b)),i=y[1].clone().sub(o(y[1],b));n.x=-n.x,i.x=-i.x,r.pan(n.add(i).multiplyScalar(.5))}b[0].copy(y[0]),b[1].copy(y[1])}function o(e,t){var r=t[0];for(var a in t)r.distanceTo(e)>t[a].distanceTo(e)&&(r=t[a]);return r}}t.addEventListener("touchstart",x,!1),t.addEventListener("touchmove",_,!1)};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e){e.preventDefault()}this.object=e,this.target=new a.Vector3(0,0,0),this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.lookSpeed=.005,this.lookVertical=!0,this.autoForward=!1,this.activeLook=!0,this.heightSpeed=!1,this.heightCoef=1,this.heightMin=0,this.heightMax=1,this.constrainVertical=!1,this.verticalMin=0,this.verticalMax=Math.PI,this.autoSpeedFactor=0,this.mouseX=0,this.mouseY=0,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.moveForward=!1,this.moveBackward=!1,this.moveLeft=!1,this.moveRight=!1,this.mouseDragOn=!1,this.viewHalfX=0,this.viewHalfY=0,this.domElement!==document&&this.domElement.setAttribute("tabindex",-1),this.handleResize=function(){this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)},this.onMouseDown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0},this.onMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1},this.onMouseMove=function(e){this.domElement===document?(this.mouseX=e.pageX-this.viewHalfX,this.mouseY=e.pageY-this.viewHalfY):(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)},this.onKeyDown=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0}},this.onKeyUp=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}},this.update=function(e){if(!1!==this.enabled){if(this.heightSpeed){var t=a.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;var r=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(r+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(r),this.moveLeft&&this.object.translateX(-r),this.moveRight&&this.object.translateX(r),this.moveUp&&this.object.translateY(r),this.moveDown&&this.object.translateY(-r);var n=e*this.lookSpeed;this.activeLook||(n=0);var i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon+=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*i),this.lat=Math.max(-85,Math.min(85,this.lat)),this.phi=a.Math.degToRad(90-this.lat),this.theta=a.Math.degToRad(this.lon),this.constrainVertical&&(this.phi=a.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax));var o=this.target,s=this.object.position;o.x=s.x+100*Math.sin(this.phi)*Math.cos(this.theta),o.y=s.y+100*Math.cos(this.phi),o.z=s.z+100*Math.sin(this.phi)*Math.sin(this.theta),this.object.lookAt(o)}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",r,!1),this.domElement.removeEventListener("mousedown",i,!1),this.domElement.removeEventListener("mousemove",n,!1),this.domElement.removeEventListener("mouseup",o,!1),window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",l,!1)};var n=u(this,this.onMouseMove),i=u(this,this.onMouseDown),o=u(this,this.onMouseUp),s=u(this,this.onKeyDown),l=u(this,this.onKeyUp);function u(e,t){return function(){t.apply(e,arguments)}}this.domElement.addEventListener("contextmenu",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mouseup",o,!1),window.addEventListener("keydown",s,!1),window.addEventListener("keyup",l,!1),this.handleResize()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e,t){return function(){t.apply(e,arguments)}}function n(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this.tmpQuaternion=new a.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new a.Vector3(0,0,0),this.rotationVector=new a.Vector3(0,0,0),this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)},this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),r=t.size[0]/2,a=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-a)/a,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){var t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order)},this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",n,!1),this.domElement.removeEventListener("mousedown",o,!1),this.domElement.removeEventListener("mousemove",i,!1),this.domElement.removeEventListener("mouseup",s,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",u,!1)};var i=r(this,this.mousemove),o=r(this,this.mousedown),s=r(this,this.mouseup),l=r(this,this.keydown),u=r(this,this.keyup);this.domElement.addEventListener("contextmenu",n,!1),this.domElement.addEventListener("mousemove",i,!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mouseup",s,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",u,!1),this.updateMovementVector(),this.updateRotationVector()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),d=h.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&d===h.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),y.set(0,0,0)),g=1,!!(b||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},d=h.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,k=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),R=function(){var e=new a.Vector3;return function(t,r){!0===l.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var a=l.domElement===document?l.domElement.body:l.domElement;if(l.object.isPerspectiveCamera){var n=l.object.position;e.copy(n).sub(l.target);var i=e.length();i*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*i/a.clientHeight,l.object.matrix),R(2*r*i/a.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/a.clientWidth,l.object.matrix),R(r*(l.object.top-l.object.bottom)/l.object.zoom/a.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object.isPerspectiveCamera?g/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object.isPerspectiveCamera?g*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),d=h.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),d=h.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),d=h.PAN}d!==h.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),d){case h.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case h.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case h.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),d=h.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||d!==h.NONE&&d!==h.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(c),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);A.set(n,i)}}(e),d=h.TOUCH_DOLLY_PAN;break;default:d=h.NONE}d!==h.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(d!==h.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;if(d!==h.TOUCH_DOLLY_PAN)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.set(0,Math.pow(T.y/M.y,l.zoomSpeed)),N(P.y),M.copy(T)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);E.set(n,i),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E)}l.update()}(e);break;default:d=h.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),d=h.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.radius=0,this.rotateSpeed=1,this.zoomSpeed=1.2,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.keys=[65,83,68],this.target=new a.Vector3;var i=!0,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector3,c=new a.Vector3,f=new a.Vector2,h=new a.Vector2,d=0,p=0,m=new a.Vector2,v=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom;var g={type:"change"},y={type:"start"},b={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}this.radius=.5*Math.min(this.screen.width,this.screen.height),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var w,x,_,A,E,S,M=(w=new a.Vector2,function(e,t){return w.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),w}),T=function(){var e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(a,i){n.set((a-.5*r.screen.width-r.screen.left)/r.radius,(.5*r.screen.height+r.screen.top-i)/r.radius,0);var o=n.length();return r.noRoll?o1?n.normalize():n.z=Math.sqrt(1-o*o),l.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(n.y),e.add(t.copy(r.object.up).cross(l).setLength(n.x)),e.add(l.setLength(n.z)),e}}();function P(e){!1!==r.enabled&&(window.removeEventListener("keydown",P),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function F(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",P,!1))}function O(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(m.copy(M(e.pageX,e.pageY)),v.copy(m)):(f.copy(M(e.pageX,e.pageY)),h.copy(f)):(u.copy(T(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",L,!1),document.addEventListener("mouseup",C,!1),r.dispatchEvent(y))}function L(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||v.copy(M(e.pageX,e.pageY)):h.copy(M(e.pageX,e.pageY)):c.copy(T(e.pageX,e.pageY)))}function C(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",C),r.dispatchEvent(b))}function k(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),f.y+=.01*e.deltaY,r.dispatchEvent(y),r.dispatchEvent(b))}function R(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,u.copy(T(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;case 2:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=d=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(M(i,s)),v.copy(m);break;default:o=n.NONE}r.dispatchEvent(y)}}function I(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(i,s));break;default:o=n.NONE}}function N(e){if(!1!==r.enabled){switch(e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;case 2:d=p=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,a=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(t,a)),m.copy(v)}o=n.NONE,r.dispatchEvent(b)}}function D(e){e.preventDefault()}this.rotateCamera=(x=new a.Vector3,_=new a.Quaternion,function(){var e=Math.acos(u.dot(c)/u.length()/c.length());e&&(x.crossVectors(u,c).normalize(),e*=r.rotateSpeed,_.setFromAxisAngle(x,-e),l.applyQuaternion(_),r.object.up.applyQuaternion(_),c.applyQuaternion(_),r.staticMoving?u.copy(c):(_.setFromAxisAngle(x,e*(r.dynamicDampingFactor-1)),u.applyQuaternion(_)),i=!0)}),this.zoomCamera=function(){if(o===n.TOUCH_ZOOM_PAN){var e=p/d;d=p,r.object.zoom*=e,i=!0}else{e=1+(h.y-f.y)*r.zoomSpeed;Math.abs(e-1)>1e-6&&e>0&&(r.object.zoom/=e,r.staticMoving?f.copy(h):f.y+=(h.y-f.y)*this.dynamicDampingFactor,i=!0)}},this.panCamera=(A=new a.Vector2,E=new a.Vector3,S=new a.Vector3,function(){if(A.copy(v).sub(m),A.lengthSq()){var e=(r.object.right-r.object.left)/r.object.zoom,t=(r.object.top-r.object.bottom)/r.object.zoom;A.x*=e,A.y*=t,S.copy(l).cross(r.object.up).setLength(A.x),S.add(E.copy(r.object.up).setLength(A.y)),r.object.position.add(S),r.target.add(S),r.staticMoving?m.copy(v):m.add(A.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)),i=!0}}),this.update=function(){l.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||(r.zoomCamera(),i&&r.object.updateProjectionMatrix()),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,l),r.object.lookAt(r.target),i&&(r.dispatchEvent(g),i=!1)},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.left=r.left0,r.object.right=r.right0,r.object.top=r.top0,r.object.bottom=r.bottom0,r.object.lookAt(r.target),r.dispatchEvent(g),i=!1},this.dispose=function(){this.domElement.removeEventListener("contextmenu",D,!1),this.domElement.removeEventListener("mousedown",O,!1),this.domElement.removeEventListener("wheel",k,!1),this.domElement.removeEventListener("touchstart",R,!1),this.domElement.removeEventListener("touchend",N,!1),this.domElement.removeEventListener("touchmove",I,!1),document.removeEventListener("mousemove",L,!1),document.removeEventListener("mouseup",C,!1),window.removeEventListener("keydown",P,!1),window.removeEventListener("keyup",F,!1)},this.domElement.addEventListener("contextmenu",D,!1),this.domElement.addEventListener("mousedown",O,!1),this.domElement.addEventListener("wheel",k,!1),this.domElement.addEventListener("touchstart",R,!1),this.domElement.addEventListener("touchend",N,!1),this.domElement.addEventListener("touchmove",I,!1),window.addEventListener("keydown",P,!1),window.addEventListener("keyup",F,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;e.rotation.set(0,0,0);var r=new a.Object3D;r.add(e);var n=new a.Object3D;n.position.y=10,n.add(r);var i,o,s=Math.PI/2,l=function(e){if(!1!==t.enabled){var a=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;n.rotation.y-=.002*a,r.rotation.x-=.002*i,r.rotation.x=Math.max(-s,Math.min(s,r.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",l,!1)},document.addEventListener("mousemove",l,!1),this.enabled=!1,this.getObject=function(){return n},this.getDirection=(i=new a.Vector3(0,0,-1),o=new a.Euler(0,0,0,"YXZ"),function(e){return o.set(r.rotation.x,n.rotation.y,0),e.copy(i).applyEuler(o),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new a.Vector3;var i=new a.Vector3,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector2,c=new a.Vector2,f=new a.Vector3,h=0,d=new a.Vector2,p=new a.Vector2,m=0,v=0,g=new a.Vector2,y=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var b={type:"change"},w={type:"start"},x={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var _,A,E,S,M,T,P,F,O,L,C,k=(_=new a.Vector2,function(e,t){return _.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),_}),R=function(){var e=new a.Vector2;return function(t,a){return e.set((t-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-a))/r.screen.width),e}}();function I(e){!1!==r.enabled&&(window.removeEventListener("keydown",I),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function N(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",I,!1))}function D(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(g.copy(k(e.pageX,e.pageY)),y.copy(g)):(d.copy(k(e.pageX,e.pageY)),p.copy(d)):(c.copy(R(e.pageX,e.pageY)),u.copy(c)),document.addEventListener("mousemove",U,!1),document.addEventListener("mouseup",j,!1),r.dispatchEvent(w))}function U(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||y.copy(k(e.pageX,e.pageY)):p.copy(k(e.pageX,e.pageY)):(u.copy(c),c.copy(R(e.pageX,e.pageY))))}function j(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",j),r.dispatchEvent(x))}function B(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:d.y-=.025*e.deltaY;break;case 1:d.y-=.01*e.deltaY;break;default:d.y-=25e-5*e.deltaY}r.dispatchEvent(w),r.dispatchEvent(x)}}function V(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,c.copy(R(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;default:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=m=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;g.copy(k(i,s)),y.copy(g)}r.dispatchEvent(w)}}function z(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:u.copy(c),c.copy(R(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=Math.sqrt(t*t+a*a);var n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;y.copy(k(n,i))}}function G(e){if(!1!==r.enabled){switch(e.touches.length){case 0:o=n.NONE;break;case 1:o=n.TOUCH_ROTATE,c.copy(R(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c)}r.dispatchEvent(x)}}function H(e){!1!==r.enabled&&e.preventDefault()}this.rotateCamera=(E=new a.Vector3,S=new a.Quaternion,M=new a.Vector3,T=new a.Vector3,P=new a.Vector3,F=new a.Vector3,function(){F.set(c.x-u.x,c.y-u.y,0),(A=F.length())?(l.copy(r.object.position).sub(r.target),M.copy(l).normalize(),T.copy(r.object.up).normalize(),P.crossVectors(T,M).normalize(),T.setLength(c.y-u.y),P.setLength(c.x-u.x),F.copy(T.add(P)),E.crossVectors(F,l).normalize(),A*=r.rotateSpeed,S.setFromAxisAngle(E,A),l.applyQuaternion(S),r.object.up.applyQuaternion(S),f.copy(E),h=A):!r.staticMoving&&h&&(h*=Math.sqrt(1-r.dynamicDampingFactor),l.copy(r.object.position).sub(r.target),S.setFromAxisAngle(f,h),l.applyQuaternion(S),r.object.up.applyQuaternion(S)),u.copy(c)}),this.zoomCamera=function(){var e;o===n.TOUCH_ZOOM_PAN?(e=m/v,m=v,l.multiplyScalar(e)):(1!==(e=1+(p.y-d.y)*r.zoomSpeed)&&e>0&&l.multiplyScalar(e),r.staticMoving?d.copy(p):d.y+=(p.y-d.y)*this.dynamicDampingFactor)},this.panCamera=(O=new a.Vector2,L=new a.Vector3,C=new a.Vector3,function(){O.copy(y).sub(g),O.lengthSq()&&(O.multiplyScalar(l.length()*r.panSpeed),C.copy(l).cross(r.object.up).setLength(O.x),C.add(L.copy(r.object.up).setLength(O.y)),r.object.position.add(C),r.target.add(C),r.staticMoving?g.copy(y):g.add(O.subVectors(y,g).multiplyScalar(r.dynamicDampingFactor)))}),this.checkDistances=function(){r.noZoom&&r.noPan||(l.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,l.setLength(r.maxDistance)),d.copy(p)),l.lengthSq()1e-6&&(r.dispatchEvent(b),i.copy(r.object.position))},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(b),i.copy(r.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",H,!1),this.domElement.removeEventListener("mousedown",D,!1),this.domElement.removeEventListener("wheel",B,!1),this.domElement.removeEventListener("touchstart",V,!1),this.domElement.removeEventListener("touchend",G,!1),this.domElement.removeEventListener("touchmove",z,!1),document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",I,!1),window.removeEventListener("keyup",N,!1)},this.domElement.addEventListener("contextmenu",H,!1),this.domElement.addEventListener("mousedown",D,!1),this.domElement.addEventListener("wheel",B,!1),this.domElement.addEventListener("touchstart",V,!1),this.domElement.addEventListener("touchend",G,!1),this.domElement.addEventListener("touchmove",z,!1),window.addEventListener("keydown",I,!1),window.addEventListener("keyup",N,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){var e=function(e){a.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.side=a.FrontSide,this.transparent=!0,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(e.prototype=Object.create(a.MeshBasicMaterial.prototype)).constructor=e;var t=function(e){a.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.transparent=!0,this.linewidth=1,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(t.prototype=Object.create(a.LineBasicMaterial.prototype)).constructor=t;var r=new e({visible:!1,transparent:!1}),n=function(){this.init=function(){a.Object3D.call(this),this.handles=new a.Object3D,this.pickers=new a.Object3D,this.planes=new a.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new a.PlaneBufferGeometry(50,50,2,2),t=new a.MeshBasicMaterial({visible:!1,side:a.DoubleSide}),r={XY:new a.Mesh(e,t),YZ:new a.Mesh(e,t),XZ:new a.Mesh(e,t),XYZE:new a.Mesh(e,t)};for(var n in this.activePlane=r.XYZE,r.YZ.rotation.set(0,Math.PI/2,0),r.XZ.rotation.set(-Math.PI/2,0,0),r)r[n].name=n,this.planes.add(r[n]),this.planes[n]=r[n];var i=function(e,t){for(var r in e)for(n=e[r].length;n--;){var a=e[r][n][0],i=e[r][n][1],o=e[r][n][2];a.name=r,a.renderOrder=1/0,i&&a.position.set(i[0],i[1],i[2]),o&&a.rotation.set(o[0],o[1],o[2]),t.add(a)}};i(this.handleGizmos,this.handles),i(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof a.Mesh){e.updateMatrix();var t=e.geometry.clone();t.applyMatrix(e.matrix),e.geometry=t,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))},this.highlight=function(e){this.traverse((function(t){t.material&&t.material.highlight&&(t.name===e?t.material.highlight(!0):t.material.highlight(!1))}))}};(n.prototype=Object.create(a.Object3D.prototype)).constructor=n,n.prototype.update=function(e,t){var r=new a.Vector3(0,0,0),n=new a.Vector3(0,1,0),i=new a.Matrix4;this.traverse((function(a){-1!==a.name.search("E")?a.quaternion.setFromRotationMatrix(i.lookAt(t,r,n)):-1===a.name.search("X")&&-1===a.name.search("Y")&&-1===a.name.search("Z")||a.quaternion.setFromEuler(e)}))};var i=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.CylinderGeometry(0,.05,.2,12,1,!1));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),new e({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),r)]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()};(i.prototype=Object.create(n.prototype)).constructor=i;var o=function(){n.call(this);var e=function(e,t,r){var n=new a.BufferGeometry,i=[];r=r||1;for(var o=0;o<=64*r;++o)"x"===t&&i.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&i.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&i.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return n.addAttribute("position",new a.Float32BufferAttribute(i,3)),n};this.handleGizmos={X:[[new a.Line(new e(1,"x",.5),new t({color:16711680}))]],Y:[[new a.Line(new e(1,"y",.5),new t({color:65280}))]],Z:[[new a.Line(new e(1,"z",.5),new t({color:255}))]],E:[[new a.Line(new e(1.25,"z",1),new t({color:13421568}))]],XYZE:[[new a.Line(new e(1,"z",1),new t({color:7895160}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusBufferGeometry(1.25,.12,2,24),r)]],XYZE:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,2,24),r)]]},this.pickerGizmos.XYZE[0][0].visible=!1,this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){n.prototype.update.apply(this,arguments);var r=new a.Matrix4,i=new a.Euler(0,0,1),o=new a.Quaternion,s=new a.Vector3(1,0,0),l=new a.Vector3(0,1,0),u=new a.Vector3(0,0,1),c=new a.Quaternion,f=new a.Quaternion,h=new a.Quaternion,d=t.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),r.makeRotationFromQuaternion(o).getInverse(r),d.applyMatrix4(r),this.traverse((function(e){o.setFromEuler(i),"X"===e.name&&(c.setFromAxisAngle(s,Math.atan2(-d.y,d.z)),o.multiplyQuaternions(o,c),e.quaternion.copy(o)),"Y"===e.name&&(f.setFromAxisAngle(l,Math.atan2(d.x,d.z)),o.multiplyQuaternions(o,f),e.quaternion.copy(o)),"Z"===e.name&&(h.setFromAxisAngle(u,Math.atan2(d.y,d.x)),o.multiplyQuaternions(o,h),e.quaternion.copy(o))}))},this.init()};(o.prototype=Object.create(n.prototype)).constructor=o;var s=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.BoxGeometry(.125,.125,.125));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.125,.125,.125),new e({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.4,.4,.4),r)]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()};(s.prototype=Object.create(n.prototype)).constructor=s;var l=function(e,t){a.Object3D.call(this),t=void 0!==t?t:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var r=this,n="translate",l=!1,u={translate:new i,rotate:new o,scale:new s};for(var c in u){var f=u[c];f.visible=c===n,this.add(f)}var h={type:"change"},d={type:"mouseDown"},p={type:"mouseUp",mode:n},m={type:"objectChange"},v=new a.Raycaster,g=new a.Vector2,y=new a.Vector3,b=new a.Vector3,w=new a.Vector3,x=new a.Vector3,_=1,A=new a.Matrix4,E=new a.Vector3,S=new a.Matrix4,M=new a.Vector3,T=new a.Quaternion,P=new a.Vector3(1,0,0),F=new a.Vector3(0,1,0),O=new a.Vector3(0,0,1),L=new a.Quaternion,C=new a.Quaternion,k=new a.Quaternion,R=new a.Quaternion,I=new a.Quaternion,N=new a.Vector3,D=new a.Vector3,U=new a.Matrix4,j=new a.Matrix4,B=new a.Vector3,V=new a.Vector3,z=new a.Euler,G=new a.Matrix4,H=new a.Vector3,X=new a.Euler;function Y(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,u[n].pickers.children),a=null;t&&(a=t.object.name,e.preventDefault()),r.axis!==a&&(r.axis=a,r.update(),r.dispatchEvent(h))}}function W(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=e.changedTouches?e.changedTouches[0]:e;if(0===t.button||void 0===t.button){var a=Z(t,u[n].pickers.children);if(a){e.preventDefault(),e.stopPropagation(),r.axis=a.object.name,r.dispatchEvent(d),r.update(),E.copy(H).sub(V).normalize(),u[n].setActivePlane(r.axis,E);var i=Z(t,[u[n].activePlane]);i&&(N.copy(r.object.position),D.copy(r.object.scale),U.extractRotation(r.object.matrix),G.extractRotation(r.object.matrixWorld),j.extractRotation(r.object.parent.matrixWorld),B.setFromMatrixScale(S.getInverse(r.object.parent.matrixWorld)),b.copy(i.point))}}l=!0}}function q(e){if(void 0!==r.object&&null!==r.axis&&!1!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,[u[n].activePlane]);!1!==t&&(e.preventDefault(),e.stopPropagation(),y.copy(t.point),"translate"===n?(y.sub(b),y.multiply(B),"local"===r.space&&(y.applyMatrix4(S.getInverse(G)),-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(U),r.object.position.copy(N),r.object.position.add(y)),"world"!==r.space&&-1===r.axis.search("XYZ")||(-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(S.getInverse(j)),r.object.position.copy(N),r.object.position.add(y)),null!==r.translationSnap&&("local"===r.space&&r.object.position.applyMatrix4(S.getInverse(G)),-1!==r.axis.search("X")&&(r.object.position.x=Math.round(r.object.position.x/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Y")&&(r.object.position.y=Math.round(r.object.position.y/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Z")&&(r.object.position.z=Math.round(r.object.position.z/r.translationSnap)*r.translationSnap),"local"===r.space&&r.object.position.applyMatrix4(G))):"scale"===n?(y.sub(b),y.multiply(B),"local"===r.space&&("XYZ"===r.axis?(_=1+y.y/Math.max(D.x,D.y,D.z),r.object.scale.x=D.x*_,r.object.scale.y=D.y*_,r.object.scale.z=D.z*_):(y.applyMatrix4(S.getInverse(G)),"X"===r.axis&&(r.object.scale.x=D.x*(1+y.x/D.x)),"Y"===r.axis&&(r.object.scale.y=D.y*(1+y.y/D.y)),"Z"===r.axis&&(r.object.scale.z=D.z*(1+y.z/D.z))))):"rotate"===n&&(y.sub(V),y.multiply(B),M.copy(b).sub(V),M.multiply(B),"E"===r.axis?(y.applyMatrix4(S.getInverse(A)),M.applyMatrix4(S.getInverse(A)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),I.setFromAxisAngle(E,w.z-x.z),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,I),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"XYZE"===r.axis?(I.setFromEuler(y.clone().cross(M).normalize()),T.setFromRotationMatrix(S.getInverse(j)),C.setFromAxisAngle(I,-y.clone().angleTo(M)),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,C),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"local"===r.space?(y.applyMatrix4(S.getInverse(G)),M.applyMatrix4(S.getInverse(G)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),L.setFromRotationMatrix(U),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),k.setFromAxisAngle(F,w.y-x.y),R.setFromAxisAngle(O,w.z-x.z)),"X"===r.axis&&L.multiplyQuaternions(L,C),"Y"===r.axis&&L.multiplyQuaternions(L,k),"Z"===r.axis&&L.multiplyQuaternions(L,R),r.object.quaternion.copy(L)):"world"===r.space&&(w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),k.setFromAxisAngle(F,w.y-x.y),R.setFromAxisAngle(O,w.z-x.z)),L.setFromRotationMatrix(G),"X"===r.axis&&T.multiplyQuaternions(T,C),"Y"===r.axis&&T.multiplyQuaternions(T,k),"Z"===r.axis&&T.multiplyQuaternions(T,R),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T))),r.update(),r.dispatchEvent(h),r.dispatchEvent(m))}}function Q(e){e.preventDefault(),void 0!==e.button&&0!==e.button||(l&&null!==r.axis&&(p.mode=n,r.dispatchEvent(p)),l=!1,"TouchEvent"in window&&e instanceof TouchEvent?(r.axis=null,r.update(),r.dispatchEvent(h)):Y(e))}function Z(r,a){var n=t.getBoundingClientRect(),i=(r.clientX-n.left)/n.width,o=(r.clientY-n.top)/n.height;g.set(2*i-1,-2*o+1),v.setFromCamera(g,e);var s=v.intersectObjects(a,!0);return!!s[0]&&s[0]}t.addEventListener("mousedown",W,!1),t.addEventListener("touchstart",W,!1),t.addEventListener("mousemove",Y,!1),t.addEventListener("touchmove",Y,!1),t.addEventListener("mousemove",q,!1),t.addEventListener("touchmove",q,!1),t.addEventListener("mouseup",Q,!1),t.addEventListener("mouseout",Q,!1),t.addEventListener("touchend",Q,!1),t.addEventListener("touchcancel",Q,!1),t.addEventListener("touchleave",Q,!1),this.dispose=function(){t.removeEventListener("mousedown",W),t.removeEventListener("touchstart",W),t.removeEventListener("mousemove",Y),t.removeEventListener("touchmove",Y),t.removeEventListener("mousemove",q),t.removeEventListener("touchmove",q),t.removeEventListener("mouseup",Q),t.removeEventListener("mouseout",Q),t.removeEventListener("touchend",Q),t.removeEventListener("touchcancel",Q),t.removeEventListener("touchleave",Q)},this.attach=function(e){this.object=e,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return n},this.setMode=function(e){for(var t in"scale"===(n=e||n)&&(r.space="local"),u)u[t].visible=t===n;this.update(),r.dispatchEvent(h)},this.setTranslationSnap=function(e){r.translationSnap=e},this.setRotationSnap=function(e){r.rotationSnap=e},this.setSize=function(e){r.size=e,this.update(),r.dispatchEvent(h)},this.setSpace=function(e){r.space=e,this.update(),r.dispatchEvent(h)},this.update=function(){void 0!==r.object&&(r.object.updateMatrixWorld(),V.setFromMatrixPosition(r.object.matrixWorld),z.setFromRotationMatrix(S.extractRotation(r.object.matrixWorld)),e.updateMatrixWorld(),H.setFromMatrixPosition(e.matrixWorld),X.setFromRotationMatrix(S.extractRotation(e.matrixWorld)),_=V.distanceTo(H)/6*r.size,this.position.copy(V),this.scale.set(_,_,_),e instanceof a.PerspectiveCamera?E.copy(H).sub(V).normalize():e instanceof a.OrthographicCamera&&E.copy(H).normalize(),"local"===r.space?u[n].update(z,E):"world"===r.space&&u[n].update(new a.Euler,E),u[n].highlight(r.axis))}};return(l.prototype=Object.create(a.Object3D.prototype)).constructor=l,l}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){var r,n,i=this,o=new a.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")})).catch((function(){console.warn("THREE.VRControls: Unable to get VR Displays")})),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return o},this.update=function(){var t;r&&(r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(i.scale))},this.dispose=function(){r=null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedGeometryExporter=t.STLExporter=t.STLBinaryExporter=t.PLYExporter=t.OBJExporter=t.MMDExporter=t.GLTFExporter=void 0;var a=c(r(41)),n=c(r(42)),i=c(r(43)),o=c(r(44)),s=c(r(45)),l=c(r(46)),u=c(r(47));function c(e){return e&&e.__esModule?e:{default:e}}t.GLTFExporter=a.default,t.MMDExporter=n.default,t.OBJExporter=i.default,t.PLYExporter=o.default,t.STLBinaryExporter=s.default,t.STLExporter=l.default,t.TypedGeometryExporter=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987},i={1003:n.NEAREST,1004:n.NEAREST_MIPMAP_NEAREST,1005:n.NEAREST_MIPMAP_LINEAR,1006:n.LINEAR,1007:n.LINEAR_MIPMAP_NEAREST,1008:n.LINEAR_MIPMAP_LINEAR},o={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},s=function(){};s.prototype={constructor:s,parse:function(e,t,r){(r=Object.assign({},{trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,animations:[],forceIndices:!1,forcePowerOfTwoTextures:!1},r)).animations.length>0&&(r.trs=!0);var s,l={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},u=0,c=[],f=[],h=new Map,d=[],p={},m={attributes:new Map,materials:new Map,textures:new Map};function v(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}function g(e){return 4*Math.ceil(e/4)}function y(e,t){t=t||0;var r=g(e.byteLength);if(r!==e.byteLength){var a=new Uint8Array(r);if(a.set(new Uint8Array(e)),0!==t)for(var n=e.byteLength;n0)&&(t.alphaMode=e.opacity<1?"BLEND":"MASK",e.alphaTest>0&&.5!==e.alphaTest&&(t.alphaCutoff=e.alphaTest)),e.side===a.DoubleSide&&(t.doubleSided=!0),""!==e.name&&(t.name=e.name),l.materials.push(t);var i=l.materials.length-1;return m.materials.set(e,i),i}function S(e){var t,i=e.geometry;if(e.isLineSegments)t=n.LINES;else if(e.isLineLoop)t=n.LINE_LOOP;else if(e.isLine)t=n.LINE_STRIP;else if(e.isPoints)t=n.POINTS;else{if(!i.isBufferGeometry){var o=new a.BufferGeometry;o.fromGeometry(i),i=o}e.drawMode===a.TriangleFanDrawMode?(console.warn("GLTFExporter: TriangleFanDrawMode and wireframe incompatible."),t=n.TRIANGLE_FAN):t=e.drawMode===a.TriangleStripDrawMode?e.material.wireframe?n.LINE_STRIP:n.TRIANGLE_STRIP:e.material.wireframe?n.LINES:n.TRIANGLES}var s={},u={},c=[],f=[],h={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},d=i.getAttribute("normal");for(var p in void 0===d||function(e){if(m.attributes.has(e))return!1;for(var t=new a.Vector3,r=0,n=e.count;r5e-4)return!1;return!0}(d)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.addAttribute("normal",function(e){if(m.attributes.has(e))return m.textures.get(e);for(var t=e.clone(),r=new a.Vector3,n=0,i=t.count;n0){var b=[],x=[],_={};if(void 0!==e.morphTargetDictionary)for(var A in e.morphTargetDictionary)_[e.morphTargetDictionary[A]]=A;for(var S=0;S0&&(s.extras={},s.extras.targetNames=x)}var C=r.forceIndices,k=Array.isArray(e.material);if(k&&0===e.geometry.groups.length)return null;!C&&null===i.index&&k&&(console.warn("THREE.GLTFExporter: Creating index for non-indexed multi-material mesh."),C=!0);var R=!1;if(null===i.index&&C){for(var I=[],N=(S=0,i.attributes.position.count);S0&&(j.targets=f),null!==i.index&&(j.indices=w(i.index,i,U[S].start,U[S].count));var B=E(D[U[S].materialIndex]);null!==B&&(j.material=B),c.push(j)}return R&&i.setIndex(null),s.primitives=c,l.meshes||(l.meshes=[]),l.meshes.push(s),l.meshes.length-1}function M(e,t){l.animations||(l.animations=[]);for(var r=[],n=[],i=0;i0)try{t.extras=JSON.parse(JSON.stringify(e.userData))}catch(e){throw new Error("THREE.GLTFExporter: userData can't be serialized")}if(e.isMesh||e.isLine||e.isPoints){var s=S(e);null!==s&&(t.mesh=s)}else e.isCamera&&(t.camera=function(e){l.cameras||(l.cameras=[]);var t=e.isOrthographicCamera,r={type:t?"orthographic":"perspective"};return t?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:a.Math.degToRad(e.fov)/e.aspect,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),l.cameras.push(r),l.cameras.length-1}(e));if(e.isSkinnedMesh&&d.push(e),e.children.length>0){for(var u=[],c=0,f=e.children.length;c0&&(t.children=u)}l.nodes.push(t);var g=l.nodes.length-1;return h.set(e,g),g}function F(e){l.scenes||(l.scenes=[],l.scene=0);var t={nodes:[]};""!==e.name&&(t.name=e.name),l.scenes.push(t);for(var a=[],n=0,i=e.children.length;n0&&(t.nodes=a)}!function(e){e=e instanceof Array?e:[e];for(var t=[],n=0;n0&&function(e){var t=new a.Scene;t.name="AuxScene";for(var r=0;r0&&(l.extensionsUsed=a),l.buffers&&l.buffers.length>0){l.buffers[0].byteLength=e.size;var n=new window.FileReader;if(!0===r.binary){n.readAsArrayBuffer(e),n.onloadend=function(){var e=y(n.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,e.byteLength,!0),r.setUint32(4,5130562,!0);var a=y(function(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0,a=e.length;r255?32:n}return t.buffer}(JSON.stringify(l)),32),i=new DataView(new ArrayBuffer(8));i.setUint32(0,a.byteLength,!0),i.setUint32(4,1313821514,!0);var o=new ArrayBuffer(12),s=new DataView(o);s.setUint32(0,1179937895,!0),s.setUint32(4,2,!0);var u=12+i.byteLength+a.byteLength+r.byteLength+e.byteLength;s.setUint32(8,u,!0);var c=new Blob([o,i,a,r,e],{type:"application/octet-stream"}),f=new window.FileReader;f.readAsArrayBuffer(c),f.onloadend=function(){t(f.result)}}}else n.readAsDataURL(e),n.onloadend=function(){var e=n.result;l.buffers[0].uri=e,t(l)}}else t(l)}))}},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(0)),n=i(r(4));function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.default=function(){var e;this.parseVpd=function(t,r,i){if(!0!==t.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);var t=e.toString();-1===t.indexOf(".")&&(t+=".");var r=(t+="000000").indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function s(e){for(var t=[],r=0,a=e.length;r255?(u.push(l>>8&255),u.push(255&l)):u.push(255&l)}return new Uint8Array(u)}(x):x}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(){};n.prototype={constructor:n,parse:function(e){var t,r,n,i,o,s="",l=0,u=0,c=0,f=new a.Vector3,h=new a.Vector3,d=new a.Vector2,p=[];return e.traverse((function(e){e instanceof a.Mesh&&function(e){var n=0,m=0,v=0,g=e.geometry,y=new a.Matrix3;if(g instanceof a.Geometry&&(g=(new a.BufferGeometry).setFromObject(e)),g instanceof a.BufferGeometry){var b=g.getAttribute("position"),w=g.getAttribute("normal"),x=g.getAttribute("uv"),_=g.getIndex();if(s+="o "+e.name+"\n",e.material&&e.material.name&&(s+="usemtl "+e.material.name+"\n"),void 0!==b)for(t=0,i=b.count;t=200)return void n("THREE.AssimpJSONLoader: Unsupported assimp2json file format version.")}t(i.parse(r,o))}),r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=new Array(e.length),a=0;a0&&i.addAttribute("normal",new a.Float32BufferAttribute(l,3)),u.length>0&&i.addAttribute("uv",new a.Float32BufferAttribute(u,2)),c.length>0&&i.addAttribute("color",new a.Float32BufferAttribute(c,3)),i.computeBoundingSphere(),i})),o=r(e.materials,(function(e){var t=new a.MeshPhongMaterial;for(var r in e.properties){var i=e.properties[r],o=i.key,s=i.value;switch(o){case"$tex.file":var l=i.semantic;if(1===l||2===l||5===l||6===l){var u;switch(l){case 1:u="map";break;case 2:u="specularMap";break;case 5:u="bumpMap";break;case 6:u="normalMap"}var c=n.load(s);c.wrapS=c.wrapT=a.RepeatWrapping,t[u]=c}break;case"?mat.name":t.name=s;break;case"$clr.diffuse":t.color.fromArray(s);break;case"$clr.specular":t.specular.fromArray(s);break;case"$clr.emissive":t.emissive.fromArray(s);break;case"$mat.shininess":t.shininess=s;break;case"$mat.shadingm":t.flatShading=1===s;break;case"$mat.opacity":s<1&&(t.opacity=s,t.transparent=!0)}}return t}));return function e(t,r,n,i){var o,s,l=new a.Object3D;for(l.name=r.name||"",l.matrix=(new a.Matrix4).fromArray(r.transformation).transpose(),l.matrix.decompose(l.position,l.quaternion,l.scale),o=0;r.meshes&&o0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(var e=0;e=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;for(var r=e.hierarchy[0].keys,a=0;ae){t=this.keys[a],r=this.keys[a+1];break}if(this.keys[a].time4&&(r.length=4);var n=0;for(a=0;a<4;a++)n+=r[a].w*r[a].w;n=Math.sqrt(n);for(a=0;a<4;a++)r[a].w=r[a].w/n,e[a]=r[a].i,t[a]=r[a].w}function R(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(var r in e.children){var a=R(e.children[r],t);if(a)return a}}function I(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e,t){if(0!=this.mBones.length){for(var r=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var o=C(u=i.toTHREE(e),e);this.threeNode.add(o);for(var s=0;s0&&n.addAttribute("normal",new a.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&n.addAttribute("color",new a.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&n.addAttribute("uv",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&n.addAttribute("uv1",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&n.addAttribute("tangents",new a.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&n.addAttribute("bitangents",new a.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){for(var i=[],o=[],s=0;s0&&(r=new a.SkinnedMesh(n,t)),this.threeNode=r,r}}function N(){this.mNumIndices=0,this.mIndices=[]}function D(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new a.Vector3(this.x,this.y,this.z)}}function U(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new a.Color(this.r,this.g,this.b,1)}}function j(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new a.Quaternion(this.x,this.y,this.z,this.w)}}function B(){this.mVertexId=0,this.mWeight=0}function V(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}function z(){this.mTime=0,this.mValue=null}function G(){this.mTime=0,this.mValue=null}function H(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new a.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(var r=0;r0)var r=this.mAnimations[0].toTHREE(this);return{object:e,animation:r}}}function ie(){this.elements=[[],[],[],[]],this.toTHREE=function(){for(var e=new a.Matrix4,t=0;t<4;++t)for(var r=0;r<4;++r)e.elements[4*t+r]=this.elements[r][t];return e}}var oe=!0;function se(e){var t=e.getFloat32(e.readOffset,oe);return e.readOffset+=4,t}function le(e){var t=e.getFloat64(e.readOffset,oe);return e.readOffset+=8,t}function ue(e){var t=e.getUint16(e.readOffset,oe);return e.readOffset+=2,t}function ce(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function fe(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function he(e){var t=new D;return t.x=se(e),t.y=se(e),t.z=se(e),t}function de(e){var t=new U;return t.r=se(e),t.g=se(e),t.b=se(e),t}function pe(e){var t=new V,r=ce(e);return e.ReadBytes(t.data,1,r),t.toString()}function me(e){var t=new B;return t.mVertexId=ce(e),t.mWeight=se(e),t}function ve(e){for(var t=new ie,r=0;r<4;++r)for(var a=0;a<4;++a)t.elements[r][a]=se(e);return t}function ge(e){var t=new z;return t.mTime=le(e),t.mValue=he(e),t}function ye(e){var t=new G;return t.mTime=le(e),t.mValue=function(e){var t=new j;return t.w=se(e),t.x=se(e),t.y=se(e),t.z=se(e),t}(e),t}function be(e,t,r){for(var a=0;a0,ke=ue(r)>0,Ce)throw"Shortened binaries are not supported!";if(r.Seek(256,Re),r.Seek(128,Re),r.Seek(64,Re),!ke)return Le(r,t),t.toTHREE();var a=fe(r),n=r.FileSize()-r.Tell(),i=[];r.Read(i,1,n);var o=[];uncompress(o,a,i,n),Le(new ArrayBuffer(o),t)}(e)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){function e(){this.id=0,this.data=null}function t(){}t.prototype={set:function(e,t){this[e]=t},get:function(e,t){return this.hasOwnProperty(e)?this[e]:t}};var r=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.trunk=new a.Object3D,this.materialFactory=void 0,this._url="",this._baseDir="",this._data=void 0,this._ptr=0,this._version=[],this._streaming=!1,this._optimized_for_accuracy=!1,this._compression=0,this._bodylen=4294967295,this._blocks=[new e],this._accuracyMatrix=!1,this._accuracyGeo=!1,this._accuracyProps=!1};return r.prototype={constructor:r,load:function(e,t,r,n){var i=this;this._url=e,this._baseDir=e.substr(0,e.lastIndexOf("/")+1);var o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){var t=e.byteLength;for(this._ptr=0,this._data=new DataView(e),this._parseHeader(),0!=this._compression&&console.error("compressed AWD not supported"),this._streaming||this._bodylen==e.byteLength-this._ptr||console.error("AWDLoader: body len does not match file length",this._bodylen,t-this._ptr);this._ptr1)for(r=new a.Object3D,p=0;p191&&a<224){var n=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((31&a)<<6|63&n)}else{n=this._data.getUint8(this._ptr++,!0);var i=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((15&a)<<12|(63&n)<<6|63&i)}}return t.join("")}},r}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),r,n)},parse:function(e){function t(e){var t=new a.BufferGeometry,r=e.indices,n=e.positions,i=e.normals,o=e.uvs;t.setIndex(r);for(var s=2,l=n.length;s0&&t.push(new a.VectorKeyframeTrack(n+".position",i,o)),s.length>0&&t.push(new a.QuaternionKeyframeTrack(n+".quaternion",i,s)),l.length>0&&t.push(new a.VectorKeyframeTrack(n+".scale",i,l)),t}function A(e,t,r){var a,n,i,o=!0;for(n=0,i=e.length;n=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function S(e,t,r){for(;t0&&t0&&d.addAttribute("position",new a.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&d.addAttribute("normal",new a.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&d.addAttribute("color",new a.Float32BufferAttribute(l.array,l.stride)),s.array.length>0&&d.addAttribute("uv",new a.Float32BufferAttribute(s.array,s.stride)),u.length>0&&d.addAttribute("skinIndex",new a.Float32BufferAttribute(u,c)),f.length>0&&d.addAttribute("skinWeight",new a.Float32BufferAttribute(f,h)),n.data=d,n.type=e[0].type,n.materialKeys=p,n}function fe(e,t,r,a){var n=e.p,i=e.stride,o=e.vcount;function s(e){for(var t=n[e+r]*u,i=t+u;t4)for(var g=1,y=d-2;g<=y;g++){p=c+i*g,m=c+i*(g+1);s(c+0*i),s(p),s(m)}c+=i*d}else for(f=0,h=n.length;f=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ge(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;rn.limits.max||t>8&255,h>>16&255,h>>24&255))),r;p=!0,o=64,r.format=a.RGBAFormat}r.mipmapCount=1,131072&f[2]&&!1!==t&&(r.mipmapCount=Math.max(1,f[7]));var m=f[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=f[4],r.height=f[3];for(var v=f[1]+4,g=r.isCubemap?6:1,y=0;y>1,1),w=Math.max(w>>1,1)}return r},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="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},n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var i=function(e){this.timeLoaded=0,this.manager=e||n.DefaultLoadingManager,this.materials=null,this.verbosity=0,this.attributeOptions={},this.drawMode=n.TrianglesDrawMode,this.nativeAttributeMap={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"}};i.prototype={constructor:i,load:function(e,t,r,a){var i=this,o=new n.FileLoader(i.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.load(e,(function(e){i.decodeDracoFile(e,t)}),r,a)},setPath:function(e){this.path=e},setCrossOrigin:function(e){this.crossOrigin=e},setVerbosity:function(e){this.verbosity=e},setDrawMode:function(e){this.drawMode=e},setSkipDequantization:function(e,t){var r=!0;void 0!==t&&(r=t),this.getAttributeOptions(e).skipDequantization=r},decodeDracoFile:function(e,t,r){var a=this;i.getDecoderModule().then((function(n){a.decodeDracoFileInternal(e,n.decoder,t,r||{})}))},decodeDracoFileInternal:function(e,t,r,a){var n=new t.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength);var i=new t.Decoder,o=i.GetEncodedGeometryType(n);if(o==t.TRIANGULAR_MESH)this.verbosity>0&&console.log("Loaded a mesh.");else{if(o!=t.POINT_CLOUD){var s="THREE.DRACOLoader: Unknown geometry type.";throw console.error(s),new Error(s)}this.verbosity>0&&console.log("Loaded a point cloud.")}r(this.convertDracoGeometryTo3JS(t,i,o,n,a))},addAttributeToGeometry:function(e,t,r,a,i,o,s){if(0===i.ptr){var l="THREE.DRACOLoader: No attribute "+a;throw console.error(l),new Error(l)}var u=i.num_components(),c=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,c);var f=r.num_points()*u;s[a]=new Float32Array(f);for(var h=0;h0&&console.log("Number of faces loaded: "+c.toString())):c=0;var h=o.num_points(),d=o.num_attributes();this.verbosity>0&&(console.log("Number of points loaded: "+h.toString()),console.log("Number of attributes loaded: "+d.toString()));var p=t.GetAttributeId(o,e.POSITION);if(-1==p){u="THREE.DRACOLoader: No position attribute found.";throw console.error(u),e.destroy(t),e.destroy(o),new Error(u)}var m=t.GetAttribute(o,p),v={},g=new n.BufferGeometry;for(var y in this.nativeAttributeMap)if(void 0===i[y]){var b=t.GetAttributeId(o,e[this.nativeAttributeMap[y]]);if(-1!==b){this.verbosity>0&&console.log("Loaded "+y+" attribute.");var w=t.GetAttribute(o,b);this.addAttributeToGeometry(e,t,o,y,w,g,v)}}for(var y in i){var x=i[y];w=t.GetAttributeByUniqueId(o,x);this.addAttributeToGeometry(e,t,o,y,w,g,v)}if(r==e.TRIANGULAR_MESH)if(this.drawMode===n.TriangleStripDrawMode){var _=new e.DracoInt32Array;t.GetTriangleStripsFromMesh(o,_);v.indices=new Uint32Array(_.size());for(var A=0;A<_.size();++A)v.indices[A]=_.GetValue(A);e.destroy(_)}else{var E=3*c;v.indices=new Uint32Array(E);var S=new e.DracoInt32Array;for(A=0;A65535?n.Uint32BufferAttribute:n.Uint16BufferAttribute)(v.indices,1));var T=new e.AttributeQuantizationTransform;if(T.InitFromAttribute(m)){g.attributes.position.isQuantized=!0,g.attributes.position.maxRange=T.range(),g.attributes.position.numQuantizationBits=T.quantization_bits(),g.attributes.position.minValues=new Float32Array(3);for(A=0;A<3;++A)g.attributes.position.minValues[A]=T.min_value(A)}return e.destroy(T),e.destroy(t),e.destroy(o),this.decode_time=f-l,this.import_time=performance.now()-f,this.verbosity>0&&(console.log("Decode time: "+this.decode_time),console.log("Import time: "+this.import_time)),g},isVersionSupported:function(e,t){i.getDecoderModule().then((function(r){t(r.decoder.isVersionSupported(e))}))},getAttributeOptions:function(e){return void 0===this.attributeOptions[e]&&(this.attributeOptions[e]={}),this.attributeOptions[e]}},i.decoderPath="./",i.decoderConfig={},i.decoderModulePromise=null,i.setDecoderPath=function(e){i.decoderPath=e},i.setDecoderConfig=function(e){var t=i.decoderConfig.wasmBinary;i.decoderConfig=e||{},i.releaseDecoderModule(),t&&(i.decoderConfig.wasmBinary=t)},i.releaseDecoderModule=function(){i.decoderModulePromise=null},i.getDecoderModule=function(){var e=this,t=i.decoderPath,r=i.decoderConfig,n=i.decoderModulePromise;return n||("undefined"!=typeof DracoDecoderModule?n=Promise.resolve():"object"!==("undefined"==typeof WebAssembly?"undefined":a(WebAssembly))||"js"===r.type?n=i._loadScript(t+"draco_decoder.js"):(r.wasmBinaryFile=t+"draco_decoder.wasm",n=i._loadScript(t+"draco_wasm_wrapper.js").then((function(){return i._loadArrayBuffer(r.wasmBinaryFile)})).then((function(e){r.wasmBinary=e}))),n=n.then((function(){return new Promise((function(t){r.onModuleLoaded=function(r){e.timeLoaded=performance.now(),t({decoder:r})},DracoDecoderModule(r)}))})),i.decoderModulePromise=n,n)},i._loadScript=function(e){var t=document.getElementById("decoder_script");null!==t&&t.parentNode.removeChild(t);var r=document.getElementsByTagName("head")[0],a=document.createElement("script");return a.id="decoder_script",a.type="text/javascript",a.src=e,new Promise((function(e){a.onload=e,r.appendChild(a)}))},i._loadArrayBuffer=function(e){var t=new n.FileLoader;return t.setResponseType("arraybuffer"),new Promise((function(r,a){t.load(e,r,void 0,a)}))},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.sourceTexture=e,this.resolution=t,this.views=[{t:[1,0,0],u:[0,-1,0]},{t:[-1,0,0],u:[0,-1,0]},{t:[0,1,0],u:[0,0,1]},{t:[0,-1,0],u:[0,0,-1]},{t:[0,0,1],u:[0,-1,0]},{t:[0,0,-1],u:[0,-1,0]}],this.camera=new a.PerspectiveCamera(90,1,.1,10),this.boxMesh=new a.Mesh(new a.BoxBufferGeometry(1,1,1),this.getShader()),this.boxMesh.material.side=a.BackSide,this.scene=new a.Scene,this.scene.add(this.boxMesh);var r={format:a.RGBAFormat,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.renderTarget=new a.WebGLRenderTargetCube(this.resolution,this.resolution,r)};n.prototype={constructor:n,update:function(e){for(var t=0;t<6;t++){this.renderTarget.activeCubeFace=t;var r=this.views[t];this.camera.position.set(0,0,0),this.camera.up.set(r.u[0],r.u[1],r.u[2]),this.camera.lookAt(r.t[0],r.t[1],r.t[2]),e.render(this.scene,this.camera,this.renderTarget,!0)}return this.renderTarget.texture},getShader:function(){var e=new a.ShaderMaterial({uniforms:{equirectangularMap:{value:this.sourceTexture}},vertexShader:"varying vec3 localPosition;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tlocalPosition = position;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \n\t\t\t\tvarying vec3 localPosition;\n\t\t\t\tuniform sampler2D equirectangularMap;\n\t\t\t\t\n\t\t\t\tvec2 EquiangularSampleUV(vec3 v) {\n\t\t\t vec2 uv = vec2(atan(v.z, v.x), asin(v.y));\n\t\t\t uv *= vec2(0.1591, 0.3183); // inverse atan\n\t\t\t uv += 0.5;\n\t\t\t return uv;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = EquiangularSampleUV(normalize(localPosition));\n \t\t\tvec3 color = texture2D(equirectangularMap, uv).rgb;\n \t\t\t\n\t\t\t\t\tgl_FragColor = vec4( color, 1.0 );\n\t\t\t\t}",blending:a.CustomBlending,premultipliedAlpha:!1,blendSrc:a.OneFactor,blendDst:a.ZeroFactor,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.ZeroFactor,blendEquation:a.AddEquation});return e.type="EquiangularToCubeGenerator",e},dispose:function(){this.boxMesh.geometry.dispose(),this.boxMesh.material.dispose(),this.renderTarget.dispose()}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};(n.prototype=Object.create(a.DataTextureLoader.prototype))._parser=function(e){var t=65536,r=t>>3,n=14,i=65537,o=1<>r&(1<a)return!1;g(6,h,d,e,f);var p=v.l;if(h=v.c,d=v.lc,s[n]=p,p==u){if(f.value-r.value>a)throw"Something wrong with hufUnpackEncTable";g(8,h,d,e,f);var m=v.l+c;if(h=v.c,d=v.lc,n+m>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}else if(p>=l){if(n+(m=p-l+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}}!function(e){for(var t=0;t<=58;++t)y[t]=0;for(t=0;t0;--t){var a=r+y[t]>>1;y[t]=r,r=a}for(t=0;t0&&(e[t]=n|y[n]++<<6)}}(s)}function w(e){return 63&e}function x(e){return e>>6}var _={c:0,lc:0};function A(e,t,r,a){e=e<<8|I(r,a),t+=8,_.c=e,_.lc=t}var E={c:0,lc:0};function S(e,t,r,a,n,i,o,s,l,u){if(e==t){a<8&&(A(r,a,n,o),r=_.c,a=_.lc);var c=r>>(a-=8);if(out+c>oe)throw"Issue with getCode";for(var f=out[-1];c-- >0;)s[l.value++]=f}else{if(!(l.value32767?t-65536:t}var T={a:0,b:0};function P(e,t){var r=M(e),a=M(t),n=r+(1&a)+(a>>1),i=n,o=n-a;T.a=i,T.b=o}function F(e,t,r,a,n,i,o){for(var s,l=r>n?n:r,u=1;u<=l;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var c,f,h,d,p=0,m=p+i*(n-s),v=i*u,g=i*s,y=a*u,b=a*s;p<=m;p+=g){for(var w=p,x=p+a*(r-s);w<=x;w+=b){var _=w+y,A=(E=w+v)+y;P(t[w+e],t[E+e]),c=T.a,h=T.b,P(t[_+e],t[A+e]),f=T.a,d=T.b,P(c,f),t[w+e]=T.a,t[_+e]=T.b,P(h,d),t[E+e]=T.a,t[A+e]=T.b}if(r&u){var E=w+v;P(t[w+e],t[E+e]),c=T.a,t[E+e]=T.b,t[w+e]=c}}if(n&u)for(w=p,x=p+a*(r-s);w<=x;w+=b){_=w+y;P(t[w+e],t[_+e]),c=T.a,t[_+e]=T.b,t[w+e]=c}s=u,u>>=1}return p}function O(e,t,r,a,l,u,c){var f=r.value,h=R(t,r),d=R(t,r);r.value+=4;var p=R(t,r);if(r.value+=4,h<0||h>=i||d<0||d>=i)throw"Something wrong with HUF_ENCSIZE";var m=new Array(i),v=new Array(o);if(function(e){for(var t=0;t8*(a-(r.value-f)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var i=x(e[t]),o=w(e[t]);if(i>>o)throw"Invalid table entry";if(o>n){if((c=a[i>>o-n]).len)throw"Invalid table entry";if(c.lit++,c.p){var s=c.p;c.p=new Array(c.lit);for(var l=0;l0;l--){var c;if((c=a[(i<=n;){if((b=t[h>>d-n&s]).len)d-=b.len,S(b.lit,l,h,d,r,0,i,c,f,p),h=E.c,d=E.lc;else{if(!b.p)throw"hufDecode issues";var v;for(v=0;v=g&&x(e[b.p[v]])==(h>>d-g&(1<>=y,d-=y;d>0;){var b;if(!(b=t[h<=r)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(d<=p)for(var m=0;m>3]&1<<(7&n))&&(r[a++]=n);for(var i=a-1;a>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function j(e,t){var r=e.getUint16(t.value,!0);return t.value+=p,r}function B(e,t){return U(j(e,t))}function V(e,t,r,a,n){if("string"===a||"iccProfile"===a)return function(e,t,r){var a=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,a}(t,r,n);if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value0&&void 0!==r[l[0].ID]&&(0!==(i=r[l[0].ID]).indexOf("blob:")&&0!==i.indexOf("data:")||t.setPath(void 0));o="tga"===e.FileName.slice(-3).toLowerCase()?n.Loader.Handlers.get(".tga").load(i):t.load(i);return t.setPath(s),o}(e,t,r,a);i.ID=e.id,i.name=e.attrName;var o=e.WrapModeU,s=e.WrapModeV,l=void 0!==o?o.value:0,u=void 0!==s?s.value:0;if(i.wrapS=0===l?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===u?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){var c=e.Scaling.value;i.repeat.x=c[0],i.repeat.y=c[1]}return i}function i(e,t,r,i){var s=t.id,l=t.attrName,u=t.ShadingModel;if("object"===(void 0===u?"undefined":a(u))&&(u=u.value),!i.has(s))return null;var c,f=function(e,t,r,a,i){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value);t.Diffuse?s.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new n.Color).fromArray(t.DiffuseColor.value));t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value);t.Emissive?s.emissive=(new n.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new n.Color).fromArray(t.EmissiveColor.value));t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value));t.Opacity&&(s.opacity=parseFloat(t.Opacity.value));s.opacity<1&&(s.transparent=!0);t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value);t.Shininess&&(s.shininess=t.Shininess.value);t.Specular?s.specular=(new n.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new n.Color).fromArray(t.SpecularColor.value));return i.get(a).children.forEach((function(t){var a=t.relationship;switch(a){case"Bump":s.bumpMap=r.get(t.ID);break;case"DiffuseColor":s.map=o(e,r,t.ID,i);break;case"DisplacementColor":s.displacementMap=o(e,r,t.ID,i);break;case"EmissiveColor":s.emissiveMap=o(e,r,t.ID,i);break;case"NormalMap":s.normalMap=o(e,r,t.ID,i);break;case"ReflectionColor":s.envMap=o(e,r,t.ID,i),s.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":s.specularMap=o(e,r,t.ID,i);break;case"TransparentColor":s.alphaMap=o(e,r,t.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a)}})),s}(e,t,r,s,i);switch(u.toLowerCase()){case"phong":c=new n.MeshPhongMaterial;break;case"lambert":c=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',u),c=new n.MeshPhongMaterial({color:3342591})}return c.setValues(f),c.name=l,c}function o(e,t,r,a){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=a.get(r).children[0].ID),t.get(r)}function s(e,t){var r=[];return e.children.forEach((function(e){var a=t[e.ID];if("Cluster"===a.attrType){var i={ID:e.ID,indices:[],weights:[],transform:(new n.Matrix4).fromArray(a.Transform.a),transformLink:(new n.Matrix4).fromArray(a.TransformLink.a),linkMode:a.Mode};"Indexes"in a&&(i.indices=a.Indexes.a,i.weights=a.Weights.a),r.push(i)}})),{rawBones:r,bones:[]}}function l(e,t,r,a){for(var n=[],i=0;i0&&o.addAttribute("color",new n.Float32BufferAttribute(l.colors,3));r&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(l.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(l.vertexWeights,4)),o.FBX_Deformer=r);if(l.normal.length>0){var h=new n.Float32BufferAttribute(l.normal,3);(new n.Matrix3).getNormalMatrix(i).applyToBufferAttribute(h),o.addAttribute("normal",h)}if(l.uvs.forEach((function(e,t){var r="uv"+(t+1).toString();0===t&&(r="uv"),o.addAttribute(r,new n.Float32BufferAttribute(l.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){var d=l.materialIndex[0],p=0;if(l.materialIndex.forEach((function(e,t){e!==d&&(o.addGroup(p,t-p,d),d=e,p=t)})),o.groups.length>0){var m=o.groups[o.groups.length-1],v=m.start+m.count;v!==l.materialIndex.length&&o.addGroup(v,l.materialIndex.length-v,d)}0===o.groups.length&&o.addGroup(0,l.materialIndex.length,l.materialIndex[0])}return function(e,t,r,a,i){if(null===a)return;t.morphAttributes.position=[],t.morphAttributes.normal=[],a.rawTargets.forEach((function(a){var o=e.Objects.Geometry[a.geoID];void 0!==o&&function(e,t,r,a){var i=new n.BufferGeometry;r.attrName&&(i.name=r.attrName);for(var o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],s=void 0!==t.Vertices?t.Vertices.a.slice():[],l=void 0!==r.Vertices?r.Vertices.a:[],u=void 0!==r.Indexes?r.Indexes.a:[],f=0;f4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);var y=[0,0,0,0],b=[0,0,0,0];v.forEach((function(e,t){var r=e,a=m[t];b.forEach((function(e,t,n){if(r>e){n[t]=r,r=e;var i=y[t];y[t]=a,a=i}}))})),m=y,v=b}for(;v.length<4;)v.push(0),m.push(0);for(var w=0;w<4;++w)u.push(v[w]),c.push(m[w])}if(e.normal){g=d(h,r,f,e.normal);o.push(g[0],g[1],g[2])}if(e.material&&"AllSame"!==e.material.mappingType)var x=d(h,r,f,e.material)[0];e.uv&&e.uv.forEach((function(e,t){var a=d(h,r,f,e);void 0===l[t]&&(l[t]=[]),l[t].push(a[0]),l[t].push(a[1])})),a++,p&&(!function(e,t,r,a,n,i,o,s,l,u){for(var c=2;c=f.length&&f===C(c,0,f.length))o=(new M).parse(e);else{var h=C(e);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;for(var a=0;a0,u="string"==typeof o.Content&&""!==o.Content;if(l||u){var c=t(n[i]);a[o.RelativeFilename||o.Filename]=c}}}}for(var s in r){var f=r[s];void 0!==a[f]?r[s]=a[f]:r[s]=r[s].split("\\").pop()}return r}(o),_=function(e,t,r){var a=new Map;if("Material"in e.Objects){var n=e.Objects.Material;for(var o in n){var s=i(e,n[o],t,r);null!==s&&a.set(parseInt(o),s)}}return a}(o,function(e,t,a,n){var i=new Map;if("Texture"in e.Objects){var o=e.Objects.Texture;for(var s in o){var l=r(o[s],t,a,n);i.set(parseInt(s),l)}}return i}(o,new n.TextureLoader(this.manager).setPath(a),x,d),d),A=function(e,t){var r={},a={};if("Deformer"in e.Objects){var n=e.Objects.Deformer;for(var i in n){var o=n[i],u=t.get(parseInt(i));if("Skin"===o.attrType){var c=s(u,n);c.ID=i,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),c.geometryID=u.parents[0].ID,r[i]=c}else if("BlendShape"===o.attrType){var f={id:i};f.rawTargets=l(u,o,n,t),f.id=i,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),f.parentGeoID=u.parents[0].ID,a[i]=f}}}return{skeletons:r,morphTargets:a}}(o,d),E=function(e,t,r){var a=new Map;if("Geometry"in e.Objects){var n=e.Objects.Geometry;for(var i in n){var o=t.get(parseInt(i)),s=u(e,o,n[i],r);a.set(parseInt(i),s)}}return a}(o,d,A);return function(e,t,r,a,i){var o=new n.Group,s=function(e,t,r,a,i){var o=new Map,s=e.Objects.Model;for(var l in s){var u=parseInt(l),c=s[l],f=i.get(u),h=p(f,t,u,c.attrName);if(!h){switch(c.attrType){case"Camera":h=m(e,f);break;case"Light":h=v(e,f);break;case"Mesh":h=g(e,f,r,a);break;case"NurbsCurve":h=y(f,r);break;case"LimbNode":case"Null":default:h=new n.Group}h.name=n.PropertyBinding.sanitizeNodeName(c.attrName),h.ID=u}b(e,h,c),o.set(u,h)}return o}(e,r,a,i,t),l=e.Objects.Model;return s.forEach((function(r){var a=l[r.ID];!function(e,t,r,a,i){if("LookAtProperty"in r){a.get(t.ID).children.forEach((function(r){if("LookAtProperty"===r.relationship){var a=e.Objects.Model[r.ID];if("Lcl_Translation"in a){var o=a.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(o),i.add(t.target)):t.lookAt((new n.Vector3).fromArray(o))}}}))}}(e,r,a,t,o),t.get(r.ID).parents.forEach((function(e){var t=s.get(e.ID);void 0!==t&&t.add(r)})),null===r.parent&&o.add(r)})),function(e,t,r,a,i){var o=function(e){var t={};if("Pose"in e.Objects){var r=e.Objects.Pose;for(var a in r)if("BindPose"===r[a].attrType){var i=r[a].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new n.Matrix4).fromArray(e.Matrix.a)})):t[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return t}(e);for(var s in t){var l=t[s];i.get(parseInt(l.ID)).parents.forEach((function(e){if(r.has(e.ID)){var t=e.ID;i.get(t).parents.forEach((function(e){a.has(e.ID)&&a.get(e.ID).bind(new n.Skeleton(l.bones),o[e.ID])}))}}))}}(e,r,a,s,t),function(e,t,r){r.animations=[];var a=function(e,t){if(void 0===e.Objects.AnimationCurve)return;var r=function(e){var t=e.Objects.AnimationCurveNode,r=new Map;for(var a in t){var n=t[a];if(null!==n.attrName.match(/S|R|T/)){var i={id:n.id,attr:n.attrName,curves:{}};r.set(i.id,i)}}return r}(e);!function(e,t,r){var a=e.Objects.AnimationCurve;for(var n in a){var i={id:a[n].id,times:a[n].KeyTime.a.map(O),values:a[n].KeyValueFloat.a},o=t.get(i.id);if(void 0!==o){var s=o.parents[0].ID,l=o.parents[0].relationship;l.match(/X/)?r.get(s).curves.x=i:l.match(/Y/)?r.get(s).curves.y=i:l.match(/Z/)&&(r.get(s).curves.z=i)}}}(e,t,r);var a=function(e,t,r){var a=e.Objects.AnimationLayer,i=new Map;for(var o in a){var s=[],l=t.get(parseInt(o));if(void 0!==l)l.children.forEach((function(a,i){if(r.has(a.ID)){var o=r.get(a.ID);if(void 0!==o.curves.x||void 0!==o.curves.y||void 0!==o.curves.z){if(void 0===s[i]){var l;t.get(a.ID).parents.forEach((function(e){void 0!==e.relationship&&(l=e.ID)}));var u=e.Objects.Model[l.toString()],c={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};"Lcl_Translation"in u&&(c.initialPosition=u.Lcl_Translation.value),"Lcl_Rotation"in u&&(c.initialRotation=u.Lcl_Rotation.value),"Lcl_Scaling"in u&&(c.initialScale=u.Lcl_Scaling.value),"PreRotation"in u&&(c.preRotations=u.PreRotation.value),s[i]=c}s[i][o.attr]=o}}})),i.set(parseInt(o),s)}return i}(e,t,r);return function(e,t,r){var a=e.Objects.AnimationStack,n={};for(var i in a){var o=t.get(parseInt(i)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=r.get(o[0].ID);n[i]={name:a[i].attrName,layer:s}}return n}(e,t,a)}(e,t);if(void 0===a)return;for(var i in a){var o=w(a[i]);r.animations.push(o)}}(e,t,o),function(e,t){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var r=e.GlobalSettings.AmbientColor.value,a=r[0],i=r[1],o=r[2];if(0!==a||0!==i||0!==o){var s=new n.Color(a,i,o);t.add(new n.AmbientLight(s,1))}}}(e,o),o}(o,d,A.skeletons,E,_)}});var h=[];function d(e,t,r,a){var n;switch(a.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=r;break;case"AllSame":n=a.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+a.mappingType)}"IndexToDirect"===a.referenceType&&(n=a.indices[n]);var i=n*a.dataSize,o=i+a.dataSize;return function(e,t,r,a){for(var n=r,i=0;n1?s=l:l.length>0?s=l[0]:(s=new n.MeshPhongMaterial({color:13421772}),l.push(s)),"color"in o.attributes&&l.forEach((function(e){e.vertexColors=n.VertexColors})),o.FBX_Deformer?(l.forEach((function(e){e.skinning=!0})),i=new n.SkinnedMesh(o,s)):i=new n.Mesh(o,s),i}function y(e,t){var r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),a=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,a)}function b(e,t,r){if("RotationOrder"in r){var a=parseInt(r.RotationOrder.value,10);a>0&&a<6?console.warn("THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.",["XYZ","XZY","YZX","ZXY","YXZ","ZYX","SphericXYZ"][a]):6===a&&console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.")}if("Lcl_Translation"in r&&t.position.fromArray(r.Lcl_Translation.value),"Lcl_Rotation"in r){var i=r.Lcl_Rotation.value.map(n.Math.degToRad);i.push("ZYX"),t.quaternion.setFromEuler((new n.Euler).fromArray(i))}if("Lcl_Scaling"in r&&t.scale.fromArray(r.Lcl_Scaling.value),"PreRotation"in r){var o=r.PreRotation.value.map(n.Math.degToRad);o[3]="ZYX";var s=(new n.Euler).fromArray(o);s=(new n.Quaternion).setFromEuler(s),t.quaternion.premultiply(s)}}function w(e){var t=[];return e.layer.forEach((function(e){t=t.concat(function(e){var t=[];if(void 0!==e.T&&Object.keys(e.T.curves).length>0){var r=x(e.modelName,e.T.curves,e.initialPosition,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=function(e,t,r,a){void 0!==t.x&&(E(t.x),t.x.values=t.x.values.map(n.Math.degToRad));void 0!==t.y&&(E(t.y),t.y.values=t.y.values.map(n.Math.degToRad));void 0!==t.z&&(E(t.z),t.z.values=t.z.values.map(n.Math.degToRad));var i=A(t),o=_(i,t,r);void 0!==a&&((a=a.map(n.Math.degToRad)).push("ZYX"),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a));for(var s=new n.Quaternion,l=new n.Euler,u=[],c=0;c0){var i=x(e.modelName,e.S.curves,e.initialScale,"scale");void 0!==i&&t.push(i)}return t}(e))})),new n.AnimationClip(e.name,-1,t)}function x(e,t,r,a){var i=A(t),o=_(i,t,r);return new n.VectorKeyframeTrack(e+"."+a,i,o)}function _(e,t,r){var a=r,n=[],i=-1,o=-1,s=-1;return e.forEach((function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(s=t.z.times.indexOf(e)),-1!==i){var r=t.x.values[i];n.push(r),a[0]=r}else n.push(a[0]);if(-1!==o){var l=t.y.values[o];n.push(l),a[1]=l}else n.push(a[1]);if(-1!==s){var u=t.z.values[s];n.push(u),a[2]=u}else n.push(a[2])})),n}function A(e){var t=[];return void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})).filter((function(e,t,r){return r.indexOf(e)==t}))}function E(e){for(var t=1;t=180){for(var i=n/180,o=a/i,s=r+o,l=e.times[t-1],u=(e.times[t]-l)/i,c=l+u,f=[],h=[];c1&&(r=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:r,type:a}},parseNodeProperty:function(e,t,r){var a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===a&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());var i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===a){var o=n.split(",").slice(1),s=parseInt(o[0]),l=parseInt(o[1]),u=n.split(",").slice(3);a="connections",function(e,t){for(var r=0,a=e.length,n=t.length;r=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var r={},a=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32(),i=(t>=7500?e.getUint64():e.getUint32(),e.getUint8()),o=e.getString(i);if(0===a)return null;for(var s=[],l=0;l0?s[0]:"",c=s.length>1?s[1]:"",f=s.length>2?s[2]:"";for(r.singleProperty=1===n&&e.getOffset()===a;a>e.getOffset();){var h=this.parseNode(e,t);null!==h&&this.parseSubNode(o,r,h)}return r.propertyList=s,"number"==typeof u&&(r.id=u),""!==c&&(r.attrName=c),""!==f&&(r.attrType=f),""!==o&&(r.name=o),r},parseSubNode:function(e,t,r){if(!0===r.singleProperty){var a=r.propertyList[0];Array.isArray(a)?(t[r.name]=r,r.a=a):t[r.name]=a}else if("Connections"===e&&"C"===r.name){var n=[];r.propertyList.forEach((function(e,t){0!==t&&n.push(e)})),void 0===t.connections&&(t.connections=[]),t.connections.push(n)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){var i,o=r.propertyList[0],s=r.propertyList[1],l=r.propertyList[2],u=r.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),i="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[o]={type:s,type2:l,flag:u,value:i}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var r=e.getUint32();return e.getArrayBuffer(r);case"S":r=e.getUint32();return e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var a=e.getUint32(),n=e.getUint32(),i=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}void 0===window.Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var o=new T(new Zlib.Inflate(new Uint8Array(e.getArrayBuffer(i))).decompress().buffer);switch(t){case"b":case"c":return o.getBooleanArray(a);case"d":return o.getFloat64Array(a);case"f":return o.getFloat32Array(a);case"i":return o.getInt32Array(a);case"l":return o.getInt64Array(a)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}),Object.assign(T.prototype,{getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],r=0;r=0&&(t=t.slice(0,a)),n.LoaderUtils.decodeText(t)}}),Object.assign(P.prototype,{add:function(e,t){this[e]=t}}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.splitLayer=!1};n.prototype.load=function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},n.prototype.parse=function(e){var t={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},r=[],n=void 0,i=new a.LineBasicMaterial({color:16711680});i.name="path";var o=new a.LineBasicMaterial({color:65280});function s(e){n={vertex:[],pathVertex:[],z:e.z},r.push(n)}function l(e,r){return t.relative?r:r-e}function u(e,r){return t.relative?e+r:r}o.name="extruded";for(var c,f,h=e.replace(/;.+/g,"").split("\n"),d=0;d0&&(g.extruding=l(t.e,g.e)>0,null!=n&&g.z==n.z||s(g)),c=t,f=g,void 0===n&&s(c),g.extruding?(n.vertex.push(c.x,c.y,c.z),n.vertex.push(f.x,f.y,f.z)):(n.pathVertex.push(c.x,c.y,c.z),n.pathVertex.push(f.x,f.y,f.z)),t=g}else if("G2"===m||"G3"===m)console.warn("THREE.GCodeLoader: Arc command not supported");else if("G90"===m)t.relative=!1;else if("G91"===m)t.relative=!0;else if("G92"===m){(g=t).x=void 0!==v.x?v.x:g.x,g.y=void 0!==v.y?v.y:g.y,g.z=void 0!==v.z?v.z:g.z,g.e=void 0!==v.e?v.e:g.e,t=g}else console.warn("THREE.GCodeLoader: Command not supported:"+m)}function y(e,t){var r=new a.BufferGeometry;r.addAttribute("position",new a.Float32BufferAttribute(e,3));var n=new a.LineSegments(r,t?o:i);n.name="layer"+d,b.add(n)}var b=new a.Group;if(b.name="gcode",this.splitLayer)for(d=0;d>16&32768,i=a>>12&2047,o=a>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&a):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)}return function(e,t,a,n){var i=e[t+3],o=Math.pow(2,i-128)/255;a[n+0]=r(e[t+0]*o),a[n+1]=r(e[t+1]*o),a[n+2]=r(e[t+2]*o)}}(),l=new n.CubeTexture;l.type=e,l.encoding=e===n.UnsignedByteType?n.RGBEEncoding:n.LinearEncoding,l.format=e===n.UnsignedByteType?n.RGBAFormat:n.RGBFormat,l.minFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.magFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.generateMipmaps=l.encoding!==n.RGBEEncoding,l.anisotropy=0;var u=this.hdrLoader,c=0;function f(r,a,i,f){var h=new n.FileLoader(this.manager);h.setResponseType("arraybuffer"),h.load(t[r],(function(t){c++;var i=u._parser(t);if(i){if(e===n.FloatType){for(var f=i.data.length/4*3,h=new Float32Array(f),d=0;d>8&65280|e>>24&255},e.prototype.mipmaps=function(t){for(var r=[],a=e.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight,o=t?this.numberOfMipmapLevels:1,s=0;s0?o():t(n.mergeVmds(i))}),r,a)}()},s.prototype.loadAudio=function(e,t,r,n){var i=new a.AudioListener,o=new a.Audio(i);new a.AudioLoader(this.manager).load(e,(function(e){o.setBuffer(e),t(o,i)}),r,n)},s.prototype.loadVpd=function(e,t,r,a,n){var i=this;(n&&"unicode"===n.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this)(e,(function(e){t(i.parseVpd(e))}),r,a)},s.prototype.parseModel=function(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}},s.prototype.parsePmd=function(e){return this.parser.parsePmd(e,!0)},s.prototype.parsePmx=function(e){return this.parser.parsePmx(e,!0)},s.prototype.parseVmd=function(e){return this.parser.parseVmd(e,!0)},s.prototype.parseVpd=function(e){return this.parser.parseVpd(e,!0)},s.prototype.mergeVmds=function(e){return this.parser.mergeVmds(e)},s.prototype.pourVmdIntoModel=function(e,t,r){this.createAnimation(e,t,r)},s.prototype.pourVmdIntoCamera=function(e,t,r){var n=new s.DataCreationHelper;!function(){for(var i,o,l=n.createOrderedMotionArray(t.cameras),u=[],c=[],f=[],h=[],d=[],p=[],m=[],v=[],g=[],y=new a.Quaternion,b=new a.Euler,w=new a.Vector3,x=new a.Vector3,_=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},A=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},E=function(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();for(var o=n.length/r.length,l=3===o?12:4,u=1,c=2,f=r.length;cu){r[u]=r[c];for(h=0;h=a?r.skinIndices[a]:0);for(a=0;a<4;a++)l.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t=0&&(l.limitation=new a.Vector3(1,0,0)),s.links.push(l)}t.push(s)}else for(r=0;r=0?c:u);var p=d.load(s,(function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,n=t.height;f.width=r,f.height=n,h.clearRect(0,0,r,n),h.translate(r/2,n/2),h.rotate(.5*Math.PI),h.translate(-r/2,-n/2),h.drawImage(t,0,0),e.image=h.getImageData(0,0,r,n)}e.flipY=!1,e.wrapS=a.RepeatWrapping,e.wrapT=a.RepeatWrapping;for(var i=0;i=0?(x.push(w.slice(0,_)),x.push(w.slice(_+1))):x.push(w);for(var A=0;A=0||E.indexOf(".spa")>=0?(b.envMap=m(E,{sphericalReflectionMapping:!0}),E.indexOf(".sph")>=0?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation):b.map=m(E)}}}else{if(-1!==y.textureIndex){var E=e.textures[y.textureIndex];b.map=m(E)}if(-1!==y.envTextureIndex&&(1===y.envFlag||2==y.envFlag)){E=e.textures[y.envTextureIndex];b.envMap=m(E,{sphericalReflectionMapping:!0}),1===y.envFlag?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation}}var S=void 0===b.map?1:.2;b.emissive=new a.Color(y.ambient[0]*S,y.ambient[1]*S,y.ambient[2]*S),p.push(b)}for(g=0;g0,y.morphTargets=o.morphTargets.length>0,y.lights=!0,y.side="pmx"===e.metadata.format&&1==(1&T.flag)?a.DoubleSide:M.side,y.transparent=M.transparent,y.fog=!0,y.blending=a.CustomBlending,y.blendSrc=a.SrcAlphaFactor,y.blendDst=a.OneMinusSrcAlphaFactor,y.blendSrcAlpha=a.SrcAlphaFactor,y.blendDstAlpha=a.DstAlphaFactor,void 0!==M.map){y.faceOffset=M.faceOffset,y.faceNum=M.faceNum,y.map=v(M.map,l),function(e){e.map.readyCallbacks.push((function(t){function r(e,t){var r=e.width,a=e.height,n=Math.round(t.x*r)%r,i=Math.round(t.y*a)%a;n<0&&(n+=r),i<0&&(i+=a);var o=i*r+n;return e.data[4*o+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),n=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var n=e.width,i=e.height;if(e.data.length/(n*i)!=4)return!1;for(var o=0;o=this.duration;)this.currentTime-=this.duration;return!(this.currentTime=this.duration}},a.MMDGrantSolver=function(e){this.mesh=e},a.MMDGrantSolver.prototype={constructor:a.MMDGrantSolver,update:(o=new a.Quaternion,function(){for(var e=0;e0)}},setAnimations:function(){for(var e=0;e0&&0!==e.action._clip.tracks[0].name.indexOf(".bones")||(e.target._root.looped=!0)}));for(var t=!1,r=!1,n=0;n0&&0===i.tracks[0].name.indexOf(".morphTargetInfluences")?r||(o.play(),r=!0):t||(o.play(),t=!0)}t&&(e.ikSolver=new a.CCDIKSolver(e),void 0!==e.geometry.grants&&(e.grantSolver=new a.MMDGrantSolver(e)))}},setCameraAnimation:function(e){void 0!==e.animations&&(e.mixer=new a.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())},unifyAnimationDuration:function(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,n=0;n0,i=!0,s={};var l=function(e,n){null==n&&(n=1);var o=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,o=2;break;case"sshort":s=Int16Array,o=2;break;case"uint":s=Uint32Array,o=4;break;case"sint":s=Int32Array,o=4;break;case"float":s=Float32Array,o=4;break;case"complex":case"double":s=Float64Array,o=8}var l=new s(t.slice(r,r+=n*o));return a!=i&&(l=function(e,t){for(var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=0;ai;n--,i++){var o=r[i];r[i]=r[n],r[n]=o}return e}(l,o)),1==n?l[0]:l}("uchar",e.byteLength),u=l.length,c=null,f=0;for(p=1;p13)&&32!==a?n+=String.fromCharCode(a):(""!==n&&(l[u]=c(n,o),u++),n="");return""!==n&&(l[u]=c(n,o),u++),l}(t);else if("raw"===s.encoding){for(var d=new Uint8Array(t.length),p=0;p0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,n=this.object.geometry.vertices;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){var a=this.normals,n=this.object.geometry.normals;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addColor:function(e,t,r){var a=this.colors,n=this.object.geometry.colors;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addUV:function(e,t,r){var a=this.uvs,n=this.object.geometry.uvs;n.push(a[e+0],a[e+1]),n.push(a[t+0],a[t+1]),n.push(a[r+0],a[r+1])},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,a,n,i,o,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),f=this.parseVertexIndex(t,u),h=this.parseVertexIndex(r,u);if(this.addVertex(c,f,h),void 0!==a&&""!==a){var d=this.uvs.length;c=this.parseUVIndex(a,d),f=this.parseUVIndex(n,d),h=this.parseUVIndex(i,d),this.addUV(c,f,h)}if(void 0!==o&&""!==o){var p=this.normals.length;c=this.parseNormalIndex(o,p),f=o===s?c:this.parseNormalIndex(s,p),h=o===l?c:this.parseNormalIndex(l,p),this.addNormal(c,f,h)}this.colors.length>0&&this.addColor(c,f,h)},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,r=0,a=e.length;r0){var w=b.split("/");v.push(w)}}var x=v[0];for(g=1,y=v.length-1;g1){var C=c[1].trim().toLowerCase();o.object.smooth="0"!==C&&"off"!==C}else o.object.smooth=!0;(Y=o.object.currentMaterial())&&(Y.smooth=o.object.smooth)}o.finalize();var k=new a.Group;k.materialLibraries=[].concat(o.materialLibraries);for(h=0,d=o.objects.length;h0?B.addAttribute("normal",new a.Float32BufferAttribute(I.normals,3)):B.computeVertexNormals(),I.colors.length>0&&(j=!0,B.addAttribute("color",new a.Float32BufferAttribute(I.colors,3))),I.uvs.length>0&&B.addAttribute("uv",new a.Float32BufferAttribute(I.uvs,2));for(var V,z=[],G=0,H=N.length;G1){for(G=0,H=N.length;Gf){f=h;var r='Download of "'+e.url+'": '+(100*h).toFixed(2)+"%";u.onProgress("progressLoad",r,h)}}}var d=new a.FileLoader(this.manager);d.setPath(this.path),d.setResponseType("arraybuffer"),d.load(e.url,c,i,o)}},r.prototype.run=function(e,r){this._applyPrepData(e);var a=e.checkResourceDescriptorFiles(e.resources,[{ext:"obj",type:"ArrayBuffer",ignore:!1},{ext:"mtl",type:"String",ignore:!1},{ext:"zip",type:"String",ignore:!0}]);t.isValid(r)&&(this.terminateWorkerOnLoad=!1,this.workerSupport=r,this.logging.enabled=this.workerSupport.logging.enabled,this.logging.debug=this.workerSupport.logging.debug);var n=this;this._loadMtl(a.mtl,(function(t){null!==t&&n.meshBuilder.setMaterials(t),n._loadObj(a.obj,n.callbacks.onLoad,null,null,n.callbacks.onMeshAlter,e.useAsync)}),e.crossOrigin,e.materialOptions)},r.prototype._applyPrepData=function(e){t.isValid(e)&&(this.setLogging(e.logging.enabled,e.logging.debug),this.setModelName(e.modelName),this.setStreamMeshesTo(e.streamMeshesTo),this.meshBuilder.setMaterials(e.materials),this.setUseIndices(e.useIndices),this.setDisregardNormals(e.disregardNormals),this.setMaterialPerSmoothingGroup(e.materialPerSmoothingGroup),this._setCallbacks(e.getCallbacks()))},r.prototype.parse=function(e){if(!t.isValid(e))return console.warn("Provided content is not a valid ArrayBuffer or String."),this.loaderRootNode;this.logging.enabled&&console.time("OBJLoader2 parse: "+this.modelName),this.meshBuilder.init();var r=new o;r.setLogging(this.logging.enabled,this.logging.debug),r.setMaterialPerSmoothingGroup(this.materialPerSmoothingGroup),r.setUseIndices(this.useIndices),r.setDisregardNormals(this.disregardNormals),r.setMaterials(this.meshBuilder.getMaterials());var a=this;r.setCallbackMeshBuilder((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}));if(r.setCallbackProgress((function(e,t){a.onProgress("progressParse",e,t)})),e instanceof ArrayBuffer||e instanceof Uint8Array)this.logging.enabled&&console.info("Parsing arrayBuffer..."),r.parse(e);else{if(!("string"==typeof e||e instanceof String))throw"Provided content was neither of type String nor Uint8Array! Aborting...";this.logging.enabled&&console.info("Parsing text..."),r.parseText(e)}return this.logging.enabled&&console.timeEnd("OBJLoader2 parse: "+this.modelName),this.loaderRootNode},r.prototype.parseAsync=function(e,r){var a=this,n=!1,i=function(){r({detail:{loaderRootNode:a.loaderRootNode,modelName:a.modelName,instanceNo:a.instanceNo}}),n&&a.logging.enabled&&console.timeEnd("OBJLoader2 parseAsync: "+a.modelName)};t.isValid(e)?n=!0:(console.warn("Provided content is not a valid ArrayBuffer."),i()),n&&this.logging.enabled&&console.time("OBJLoader2 parseAsync: "+this.modelName),this.meshBuilder.init();this.workerSupport.validate((function(e,r){var a="";return a+="/**\n",a+=" * This code was constructed by OBJLoader2 buildCode.\n",a+=" */\n\n",a+="THREE = { LoaderSupport: {} };\n\n",a+=e("LoaderSupport.Validator",t),a+=r("Parser",o)}),"Parser"),this.workerSupport.setCallbacks((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}),i),a.terminateWorkerOnLoad&&this.workerSupport.setTerminateRequested(!0);var s={},l=this.meshBuilder.getMaterials();for(var u in l)s[u]=u;this.workerSupport.run({params:{useAsync:!0,materialPerSmoothingGroup:this.materialPerSmoothingGroup,useIndices:this.useIndices,disregardNormals:this.disregardNormals},logging:{enabled:this.logging.enabled,debug:this.logging.debug},materials:{materials:s},data:{input:e,options:null}})};var o=function(){function e(){this.callbackProgress=null,this.callbackMeshBuilder=null,this.contentRef=null,this.legacyMode=!1,this.materials={},this.useAsync=!1,this.materialPerSmoothingGroup=!1,this.useIndices=!1,this.disregardNormals=!1,this.vertices=[],this.colors=[],this.normals=[],this.uvs=[],this.rawMesh={objectName:"",groupName:"",activeMtlName:"",mtllibName:"",faceType:-1,subGroups:[],subGroupInUse:null,smoothingGroup:{splitMaterials:!1,normalized:-1,real:-1},counts:{doubleIndicesCount:0,faceCount:0,mtlCount:0,smoothingGroupCount:0}},this.inputObjectCount=1,this.outputObjectCount=1,this.globalCounts={vertices:0,faces:0,doubleIndicesCount:0,lineByte:0,currentByte:0,totalBytes:0},this.logging={enabled:!0,debug:!1}}return e.prototype.resetRawMesh=function(){this.rawMesh.subGroups=[],this.rawMesh.subGroupInUse=null,this.rawMesh.smoothingGroup.normalized=-1,this.rawMesh.smoothingGroup.real=-1,this.pushSmoothingGroup(1),this.rawMesh.counts.doubleIndicesCount=0,this.rawMesh.counts.faceCount=0,this.rawMesh.counts.mtlCount=0,this.rawMesh.counts.smoothingGroupCount=0},e.prototype.setUseAsync=function(e){this.useAsync=e},e.prototype.setMaterialPerSmoothingGroup=function(e){this.materialPerSmoothingGroup=e},e.prototype.setUseIndices=function(e){this.useIndices=e},e.prototype.setDisregardNormals=function(e){this.disregardNormals=e},e.prototype.setMaterials=function(e){this.materials=n.default.Validator.verifyInput(e,this.materials),this.materials=n.default.Validator.verifyInput(this.materials,{})},e.prototype.setCallbackMeshBuilder=function(e){if(!n.default.Validator.isValid(e))throw'Unable to run as no "MeshBuilder" callback is set.';this.callbackMeshBuilder=e},e.prototype.setCallbackProgress=function(e){this.callbackProgress=e},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.configure=function(){if(this.pushSmoothingGroup(1),this.logging.enabled){var e=Object.keys(this.materials),t="OBJLoader2.Parser configuration:"+(e.length>0?"\n\tmaterialNames:\n\t\t- "+e.join("\n\t\t- "):"\n\tmaterialNames: None")+"\n\tuseAsync: "+this.useAsync+"\n\tmaterialPerSmoothingGroup: "+this.materialPerSmoothingGroup+"\n\tuseIndices: "+this.useIndices+"\n\tdisregardNormals: "+this.disregardNormals+"\n\tcallbackMeshBuilderName: "+this.callbackMeshBuilder.name+"\n\tcallbackProgressName: "+this.callbackProgress.name;console.info(t)}},e.prototype.parse=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parse"),this.configure();var t=new Uint8Array(e);this.contentRef=t;var r=t.byteLength;this.globalCounts.totalBytes=r;for(var a,n=new Array(128),i="",o=0,s=0,l=0;l0&&(n[o++]=i),i="";break;case 47:i.length>0&&(n[o++]=i),s++,i="";break;case 10:i.length>0&&(n[o++]=i),i="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=l,this.processLine(n,o,s),o=0,s=0;break;case 13:break;default:i+=String.fromCharCode(a)}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parse")},e.prototype.parseText=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parseText"),this.configure(),this.legacyMode=!0,this.contentRef=e;var t=e.length;this.globalCounts.totalBytes=t;for(var r,a=new Array(128),n="",i=0,o=0,s=0;s0&&(a[i++]=n),n="";break;case"/":n.length>0&&(a[i++]=n),o++,n="";break;case"\n":n.length>0&&(a[i++]=n),n="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=s,this.processLine(a,i,o),i=0,o=0;break;case"\r":break;default:n+=r}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parseText")},e.prototype.processLine=function(e,t,r){if(!(t<1)){var a,n,i,o,s=function(e,t,r,a){var n="";if(a>r){var i;if(t)for(i=r;i4&&(this.colors.push(parseFloat(e[4])),this.colors.push(parseFloat(e[5])),this.colors.push(parseFloat(e[6])));break;case"vt":this.uvs.push(parseFloat(e[1])),this.uvs.push(parseFloat(e[2]));break;case"vn":this.normals.push(parseFloat(e[1])),this.normals.push(parseFloat(e[2])),this.normals.push(parseFloat(e[3]));break;case"f":if(a=t-1,0===r)for(this.checkFaceType(0),i=2,n=a;i0?n-1:n+a.vertices.length/3),o=a.rawMesh.subGroupInUse.vertices;o.push(a.vertices[i++]),o.push(a.vertices[i++]),o.push(a.vertices[i]);var s=a.colors.length>0?i:null;if(null!==s){var l=a.rawMesh.subGroupInUse.colors;l.push(a.colors[s++]),l.push(a.colors[s++]),l.push(a.colors[s])}if(t){var u=parseInt(t),c=2*(u>0?u-1:u+a.uvs.length/2),f=a.rawMesh.subGroupInUse.uvs;f.push(a.uvs[c++]),f.push(a.uvs[c])}if(r){var h=parseInt(r),d=3*(h>0?h-1:h+a.normals.length/3),p=a.rawMesh.subGroupInUse.normals;p.push(a.normals[d++]),p.push(a.normals[d++]),p.push(a.normals[d])}};if(this.useIndices){var o=e+(t?"_"+t:"_n")+(r?"_"+r:"_n"),s=this.rawMesh.subGroupInUse.indexMappings[o];n.default.Validator.isValid(s)?this.rawMesh.counts.doubleIndicesCount++:(s=this.rawMesh.subGroupInUse.vertices.length/3,i(),this.rawMesh.subGroupInUse.indexMappings[o]=s,this.rawMesh.subGroupInUse.indexMappingsCount++),this.rawMesh.subGroupInUse.indices.push(s)}else i();this.rawMesh.counts.faceCount++},e.prototype.createRawMeshReport=function(e){return"Input Object number: "+e+"\n\tObject name: "+this.rawMesh.objectName+"\n\tGroup name: "+this.rawMesh.groupName+"\n\tMtllib name: "+this.rawMesh.mtllibName+"\n\tVertex count: "+this.vertices.length/3+"\n\tNormal count: "+this.normals.length/3+"\n\tUV count: "+this.uvs.length/2+"\n\tSmoothingGroup count: "+this.rawMesh.counts.smoothingGroupCount+"\n\tMaterial count: "+this.rawMesh.counts.mtlCount+"\n\tReal MeshOutputGroup count: "+this.rawMesh.subGroups.length},e.prototype.finalizeRawMesh=function(){var e,t,r=[],a=0,n=0,i=0,o=0,s=0,l=0;for(var u in this.rawMesh.subGroups)if((e=this.rawMesh.subGroups[u]).vertices.length>0){if((t=e.indices).length>0&&n>0)for(var c in t)t[c]=t[c]+n;r.push(e),a+=e.vertices.length,n+=e.indexMappingsCount,i+=e.indices.length,o+=e.colors.length,l+=e.uvs.length,s+=e.normals.length}var f=null;return r.length>0&&(f={name:""!==this.rawMesh.groupName?this.rawMesh.groupName:this.rawMesh.objectName,subGroups:r,absoluteVertexCount:a,absoluteIndexCount:i,absoluteColorCount:o,absoluteNormalCount:s,absoluteUvCount:l,faceCount:this.rawMesh.counts.faceCount,doubleIndicesCount:this.rawMesh.counts.doubleIndicesCount}),f},e.prototype.processCompletedMesh=function(){var e=this.finalizeRawMesh();if(n.default.Validator.isValid(e)){if(this.colors.length>0&&this.colors.length!==this.vertices.length)throw"Vertex Colors were detected, but vertex count and color count do not match!";this.logging.enabled&&this.logging.debug&&console.debug(this.createRawMeshReport(this.inputObjectCount)),this.inputObjectCount++,this.buildMesh(e);var t=this.globalCounts.currentByte/this.globalCounts.totalBytes;return this.callbackProgress("Completed [o: "+this.rawMesh.objectName+" g:"+this.rawMesh.groupName+"] Total progress: "+(100*t).toFixed(2)+"%",t),this.resetRawMesh(),!0}return!1},e.prototype.buildMesh=function(e){var t=e.subGroups,r=new Float32Array(e.absoluteVertexCount);this.globalCounts.vertices+=e.absoluteVertexCount/3,this.globalCounts.faces+=e.faceCount,this.globalCounts.doubleIndicesCount+=e.doubleIndicesCount;var a,i,o,s,l,u,c,f=e.absoluteIndexCount>0?new Uint32Array(e.absoluteIndexCount):null,h=e.absoluteColorCount>0?new Float32Array(e.absoluteColorCount):null,d=e.absoluteNormalCount>0?new Float32Array(e.absoluteNormalCount):null,p=e.absoluteUvCount>0?new Float32Array(e.absoluteUvCount):null,m=n.default.Validator.isValid(h),v=[],g=t.length>1,y=0,b=[],w=[],x=0,_=0,A=0,E=0,S=0,M=0,T=0;for(var P in t)if(t.hasOwnProperty(P)){if(c=(a=t[P]).materialName,u=this.rawMesh.faceType<4?c+(m?"_vertexColor":"")+(0===a.smoothingGroup?"_flat":""):6===this.rawMesh.faceType?"defaultPointMaterial":"defaultLineMaterial",s=this.materials[c],l=this.materials[u],!n.default.Validator.isValid(s)&&!n.default.Validator.isValid(l)){var F=m?"defaultVertexColorMaterial":"defaultMaterial";s=this.materials[F],this.logging.enabled&&console.warn('object_group "'+a.objectName+"_"+a.groupName+'" was defined with unresolvable material "'+c+'"! Assigning "'+F+'".'),(c=F)===u&&(l=s,u=F)}if(!n.default.Validator.isValid(l)){var O={materialNameOrg:c,materialName:u,materialProperties:{vertexColors:m?2:0,flatShading:0===a.smoothingGroup}},L={cmd:"materialData",materials:{materialCloneInstructions:O}};this.callbackMeshBuilder(L),this.useAsync&&(this.materials[u]=O)}if(g?((i=b[u])||(i=y,b[u]=y,v.push(u),y++),o={start:M,count:T=this.useIndices?a.indices.length:a.vertices.length/3,index:i},w.push(o),M+=T):v.push(u),r.set(a.vertices,x),x+=a.vertices.length,f&&(f.set(a.indices,_),_+=a.indices.length),h&&(h.set(a.colors,A),A+=a.colors.length),d&&(d.set(a.normals,E),E+=a.normals.length),p&&(p.set(a.uvs,S),S+=a.uvs.length),this.logging.enabled&&this.logging.debug){var C=n.default.Validator.isValid(i)?"\n\t\tmaterialIndex: "+i:"",k="\tOutput Object no.: "+this.outputObjectCount+"\n\t\tgroupName: "+a.groupName+"\n\t\tIndex: "+a.index+"\n\t\tfaceType: "+this.rawMesh.faceType+"\n\t\tmaterialName: "+a.materialName+"\n\t\tsmoothingGroup: "+a.smoothingGroup+C+"\n\t\tobjectName: "+a.objectName+"\n\t\t#vertices: "+a.vertices.length/3+"\n\t\t#indices: "+a.indices.length+"\n\t\t#colors: "+a.colors.length/3+"\n\t\t#uvs: "+a.uvs.length/2+"\n\t\t#normals: "+a.normals.length/3;console.debug(k)}}this.outputObjectCount++,this.callbackMeshBuilder({cmd:"meshData",progress:{numericalValue:this.globalCounts.currentByte/this.globalCounts.totalBytes},params:{meshName:e.name},materials:{multiMaterial:g,materialNames:v,materialGroups:w},buffers:{vertices:r,indices:f,colors:h,normals:d,uvs:p},geometryType:this.rawMesh.faceType<4?0:6===this.rawMesh.faceType?2:1},[r.buffer],n.default.Validator.isValid(f)?[f.buffer]:null,n.default.Validator.isValid(h)?[h.buffer]:null,n.default.Validator.isValid(d)?[d.buffer]:null,n.default.Validator.isValid(p)?[p.buffer]:null)},e.prototype.finalizeParsing=function(){if(this.logging.enabled&&console.info("Global output object count: "+this.outputObjectCount),this.processCompletedMesh()&&this.logging.enabled){var e="Overall counts: \n\tVertices: "+this.globalCounts.vertices+"\n\tFaces: "+this.globalCounts.faces+"\n\tMultiple definitions: "+this.globalCounts.doubleIndicesCount;console.info(e)}},e}();return r.prototype.loadMtl=function(e,t,r,a,i){var o=new n.default.ResourceDescriptor(e,"MTL");o.setContent(t),this._loadMtl(o,r,a,i)},r.prototype._loadMtl=function(e,r,n,o){void 0===i.default&&console.error('"THREE.MTLLoader" is not available. "THREE.OBJLoader2" requires it for loading MTL files.'),t.isValid(e)&&this.logging.enabled&&console.time("Loading MTL: "+e.name);var s=[],l=this,u=function(a){var n=[];if(t.isValid(a))for(var i in a.preload(),n=a.materials)n.hasOwnProperty(i)&&(s[i]=n[i]);t.isValid(e)&&l.logging.enabled&&console.timeEnd("Loading MTL: "+e.name),r(s,a)};if(t.isValid(e)&&(t.isValid(e.content)||t.isValid(e.url))){var c=new i.default(this.manager);if(n=t.verifyInput(n,"anonymous"),c.setCrossOrigin(n),c.setPath(e.path),t.isValid(o)&&c.setMaterialOptions(o),t.isValid(e.content))u(t.isValid(e.content)?c.parse(e.content):null);else if(t.isValid(e.url)){new a.FileLoader(this.manager).load(e.url,(function(t){e.content=t,u(c.parse(t))}),this._onProgress,this._onError)}}else u()},r}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.littleEndian=!0};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(e,(function(r){t(i.parse(r,e))}),r,n)},parse:function(e,t){var r=a.LoaderUtils.decodeText(e),n=function(e){var t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),a=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=a[1],t.headerLen=a[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(var n=0,i=t.fields.length;n0&&v.addAttribute("position",new a.Float32BufferAttribute(i,3)),o.length>0&&v.addAttribute("normal",new a.Float32BufferAttribute(o,3)),s.length>0&&v.addAttribute("color",new a.Float32BufferAttribute(s,3)),v.computeBoundingSphere();var g=new a.PointsMaterial({size:.005});s.length>0?g.vertexColors=!0:g.color.setHex(16777215*Math.random());var y=new a.Points(v,g),b=t.split("").reverse().join("");return b=(b=/([^\/]*)/.exec(b))[1].split("").reverse().join(""),y.name=b,y}console.error("THREE.PCDLoader: binary_compressed files are not supported")}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function n(e,t){var r=parseInt(m[v].substr(e,t));if(r){var a=function(e,t){return"s"+Math.min(e,t)+"e"+Math.max(e,t)}(y,r);void 0===p[a]&&(h.push([y-1,r-1,1]),p[a]=h.length-1)}}for(var i,o,s,l,u,c={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},f=[],h=[],d={},p={},m=e.split("\n"),v=0,g=m.length;v=t.elements[u].count&&(u++,c=0);var d=n(t.elements[u].properties,h);s(a,t.elements[u].name,d),c++}}return o(a)}function o(e){var t=new a.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.addAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.addAttribute("normal",new a.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.addAttribute("uv",new a.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.addAttribute("color",new a.Float32BufferAttribute(e.colors,3)),t.computeBoundingSphere(),t}function s(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){var a=r.vertex_indices||r.vertex_index;3===a.length?e.indices.push(a[0],a[1],a[2]):4===a.length&&(e.indices.push(a[0],a[1],a[3]),e.indices.push(a[1],a[2],a[3]))}}function l(e,t,r,a){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,a),2];case"uint16":case"ushort":return[e.getUint16(t,a),2];case"int32":case"int":return[e.getInt32(t,a),4];case"uint32":case"uint":return[e.getUint32(t,a),4];case"float32":case"float":return[e.getFloat32(t,a),4];case"float64":case"double":return[e.getFloat64(t,a),8]}}function u(e,t,r,a){for(var n,i={},o=0,s=0;s>7&1),s=n>>6&1,l=1==(n>>5&1),u=31&n,c=0,f=0;if(l?(c=(t[2]<<16)+(t[3]<<8)+t[4],f=(t[5]<<16)+(t[6]<<8)+t[7]):(c=t[2]+(t[3]<<8)+(t[4]<<16),f=t[5]+(t[6]<<8)+(t[7]<<16)),0===a)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==a)throw new Error("PRWM decoder: Unsupported format version: "+a);if(!o){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==f)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}var h,d,p,m,v,g,y,b,w=8,x={};for(b=0;b>7&1,m=1+(n>>4&3),w++,g=i(e,v=r[15&n],w=4*Math.ceil(w/4),m*c,l),w+=v.BYTES_PER_ELEMENT*m*c,x[h]={type:p,cardinality:m,values:g}}return w=4*Math.ceil(w/4),y=null,o&&(y=i(e,1===s?Uint32Array:Uint16Array,w,f,l)),{version:a,attributes:x,indices:y}}(e),s=Object.keys(o.attributes),l=new a.BufferGeometry;for(n=0;n0;return 25===d?(r=p?a.RGBA_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,t=4):24===d?(r=p?a.RGBA_PVRTC_2BPPV1_Format:a.RGB_PVRTC_2BPPV1_Format,t=2):console.error("THREE.PVRLoader: Unknown PVR format:",d),e.dataPtr=o,e.bpp=t,e.format=r,e.width=l,e.height=s,e.numSurfaces=h,e.numMipmaps=u+1,e.isCubemap=6===h,n._extract(e)},n._extract=function(e){var t,r={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},a=e.buffer,n=e.dataPtr,i=e.bpp,o=e.numSurfaces,s=0,l=0,u=0,c=0,f=0;2===i?(l=8,u=4):(l=4,u=4),t=l*u*i/8,r.mipmaps.length=e.numMipmaps*o;for(var h=0;h>h,p=e.height>>h;(c=d/l)<2&&(c=2),(f=p/u)<2&&(f=2),s=c*f*t;for(var m=0;m>5&31)/31,n=(_>>10&31)/31):(t=o,r=s,n=l)}for(var A=1;A<=3;A++){var E=y+12*A;m.push(c.getFloat32(E,!0)),m.push(c.getFloat32(E+4,!0)),m.push(c.getFloat32(E+8,!0)),v.push(b,w,x),h&&i.push(t,r,n)}}return p.addAttribute("position",new a.BufferAttribute(new Float32Array(m),3)),p.addAttribute("normal",new a.BufferAttribute(new Float32Array(v),3)),h&&(p.addAttribute("color",new a.BufferAttribute(new Float32Array(i),3)),p.hasColors=!0,p.alpha=u),p}(r):function(e){for(var t,r=new a.BufferGeometry,n=/facet([\s\S]*?)endfacet/g,i=0,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+o+o+o,"g"),l=new RegExp("normal"+o+o+o,"g"),u=[],c=[],f=new a.Vector3;null!==(t=n.exec(e));){for(var h=0,d=0,p=t[0];null!==(t=l.exec(p));)f.x=parseFloat(t[1]),f.y=parseFloat(t[2]),f.z=parseFloat(t[3]),d++;for(;null!==(t=s.exec(p));)u.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),c.push(f.x,f.y,f.z),h++;1!==d&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==h&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}return r.addAttribute("position",new a.Float32BufferAttribute(u,3)),r.addAttribute("normal",new a.Float32BufferAttribute(c,3)),r}("string"!=typeof(t=e)?a.LoaderUtils.decodeText(new Uint8Array(t)):t)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e,t,a,n,i,o,s,l){n=n*Math.PI/180,t=Math.abs(t),a=Math.abs(a);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,f=Math.cos(n)*u+Math.sin(n)*c,h=-Math.sin(n)*u+Math.cos(n)*c,d=t*t,p=a*a,m=f*f,v=h*h,g=m/d+v/p;if(g>1){var y=Math.sqrt(g);d=(t*=y)*t,p=(a*=y)*a}var b=d*v+p*m,w=(d*p-b)/b,x=Math.sqrt(Math.max(0,w));i===o&&(x=-x);var _=x*t*h/a,A=-x*a*f/t,E=Math.cos(n)*_-Math.sin(n)*A+(s.x+l.x)/2,S=Math.sin(n)*_+Math.cos(n)*A+(s.y+l.y)/2,M=r(1,0,(f-_)/t,(h-A)/a),T=r((f-_)/t,(h-A)/a,(-f-_)/t,(-h-A)/a)%(2*Math.PI);e.currentPath.absellipse(E,S,t,a,M,M+T,0===o,n)}function r(e,t,r,a){var n=e*r+t*a,i=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+a*a),o=Math.acos(Math.max(-1,Math.min(1,n/i)));return e*a-t*r<0&&(o=-o),o}function n(e,t){return t=Object.assign({},t),e.hasAttribute("fill")&&(t.fill=e.getAttribute("fill")),""!==e.style.fill&&(t.fill=e.style.fill),t}function i(e){return"none"!==e.fill&&"transparent"!==e.fill}function o(e,t){return 2*e-(t-e)}function s(e){for(var t=e.split(/[\s,]+|(?=\s?[+\-])/),r=0;r0){var p=[];for(u=0;u=t.end)return 0;this.position=t.cur;try{var r=this.readChunk(e);return t.cur+=r.size,r.id}catch(e){return this.debugMessage("Unable to read chunk at "+this.position),0}},resetPosition:function(){this.position-=6},readByte:function(e){var t=e.getUint8(this.position,!0);return this.position+=1,t},readFloat:function(e){try{var t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}},readInt:function(e){var t=e.getInt32(this.position,!0);return this.position+=4,t},readShort:function(e){var t=e.getInt16(this.position,!0);return this.position+=2,t},readDWord:function(e){var t=e.getUint32(this.position,!0);return this.position+=4,t},readWord:function(e){var t=e.getUint16(this.position,!0);return this.position+=2,t},readString:function(e,t){for(var r="",a=0;a256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case a:case n:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;var g=!1,y=!1,b=!1;switch(v.image_type){case i:g=!0,y=!0;break;case r:y=!0;break;case o:g=!0;break;case a:break;case s:g=!0,b=!0;break;case n:b=!0}var w=document.createElement("canvas");w.width=v.width,w.height=v.height;var x=w.getContext("2d"),_=x.createImageData(v.width,v.height),A=function(e,t,r,a,n){var i,o,s,l;if(o=r.pixel_size>>3,s=r.width*r.height*o,t&&(l=n.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,c,f;i=new Uint8Array(s);for(var h=0,d=new Uint8Array(o);h>u){default:case h:i=0,s=1,m=t,o=0,p=1,g=r;break;case c:i=0,s=1,m=t,o=r-1,p=-1,g=-1;break;case d:i=t-1,s=-1,m=-1,o=0,p=1,g=r;break;case f:i=t-1,s=-1,m=-1,o=r-1,p=-1,g=-1}if(b)switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,h=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f++)l=s[f],e[4*(u+h*c)+0]=l,e[4*(u+h*c)+1]=l,e[4*(u+h*c)+2]=l,e[4*(u+h*c)+3]=255}(e,o,p,g,i,s,m,a);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=2)e[4*(l+f*u)+0]=s[c+0],e[4*(l+f*u)+1]=s[c+0],e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+3]=s[c+1]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s,l){var u,c,f,h=l,d=0,p=v.width;for(f=t;f!==a;f+=r)for(c=n;c!==o;c+=i,d++)u=s[d],e[4*(c+p*f)+3]=255,e[4*(c+p*f)+2]=h[3*u+0],e[4*(c+p*f)+1]=h[3*u+1],e[4*(c+p*f)+0]=h[3*u+2]}(e,o,p,g,i,s,m,a,n);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,h=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f+=2)l=s[f+0]+(s[f+1]<<8),e[4*(u+h*c)+0]=(31744&l)>>7,e[4*(u+h*c)+1]=(992&l)>>2,e[4*(u+h*c)+2]=(31&l)>>3,e[4*(u+h*c)+3]=32768&l?0:255}(e,o,p,g,i,s,m,a);break;case 24:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=3)e[4*(l+f*u)+3]=255,e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2]}(e,o,p,g,i,s,m,a);break;case 32:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=4)e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2],e[4*(l+f*u)+3]=s[c+3]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}}(_.data,v.width,v.height,A.pixel_data,A.palettes);return x.putImageData(_,0,0),w}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.reversed=!1};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){var t,r=[];e.forEach((function(e){"m"===e.type.toLowerCase()?(t=[e],r.push(t)):"z"!==e.type.toLowerCase()&&t.push(e)}));var a=[];return r.forEach((function(e){var t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};a.push(t);for(var r=e.length-1;r>0;r--){var n=e[r];t={type:n.type};void 0!==n.x2&&void 0!==n.y2?(t.x1=n.x2,t.y1=n.y2,t.x2=n.x1,t.y2=n.y1):void 0!==n.x1&&void 0!==n.y1&&(t.x1=n.x1,t.y1=n.y1),t.x=e[r-1].x,t.y=e[r-1].y,a.push(t)}})),a}return"undefined"==typeof opentype?(console.warn("THREE.TTFLoader: The loader requires opentype.js. Make sure it's included before using the loader."),null):function(e,r){for(var a=Math.round,n={},i=1e5/(72*(e.unitsPerEm||2048)),o=0;o-1;o--){var s=i[o];if(/{.*[{\[]/.test(s))(l=s.split("{").join("{\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);else if(/\].*}/.test(s)){var l;(l=s.split("]").join("]\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l)}if(/}.*}/.test(s))(l=s.split("}").join("}\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);/^\b[^\s]+\b$/.test(s.trim())?(i[o+1]=s+" "+i[o+1].trim(),i.splice(o,1)):s.indexOf("coord")>-1&&s.indexOf("[")<0&&s.indexOf("{")<0&&(i[o]+=" Coordinate {}")}var u=i.shift();return/V1.0/.exec(u)?console.warn("THREE.VRMLLoader: V1.0 not supported yet."):/V2.0/.exec(u)&&function(e,n){var i={},o=/(\b|\-|\+)([\d\.e]+)/,s=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g,l=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g;function u(e,t,r,n,i){for(var o=!0===i?1:-1,s=[],l={},u={},c=0;cu.y:m.y>=l.y&&m.y0)for(var h=0;h0&&this.indexes.push(c),c=[]):c.push(parseInt(i[h])));/]/.exec(t)&&(c.length>0&&this.indexes.push(c),c=[],this.isRecordingFaces=!1,e[this.recordingFieldname]=this.indexes)}else if(this.isRecordingPoints){if("Coordinate"==e.nodeType)for(;null!==(i=l.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2]),z:parseFloat(i[3])},this.points.push(n);if("TextureCoordinate"==e.nodeType)for(;null!==(i=s.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2])},this.points.push(n);/]/.exec(t)&&(this.isRecordingPoints=!1,e.points=this.points)}else if(this.isRecordingAngles){if(i.length>0)for(h=0;h-1&&"PointLight"===o.nodeType&&(o.nodeType="AmbientLight");var c=void 0===o.on||o.on,f=void 0!==o.intensity?o.intensity:1,h=new a.Color;if(o.color&&h.copy(o.color),"AmbientLight"===o.nodeType)(l=new a.AmbientLight(h,f)).visible=c,s.add(l);else if("PointLight"===o.nodeType){var d=0;void 0!==o.radius&&o.radius<1e3&&(d=o.radius),(l=new a.PointLight(h,f,d)).visible=c,s.add(l)}else if("SpotLight"===o.nodeType){f=1,d=0;var p=Math.PI/3;c=!0;void 0!==o.radius&&o.radius<1e3&&(d=o.radius),void 0!==o.cutOffAngle&&(p=o.cutOffAngle),(l=new a.SpotLight(h,f,d,p,0)).visible=c,s.add(l)}else if("Transform"===o.nodeType||"Group"===o.nodeType){if(l=new a.Object3D,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),void 0!==o.translation){var m=o.translation;l.position.set(m.x,m.y,m.z)}if(void 0!==o.rotation){var v=o.rotation;l.quaternion.setFromAxisAngle(new a.Vector3(v.x,v.y,v.z),v.w)}if(void 0!==o.scale){var g=o.scale;l.scale.set(g.x,g.y,g.z)}s.add(l)}else if("Shape"===o.nodeType)l=new a.Mesh,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),s.add(l);else if("Background"===o.nodeType){var y=2e4,b=new a.SphereBufferGeometry(y,20,20),w=new a.MeshBasicMaterial({fog:!1,side:a.BackSide});if(o.skyColor.length>1)u(b,y,o.skyAngle,o.skyColor,!0),w.vertexColors=a.VertexColors;else{var x=o.skyColor[0];w.color.setRGB(x.r,x.b,x.g)}if(n.add(new a.Mesh(b,w)),void 0!==o.groundColor){y=12e3;var _=new a.SphereBufferGeometry(y,20,20,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),A=new a.MeshBasicMaterial({fog:!1,side:a.BackSide,vertexColors:a.VertexColors});u(_,y,o.groundAngle,o.groundColor,!1),n.add(new a.Mesh(_,A))}}else{if(/geometry/.exec(o.string)){if("Box"===o.nodeType){g=o.size;s.geometry=new a.BoxBufferGeometry(g.x,g.y,g.z)}else if("Cylinder"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.radius,o.radius,o.height);else if("Cone"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.topRadius,o.bottomRadius,o.height);else if("Sphere"===o.nodeType)s.geometry=new a.SphereBufferGeometry(o.radius);else if("IndexedFaceSet"===o.nodeType){var E,S,M,T,P,F=new a.BufferGeometry,O=[],L=[];for(B=0,M=o.children.length;B-1){var C=/DEF\s+([^\s]+)/.exec(V.string)[1];i[C]=O.slice(0)}if(V.string.indexOf("USE")>-1){W=/USE\s+([^\s]+)/.exec(V.string)[1];O=i[W]}}}var k=0;if(o.coordIndex){var R=[],I=[];for(E=new a.Vector3,S=new a.Vector2,B=0,M=o.coordIndex.length;B=3&&k0&&F.addAttribute("uv",new a.Float32BufferAttribute(L,2)),F.computeVertexNormals(),F.computeBoundingSphere(),/DEF/.exec(o.string)&&(F.name=/DEF ([^\s]+)/.exec(o.string)[1],i[F.name]=F),s.geometry=F}return}if(/appearance/.exec(o.string)){for(var B=0;B>1^-(1&c),a[n]=s*(l+o),n+=i}},n.prototype.decompressIndices_=function(e,t,r,a,n){for(var i=0,o=0;o>1,p=e.charCodeAt(u+4)+1>>1,m=e.charCodeAt(u+5)+1>>1;l[s++]=n[0]*(c+d),l[s++]=n[1]*(f+p),l[s++]=n[2]*(h+m),l[s++]=n[0]*d,l[s++]=n[1]*p,l[s++]=n[2]*m}return l},n.prototype.decompressMesh=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=u,h=new Float32Array(o*c),d=0;d>1^-(1&f);l[c]+=h,s[t*u+c]=l[c],o[t*u+c]=a[c]*(l[c]+r[c])}},n.prototype.accumulateNormal=function(e,t,r,a,n){var i=a[8*e],o=a[8*e+1],s=a[8*e+2],l=a[8*t],u=a[8*t+1],c=a[8*t+2],f=a[8*r],h=a[8*r+1],d=a[8*r+2];l-=i,f-=i,i=(u-=o)*(d-=s)-(c-=s)*(h-=o),o=c*f-l*d,s=l*h-u*f,n[3*e]+=i,n[3*e+1]+=o,n[3*e+2]+=s,n[3*t]+=i,n[3*t+1]+=o,n[3*t+2]+=s,n[3*r]+=i,n[3*r+1]+=o,n[3*r+2]+=s},n.prototype.decompressMesh2=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=t.codeRange[0],h=3*t.codeRange[2],d=new Uint16Array(h),p=new Int32Array(3*c),m=new Uint16Array(o),v=new Uint16Array(o*c),g=new Float32Array(o*c),y=0,b=0,w=0;w>1^-(1&O))+v[o*A+F]+v[o*E+F]-v[o*S+F];m[F]=L,v[o*y+F]=L,g[o*y+F]=l[F]*(L+s[F])}y++}else this.copyAttrib(o,v,m,P);this.accumulateNormal(A,E,P,v,p)}else{var C=y-(x-_);d[b++]=C,x===_?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,C);var k=y-(x=e.charCodeAt(f++));d[b++]=k,0===x?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,k);var R=y-(x=e.charCodeAt(f++));if(d[b++]=R,0===x){for(F=0;F<5;F++)m[F]=(v[o*C+F]+v[o*k+F])/2;this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++)}else this.copyAttrib(o,v,m,R);this.accumulateNormal(C,k,R,v,p)}}for(w=0;w>1^-(1&j)),g[o*w+6]=U*N+(B>>1^-(1&B)),g[o*w+7]=U*D+(V>>1^-(1&V))}i(a,n,g,d,void 0,t)},n.prototype.downloadMesh=function(e,t,r,a,n){var i=this,s=0;o(e,(function(e){!function(e){for(;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=new s(3*f/4-(i="="===e[f-2]?2:"="===e[f-1]?1:0)),a=i>0?f-4:f;var h=0;for(t=0,r=0;t>16,o[h++]=(65280&n)>>8,o[h++]=255&n;return 2===i?(n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[h++]=255&n):1===i&&(n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[h++]=n>>8&255,o[h++]=255&n),o}function n(e,a){var n,i,s,l,u=0;if("UInt64"===o.attributes.header_type?u=8:"UInt32"===o.attributes.header_type&&(u=4),"binary"===e.attributes.format&&a){var c,f,h,d,p,m;if("Float32"===e.attributes.type)var v=new Float32Array;else if("Int64"===e.attributes.type)v=new Int32Array;f=(c=r(e["#text"]))[0];for(var g=1;g0?3-d%3:0,(p=[]).push(m),h=3*u;for(g=0;g0){r.attributes={};for(var a=0;a0&&(v[g].text=n(v[g],f)),g++;switch(h[d]){case"PointData":var b=parseInt(c.attributes.NumberOfPoints),w=m.attributes.Normals;if(b>0)for(var x=0,_=v.length;x<_;x++)if(w===v[x].attributes.Name){var A=v[x].attributes.NumberOfComponents;(l=new Float32Array(b*A)).set(v[x].text,0)}break;case"Points":if((b=parseInt(c.attributes.NumberOfPoints))>0){A=m.DataArray.attributes.NumberOfComponents;(s=new Float32Array(b*A)).set(m.DataArray.text,0)}break;case"Strips":var E=parseInt(c.attributes.NumberOfStrips);if(E>0){var S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);var T=E+S.length;u=new Uint32Array(3*T-9*E);var P=0;for(x=0,_=E;x<_;x++){for(var F=[],O=0,L=M[x],C=0;O0&&(C=M[x-1]);var k=0;for(L=M[x],C=0;k0&&(C=M[x-1])}}break;case"Polys":var R=parseInt(c.attributes.NumberOfPolys);if(R>0){S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);T=R+S.length;u=new Uint32Array(3*T-9*R);P=0;var I=0;for(x=0,_=R,C=0;x<_;){var N=[];for(O=0,L=M[x];O=3)for(var C=parseInt(L[0]),k=1,R=0;R=3){var I,N;for(R=0;R=u.byteLength)break}var A=new a.BufferGeometry;return A.setIndex(new a.BufferAttribute(d,1)),A.addAttribute("position",new a.BufferAttribute(f,3)),h.length===f.length&&A.addAttribute("normal",new a.BufferAttribute(h,3)),A}(e)}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(var r=t;r-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,a=0;a127)return!0;return!1}},{key:"ensureBinary",value:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),r=0;r0&&(this.baseDir=this.url.substr(0,this.url.lastIndexOf("/")+1));this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this.mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var a=this._data.indexOf("{",r)+1,n=this._data.indexOf("}",r),i=this._data.indexOf("{",a)+1;if(!(a>0&&n>a)){r=-1===a?this._data.length:n+1;break}var o={children:[]},s=this._readLine(this._data.substr(r,a-r-1)).trim(),l=s.split(/ /g);if(l.length>0?(o.type=l[0],l.length>=2?o.name=l[1]:o.name=l[0]+this.Hierarchies.children.length):(o.name=s,o.type=""),"Animation"===o.type){o.data=this._data.substr(i,n-i).trim();var u=this._hierarchieParse(o,n+1);r=u.end,o.children=u.parent.children}else{var c=this._data.lastIndexOf(";",i>0?Math.min(i,n):n);if(o.data=this._data.substr(a,c-a).trim(),i<=0||n0||!this._currentObject.worked?setTimeout((function(){e.mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.Geometry=new a.Geometry,this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new s,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new a.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new a.Bone;if(e.name=this._currentFrame.name,e.applyMatrix(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(var t in this.HieStack)this.HieStack[t].name===this._currentFrame.parentName&&this.HieStack[t].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,a=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,n=0,(a=this._currentObject.data.indexOf(";;",e)+1)<=0&&(a=this._currentObject.data.length)}else{var o=0;switch(t){case 0:o=this._currentObject.data.indexOf(",",e)+1;break;case 1:o=this._currentObject.data.indexOf(";,",e)+1}switch((0===o||o>a)&&(o=a,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,o-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,o-e))}break;case"MeshNormals":switch(t){case 0:this._readNormalVector1(this._currentObject.data.substr(e,o-e));break;case 1:this._readNormalFace1(this._currentObject.data.substr(e,o-e),n)}}e=o+1,n++,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.Geometry.vertices.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))),this._currentGeo.Geometry.skinIndices.push(new a.Vector4(0,0,0,0)),this._currentGeo.Geometry.skinWeights.push(new a.Vector4(1,0,0,0)),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.Geometry.faces.push(new a.Face3(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),new a.Vector3(1,1,1).normalize()))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.normalVectors.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])))}},{key:"_readNormalFace1",value:function(e,t){var r=this._readLine(e.trim()).substr(2,e.length-4).split(","),a=parseInt(r[0],10),n=this._currentGeo.normalVectors[a];a=parseInt(r[1],10);var i=this._currentGeo.normalVectors[a];a=parseInt(r[2],10);var o=this._currentGeo.normalVectors[a];this._currentGeo.Geometry.faces[t].vertexNormals=[n,i,o]}},{key:"_setMeshNormals",value:function(){for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var a=this._currentObject.data.indexOf(",",e)+1;-1===a&&(a=this._currentObject.data.indexOf(";;",e)+1,t=2,r=0);var n=this._currentObject.data.substr(e,a-e),i=this._readLine(n.trim()).split(";");this._currentGeo.normalVectors.push([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]),e=a+1}}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshTextureCoords",value:function(){this._tmpUvArray=[],this._currentGeo.Geometry.faceVertexUvs=[],this._currentGeo.Geometry.faceVertexUvs.push([]);for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),o=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),1-parseFloat(o[1]))):this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),parseFloat(o[1]))),e=n+1}}if(e>=this._currentObject.data.length)break}this._currentGeo.Geometry.faceVertexUvs[0]=[];for(var s=0;s=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new a.MeshPhongMaterial({color:16777215*Math.random()});e.side=a.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t),i=this._readLine(n.trim()).split(";");e.color.r=parseFloat(i[0]),e.color.g=parseFloat(i[1]),e.color.b=parseFloat(i[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(n)),t=r+1,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t);var o=this._readLine(n.trim()).split(";");e.specular.r=parseFloat(o[0]),e.specular.g=parseFloat(o[1]),e.specular.b=parseFloat(o[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),n=this._currentObject.data.substr(t,r-t);var s=this._readLine(n.trim()).split(";");e.emissive.r=parseFloat(s[0]),e.emissive.g=parseFloat(s[1]),e.emissive.b=parseFloat(s[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var u=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(this.baseDir+u);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(this.baseDir+u),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(this.baseDir+u),e.normalScale=new a.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(this.baseDir+u);break;case"LightMapFilename":e.lightMap=this.texloader.load(this.baseDir+u)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new o,t=0,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);t=r+1,e.boneName=n.substr(1,n.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(r=this._currentObject.data.indexOf(";",t))+1,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);for(var i=this._readLine(n.trim()).split(","),s=0;s0)for(var o=0;o0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(var r=0;r4&&console.log("warn! over 4 bone weight! :"+s)}}for(var u=0;u0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,i&&e.context.disable(e.context.STENCIL_TEST),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new a.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new a.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionX,e.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.context.enable(e.context.STENCIL_TEST),e.render(this.scene,this.camera,r,!1),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:new a.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),s.BlurDirectionX=new a.Vector2(1,0),s.BlurDirectionY=new a.Vector2(0,1),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=r(1),i=(a=n)&&a.__esModule?a:{default:a};var o=function(e,t,r,a,n){i.default.call(this),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=a,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};o.prototype=Object.assign(Object.create(i.default.prototype),{constructor:o,render:function(e,t,r,a,n){var i,o,s=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),o=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),this.clearColor&&e.setClearColor(i,o),this.scene.overrideMaterial=null,e.autoClear=s}}),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=c(r(1)),i=c(r(19)),o=c(r(20)),s=c(r(2)),l=c(r(21)),u=c(r(22));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e,t,r,u,c){(n.default.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==r&&r,this.supportsNormalTexture=void 0!==u&&u,this.oldClearColor=new a.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==c?new a.Vector2(c.x,c.y):new a.Vector2(256,256),this.saoRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.NearestFilter,magFilter:a.NearestFilter,format:a.RGBAFormat}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((r=new a.DepthTexture).type=a.UnsignedShortType,r.minFilter=a.NearestFilter,r.maxFilter=a.NearestFilter,this.beautyRenderTarget.depthTexture=r,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.normalMaterial=new a.MeshNormalMaterial,this.normalMaterial.blending=a.NoBlending,void 0===i.default&&console.error("THREE.SAOPass relies on THREE.SAOShader"),this.saoMaterial=new a.ShaderMaterial({defines:Object.assign({},i.default.defines),fragmentShader:i.default.fragmentShader,vertexShader:i.default.vertexShader,uniforms:a.UniformsUtils.clone(i.default.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=a.NoBlending,void 0===o.default&&console.error("THREE.SAOPass relies on THREE.DepthLimitedBlurShader"),this.vBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=a.NoBlending,this.hBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=a.NoBlending,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.CopyShader"),this.materialCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(s.default.uniforms),vertexShader:s.default.vertexShader,fragmentShader:s.default.fragmentShader,blending:a.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=a.CustomBlending,this.materialCopy.blendSrc=a.DstColorFactor,this.materialCopy.blendDst=a.ZeroFactor,this.materialCopy.blendEquation=a.AddEquation,this.materialCopy.blendSrcAlpha=a.DstAlphaFactor,this.materialCopy.blendDstAlpha=a.ZeroFactor,this.materialCopy.blendEquationAlpha=a.AddEquation,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.UnpackDepthRGBAShader"),this.depthCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(l.default.uniforms),vertexShader:l.default.vertexShader,fragmentShader:l.default.fragmentShader,blending:a.NoBlending}),this.quadCamera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.quadScene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quadScene.add(this.quad)};f.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},f.prototype=Object.assign(Object.create(n.default.prototype),{constructor:f,render:function(e,t,r,n,i){if(this.renderToScreen&&(this.materialCopy.blending=a.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,e.clearTarget(this.depthRenderTarget),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(u.default.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(0,1)),u.default.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.render(this.scene,this.camera,this.beautyRenderTarget,!0),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var l=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,l=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?l.blending=a.CustomBlending:l.blending=a.NoBlending,this.renderPass(e,l,this.renderToScreen?null:r),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}},renderPass:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.quad.material=t,e.render(this.quadScene,this.quadCamera,r,l),e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},renderOverride:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1,a=t.clearColor||a,n=t.clearAlpha||n;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.scene.overrideMaterial=t,e.render(this.scene,this.camera,r,l),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}}),t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){n.default.call(this),void 0===i.default&&console.error("THREE.SavePass relies on THREE.CopyShader");var t=i.default;this.textureID="tDiffuse",this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new a.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBFormat,stencilBuffer:!1}),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,e.render(this.scene,this.camera,this.renderTarget,this.clear)}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(23));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),this.edgesRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var r=new Image;r.src=this.getAreaTexture(),this.areaTexture=new a.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=a.RGBFormat,this.areaTexture.minFilter=a.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.needsUpdate=!0,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),this.searchTexture=new a.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=a.NearestFilter,this.searchTexture.minFilter=a.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.needsUpdate=!0,this.searchTexture.flipY=!1,void 0===i.default&&console.error("THREE.SMAAPass relies on THREE.SMAAShader"),this.uniformsEdges=a.UniformsUtils.clone(i.default[0].uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new a.ShaderMaterial({defines:Object.assign({},i.default[0].defines),uniforms:this.uniformsEdges,vertexShader:i.default[0].vertexShader,fragmentShader:i.default[0].fragmentShader}),this.uniformsWeights=a.UniformsUtils.clone(i.default[1].uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new a.ShaderMaterial({defines:Object.assign({},i.default[1].defines),uniforms:this.uniformsWeights,vertexShader:i.default[1].vertexShader,fragmentShader:i.default[1].fragmentShader}),this.uniformsBlend=a.UniformsUtils.clone(i.default[2].uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new a.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:i.default[2].vertexShader,fragmentShader:i.default[2].fragmentShader}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniformsEdges.tDiffuse.value=r.texture,this.quad.material=this.materialEdges,e.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,e.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=r.texture,this.quad.material=this.materialBlend,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW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Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(3)),i=o(r(25));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){if(void 0===i.default)return console.warn("THREE.SSAOPass depends on THREE.SSAOShader"),new n.default;n.default.call(this,i.default),this.width=void 0!==r?r:512,this.height=void 0!==o?o:256,this.renderToScreen=!1,this.camera2=t,this.scene2=e,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.depthRenderTarget=new a.WebGLRenderTarget(this.width,this.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter}),this.uniforms.tDepth.value=this.depthRenderTarget.texture,this.uniforms.size.value.set(this.width,this.height),this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far,this.uniforms.radius.value=4,this.uniforms.onlyAO.value=!1,this.uniforms.aoClamp.value=.25,this.uniforms.lumInfluence.value=.7;Object.defineProperties(this,{radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},onlyAO:{get:function(){return this.uniforms.onlyAO.value},set:function(e){this.uniforms.onlyAO.value=e}},aoClamp:{get:function(){return this.uniforms.aoClamp.value},set:function(e){this.uniforms.aoClamp.value=e}},lumInfluence:{get:function(){return this.uniforms.lumInfluence.value},set:function(e){this.uniforms.lumInfluence.value=e}}})};(s.prototype=Object.create(n.default.prototype)).render=function(e,t,r,a,i){this.scene2.overrideMaterial=this.depthMaterial,e.render(this.scene2,this.camera2,this.depthRenderTarget,!0),this.scene2.overrideMaterial=null,n.default.prototype.render.call(this,e,t,r,a,i)},s.prototype.setScene=function(e){this.scene2=e},s.prototype.setCamera=function(e){this.camera2=e,this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far},s.prototype.setSize=function(e,t){this.width=e,this.height=t,this.uniforms.size.value.set(this.width,this.height),this.depthRenderTarget.setSize(this.width,this.height)},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(24),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t,r){void 0===o.default&&console.error("THREE.TAARenderPass relies on THREE.SSAARenderPass"),o.default.call(this,e,t,r),this.sampleLevel=0,this.accumulate=!1};s.JitterVectors=o.default.JitterVectors,s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a){if(!this.accumulate)return o.default.prototype.render.call(this,e,t,r,a),void(this.accumulateIndex=-1);var i=s.JitterVectors[5];this.sampleRenderTarget||(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),this.holdRenderTarget||(this.holdRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.holdRenderTarget.texture.name="TAARenderPass.hold"),this.accumulate&&-1===this.accumulateIndex&&(o.default.prototype.render.call(this,e,this.holdRenderTarget,r,a),this.accumulateIndex=0);var l=e.autoClear;e.autoClear=!1;var u=1/i.length;if(this.accumulateIndex>=0&&this.accumulateIndex=i.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}var d=this.accumulateIndex*u;d>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.render(this.scene2,this.camera2,t,!0)),d<1&&(this.copyUniforms.opacity.value=1-d,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.render(this.scene2,this.camera2,t,0===d)),e.autoClear=l}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),void 0===i.default&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=i.default;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=a.UniformsUtils.clone(r.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){var i=e.autoClear;e.autoClear=!1,this.quad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),e.autoClear=i}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=s(r(1)),i=s(r(2)),o=s(r(26));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e,t,r,s){n.default.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=s,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);var l={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var u=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new a.WebGLRenderTarget(u,c,l),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var f=0;f\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new a.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),l.BlurDirectionX=new a.Vector2(1,0),l.BlurDirectionY=new a.Vector2(0,1),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaterRefractionShader=t.VignetteShader=t.VerticalTiltShiftShader=t.VerticalBlurShader=t.UnpackDepthRGBAShader=t.TriangleBlurShader=t.ToneMapShader=t.TechnicolorShader=t.SSAOShader=t.SobelOperatorShader=t.SMAAShader=t.SepiaShader=t.SAOShader=t.RGBShiftShader=t.PixelShader=t.ParallaxShader=t.NormalMapShader=t.MirrorShader=t.LuminosityShader=t.LuminosityHighPassShader=t.KaleidoShader=t.HueSaturationShader=t.HorizontalTiltShiftShader=t.HorizontalBlurShader=t.HalftoneShader=t.GammaCorrectionShader=t.FXAAShader=t.FresnelShader=t.FreiChenShader=t.FocusShader=t.FilmShader=t.DotScreenShader=t.DOFMipMapShader=t.DigitalGlitch=t.DepthLimitedBlurShader=t.CopyShader=t.ConvolutionShader=t.ColorifyShader=t.ColorCorrectionShader=t.BrightnessContrastShader=t.BokehShader2=t.BokehShader=t.BlurShaderUtils=t.BlendShader=t.BleachBypassShader=t.BasicShader=void 0;var a=Q(r(113)),n=Q(r(114)),i=Q(r(115)),o=Q(r(22)),s=Q(r(14)),l=Q(r(116)),u=Q(r(117)),c=Q(r(118)),f=Q(r(119)),h=Q(r(13)),d=Q(r(2)),p=Q(r(20)),m=Q(r(17)),v=Q(r(120)),g=Q(r(15)),y=Q(r(16)),b=Q(r(121)),w=Q(r(122)),x=Q(r(123)),_=Q(r(124)),A=Q(r(125)),E=Q(r(18)),S=Q(r(126)),M=Q(r(127)),T=Q(r(128)),P=Q(r(129)),F=Q(r(26)),O=Q(r(11)),L=Q(r(130)),C=Q(r(131)),k=(Q(r(132)),Q(r(133))),R=Q(r(134)),I=Q(r(135)),N=Q(r(19)),D=Q(r(136)),U=Q(r(23)),j=Q(r(137)),B=Q(r(25)),V=Q(r(138)),z=Q(r(12)),G=Q(r(139)),H=Q(r(21)),X=Q(r(140)),Y=Q(r(141)),W=Q(r(142)),q=Q(r(143));function Q(e){return e&&e.__esModule?e:{default:e}}t.BasicShader=a.default,t.BleachBypassShader=n.default,t.BlendShader=i.default,t.BlurShaderUtils=o.default,t.BokehShader=s.default,t.BokehShader2=l.default,t.BrightnessContrastShader=u.default,t.ColorCorrectionShader=c.default,t.ColorifyShader=f.default,t.ConvolutionShader=h.default,t.CopyShader=d.default,t.DepthLimitedBlurShader=p.default,t.DigitalGlitch=m.default,t.DOFMipMapShader=v.default,t.DotScreenShader=g.default,t.FilmShader=y.default,t.FocusShader=b.default,t.FreiChenShader=w.default,t.FresnelShader=x.default,t.FXAAShader=_.default,t.GammaCorrectionShader=A.default,t.HalftoneShader=E.default,t.HorizontalBlurShader=S.default,t.HorizontalTiltShiftShader=M.default,t.HueSaturationShader=T.default,t.KaleidoShader=P.default,t.LuminosityHighPassShader=F.default,t.LuminosityShader=O.default,t.MirrorShader=L.default,t.NormalMapShader=C.default,t.ParallaxShader=k.default,t.PixelShader=R.default,t.RGBShiftShader=I.default,t.SAOShader=N.default,t.SepiaShader=D.default,t.SMAAShader=U.default,t.SobelOperatorShader=j.default,t.SSAOShader=B.default,t.TechnicolorShader=V.default,t.ToneMapShader=z.default,t.TriangleBlurShader=G.default,t.UnpackDepthRGBAShader=H.default,t.VerticalBlurShader=X.default,t.VerticalTiltShiftShader=Y.default,t.VignetteShader=W.default,t.WaterRefractionShader=q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","vec4 texel1 = texture2D( tDiffuse1, vUv );","vec4 texel2 = texture2D( tDiffuse2, vUv );","gl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float penta(vec2 coords) {","//pentagonal shape","float scale = float(rings) - 1.3;","vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","vec4 one = vec4( 1.0 );","vec4 P = vec4((coords),vec2(scale, scale));","vec4 dist = vec4(0.0);","float inorout = -4.0;","dist.x = dot( P, HS0 );","dist.y = dot( P, HS1 );","dist.z = dot( P, HS2 );","dist.w = dot( P, HS3 );","dist = smoothstep( -feather, feather, dist );","inorout += dot( dist, one );","dist.x = dot( P, HS4 );","dist.y = HS5.w - abs( P.z );","dist = smoothstep( -feather, feather, dist );","inorout += dist.x;","return clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","// Depth buffer blur","float d = 0.0;","float kernel[9];","vec2 offset[9];","vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","offset[0] = vec2(-wh.x,-wh.y);","offset[1] = vec2( 0.0, -wh.y);","offset[2] = vec2( wh.x -wh.y);","offset[3] = vec2(-wh.x, 0.0);","offset[4] = vec2( 0.0, 0.0);","offset[5] = vec2( wh.x, 0.0);","offset[6] = vec2(-wh.x, wh.y);","offset[7] = vec2( 0.0, wh.y);","offset[8] = vec2( wh.x, wh.y);","kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","for( int i=0; i<9; i++ ) {","float tmp = getDepth( coords + offset[ i ] );","d += tmp * kernel[i];","}","return d;","}","vec3 color(vec2 coords,float blur) {","//processing the sample","vec3 col = vec3(0.0);","vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","vec3 lumcoeff = vec3(0.299,0.587,0.114);","float lum = dot(col.rgb, lumcoeff);","float thresh = max((lum-threshold)*gain, 0.0);","return col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","float edge = 0.002*depth; //distance based edge smoothing","float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","return col;","}","float linearize(float depth) {","return -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","float dist = distance(vUv.xy, vec2(0.5,0.5));","dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","return clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","float rings2 = float(rings);","float step = PI*2.0 / float(ringsamples);","float pw = cos(j*step)*i;","float ph = sin(j*step)*i;","float p = 1.0;","if (pentagon) {","p = penta(vec2(pw,ph));","}","col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","return 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","//scene depth calculation","float depth = linearize( getDepth( vUv.xy ) );","// Blur depth?","if (depthblur) {","depth = linearize(bdepth(vUv.xy));","}","//focal plane calculation","float fDepth = focalDepth;","if (shaderFocus) {","fDepth = linearize( getDepth( focusCoords ) );","}","// dof blur factor calculation","float blur = 0.0;","if (manualdof) {","float a = depth-fDepth; // Focal plane","float b = (a-fdofstart)/fdofdist; // Far DoF","float c = (-a-ndofstart)/ndofdist; // Near Dof","blur = (a>0.0) ? b : c;","} else {","float f = focalLength; // focal length in mm","float d = fDepth*1000.0; // focal plane in mm","float o = depth*1000.0; // depth in mm","float a = (o*f)/(o-f);","float b = (d*f)/(d-f);","float c = (d-f)/(d*fstop*CoC);","blur = abs(a-b)*c;","}","blur = clamp(blur,0.0,1.0);","// calculation of pattern for dithering","vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","// getting blur x and y step factor","float w = (1.0/textureWidth)*blur*maxblur+noise.x;","float h = (1.0/textureHeight)*blur*maxblur+noise.y;","// calculation of final color","vec3 col = vec3(0.0);","if(blur < 0.05) {","//some optimization thingy","col = texture2D(tColor, vUv.xy).rgb;","} else {","col = texture2D(tColor, vUv.xy).rgb;","float s = 1.0;","int ringsamples;","for (int i = 1; i <= rings; i++) {","/*unboxstart*/","ringsamples = i * samples;","for (int j = 0 ; j < maxringsamples ; j++) {","if (j >= ringsamples) break;","s += gather(float(i), float(j), ringsamples, col, w, h, blur);","}","/*unboxend*/","}","col /= s; //divide by sample count","}","if (showFocus) {","col = debugFocus(col, blur, depth);","}","if (vignetting) {","col *= vignette();","}","gl_FragColor.rgb = col;","gl_FragColor.a = 1.0;","} "].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},powRGB:{value:new a.Vector3(2,2,2)},mulRGB:{value:new a.Vector3(1,1,1)},addRGB:{value:new a.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},color:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},aspect:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","G[0] = g0,","G[1] = g1,","G[2] = g2,","G[3] = g3,","G[4] = g4,","G[5] = g5,","G[6] = g6,","G[7] = g7,","G[8] = g8;","mat3 I;","float cnv[9];","vec3 sample;","for (float i=0.0; i<3.0; i++) {","for (float j=0.0; j<3.0; j++) {","sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","I[int(i)][int(j)] = length(sample);","}","}","for (int i=0; i<9; i++) {","float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","cnv[i] = dp3 * dp3;","}","float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","vec3 I = worldPosition.xyz - cameraPosition;","vReflect = reflect( I, worldNormal );","vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","vec4 refractedColor = vec4( 1.0 );","refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immedates."," // Immedates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","gl_FragColor = LinearToGamma( tex, float( GAMMA_FACTOR ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 p = vUv - 0.5;","float r = length(p);","float a = atan(p.y, p.x) + angle;","float tau = 2. * 3.1416 ;","a = mod(a, tau/sides);","a = abs(a - tau/sides/2.) ;","p = r * vec2(cos(a), sin(a));","vec4 color = texture2D(tDiffuse, p + 0.5);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","vec2 p = vUv;","if (side == 0){","if (p.x > 0.5) p.x = 1.0 - p.x;","}else if (side == 1){","if (p.x < 0.5) p.x = 1.0 - p.x;","}else if (side == 2){","if (p.y < 0.5) p.y = 1.0 - p.y;","}else if (side == 3){","if (p.y > 0.5) p.y = 1.0 - p.y;","} ","vec4 color = texture2D(tDiffuse, p);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{heightMap:{value:null},resolution:{value:new a.Vector2(512,512)},scale:{value:new a.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));a.ShaderLib.ocean_sim_vertex={vertexShader:["varying vec2 vUV;","void main (void) {","vUV = position.xy * 0.5 + 0.5;","gl_Position = vec4(position, 1.0 );","}"].join("\n")},a.ShaderLib.ocean_subtransform={uniforms:{u_input:{value:null},u_transformSize:{value:512},u_subtransformSize:{value:250}},fragmentShader:["precision highp float;","#include ","uniform sampler2D u_input;","uniform float u_transformSize;","uniform float u_subtransformSize;","varying vec2 vUV;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","void main (void) {","#ifdef HORIZONTAL","float index = vUV.x * u_transformSize - 0.5;","#else","float index = vUV.y * u_transformSize - 0.5;","#endif","float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);","#ifdef HORIZONTAL","vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","#else","vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;","#endif","float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);","vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));","vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);","vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);","gl_FragColor = vec4(outputA, outputB);","}"].join("\n")},a.ShaderLib.ocean_initial_spectrum={uniforms:{u_wind:{value:new a.Vector2(10,10)},u_resolution:{value:512},u_size:{value:250}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","const float CM = 0.23;","uniform vec2 u_wind;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + pow2(k / KM)));","}","float tanh (float x) {","return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 K = (2.0 * PI * vec2(n, m)) / u_size;","float k = length(K);","float l_wind = length(u_wind);","float Omega = 0.84;","float kp = G * pow2(Omega / l_wind);","float c = omega(k) / k;","float cp = omega(kp) / kp;","float Lpm = exp(-1.25 * pow2(kp / k));","float gamma = 1.7;","float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));","float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));","float Jp = pow(gamma, Gamma);","float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));","float alphap = 0.006 * sqrt(Omega);","float Bl = 0.5 * alphap * cp / c * Fp;","float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);","float uStar = 0.41 * l_wind / log(10.0 / z0);","float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));","float Fm = exp(-0.25 * pow2(k / KM - 1.0));","float Bh = 0.5 * alpham * CM / c * Fm * Lpm;","float a0 = log(2.0) / 4.0;","float am = 0.13 * uStar / CM;","float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));","float cosPhi = dot(normalize(u_wind), normalize(K));","float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));","float dk = 2.0 * PI / u_size;","float h = sqrt(S / 2.0) * dk;","if (K.x == 0.0 && K.y == 0.0) {","h = 0.0;","}","gl_FragColor = vec4(h, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_phase={uniforms:{u_phases:{value:null},u_deltaTime:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform sampler2D u_phases;","uniform float u_deltaTime;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","float deltaTime = 1.0 / 60.0;","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","float deltaPhase = omega(length(waveVector)) * u_deltaTime;","phase = mod(phase + deltaPhase, 2.0 * PI);","gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_spectrum={uniforms:{u_size:{value:null},u_resolution:{value:null},u_choppiness:{value:null},u_phases:{value:null},u_initialSpectrum:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform float u_size;","uniform float u_resolution;","uniform float u_choppiness;","uniform sampler2D u_phases;","uniform sampler2D u_initialSpectrum;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","vec2 multiplyByI (vec2 z) {","return vec2(-z[1], z[0]);","}","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","vec2 phaseVector = vec2(cos(phase), sin(phase));","vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;","vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;","h0Star.y *= -1.0;","vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));","vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;","vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;","if (waveVector.x == 0.0 && waveVector.y == 0.0) {","h = vec2(0.0);","hX = vec2(0.0);","hZ = vec2(0.0);","}","gl_FragColor = vec4(hX + multiplyByI(h), hZ);","}"].join("\n")},a.ShaderLib.ocean_normals={uniforms:{u_displacementMap:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform float u_resolution;","uniform float u_size;","void main (void) {","float texel = 1.0 / u_resolution;","float texelSize = u_size / u_resolution;","vec3 center = texture2D(u_displacementMap, vUV).rgb;","vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;","vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;","vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;","vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;","vec3 topRight = cross(right, top);","vec3 topLeft = cross(top, left);","vec3 bottomLeft = cross(left, bottom);","vec3 bottomRight = cross(bottom, right);","gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);","}"].join("\n")},a.ShaderLib.ocean_main={uniforms:{u_displacementMap:{value:null},u_normalMap:{value:null},u_geometrySize:{value:null},u_size:{value:null},u_projectionMatrix:{value:null},u_viewMatrix:{value:null},u_cameraPosition:{value:null},u_skyColor:{value:null},u_oceanColor:{value:null},u_sunDirection:{value:null},u_exposure:{value:null}},vertexShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform mat4 u_projectionMatrix;","uniform mat4 u_viewMatrix;","uniform float u_size;","uniform float u_geometrySize;","uniform sampler2D u_displacementMap;","void main (void) {","vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);","vPos = newPos;","vUV = uv;","gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);","}"].join("\n"),fragmentShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform sampler2D u_normalMap;","uniform vec3 u_cameraPosition;","uniform vec3 u_oceanColor;","uniform vec3 u_skyColor;","uniform vec3 u_sunDirection;","uniform float u_exposure;","vec3 hdr (vec3 color, float exposure) {","return 1.0 - exp(-color * exposure);","}","void main (void) {","vec3 normal = texture2D(u_normalMap, vUV).rgb;","vec3 view = normalize(u_cameraPosition - vPos);","float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);","vec3 sky = fresnel * u_skyColor;","float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);","vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;","vec3 color = sky + water;","gl_FragColor = vec4(hdr(color, u_exposure), 1.0);","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","vUv = uv;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vViewPosition = -mvPosition.xyz;","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","vec2 parallaxMap( in vec3 V ) {","float initialHeight = texture2D( bumpMap, vUv ).r;","vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","return vUv - texCoordOffset;","}","#else","vec2 parallaxMap( in vec3 V ) {","float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","float layerHeight = 1.0 / numLayers;","float currentLayerHeight = 0.0;","vec2 dtex = parallaxScale * V.xy / V.z / numLayers;","vec2 currentTextureCoords = vUv;","float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","for ( int i = 0; i < 30; i += 1 ) {","if ( heightFromTexture <= currentLayerHeight ) {","break;","}","currentLayerHeight += layerHeight;","currentTextureCoords -= dtex;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","}","#ifdef USE_STEEP_PARALLAX","return currentTextureCoords;","#elif defined( USE_RELIEF_PARALLAX )","vec2 deltaTexCoord = dtex / 2.0;","float deltaHeight = layerHeight / 2.0;","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","const int numSearches = 5;","for ( int i = 0; i < numSearches; i += 1 ) {","deltaTexCoord /= 2.0;","deltaHeight /= 2.0;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","if( heightFromTexture > currentLayerHeight ) {","currentTextureCoords -= deltaTexCoord;","currentLayerHeight += deltaHeight;","} else {","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","}","}","return currentTextureCoords;","#elif defined( USE_OCLUSION_PARALLAX )","vec2 prevTCoords = currentTextureCoords + dtex;","float nextH = heightFromTexture - currentLayerHeight;","float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","float weight = nextH / ( nextH - prevH );","return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","#else","return vUv;","#endif","}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","vec2 texDx = dFdx( vUv );","vec2 texDy = dFdy( vUv );","vec3 vSigmaX = dFdx( surfPosition );","vec3 vSigmaY = dFdy( surfPosition );","vec3 vR1 = cross( vSigmaY, surfNormal );","vec3 vR2 = cross( surfNormal, vSigmaX );","float fDet = dot( vSigmaX, vR1 );","vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","vec3 vProjVtex;","vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","vProjVtex.z = dot( surfNormal, viewPosition );","return parallaxMap( vProjVtex );","}","void main() {","vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","gl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, vUv + offset);","vec4 cga = texture2D(tDiffuse, vUv);","vec4 cb = texture2D(tDiffuse, vUv - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","gl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","gl_FragColor = newTex;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{texture:{value:null},delta:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = rand( vUv );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{color:{type:"c",value:null},time:{type:"f",value:0},tDiffuse:{type:"t",value:null},tDudv:{type:"t",value:null},textureMatrix:{type:"m4",value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Volume=void 0;var a,n=r(10),i=(a=n)&&a.__esModule?a:{default:a};t.Volume=i.default}]))},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,a,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,a)}));case 4:return t.nextTick((function(){e.call(null,r,a,n)}));default:for(i=new Array(s-1),o=0;o>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return n>0&&(e.lastNeed=n-1),n;if(--a=0)return n>0&&(e.lastNeed=n-2),n;if(--a=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";(function(t){var a=r(117); +!function(e,t){for(var r in t)e[r]=t[r]}(exports,function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){e.exports=__webpack_require__(0)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1};Object.assign(a.prototype,{setSize:function(e,t){},render:function(e,t,r,a,n){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(1),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t){o.default.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof n.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=n.UniformsUtils.clone(e.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new n.Scene,this.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)}}),t.default=s},function(e,t,r){!function(e){"use strict";function t(){}function r(e,r){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===r||r,this.encoder=new t}function a(){}function n(){}t.prototype.s2u=function(e){for(var t=this.s2uTable,r="",a=0;a=0&&n<=126||n>=161&&n<=223)&&a0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},a.prototype={constructor:a,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],a=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=a}},n.prototype.parsePmd=function(e,t){var a,n={},i=new r(e);return n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left",function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),function(){var e,t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r0&&(a.englishModelName=i.getSjisStringsAsUnicode(20),a.englishComment=i.getSjisStringsAsUnicode(256)),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneNames=[];for(var t=0;t=2.0 are supported. Use LegacyGLTFLoader instead.")):(m.extensionsUsed&&(m.extensionsUsed.indexOf(r.KHR_LIGHTS)>=0&&(p[r.KHR_LIGHTS]=new i(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_UNLIT)>=0&&(p[r.KHR_MATERIALS_UNLIT]=new o(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(p[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new h),m.extensionsUsed.indexOf(r.KHR_DRACO_MESH_COMPRESSION)>=0&&(p[r.KHR_DRACO_MESH_COMPRESSION]=new f(this.dracoLoader)),m.extensionsUsed.indexOf(r.MSFT_TEXTURE_DDS)>=0&&(p[r.MSFT_TEXTURE_DDS]=new n)),new U(m,p,{path:t||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse((function(e,t,r,a,n){l({scene:e,scenes:t,cameras:r,animations:a,asset:n})}),u))}};var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(){if(!a.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=new a.DDSLoader}function i(e){this.name=r.KHR_LIGHTS,this.lights={};var t=(e.extensions&&e.extensions[r.KHR_LIGHTS]||{}).lights||{};for(var n in t){var i,o=t[n],s=(new a.Color).fromArray(o.color);switch(o.type){case"directional":(i=new a.DirectionalLight(s)).target.position.set(0,0,1),i.add(i.target);break;case"point":i=new a.PointLight(s);break;case"spot":i=new a.SpotLight(s),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;case"ambient":i=new a.AmbientLight(s)}i&&(i.decay=2,void 0!==o.intensity&&(i.intensity=o.intensity),i.name=o.name||"light_"+n,this.lights[n]=i)}}function o(e){this.name=r.KHR_MATERIALS_UNLIT}o.prototype.getMaterialType=function(e){return a.MeshBasicMaterial},o.prototype.extendParams=function(e,t,r){var n=[];e.color=new a.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var o=i.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture.index))}return Promise.all(n)};var s="glTF",l=12,u={JSON:1313821514,BIN:5130562};function c(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,l);if(this.header={magic:a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,l),i=0;i",s).replace("#include ",l).replace("#include ",u).replace("#include ",c).replace("#include ",f);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new a.Color).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=h,e.uniforms=o,e.defines={STANDARD:""},e.color=new a.Color(1,1,1),e.opacity=1;var d=[];if(Array.isArray(n.diffuseFactor)){var p=n.diffuseFactor;e.color.fromArray(p),e.opacity=p[3]}if(void 0!==n.diffuseTexture&&d.push(r.assignTexture(e,"map",n.diffuseTexture.index)),e.emissive=new a.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new a.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var m=n.specularGlossinessTexture.index;d.push(r.assignTexture(e,"glossinessMap",m)),d.push(r.assignTexture(e,"specularMap",m))}return Promise.all(d)},createMaterial:function(e){var t=new a.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var r=this.specularGlossinessParams,a=0,n=r.length;a=2&&(n[i+1]=e.getY(i)),r>=3&&(n[i+2]=e.getZ(i)),r>=4&&(n[i+3]=e.getW(i));return new a.BufferAttribute(n,r,e.normalized)}return e.clone()}function U(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new t,this.primitiveCache=[],this.textureLoader=new a.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function j(e,t,r){var a=t.attributes;for(var n in a){var i=T[n],o=r[a[n]];i&&(i in e.attributes||e.addAttribute(i,o))}void 0===t.indices||e.index||e.setIndex(r[t.indices])}return U.prototype.parse=function(e,t){var r=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then((function(t){var a=t.scenes||[],n=a[r.scene||0],i=t.animations||[],o=r.asset,s=t.cameras||[];e(n,a,s,i,o)})).catch(t)},U.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},i=0,o=t.length;i=2&&o.setY(T,A[E*l+1]),l>=3&&o.setZ(T,A[E*l+2]),l>=4&&o.setW(T,A[E*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},U.prototype.loadTexture=function(e){var t,n=this,i=this.json,o=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=i.textures[e],c=u.extensions||{},f=(t=c[r.MSFT_TEXTURE_DDS]?i.images[c[r.MSFT_TEXTURE_DDS].source]:i.images[u.source]).uri,h=!1;return void 0!==t.bufferView&&(f=n.getDependency("bufferView",t.bufferView).then((function(e){h=!0;var r=new Blob([e],{type:t.mimeType});return f=l.createObjectURL(r)}))),Promise.resolve(f).then((function(e){var t=a.Loader.Handlers.get(e);return t||(t=c[r.MSFT_TEXTURE_DDS]?n.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(r,a){t.load(k(e,o.path),r,void 0,a)}))})).then((function(e){!0===h&&l.revokeObjectURL(f),e.flipY=!1,void 0!==u.name&&(e.name=u.name),c[r.MSFT_TEXTURE_DDS]||(e.format=void 0!==u.format?E[u.format]:a.RGBAFormat),void 0!==u.internalFormat&&e.format!==E[u.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==u.type?S[u.type]:a.UnsignedByteType;var t=(i.samplers||{})[u.sampler]||{};return e.magFilter=_[t.magFilter]||a.LinearFilter,e.minFilter=_[t.minFilter]||a.LinearMipMapLinearFilter,e.wrapS=A[t.wrapS]||a.RepeatWrapping,e.wrapT=A[t.wrapT]||a.RepeatWrapping,e}))},U.prototype.assignTexture=function(e,t,r){return this.getDependency("texture",r).then((function(r){e[t]=r}))},U.prototype.loadMaterial=function(e){this.json;var t,n=this.extensions,i=this.json.materials[e],o={},s=i.extensions||{},l=[];if(s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(i),l.push(u.extendParams(o,i,this))}else if(s[r.KHR_MATERIALS_UNLIT]){var c=n[r.KHR_MATERIALS_UNLIT];t=c.getMaterialType(i),l.push(c.extendParams(o,i,this))}else{t=a.MeshStandardMaterial;var f=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(f.baseColorFactor)){var h=f.baseColorFactor;o.color.fromArray(h),o.opacity=h[3]}if(void 0!==f.baseColorTexture&&l.push(this.assignTexture(o,"map",f.baseColorTexture.index)),o.metalness=void 0!==f.metallicFactor?f.metallicFactor:1,o.roughness=void 0!==f.roughnessFactor?f.roughnessFactor:1,void 0!==f.metallicRoughnessTexture){var d=f.metallicRoughnessTexture.index;l.push(this.assignTexture(o,"metalnessMap",d)),l.push(this.assignTexture(o,"roughnessMap",d))}}!0===i.doubleSided&&(o.side=a.DoubleSide);var p=i.alphaMode||O;return p===C?o.transparent=!0:(o.transparent=!1,p===L&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"normalMap",i.normalTexture.index)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale&&o.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"aoMap",i.occlusionTexture.index)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==a.MeshBasicMaterial&&l.push(this.assignTexture(o,"emissiveMap",i.emissiveTexture.index)),Promise.all(l).then((function(){var e;return e=t===a.ShaderMaterial?n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==i.name&&(e.name=i.name),e.normalScale&&(e.normalScale.y=-e.normalScale.y),e.map&&(e.map.encoding=a.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=a.sRGBEncoding),i.extras&&(e.userData=i.extras),e}))},U.prototype.loadGeometries=function(e){var t=this,n=this.extensions,i=this.primitiveCache;return this.getDependencies("accessor").then((function(o){for(var s=[],l=0,u=e.length;l1))return _;_.name+="_"+c,s.add(_)}return s}))}))},U.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new a.PerspectiveCamera(a.Math.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new a.OrthographicCamera(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar)),void 0!==r.name&&(t.name=r.name),r.extras&&(t.userData=r.extras),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},U.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},U.prototype.loadAnimation=function(e){this.json;var t=this.json.animations[e];return this.getMultiDependencies(["accessor","node"]).then((function(r){for(var n=[],i=0,o=t.channels.length;i1&&(s.name+="_instance_"+i[o.mesh]++)}else if(void 0!==o.camera)s=e.cameras[o.camera];else if(o.extensions&&o.extensions[r.KHR_LIGHTS]&&void 0!==o.extensions[r.KHR_LIGHTS].light){s=t[r.KHR_LIGHTS].lights[o.extensions[r.KHR_LIGHTS].light]}else s=new a.Object3D;if(void 0!==o.name&&(s.name=a.PropertyBinding.sanitizeNodeName(o.name)),o.extras&&(s.userData=o.extras),void 0!==o.matrix){var h=new a.Matrix4;h.fromArray(o.matrix),s.applyMatrix(h)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return s}))},U.prototype.loadScene=function(){function e(t,r,n,i,o){var s=i[t],l=n.nodes[t];if(void 0!==l.skin)for(var u=!0===s.isGroup?s.children:[s],c=0,f=u.length;c(n=s.indexOf("\n"))&&i=e.byteLength||!(a=r(e)))return t(1,"no header found");if(!(n=a.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(u.valid|=1,u.programtype=n[1],u.string+=a+"\n";!1!==(a=r(e));)if(u.string+=a+"\n","#"!==a.charAt(0)){if((n=a.match(i))&&(u.gamma=parseFloat(n[1],10)),(n=a.match(o))&&(u.exposure=parseFloat(n[1],10)),(n=a.match(s))&&(u.valid|=2,u.format=n[1]),(n=a.match(l))&&(u.valid|=4,u.height=parseInt(n[1],10),u.width=parseInt(n[2],10)),2&u.valid&&4&u.valid)break}else u.comments+=a+"\n";return 2&u.valid?4&u.valid?u:t(3,"missing image size specifier"):t(3,"missing format specifier")}(n);if(-1!==i){var o=i.width,s=i.height,l=function(e,r,a){var n,i,o,s,l,u,c,f,h,d,p,m,v,g=r,y=a;if(g<8||g>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(g!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(n=new Uint8Array(4*r*a))||!n.length)return t(4,"unable to allocate buffer space");for(i=0,o=0,f=4*g,v=new Uint8Array(4),u=new Uint8Array(f);y>0&&oe.byteLength)return t(1);if(v[0]=e[o++],v[1]=e[o++],v[2]=e[o++],v[3]=e[o++],2!=v[0]||2!=v[1]||(v[2]<<8|v[3])!=g)return t(3,"bad rgbe scanline format");for(c=0;c128)&&(s-=128),0===s||c+s>f)return t(3,"bad scanline data");if(m)for(l=e[o++],h=0;h0){var x=[];for(var w in v)d=v[w],x[w]=d.name;m="Adding mesh(es) ("+x.length+": "+x+") from input mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)"}else m="Not adding mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)";var _=this.callbacks.onProgress;t.isValid(_)&&_(new CustomEvent("MeshBuilderEvent",{detail:{type:"progress",modelName:e.params.meshName,text:m,numericalValue:e.progress.numericalValue}}));return v},r.prototype.updateMaterials=function(e){var r,a,i=e.materials.materialCloneInstructions;if(t.isValid(i)){var o=i.materialNameOrg,s=this.materials[o];if(t.isValid(o)){r=s.clone(),a=i.materialName,r.name=a;var l=i.materialProperties;for(var u in l)r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&(r[u]=l[u]);this.materials[a]=r}else console.warn('Requested material "'+o+'" is not available!')}var c=e.materials.serializedMaterials;if(t.isValid(c)&&Object.keys(c).length>0){var f,h=new n.MaterialLoader;for(a in c)f=c[a],t.isValid(f)&&(r=h.parse(f),this.logging.enabled&&console.info('De-serialized material with name "'+a+'" will be added.'),this.materials[a]=r)}if(c=e.materials.runtimeMaterials,t.isValid(c)&&Object.keys(c).length>0)for(a in c)r=c[a],this.logging.enabled&&console.info('Material with name "'+a+'" will be added.'),this.materials[a]=r},r.prototype.getMaterialsJSON=function(){var e,t={};for(var r in this.materials)e=this.materials[r],t[r]=e.toJSON();return t},r.prototype.getMaterials=function(){return this.materials},r}(),s.WorkerRunnerRefImpl=function(){function e(){var e=this;self.addEventListener("message",(function(t){e.processMessage(t.data)}),!1)}return e.prototype.applyProperties=function(e,t){var r,a,n;for(r in t)a="set"+r.substring(0,1).toLocaleUpperCase()+r.substring(1),n=t[r],"function"==typeof e[a]?e[a](n):e.hasOwnProperty(r)&&(e[r]=n)},e.prototype.processMessage=function(e){if("run"===e.cmd){var t={callbackMeshBuilder:function(e){self.postMessage(e)},callbackProgress:function(t){e.logging.enabled&&e.logging.debug&&console.debug("WorkerRunner: progress: "+t)}},r=new Parser;"function"==typeof r.setLogging&&r.setLogging(e.logging.enabled,e.logging.debug),this.applyProperties(r,e.params),this.applyProperties(r,e.materials),this.applyProperties(r,t),r.workerScope=self,r.parse(e.data.input,e.data.options),e.logging.enabled&&console.log("WorkerRunner: Run complete!"),t.callbackMeshBuilder({cmd:"complete",msg:"WorkerRunner completed run."})}else console.error("WorkerRunner: Received unknown command: "+e.cmd)},e}(),s.WorkerSupport=function(){var e="2.2.0",t=s.Validator,r=function(){function e(){this._reset()}return e.prototype._reset=function(){this.logging={enabled:!0,debug:!1},this.worker=null,this.runnerImplName=null,this.callbacks={meshBuilder:null,onLoad:null},this.terminateRequested=!1,this.queuedMessage=null,this.started=!1,this.forceCopy=!1},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.setForceCopy=function(e){this.forceCopy=!0===e},e.prototype.initWorker=function(e,t){this.runnerImplName=t;var r=new Blob([e],{type:"application/javascript"});this.worker=new Worker(o.URL.createObjectURL(r)),this.worker.onmessage=this._receiveWorkerMessage,this.worker.runtimeRef=this,this._postMessage()},e.prototype._receiveWorkerMessage=function(e){var t=e.data;switch(t.cmd){case"meshData":case"materialData":case"imageData":this.runtimeRef.callbacks.meshBuilder(t);break;case"complete":this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run is complete. Terminating application on request!"),this.runtimeRef._terminate());break;case"error":console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Reported error: "+t.msg),this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run reported error. Terminating application on request!"),this.runtimeRef._terminate());break;default:console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Received unknown command: "+t.cmd)}},e.prototype.setCallbacks=function(e,r){this.callbacks.meshBuilder=t.verifyInput(e,this.callbacks.meshBuilder),this.callbacks.onLoad=t.verifyInput(r,this.callbacks.onLoad)},e.prototype.run=function(e){if(t.isValid(this.queuedMessage))console.warn("Already processing message. Rejecting new run instruction");else{if(this.queuedMessage=e,this.started=!0,!t.isValid(this.callbacks.meshBuilder))throw'Unable to run as no "MeshBuilder" callback is set.';if(!t.isValid(this.callbacks.onLoad))throw'Unable to run as no "onLoad" callback is set.';"run"!==e.cmd&&(e.cmd="run"),t.isValid(e.logging)?(e.logging.enabled=!0===e.logging.enabled,e.logging.debug=!0===e.logging.debug):e.logging={enabled:!0,debug:!1},this._postMessage()}},e.prototype._postMessage=function(){var e;t.isValid(this.queuedMessage)&&t.isValid(this.worker)&&(this.queuedMessage.data.input instanceof ArrayBuffer?(e=this.forceCopy?this.queuedMessage.data.input.slice(0):this.queuedMessage.data.input,this.worker.postMessage(this.queuedMessage,[e])):this.worker.postMessage(this.queuedMessage))},e.prototype.setTerminateRequested=function(e){this.terminateRequested=!0===e,this.terminateRequested&&t.isValid(this.worker)&&!t.isValid(this.queuedMessage)&&this.started&&(this.logging.enabled&&console.info("Worker is terminated immediately as it is not running!"),this._terminate())},e.prototype._terminate=function(){this.worker.terminate(),this._reset()},e}();function a(){if(console.info("Using THREE.LoaderSupport.WorkerSupport version: "+e),this.logging={enabled:!0,debug:!1},void 0===o.Worker)throw"This browser does not support web workers!";if(void 0===o.Blob)throw"This browser does not support Blob!";if("function"!=typeof o.URL.createObjectURL)throw"This browser does not support Object creation from URL!";this.loaderWorker=new r}a.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t,this.loaderWorker.setLogging(this.logging.enabled,this.logging.debug)},a.prototype.setForceWorkerDataCopy=function(e){this.loaderWorker.setForceCopy(e)},a.prototype.validate=function(e,r,a,o,u){if(!t.isValid(this.loaderWorker.worker)){this.logging.enabled&&(console.info("WorkerSupport: Building worker code..."),console.time("buildWebWorkerCode")),t.isValid(u)?this.logging.enabled&&console.info('WorkerSupport: Using "'+u.name+'" as Runner class for worker.'):(u=s.WorkerRunnerRefImpl,this.logging.enabled&&console.info('WorkerSupport: Using DEFAULT "THREE.LoaderSupport.WorkerRunnerRefImpl" as Runner class for worker.'));var c=e(i,l);c+="var Parser = "+r+";\n\n",c+=l(u.name,u),c+="new "+u.name+"();\n\n";var f=this;if(t.isValid(a)&&a.length>0){var h="";!function e(t,r){if(0===r.length)f.loaderWorker.initWorker(h+c,u.name),f.logging.enabled&&console.timeEnd("buildWebWorkerCode");else{var a=new n.FileLoader;a.setPath(t),a.setResponseType("text"),a.load(r[0],(function(a){h+=a,e(t,r)})),r.shift()}}(o,a)}else this.loaderWorker.initWorker(c,u.name),this.logging.enabled&&console.timeEnd("buildWebWorkerCode")}},a.prototype.setCallbacks=function(e,t){this.loaderWorker.setCallbacks(e,t)},a.prototype.run=function(e){this.loaderWorker.run(e)},a.prototype.setTerminateRequested=function(e){this.loaderWorker.setTerminateRequested(e)};var i=function(e,t){var r,a=e+" = {\n";for(var n in t)"string"==typeof(r=t[n])||r instanceof String?a+="\t"+n+': "'+(r=(r=r.replace("\n","\\n")).replace("\r","\\r"))+'",\n':r instanceof Array?a+="\t"+n+": ["+r+"],\n":Number.isInteger(r)?a+="\t"+n+": "+r+",\n":"function"==typeof r&&(a+="\t"+n+": "+r+",\n");return a+="}\n\n"},l=function(e,r,a,n,i){var o,s,l="",u=t.isValid(a)?a:r.name;for(var c in i=t.verifyInput(i,[]),r.prototype)o=r.prototype[c],"constructor"===c?s="\tfunction "+u+o.toString().replace("function","")+";\n\n":"function"==typeof o&&i.indexOf(c)<0&&(l+="\t"+u+".prototype."+c+" = "+o.toString()+";\n\n");l+="\treturn "+u+";\n",l+="})();\n\n";var f="";return t.isValid(n)&&(f+="\n",f+=u+".prototype = Object.create( "+n+".prototype );\n",f+=u+".constructor = "+u+";\n",f+="\n"),t.isValid(s)?l=e+" = (function () {\n\n"+f+s+l:(s=e+" = (function () {\n\n",l=(s+=f+"\t"+r.prototype.constructor.toString()+"\n\n")+l),l};return a}(),s.WorkerDirector=function(){var e="2.2.0",t=s.Validator,r=16,a=8192;function i(n){if(console.info("Using THREE.LoaderSupport.WorkerDirector version: "+e),this.logging={enabled:!0,debug:!1},this.maxQueueSize=a,this.maxWebWorkers=r,this.crossOrigin=null,!t.isValid(n))throw"Provided invalid classDef: "+n;this.workerDescription={classDef:n,globalCallbacks:{},workerSupports:{},forceWorkerDataCopy:!0},this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0,this.callbackOnFinishedProcessing=null}return i.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},i.prototype.getMaxQueueSize=function(){return this.maxQueueSize},i.prototype.getMaxWebWorkers=function(){return this.maxWebWorkers},i.prototype.setCrossOrigin=function(e){this.crossOrigin=e},i.prototype.setForceWorkerDataCopy=function(e){this.workerDescription.forceWorkerDataCopy=!0===e},i.prototype.prepareWorkers=function(e,i,o){t.isValid(e)&&(this.workerDescription.globalCallbacks=e),this.maxQueueSize=Math.min(i,a),this.maxWebWorkers=Math.min(o,r),this.maxWebWorkers=Math.min(this.maxWebWorkers,this.maxQueueSize),this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0;for(var s=0;s0&&this.instructionQueuePointer0},i.prototype.processQueue=function(){var e,t;for(var r in this.workerDescription.workerSupports)(t=this.workerDescription.workerSupports[r]).inUse||(this.instructionQueuePointer=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},i[c]=r;else if(r)if("ka"===u||"kd"===u||"ks"===u){var f=c.split(a,3);r[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else r[u]=c}}var h=new n.MaterialCreator(this.texturePath||this.path,this.materialOptions);return h.setCrossOrigin(this.crossOrigin),h.setManager(this.manager),h.setMaterials(i),h}},(n.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:a.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:a.RepeatWrapping}).prototype={constructor:n.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var r in e){var a=e[r],n={};for(var i in t[r]=n,a){var o=!0,s=a[i],l=i.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(n[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,r=this.materialsInfo[e],n={name:e,side:this.side};function i(e,r){if(!n[e]){var a,i,o=t.getTextureParams(r,n),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(i=o.url)||""===i?"":/^https?:\/\//i.test(i)?i:a+i));s.repeat.copy(o.scale),s.offset.copy(o.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,n[e]=s}}for(var o in r){var s,l=r[o];if(""!==l)switch(o.toLowerCase()){case"kd":n.color=(new a.Color).fromArray(l);break;case"ks":n.specular=(new a.Color).fromArray(l);break;case"map_kd":i("map",l);break;case"map_ks":i("specularMap",l);break;case"norm":i("normalMap",l);break;case"map_bump":case"bump":i("bumpMap",l);break;case"ns":n.shininess=parseFloat(l);break;case"d":(s=parseFloat(l))<1&&(n.opacity=s,n.transparent=!0);break;case"tr":s=parseFloat(l),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var r,n={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},i=e.split(/\s+/);return(r=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),(r=i.indexOf("-s"))>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),(r=i.indexOf("-o"))>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n},loadTexture:function(e,t,r,n,i){var o,s=a.Loader.Handlers.get(e),l=void 0!==this.manager?this.manager:a.DefaultLoadingManager;return null===s&&(s=new a.TextureLoader(l)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,r,n,i),void 0!==t&&(o.mapping=t),o}},t.default=n},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _three=__webpack_require__(0),THREE=_interopRequireWildcard(_three);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var Volume=function(e,t,r,a,n){if(arguments.length>0){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,a){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(n);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(n);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(n);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(n);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(n);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(n);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw"Error in THREE.Volume constructor : this type is not supported in JavaScript";case"Float32":case"float32":case"float":this.data=new Float32Array(n);break;case"Float64":case"float64":case"double":this.data=new Float64Array(n);break;default:this.data=new Uint8Array(n)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw"Error in THREE.Volume constructor, lengths are not matching arrayBuffer size"}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new THREE.Matrix3,this.matrix.identity();var i=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return i},set:function(e){i=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});var o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[]};Volume.prototype={constructor:Volume,getData:function(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]},access:function(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e},reverseAccess:function(e){var t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]},map:function(e,t){var r=this.data.length;t=t||this;for(var a=0;a.9})),jDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[1]))>.9})),kDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[2]))>.9})),argumentsWithInversion=["volume.xLength-1-","volume.yLength-1-","volume.zLength-1-"],argArray=[iDirection,jDirection,kDirection].map((function(e,t){return(e.dot(base[t])>0?"":argumentsWithInversion[t])+(e===axisInIJK?"IJKIndex":e.argVar)})),argString=argArray.join(",");return sliceAccess=eval("(function sliceAccess (i,j) {return volume.access( "+argString+");})"),{iLength:iLength,jLength:jLength,sliceAccess:sliceAccess,matrix:planeMatrix,planeWidth:planeWidth,planeHeight:planeHeight}},extractSlice:function(e,t){var r=new THREE.VolumeSlice(this,t,e);return this.sliceList.push(r),r},repaintAllSlices:function(){return this.sliceList.forEach((function(e){e.repaint()})),this},computeMinMax:function(){var e=1/0,t=-1/0,r=this.data.length,a=0;for(a=0;a","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","float l = linearToRelativeLuminance( texel.rgb );","gl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","uniform sampler2D luminanceMap;","#else","uniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","#ifdef ADAPTED_LUMINANCE","float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","#else","float fLumAvg = averageLuminance;","#endif","float fLumPixel = linearToRelativeLuminance( vColor );","float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","return fLumCompressed * vColor;","}","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-e*e/(2*t*t))}var r,a,n,i,o=2*Math.ceil(3*e)+1;for(o>25&&(o=25),i=.5*(o-1),a=new Array(o),n=0,r=0;r","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","vec2 aspectcorrect = vec2( 1.0, aspect );","float viewZ = getViewZ( getDepth( vUv ) );","float factor = ( focus + viewZ );","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},tSize:{value:new a.Vector2(256,256)},center:{value:new a.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float dx = rand( vUv + time );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","if(byp<1) {","vec2 p = vUv;","float xs = floor(gl_FragCoord.x / 0.5);","float ys = floor(gl_FragCoord.y / 0.5);","vec4 normal = texture2D (tDisp, p*seed*seed);","if(p.ydistortion_x-col_s*seed) {","if(seed_x>0.){","p.y = 1. - (p.y + distortion_y);","}","else {","p.y = distortion_y;","}","}","if(p.xdistortion_y-col_s*seed) {","if(seed_y>0.){","p.x=distortion_x;","}","else {","p.x = 1. - (p.x + distortion_x);","}","}","p.x+=normal.x*seed_x*(seed/5.);","p.y+=normal.y*seed_y*(seed/5.);","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, p + offset);","vec4 cga = texture2D(tDiffuse, p);","vec4 cb = texture2D(tDiffuse, p - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","gl_FragColor = gl_FragColor+ snow;","}","else {","gl_FragColor=texture2D (tDiffuse, vUv);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","vUV = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","return a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","return sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","float dist = hypot( coord.x - p.x, coord.y - p.y );","float rad = channel;","if ( shape == SHAPE_DOT ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","} else if ( shape == SHAPE_ELLIPSE ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","if ( dist != 0.0 ) {","float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","}","} else if ( shape == SHAPE_LINE ) {","rad = pow( abs( rad ), 1.5) * rad_max;","float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","dist = hypot( normal.x * dot_p, normal.y * dot_p );","} else if ( shape == SHAPE_SQUARE ) {","float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","float sin_t = abs( sin( theta ) );","float cos_t = abs( cos( theta ) );","rad = pow( abs( rad ), 1.4 );","rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","}","return rad - dist;","}","struct Cell {","vec2 normal;","vec2 p1;","vec2 p2;","vec2 p3;","vec2 p4;","float samp2;","float samp1;","float samp3;","float samp4;","};","vec4 getSample( vec2 point ) {","vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","float step = PI2 / float( samples );","float dist = radius * 0.66;","for ( int i = 0; i < samples; ++i ) {","float r = base + step * float( i );","vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","}","tex /= float( samples ) + 1.0;","return tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","if ( channel == 0 ) {","c.samp1 = getSample( c.p1 ).r;","c.samp2 = getSample( c.p2 ).r;","c.samp3 = getSample( c.p3 ).r;","c.samp4 = getSample( c.p4 ).r;","} else if (channel == 1) {","c.samp1 = getSample( c.p1 ).g;","c.samp2 = getSample( c.p2 ).g;","c.samp3 = getSample( c.p3 ).g;","c.samp4 = getSample( c.p4 ).g;","} else {","c.samp1 = getSample( c.p1 ).b;","c.samp3 = getSample( c.p3 ).b;","c.samp2 = getSample( c.p2 ).b;","c.samp4 = getSample( c.p4 ).b;","}","dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","res = clamp( res, 0.0, 1.0 );","return res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","Cell c;","vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","float threshold = step * 0.5;","float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","float offset_normal = mod( hypot( offset.x, offset.y ), step );","float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","c.normal = n;","c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","if ( scatter != 0.0 ) {","float off_mag = scatter * threshold * 0.5;","float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","c.p1.x += cos( off_angle ) * off_mag;","c.p1.y += sin( off_angle ) * off_mag;","}","float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","c.p2.x = c.p1.x - n.x * normal_step;","c.p2.y = c.p1.y - n.y * normal_step;","c.p3.x = c.p1.x + n.y * line_step;","c.p3.y = c.p1.y - n.x * line_step;","c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","return c;","}","float blendColour( float a, float b, float t ) {","if ( blendingMode == BLENDING_LINEAR ) {","return blend( a, b, 1.0 - t );","} else if ( blendingMode == BLENDING_ADD ) {","return blend( a, min( 1.0, a + b ), t );","} else if ( blendingMode == BLENDING_MULTIPLY ) {","return blend( a, max( 0.0, a * b ), t );","} else if ( blendingMode == BLENDING_LIGHTER ) {","return blend( a, max( a, b ), t );","} else if ( blendingMode == BLENDING_DARKER ) {","return blend( a, min( a, b ), t );","} else {","return blend( a, b, 1.0 - t );","}","}","void main() {","if ( ! disable ) {","vec2 p = vec2( vUV.x * width, vUV.y * height );","vec2 origin = vec2( 0, 0 );","float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","Cell cell_r = getReferenceCell( p, origin, rotateR, radius );","Cell cell_g = getReferenceCell( p, origin, rotateG, radius );","Cell cell_b = getReferenceCell( p, origin, rotateB, radius );","float r = getDotColour( cell_r, p, 0, rotateR, aa );","float g = getDotColour( cell_g, p, 1, rotateG, aa );","float b = getDotColour( cell_b, p, 2, rotateB, aa );","vec4 colour = texture2D( tDiffuse, vUV );","r = blendColour( r, colour.r, blending );","g = blendColour( g, colour.g, blending );","b = blendColour( b, colour.b, blending );","if ( greyscale ) {","r = g = b = (r + b + g) / 3.0;","}","gl_FragColor = vec4( r, g, b, 1.0 );","} else {","gl_FragColor = texture2D( tDiffuse, vUV );","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{type:"t",value:null},tDiffuse:{type:"t",value:null},tNormal:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},cameraProjectionMatrix:{type:"m4",value:new a.Matrix4},cameraInverseProjectionMatrix:{type:"m4",value:new a.Matrix4},scale:{type:"f",value:1},intensity:{type:"f",value:.1},bias:{type:"f",value:.5},minResolution:{type:"f",value:0},kernelRadius:{type:"f",value:100},randomSeed:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},sampleUvOffsets:{type:"v2v",value:[new a.Vector2(0,0)]},sampleWeights:{type:"1fv",value:[1]},tDepth:{type:"t",value:null},cameraNear:{type:"f",value:10},cameraFar:{type:"f",value:1e3},depthCutoff:{type:"f",value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","float depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={createSampleWeights:function(e,t){for(var r=function(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)},a=[],n=0;n<=e;n++)a.push(r(n,t));return a},createSampleOffsets:function(e,t){for(var r=[],a=0;a<=e;a++)r.push(t.clone().multiplyScalar(a));return r},configure:function(e,t,r,n){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=a.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=a.createSampleWeights(t,r),e.needsUpdate=!0}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","t = abs( C - Ctop );","delta.y = max( max( t.r, t.g ), t.b );","vec2 edges = step( threshold, delta.xy );","if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){n.default.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==o?o:0,void 0===i.default&&console.error("THREE.SSAARenderPass relies on THREE.CopyShader");var s=i.default;this.copyUniforms=a.UniformsUtils.clone(s.uniforms),this.copyMaterial=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.camera2=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene2=new a.Scene,this.quad2=new a.Mesh(new a.PlaneBufferGeometry(2,2),this.copyMaterial),this.quad2.frustumCulled=!1,this.scene2.add(this.quad2)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var n=s.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1;var o=e.getClearColor().getHex(),l=e.getClearAlpha(),u=1/n.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;for(var c=r.width,f=r.height,h=0;h","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );","float gg = fract( coord.t * ( size.y / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float readDepth( const in vec2 coord ) {","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","#ifdef USE_LOGDEPTHBUF","float logz = unpackRGBAToDepth( texture2D( tDepth, coord ) );","float w = pow(2.0, (logz / logDepthBufFC)) - 1.0;","float z = (logz / w) + 1.0;","#else","float z = unpackRGBAToDepth( texture2D( tDepth, coord ) );","#endif","return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 8.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + radius * vv;","vec2 coord2 = vUv - radius * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float ao = 0.0;","float dz = 1.0 / float( samples );","float l = 0.0;","float z = 1.0 - dz / 2.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","float pw = cos( l ) * r;","float ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{type:"t",value:null},luminosityThreshold:{type:"f",value:1},smoothWidth:{type:"f",value:1},defaultColor:{type:"c",value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(0)},defaultOpacity:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","gl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var n=r(40);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}));var i=r(48);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}));var o=r(90);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}));var s=r(112);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})}));var l=r(144);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VRControls=t.TransformControls=t.TrackballControls=t.PointerLockControls=t.OrthographicTrackballControls=t.OrbitControls=t.FlyControls=t.FirstPersonControls=t.EditorControls=t.DragControls=t.DeviceOrientationControls=void 0;var a=p(r(29)),n=p(r(30)),i=p(r(31)),o=p(r(32)),s=p(r(33)),l=p(r(34)),u=p(r(35)),c=p(r(36)),f=p(r(37)),h=p(r(38)),d=p(r(39));function p(e){return e&&e.__esModule?e:{default:e}}t.DeviceOrientationControls=a.default,t.DragControls=n.default,t.EditorControls=i.default,t.FirstPersonControls=o.default,t.FlyControls=s.default,t.OrbitControls=l.default,t.OrthographicTrackballControls=u.default,t.PointerLockControls=c.default,t.TrackballControls=f.default,t.TransformControls=h.default,t.VRControls=d.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r,n,i,o,s=function(e){t.deviceOrientation=e},l=function(){t.screenOrientation=window.orientation||0},u=(r=new a.Vector3(0,0,1),n=new a.Euler,i=new a.Quaternion,o=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),function(e,t,a,s,l){n.set(a,t,-s,"YXZ"),e.setFromEuler(n),e.multiply(o),e.multiply(i.setFromAxisAngle(r,-l))});this.connect=function(){l(),window.addEventListener("orientationchange",l,!1),window.addEventListener("deviceorientation",s,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",l,!1),window.removeEventListener("deviceorientation",s,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var r=e.alpha?a.Math.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?a.Math.degToRad(e.beta):0,i=e.gamma?a.Math.degToRad(e.gamma):0,o=t.screenOrientation?a.Math.degToRad(t.screenOrientation):0;u(t.object.quaternion,r,n,i,o)}}},this.dispose=function(){t.disconnect()},this.connect()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t,r){if(e instanceof a.Camera){console.warn("THREE.DragControls: Constructor now expects ( objects, camera, domElement )");var n=e;e=t,t=n}var i=new a.Plane,o=new a.Raycaster,s=new a.Vector2,l=new a.Vector3,u=new a.Vector3,c=null,f=null,h=this;function d(){r.addEventListener("mousemove",m,!1),r.addEventListener("mousedown",v,!1),r.addEventListener("mouseup",g,!1),r.addEventListener("mouseleave",g,!1),r.addEventListener("touchmove",y,!1),r.addEventListener("touchstart",b,!1),r.addEventListener("touchend",w,!1)}function p(){r.removeEventListener("mousemove",m,!1),r.removeEventListener("mousedown",v,!1),r.removeEventListener("mouseup",g,!1),r.removeEventListener("mouseleave",g,!1),r.removeEventListener("touchmove",y,!1),r.removeEventListener("touchstart",b,!1),r.removeEventListener("touchend",w,!1)}function m(a){a.preventDefault();var n=r.getBoundingClientRect();if(s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t),c&&h.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void h.dispatchEvent({type:"drag",object:c});o.setFromCamera(s,t);var d=o.intersectObjects(e);if(d.length>0){var p=d[0].object;i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),p.position),f!==p&&(h.dispatchEvent({type:"hoveron",object:p}),r.style.cursor="pointer",f=p)}else null!==f&&(h.dispatchEvent({type:"hoveroff",object:f}),r.style.cursor="auto",f=null)}function v(a){a.preventDefault(),o.setFromCamera(s,t);var n=o.intersectObjects(e);n.length>0&&(c=n[0].object,o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",h.dispatchEvent({type:"dragstart",object:c}))}function g(e){e.preventDefault(),c&&(h.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}function y(e){e.preventDefault(),e=e.changedTouches[0];var a=r.getBoundingClientRect();if(s.x=(e.clientX-a.left)/a.width*2-1,s.y=-(e.clientY-a.top)/a.height*2+1,o.setFromCamera(s,t),c&&h.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void h.dispatchEvent({type:"drag",object:c})}function b(a){a.preventDefault(),a=a.changedTouches[0];var n=r.getBoundingClientRect();s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t);var f=o.intersectObjects(e);f.length>0&&(c=f[0].object,i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),c.position),o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",h.dispatchEvent({type:"dragstart",object:c}))}function w(e){e.preventDefault(),c&&(h.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}d(),this.enabled=!0,this.activate=d,this.deactivate=p,this.dispose=function(){p()},this.setObjects=function(){console.error("THREE.DragControls: setObjects() has been removed.")},this.on=function(e,t){console.warn("THREE.DragControls: on() has been deprecated. Use addEventListener() instead."),h.addEventListener(e,t)},this.off=function(e,t){console.warn("THREE.DragControls: off() has been deprecated. Use removeEventListener() instead."),h.removeEventListener(e,t)},this.notify=function(e){console.error("THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead."),h.dispatchEvent({type:e})}};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){t=void 0!==t?t:document,this.enabled=!0,this.center=new a.Vector3,this.panSpeed=.001,this.zoomSpeed=.001,this.rotationSpeed=.005;var r=this,n=new a.Vector3,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2},o=i.NONE,s=this.center,l=new a.Matrix3,u=new a.Vector2,c=new a.Vector2,f=new a.Spherical,h={type:"change"};function d(e){!1!==r.enabled&&(0===e.button?o=i.ROTATE:1===e.button?o=i.ZOOM:2===e.button&&(o=i.PAN),c.set(e.clientX,e.clientY),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",m,!1),t.addEventListener("mouseout",m,!1),t.addEventListener("dblclick",m,!1))}function p(e){if(!1!==r.enabled){u.set(e.clientX,e.clientY);var t=u.x-c.x,n=u.y-c.y;o===i.ROTATE?r.rotate(new a.Vector3(-t*r.rotationSpeed,-n*r.rotationSpeed,0)):o===i.ZOOM?r.zoom(new a.Vector3(0,0,n)):o===i.PAN&&r.pan(new a.Vector3(-t,n,0)),c.set(e.clientX,e.clientY)}}function m(e){t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),o=i.NONE}function v(e){e.preventDefault(),r.zoom(new a.Vector3(0,0,e.deltaY))}function g(e){e.preventDefault()}this.focus=function(t){var n,i=(new a.Box3).setFromObject(t);!1===i.isEmpty()?(s.copy(i.getCenter()),n=i.getBoundingSphere().radius):(s.setFromMatrixPosition(t.matrixWorld),n=.1);var o=new a.Vector3(0,0,1);o.applyQuaternion(e.quaternion),o.multiplyScalar(4*n),e.position.copy(s).add(o),r.dispatchEvent(h)},this.pan=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.panSpeed),t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),s.add(t),r.dispatchEvent(h)},this.zoom=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.zoomSpeed),t.length()>a||(t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),r.dispatchEvent(h))},this.rotate=function(t){n.copy(e.position).sub(s),f.setFromVector3(n),f.theta+=t.x,f.phi+=t.y,f.makeSafe(),n.setFromSpherical(f),e.position.copy(s).add(n),e.lookAt(s),r.dispatchEvent(h)},this.dispose=function(){t.removeEventListener("contextmenu",g,!1),t.removeEventListener("mousedown",d,!1),t.removeEventListener("wheel",v,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),t.removeEventListener("touchstart",x,!1),t.removeEventListener("touchmove",_,!1)},t.addEventListener("contextmenu",g,!1),t.addEventListener("mousedown",d,!1),t.addEventListener("wheel",v,!1);var y=[new a.Vector3,new a.Vector3,new a.Vector3],b=[new a.Vector3,new a.Vector3,new a.Vector3],w=null;function x(e){if(!1!==r.enabled){switch(e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0);break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0),w=y[0].distanceTo(y[1])}b[0].copy(y[0]),b[1].copy(y[1])}}function _(e){if(!1!==r.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0),r.rotate(y[0].sub(o(y[0],b)).multiplyScalar(-r.rotationSpeed));break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0);var t=y[0].distanceTo(y[1]);r.zoom(new a.Vector3(0,0,w-t)),w=t;var n=y[0].clone().sub(o(y[0],b)),i=y[1].clone().sub(o(y[1],b));n.x=-n.x,i.x=-i.x,r.pan(n.add(i).multiplyScalar(.5))}b[0].copy(y[0]),b[1].copy(y[1])}function o(e,t){var r=t[0];for(var a in t)r.distanceTo(e)>t[a].distanceTo(e)&&(r=t[a]);return r}}t.addEventListener("touchstart",x,!1),t.addEventListener("touchmove",_,!1)};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e){e.preventDefault()}this.object=e,this.target=new a.Vector3(0,0,0),this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.lookSpeed=.005,this.lookVertical=!0,this.autoForward=!1,this.activeLook=!0,this.heightSpeed=!1,this.heightCoef=1,this.heightMin=0,this.heightMax=1,this.constrainVertical=!1,this.verticalMin=0,this.verticalMax=Math.PI,this.autoSpeedFactor=0,this.mouseX=0,this.mouseY=0,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.moveForward=!1,this.moveBackward=!1,this.moveLeft=!1,this.moveRight=!1,this.mouseDragOn=!1,this.viewHalfX=0,this.viewHalfY=0,this.domElement!==document&&this.domElement.setAttribute("tabindex",-1),this.handleResize=function(){this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)},this.onMouseDown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0},this.onMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1},this.onMouseMove=function(e){this.domElement===document?(this.mouseX=e.pageX-this.viewHalfX,this.mouseY=e.pageY-this.viewHalfY):(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)},this.onKeyDown=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0}},this.onKeyUp=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}},this.update=function(e){if(!1!==this.enabled){if(this.heightSpeed){var t=a.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;var r=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(r+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(r),this.moveLeft&&this.object.translateX(-r),this.moveRight&&this.object.translateX(r),this.moveUp&&this.object.translateY(r),this.moveDown&&this.object.translateY(-r);var n=e*this.lookSpeed;this.activeLook||(n=0);var i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon+=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*i),this.lat=Math.max(-85,Math.min(85,this.lat)),this.phi=a.Math.degToRad(90-this.lat),this.theta=a.Math.degToRad(this.lon),this.constrainVertical&&(this.phi=a.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax));var o=this.target,s=this.object.position;o.x=s.x+100*Math.sin(this.phi)*Math.cos(this.theta),o.y=s.y+100*Math.cos(this.phi),o.z=s.z+100*Math.sin(this.phi)*Math.sin(this.theta),this.object.lookAt(o)}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",r,!1),this.domElement.removeEventListener("mousedown",i,!1),this.domElement.removeEventListener("mousemove",n,!1),this.domElement.removeEventListener("mouseup",o,!1),window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",l,!1)};var n=u(this,this.onMouseMove),i=u(this,this.onMouseDown),o=u(this,this.onMouseUp),s=u(this,this.onKeyDown),l=u(this,this.onKeyUp);function u(e,t){return function(){t.apply(e,arguments)}}this.domElement.addEventListener("contextmenu",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mouseup",o,!1),window.addEventListener("keydown",s,!1),window.addEventListener("keyup",l,!1),this.handleResize()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e,t){return function(){t.apply(e,arguments)}}function n(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this.tmpQuaternion=new a.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new a.Vector3(0,0,0),this.rotationVector=new a.Vector3(0,0,0),this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)},this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),r=t.size[0]/2,a=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-a)/a,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){var t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order)},this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",n,!1),this.domElement.removeEventListener("mousedown",o,!1),this.domElement.removeEventListener("mousemove",i,!1),this.domElement.removeEventListener("mouseup",s,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",u,!1)};var i=r(this,this.mousemove),o=r(this,this.mousedown),s=r(this,this.mouseup),l=r(this,this.keydown),u=r(this,this.keyup);this.domElement.addEventListener("contextmenu",n,!1),this.domElement.addEventListener("mousemove",i,!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mouseup",s,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",u,!1),this.updateMovementVector(),this.updateRotationVector()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),d=h.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&d===h.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),y.set(0,0,0)),g=1,!!(b||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},d=h.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,k=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),R=function(){var e=new a.Vector3;return function(t,r){!0===l.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var a=l.domElement===document?l.domElement.body:l.domElement;if(l.object.isPerspectiveCamera){var n=l.object.position;e.copy(n).sub(l.target);var i=e.length();i*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*i/a.clientHeight,l.object.matrix),R(2*r*i/a.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/a.clientWidth,l.object.matrix),R(r*(l.object.top-l.object.bottom)/l.object.zoom/a.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object.isPerspectiveCamera?g/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object.isPerspectiveCamera?g*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),d=h.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),d=h.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),d=h.PAN}d!==h.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),d){case h.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case h.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case h.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),d=h.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||d!==h.NONE&&d!==h.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(c),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),d=h.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);A.set(n,i)}}(e),d=h.TOUCH_DOLLY_PAN;break;default:d=h.NONE}d!==h.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(d!==h.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;if(d!==h.TOUCH_DOLLY_PAN)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.set(0,Math.pow(T.y/M.y,l.zoomSpeed)),N(P.y),M.copy(T)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);E.set(n,i),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E)}l.update()}(e);break;default:d=h.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),d=h.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.radius=0,this.rotateSpeed=1,this.zoomSpeed=1.2,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.keys=[65,83,68],this.target=new a.Vector3;var i=!0,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector3,c=new a.Vector3,f=new a.Vector2,h=new a.Vector2,d=0,p=0,m=new a.Vector2,v=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom;var g={type:"change"},y={type:"start"},b={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}this.radius=.5*Math.min(this.screen.width,this.screen.height),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var w,x,_,A,E,S,M=(w=new a.Vector2,function(e,t){return w.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),w}),T=function(){var e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(a,i){n.set((a-.5*r.screen.width-r.screen.left)/r.radius,(.5*r.screen.height+r.screen.top-i)/r.radius,0);var o=n.length();return r.noRoll?o1?n.normalize():n.z=Math.sqrt(1-o*o),l.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(n.y),e.add(t.copy(r.object.up).cross(l).setLength(n.x)),e.add(l.setLength(n.z)),e}}();function P(e){!1!==r.enabled&&(window.removeEventListener("keydown",P),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function F(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",P,!1))}function O(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(m.copy(M(e.pageX,e.pageY)),v.copy(m)):(f.copy(M(e.pageX,e.pageY)),h.copy(f)):(u.copy(T(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",L,!1),document.addEventListener("mouseup",C,!1),r.dispatchEvent(y))}function L(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||v.copy(M(e.pageX,e.pageY)):h.copy(M(e.pageX,e.pageY)):c.copy(T(e.pageX,e.pageY)))}function C(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",C),r.dispatchEvent(b))}function k(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),f.y+=.01*e.deltaY,r.dispatchEvent(y),r.dispatchEvent(b))}function R(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,u.copy(T(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;case 2:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=d=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(M(i,s)),v.copy(m);break;default:o=n.NONE}r.dispatchEvent(y)}}function I(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(i,s));break;default:o=n.NONE}}function N(e){if(!1!==r.enabled){switch(e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;case 2:d=p=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,a=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(t,a)),m.copy(v)}o=n.NONE,r.dispatchEvent(b)}}function D(e){e.preventDefault()}this.rotateCamera=(x=new a.Vector3,_=new a.Quaternion,function(){var e=Math.acos(u.dot(c)/u.length()/c.length());e&&(x.crossVectors(u,c).normalize(),e*=r.rotateSpeed,_.setFromAxisAngle(x,-e),l.applyQuaternion(_),r.object.up.applyQuaternion(_),c.applyQuaternion(_),r.staticMoving?u.copy(c):(_.setFromAxisAngle(x,e*(r.dynamicDampingFactor-1)),u.applyQuaternion(_)),i=!0)}),this.zoomCamera=function(){if(o===n.TOUCH_ZOOM_PAN){var e=p/d;d=p,r.object.zoom*=e,i=!0}else{e=1+(h.y-f.y)*r.zoomSpeed;Math.abs(e-1)>1e-6&&e>0&&(r.object.zoom/=e,r.staticMoving?f.copy(h):f.y+=(h.y-f.y)*this.dynamicDampingFactor,i=!0)}},this.panCamera=(A=new a.Vector2,E=new a.Vector3,S=new a.Vector3,function(){if(A.copy(v).sub(m),A.lengthSq()){var e=(r.object.right-r.object.left)/r.object.zoom,t=(r.object.top-r.object.bottom)/r.object.zoom;A.x*=e,A.y*=t,S.copy(l).cross(r.object.up).setLength(A.x),S.add(E.copy(r.object.up).setLength(A.y)),r.object.position.add(S),r.target.add(S),r.staticMoving?m.copy(v):m.add(A.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)),i=!0}}),this.update=function(){l.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||(r.zoomCamera(),i&&r.object.updateProjectionMatrix()),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,l),r.object.lookAt(r.target),i&&(r.dispatchEvent(g),i=!1)},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.left=r.left0,r.object.right=r.right0,r.object.top=r.top0,r.object.bottom=r.bottom0,r.object.lookAt(r.target),r.dispatchEvent(g),i=!1},this.dispose=function(){this.domElement.removeEventListener("contextmenu",D,!1),this.domElement.removeEventListener("mousedown",O,!1),this.domElement.removeEventListener("wheel",k,!1),this.domElement.removeEventListener("touchstart",R,!1),this.domElement.removeEventListener("touchend",N,!1),this.domElement.removeEventListener("touchmove",I,!1),document.removeEventListener("mousemove",L,!1),document.removeEventListener("mouseup",C,!1),window.removeEventListener("keydown",P,!1),window.removeEventListener("keyup",F,!1)},this.domElement.addEventListener("contextmenu",D,!1),this.domElement.addEventListener("mousedown",O,!1),this.domElement.addEventListener("wheel",k,!1),this.domElement.addEventListener("touchstart",R,!1),this.domElement.addEventListener("touchend",N,!1),this.domElement.addEventListener("touchmove",I,!1),window.addEventListener("keydown",P,!1),window.addEventListener("keyup",F,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;e.rotation.set(0,0,0);var r=new a.Object3D;r.add(e);var n=new a.Object3D;n.position.y=10,n.add(r);var i,o,s=Math.PI/2,l=function(e){if(!1!==t.enabled){var a=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;n.rotation.y-=.002*a,r.rotation.x-=.002*i,r.rotation.x=Math.max(-s,Math.min(s,r.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",l,!1)},document.addEventListener("mousemove",l,!1),this.enabled=!1,this.getObject=function(){return n},this.getDirection=(i=new a.Vector3(0,0,-1),o=new a.Euler(0,0,0,"YXZ"),function(e){return o.set(r.rotation.x,n.rotation.y,0),e.copy(i).applyEuler(o),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new a.Vector3;var i=new a.Vector3,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector2,c=new a.Vector2,f=new a.Vector3,h=0,d=new a.Vector2,p=new a.Vector2,m=0,v=0,g=new a.Vector2,y=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var b={type:"change"},w={type:"start"},x={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var _,A,E,S,M,T,P,F,O,L,C,k=(_=new a.Vector2,function(e,t){return _.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),_}),R=function(){var e=new a.Vector2;return function(t,a){return e.set((t-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-a))/r.screen.width),e}}();function I(e){!1!==r.enabled&&(window.removeEventListener("keydown",I),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function N(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",I,!1))}function D(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(g.copy(k(e.pageX,e.pageY)),y.copy(g)):(d.copy(k(e.pageX,e.pageY)),p.copy(d)):(c.copy(R(e.pageX,e.pageY)),u.copy(c)),document.addEventListener("mousemove",U,!1),document.addEventListener("mouseup",j,!1),r.dispatchEvent(w))}function U(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||y.copy(k(e.pageX,e.pageY)):p.copy(k(e.pageX,e.pageY)):(u.copy(c),c.copy(R(e.pageX,e.pageY))))}function j(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",j),r.dispatchEvent(x))}function B(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:d.y-=.025*e.deltaY;break;case 1:d.y-=.01*e.deltaY;break;default:d.y-=25e-5*e.deltaY}r.dispatchEvent(w),r.dispatchEvent(x)}}function V(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,c.copy(R(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;default:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=m=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;g.copy(k(i,s)),y.copy(g)}r.dispatchEvent(w)}}function z(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:u.copy(c),c.copy(R(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=Math.sqrt(t*t+a*a);var n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;y.copy(k(n,i))}}function G(e){if(!1!==r.enabled){switch(e.touches.length){case 0:o=n.NONE;break;case 1:o=n.TOUCH_ROTATE,c.copy(R(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c)}r.dispatchEvent(x)}}function H(e){!1!==r.enabled&&e.preventDefault()}this.rotateCamera=(E=new a.Vector3,S=new a.Quaternion,M=new a.Vector3,T=new a.Vector3,P=new a.Vector3,F=new a.Vector3,function(){F.set(c.x-u.x,c.y-u.y,0),(A=F.length())?(l.copy(r.object.position).sub(r.target),M.copy(l).normalize(),T.copy(r.object.up).normalize(),P.crossVectors(T,M).normalize(),T.setLength(c.y-u.y),P.setLength(c.x-u.x),F.copy(T.add(P)),E.crossVectors(F,l).normalize(),A*=r.rotateSpeed,S.setFromAxisAngle(E,A),l.applyQuaternion(S),r.object.up.applyQuaternion(S),f.copy(E),h=A):!r.staticMoving&&h&&(h*=Math.sqrt(1-r.dynamicDampingFactor),l.copy(r.object.position).sub(r.target),S.setFromAxisAngle(f,h),l.applyQuaternion(S),r.object.up.applyQuaternion(S)),u.copy(c)}),this.zoomCamera=function(){var e;o===n.TOUCH_ZOOM_PAN?(e=m/v,m=v,l.multiplyScalar(e)):(1!==(e=1+(p.y-d.y)*r.zoomSpeed)&&e>0&&l.multiplyScalar(e),r.staticMoving?d.copy(p):d.y+=(p.y-d.y)*this.dynamicDampingFactor)},this.panCamera=(O=new a.Vector2,L=new a.Vector3,C=new a.Vector3,function(){O.copy(y).sub(g),O.lengthSq()&&(O.multiplyScalar(l.length()*r.panSpeed),C.copy(l).cross(r.object.up).setLength(O.x),C.add(L.copy(r.object.up).setLength(O.y)),r.object.position.add(C),r.target.add(C),r.staticMoving?g.copy(y):g.add(O.subVectors(y,g).multiplyScalar(r.dynamicDampingFactor)))}),this.checkDistances=function(){r.noZoom&&r.noPan||(l.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,l.setLength(r.maxDistance)),d.copy(p)),l.lengthSq()1e-6&&(r.dispatchEvent(b),i.copy(r.object.position))},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(b),i.copy(r.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",H,!1),this.domElement.removeEventListener("mousedown",D,!1),this.domElement.removeEventListener("wheel",B,!1),this.domElement.removeEventListener("touchstart",V,!1),this.domElement.removeEventListener("touchend",G,!1),this.domElement.removeEventListener("touchmove",z,!1),document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",I,!1),window.removeEventListener("keyup",N,!1)},this.domElement.addEventListener("contextmenu",H,!1),this.domElement.addEventListener("mousedown",D,!1),this.domElement.addEventListener("wheel",B,!1),this.domElement.addEventListener("touchstart",V,!1),this.domElement.addEventListener("touchend",G,!1),this.domElement.addEventListener("touchmove",z,!1),window.addEventListener("keydown",I,!1),window.addEventListener("keyup",N,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){var e=function(e){a.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.side=a.FrontSide,this.transparent=!0,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(e.prototype=Object.create(a.MeshBasicMaterial.prototype)).constructor=e;var t=function(e){a.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.transparent=!0,this.linewidth=1,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(t.prototype=Object.create(a.LineBasicMaterial.prototype)).constructor=t;var r=new e({visible:!1,transparent:!1}),n=function(){this.init=function(){a.Object3D.call(this),this.handles=new a.Object3D,this.pickers=new a.Object3D,this.planes=new a.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new a.PlaneBufferGeometry(50,50,2,2),t=new a.MeshBasicMaterial({visible:!1,side:a.DoubleSide}),r={XY:new a.Mesh(e,t),YZ:new a.Mesh(e,t),XZ:new a.Mesh(e,t),XYZE:new a.Mesh(e,t)};for(var n in this.activePlane=r.XYZE,r.YZ.rotation.set(0,Math.PI/2,0),r.XZ.rotation.set(-Math.PI/2,0,0),r)r[n].name=n,this.planes.add(r[n]),this.planes[n]=r[n];var i=function(e,t){for(var r in e)for(n=e[r].length;n--;){var a=e[r][n][0],i=e[r][n][1],o=e[r][n][2];a.name=r,a.renderOrder=1/0,i&&a.position.set(i[0],i[1],i[2]),o&&a.rotation.set(o[0],o[1],o[2]),t.add(a)}};i(this.handleGizmos,this.handles),i(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof a.Mesh){e.updateMatrix();var t=e.geometry.clone();t.applyMatrix(e.matrix),e.geometry=t,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))},this.highlight=function(e){this.traverse((function(t){t.material&&t.material.highlight&&(t.name===e?t.material.highlight(!0):t.material.highlight(!1))}))}};(n.prototype=Object.create(a.Object3D.prototype)).constructor=n,n.prototype.update=function(e,t){var r=new a.Vector3(0,0,0),n=new a.Vector3(0,1,0),i=new a.Matrix4;this.traverse((function(a){-1!==a.name.search("E")?a.quaternion.setFromRotationMatrix(i.lookAt(t,r,n)):-1===a.name.search("X")&&-1===a.name.search("Y")&&-1===a.name.search("Z")||a.quaternion.setFromEuler(e)}))};var i=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.CylinderGeometry(0,.05,.2,12,1,!1));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),new e({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),r)]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()};(i.prototype=Object.create(n.prototype)).constructor=i;var o=function(){n.call(this);var e=function(e,t,r){var n=new a.BufferGeometry,i=[];r=r||1;for(var o=0;o<=64*r;++o)"x"===t&&i.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&i.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&i.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return n.addAttribute("position",new a.Float32BufferAttribute(i,3)),n};this.handleGizmos={X:[[new a.Line(new e(1,"x",.5),new t({color:16711680}))]],Y:[[new a.Line(new e(1,"y",.5),new t({color:65280}))]],Z:[[new a.Line(new e(1,"z",.5),new t({color:255}))]],E:[[new a.Line(new e(1.25,"z",1),new t({color:13421568}))]],XYZE:[[new a.Line(new e(1,"z",1),new t({color:7895160}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusBufferGeometry(1.25,.12,2,24),r)]],XYZE:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,2,24),r)]]},this.pickerGizmos.XYZE[0][0].visible=!1,this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){n.prototype.update.apply(this,arguments);var r=new a.Matrix4,i=new a.Euler(0,0,1),o=new a.Quaternion,s=new a.Vector3(1,0,0),l=new a.Vector3(0,1,0),u=new a.Vector3(0,0,1),c=new a.Quaternion,f=new a.Quaternion,h=new a.Quaternion,d=t.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),r.makeRotationFromQuaternion(o).getInverse(r),d.applyMatrix4(r),this.traverse((function(e){o.setFromEuler(i),"X"===e.name&&(c.setFromAxisAngle(s,Math.atan2(-d.y,d.z)),o.multiplyQuaternions(o,c),e.quaternion.copy(o)),"Y"===e.name&&(f.setFromAxisAngle(l,Math.atan2(d.x,d.z)),o.multiplyQuaternions(o,f),e.quaternion.copy(o)),"Z"===e.name&&(h.setFromAxisAngle(u,Math.atan2(d.y,d.x)),o.multiplyQuaternions(o,h),e.quaternion.copy(o))}))},this.init()};(o.prototype=Object.create(n.prototype)).constructor=o;var s=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.BoxGeometry(.125,.125,.125));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.125,.125,.125),new e({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.4,.4,.4),r)]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()};(s.prototype=Object.create(n.prototype)).constructor=s;var l=function(e,t){a.Object3D.call(this),t=void 0!==t?t:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var r=this,n="translate",l=!1,u={translate:new i,rotate:new o,scale:new s};for(var c in u){var f=u[c];f.visible=c===n,this.add(f)}var h={type:"change"},d={type:"mouseDown"},p={type:"mouseUp",mode:n},m={type:"objectChange"},v=new a.Raycaster,g=new a.Vector2,y=new a.Vector3,b=new a.Vector3,w=new a.Vector3,x=new a.Vector3,_=1,A=new a.Matrix4,E=new a.Vector3,S=new a.Matrix4,M=new a.Vector3,T=new a.Quaternion,P=new a.Vector3(1,0,0),F=new a.Vector3(0,1,0),O=new a.Vector3(0,0,1),L=new a.Quaternion,C=new a.Quaternion,k=new a.Quaternion,R=new a.Quaternion,I=new a.Quaternion,N=new a.Vector3,D=new a.Vector3,U=new a.Matrix4,j=new a.Matrix4,B=new a.Vector3,V=new a.Vector3,z=new a.Euler,G=new a.Matrix4,H=new a.Vector3,X=new a.Euler;function Y(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,u[n].pickers.children),a=null;t&&(a=t.object.name,e.preventDefault()),r.axis!==a&&(r.axis=a,r.update(),r.dispatchEvent(h))}}function W(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=e.changedTouches?e.changedTouches[0]:e;if(0===t.button||void 0===t.button){var a=Z(t,u[n].pickers.children);if(a){e.preventDefault(),e.stopPropagation(),r.axis=a.object.name,r.dispatchEvent(d),r.update(),E.copy(H).sub(V).normalize(),u[n].setActivePlane(r.axis,E);var i=Z(t,[u[n].activePlane]);i&&(N.copy(r.object.position),D.copy(r.object.scale),U.extractRotation(r.object.matrix),G.extractRotation(r.object.matrixWorld),j.extractRotation(r.object.parent.matrixWorld),B.setFromMatrixScale(S.getInverse(r.object.parent.matrixWorld)),b.copy(i.point))}}l=!0}}function q(e){if(void 0!==r.object&&null!==r.axis&&!1!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,[u[n].activePlane]);!1!==t&&(e.preventDefault(),e.stopPropagation(),y.copy(t.point),"translate"===n?(y.sub(b),y.multiply(B),"local"===r.space&&(y.applyMatrix4(S.getInverse(G)),-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(U),r.object.position.copy(N),r.object.position.add(y)),"world"!==r.space&&-1===r.axis.search("XYZ")||(-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(S.getInverse(j)),r.object.position.copy(N),r.object.position.add(y)),null!==r.translationSnap&&("local"===r.space&&r.object.position.applyMatrix4(S.getInverse(G)),-1!==r.axis.search("X")&&(r.object.position.x=Math.round(r.object.position.x/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Y")&&(r.object.position.y=Math.round(r.object.position.y/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Z")&&(r.object.position.z=Math.round(r.object.position.z/r.translationSnap)*r.translationSnap),"local"===r.space&&r.object.position.applyMatrix4(G))):"scale"===n?(y.sub(b),y.multiply(B),"local"===r.space&&("XYZ"===r.axis?(_=1+y.y/Math.max(D.x,D.y,D.z),r.object.scale.x=D.x*_,r.object.scale.y=D.y*_,r.object.scale.z=D.z*_):(y.applyMatrix4(S.getInverse(G)),"X"===r.axis&&(r.object.scale.x=D.x*(1+y.x/D.x)),"Y"===r.axis&&(r.object.scale.y=D.y*(1+y.y/D.y)),"Z"===r.axis&&(r.object.scale.z=D.z*(1+y.z/D.z))))):"rotate"===n&&(y.sub(V),y.multiply(B),M.copy(b).sub(V),M.multiply(B),"E"===r.axis?(y.applyMatrix4(S.getInverse(A)),M.applyMatrix4(S.getInverse(A)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),I.setFromAxisAngle(E,w.z-x.z),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,I),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"XYZE"===r.axis?(I.setFromEuler(y.clone().cross(M).normalize()),T.setFromRotationMatrix(S.getInverse(j)),C.setFromAxisAngle(I,-y.clone().angleTo(M)),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,C),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"local"===r.space?(y.applyMatrix4(S.getInverse(G)),M.applyMatrix4(S.getInverse(G)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),L.setFromRotationMatrix(U),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),k.setFromAxisAngle(F,w.y-x.y),R.setFromAxisAngle(O,w.z-x.z)),"X"===r.axis&&L.multiplyQuaternions(L,C),"Y"===r.axis&&L.multiplyQuaternions(L,k),"Z"===r.axis&&L.multiplyQuaternions(L,R),r.object.quaternion.copy(L)):"world"===r.space&&(w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),k.setFromAxisAngle(F,w.y-x.y),R.setFromAxisAngle(O,w.z-x.z)),L.setFromRotationMatrix(G),"X"===r.axis&&T.multiplyQuaternions(T,C),"Y"===r.axis&&T.multiplyQuaternions(T,k),"Z"===r.axis&&T.multiplyQuaternions(T,R),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T))),r.update(),r.dispatchEvent(h),r.dispatchEvent(m))}}function Q(e){e.preventDefault(),void 0!==e.button&&0!==e.button||(l&&null!==r.axis&&(p.mode=n,r.dispatchEvent(p)),l=!1,"TouchEvent"in window&&e instanceof TouchEvent?(r.axis=null,r.update(),r.dispatchEvent(h)):Y(e))}function Z(r,a){var n=t.getBoundingClientRect(),i=(r.clientX-n.left)/n.width,o=(r.clientY-n.top)/n.height;g.set(2*i-1,-2*o+1),v.setFromCamera(g,e);var s=v.intersectObjects(a,!0);return!!s[0]&&s[0]}t.addEventListener("mousedown",W,!1),t.addEventListener("touchstart",W,!1),t.addEventListener("mousemove",Y,!1),t.addEventListener("touchmove",Y,!1),t.addEventListener("mousemove",q,!1),t.addEventListener("touchmove",q,!1),t.addEventListener("mouseup",Q,!1),t.addEventListener("mouseout",Q,!1),t.addEventListener("touchend",Q,!1),t.addEventListener("touchcancel",Q,!1),t.addEventListener("touchleave",Q,!1),this.dispose=function(){t.removeEventListener("mousedown",W),t.removeEventListener("touchstart",W),t.removeEventListener("mousemove",Y),t.removeEventListener("touchmove",Y),t.removeEventListener("mousemove",q),t.removeEventListener("touchmove",q),t.removeEventListener("mouseup",Q),t.removeEventListener("mouseout",Q),t.removeEventListener("touchend",Q),t.removeEventListener("touchcancel",Q),t.removeEventListener("touchleave",Q)},this.attach=function(e){this.object=e,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return n},this.setMode=function(e){for(var t in"scale"===(n=e||n)&&(r.space="local"),u)u[t].visible=t===n;this.update(),r.dispatchEvent(h)},this.setTranslationSnap=function(e){r.translationSnap=e},this.setRotationSnap=function(e){r.rotationSnap=e},this.setSize=function(e){r.size=e,this.update(),r.dispatchEvent(h)},this.setSpace=function(e){r.space=e,this.update(),r.dispatchEvent(h)},this.update=function(){void 0!==r.object&&(r.object.updateMatrixWorld(),V.setFromMatrixPosition(r.object.matrixWorld),z.setFromRotationMatrix(S.extractRotation(r.object.matrixWorld)),e.updateMatrixWorld(),H.setFromMatrixPosition(e.matrixWorld),X.setFromRotationMatrix(S.extractRotation(e.matrixWorld)),_=V.distanceTo(H)/6*r.size,this.position.copy(V),this.scale.set(_,_,_),e instanceof a.PerspectiveCamera?E.copy(H).sub(V).normalize():e instanceof a.OrthographicCamera&&E.copy(H).normalize(),"local"===r.space?u[n].update(z,E):"world"===r.space&&u[n].update(new a.Euler,E),u[n].highlight(r.axis))}};return(l.prototype=Object.create(a.Object3D.prototype)).constructor=l,l}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){var r,n,i=this,o=new a.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")})).catch((function(){console.warn("THREE.VRControls: Unable to get VR Displays")})),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return o},this.update=function(){var t;r&&(r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(i.scale))},this.dispose=function(){r=null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedGeometryExporter=t.STLExporter=t.STLBinaryExporter=t.PLYExporter=t.OBJExporter=t.MMDExporter=t.GLTFExporter=void 0;var a=c(r(41)),n=c(r(42)),i=c(r(43)),o=c(r(44)),s=c(r(45)),l=c(r(46)),u=c(r(47));function c(e){return e&&e.__esModule?e:{default:e}}t.GLTFExporter=a.default,t.MMDExporter=n.default,t.OBJExporter=i.default,t.PLYExporter=o.default,t.STLBinaryExporter=s.default,t.STLExporter=l.default,t.TypedGeometryExporter=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987},i={1003:n.NEAREST,1004:n.NEAREST_MIPMAP_NEAREST,1005:n.NEAREST_MIPMAP_LINEAR,1006:n.LINEAR,1007:n.LINEAR_MIPMAP_NEAREST,1008:n.LINEAR_MIPMAP_LINEAR},o={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},s=function(){};s.prototype={constructor:s,parse:function(e,t,r){(r=Object.assign({},{trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,animations:[],forceIndices:!1,forcePowerOfTwoTextures:!1},r)).animations.length>0&&(r.trs=!0);var s,l={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},u=0,c=[],f=[],h=new Map,d=[],p={},m={attributes:new Map,materials:new Map,textures:new Map};function v(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}function g(e){return 4*Math.ceil(e/4)}function y(e,t){t=t||0;var r=g(e.byteLength);if(r!==e.byteLength){var a=new Uint8Array(r);if(a.set(new Uint8Array(e)),0!==t)for(var n=e.byteLength;n0)&&(t.alphaMode=e.opacity<1?"BLEND":"MASK",e.alphaTest>0&&.5!==e.alphaTest&&(t.alphaCutoff=e.alphaTest)),e.side===a.DoubleSide&&(t.doubleSided=!0),""!==e.name&&(t.name=e.name),l.materials.push(t);var i=l.materials.length-1;return m.materials.set(e,i),i}function S(e){var t,i=e.geometry;if(e.isLineSegments)t=n.LINES;else if(e.isLineLoop)t=n.LINE_LOOP;else if(e.isLine)t=n.LINE_STRIP;else if(e.isPoints)t=n.POINTS;else{if(!i.isBufferGeometry){var o=new a.BufferGeometry;o.fromGeometry(i),i=o}e.drawMode===a.TriangleFanDrawMode?(console.warn("GLTFExporter: TriangleFanDrawMode and wireframe incompatible."),t=n.TRIANGLE_FAN):t=e.drawMode===a.TriangleStripDrawMode?e.material.wireframe?n.LINE_STRIP:n.TRIANGLE_STRIP:e.material.wireframe?n.LINES:n.TRIANGLES}var s={},u={},c=[],f=[],h={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},d=i.getAttribute("normal");for(var p in void 0===d||function(e){if(m.attributes.has(e))return!1;for(var t=new a.Vector3,r=0,n=e.count;r5e-4)return!1;return!0}(d)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.addAttribute("normal",function(e){if(m.attributes.has(e))return m.textures.get(e);for(var t=e.clone(),r=new a.Vector3,n=0,i=t.count;n0){var b=[],x=[],_={};if(void 0!==e.morphTargetDictionary)for(var A in e.morphTargetDictionary)_[e.morphTargetDictionary[A]]=A;for(var S=0;S0&&(s.extras={},s.extras.targetNames=x)}var C=r.forceIndices,k=Array.isArray(e.material);if(k&&0===e.geometry.groups.length)return null;!C&&null===i.index&&k&&(console.warn("THREE.GLTFExporter: Creating index for non-indexed multi-material mesh."),C=!0);var R=!1;if(null===i.index&&C){for(var I=[],N=(S=0,i.attributes.position.count);S0&&(j.targets=f),null!==i.index&&(j.indices=w(i.index,i,U[S].start,U[S].count));var B=E(D[U[S].materialIndex]);null!==B&&(j.material=B),c.push(j)}return R&&i.setIndex(null),s.primitives=c,l.meshes||(l.meshes=[]),l.meshes.push(s),l.meshes.length-1}function M(e,t){l.animations||(l.animations=[]);for(var r=[],n=[],i=0;i0)try{t.extras=JSON.parse(JSON.stringify(e.userData))}catch(e){throw new Error("THREE.GLTFExporter: userData can't be serialized")}if(e.isMesh||e.isLine||e.isPoints){var s=S(e);null!==s&&(t.mesh=s)}else e.isCamera&&(t.camera=function(e){l.cameras||(l.cameras=[]);var t=e.isOrthographicCamera,r={type:t?"orthographic":"perspective"};return t?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:a.Math.degToRad(e.fov)/e.aspect,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),l.cameras.push(r),l.cameras.length-1}(e));if(e.isSkinnedMesh&&d.push(e),e.children.length>0){for(var u=[],c=0,f=e.children.length;c0&&(t.children=u)}l.nodes.push(t);var g=l.nodes.length-1;return h.set(e,g),g}function F(e){l.scenes||(l.scenes=[],l.scene=0);var t={nodes:[]};""!==e.name&&(t.name=e.name),l.scenes.push(t);for(var a=[],n=0,i=e.children.length;n0&&(t.nodes=a)}!function(e){e=e instanceof Array?e:[e];for(var t=[],n=0;n0&&function(e){var t=new a.Scene;t.name="AuxScene";for(var r=0;r0&&(l.extensionsUsed=a),l.buffers&&l.buffers.length>0){l.buffers[0].byteLength=e.size;var n=new window.FileReader;if(!0===r.binary){n.readAsArrayBuffer(e),n.onloadend=function(){var e=y(n.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,e.byteLength,!0),r.setUint32(4,5130562,!0);var a=y(function(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0,a=e.length;r255?32:n}return t.buffer}(JSON.stringify(l)),32),i=new DataView(new ArrayBuffer(8));i.setUint32(0,a.byteLength,!0),i.setUint32(4,1313821514,!0);var o=new ArrayBuffer(12),s=new DataView(o);s.setUint32(0,1179937895,!0),s.setUint32(4,2,!0);var u=12+i.byteLength+a.byteLength+r.byteLength+e.byteLength;s.setUint32(8,u,!0);var c=new Blob([o,i,a,r,e],{type:"application/octet-stream"}),f=new window.FileReader;f.readAsArrayBuffer(c),f.onloadend=function(){t(f.result)}}}else n.readAsDataURL(e),n.onloadend=function(){var e=n.result;l.buffers[0].uri=e,t(l)}}else t(l)}))}},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(0)),n=i(r(4));function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.default=function(){var e;this.parseVpd=function(t,r,i){if(!0!==t.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);var t=e.toString();-1===t.indexOf(".")&&(t+=".");var r=(t+="000000").indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function s(e){for(var t=[],r=0,a=e.length;r255?(u.push(l>>8&255),u.push(255&l)):u.push(255&l)}return new Uint8Array(u)}(x):x}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(){};n.prototype={constructor:n,parse:function(e){var t,r,n,i,o,s="",l=0,u=0,c=0,f=new a.Vector3,h=new a.Vector3,d=new a.Vector2,p=[];return e.traverse((function(e){e instanceof a.Mesh&&function(e){var n=0,m=0,v=0,g=e.geometry,y=new a.Matrix3;if(g instanceof a.Geometry&&(g=(new a.BufferGeometry).setFromObject(e)),g instanceof a.BufferGeometry){var b=g.getAttribute("position"),w=g.getAttribute("normal"),x=g.getAttribute("uv"),_=g.getIndex();if(s+="o "+e.name+"\n",e.material&&e.material.name&&(s+="usemtl "+e.material.name+"\n"),void 0!==b)for(t=0,i=b.count;t=200)return void n("THREE.AssimpJSONLoader: Unsupported assimp2json file format version.")}t(i.parse(r,o))}),r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=new Array(e.length),a=0;a0&&i.addAttribute("normal",new a.Float32BufferAttribute(l,3)),u.length>0&&i.addAttribute("uv",new a.Float32BufferAttribute(u,2)),c.length>0&&i.addAttribute("color",new a.Float32BufferAttribute(c,3)),i.computeBoundingSphere(),i})),o=r(e.materials,(function(e){var t=new a.MeshPhongMaterial;for(var r in e.properties){var i=e.properties[r],o=i.key,s=i.value;switch(o){case"$tex.file":var l=i.semantic;if(1===l||2===l||5===l||6===l){var u;switch(l){case 1:u="map";break;case 2:u="specularMap";break;case 5:u="bumpMap";break;case 6:u="normalMap"}var c=n.load(s);c.wrapS=c.wrapT=a.RepeatWrapping,t[u]=c}break;case"?mat.name":t.name=s;break;case"$clr.diffuse":t.color.fromArray(s);break;case"$clr.specular":t.specular.fromArray(s);break;case"$clr.emissive":t.emissive.fromArray(s);break;case"$mat.shininess":t.shininess=s;break;case"$mat.shadingm":t.flatShading=1===s;break;case"$mat.opacity":s<1&&(t.opacity=s,t.transparent=!0)}}return t}));return function e(t,r,n,i){var o,s,l=new a.Object3D;for(l.name=r.name||"",l.matrix=(new a.Matrix4).fromArray(r.transformation).transpose(),l.matrix.decompose(l.position,l.quaternion,l.scale),o=0;r.meshes&&o0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(var e=0;e=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;for(var r=e.hierarchy[0].keys,a=0;ae){t=this.keys[a],r=this.keys[a+1];break}if(this.keys[a].time4&&(r.length=4);var n=0;for(a=0;a<4;a++)n+=r[a].w*r[a].w;n=Math.sqrt(n);for(a=0;a<4;a++)r[a].w=r[a].w/n,e[a]=r[a].i,t[a]=r[a].w}function R(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(var r in e.children){var a=R(e.children[r],t);if(a)return a}}function I(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e,t){if(0!=this.mBones.length){for(var r=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var o=C(u=i.toTHREE(e),e);this.threeNode.add(o);for(var s=0;s0&&n.addAttribute("normal",new a.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&n.addAttribute("color",new a.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&n.addAttribute("uv",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&n.addAttribute("uv1",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&n.addAttribute("tangents",new a.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&n.addAttribute("bitangents",new a.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){for(var i=[],o=[],s=0;s0&&(r=new a.SkinnedMesh(n,t)),this.threeNode=r,r}}function N(){this.mNumIndices=0,this.mIndices=[]}function D(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new a.Vector3(this.x,this.y,this.z)}}function U(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new a.Color(this.r,this.g,this.b,1)}}function j(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new a.Quaternion(this.x,this.y,this.z,this.w)}}function B(){this.mVertexId=0,this.mWeight=0}function V(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}function z(){this.mTime=0,this.mValue=null}function G(){this.mTime=0,this.mValue=null}function H(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new a.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(var r=0;r0)var r=this.mAnimations[0].toTHREE(this);return{object:e,animation:r}}}function ie(){this.elements=[[],[],[],[]],this.toTHREE=function(){for(var e=new a.Matrix4,t=0;t<4;++t)for(var r=0;r<4;++r)e.elements[4*t+r]=this.elements[r][t];return e}}var oe=!0;function se(e){var t=e.getFloat32(e.readOffset,oe);return e.readOffset+=4,t}function le(e){var t=e.getFloat64(e.readOffset,oe);return e.readOffset+=8,t}function ue(e){var t=e.getUint16(e.readOffset,oe);return e.readOffset+=2,t}function ce(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function fe(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function he(e){var t=new D;return t.x=se(e),t.y=se(e),t.z=se(e),t}function de(e){var t=new U;return t.r=se(e),t.g=se(e),t.b=se(e),t}function pe(e){var t=new V,r=ce(e);return e.ReadBytes(t.data,1,r),t.toString()}function me(e){var t=new B;return t.mVertexId=ce(e),t.mWeight=se(e),t}function ve(e){for(var t=new ie,r=0;r<4;++r)for(var a=0;a<4;++a)t.elements[r][a]=se(e);return t}function ge(e){var t=new z;return t.mTime=le(e),t.mValue=he(e),t}function ye(e){var t=new G;return t.mTime=le(e),t.mValue=function(e){var t=new j;return t.w=se(e),t.x=se(e),t.y=se(e),t.z=se(e),t}(e),t}function be(e,t,r){for(var a=0;a0,ke=ue(r)>0,Ce)throw"Shortened binaries are not supported!";if(r.Seek(256,Re),r.Seek(128,Re),r.Seek(64,Re),!ke)return Le(r,t),t.toTHREE();var a=fe(r),n=r.FileSize()-r.Tell(),i=[];r.Read(i,1,n);var o=[];uncompress(o,a,i,n),Le(new ArrayBuffer(o),t)}(e)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){function e(){this.id=0,this.data=null}function t(){}t.prototype={set:function(e,t){this[e]=t},get:function(e,t){return this.hasOwnProperty(e)?this[e]:t}};var r=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.trunk=new a.Object3D,this.materialFactory=void 0,this._url="",this._baseDir="",this._data=void 0,this._ptr=0,this._version=[],this._streaming=!1,this._optimized_for_accuracy=!1,this._compression=0,this._bodylen=4294967295,this._blocks=[new e],this._accuracyMatrix=!1,this._accuracyGeo=!1,this._accuracyProps=!1};return r.prototype={constructor:r,load:function(e,t,r,n){var i=this;this._url=e,this._baseDir=e.substr(0,e.lastIndexOf("/")+1);var o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){var t=e.byteLength;for(this._ptr=0,this._data=new DataView(e),this._parseHeader(),0!=this._compression&&console.error("compressed AWD not supported"),this._streaming||this._bodylen==e.byteLength-this._ptr||console.error("AWDLoader: body len does not match file length",this._bodylen,t-this._ptr);this._ptr1)for(r=new a.Object3D,p=0;p191&&a<224){var n=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((31&a)<<6|63&n)}else{n=this._data.getUint8(this._ptr++,!0);var i=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((15&a)<<12|(63&n)<<6|63&i)}}return t.join("")}},r}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),r,n)},parse:function(e){function t(e){var t=new a.BufferGeometry,r=e.indices,n=e.positions,i=e.normals,o=e.uvs;t.setIndex(r);for(var s=2,l=n.length;s0&&t.push(new a.VectorKeyframeTrack(n+".position",i,o)),s.length>0&&t.push(new a.QuaternionKeyframeTrack(n+".quaternion",i,s)),l.length>0&&t.push(new a.VectorKeyframeTrack(n+".scale",i,l)),t}function A(e,t,r){var a,n,i,o=!0;for(n=0,i=e.length;n=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function S(e,t,r){for(;t0&&t0&&d.addAttribute("position",new a.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&d.addAttribute("normal",new a.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&d.addAttribute("color",new a.Float32BufferAttribute(l.array,l.stride)),s.array.length>0&&d.addAttribute("uv",new a.Float32BufferAttribute(s.array,s.stride)),u.length>0&&d.addAttribute("skinIndex",new a.Float32BufferAttribute(u,c)),f.length>0&&d.addAttribute("skinWeight",new a.Float32BufferAttribute(f,h)),n.data=d,n.type=e[0].type,n.materialKeys=p,n}function fe(e,t,r,a){var n=e.p,i=e.stride,o=e.vcount;function s(e){for(var t=n[e+r]*u,i=t+u;t4)for(var g=1,y=d-2;g<=y;g++){p=c+i*g,m=c+i*(g+1);s(c+0*i),s(p),s(m)}c+=i*d}else for(f=0,h=n.length;f=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ge(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;rn.limits.max||t>8&255,h>>16&255,h>>24&255))),r;p=!0,o=64,r.format=a.RGBAFormat}r.mipmapCount=1,131072&f[2]&&!1!==t&&(r.mipmapCount=Math.max(1,f[7]));var m=f[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=f[4],r.height=f[3];for(var v=f[1]+4,g=r.isCubemap?6:1,y=0;y>1,1),w=Math.max(w>>1,1)}return r},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="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},n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var i=function(e){this.timeLoaded=0,this.manager=e||n.DefaultLoadingManager,this.materials=null,this.verbosity=0,this.attributeOptions={},this.drawMode=n.TrianglesDrawMode,this.nativeAttributeMap={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"}};i.prototype={constructor:i,load:function(e,t,r,a){var i=this,o=new n.FileLoader(i.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.load(e,(function(e){i.decodeDracoFile(e,t)}),r,a)},setPath:function(e){this.path=e},setCrossOrigin:function(e){this.crossOrigin=e},setVerbosity:function(e){this.verbosity=e},setDrawMode:function(e){this.drawMode=e},setSkipDequantization:function(e,t){var r=!0;void 0!==t&&(r=t),this.getAttributeOptions(e).skipDequantization=r},decodeDracoFile:function(e,t,r){var a=this;i.getDecoderModule().then((function(n){a.decodeDracoFileInternal(e,n.decoder,t,r||{})}))},decodeDracoFileInternal:function(e,t,r,a){var n=new t.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength);var i=new t.Decoder,o=i.GetEncodedGeometryType(n);if(o==t.TRIANGULAR_MESH)this.verbosity>0&&console.log("Loaded a mesh.");else{if(o!=t.POINT_CLOUD){var s="THREE.DRACOLoader: Unknown geometry type.";throw console.error(s),new Error(s)}this.verbosity>0&&console.log("Loaded a point cloud.")}r(this.convertDracoGeometryTo3JS(t,i,o,n,a))},addAttributeToGeometry:function(e,t,r,a,i,o,s){if(0===i.ptr){var l="THREE.DRACOLoader: No attribute "+a;throw console.error(l),new Error(l)}var u=i.num_components(),c=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,c);var f=r.num_points()*u;s[a]=new Float32Array(f);for(var h=0;h0&&console.log("Number of faces loaded: "+c.toString())):c=0;var h=o.num_points(),d=o.num_attributes();this.verbosity>0&&(console.log("Number of points loaded: "+h.toString()),console.log("Number of attributes loaded: "+d.toString()));var p=t.GetAttributeId(o,e.POSITION);if(-1==p){u="THREE.DRACOLoader: No position attribute found.";throw console.error(u),e.destroy(t),e.destroy(o),new Error(u)}var m=t.GetAttribute(o,p),v={},g=new n.BufferGeometry;for(var y in this.nativeAttributeMap)if(void 0===i[y]){var b=t.GetAttributeId(o,e[this.nativeAttributeMap[y]]);if(-1!==b){this.verbosity>0&&console.log("Loaded "+y+" attribute.");var w=t.GetAttribute(o,b);this.addAttributeToGeometry(e,t,o,y,w,g,v)}}for(var y in i){var x=i[y];w=t.GetAttributeByUniqueId(o,x);this.addAttributeToGeometry(e,t,o,y,w,g,v)}if(r==e.TRIANGULAR_MESH)if(this.drawMode===n.TriangleStripDrawMode){var _=new e.DracoInt32Array;t.GetTriangleStripsFromMesh(o,_);v.indices=new Uint32Array(_.size());for(var A=0;A<_.size();++A)v.indices[A]=_.GetValue(A);e.destroy(_)}else{var E=3*c;v.indices=new Uint32Array(E);var S=new e.DracoInt32Array;for(A=0;A65535?n.Uint32BufferAttribute:n.Uint16BufferAttribute)(v.indices,1));var T=new e.AttributeQuantizationTransform;if(T.InitFromAttribute(m)){g.attributes.position.isQuantized=!0,g.attributes.position.maxRange=T.range(),g.attributes.position.numQuantizationBits=T.quantization_bits(),g.attributes.position.minValues=new Float32Array(3);for(A=0;A<3;++A)g.attributes.position.minValues[A]=T.min_value(A)}return e.destroy(T),e.destroy(t),e.destroy(o),this.decode_time=f-l,this.import_time=performance.now()-f,this.verbosity>0&&(console.log("Decode time: "+this.decode_time),console.log("Import time: "+this.import_time)),g},isVersionSupported:function(e,t){i.getDecoderModule().then((function(r){t(r.decoder.isVersionSupported(e))}))},getAttributeOptions:function(e){return void 0===this.attributeOptions[e]&&(this.attributeOptions[e]={}),this.attributeOptions[e]}},i.decoderPath="./",i.decoderConfig={},i.decoderModulePromise=null,i.setDecoderPath=function(e){i.decoderPath=e},i.setDecoderConfig=function(e){var t=i.decoderConfig.wasmBinary;i.decoderConfig=e||{},i.releaseDecoderModule(),t&&(i.decoderConfig.wasmBinary=t)},i.releaseDecoderModule=function(){i.decoderModulePromise=null},i.getDecoderModule=function(){var e=this,t=i.decoderPath,r=i.decoderConfig,n=i.decoderModulePromise;return n||("undefined"!=typeof DracoDecoderModule?n=Promise.resolve():"object"!==("undefined"==typeof WebAssembly?"undefined":a(WebAssembly))||"js"===r.type?n=i._loadScript(t+"draco_decoder.js"):(r.wasmBinaryFile=t+"draco_decoder.wasm",n=i._loadScript(t+"draco_wasm_wrapper.js").then((function(){return i._loadArrayBuffer(r.wasmBinaryFile)})).then((function(e){r.wasmBinary=e}))),n=n.then((function(){return new Promise((function(t){r.onModuleLoaded=function(r){e.timeLoaded=performance.now(),t({decoder:r})},DracoDecoderModule(r)}))})),i.decoderModulePromise=n,n)},i._loadScript=function(e){var t=document.getElementById("decoder_script");null!==t&&t.parentNode.removeChild(t);var r=document.getElementsByTagName("head")[0],a=document.createElement("script");return a.id="decoder_script",a.type="text/javascript",a.src=e,new Promise((function(e){a.onload=e,r.appendChild(a)}))},i._loadArrayBuffer=function(e){var t=new n.FileLoader;return t.setResponseType("arraybuffer"),new Promise((function(r,a){t.load(e,r,void 0,a)}))},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.sourceTexture=e,this.resolution=t,this.views=[{t:[1,0,0],u:[0,-1,0]},{t:[-1,0,0],u:[0,-1,0]},{t:[0,1,0],u:[0,0,1]},{t:[0,-1,0],u:[0,0,-1]},{t:[0,0,1],u:[0,-1,0]},{t:[0,0,-1],u:[0,-1,0]}],this.camera=new a.PerspectiveCamera(90,1,.1,10),this.boxMesh=new a.Mesh(new a.BoxBufferGeometry(1,1,1),this.getShader()),this.boxMesh.material.side=a.BackSide,this.scene=new a.Scene,this.scene.add(this.boxMesh);var r={format:a.RGBAFormat,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.renderTarget=new a.WebGLRenderTargetCube(this.resolution,this.resolution,r)};n.prototype={constructor:n,update:function(e){for(var t=0;t<6;t++){this.renderTarget.activeCubeFace=t;var r=this.views[t];this.camera.position.set(0,0,0),this.camera.up.set(r.u[0],r.u[1],r.u[2]),this.camera.lookAt(r.t[0],r.t[1],r.t[2]),e.render(this.scene,this.camera,this.renderTarget,!0)}return this.renderTarget.texture},getShader:function(){var e=new a.ShaderMaterial({uniforms:{equirectangularMap:{value:this.sourceTexture}},vertexShader:"varying vec3 localPosition;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tlocalPosition = position;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \n\t\t\t\tvarying vec3 localPosition;\n\t\t\t\tuniform sampler2D equirectangularMap;\n\t\t\t\t\n\t\t\t\tvec2 EquiangularSampleUV(vec3 v) {\n\t\t\t vec2 uv = vec2(atan(v.z, v.x), asin(v.y));\n\t\t\t uv *= vec2(0.1591, 0.3183); // inverse atan\n\t\t\t uv += 0.5;\n\t\t\t return uv;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = EquiangularSampleUV(normalize(localPosition));\n \t\t\tvec3 color = texture2D(equirectangularMap, uv).rgb;\n \t\t\t\n\t\t\t\t\tgl_FragColor = vec4( color, 1.0 );\n\t\t\t\t}",blending:a.CustomBlending,premultipliedAlpha:!1,blendSrc:a.OneFactor,blendDst:a.ZeroFactor,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.ZeroFactor,blendEquation:a.AddEquation});return e.type="EquiangularToCubeGenerator",e},dispose:function(){this.boxMesh.geometry.dispose(),this.boxMesh.material.dispose(),this.renderTarget.dispose()}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};(n.prototype=Object.create(a.DataTextureLoader.prototype))._parser=function(e){var t=65536,r=t>>3,n=14,i=65537,o=1<>r&(1<a)return!1;g(6,h,d,e,f);var p=v.l;if(h=v.c,d=v.lc,s[n]=p,p==u){if(f.value-r.value>a)throw"Something wrong with hufUnpackEncTable";g(8,h,d,e,f);var m=v.l+c;if(h=v.c,d=v.lc,n+m>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}else if(p>=l){if(n+(m=p-l+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}}!function(e){for(var t=0;t<=58;++t)y[t]=0;for(t=0;t0;--t){var a=r+y[t]>>1;y[t]=r,r=a}for(t=0;t0&&(e[t]=n|y[n]++<<6)}}(s)}function w(e){return 63&e}function x(e){return e>>6}var _={c:0,lc:0};function A(e,t,r,a){e=e<<8|I(r,a),t+=8,_.c=e,_.lc=t}var E={c:0,lc:0};function S(e,t,r,a,n,i,o,s,l,u){if(e==t){a<8&&(A(r,a,n,o),r=_.c,a=_.lc);var c=r>>(a-=8);if(out+c>oe)throw"Issue with getCode";for(var f=out[-1];c-- >0;)s[l.value++]=f}else{if(!(l.value32767?t-65536:t}var T={a:0,b:0};function P(e,t){var r=M(e),a=M(t),n=r+(1&a)+(a>>1),i=n,o=n-a;T.a=i,T.b=o}function F(e,t,r,a,n,i,o){for(var s,l=r>n?n:r,u=1;u<=l;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var c,f,h,d,p=0,m=p+i*(n-s),v=i*u,g=i*s,y=a*u,b=a*s;p<=m;p+=g){for(var w=p,x=p+a*(r-s);w<=x;w+=b){var _=w+y,A=(E=w+v)+y;P(t[w+e],t[E+e]),c=T.a,h=T.b,P(t[_+e],t[A+e]),f=T.a,d=T.b,P(c,f),t[w+e]=T.a,t[_+e]=T.b,P(h,d),t[E+e]=T.a,t[A+e]=T.b}if(r&u){var E=w+v;P(t[w+e],t[E+e]),c=T.a,t[E+e]=T.b,t[w+e]=c}}if(n&u)for(w=p,x=p+a*(r-s);w<=x;w+=b){_=w+y;P(t[w+e],t[_+e]),c=T.a,t[_+e]=T.b,t[w+e]=c}s=u,u>>=1}return p}function O(e,t,r,a,l,u,c){var f=r.value,h=R(t,r),d=R(t,r);r.value+=4;var p=R(t,r);if(r.value+=4,h<0||h>=i||d<0||d>=i)throw"Something wrong with HUF_ENCSIZE";var m=new Array(i),v=new Array(o);if(function(e){for(var t=0;t8*(a-(r.value-f)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var i=x(e[t]),o=w(e[t]);if(i>>o)throw"Invalid table entry";if(o>n){if((c=a[i>>o-n]).len)throw"Invalid table entry";if(c.lit++,c.p){var s=c.p;c.p=new Array(c.lit);for(var l=0;l0;l--){var c;if((c=a[(i<=n;){if((b=t[h>>d-n&s]).len)d-=b.len,S(b.lit,l,h,d,r,0,i,c,f,p),h=E.c,d=E.lc;else{if(!b.p)throw"hufDecode issues";var v;for(v=0;v=g&&x(e[b.p[v]])==(h>>d-g&(1<>=y,d-=y;d>0;){var b;if(!(b=t[h<=r)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(d<=p)for(var m=0;m>3]&1<<(7&n))&&(r[a++]=n);for(var i=a-1;a>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function j(e,t){var r=e.getUint16(t.value,!0);return t.value+=p,r}function B(e,t){return U(j(e,t))}function V(e,t,r,a,n){if("string"===a||"iccProfile"===a)return function(e,t,r){var a=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,a}(t,r,n);if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value0&&void 0!==r[l[0].ID]&&(0!==(i=r[l[0].ID]).indexOf("blob:")&&0!==i.indexOf("data:")||t.setPath(void 0));o="tga"===e.FileName.slice(-3).toLowerCase()?n.Loader.Handlers.get(".tga").load(i):t.load(i);return t.setPath(s),o}(e,t,r,a);i.ID=e.id,i.name=e.attrName;var o=e.WrapModeU,s=e.WrapModeV,l=void 0!==o?o.value:0,u=void 0!==s?s.value:0;if(i.wrapS=0===l?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===u?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){var c=e.Scaling.value;i.repeat.x=c[0],i.repeat.y=c[1]}return i}function i(e,t,r,i){var s=t.id,l=t.attrName,u=t.ShadingModel;if("object"===(void 0===u?"undefined":a(u))&&(u=u.value),!i.has(s))return null;var c,f=function(e,t,r,a,i){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value);t.Diffuse?s.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new n.Color).fromArray(t.DiffuseColor.value));t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value);t.Emissive?s.emissive=(new n.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new n.Color).fromArray(t.EmissiveColor.value));t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value));t.Opacity&&(s.opacity=parseFloat(t.Opacity.value));s.opacity<1&&(s.transparent=!0);t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value);t.Shininess&&(s.shininess=t.Shininess.value);t.Specular?s.specular=(new n.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new n.Color).fromArray(t.SpecularColor.value));return i.get(a).children.forEach((function(t){var a=t.relationship;switch(a){case"Bump":s.bumpMap=r.get(t.ID);break;case"DiffuseColor":s.map=o(e,r,t.ID,i);break;case"DisplacementColor":s.displacementMap=o(e,r,t.ID,i);break;case"EmissiveColor":s.emissiveMap=o(e,r,t.ID,i);break;case"NormalMap":s.normalMap=o(e,r,t.ID,i);break;case"ReflectionColor":s.envMap=o(e,r,t.ID,i),s.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":s.specularMap=o(e,r,t.ID,i);break;case"TransparentColor":s.alphaMap=o(e,r,t.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a)}})),s}(e,t,r,s,i);switch(u.toLowerCase()){case"phong":c=new n.MeshPhongMaterial;break;case"lambert":c=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',u),c=new n.MeshPhongMaterial({color:3342591})}return c.setValues(f),c.name=l,c}function o(e,t,r,a){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=a.get(r).children[0].ID),t.get(r)}function s(e,t){var r=[];return e.children.forEach((function(e){var a=t[e.ID];if("Cluster"===a.attrType){var i={ID:e.ID,indices:[],weights:[],transform:(new n.Matrix4).fromArray(a.Transform.a),transformLink:(new n.Matrix4).fromArray(a.TransformLink.a),linkMode:a.Mode};"Indexes"in a&&(i.indices=a.Indexes.a,i.weights=a.Weights.a),r.push(i)}})),{rawBones:r,bones:[]}}function l(e,t,r,a){for(var n=[],i=0;i0&&o.addAttribute("color",new n.Float32BufferAttribute(l.colors,3));r&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(l.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(l.vertexWeights,4)),o.FBX_Deformer=r);if(l.normal.length>0){var h=new n.Float32BufferAttribute(l.normal,3);(new n.Matrix3).getNormalMatrix(i).applyToBufferAttribute(h),o.addAttribute("normal",h)}if(l.uvs.forEach((function(e,t){var r="uv"+(t+1).toString();0===t&&(r="uv"),o.addAttribute(r,new n.Float32BufferAttribute(l.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){var d=l.materialIndex[0],p=0;if(l.materialIndex.forEach((function(e,t){e!==d&&(o.addGroup(p,t-p,d),d=e,p=t)})),o.groups.length>0){var m=o.groups[o.groups.length-1],v=m.start+m.count;v!==l.materialIndex.length&&o.addGroup(v,l.materialIndex.length-v,d)}0===o.groups.length&&o.addGroup(0,l.materialIndex.length,l.materialIndex[0])}return function(e,t,r,a,i){if(null===a)return;t.morphAttributes.position=[],t.morphAttributes.normal=[],a.rawTargets.forEach((function(a){var o=e.Objects.Geometry[a.geoID];void 0!==o&&function(e,t,r,a){var i=new n.BufferGeometry;r.attrName&&(i.name=r.attrName);for(var o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],s=void 0!==t.Vertices?t.Vertices.a.slice():[],l=void 0!==r.Vertices?r.Vertices.a:[],u=void 0!==r.Indexes?r.Indexes.a:[],f=0;f4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);var y=[0,0,0,0],b=[0,0,0,0];v.forEach((function(e,t){var r=e,a=m[t];b.forEach((function(e,t,n){if(r>e){n[t]=r,r=e;var i=y[t];y[t]=a,a=i}}))})),m=y,v=b}for(;v.length<4;)v.push(0),m.push(0);for(var w=0;w<4;++w)u.push(v[w]),c.push(m[w])}if(e.normal){g=d(h,r,f,e.normal);o.push(g[0],g[1],g[2])}if(e.material&&"AllSame"!==e.material.mappingType)var x=d(h,r,f,e.material)[0];e.uv&&e.uv.forEach((function(e,t){var a=d(h,r,f,e);void 0===l[t]&&(l[t]=[]),l[t].push(a[0]),l[t].push(a[1])})),a++,p&&(!function(e,t,r,a,n,i,o,s,l,u){for(var c=2;c=f.length&&f===C(c,0,f.length))o=(new M).parse(e);else{var h=C(e);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;for(var a=0;a0,u="string"==typeof o.Content&&""!==o.Content;if(l||u){var c=t(n[i]);a[o.RelativeFilename||o.Filename]=c}}}}for(var s in r){var f=r[s];void 0!==a[f]?r[s]=a[f]:r[s]=r[s].split("\\").pop()}return r}(o),_=function(e,t,r){var a=new Map;if("Material"in e.Objects){var n=e.Objects.Material;for(var o in n){var s=i(e,n[o],t,r);null!==s&&a.set(parseInt(o),s)}}return a}(o,function(e,t,a,n){var i=new Map;if("Texture"in e.Objects){var o=e.Objects.Texture;for(var s in o){var l=r(o[s],t,a,n);i.set(parseInt(s),l)}}return i}(o,new n.TextureLoader(this.manager).setPath(a),x,d),d),A=function(e,t){var r={},a={};if("Deformer"in e.Objects){var n=e.Objects.Deformer;for(var i in n){var o=n[i],u=t.get(parseInt(i));if("Skin"===o.attrType){var c=s(u,n);c.ID=i,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),c.geometryID=u.parents[0].ID,r[i]=c}else if("BlendShape"===o.attrType){var f={id:i};f.rawTargets=l(u,o,n,t),f.id=i,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),f.parentGeoID=u.parents[0].ID,a[i]=f}}}return{skeletons:r,morphTargets:a}}(o,d),E=function(e,t,r){var a=new Map;if("Geometry"in e.Objects){var n=e.Objects.Geometry;for(var i in n){var o=t.get(parseInt(i)),s=u(e,o,n[i],r);a.set(parseInt(i),s)}}return a}(o,d,A);return function(e,t,r,a,i){var o=new n.Group,s=function(e,t,r,a,i){var o=new Map,s=e.Objects.Model;for(var l in s){var u=parseInt(l),c=s[l],f=i.get(u),h=p(f,t,u,c.attrName);if(!h){switch(c.attrType){case"Camera":h=m(e,f);break;case"Light":h=v(e,f);break;case"Mesh":h=g(e,f,r,a);break;case"NurbsCurve":h=y(f,r);break;case"LimbNode":case"Null":default:h=new n.Group}h.name=n.PropertyBinding.sanitizeNodeName(c.attrName),h.ID=u}b(e,h,c),o.set(u,h)}return o}(e,r,a,i,t),l=e.Objects.Model;return s.forEach((function(r){var a=l[r.ID];!function(e,t,r,a,i){if("LookAtProperty"in r){a.get(t.ID).children.forEach((function(r){if("LookAtProperty"===r.relationship){var a=e.Objects.Model[r.ID];if("Lcl_Translation"in a){var o=a.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(o),i.add(t.target)):t.lookAt((new n.Vector3).fromArray(o))}}}))}}(e,r,a,t,o),t.get(r.ID).parents.forEach((function(e){var t=s.get(e.ID);void 0!==t&&t.add(r)})),null===r.parent&&o.add(r)})),function(e,t,r,a,i){var o=function(e){var t={};if("Pose"in e.Objects){var r=e.Objects.Pose;for(var a in r)if("BindPose"===r[a].attrType){var i=r[a].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new n.Matrix4).fromArray(e.Matrix.a)})):t[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return t}(e);for(var s in t){var l=t[s];i.get(parseInt(l.ID)).parents.forEach((function(e){if(r.has(e.ID)){var t=e.ID;i.get(t).parents.forEach((function(e){a.has(e.ID)&&a.get(e.ID).bind(new n.Skeleton(l.bones),o[e.ID])}))}}))}}(e,r,a,s,t),function(e,t,r){r.animations=[];var a=function(e,t){if(void 0===e.Objects.AnimationCurve)return;var r=function(e){var t=e.Objects.AnimationCurveNode,r=new Map;for(var a in t){var n=t[a];if(null!==n.attrName.match(/S|R|T/)){var i={id:n.id,attr:n.attrName,curves:{}};r.set(i.id,i)}}return r}(e);!function(e,t,r){var a=e.Objects.AnimationCurve;for(var n in a){var i={id:a[n].id,times:a[n].KeyTime.a.map(O),values:a[n].KeyValueFloat.a},o=t.get(i.id);if(void 0!==o){var s=o.parents[0].ID,l=o.parents[0].relationship;l.match(/X/)?r.get(s).curves.x=i:l.match(/Y/)?r.get(s).curves.y=i:l.match(/Z/)&&(r.get(s).curves.z=i)}}}(e,t,r);var a=function(e,t,r){var a=e.Objects.AnimationLayer,i=new Map;for(var o in a){var s=[],l=t.get(parseInt(o));if(void 0!==l)l.children.forEach((function(a,i){if(r.has(a.ID)){var o=r.get(a.ID);if(void 0!==o.curves.x||void 0!==o.curves.y||void 0!==o.curves.z){if(void 0===s[i]){var l;t.get(a.ID).parents.forEach((function(e){void 0!==e.relationship&&(l=e.ID)}));var u=e.Objects.Model[l.toString()],c={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};"Lcl_Translation"in u&&(c.initialPosition=u.Lcl_Translation.value),"Lcl_Rotation"in u&&(c.initialRotation=u.Lcl_Rotation.value),"Lcl_Scaling"in u&&(c.initialScale=u.Lcl_Scaling.value),"PreRotation"in u&&(c.preRotations=u.PreRotation.value),s[i]=c}s[i][o.attr]=o}}})),i.set(parseInt(o),s)}return i}(e,t,r);return function(e,t,r){var a=e.Objects.AnimationStack,n={};for(var i in a){var o=t.get(parseInt(i)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=r.get(o[0].ID);n[i]={name:a[i].attrName,layer:s}}return n}(e,t,a)}(e,t);if(void 0===a)return;for(var i in a){var o=w(a[i]);r.animations.push(o)}}(e,t,o),function(e,t){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var r=e.GlobalSettings.AmbientColor.value,a=r[0],i=r[1],o=r[2];if(0!==a||0!==i||0!==o){var s=new n.Color(a,i,o);t.add(new n.AmbientLight(s,1))}}}(e,o),o}(o,d,A.skeletons,E,_)}});var h=[];function d(e,t,r,a){var n;switch(a.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=r;break;case"AllSame":n=a.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+a.mappingType)}"IndexToDirect"===a.referenceType&&(n=a.indices[n]);var i=n*a.dataSize,o=i+a.dataSize;return function(e,t,r,a){for(var n=r,i=0;n1?s=l:l.length>0?s=l[0]:(s=new n.MeshPhongMaterial({color:13421772}),l.push(s)),"color"in o.attributes&&l.forEach((function(e){e.vertexColors=n.VertexColors})),o.FBX_Deformer?(l.forEach((function(e){e.skinning=!0})),i=new n.SkinnedMesh(o,s)):i=new n.Mesh(o,s),i}function y(e,t){var r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),a=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,a)}function b(e,t,r){if("RotationOrder"in r){var a=parseInt(r.RotationOrder.value,10);a>0&&a<6?console.warn("THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.",["XYZ","XZY","YZX","ZXY","YXZ","ZYX","SphericXYZ"][a]):6===a&&console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.")}if("Lcl_Translation"in r&&t.position.fromArray(r.Lcl_Translation.value),"Lcl_Rotation"in r){var i=r.Lcl_Rotation.value.map(n.Math.degToRad);i.push("ZYX"),t.quaternion.setFromEuler((new n.Euler).fromArray(i))}if("Lcl_Scaling"in r&&t.scale.fromArray(r.Lcl_Scaling.value),"PreRotation"in r){var o=r.PreRotation.value.map(n.Math.degToRad);o[3]="ZYX";var s=(new n.Euler).fromArray(o);s=(new n.Quaternion).setFromEuler(s),t.quaternion.premultiply(s)}}function w(e){var t=[];return e.layer.forEach((function(e){t=t.concat(function(e){var t=[];if(void 0!==e.T&&Object.keys(e.T.curves).length>0){var r=x(e.modelName,e.T.curves,e.initialPosition,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=function(e,t,r,a){void 0!==t.x&&(E(t.x),t.x.values=t.x.values.map(n.Math.degToRad));void 0!==t.y&&(E(t.y),t.y.values=t.y.values.map(n.Math.degToRad));void 0!==t.z&&(E(t.z),t.z.values=t.z.values.map(n.Math.degToRad));var i=A(t),o=_(i,t,r);void 0!==a&&((a=a.map(n.Math.degToRad)).push("ZYX"),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a));for(var s=new n.Quaternion,l=new n.Euler,u=[],c=0;c0){var i=x(e.modelName,e.S.curves,e.initialScale,"scale");void 0!==i&&t.push(i)}return t}(e))})),new n.AnimationClip(e.name,-1,t)}function x(e,t,r,a){var i=A(t),o=_(i,t,r);return new n.VectorKeyframeTrack(e+"."+a,i,o)}function _(e,t,r){var a=r,n=[],i=-1,o=-1,s=-1;return e.forEach((function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(s=t.z.times.indexOf(e)),-1!==i){var r=t.x.values[i];n.push(r),a[0]=r}else n.push(a[0]);if(-1!==o){var l=t.y.values[o];n.push(l),a[1]=l}else n.push(a[1]);if(-1!==s){var u=t.z.values[s];n.push(u),a[2]=u}else n.push(a[2])})),n}function A(e){var t=[];return void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})).filter((function(e,t,r){return r.indexOf(e)==t}))}function E(e){for(var t=1;t=180){for(var i=n/180,o=a/i,s=r+o,l=e.times[t-1],u=(e.times[t]-l)/i,c=l+u,f=[],h=[];c1&&(r=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:r,type:a}},parseNodeProperty:function(e,t,r){var a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===a&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());var i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===a){var o=n.split(",").slice(1),s=parseInt(o[0]),l=parseInt(o[1]),u=n.split(",").slice(3);a="connections",function(e,t){for(var r=0,a=e.length,n=t.length;r=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var r={},a=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32(),i=(t>=7500?e.getUint64():e.getUint32(),e.getUint8()),o=e.getString(i);if(0===a)return null;for(var s=[],l=0;l0?s[0]:"",c=s.length>1?s[1]:"",f=s.length>2?s[2]:"";for(r.singleProperty=1===n&&e.getOffset()===a;a>e.getOffset();){var h=this.parseNode(e,t);null!==h&&this.parseSubNode(o,r,h)}return r.propertyList=s,"number"==typeof u&&(r.id=u),""!==c&&(r.attrName=c),""!==f&&(r.attrType=f),""!==o&&(r.name=o),r},parseSubNode:function(e,t,r){if(!0===r.singleProperty){var a=r.propertyList[0];Array.isArray(a)?(t[r.name]=r,r.a=a):t[r.name]=a}else if("Connections"===e&&"C"===r.name){var n=[];r.propertyList.forEach((function(e,t){0!==t&&n.push(e)})),void 0===t.connections&&(t.connections=[]),t.connections.push(n)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){var i,o=r.propertyList[0],s=r.propertyList[1],l=r.propertyList[2],u=r.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),i="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[o]={type:s,type2:l,flag:u,value:i}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var r=e.getUint32();return e.getArrayBuffer(r);case"S":r=e.getUint32();return e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var a=e.getUint32(),n=e.getUint32(),i=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}void 0===window.Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var o=new T(new Zlib.Inflate(new Uint8Array(e.getArrayBuffer(i))).decompress().buffer);switch(t){case"b":case"c":return o.getBooleanArray(a);case"d":return o.getFloat64Array(a);case"f":return o.getFloat32Array(a);case"i":return o.getInt32Array(a);case"l":return o.getInt64Array(a)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}),Object.assign(T.prototype,{getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],r=0;r=0&&(t=t.slice(0,a)),n.LoaderUtils.decodeText(t)}}),Object.assign(P.prototype,{add:function(e,t){this[e]=t}}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.splitLayer=!1};n.prototype.load=function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},n.prototype.parse=function(e){var t={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},r=[],n=void 0,i=new a.LineBasicMaterial({color:16711680});i.name="path";var o=new a.LineBasicMaterial({color:65280});function s(e){n={vertex:[],pathVertex:[],z:e.z},r.push(n)}function l(e,r){return t.relative?r:r-e}function u(e,r){return t.relative?e+r:r}o.name="extruded";for(var c,f,h=e.replace(/;.+/g,"").split("\n"),d=0;d0&&(g.extruding=l(t.e,g.e)>0,null!=n&&g.z==n.z||s(g)),c=t,f=g,void 0===n&&s(c),g.extruding?(n.vertex.push(c.x,c.y,c.z),n.vertex.push(f.x,f.y,f.z)):(n.pathVertex.push(c.x,c.y,c.z),n.pathVertex.push(f.x,f.y,f.z)),t=g}else if("G2"===m||"G3"===m)console.warn("THREE.GCodeLoader: Arc command not supported");else if("G90"===m)t.relative=!1;else if("G91"===m)t.relative=!0;else if("G92"===m){(g=t).x=void 0!==v.x?v.x:g.x,g.y=void 0!==v.y?v.y:g.y,g.z=void 0!==v.z?v.z:g.z,g.e=void 0!==v.e?v.e:g.e,t=g}else console.warn("THREE.GCodeLoader: Command not supported:"+m)}function y(e,t){var r=new a.BufferGeometry;r.addAttribute("position",new a.Float32BufferAttribute(e,3));var n=new a.LineSegments(r,t?o:i);n.name="layer"+d,b.add(n)}var b=new a.Group;if(b.name="gcode",this.splitLayer)for(d=0;d>16&32768,i=a>>12&2047,o=a>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&a):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)}return function(e,t,a,n){var i=e[t+3],o=Math.pow(2,i-128)/255;a[n+0]=r(e[t+0]*o),a[n+1]=r(e[t+1]*o),a[n+2]=r(e[t+2]*o)}}(),l=new n.CubeTexture;l.type=e,l.encoding=e===n.UnsignedByteType?n.RGBEEncoding:n.LinearEncoding,l.format=e===n.UnsignedByteType?n.RGBAFormat:n.RGBFormat,l.minFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.magFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.generateMipmaps=l.encoding!==n.RGBEEncoding,l.anisotropy=0;var u=this.hdrLoader,c=0;function f(r,a,i,f){var h=new n.FileLoader(this.manager);h.setResponseType("arraybuffer"),h.load(t[r],(function(t){c++;var i=u._parser(t);if(i){if(e===n.FloatType){for(var f=i.data.length/4*3,h=new Float32Array(f),d=0;d>8&65280|e>>24&255},e.prototype.mipmaps=function(t){for(var r=[],a=e.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight,o=t?this.numberOfMipmapLevels:1,s=0;s0?o():t(n.mergeVmds(i))}),r,a)}()},s.prototype.loadAudio=function(e,t,r,n){var i=new a.AudioListener,o=new a.Audio(i);new a.AudioLoader(this.manager).load(e,(function(e){o.setBuffer(e),t(o,i)}),r,n)},s.prototype.loadVpd=function(e,t,r,a,n){var i=this;(n&&"unicode"===n.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this)(e,(function(e){t(i.parseVpd(e))}),r,a)},s.prototype.parseModel=function(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}},s.prototype.parsePmd=function(e){return this.parser.parsePmd(e,!0)},s.prototype.parsePmx=function(e){return this.parser.parsePmx(e,!0)},s.prototype.parseVmd=function(e){return this.parser.parseVmd(e,!0)},s.prototype.parseVpd=function(e){return this.parser.parseVpd(e,!0)},s.prototype.mergeVmds=function(e){return this.parser.mergeVmds(e)},s.prototype.pourVmdIntoModel=function(e,t,r){this.createAnimation(e,t,r)},s.prototype.pourVmdIntoCamera=function(e,t,r){var n=new s.DataCreationHelper;!function(){for(var i,o,l=n.createOrderedMotionArray(t.cameras),u=[],c=[],f=[],h=[],d=[],p=[],m=[],v=[],g=[],y=new a.Quaternion,b=new a.Euler,w=new a.Vector3,x=new a.Vector3,_=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},A=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},E=function(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();for(var o=n.length/r.length,l=3===o?12:4,u=1,c=2,f=r.length;cu){r[u]=r[c];for(h=0;h=a?r.skinIndices[a]:0);for(a=0;a<4;a++)l.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t=0&&(l.limitation=new a.Vector3(1,0,0)),s.links.push(l)}t.push(s)}else for(r=0;r=0?c:u);var p=d.load(s,(function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,n=t.height;f.width=r,f.height=n,h.clearRect(0,0,r,n),h.translate(r/2,n/2),h.rotate(.5*Math.PI),h.translate(-r/2,-n/2),h.drawImage(t,0,0),e.image=h.getImageData(0,0,r,n)}e.flipY=!1,e.wrapS=a.RepeatWrapping,e.wrapT=a.RepeatWrapping;for(var i=0;i=0?(x.push(w.slice(0,_)),x.push(w.slice(_+1))):x.push(w);for(var A=0;A=0||E.indexOf(".spa")>=0?(b.envMap=m(E,{sphericalReflectionMapping:!0}),E.indexOf(".sph")>=0?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation):b.map=m(E)}}}else{if(-1!==y.textureIndex){var E=e.textures[y.textureIndex];b.map=m(E)}if(-1!==y.envTextureIndex&&(1===y.envFlag||2==y.envFlag)){E=e.textures[y.envTextureIndex];b.envMap=m(E,{sphericalReflectionMapping:!0}),1===y.envFlag?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation}}var S=void 0===b.map?1:.2;b.emissive=new a.Color(y.ambient[0]*S,y.ambient[1]*S,y.ambient[2]*S),p.push(b)}for(g=0;g0,y.morphTargets=o.morphTargets.length>0,y.lights=!0,y.side="pmx"===e.metadata.format&&1==(1&T.flag)?a.DoubleSide:M.side,y.transparent=M.transparent,y.fog=!0,y.blending=a.CustomBlending,y.blendSrc=a.SrcAlphaFactor,y.blendDst=a.OneMinusSrcAlphaFactor,y.blendSrcAlpha=a.SrcAlphaFactor,y.blendDstAlpha=a.DstAlphaFactor,void 0!==M.map){y.faceOffset=M.faceOffset,y.faceNum=M.faceNum,y.map=v(M.map,l),function(e){e.map.readyCallbacks.push((function(t){function r(e,t){var r=e.width,a=e.height,n=Math.round(t.x*r)%r,i=Math.round(t.y*a)%a;n<0&&(n+=r),i<0&&(i+=a);var o=i*r+n;return e.data[4*o+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),n=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var n=e.width,i=e.height;if(e.data.length/(n*i)!=4)return!1;for(var o=0;o=this.duration;)this.currentTime-=this.duration;return!(this.currentTime=this.duration}},a.MMDGrantSolver=function(e){this.mesh=e},a.MMDGrantSolver.prototype={constructor:a.MMDGrantSolver,update:(o=new a.Quaternion,function(){for(var e=0;e0)}},setAnimations:function(){for(var e=0;e0&&0!==e.action._clip.tracks[0].name.indexOf(".bones")||(e.target._root.looped=!0)}));for(var t=!1,r=!1,n=0;n0&&0===i.tracks[0].name.indexOf(".morphTargetInfluences")?r||(o.play(),r=!0):t||(o.play(),t=!0)}t&&(e.ikSolver=new a.CCDIKSolver(e),void 0!==e.geometry.grants&&(e.grantSolver=new a.MMDGrantSolver(e)))}},setCameraAnimation:function(e){void 0!==e.animations&&(e.mixer=new a.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())},unifyAnimationDuration:function(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,n=0;n0,i=!0,s={};var l=function(e,n){null==n&&(n=1);var o=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,o=2;break;case"sshort":s=Int16Array,o=2;break;case"uint":s=Uint32Array,o=4;break;case"sint":s=Int32Array,o=4;break;case"float":s=Float32Array,o=4;break;case"complex":case"double":s=Float64Array,o=8}var l=new s(t.slice(r,r+=n*o));return a!=i&&(l=function(e,t){for(var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=0;ai;n--,i++){var o=r[i];r[i]=r[n],r[n]=o}return e}(l,o)),1==n?l[0]:l}("uchar",e.byteLength),u=l.length,c=null,f=0;for(p=1;p13)&&32!==a?n+=String.fromCharCode(a):(""!==n&&(l[u]=c(n,o),u++),n="");return""!==n&&(l[u]=c(n,o),u++),l}(t);else if("raw"===s.encoding){for(var d=new Uint8Array(t.length),p=0;p0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,n=this.object.geometry.vertices;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){var a=this.normals,n=this.object.geometry.normals;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addColor:function(e,t,r){var a=this.colors,n=this.object.geometry.colors;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addUV:function(e,t,r){var a=this.uvs,n=this.object.geometry.uvs;n.push(a[e+0],a[e+1]),n.push(a[t+0],a[t+1]),n.push(a[r+0],a[r+1])},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,a,n,i,o,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),f=this.parseVertexIndex(t,u),h=this.parseVertexIndex(r,u);if(this.addVertex(c,f,h),void 0!==a&&""!==a){var d=this.uvs.length;c=this.parseUVIndex(a,d),f=this.parseUVIndex(n,d),h=this.parseUVIndex(i,d),this.addUV(c,f,h)}if(void 0!==o&&""!==o){var p=this.normals.length;c=this.parseNormalIndex(o,p),f=o===s?c:this.parseNormalIndex(s,p),h=o===l?c:this.parseNormalIndex(l,p),this.addNormal(c,f,h)}this.colors.length>0&&this.addColor(c,f,h)},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,r=0,a=e.length;r0){var w=b.split("/");v.push(w)}}var x=v[0];for(g=1,y=v.length-1;g1){var C=c[1].trim().toLowerCase();o.object.smooth="0"!==C&&"off"!==C}else o.object.smooth=!0;(Y=o.object.currentMaterial())&&(Y.smooth=o.object.smooth)}o.finalize();var k=new a.Group;k.materialLibraries=[].concat(o.materialLibraries);for(h=0,d=o.objects.length;h0?B.addAttribute("normal",new a.Float32BufferAttribute(I.normals,3)):B.computeVertexNormals(),I.colors.length>0&&(j=!0,B.addAttribute("color",new a.Float32BufferAttribute(I.colors,3))),I.uvs.length>0&&B.addAttribute("uv",new a.Float32BufferAttribute(I.uvs,2));for(var V,z=[],G=0,H=N.length;G1){for(G=0,H=N.length;Gf){f=h;var r='Download of "'+e.url+'": '+(100*h).toFixed(2)+"%";u.onProgress("progressLoad",r,h)}}}var d=new a.FileLoader(this.manager);d.setPath(this.path),d.setResponseType("arraybuffer"),d.load(e.url,c,i,o)}},r.prototype.run=function(e,r){this._applyPrepData(e);var a=e.checkResourceDescriptorFiles(e.resources,[{ext:"obj",type:"ArrayBuffer",ignore:!1},{ext:"mtl",type:"String",ignore:!1},{ext:"zip",type:"String",ignore:!0}]);t.isValid(r)&&(this.terminateWorkerOnLoad=!1,this.workerSupport=r,this.logging.enabled=this.workerSupport.logging.enabled,this.logging.debug=this.workerSupport.logging.debug);var n=this;this._loadMtl(a.mtl,(function(t){null!==t&&n.meshBuilder.setMaterials(t),n._loadObj(a.obj,n.callbacks.onLoad,null,null,n.callbacks.onMeshAlter,e.useAsync)}),e.crossOrigin,e.materialOptions)},r.prototype._applyPrepData=function(e){t.isValid(e)&&(this.setLogging(e.logging.enabled,e.logging.debug),this.setModelName(e.modelName),this.setStreamMeshesTo(e.streamMeshesTo),this.meshBuilder.setMaterials(e.materials),this.setUseIndices(e.useIndices),this.setDisregardNormals(e.disregardNormals),this.setMaterialPerSmoothingGroup(e.materialPerSmoothingGroup),this._setCallbacks(e.getCallbacks()))},r.prototype.parse=function(e){if(!t.isValid(e))return console.warn("Provided content is not a valid ArrayBuffer or String."),this.loaderRootNode;this.logging.enabled&&console.time("OBJLoader2 parse: "+this.modelName),this.meshBuilder.init();var r=new o;r.setLogging(this.logging.enabled,this.logging.debug),r.setMaterialPerSmoothingGroup(this.materialPerSmoothingGroup),r.setUseIndices(this.useIndices),r.setDisregardNormals(this.disregardNormals),r.setMaterials(this.meshBuilder.getMaterials());var a=this;r.setCallbackMeshBuilder((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}));if(r.setCallbackProgress((function(e,t){a.onProgress("progressParse",e,t)})),e instanceof ArrayBuffer||e instanceof Uint8Array)this.logging.enabled&&console.info("Parsing arrayBuffer..."),r.parse(e);else{if(!("string"==typeof e||e instanceof String))throw"Provided content was neither of type String nor Uint8Array! Aborting...";this.logging.enabled&&console.info("Parsing text..."),r.parseText(e)}return this.logging.enabled&&console.timeEnd("OBJLoader2 parse: "+this.modelName),this.loaderRootNode},r.prototype.parseAsync=function(e,r){var a=this,n=!1,i=function(){r({detail:{loaderRootNode:a.loaderRootNode,modelName:a.modelName,instanceNo:a.instanceNo}}),n&&a.logging.enabled&&console.timeEnd("OBJLoader2 parseAsync: "+a.modelName)};t.isValid(e)?n=!0:(console.warn("Provided content is not a valid ArrayBuffer."),i()),n&&this.logging.enabled&&console.time("OBJLoader2 parseAsync: "+this.modelName),this.meshBuilder.init();this.workerSupport.validate((function(e,r){var a="";return a+="/**\n",a+=" * This code was constructed by OBJLoader2 buildCode.\n",a+=" */\n\n",a+="THREE = { LoaderSupport: {} };\n\n",a+=e("LoaderSupport.Validator",t),a+=r("Parser",o)}),"Parser"),this.workerSupport.setCallbacks((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}),i),a.terminateWorkerOnLoad&&this.workerSupport.setTerminateRequested(!0);var s={},l=this.meshBuilder.getMaterials();for(var u in l)s[u]=u;this.workerSupport.run({params:{useAsync:!0,materialPerSmoothingGroup:this.materialPerSmoothingGroup,useIndices:this.useIndices,disregardNormals:this.disregardNormals},logging:{enabled:this.logging.enabled,debug:this.logging.debug},materials:{materials:s},data:{input:e,options:null}})};var o=function(){function e(){this.callbackProgress=null,this.callbackMeshBuilder=null,this.contentRef=null,this.legacyMode=!1,this.materials={},this.useAsync=!1,this.materialPerSmoothingGroup=!1,this.useIndices=!1,this.disregardNormals=!1,this.vertices=[],this.colors=[],this.normals=[],this.uvs=[],this.rawMesh={objectName:"",groupName:"",activeMtlName:"",mtllibName:"",faceType:-1,subGroups:[],subGroupInUse:null,smoothingGroup:{splitMaterials:!1,normalized:-1,real:-1},counts:{doubleIndicesCount:0,faceCount:0,mtlCount:0,smoothingGroupCount:0}},this.inputObjectCount=1,this.outputObjectCount=1,this.globalCounts={vertices:0,faces:0,doubleIndicesCount:0,lineByte:0,currentByte:0,totalBytes:0},this.logging={enabled:!0,debug:!1}}return e.prototype.resetRawMesh=function(){this.rawMesh.subGroups=[],this.rawMesh.subGroupInUse=null,this.rawMesh.smoothingGroup.normalized=-1,this.rawMesh.smoothingGroup.real=-1,this.pushSmoothingGroup(1),this.rawMesh.counts.doubleIndicesCount=0,this.rawMesh.counts.faceCount=0,this.rawMesh.counts.mtlCount=0,this.rawMesh.counts.smoothingGroupCount=0},e.prototype.setUseAsync=function(e){this.useAsync=e},e.prototype.setMaterialPerSmoothingGroup=function(e){this.materialPerSmoothingGroup=e},e.prototype.setUseIndices=function(e){this.useIndices=e},e.prototype.setDisregardNormals=function(e){this.disregardNormals=e},e.prototype.setMaterials=function(e){this.materials=n.default.Validator.verifyInput(e,this.materials),this.materials=n.default.Validator.verifyInput(this.materials,{})},e.prototype.setCallbackMeshBuilder=function(e){if(!n.default.Validator.isValid(e))throw'Unable to run as no "MeshBuilder" callback is set.';this.callbackMeshBuilder=e},e.prototype.setCallbackProgress=function(e){this.callbackProgress=e},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.configure=function(){if(this.pushSmoothingGroup(1),this.logging.enabled){var e=Object.keys(this.materials),t="OBJLoader2.Parser configuration:"+(e.length>0?"\n\tmaterialNames:\n\t\t- "+e.join("\n\t\t- "):"\n\tmaterialNames: None")+"\n\tuseAsync: "+this.useAsync+"\n\tmaterialPerSmoothingGroup: "+this.materialPerSmoothingGroup+"\n\tuseIndices: "+this.useIndices+"\n\tdisregardNormals: "+this.disregardNormals+"\n\tcallbackMeshBuilderName: "+this.callbackMeshBuilder.name+"\n\tcallbackProgressName: "+this.callbackProgress.name;console.info(t)}},e.prototype.parse=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parse"),this.configure();var t=new Uint8Array(e);this.contentRef=t;var r=t.byteLength;this.globalCounts.totalBytes=r;for(var a,n=new Array(128),i="",o=0,s=0,l=0;l0&&(n[o++]=i),i="";break;case 47:i.length>0&&(n[o++]=i),s++,i="";break;case 10:i.length>0&&(n[o++]=i),i="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=l,this.processLine(n,o,s),o=0,s=0;break;case 13:break;default:i+=String.fromCharCode(a)}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parse")},e.prototype.parseText=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parseText"),this.configure(),this.legacyMode=!0,this.contentRef=e;var t=e.length;this.globalCounts.totalBytes=t;for(var r,a=new Array(128),n="",i=0,o=0,s=0;s0&&(a[i++]=n),n="";break;case"/":n.length>0&&(a[i++]=n),o++,n="";break;case"\n":n.length>0&&(a[i++]=n),n="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=s,this.processLine(a,i,o),i=0,o=0;break;case"\r":break;default:n+=r}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parseText")},e.prototype.processLine=function(e,t,r){if(!(t<1)){var a,n,i,o,s=function(e,t,r,a){var n="";if(a>r){var i;if(t)for(i=r;i4&&(this.colors.push(parseFloat(e[4])),this.colors.push(parseFloat(e[5])),this.colors.push(parseFloat(e[6])));break;case"vt":this.uvs.push(parseFloat(e[1])),this.uvs.push(parseFloat(e[2]));break;case"vn":this.normals.push(parseFloat(e[1])),this.normals.push(parseFloat(e[2])),this.normals.push(parseFloat(e[3]));break;case"f":if(a=t-1,0===r)for(this.checkFaceType(0),i=2,n=a;i0?n-1:n+a.vertices.length/3),o=a.rawMesh.subGroupInUse.vertices;o.push(a.vertices[i++]),o.push(a.vertices[i++]),o.push(a.vertices[i]);var s=a.colors.length>0?i:null;if(null!==s){var l=a.rawMesh.subGroupInUse.colors;l.push(a.colors[s++]),l.push(a.colors[s++]),l.push(a.colors[s])}if(t){var u=parseInt(t),c=2*(u>0?u-1:u+a.uvs.length/2),f=a.rawMesh.subGroupInUse.uvs;f.push(a.uvs[c++]),f.push(a.uvs[c])}if(r){var h=parseInt(r),d=3*(h>0?h-1:h+a.normals.length/3),p=a.rawMesh.subGroupInUse.normals;p.push(a.normals[d++]),p.push(a.normals[d++]),p.push(a.normals[d])}};if(this.useIndices){var o=e+(t?"_"+t:"_n")+(r?"_"+r:"_n"),s=this.rawMesh.subGroupInUse.indexMappings[o];n.default.Validator.isValid(s)?this.rawMesh.counts.doubleIndicesCount++:(s=this.rawMesh.subGroupInUse.vertices.length/3,i(),this.rawMesh.subGroupInUse.indexMappings[o]=s,this.rawMesh.subGroupInUse.indexMappingsCount++),this.rawMesh.subGroupInUse.indices.push(s)}else i();this.rawMesh.counts.faceCount++},e.prototype.createRawMeshReport=function(e){return"Input Object number: "+e+"\n\tObject name: "+this.rawMesh.objectName+"\n\tGroup name: "+this.rawMesh.groupName+"\n\tMtllib name: "+this.rawMesh.mtllibName+"\n\tVertex count: "+this.vertices.length/3+"\n\tNormal count: "+this.normals.length/3+"\n\tUV count: "+this.uvs.length/2+"\n\tSmoothingGroup count: "+this.rawMesh.counts.smoothingGroupCount+"\n\tMaterial count: "+this.rawMesh.counts.mtlCount+"\n\tReal MeshOutputGroup count: "+this.rawMesh.subGroups.length},e.prototype.finalizeRawMesh=function(){var e,t,r=[],a=0,n=0,i=0,o=0,s=0,l=0;for(var u in this.rawMesh.subGroups)if((e=this.rawMesh.subGroups[u]).vertices.length>0){if((t=e.indices).length>0&&n>0)for(var c in t)t[c]=t[c]+n;r.push(e),a+=e.vertices.length,n+=e.indexMappingsCount,i+=e.indices.length,o+=e.colors.length,l+=e.uvs.length,s+=e.normals.length}var f=null;return r.length>0&&(f={name:""!==this.rawMesh.groupName?this.rawMesh.groupName:this.rawMesh.objectName,subGroups:r,absoluteVertexCount:a,absoluteIndexCount:i,absoluteColorCount:o,absoluteNormalCount:s,absoluteUvCount:l,faceCount:this.rawMesh.counts.faceCount,doubleIndicesCount:this.rawMesh.counts.doubleIndicesCount}),f},e.prototype.processCompletedMesh=function(){var e=this.finalizeRawMesh();if(n.default.Validator.isValid(e)){if(this.colors.length>0&&this.colors.length!==this.vertices.length)throw"Vertex Colors were detected, but vertex count and color count do not match!";this.logging.enabled&&this.logging.debug&&console.debug(this.createRawMeshReport(this.inputObjectCount)),this.inputObjectCount++,this.buildMesh(e);var t=this.globalCounts.currentByte/this.globalCounts.totalBytes;return this.callbackProgress("Completed [o: "+this.rawMesh.objectName+" g:"+this.rawMesh.groupName+"] Total progress: "+(100*t).toFixed(2)+"%",t),this.resetRawMesh(),!0}return!1},e.prototype.buildMesh=function(e){var t=e.subGroups,r=new Float32Array(e.absoluteVertexCount);this.globalCounts.vertices+=e.absoluteVertexCount/3,this.globalCounts.faces+=e.faceCount,this.globalCounts.doubleIndicesCount+=e.doubleIndicesCount;var a,i,o,s,l,u,c,f=e.absoluteIndexCount>0?new Uint32Array(e.absoluteIndexCount):null,h=e.absoluteColorCount>0?new Float32Array(e.absoluteColorCount):null,d=e.absoluteNormalCount>0?new Float32Array(e.absoluteNormalCount):null,p=e.absoluteUvCount>0?new Float32Array(e.absoluteUvCount):null,m=n.default.Validator.isValid(h),v=[],g=t.length>1,y=0,b=[],w=[],x=0,_=0,A=0,E=0,S=0,M=0,T=0;for(var P in t)if(t.hasOwnProperty(P)){if(c=(a=t[P]).materialName,u=this.rawMesh.faceType<4?c+(m?"_vertexColor":"")+(0===a.smoothingGroup?"_flat":""):6===this.rawMesh.faceType?"defaultPointMaterial":"defaultLineMaterial",s=this.materials[c],l=this.materials[u],!n.default.Validator.isValid(s)&&!n.default.Validator.isValid(l)){var F=m?"defaultVertexColorMaterial":"defaultMaterial";s=this.materials[F],this.logging.enabled&&console.warn('object_group "'+a.objectName+"_"+a.groupName+'" was defined with unresolvable material "'+c+'"! Assigning "'+F+'".'),(c=F)===u&&(l=s,u=F)}if(!n.default.Validator.isValid(l)){var O={materialNameOrg:c,materialName:u,materialProperties:{vertexColors:m?2:0,flatShading:0===a.smoothingGroup}},L={cmd:"materialData",materials:{materialCloneInstructions:O}};this.callbackMeshBuilder(L),this.useAsync&&(this.materials[u]=O)}if(g?((i=b[u])||(i=y,b[u]=y,v.push(u),y++),o={start:M,count:T=this.useIndices?a.indices.length:a.vertices.length/3,index:i},w.push(o),M+=T):v.push(u),r.set(a.vertices,x),x+=a.vertices.length,f&&(f.set(a.indices,_),_+=a.indices.length),h&&(h.set(a.colors,A),A+=a.colors.length),d&&(d.set(a.normals,E),E+=a.normals.length),p&&(p.set(a.uvs,S),S+=a.uvs.length),this.logging.enabled&&this.logging.debug){var C=n.default.Validator.isValid(i)?"\n\t\tmaterialIndex: "+i:"",k="\tOutput Object no.: "+this.outputObjectCount+"\n\t\tgroupName: "+a.groupName+"\n\t\tIndex: "+a.index+"\n\t\tfaceType: "+this.rawMesh.faceType+"\n\t\tmaterialName: "+a.materialName+"\n\t\tsmoothingGroup: "+a.smoothingGroup+C+"\n\t\tobjectName: "+a.objectName+"\n\t\t#vertices: "+a.vertices.length/3+"\n\t\t#indices: "+a.indices.length+"\n\t\t#colors: "+a.colors.length/3+"\n\t\t#uvs: "+a.uvs.length/2+"\n\t\t#normals: "+a.normals.length/3;console.debug(k)}}this.outputObjectCount++,this.callbackMeshBuilder({cmd:"meshData",progress:{numericalValue:this.globalCounts.currentByte/this.globalCounts.totalBytes},params:{meshName:e.name},materials:{multiMaterial:g,materialNames:v,materialGroups:w},buffers:{vertices:r,indices:f,colors:h,normals:d,uvs:p},geometryType:this.rawMesh.faceType<4?0:6===this.rawMesh.faceType?2:1},[r.buffer],n.default.Validator.isValid(f)?[f.buffer]:null,n.default.Validator.isValid(h)?[h.buffer]:null,n.default.Validator.isValid(d)?[d.buffer]:null,n.default.Validator.isValid(p)?[p.buffer]:null)},e.prototype.finalizeParsing=function(){if(this.logging.enabled&&console.info("Global output object count: "+this.outputObjectCount),this.processCompletedMesh()&&this.logging.enabled){var e="Overall counts: \n\tVertices: "+this.globalCounts.vertices+"\n\tFaces: "+this.globalCounts.faces+"\n\tMultiple definitions: "+this.globalCounts.doubleIndicesCount;console.info(e)}},e}();return r.prototype.loadMtl=function(e,t,r,a,i){var o=new n.default.ResourceDescriptor(e,"MTL");o.setContent(t),this._loadMtl(o,r,a,i)},r.prototype._loadMtl=function(e,r,n,o){void 0===i.default&&console.error('"THREE.MTLLoader" is not available. "THREE.OBJLoader2" requires it for loading MTL files.'),t.isValid(e)&&this.logging.enabled&&console.time("Loading MTL: "+e.name);var s=[],l=this,u=function(a){var n=[];if(t.isValid(a))for(var i in a.preload(),n=a.materials)n.hasOwnProperty(i)&&(s[i]=n[i]);t.isValid(e)&&l.logging.enabled&&console.timeEnd("Loading MTL: "+e.name),r(s,a)};if(t.isValid(e)&&(t.isValid(e.content)||t.isValid(e.url))){var c=new i.default(this.manager);if(n=t.verifyInput(n,"anonymous"),c.setCrossOrigin(n),c.setPath(e.path),t.isValid(o)&&c.setMaterialOptions(o),t.isValid(e.content))u(t.isValid(e.content)?c.parse(e.content):null);else if(t.isValid(e.url)){new a.FileLoader(this.manager).load(e.url,(function(t){e.content=t,u(c.parse(t))}),this._onProgress,this._onError)}}else u()},r}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.littleEndian=!0};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(e,(function(r){t(i.parse(r,e))}),r,n)},parse:function(e,t){var r=a.LoaderUtils.decodeText(e),n=function(e){var t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),a=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=a[1],t.headerLen=a[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(var n=0,i=t.fields.length;n0&&v.addAttribute("position",new a.Float32BufferAttribute(i,3)),o.length>0&&v.addAttribute("normal",new a.Float32BufferAttribute(o,3)),s.length>0&&v.addAttribute("color",new a.Float32BufferAttribute(s,3)),v.computeBoundingSphere();var g=new a.PointsMaterial({size:.005});s.length>0?g.vertexColors=!0:g.color.setHex(16777215*Math.random());var y=new a.Points(v,g),b=t.split("").reverse().join("");return b=(b=/([^\/]*)/.exec(b))[1].split("").reverse().join(""),y.name=b,y}console.error("THREE.PCDLoader: binary_compressed files are not supported")}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function n(e,t){var r=parseInt(m[v].substr(e,t));if(r){var a=function(e,t){return"s"+Math.min(e,t)+"e"+Math.max(e,t)}(y,r);void 0===p[a]&&(h.push([y-1,r-1,1]),p[a]=h.length-1)}}for(var i,o,s,l,u,c={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},f=[],h=[],d={},p={},m=e.split("\n"),v=0,g=m.length;v=t.elements[u].count&&(u++,c=0);var d=n(t.elements[u].properties,h);s(a,t.elements[u].name,d),c++}}return o(a)}function o(e){var t=new a.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.addAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.addAttribute("normal",new a.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.addAttribute("uv",new a.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.addAttribute("color",new a.Float32BufferAttribute(e.colors,3)),t.computeBoundingSphere(),t}function s(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){var a=r.vertex_indices||r.vertex_index;3===a.length?e.indices.push(a[0],a[1],a[2]):4===a.length&&(e.indices.push(a[0],a[1],a[3]),e.indices.push(a[1],a[2],a[3]))}}function l(e,t,r,a){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,a),2];case"uint16":case"ushort":return[e.getUint16(t,a),2];case"int32":case"int":return[e.getInt32(t,a),4];case"uint32":case"uint":return[e.getUint32(t,a),4];case"float32":case"float":return[e.getFloat32(t,a),4];case"float64":case"double":return[e.getFloat64(t,a),8]}}function u(e,t,r,a){for(var n,i={},o=0,s=0;s>7&1),s=n>>6&1,l=1==(n>>5&1),u=31&n,c=0,f=0;if(l?(c=(t[2]<<16)+(t[3]<<8)+t[4],f=(t[5]<<16)+(t[6]<<8)+t[7]):(c=t[2]+(t[3]<<8)+(t[4]<<16),f=t[5]+(t[6]<<8)+(t[7]<<16)),0===a)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==a)throw new Error("PRWM decoder: Unsupported format version: "+a);if(!o){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==f)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}var h,d,p,m,v,g,y,b,w=8,x={};for(b=0;b>7&1,m=1+(n>>4&3),w++,g=i(e,v=r[15&n],w=4*Math.ceil(w/4),m*c,l),w+=v.BYTES_PER_ELEMENT*m*c,x[h]={type:p,cardinality:m,values:g}}return w=4*Math.ceil(w/4),y=null,o&&(y=i(e,1===s?Uint32Array:Uint16Array,w,f,l)),{version:a,attributes:x,indices:y}}(e),s=Object.keys(o.attributes),l=new a.BufferGeometry;for(n=0;n0;return 25===d?(r=p?a.RGBA_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,t=4):24===d?(r=p?a.RGBA_PVRTC_2BPPV1_Format:a.RGB_PVRTC_2BPPV1_Format,t=2):console.error("THREE.PVRLoader: Unknown PVR format:",d),e.dataPtr=o,e.bpp=t,e.format=r,e.width=l,e.height=s,e.numSurfaces=h,e.numMipmaps=u+1,e.isCubemap=6===h,n._extract(e)},n._extract=function(e){var t,r={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},a=e.buffer,n=e.dataPtr,i=e.bpp,o=e.numSurfaces,s=0,l=0,u=0,c=0,f=0;2===i?(l=8,u=4):(l=4,u=4),t=l*u*i/8,r.mipmaps.length=e.numMipmaps*o;for(var h=0;h>h,p=e.height>>h;(c=d/l)<2&&(c=2),(f=p/u)<2&&(f=2),s=c*f*t;for(var m=0;m>5&31)/31,n=(_>>10&31)/31):(t=o,r=s,n=l)}for(var A=1;A<=3;A++){var E=y+12*A;m.push(c.getFloat32(E,!0)),m.push(c.getFloat32(E+4,!0)),m.push(c.getFloat32(E+8,!0)),v.push(b,w,x),h&&i.push(t,r,n)}}return p.addAttribute("position",new a.BufferAttribute(new Float32Array(m),3)),p.addAttribute("normal",new a.BufferAttribute(new Float32Array(v),3)),h&&(p.addAttribute("color",new a.BufferAttribute(new Float32Array(i),3)),p.hasColors=!0,p.alpha=u),p}(r):function(e){for(var t,r=new a.BufferGeometry,n=/facet([\s\S]*?)endfacet/g,i=0,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+o+o+o,"g"),l=new RegExp("normal"+o+o+o,"g"),u=[],c=[],f=new a.Vector3;null!==(t=n.exec(e));){for(var h=0,d=0,p=t[0];null!==(t=l.exec(p));)f.x=parseFloat(t[1]),f.y=parseFloat(t[2]),f.z=parseFloat(t[3]),d++;for(;null!==(t=s.exec(p));)u.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),c.push(f.x,f.y,f.z),h++;1!==d&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==h&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}return r.addAttribute("position",new a.Float32BufferAttribute(u,3)),r.addAttribute("normal",new a.Float32BufferAttribute(c,3)),r}("string"!=typeof(t=e)?a.LoaderUtils.decodeText(new Uint8Array(t)):t)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e,t,a,n,i,o,s,l){n=n*Math.PI/180,t=Math.abs(t),a=Math.abs(a);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,f=Math.cos(n)*u+Math.sin(n)*c,h=-Math.sin(n)*u+Math.cos(n)*c,d=t*t,p=a*a,m=f*f,v=h*h,g=m/d+v/p;if(g>1){var y=Math.sqrt(g);d=(t*=y)*t,p=(a*=y)*a}var b=d*v+p*m,w=(d*p-b)/b,x=Math.sqrt(Math.max(0,w));i===o&&(x=-x);var _=x*t*h/a,A=-x*a*f/t,E=Math.cos(n)*_-Math.sin(n)*A+(s.x+l.x)/2,S=Math.sin(n)*_+Math.cos(n)*A+(s.y+l.y)/2,M=r(1,0,(f-_)/t,(h-A)/a),T=r((f-_)/t,(h-A)/a,(-f-_)/t,(-h-A)/a)%(2*Math.PI);e.currentPath.absellipse(E,S,t,a,M,M+T,0===o,n)}function r(e,t,r,a){var n=e*r+t*a,i=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+a*a),o=Math.acos(Math.max(-1,Math.min(1,n/i)));return e*a-t*r<0&&(o=-o),o}function n(e,t){return t=Object.assign({},t),e.hasAttribute("fill")&&(t.fill=e.getAttribute("fill")),""!==e.style.fill&&(t.fill=e.style.fill),t}function i(e){return"none"!==e.fill&&"transparent"!==e.fill}function o(e,t){return 2*e-(t-e)}function s(e){for(var t=e.split(/[\s,]+|(?=\s?[+\-])/),r=0;r0){var p=[];for(u=0;u=t.end)return 0;this.position=t.cur;try{var r=this.readChunk(e);return t.cur+=r.size,r.id}catch(e){return this.debugMessage("Unable to read chunk at "+this.position),0}},resetPosition:function(){this.position-=6},readByte:function(e){var t=e.getUint8(this.position,!0);return this.position+=1,t},readFloat:function(e){try{var t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}},readInt:function(e){var t=e.getInt32(this.position,!0);return this.position+=4,t},readShort:function(e){var t=e.getInt16(this.position,!0);return this.position+=2,t},readDWord:function(e){var t=e.getUint32(this.position,!0);return this.position+=4,t},readWord:function(e){var t=e.getUint16(this.position,!0);return this.position+=2,t},readString:function(e,t){for(var r="",a=0;a256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case a:case n:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;var g=!1,y=!1,b=!1;switch(v.image_type){case i:g=!0,y=!0;break;case r:y=!0;break;case o:g=!0;break;case a:break;case s:g=!0,b=!0;break;case n:b=!0}var w=document.createElement("canvas");w.width=v.width,w.height=v.height;var x=w.getContext("2d"),_=x.createImageData(v.width,v.height),A=function(e,t,r,a,n){var i,o,s,l;if(o=r.pixel_size>>3,s=r.width*r.height*o,t&&(l=n.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,c,f;i=new Uint8Array(s);for(var h=0,d=new Uint8Array(o);h>u){default:case h:i=0,s=1,m=t,o=0,p=1,g=r;break;case c:i=0,s=1,m=t,o=r-1,p=-1,g=-1;break;case d:i=t-1,s=-1,m=-1,o=0,p=1,g=r;break;case f:i=t-1,s=-1,m=-1,o=r-1,p=-1,g=-1}if(b)switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,h=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f++)l=s[f],e[4*(u+h*c)+0]=l,e[4*(u+h*c)+1]=l,e[4*(u+h*c)+2]=l,e[4*(u+h*c)+3]=255}(e,o,p,g,i,s,m,a);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=2)e[4*(l+f*u)+0]=s[c+0],e[4*(l+f*u)+1]=s[c+0],e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+3]=s[c+1]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s,l){var u,c,f,h=l,d=0,p=v.width;for(f=t;f!==a;f+=r)for(c=n;c!==o;c+=i,d++)u=s[d],e[4*(c+p*f)+3]=255,e[4*(c+p*f)+2]=h[3*u+0],e[4*(c+p*f)+1]=h[3*u+1],e[4*(c+p*f)+0]=h[3*u+2]}(e,o,p,g,i,s,m,a,n);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,h=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f+=2)l=s[f+0]+(s[f+1]<<8),e[4*(u+h*c)+0]=(31744&l)>>7,e[4*(u+h*c)+1]=(992&l)>>2,e[4*(u+h*c)+2]=(31&l)>>3,e[4*(u+h*c)+3]=32768&l?0:255}(e,o,p,g,i,s,m,a);break;case 24:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=3)e[4*(l+f*u)+3]=255,e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2]}(e,o,p,g,i,s,m,a);break;case 32:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=4)e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2],e[4*(l+f*u)+3]=s[c+3]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}}(_.data,v.width,v.height,A.pixel_data,A.palettes);return x.putImageData(_,0,0),w}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.reversed=!1};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){var t,r=[];e.forEach((function(e){"m"===e.type.toLowerCase()?(t=[e],r.push(t)):"z"!==e.type.toLowerCase()&&t.push(e)}));var a=[];return r.forEach((function(e){var t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};a.push(t);for(var r=e.length-1;r>0;r--){var n=e[r];t={type:n.type};void 0!==n.x2&&void 0!==n.y2?(t.x1=n.x2,t.y1=n.y2,t.x2=n.x1,t.y2=n.y1):void 0!==n.x1&&void 0!==n.y1&&(t.x1=n.x1,t.y1=n.y1),t.x=e[r-1].x,t.y=e[r-1].y,a.push(t)}})),a}return"undefined"==typeof opentype?(console.warn("THREE.TTFLoader: The loader requires opentype.js. Make sure it's included before using the loader."),null):function(e,r){for(var a=Math.round,n={},i=1e5/(72*(e.unitsPerEm||2048)),o=0;o-1;o--){var s=i[o];if(/{.*[{\[]/.test(s))(l=s.split("{").join("{\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);else if(/\].*}/.test(s)){var l;(l=s.split("]").join("]\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l)}if(/}.*}/.test(s))(l=s.split("}").join("}\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);/^\b[^\s]+\b$/.test(s.trim())?(i[o+1]=s+" "+i[o+1].trim(),i.splice(o,1)):s.indexOf("coord")>-1&&s.indexOf("[")<0&&s.indexOf("{")<0&&(i[o]+=" Coordinate {}")}var u=i.shift();return/V1.0/.exec(u)?console.warn("THREE.VRMLLoader: V1.0 not supported yet."):/V2.0/.exec(u)&&function(e,n){var i={},o=/(\b|\-|\+)([\d\.e]+)/,s=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g,l=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g;function u(e,t,r,n,i){for(var o=!0===i?1:-1,s=[],l={},u={},c=0;cu.y:m.y>=l.y&&m.y0)for(var h=0;h0&&this.indexes.push(c),c=[]):c.push(parseInt(i[h])));/]/.exec(t)&&(c.length>0&&this.indexes.push(c),c=[],this.isRecordingFaces=!1,e[this.recordingFieldname]=this.indexes)}else if(this.isRecordingPoints){if("Coordinate"==e.nodeType)for(;null!==(i=l.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2]),z:parseFloat(i[3])},this.points.push(n);if("TextureCoordinate"==e.nodeType)for(;null!==(i=s.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2])},this.points.push(n);/]/.exec(t)&&(this.isRecordingPoints=!1,e.points=this.points)}else if(this.isRecordingAngles){if(i.length>0)for(h=0;h-1&&"PointLight"===o.nodeType&&(o.nodeType="AmbientLight");var c=void 0===o.on||o.on,f=void 0!==o.intensity?o.intensity:1,h=new a.Color;if(o.color&&h.copy(o.color),"AmbientLight"===o.nodeType)(l=new a.AmbientLight(h,f)).visible=c,s.add(l);else if("PointLight"===o.nodeType){var d=0;void 0!==o.radius&&o.radius<1e3&&(d=o.radius),(l=new a.PointLight(h,f,d)).visible=c,s.add(l)}else if("SpotLight"===o.nodeType){f=1,d=0;var p=Math.PI/3;c=!0;void 0!==o.radius&&o.radius<1e3&&(d=o.radius),void 0!==o.cutOffAngle&&(p=o.cutOffAngle),(l=new a.SpotLight(h,f,d,p,0)).visible=c,s.add(l)}else if("Transform"===o.nodeType||"Group"===o.nodeType){if(l=new a.Object3D,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),void 0!==o.translation){var m=o.translation;l.position.set(m.x,m.y,m.z)}if(void 0!==o.rotation){var v=o.rotation;l.quaternion.setFromAxisAngle(new a.Vector3(v.x,v.y,v.z),v.w)}if(void 0!==o.scale){var g=o.scale;l.scale.set(g.x,g.y,g.z)}s.add(l)}else if("Shape"===o.nodeType)l=new a.Mesh,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),s.add(l);else if("Background"===o.nodeType){var y=2e4,b=new a.SphereBufferGeometry(y,20,20),w=new a.MeshBasicMaterial({fog:!1,side:a.BackSide});if(o.skyColor.length>1)u(b,y,o.skyAngle,o.skyColor,!0),w.vertexColors=a.VertexColors;else{var x=o.skyColor[0];w.color.setRGB(x.r,x.b,x.g)}if(n.add(new a.Mesh(b,w)),void 0!==o.groundColor){y=12e3;var _=new a.SphereBufferGeometry(y,20,20,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),A=new a.MeshBasicMaterial({fog:!1,side:a.BackSide,vertexColors:a.VertexColors});u(_,y,o.groundAngle,o.groundColor,!1),n.add(new a.Mesh(_,A))}}else{if(/geometry/.exec(o.string)){if("Box"===o.nodeType){g=o.size;s.geometry=new a.BoxBufferGeometry(g.x,g.y,g.z)}else if("Cylinder"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.radius,o.radius,o.height);else if("Cone"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.topRadius,o.bottomRadius,o.height);else if("Sphere"===o.nodeType)s.geometry=new a.SphereBufferGeometry(o.radius);else if("IndexedFaceSet"===o.nodeType){var E,S,M,T,P,F=new a.BufferGeometry,O=[],L=[];for(B=0,M=o.children.length;B-1){var C=/DEF\s+([^\s]+)/.exec(V.string)[1];i[C]=O.slice(0)}if(V.string.indexOf("USE")>-1){W=/USE\s+([^\s]+)/.exec(V.string)[1];O=i[W]}}}var k=0;if(o.coordIndex){var R=[],I=[];for(E=new a.Vector3,S=new a.Vector2,B=0,M=o.coordIndex.length;B=3&&k0&&F.addAttribute("uv",new a.Float32BufferAttribute(L,2)),F.computeVertexNormals(),F.computeBoundingSphere(),/DEF/.exec(o.string)&&(F.name=/DEF ([^\s]+)/.exec(o.string)[1],i[F.name]=F),s.geometry=F}return}if(/appearance/.exec(o.string)){for(var B=0;B>1^-(1&c),a[n]=s*(l+o),n+=i}},n.prototype.decompressIndices_=function(e,t,r,a,n){for(var i=0,o=0;o>1,p=e.charCodeAt(u+4)+1>>1,m=e.charCodeAt(u+5)+1>>1;l[s++]=n[0]*(c+d),l[s++]=n[1]*(f+p),l[s++]=n[2]*(h+m),l[s++]=n[0]*d,l[s++]=n[1]*p,l[s++]=n[2]*m}return l},n.prototype.decompressMesh=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=u,h=new Float32Array(o*c),d=0;d>1^-(1&f);l[c]+=h,s[t*u+c]=l[c],o[t*u+c]=a[c]*(l[c]+r[c])}},n.prototype.accumulateNormal=function(e,t,r,a,n){var i=a[8*e],o=a[8*e+1],s=a[8*e+2],l=a[8*t],u=a[8*t+1],c=a[8*t+2],f=a[8*r],h=a[8*r+1],d=a[8*r+2];l-=i,f-=i,i=(u-=o)*(d-=s)-(c-=s)*(h-=o),o=c*f-l*d,s=l*h-u*f,n[3*e]+=i,n[3*e+1]+=o,n[3*e+2]+=s,n[3*t]+=i,n[3*t+1]+=o,n[3*t+2]+=s,n[3*r]+=i,n[3*r+1]+=o,n[3*r+2]+=s},n.prototype.decompressMesh2=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=t.codeRange[0],h=3*t.codeRange[2],d=new Uint16Array(h),p=new Int32Array(3*c),m=new Uint16Array(o),v=new Uint16Array(o*c),g=new Float32Array(o*c),y=0,b=0,w=0;w>1^-(1&O))+v[o*A+F]+v[o*E+F]-v[o*S+F];m[F]=L,v[o*y+F]=L,g[o*y+F]=l[F]*(L+s[F])}y++}else this.copyAttrib(o,v,m,P);this.accumulateNormal(A,E,P,v,p)}else{var C=y-(x-_);d[b++]=C,x===_?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,C);var k=y-(x=e.charCodeAt(f++));d[b++]=k,0===x?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,k);var R=y-(x=e.charCodeAt(f++));if(d[b++]=R,0===x){for(F=0;F<5;F++)m[F]=(v[o*C+F]+v[o*k+F])/2;this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++)}else this.copyAttrib(o,v,m,R);this.accumulateNormal(C,k,R,v,p)}}for(w=0;w>1^-(1&j)),g[o*w+6]=U*N+(B>>1^-(1&B)),g[o*w+7]=U*D+(V>>1^-(1&V))}i(a,n,g,d,void 0,t)},n.prototype.downloadMesh=function(e,t,r,a,n){var i=this,s=0;o(e,(function(e){!function(e){for(;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=new s(3*f/4-(i="="===e[f-2]?2:"="===e[f-1]?1:0)),a=i>0?f-4:f;var h=0;for(t=0,r=0;t>16,o[h++]=(65280&n)>>8,o[h++]=255&n;return 2===i?(n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[h++]=255&n):1===i&&(n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[h++]=n>>8&255,o[h++]=255&n),o}function n(e,a){var n,i,s,l,u=0;if("UInt64"===o.attributes.header_type?u=8:"UInt32"===o.attributes.header_type&&(u=4),"binary"===e.attributes.format&&a){var c,f,h,d,p,m;if("Float32"===e.attributes.type)var v=new Float32Array;else if("Int64"===e.attributes.type)v=new Int32Array;f=(c=r(e["#text"]))[0];for(var g=1;g0?3-d%3:0,(p=[]).push(m),h=3*u;for(g=0;g0){r.attributes={};for(var a=0;a0&&(v[g].text=n(v[g],f)),g++;switch(h[d]){case"PointData":var b=parseInt(c.attributes.NumberOfPoints),w=m.attributes.Normals;if(b>0)for(var x=0,_=v.length;x<_;x++)if(w===v[x].attributes.Name){var A=v[x].attributes.NumberOfComponents;(l=new Float32Array(b*A)).set(v[x].text,0)}break;case"Points":if((b=parseInt(c.attributes.NumberOfPoints))>0){A=m.DataArray.attributes.NumberOfComponents;(s=new Float32Array(b*A)).set(m.DataArray.text,0)}break;case"Strips":var E=parseInt(c.attributes.NumberOfStrips);if(E>0){var S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);var T=E+S.length;u=new Uint32Array(3*T-9*E);var P=0;for(x=0,_=E;x<_;x++){for(var F=[],O=0,L=M[x],C=0;O0&&(C=M[x-1]);var k=0;for(L=M[x],C=0;k0&&(C=M[x-1])}}break;case"Polys":var R=parseInt(c.attributes.NumberOfPolys);if(R>0){S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);T=R+S.length;u=new Uint32Array(3*T-9*R);P=0;var I=0;for(x=0,_=R,C=0;x<_;){var N=[];for(O=0,L=M[x];O=3)for(var C=parseInt(L[0]),k=1,R=0;R=3){var I,N;for(R=0;R=u.byteLength)break}var A=new a.BufferGeometry;return A.setIndex(new a.BufferAttribute(d,1)),A.addAttribute("position",new a.BufferAttribute(f,3)),h.length===f.length&&A.addAttribute("normal",new a.BufferAttribute(h,3)),A}(e)}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(var r=t;r-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,a=0;a127)return!0;return!1}},{key:"ensureBinary",value:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),r=0;r0&&(this.baseDir=this.url.substr(0,this.url.lastIndexOf("/")+1));this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this.mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var a=this._data.indexOf("{",r)+1,n=this._data.indexOf("}",r),i=this._data.indexOf("{",a)+1;if(!(a>0&&n>a)){r=-1===a?this._data.length:n+1;break}var o={children:[]},s=this._readLine(this._data.substr(r,a-r-1)).trim(),l=s.split(/ /g);if(l.length>0?(o.type=l[0],l.length>=2?o.name=l[1]:o.name=l[0]+this.Hierarchies.children.length):(o.name=s,o.type=""),"Animation"===o.type){o.data=this._data.substr(i,n-i).trim();var u=this._hierarchieParse(o,n+1);r=u.end,o.children=u.parent.children}else{var c=this._data.lastIndexOf(";",i>0?Math.min(i,n):n);if(o.data=this._data.substr(a,c-a).trim(),i<=0||n0||!this._currentObject.worked?setTimeout((function(){e.mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.Geometry=new a.Geometry,this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new s,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new a.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new a.Bone;if(e.name=this._currentFrame.name,e.applyMatrix(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(var t in this.HieStack)this.HieStack[t].name===this._currentFrame.parentName&&this.HieStack[t].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,a=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,n=0,(a=this._currentObject.data.indexOf(";;",e)+1)<=0&&(a=this._currentObject.data.length)}else{var o=0;switch(t){case 0:o=this._currentObject.data.indexOf(",",e)+1;break;case 1:o=this._currentObject.data.indexOf(";,",e)+1}switch((0===o||o>a)&&(o=a,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,o-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,o-e))}break;case"MeshNormals":switch(t){case 0:this._readNormalVector1(this._currentObject.data.substr(e,o-e));break;case 1:this._readNormalFace1(this._currentObject.data.substr(e,o-e),n)}}e=o+1,n++,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.Geometry.vertices.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))),this._currentGeo.Geometry.skinIndices.push(new a.Vector4(0,0,0,0)),this._currentGeo.Geometry.skinWeights.push(new a.Vector4(1,0,0,0)),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.Geometry.faces.push(new a.Face3(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),new a.Vector3(1,1,1).normalize()))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.normalVectors.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])))}},{key:"_readNormalFace1",value:function(e,t){var r=this._readLine(e.trim()).substr(2,e.length-4).split(","),a=parseInt(r[0],10),n=this._currentGeo.normalVectors[a];a=parseInt(r[1],10);var i=this._currentGeo.normalVectors[a];a=parseInt(r[2],10);var o=this._currentGeo.normalVectors[a];this._currentGeo.Geometry.faces[t].vertexNormals=[n,i,o]}},{key:"_setMeshNormals",value:function(){for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var a=this._currentObject.data.indexOf(",",e)+1;-1===a&&(a=this._currentObject.data.indexOf(";;",e)+1,t=2,r=0);var n=this._currentObject.data.substr(e,a-e),i=this._readLine(n.trim()).split(";");this._currentGeo.normalVectors.push([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]),e=a+1}}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshTextureCoords",value:function(){this._tmpUvArray=[],this._currentGeo.Geometry.faceVertexUvs=[],this._currentGeo.Geometry.faceVertexUvs.push([]);for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),o=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),1-parseFloat(o[1]))):this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),parseFloat(o[1]))),e=n+1}}if(e>=this._currentObject.data.length)break}this._currentGeo.Geometry.faceVertexUvs[0]=[];for(var s=0;s=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new a.MeshPhongMaterial({color:16777215*Math.random()});e.side=a.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t),i=this._readLine(n.trim()).split(";");e.color.r=parseFloat(i[0]),e.color.g=parseFloat(i[1]),e.color.b=parseFloat(i[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(n)),t=r+1,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t);var o=this._readLine(n.trim()).split(";");e.specular.r=parseFloat(o[0]),e.specular.g=parseFloat(o[1]),e.specular.b=parseFloat(o[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),n=this._currentObject.data.substr(t,r-t);var s=this._readLine(n.trim()).split(";");e.emissive.r=parseFloat(s[0]),e.emissive.g=parseFloat(s[1]),e.emissive.b=parseFloat(s[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var u=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(this.baseDir+u);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(this.baseDir+u),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(this.baseDir+u),e.normalScale=new a.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(this.baseDir+u);break;case"LightMapFilename":e.lightMap=this.texloader.load(this.baseDir+u)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new o,t=0,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);t=r+1,e.boneName=n.substr(1,n.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(r=this._currentObject.data.indexOf(";",t))+1,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);for(var i=this._readLine(n.trim()).split(","),s=0;s0)for(var o=0;o0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(var r=0;r4&&console.log("warn! over 4 bone weight! :"+s)}}for(var u=0;u0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,i&&e.context.disable(e.context.STENCIL_TEST),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new a.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new a.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionX,e.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.context.enable(e.context.STENCIL_TEST),e.render(this.scene,this.camera,r,!1),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:new a.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),s.BlurDirectionX=new a.Vector2(1,0),s.BlurDirectionY=new a.Vector2(0,1),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=r(1),i=(a=n)&&a.__esModule?a:{default:a};var o=function(e,t,r,a,n){i.default.call(this),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=a,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};o.prototype=Object.assign(Object.create(i.default.prototype),{constructor:o,render:function(e,t,r,a,n){var i,o,s=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),o=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),this.clearColor&&e.setClearColor(i,o),this.scene.overrideMaterial=null,e.autoClear=s}}),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=c(r(1)),i=c(r(19)),o=c(r(20)),s=c(r(2)),l=c(r(21)),u=c(r(22));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e,t,r,u,c){(n.default.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==r&&r,this.supportsNormalTexture=void 0!==u&&u,this.oldClearColor=new a.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==c?new a.Vector2(c.x,c.y):new a.Vector2(256,256),this.saoRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.NearestFilter,magFilter:a.NearestFilter,format:a.RGBAFormat}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((r=new a.DepthTexture).type=a.UnsignedShortType,r.minFilter=a.NearestFilter,r.maxFilter=a.NearestFilter,this.beautyRenderTarget.depthTexture=r,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.normalMaterial=new a.MeshNormalMaterial,this.normalMaterial.blending=a.NoBlending,void 0===i.default&&console.error("THREE.SAOPass relies on THREE.SAOShader"),this.saoMaterial=new a.ShaderMaterial({defines:Object.assign({},i.default.defines),fragmentShader:i.default.fragmentShader,vertexShader:i.default.vertexShader,uniforms:a.UniformsUtils.clone(i.default.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=a.NoBlending,void 0===o.default&&console.error("THREE.SAOPass relies on THREE.DepthLimitedBlurShader"),this.vBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=a.NoBlending,this.hBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=a.NoBlending,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.CopyShader"),this.materialCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(s.default.uniforms),vertexShader:s.default.vertexShader,fragmentShader:s.default.fragmentShader,blending:a.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=a.CustomBlending,this.materialCopy.blendSrc=a.DstColorFactor,this.materialCopy.blendDst=a.ZeroFactor,this.materialCopy.blendEquation=a.AddEquation,this.materialCopy.blendSrcAlpha=a.DstAlphaFactor,this.materialCopy.blendDstAlpha=a.ZeroFactor,this.materialCopy.blendEquationAlpha=a.AddEquation,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.UnpackDepthRGBAShader"),this.depthCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(l.default.uniforms),vertexShader:l.default.vertexShader,fragmentShader:l.default.fragmentShader,blending:a.NoBlending}),this.quadCamera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.quadScene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quadScene.add(this.quad)};f.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},f.prototype=Object.assign(Object.create(n.default.prototype),{constructor:f,render:function(e,t,r,n,i){if(this.renderToScreen&&(this.materialCopy.blending=a.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,e.clearTarget(this.depthRenderTarget),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(u.default.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(0,1)),u.default.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.render(this.scene,this.camera,this.beautyRenderTarget,!0),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var l=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,l=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?l.blending=a.CustomBlending:l.blending=a.NoBlending,this.renderPass(e,l,this.renderToScreen?null:r),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}},renderPass:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.quad.material=t,e.render(this.quadScene,this.quadCamera,r,l),e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},renderOverride:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1,a=t.clearColor||a,n=t.clearAlpha||n;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.scene.overrideMaterial=t,e.render(this.scene,this.camera,r,l),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}}),t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){n.default.call(this),void 0===i.default&&console.error("THREE.SavePass relies on THREE.CopyShader");var t=i.default;this.textureID="tDiffuse",this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new a.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBFormat,stencilBuffer:!1}),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,e.render(this.scene,this.camera,this.renderTarget,this.clear)}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(23));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),this.edgesRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var r=new Image;r.src=this.getAreaTexture(),this.areaTexture=new a.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=a.RGBFormat,this.areaTexture.minFilter=a.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.needsUpdate=!0,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),this.searchTexture=new a.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=a.NearestFilter,this.searchTexture.minFilter=a.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.needsUpdate=!0,this.searchTexture.flipY=!1,void 0===i.default&&console.error("THREE.SMAAPass relies on THREE.SMAAShader"),this.uniformsEdges=a.UniformsUtils.clone(i.default[0].uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new a.ShaderMaterial({defines:Object.assign({},i.default[0].defines),uniforms:this.uniformsEdges,vertexShader:i.default[0].vertexShader,fragmentShader:i.default[0].fragmentShader}),this.uniformsWeights=a.UniformsUtils.clone(i.default[1].uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new a.ShaderMaterial({defines:Object.assign({},i.default[1].defines),uniforms:this.uniformsWeights,vertexShader:i.default[1].vertexShader,fragmentShader:i.default[1].fragmentShader}),this.uniformsBlend=a.UniformsUtils.clone(i.default[2].uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new a.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:i.default[2].vertexShader,fragmentShader:i.default[2].fragmentShader}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniformsEdges.tDiffuse.value=r.texture,this.quad.material=this.materialEdges,e.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,e.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=r.texture,this.quad.material=this.materialBlend,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIz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ZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(3)),i=o(r(25));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){if(void 0===i.default)return console.warn("THREE.SSAOPass depends on THREE.SSAOShader"),new n.default;n.default.call(this,i.default),this.width=void 0!==r?r:512,this.height=void 0!==o?o:256,this.renderToScreen=!1,this.camera2=t,this.scene2=e,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.depthRenderTarget=new a.WebGLRenderTarget(this.width,this.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter}),this.uniforms.tDepth.value=this.depthRenderTarget.texture,this.uniforms.size.value.set(this.width,this.height),this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far,this.uniforms.radius.value=4,this.uniforms.onlyAO.value=!1,this.uniforms.aoClamp.value=.25,this.uniforms.lumInfluence.value=.7;Object.defineProperties(this,{radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},onlyAO:{get:function(){return this.uniforms.onlyAO.value},set:function(e){this.uniforms.onlyAO.value=e}},aoClamp:{get:function(){return this.uniforms.aoClamp.value},set:function(e){this.uniforms.aoClamp.value=e}},lumInfluence:{get:function(){return this.uniforms.lumInfluence.value},set:function(e){this.uniforms.lumInfluence.value=e}}})};(s.prototype=Object.create(n.default.prototype)).render=function(e,t,r,a,i){this.scene2.overrideMaterial=this.depthMaterial,e.render(this.scene2,this.camera2,this.depthRenderTarget,!0),this.scene2.overrideMaterial=null,n.default.prototype.render.call(this,e,t,r,a,i)},s.prototype.setScene=function(e){this.scene2=e},s.prototype.setCamera=function(e){this.camera2=e,this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far},s.prototype.setSize=function(e,t){this.width=e,this.height=t,this.uniforms.size.value.set(this.width,this.height),this.depthRenderTarget.setSize(this.width,this.height)},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(24),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t,r){void 0===o.default&&console.error("THREE.TAARenderPass relies on THREE.SSAARenderPass"),o.default.call(this,e,t,r),this.sampleLevel=0,this.accumulate=!1};s.JitterVectors=o.default.JitterVectors,s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a){if(!this.accumulate)return o.default.prototype.render.call(this,e,t,r,a),void(this.accumulateIndex=-1);var i=s.JitterVectors[5];this.sampleRenderTarget||(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),this.holdRenderTarget||(this.holdRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.holdRenderTarget.texture.name="TAARenderPass.hold"),this.accumulate&&-1===this.accumulateIndex&&(o.default.prototype.render.call(this,e,this.holdRenderTarget,r,a),this.accumulateIndex=0);var l=e.autoClear;e.autoClear=!1;var u=1/i.length;if(this.accumulateIndex>=0&&this.accumulateIndex=i.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}var d=this.accumulateIndex*u;d>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.render(this.scene2,this.camera2,t,!0)),d<1&&(this.copyUniforms.opacity.value=1-d,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.render(this.scene2,this.camera2,t,0===d)),e.autoClear=l}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),void 0===i.default&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=i.default;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=a.UniformsUtils.clone(r.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){var i=e.autoClear;e.autoClear=!1,this.quad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),e.autoClear=i}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=s(r(1)),i=s(r(2)),o=s(r(26));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e,t,r,s){n.default.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=s,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);var l={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var u=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new a.WebGLRenderTarget(u,c,l),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var f=0;f\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new a.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),l.BlurDirectionX=new a.Vector2(1,0),l.BlurDirectionY=new a.Vector2(0,1),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaterRefractionShader=t.VignetteShader=t.VerticalTiltShiftShader=t.VerticalBlurShader=t.UnpackDepthRGBAShader=t.TriangleBlurShader=t.ToneMapShader=t.TechnicolorShader=t.SSAOShader=t.SobelOperatorShader=t.SMAAShader=t.SepiaShader=t.SAOShader=t.RGBShiftShader=t.PixelShader=t.ParallaxShader=t.NormalMapShader=t.MirrorShader=t.LuminosityShader=t.LuminosityHighPassShader=t.KaleidoShader=t.HueSaturationShader=t.HorizontalTiltShiftShader=t.HorizontalBlurShader=t.HalftoneShader=t.GammaCorrectionShader=t.FXAAShader=t.FresnelShader=t.FreiChenShader=t.FocusShader=t.FilmShader=t.DotScreenShader=t.DOFMipMapShader=t.DigitalGlitch=t.DepthLimitedBlurShader=t.CopyShader=t.ConvolutionShader=t.ColorifyShader=t.ColorCorrectionShader=t.BrightnessContrastShader=t.BokehShader2=t.BokehShader=t.BlurShaderUtils=t.BlendShader=t.BleachBypassShader=t.BasicShader=void 0;var a=Q(r(113)),n=Q(r(114)),i=Q(r(115)),o=Q(r(22)),s=Q(r(14)),l=Q(r(116)),u=Q(r(117)),c=Q(r(118)),f=Q(r(119)),h=Q(r(13)),d=Q(r(2)),p=Q(r(20)),m=Q(r(17)),v=Q(r(120)),g=Q(r(15)),y=Q(r(16)),b=Q(r(121)),w=Q(r(122)),x=Q(r(123)),_=Q(r(124)),A=Q(r(125)),E=Q(r(18)),S=Q(r(126)),M=Q(r(127)),T=Q(r(128)),P=Q(r(129)),F=Q(r(26)),O=Q(r(11)),L=Q(r(130)),C=Q(r(131)),k=(Q(r(132)),Q(r(133))),R=Q(r(134)),I=Q(r(135)),N=Q(r(19)),D=Q(r(136)),U=Q(r(23)),j=Q(r(137)),B=Q(r(25)),V=Q(r(138)),z=Q(r(12)),G=Q(r(139)),H=Q(r(21)),X=Q(r(140)),Y=Q(r(141)),W=Q(r(142)),q=Q(r(143));function Q(e){return e&&e.__esModule?e:{default:e}}t.BasicShader=a.default,t.BleachBypassShader=n.default,t.BlendShader=i.default,t.BlurShaderUtils=o.default,t.BokehShader=s.default,t.BokehShader2=l.default,t.BrightnessContrastShader=u.default,t.ColorCorrectionShader=c.default,t.ColorifyShader=f.default,t.ConvolutionShader=h.default,t.CopyShader=d.default,t.DepthLimitedBlurShader=p.default,t.DigitalGlitch=m.default,t.DOFMipMapShader=v.default,t.DotScreenShader=g.default,t.FilmShader=y.default,t.FocusShader=b.default,t.FreiChenShader=w.default,t.FresnelShader=x.default,t.FXAAShader=_.default,t.GammaCorrectionShader=A.default,t.HalftoneShader=E.default,t.HorizontalBlurShader=S.default,t.HorizontalTiltShiftShader=M.default,t.HueSaturationShader=T.default,t.KaleidoShader=P.default,t.LuminosityHighPassShader=F.default,t.LuminosityShader=O.default,t.MirrorShader=L.default,t.NormalMapShader=C.default,t.ParallaxShader=k.default,t.PixelShader=R.default,t.RGBShiftShader=I.default,t.SAOShader=N.default,t.SepiaShader=D.default,t.SMAAShader=U.default,t.SobelOperatorShader=j.default,t.SSAOShader=B.default,t.TechnicolorShader=V.default,t.ToneMapShader=z.default,t.TriangleBlurShader=G.default,t.UnpackDepthRGBAShader=H.default,t.VerticalBlurShader=X.default,t.VerticalTiltShiftShader=Y.default,t.VignetteShader=W.default,t.WaterRefractionShader=q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","vec4 texel1 = texture2D( tDiffuse1, vUv );","vec4 texel2 = texture2D( tDiffuse2, vUv );","gl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float penta(vec2 coords) {","//pentagonal shape","float scale = float(rings) - 1.3;","vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","vec4 one = vec4( 1.0 );","vec4 P = vec4((coords),vec2(scale, scale));","vec4 dist = vec4(0.0);","float inorout = -4.0;","dist.x = dot( P, HS0 );","dist.y = dot( P, HS1 );","dist.z = dot( P, HS2 );","dist.w = dot( P, HS3 );","dist = smoothstep( -feather, feather, dist );","inorout += dot( dist, one );","dist.x = dot( P, HS4 );","dist.y = HS5.w - abs( P.z );","dist = smoothstep( -feather, feather, dist );","inorout += dist.x;","return clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","// Depth buffer blur","float d = 0.0;","float kernel[9];","vec2 offset[9];","vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","offset[0] = vec2(-wh.x,-wh.y);","offset[1] = vec2( 0.0, -wh.y);","offset[2] = vec2( wh.x -wh.y);","offset[3] = vec2(-wh.x, 0.0);","offset[4] = vec2( 0.0, 0.0);","offset[5] = vec2( wh.x, 0.0);","offset[6] = vec2(-wh.x, wh.y);","offset[7] = vec2( 0.0, wh.y);","offset[8] = vec2( wh.x, wh.y);","kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","for( int i=0; i<9; i++ ) {","float tmp = getDepth( coords + offset[ i ] );","d += tmp * kernel[i];","}","return d;","}","vec3 color(vec2 coords,float blur) {","//processing the sample","vec3 col = vec3(0.0);","vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","vec3 lumcoeff = vec3(0.299,0.587,0.114);","float lum = dot(col.rgb, lumcoeff);","float thresh = max((lum-threshold)*gain, 0.0);","return col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","float edge = 0.002*depth; //distance based edge smoothing","float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","return col;","}","float linearize(float depth) {","return -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","float dist = distance(vUv.xy, vec2(0.5,0.5));","dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","return clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","float rings2 = float(rings);","float step = PI*2.0 / float(ringsamples);","float pw = cos(j*step)*i;","float ph = sin(j*step)*i;","float p = 1.0;","if (pentagon) {","p = penta(vec2(pw,ph));","}","col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","return 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","//scene depth calculation","float depth = linearize( getDepth( vUv.xy ) );","// Blur depth?","if (depthblur) {","depth = linearize(bdepth(vUv.xy));","}","//focal plane calculation","float fDepth = focalDepth;","if (shaderFocus) {","fDepth = linearize( getDepth( focusCoords ) );","}","// dof blur factor calculation","float blur = 0.0;","if (manualdof) {","float a = depth-fDepth; // Focal plane","float b = (a-fdofstart)/fdofdist; // Far DoF","float c = (-a-ndofstart)/ndofdist; // Near Dof","blur = (a>0.0) ? b : c;","} else {","float f = focalLength; // focal length in mm","float d = fDepth*1000.0; // focal plane in mm","float o = depth*1000.0; // depth in mm","float a = (o*f)/(o-f);","float b = (d*f)/(d-f);","float c = (d-f)/(d*fstop*CoC);","blur = abs(a-b)*c;","}","blur = clamp(blur,0.0,1.0);","// calculation of pattern for dithering","vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","// getting blur x and y step factor","float w = (1.0/textureWidth)*blur*maxblur+noise.x;","float h = (1.0/textureHeight)*blur*maxblur+noise.y;","// calculation of final color","vec3 col = vec3(0.0);","if(blur < 0.05) {","//some optimization thingy","col = texture2D(tColor, vUv.xy).rgb;","} else {","col = texture2D(tColor, vUv.xy).rgb;","float s = 1.0;","int ringsamples;","for (int i = 1; i <= rings; i++) {","/*unboxstart*/","ringsamples = i * samples;","for (int j = 0 ; j < maxringsamples ; j++) {","if (j >= ringsamples) break;","s += gather(float(i), float(j), ringsamples, col, w, h, blur);","}","/*unboxend*/","}","col /= s; //divide by sample count","}","if (showFocus) {","col = debugFocus(col, blur, depth);","}","if (vignetting) {","col *= vignette();","}","gl_FragColor.rgb = col;","gl_FragColor.a = 1.0;","} "].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},powRGB:{value:new a.Vector3(2,2,2)},mulRGB:{value:new a.Vector3(1,1,1)},addRGB:{value:new a.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},color:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},aspect:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","G[0] = g0,","G[1] = g1,","G[2] = g2,","G[3] = g3,","G[4] = g4,","G[5] = g5,","G[6] = g6,","G[7] = g7,","G[8] = g8;","mat3 I;","float cnv[9];","vec3 sample;","for (float i=0.0; i<3.0; i++) {","for (float j=0.0; j<3.0; j++) {","sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","I[int(i)][int(j)] = length(sample);","}","}","for (int i=0; i<9; i++) {","float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","cnv[i] = dp3 * dp3;","}","float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","vec3 I = worldPosition.xyz - cameraPosition;","vReflect = reflect( I, worldNormal );","vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","vec4 refractedColor = vec4( 1.0 );","refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immedates."," // Immedates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","gl_FragColor = LinearToGamma( tex, float( GAMMA_FACTOR ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 p = vUv - 0.5;","float r = length(p);","float a = atan(p.y, p.x) + angle;","float tau = 2. * 3.1416 ;","a = mod(a, tau/sides);","a = abs(a - tau/sides/2.) ;","p = r * vec2(cos(a), sin(a));","vec4 color = texture2D(tDiffuse, p + 0.5);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","vec2 p = vUv;","if (side == 0){","if (p.x > 0.5) p.x = 1.0 - p.x;","}else if (side == 1){","if (p.x < 0.5) p.x = 1.0 - p.x;","}else if (side == 2){","if (p.y < 0.5) p.y = 1.0 - p.y;","}else if (side == 3){","if (p.y > 0.5) p.y = 1.0 - p.y;","} ","vec4 color = texture2D(tDiffuse, p);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{heightMap:{value:null},resolution:{value:new a.Vector2(512,512)},scale:{value:new a.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));a.ShaderLib.ocean_sim_vertex={vertexShader:["varying vec2 vUV;","void main (void) {","vUV = position.xy * 0.5 + 0.5;","gl_Position = vec4(position, 1.0 );","}"].join("\n")},a.ShaderLib.ocean_subtransform={uniforms:{u_input:{value:null},u_transformSize:{value:512},u_subtransformSize:{value:250}},fragmentShader:["precision highp float;","#include ","uniform sampler2D u_input;","uniform float u_transformSize;","uniform float u_subtransformSize;","varying vec2 vUV;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","void main (void) {","#ifdef HORIZONTAL","float index = vUV.x * u_transformSize - 0.5;","#else","float index = vUV.y * u_transformSize - 0.5;","#endif","float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);","#ifdef HORIZONTAL","vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","#else","vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;","#endif","float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);","vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));","vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);","vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);","gl_FragColor = vec4(outputA, outputB);","}"].join("\n")},a.ShaderLib.ocean_initial_spectrum={uniforms:{u_wind:{value:new a.Vector2(10,10)},u_resolution:{value:512},u_size:{value:250}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","const float CM = 0.23;","uniform vec2 u_wind;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + pow2(k / KM)));","}","float tanh (float x) {","return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 K = (2.0 * PI * vec2(n, m)) / u_size;","float k = length(K);","float l_wind = length(u_wind);","float Omega = 0.84;","float kp = G * pow2(Omega / l_wind);","float c = omega(k) / k;","float cp = omega(kp) / kp;","float Lpm = exp(-1.25 * pow2(kp / k));","float gamma = 1.7;","float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));","float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));","float Jp = pow(gamma, Gamma);","float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));","float alphap = 0.006 * sqrt(Omega);","float Bl = 0.5 * alphap * cp / c * Fp;","float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);","float uStar = 0.41 * l_wind / log(10.0 / z0);","float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));","float Fm = exp(-0.25 * pow2(k / KM - 1.0));","float Bh = 0.5 * alpham * CM / c * Fm * Lpm;","float a0 = log(2.0) / 4.0;","float am = 0.13 * uStar / CM;","float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));","float cosPhi = dot(normalize(u_wind), normalize(K));","float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));","float dk = 2.0 * PI / u_size;","float h = sqrt(S / 2.0) * dk;","if (K.x == 0.0 && K.y == 0.0) {","h = 0.0;","}","gl_FragColor = vec4(h, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_phase={uniforms:{u_phases:{value:null},u_deltaTime:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform sampler2D u_phases;","uniform float u_deltaTime;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","float deltaTime = 1.0 / 60.0;","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","float deltaPhase = omega(length(waveVector)) * u_deltaTime;","phase = mod(phase + deltaPhase, 2.0 * PI);","gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_spectrum={uniforms:{u_size:{value:null},u_resolution:{value:null},u_choppiness:{value:null},u_phases:{value:null},u_initialSpectrum:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform float u_size;","uniform float u_resolution;","uniform float u_choppiness;","uniform sampler2D u_phases;","uniform sampler2D u_initialSpectrum;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","vec2 multiplyByI (vec2 z) {","return vec2(-z[1], z[0]);","}","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","vec2 phaseVector = vec2(cos(phase), sin(phase));","vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;","vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;","h0Star.y *= -1.0;","vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));","vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;","vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;","if (waveVector.x == 0.0 && waveVector.y == 0.0) {","h = vec2(0.0);","hX = vec2(0.0);","hZ = vec2(0.0);","}","gl_FragColor = vec4(hX + multiplyByI(h), hZ);","}"].join("\n")},a.ShaderLib.ocean_normals={uniforms:{u_displacementMap:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform float u_resolution;","uniform float u_size;","void main (void) {","float texel = 1.0 / u_resolution;","float texelSize = u_size / u_resolution;","vec3 center = texture2D(u_displacementMap, vUV).rgb;","vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;","vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;","vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;","vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;","vec3 topRight = cross(right, top);","vec3 topLeft = cross(top, left);","vec3 bottomLeft = cross(left, bottom);","vec3 bottomRight = cross(bottom, right);","gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);","}"].join("\n")},a.ShaderLib.ocean_main={uniforms:{u_displacementMap:{value:null},u_normalMap:{value:null},u_geometrySize:{value:null},u_size:{value:null},u_projectionMatrix:{value:null},u_viewMatrix:{value:null},u_cameraPosition:{value:null},u_skyColor:{value:null},u_oceanColor:{value:null},u_sunDirection:{value:null},u_exposure:{value:null}},vertexShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform mat4 u_projectionMatrix;","uniform mat4 u_viewMatrix;","uniform float u_size;","uniform float u_geometrySize;","uniform sampler2D u_displacementMap;","void main (void) {","vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);","vPos = newPos;","vUV = uv;","gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);","}"].join("\n"),fragmentShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform sampler2D u_normalMap;","uniform vec3 u_cameraPosition;","uniform vec3 u_oceanColor;","uniform vec3 u_skyColor;","uniform vec3 u_sunDirection;","uniform float u_exposure;","vec3 hdr (vec3 color, float exposure) {","return 1.0 - exp(-color * exposure);","}","void main (void) {","vec3 normal = texture2D(u_normalMap, vUV).rgb;","vec3 view = normalize(u_cameraPosition - vPos);","float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);","vec3 sky = fresnel * u_skyColor;","float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);","vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;","vec3 color = sky + water;","gl_FragColor = vec4(hdr(color, u_exposure), 1.0);","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","vUv = uv;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vViewPosition = -mvPosition.xyz;","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","vec2 parallaxMap( in vec3 V ) {","float initialHeight = texture2D( bumpMap, vUv ).r;","vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","return vUv - texCoordOffset;","}","#else","vec2 parallaxMap( in vec3 V ) {","float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","float layerHeight = 1.0 / numLayers;","float currentLayerHeight = 0.0;","vec2 dtex = parallaxScale * V.xy / V.z / numLayers;","vec2 currentTextureCoords = vUv;","float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","for ( int i = 0; i < 30; i += 1 ) {","if ( heightFromTexture <= currentLayerHeight ) {","break;","}","currentLayerHeight += layerHeight;","currentTextureCoords -= dtex;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","}","#ifdef USE_STEEP_PARALLAX","return currentTextureCoords;","#elif defined( USE_RELIEF_PARALLAX )","vec2 deltaTexCoord = dtex / 2.0;","float deltaHeight = layerHeight / 2.0;","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","const int numSearches = 5;","for ( int i = 0; i < numSearches; i += 1 ) {","deltaTexCoord /= 2.0;","deltaHeight /= 2.0;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","if( heightFromTexture > currentLayerHeight ) {","currentTextureCoords -= deltaTexCoord;","currentLayerHeight += deltaHeight;","} else {","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","}","}","return currentTextureCoords;","#elif defined( USE_OCLUSION_PARALLAX )","vec2 prevTCoords = currentTextureCoords + dtex;","float nextH = heightFromTexture - currentLayerHeight;","float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","float weight = nextH / ( nextH - prevH );","return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","#else","return vUv;","#endif","}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","vec2 texDx = dFdx( vUv );","vec2 texDy = dFdy( vUv );","vec3 vSigmaX = dFdx( surfPosition );","vec3 vSigmaY = dFdy( surfPosition );","vec3 vR1 = cross( vSigmaY, surfNormal );","vec3 vR2 = cross( surfNormal, vSigmaX );","float fDet = dot( vSigmaX, vR1 );","vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","vec3 vProjVtex;","vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","vProjVtex.z = dot( surfNormal, viewPosition );","return parallaxMap( vProjVtex );","}","void main() {","vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","gl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, vUv + offset);","vec4 cga = texture2D(tDiffuse, vUv);","vec4 cb = texture2D(tDiffuse, vUv - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","gl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","gl_FragColor = newTex;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{texture:{value:null},delta:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = rand( vUv );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{color:{type:"c",value:null},time:{type:"f",value:0},tDiffuse:{type:"t",value:null},tDudv:{type:"t",value:null},textureMatrix:{type:"m4",value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Volume=void 0;var a,n=r(10),i=(a=n)&&a.__esModule?a:{default:a};t.Volume=i.default}]))},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,a,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,a)}));case 4:return t.nextTick((function(){e.call(null,r,a,n)}));default:for(i=new Array(s-1),o=0;o>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return n>0&&(e.lastNeed=n-1),n;if(--a=0)return n>0&&(e.lastNeed=n-2),n;if(--a=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";(function(t){var a=r(120); /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */function n(e,t){if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);n=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(e[s],t[s],r,a))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function x(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,a){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(a=r,r=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),a=(r&&r.name?" ("+r.name+").":".")+(a?" "+a:"."),e&&!n&&g(n,r,"Missing expected exception"+a);var i="string"==typeof a,s=!e&&n&&!r;if((!e&&o.isError(n)&&i&&x(n,r)||s)&&g(n,r,"Got unwanted exception"+a),e&&n&&r&&!x(n,r)||!e&&n)throw n}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(v(e.actual),128)+" "+e.operator+" "+m(v(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var a=r.stack,n=p(t),i=a.indexOf("\n"+n);if(i>=0){var o=a.indexOf("\n",i+1);a=a.substring(o+1)}this.stack=a}}},o.inherits(h.AssertionError,Error),h.fail=g,h.ok=y,h.equal=function(e,t,r){e!=t&&g(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){b(e,t,!1)||g(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){b(e,t,!0)||g(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){b(e,t,!1)&&g(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,a){b(t,r,!0)&&g(t,r,a,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){_(!0,e,t,r)},h.doesNotThrow=function(e,t,r){_(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=a((function e(t,r){t||g(t,!0,r,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var A=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(29);Object.defineProperty(t,"CopyShader",{enumerable:!0,get:function(){return d(a).default}});var n=r(9);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return d(n).default}});var i=r(45);Object.defineProperty(t,"ShaderPass",{enumerable:!0,get:function(){return d(i).default}});var o=r(80);Object.defineProperty(t,"RenderingPass",{enumerable:!0,get:function(){return d(o).default}});var s=r(81);Object.defineProperty(t,"TexturePass",{enumerable:!0,get:function(){return d(s).default}});var l=r(82);Object.defineProperty(t,"RenderPass",{enumerable:!0,get:function(){return d(l).default}});var u=r(46);Object.defineProperty(t,"MaskPass",{enumerable:!0,get:function(){return d(u).default}});var c=r(47);Object.defineProperty(t,"ClearMaskPass",{enumerable:!0,get:function(){return d(c).default}});var f=r(83);Object.defineProperty(t,"ClearPass",{enumerable:!0,get:function(){return d(f).default}});var h=r(84);function d(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"default",{enumerable:!0,get:function(){return d(h).default}})},function(e,t,r){var a,n,i,o,s;a=r(180),n=r(76).utf8,i=r(181),o=r(76).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):n.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var r=a.bytesToWords(e),l=8*e.length,u=1732584193,c=-271733879,f=-1732584194,h=271733878,d=0;d>>24)|4278255360&(r[d]<<24|r[d]>>>8);r[l>>>5]|=128<>>9<<4)]=l;var p=s._ff,m=s._gg,v=s._hh,g=s._ii;for(d=0;d>>0,c=c+b>>>0,f=f+w>>>0,h=h+x>>>0}return a.endian([u,c,f,h])})._ff=function(e,t,r,a,n,i,o){var s=e+(t&r|~t&a)+(n>>>0)+o;return(s<>>32-i)+t},s._gg=function(e,t,r,a,n,i,o){var s=e+(t&a|r&~a)+(n>>>0)+o;return(s<>>32-i)+t},s._hh=function(e,t,r,a,n,i,o){var s=e+(t^r^a)+(n>>>0)+o;return(s<>>32-i)+t},s._ii=function(e,t,r,a,n,i,o){var s=e+(r^(t|~a))+(n>>>0)+o;return(s<>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=a.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?o.bytesToString(r):a.bytesToHex(r)}},function(e,t,r){function a(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var a=r(r.s=ENTRY_MODULE);return a.default||a}var n="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+n+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e,t,a){var s={};s[a]=[];var l=t.toString(),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return s;for(var c,f=u[1],h=new RegExp("(\\\\n|\\W)"+o(f)+i,"g");c=h.exec(l);)"dll-reference"!==c[3]&&s[a].push(c[3]);for(h=new RegExp("\\("+o(f)+'\\("(dll-reference\\s('+n+'))"\\)\\)'+i,"g");c=h.exec(l);)e[c[2]]||(s[a].push(c[1]),e[c[2]]=r(c[1]).m),s[c[2]]=s[c[2]]||[],s[c[2]].push(c[4]);for(var d,p=Object.keys(s),m=0;m0}),!1)}e.exports=function(e,t){t=t||{};var n={main:r.m},i=t.all?{main:Object.keys(n.main)}:function(e,t){for(var r={main:[t]},a={main:[]},n={main:{}};l(r);)for(var i=Object.keys(r),o=0;o-1?a:i.nextTick;y.WritableState=g;var u=r(19);u.inherits=r(6);var c={deprecate:r(57)},f=r(55),h=r(23).Buffer,d=n.Uint8Array||function(){};var p,m=r(56);function v(){}function g(e,t){s=s||r(13),e=e||{};var a=t instanceof s;this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:a&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,a=r.sync,n=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,a,n){--t.pendingcb,r?(i.nextTick(n,a),i.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",a)):(n(a),e._writableState.errorEmitted=!0,e.emit("error",a),E(e,t))}(e,r,a,t,n);else{var o=_(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),a?l(w,e,r,o,n):w(e,r,o,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(s=s||r(13),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,r,a,n,i,o){t.writelen=a,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,i,t.onwrite),t.sync=!1}function w(e,t,r,a){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,a(),E(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var a=t.bufferedRequestCount,n=new Array(a),i=t.corkedRequestsFree;i.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,b(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),E(e,t)}))}function E(e,t){var r=_(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(A,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(y,f),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var a,n=this._writableState,o=!1,s=!n.objectMode&&(a=e,h.isBuffer(a)||a instanceof d);return s&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}(this,r):(s||function(e,t,r,a){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),i.nextTick(a,o),n=!1),n}(this,n,e,r))&&(n.pendingcb++,o=function(e,t,r,a,n,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r));return t}(t,a,n);a!==o&&(r=!0,n="buffer",a=o)}var s=t.objectMode?1:a.length;t.length+=s;var l=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var a=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||a.finished||function(e,t,r){t.ending=!0,E(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,a,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(5),r(109).setImmediate,r(4))},function(e,t,r){"use strict";var a=r(128),n=r(36),i=r(15),o=r(60),s=r(130);function l(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof o)return p(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var n,i,s,c=u.call(this,t,r);return c&&(n=c.schema,t=c.root,s=c.baseId),n instanceof o?i=n.validate||e.call(this,n.schema,t,void 0,s):void 0!==n&&(i=p(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,s)),i}function u(e,t){var r=a.parse(t),n=v(r),i=m(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==i){var s=y(n),l=this._refs[s];if("string"==typeof l)return c.call(this,e,l,r);if(l instanceof o)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[s])instanceof o))return;if(l.validate||this._compile(l),s==y(t))return{schema:l,root:e,baseId:i};e=l}if(!e.schema)return;i=m(this._getId(e.schema))}return h.call(this,r,i,e.schema,e)}function c(e,t,r){var a=u.call(this,e,t);if(a){var n=a.schema,i=a.baseId;e=a.root;var o=this._getId(n);return o&&(i=b(i,o)),h.call(this,r,i,n,e)}}e.exports=l,l.normalizeId=y,l.fullPath=m,l.url=b,l.ids=function(e){var t=y(this._getId(e)),r={"":t},o={"":m(t,!1)},l={},u=this;return s(e,{allKeys:!0},(function(e,t,s,c,f,h,d){if(""!==t){var p=u._getId(e),m=r[c],v=o[c]+"/"+f;if(void 0!==d&&(v+="/"+("number"==typeof d?d:i.escapeFragment(d))),"string"==typeof p){p=m=y(m?a.resolve(m,p):p);var g=u._refs[p];if("string"==typeof g&&(g=u._refs[g]),g&&g.schema){if(!n(e,g.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=y(v))if("#"==p[0]){if(l[p]&&!n(e,l[p]))throw new Error('id "'+p+'" resolves to more than one schema');l[p]=e}else u._refs[p]=v}r[t]=m,o[t]=v}})),l},l.inlineRef=p,l.schema=u;var f=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var n=e.fragment.split("/"),o=1;o{if(e.file){let r=new FileReader;r.onload=function(){let e=this.result,r=new Uint8Array(e);t(r)},r.readAsArrayBuffer(e.file)}else if(e.url){let r=new XMLHttpRequest;r.open("GET",e.url,!0),r.responseType="arraybuffer",r.onloadend=function(){if(200===r.status){let e=new Uint8Array(r.response||r.responseText);t(e)}},r.send()}else e.raw?e.raw instanceof Uint8Array?t(e.raw):t(new Uint8Array(e.raw)):r()})}function o(e,t){return new Promise((r,a)=>{if("compound"===e.type)if(e.value.hasOwnProperty("blocks")&&(e.value.hasOwnProperty("palette")||e.value.hasOwnProperty("palettes"))){let a;if(e.value.hasOwnProperty("palette"))a=e.value.palette.value.value;else{if(void 0===t&&(t=0),t>=e.value.palettes.value.value.length||!e.value.palettes.value.value[t])return void console.warn("Specified palette index ("+t+") is outside of available palettes ("+e.value.palettes.value.value.length+")");a=e.value.palettes.value.value[t].value}let n=[];for(let e=0;e{let n=e.value.Width.value,i=e.value.Height.value,o=e.value.Length.value,s=function(t,r,a){let i=(r*o+a)*n+t;return{id:255&(e.value.Blocks.value[i]||0),data:e.value.Data.value[i]||0}},l=function(e,r){let a=t.blocks[e+":"+r];return a||(console.warn("Missing legacy mapping for "+e+":"+r),"minecraft:air")},u=[];for(let e=0;e{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);o(r).then(e=>{t(e)})})})},n.prototype.schematicToModels=function(e,t){i(e).then(e=>{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);let a=new XMLHttpRequest;a.open("GET","https://minerender.org/res/idsToNames.json",!0),a.onloadend=function(){if(200===a.status){console.log(a.response||a.responseText);let e=JSON.parse(a.response||a.responseText);s(r,e).then(e=>t(e))}},a.send()})})},n.loadNBT=i,n.parseStructureData=o,n.parseSchematicData=s;let l={stained_glass:function(e){return e.color.value+"_stained_glass"},planks:function(e){return e.variant.value+"_planks"}};n.prototype.constructor=n,window.ModelConverter=n,t.a=n},function(e,t,r){const a=r(102),n=r(119).ProtoDef,i=r(178).compound,o=JSON.stringify(r(179)),s=o.replace(/(i[0-9]+)/g,"l$1");function l(e){const t=new n;return t.addType("compound",i),t.addTypes(JSON.parse(e?s:o)),t}const u=l(!1),c=l(!0);function f(e,t){return(t?c:u).parsePacketBuffer("nbt",e).data}const h=function(e){let t=!0;return 31!==e[0]&&(t=!1),139!==e[1]&&(t=!1),t};e.exports={writeUncompressed:function(e,t){return(t?c:u).createPacketBuffer("nbt",e)},parseUncompressed:f,simplify:function e(t){return function t(r,a){return"compound"===a?Object.keys(r).reduce((function(t,a){return t[a]=e(r[a]),t}),{}):"list"===a?r.value.map((function(e){return t(e,r.type)})):r}(t.value,t.type)},parse:function(e,t,r){let n=!1;"function"==typeof t?r=t:n=t,h(e)?a.gunzip(e,(function(t,a){t?r(t,e):r(null,f(a,n))})):r(null,f(e,n))},proto:u,protoLE:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(){function e(e,t){for(var r=0;r4?9:0)}function $(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ae(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ne(e,t){var r,a,n=e.max_chain_length,i=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-D?e.strstart-(e.w_size-D):0,u=e.window,c=e.w_mask,f=e.prev,h=e.strstart+N,d=u[i+o-1],p=u[i+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===d&&u[r]===u[i]&&u[++r]===u[i+1]){i+=2,r++;do{}while(u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&io){if(e.match_start=t,o=a,a>=s)break;d=u[i+o-1],p=u[i+o]}}}while((t=f[t&c])>l&&0!=--n);return o<=e.lookahead?o:e.lookahead}function ie(e){var t,r,a,i,l,u,c,f,h,d,p=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-D)){n.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;do{a=e.head[--t],e.head[t]=a>=p?a-p:0}while(--r);t=r=p;do{a=e.prev[--t],e.prev[t]=a>=p?a-p:0}while(--r);i+=p}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,f=e.strstart+e.lookahead,h=i,d=void 0,(d=u.avail_in)>h&&(d=h),r=0===d?0:(u.avail_in-=d,n.arraySet(c,u.input,u.next_in,d,f),1===u.state.wrap?u.adler=o(u.adler,c,d,f):2===u.state.wrap&&(u.adler=s(u.adler,c,d,f)),u.next_in+=d,u.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=I)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I)if(a=i._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-I,a=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<15&&(s=2,a-=16),i<1||i>T||r!==M||a<8||a>15||t<0||t>9||o<0||o>A)return K(e,v);8===a&&(a=9);var l=new ue;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=a,l.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ie(e),0===e.lookahead&&t===u)return Y;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+r;if((0===e.strstart||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,te(e,!1),0===e.strm.avail_out))return Y;if(e.strstart-e.block_start>=e.w_size-D&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===h?(te(e,!0),0===e.strm.avail_out?q:Q):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),Y)})),new le(4,4,8,4,oe),new le(4,5,16,8,oe),new le(4,6,32,32,oe),new le(4,4,16,16,se),new le(8,16,32,32,se),new le(8,16,128,128,se),new le(8,32,128,256,se),new le(32,128,258,1024,se),new le(32,258,258,4096,se)],t.deflateInit=function(e,t){return he(e,t,M,P,F,E)},t.deflateInit2=he,t.deflateReset=fe,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?v:(e.state.gzhead=t,p):v},t.deflate=function(e,t){var r,n,o,l;if(!e||!e.state||t>d||t<0)return e?K(e,v):v;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===X&&t!==h)return K(e,0===e.avail_out?y:v);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===j)if(2===n.wrap)e.adler=0,re(n,31),re(n,139),re(n,8),n.gzhead?(re(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),re(n,255&n.gzhead.time),re(n,n.gzhead.time>>8&255),re(n,n.gzhead.time>>16&255),re(n,n.gzhead.time>>24&255),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(re(n,255&n.gzhead.extra.length),re(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=s(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=B):(re(n,0),re(n,0),re(n,0),re(n,0),re(n,0),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,Z),n.status=H);else{var g=M+(n.w_bits-8<<4)<<8;g|=(n.strategy>=x||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(g|=U),g+=31-g%31,n.status=H,ae(n,g),0!==n.strstart&&(ae(n,e.adler>>>16),ae(n,65535&e.adler)),e.adler=1}if(n.status===B)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending!==n.pending_buf_size));)re(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=V)}else n.status=V;if(n.status===V)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=z)}else n.status=z;if(n.status===z)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=G)}else n.status=G;if(n.status===G&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ee(e),n.pending+2<=n.pending_buf_size&&(re(n,255&e.adler),re(n,e.adler>>8&255),e.adler=0,n.status=H)):n.status=H),0!==n.pending){if(ee(e),0===e.avail_out)return n.last_flush=-1,p}else if(0===e.avail_in&&J(t)<=J(r)&&t!==h)return K(e,y);if(n.status===X&&0!==e.avail_in)return K(e,y);if(0!==e.avail_in||0!==n.lookahead||t!==u&&n.status!==X){var b=n.strategy===x?function(e,t){for(var r;;){if(0===e.lookahead&&(ie(e),0===e.lookahead)){if(t===u)return Y;break}if(e.match_length=0,r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===h?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):n.strategy===_?function(e,t){for(var r,a,n,o,s=e.window;;){if(e.lookahead<=N){if(ie(e),e.lookahead<=N&&t===u)return Y;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(a=s[n=e.strstart-1])===s[++n]&&a===s[++n]&&a===s[++n]){o=e.strstart+N;do{}while(a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&ne.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=i._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===h?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):a[n.level].func(n,t);if(b!==q&&b!==Q||(n.status=X),b===Y||b===q)return 0===e.avail_out&&(n.last_flush=-1),p;if(b===W&&(t===c?i._tr_align(n):t!==d&&(i._tr_stored_block(n,0,0,!1),t===f&&($(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),ee(e),0===e.avail_out))return n.last_flush=-1,p}return t!==h?p:n.wrap<=0?m:(2===n.wrap?(re(n,255&e.adler),re(n,e.adler>>8&255),re(n,e.adler>>16&255),re(n,e.adler>>24&255),re(n,255&e.total_in),re(n,e.total_in>>8&255),re(n,e.total_in>>16&255),re(n,e.total_in>>24&255)):(ae(n,e.adler>>>16),ae(n,65535&e.adler)),ee(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?p:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==j&&t!==B&&t!==V&&t!==z&&t!==G&&t!==H&&t!==X?K(e,v):(e.state=null,t===H?K(e,g):p):v},t.deflateSetDictionary=function(e,t){var r,a,i,s,l,u,c,f,h=t.length;if(!e||!e.state)return v;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==j||r.lookahead)return v;for(1===s&&(e.adler=o(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&($(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new n.Buf8(r.w_size),n.arraySet(f,t,h-r.w_size,r.w_size,0),t=f,h=r.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=h,e.next_in=0,e.input=t,ie(r);r.lookahead>=I;){a=r.strstart,i=r.lookahead-(I-1);do{r.ins_h=(r.ins_h<>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{i=i+(n=n+t[a++]|0)|0}while(--o);n%=65521,i%=65521}return n|i<<16|0}},function(e,t,r){"use strict";var a=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,n){var i=a,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}},function(e,t,r){"use strict";var a=r(10),n=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var o=new a.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&i||!e.subarray&&n))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var r="",o=0;o>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new a.Buf8(e.length),r=0,n=t.length;r4)u[a++]=65533,r+=i-1;else{for(n&=2===i?31:3===i?15:7;i>1&&r1?u[a++]=65533:n<65536?u[a++]=n:(n-=65536,u[a++]=55296|n>>10&1023,u[a++]=56320|1023&n)}return l(u,a)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+o[e[r]]>t?r:t}},function(e,t,r){"use strict";var a=r(10),n=r(49),i=r(50),o=r(99),s=r(100),l=0,u=1,c=2,f=4,h=5,d=6,p=0,m=1,v=2,g=-2,y=-3,b=-4,w=-5,x=8,_=1,A=2,E=3,S=4,M=5,T=6,P=7,F=8,O=9,L=10,C=11,k=12,R=13,I=14,N=15,D=16,U=17,j=18,B=19,V=20,z=21,G=22,H=23,X=24,Y=25,W=26,q=27,Q=28,Z=29,K=30,J=31,$=32,ee=852,te=592,re=15;function ae(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ne(){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 a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(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=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new a.Buf32(ee),t.distcode=t.distdyn=new a.Buf32(te),t.sane=1,t.back=-1,p):g}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):g}function se(e,t){var r,a;return e&&e.state?(a=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?g:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=r,a.wbits=t,oe(e))):g}function le(e,t){var r,a;return e?(a=new ne,e.state=a,a.window=null,(r=se(e,t))!==p&&(e.state=null),r):g}var ue,ce,fe=!0;function he(e){if(fe){var t;for(ue=new a.Buf32(512),ce=new a.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,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,ce,0,e.work,{bits:5}),fe=!1}e.lencode=ue,e.lenbits=9,e.distcode=ce,e.distbits=5}function de(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(a.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),a.arraySet(o.window,t,r-n,i,o.wnext),(n-=i)?(a.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=i(r.check,Te,2,0),se=0,le=0,r.mode=A;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=K;break}if((15&se)!==x){e.msg="unknown compression method",r.mode=K;break}if(le-=4,_e=8+(15&(se>>>=4)),0===r.wbits)r.wbits=_e;else if(_e>r.wbits){e.msg="invalid window size",r.mode=K;break}r.dmax=1<<_e,e.adler=r.check=1,r.mode=512&se?L:k,se=0,le=0;break;case A:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8&1),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=E;case E:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,Te[2]=se>>>16&255,Te[3]=se>>>24&255,r.check=i(r.check,Te,4,0)),se=0,le=0,r.mode=S;case S:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=M;case M:if(1024&r.flags){for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0}else r.head&&(r.head.extra=null);r.mode=T;case T:if(1024&r.flags&&((fe=r.length)>ie&&(fe=ie),fe&&(r.head&&(_e=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),a.arraySet(r.head.extra,ee,re,fe,_e)),512&r.flags&&(r.check=i(r.check,ee,fe,re)),ie-=fe,re+=fe,r.length-=fe),r.length))break e;r.length=0,r.mode=P;case P:if(2048&r.flags){if(0===ie)break e;fe=0;do{_e=ee[re+fe++],r.head&&_e&&r.length<65536&&(r.head.name+=String.fromCharCode(_e))}while(_e&&fe>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=k;break;case L:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>=7&le,le-=7&le,r.mode=q;break}for(;le<3;){if(0===ie)break e;ie--,se+=ee[re++]<>>=1)){case 0:r.mode=I;break;case 1:if(he(r),r.mode=V,t===d){se>>>=2,le-=2;break e}break;case 2:r.mode=U;break;case 3:e.msg="invalid block type",r.mode=K}se>>>=2,le-=2;break;case I:for(se>>>=7&le,le-=7≤le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=K;break}if(r.length=65535&se,se=0,le=0,r.mode=N,t===d)break e;case N:r.mode=D;case D:if(fe=r.length){if(fe>ie&&(fe=ie),fe>oe&&(fe=oe),0===fe)break e;a.arraySet(te,ee,re,fe,ne),ie-=fe,re+=fe,oe-=fe,ne+=fe,r.length-=fe;break}r.mode=k;break;case U:for(;le<14;){if(0===ie)break e;ie--,se+=ee[re++]<>>=5,le-=5,r.ndist=1+(31&se),se>>>=5,le-=5,r.ncode=4+(15&se),se>>>=4,le-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=K;break}r.have=0,r.mode=j;case j:for(;r.have>>=3,le-=3}for(;r.have<19;)r.lens[Pe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},Ae=s(l,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid code lengths set",r.mode=K;break}r.have=0,r.mode=B;case B:for(;r.have>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=ve,le-=ve,r.lens[r.have++]=ye;else{if(16===ye){for(Se=ve+2;le>>=ve,le-=ve,0===r.have){e.msg="invalid bit length repeat",r.mode=K;break}_e=r.lens[r.have-1],fe=3+(3&se),se>>>=2,le-=2}else if(17===ye){for(Se=ve+3;le>>=ve)),se>>>=3,le-=3}else{for(Se=ve+7;le>>=ve)),se>>>=7,le-=7}if(r.have+fe>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=K;break}for(;fe--;)r.lens[r.have++]=_e}}if(r.mode===K)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=K;break}if(r.lenbits=9,Ee={bits:r.lenbits},Ae=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid literal/lengths set",r.mode=K;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},Ae=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,Ae){e.msg="invalid distances set",r.mode=K;break}if(r.mode=V,t===d)break e;case V:r.mode=z;case z:if(ie>=6&&oe>=258){e.next_out=ne,e.avail_out=oe,e.next_in=re,e.avail_in=ie,r.hold=se,r.bits=le,o(e,ce),ne=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,ie=e.avail_in,se=r.hold,le=r.bits,r.mode===k&&(r.back=-1);break}for(r.back=0;ge=(Me=r.lencode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,r.length=ye,0===ge){r.mode=W;break}if(32&ge){r.back=-1,r.mode=k;break}if(64&ge){e.msg="invalid literal/length code",r.mode=K;break}r.extra=15&ge,r.mode=G;case G:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=H;case H:for(;ge=(Me=r.distcode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,64&ge){e.msg="invalid distance code",r.mode=K;break}r.offset=ye,r.extra=15&ge,r.mode=X;case X:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=K;break}r.mode=Y;case Y:if(0===oe)break e;if(fe=ce-oe,r.offset>fe){if((fe=r.offset-fe)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=K;break}fe>r.wnext?(fe-=r.wnext,pe=r.wsize-fe):pe=r.wnext-fe,fe>r.length&&(fe=r.length),me=r.window}else me=te,pe=ne-r.offset,fe=r.length;fe>oe&&(fe=oe),oe-=fe,r.length-=fe;do{te[ne++]=me[pe++]}while(--fe);0===r.length&&(r.mode=z);break;case W:if(0===oe)break e;te[ne++]=r.length,oe--,r.mode=z;break;case q:if(r.wrap){for(;le<32;){if(0===ie)break e;ie--,se|=ee[re++]<0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),a?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?x(e,o,t,!1):M(e,o)):x(e,o,t,!1))):a||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(S,e):S(e))}function S(e){d("emit readable"),e.emit("readable"),O(e)}function M(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var a;ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++a}return t.length-=a,n}(e,t):function(e,t){var r=u.allocUnsafe(e),a=t.head,n=1;a.data.copy(r),e-=a.data.length;for(;a=a.next;){var i=a.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++n,a.next?t.head=a.next:t.head=t.tail=null):(t.head=a,a.data=i.slice(o));break}++n}return t.length-=n,r}(e,t);return a}(e,t.buffer,t.decoder),r);var r}function C(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(k,t,e))}function k(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var r=0,a=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):E(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&C(this),null;var a,n=t.needReadable;return d("need readable",n),(0===t.length||t.length-e0?L(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&C(this)),null!==a&&this.emit("data",a),a},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var l=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?c:b;function u(t,a){d("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,d("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",v),e.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",b),r.removeListener("data",m),h=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){d("onend"),e.end()}i.endEmitted?n.nextTick(l):r.once("end",l),e.on("unpipe",u);var f=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",f);var h=!1;var p=!1;function m(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==R(i.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(t){d("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){d("onfinish"),e.removeListener("close",g),b()}function b(){d("unpipe"),r.unpipe(e)}return r.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",r),i.flowing||(d("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i=i)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(e){return"[Circular]"}default:return e}})),l=a[r];r=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),p(r)?a.showHidden=r:r&&t._extend(a,r),y(a.showHidden)&&(a.showHidden=!1),y(a.depth)&&(a.depth=2),y(a.colors)&&(a.colors=!1),y(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=l),c(a,e,a.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function c(e,r,a){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(a,e);return g(n)||(n=c(e,n,a)),n}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(A(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return f(r)}var u,w="",E=!1,S=["{","}"];(d(r)&&(E=!0,S=["[","]"]),A(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),x(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+f(r)),0!==o.length||E&&0!=r.length?a<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=E?function(e,t,r,a,n){for(var i=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,w,S)):S[0]+w+S[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,a,n,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),P(a,n)||(o="["+n+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(i&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function d(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===E(e)}function _(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function A(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(y(i)&&(i=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var a=e.pid;o[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,a,e)}}else o[r]=function(){};return o[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=b,t.isObject=w,t.isDate=x,t.isError=_,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(118);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(6),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),a=r.length;a--;)e[r[a]]=t[r[a]];return e};var F="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(F&&e[F]){var t;if("function"!=typeof(t=e[F]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,F,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,a=new Promise((function(e,a){t=e,r=a})),n=[],i=0;i",y=d?">":"<",b=void 0;if(v){var w=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+i,_="exclType"+i,A="exclIsNumber"+i,E="' + "+(T="op"+i)+" + '";n+=" var schemaExcl"+i+" = "+w+"; ",n+=" var "+x+"; var "+_+" = typeof "+(w="schemaExcl"+i)+"; if ("+_+" != 'boolean' && "+_+" != 'undefined' && "+_+" != 'number') { ";var S;b=p;(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var M=n;n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+_+" == 'number' ? ( ("+x+" = "+a+" === undefined || "+w+" "+g+"= "+a+") ? "+f+" "+y+"= "+w+" : "+f+" "+y+" "+a+" ) : ( ("+x+" = "+w+" === true) ? "+f+" "+y+"= "+a+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { var op"+i+" = "+x+" ? '"+g+"' : '"+g+"='; ",void 0===s&&(b=p,u=e.errSchemaPath+"/"+p,a=w,h=v)}else{E=g;if((A="number"==typeof m)&&h){var T="'"+E+"'";n+=" if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" ( "+a+" === undefined || "+m+" "+g+"= "+a+" ? "+f+" "+y+"= "+m+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { "}else{A&&void 0===s?(x=!0,b=p,u=e.errSchemaPath+"/"+p,a=m,y+="="):(A&&(a=Math[d?"min":"max"](m,s)),m===(!A||a)?(x=!0,b=p,u=e.errSchemaPath+"/"+p,y+="="):(x=!1,E+="="));T="'"+E+"'";n+=" if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+" "+y+" "+a+" || "+f+" !== "+f+") { "}}b=b||t,(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+T+", limit: "+a+", exclusive: "+x+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+E+" ",n+=h?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";M=n;return n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),h=e.opts.$data&&s&&s.$data;h?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+".length "+("maxItems"==t?">":"<")+" "+a+") { ";var d=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+a+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),h=e.opts.$data&&s&&s.$data;h?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s;var d="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?n+=" "+f+".length ":n+=" ucs2length("+f+") ",n+=" "+d+" "+a+") { ";var p=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+a+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),h=e.opts.$data&&s&&s.$data;h?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" Object.keys("+f+").length "+("maxProperties"==t?">":"<")+" "+a+") { ";var d=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+a+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},function(e){e.exports=JSON.parse('{"switch":{"title":"switch","type":"array","items":[{"enum":["switch"]},{"type":"object","properties":{"compareTo":{"$ref":"definitions#/definitions/contextualizedFieldName"},"compareToValue":{"type":"string"},"fields":{"type":"object","patternProperties":{"^[-a-zA-Z0-9 _:]+$":{"$ref":"dataType"}},"additionalProperties":false},"default":{"$ref":"dataType"}},"oneOf":[{"required":["compareTo","fields"]},{"required":["compareToValue","fields"]}],"additionalProperties":false}],"additionalItems":false},"option":{"title":"option","type":"array","items":[{"enum":["option"]},{"$ref":"dataType"}],"additionalItems":false}}')},function(e,t,r){"use strict";(function(t,a){var n;e.exports=S,S.ReadableState=E;r(18).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(70),s=r(7).Buffer,l=t.Uint8Array||function(){};var u,c=r(171);u=c&&c.debuglog?c.debuglog("stream"):function(){};var f,h,d,p=r(172),m=r(71),v=r(72).getHighWaterMark,g=r(16).codes,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,x=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6)(S,o);var _=m.errorOrDestroy,A=["error","close","destroy","pause","resume"];function E(e,t,a){n=n||r(17),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",a),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(24).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(17),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function M(e,t,r,a,n){u("readableAddChunk",t);var i,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}(e,o);else if(n||(i=function(e,t){var r;a=t,s.isBuffer(a)||a instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var a;return r}(o,t)),i)_(e,i);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),a)o.endEmitted?_(e,new x):T(e,o,t,!0);else if(o.ended)_(e,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):C(e,o)):T(e,o,t,!1)}else a||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,a.nextTick(L,e))}function L(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function C(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(k,e,t))}function k(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){u("readable nexttick read 0"),e.read(0)}function N(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,a.nextTick(B,t,e))}function B(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function V(e,t){for(var r=0,a=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=F(e,t))&&t.ended)return 0===t.length&&j(this),null;var a,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==a&&this.emit("data",a),a},S.prototype._read=function(e){_(this,new w("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?l:v;function s(t,a){u("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",v),r.removeListener("data",h),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){u("onend"),e.end()}n.endEmitted?a.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var f=!1;function h(t){u("ondata");var a=e.write(t);u("dest.write",a),!1===a&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!f&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){u("onerror",t),v(),e.removeListener("error",d),0===i(e,"error")&&_(e,t)}function p(){e.removeListener("finish",m),v()}function m(){u("onfinish"),e.removeListener("close",p),v()}function v(){u("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",p),e.once("finish",m),e.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?O(this):n.reading||a.nextTick(I,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&a.nextTick(R,this),r},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||a.nextTick(R,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(N,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(a=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,L(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=f.destroy,S.prototype._undestroy=f.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this,r(4),r(5))},function(e,t,r){"use strict";e.exports=c;var a=r(16).codes,n=a.ERR_METHOD_NOT_IMPLEMENTED,i=a.ERR_MULTIPLE_CALLBACK,o=a.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=a.ERR_TRANSFORM_WITH_LENGTH_0,l=r(17);function u(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(null===a)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),a(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{i=!0,o.needsUpdate=!0,u&&(u.needsUpdate=!0);let c=-1;32===o.image.height?c=0:64===o.image.height?c=1:console.error("Couldn't detect texture version. Invalid dimensions: "+o.image.width+"x"+o.image.height),console.log("Skin Texture Version: "+c),o.magFilter=t.NearestFilter,o.minFilter=t.NearestFilter,o.anisotropy=0,u&&(u.magFilter=t.NearestFilter,u.minFilter=t.NearestFilter,u.anisotropy=0,u.format=t.RGBFormat),32===o.image.height&&(o.format=t.RGBFormat),n.attached||n._scene?console.log("[SkinRender] is attached - skipping scene init"):super.initScene((function(){n.element.dispatchEvent(new CustomEvent("skinRender",{detail:{playerModel:n.playerModel}}))})),console.log("Slim: "+f);let h=function(e,r,n,i,o){console.log("capeType: "+o);let u=new t.Object3D;u.name="headGroup",u.position.x=0,u.position.y=28,u.position.z=0,u.translateOnAxis(new t.Vector3(0,1,0),-4);let c=s(e,8,8,8,a.a.head[n],i,"head");if(c.translateOnAxis(new t.Vector3(0,1,0),4),u.add(c),n>=1){let r=s(e,8.504,8.504,8.504,a.a.hat,i,"hat",!0);r.translateOnAxis(new t.Vector3(0,1,0),4),u.add(r)}let f=new t.Object3D;f.name="bodyGroup",f.position.x=0,f.position.y=18,f.position.z=0;let h=s(e,8,12,4,a.a.body[n],i,"body");if(f.add(h),n>=1){let t=s(e,8.504,12.504,4.504,a.a.jacket,i,"jacket",!0);f.add(t)}let d=new t.Object3D;d.name="leftArmGroup",d.position.x=i?-5.5:-6,d.position.y=18,d.position.z=0,d.translateOnAxis(new t.Vector3(0,1,0),4);let p=s(e,i?3:4,12,4,a.a.leftArm[n],i,"leftArm");if(p.translateOnAxis(new t.Vector3(0,1,0),-4),d.add(p),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.leftSleeve,i,"leftSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),d.add(r)}let m=new t.Object3D;m.name="rightArmGroup",m.position.x=i?5.5:6,m.position.y=18,m.position.z=0,m.translateOnAxis(new t.Vector3(0,1,0),4);let v=s(e,i?3:4,12,4,a.a.rightArm[n],i,"rightArm");if(v.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(v),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.rightSleeve,i,"rightSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(r)}let g=new t.Object3D;g.name="leftLegGroup",g.position.x=-2,g.position.y=6,g.position.z=0,g.translateOnAxis(new t.Vector3(0,1,0),4);let y=s(e,4,12,4,a.a.leftLeg[n],i,"leftLeg");if(y.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(y),n>=1){let r=s(e,4.504,12.504,4.504,a.a.leftTrousers,i,"leftTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(r)}let b=new t.Object3D;b.name="rightLegGroup",b.position.x=2,b.position.y=6,b.position.z=0,b.translateOnAxis(new t.Vector3(0,1,0),4);let w=s(e,4,12,4,a.a.rightLeg[n],i,"rightLeg");if(w.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(w),n>=1){let r=s(e,4.504,12.504,4.504,a.a.rightTrousers,i,"rightTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(r)}let x=new t.Object3D;if(x.add(u),x.add(f),x.add(d),x.add(m),x.add(g),x.add(b),r){console.log(a.a);let e=a.a.capeRelative;"optifine"===o&&(e=a.a.capeOptifineRelative),"labymod"===o&&(e=a.a.capeLabymodRelative),e=JSON.parse(JSON.stringify(e)),console.log(e);for(let t in e)e[t].x*=r.image.width,e[t].w*=r.image.width,e[t].y*=r.image.height,e[t].h*=r.image.height;console.log(e);let n=new t.Object3D;n.name="capeGroup",n.position.x=0,n.position.y=16,n.position.z=-2.5,n.translateOnAxis(new t.Vector3(0,1,0),8),n.translateOnAxis(new t.Vector3(0,0,1),.5);let i=s(r,10,16,1,e,!1,"cape");i.rotation.x=l(10),i.translateOnAxis(new t.Vector3(0,1,0),-8),i.translateOnAxis(new t.Vector3(0,0,1),-.5),i.rotation.y=l(180),n.add(i),x.add(n)}return x}(o,u,c,f,e._capeType?e._capeType:e.optifine?"optifine":"minecraft");n.addToScene(h),n.playerModel=h,"function"==typeof r&&r()};n._skinImage=new Image,n._skinImage.crossOrigin="anonymous",n._capeImage=new Image,n._capeImage.crossOrigin="anonymous";let c=void 0!==e.cape||void 0!==e.capeUrl||void 0!==e.capeData||void 0!==e.mineskin,f=!1,h=!1,d=!1,p=new t.Texture,m=new t.Texture;if(p.image=n._skinImage,n._skinImage.onload=function(){if(n._skinImage){if(h=!0,console.log("Skin Image Loaded"),void 0===e.slim&&32!==n._skinImage.height){let e=document.createElement("canvas"),t=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,t.drawImage(n._skinImage,0,0),console.log("Slim Detection:");let r=t.getImageData(46,52,1,12).data,a=t.getImageData(54,20,1,12).data,i=!0;for(let e=3;e<48;e+=4){if(255===r[e]){i=!1;break}if(255===a[e]){i=!1;break}}console.log(i),i&&(f=!0)}if(n.options.makeNonTransparentOpaque&&32!==n._skinImage.height){let e=document.createElement("canvas"),a=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,a.drawImage(n._skinImage,0,0);let i=document.createElement("canvas"),o=i.getContext("2d");i.width=n._skinImage.width,i.height=n._skinImage.height;let s=a.getImageData(0,0,e.width,e.height),l=s.data;function r(e,t){return e>0&&t>0&&e<32&&t<32||(e>32&&t>16&&e<64&&t<32||e>16&&t>48&&e<48&&t<64)}for(let t=0;t178||r(n,i))&&(l[t+3]=255)}o.putImageData(s,0,0),console.log(i.toDataURL()),p=new t.CanvasTexture(i)}!h||!d&&c||i||o(p,m)}},n._skinImage.onerror=function(e){console.warn("Skin Image Error"),console.warn(e)},console.log("Has Cape: "+c),c?(m.image=n._capeImage,n._capeImage.onload=function(){n._capeImage&&(d=!0,console.log("Cape Image Loaded"),d&&h&&(i||o(p,m)))},n._capeImage.onerror=function(e){console.warn("Cape Image Error"),console.warn(e),d=!0,h&&(i||o(p))}):(m=null,n._capeImage=null),"string"==typeof e)0===e.indexOf("http")?n._skinImage.src=e:e.length<=16?u("https://minerender.org/nameToUuid.php?name="+e,(function(t,r){if(t)return console.log(t);console.log(r),n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e)})):e.length<=36?image.src="https://crafatar.com/skins/"+e+"?overlay":n._skinImage.src=e;else{if("object"!=typeof e)throw new Error("Invalid texture value");if(e.url?n._skinImage.src=e.url:e.data?n._skinImage.src=e.data:e.username?u("https://minerender.org/nameToUuid.php?name="+e.username,(function(t,r){if(t)return console.log(t);n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e.username)+"?overlay"})):e.uuid?n._skinImage.src="https://crafatar.com/skins/"+e.uuid+"?overlay":e.mineskin&&(n._skinImage.src="https://api.mineskin.org/render/texture/"+e.mineskin),e.cape)if(e.cape.length>36){u(e.cape.startsWith("http")?e.cape:"https://api.capes.dev/get/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else{let t="https://api.capes.dev/load/";e.capeUser?t+=e.capeUser:e.username?t+=e.username:e.uuid?t+=e.uuid:console.warn("Couldn't find a user to get a cape from"),u(t+="/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else e.capeUrl?n._capeImage.src=e.capeUrl:e.capeData?n._capeImage.src=e.capeData:e.mineskin&&(n._capeImage.src="https://api.mineskin.org/render/texture/"+e.mineskin+"/cape");f=e.slim}}resize(e,t){return this._resize(e,t)}reset(){this._skinImage=null,this._capeImage=null,this._animId&&cancelAnimationFrame(this._animId),this._canvas&&this._canvas.remove()}getPlayerModel(){return this.playerModel}getModelByName(e){return this._scene.getObjectByName(e,!0)}toggleSkinPart(e,t){this._scene.getObjectByName(e,!0).visible=t}}function s(e,r,a,n,i,o,s,l){let u=e.image.width,c=e.image.height,f=new t.BoxGeometry(r,a,n),h=new t.MeshBasicMaterial({map:e,transparent:l||!1,alphaTest:.1,side:l?t.DoubleSide:t.FrontSide});f.computeBoundingBox(),f.faceVertexUvs[0]=[];let d=["right","left","top","bottom","front","back"],p=[];for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{tolerance:0};if(!e)throw new Error("You should specify the element you want to test");"string"==typeof e&&(e=document.querySelector(e));var r=e.getBoundingClientRect();return(r.bottom-t.tolerance>0&&r.right-t.tolerance>0&&r.left+t.tolerance<(window.innerWidth||document.documentElement.clientWidth)&&r.top+t.tolerance<(window.innerHeight||document.documentElement.clientHeight))}function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0,container:""};if(!e)throw new Error("You should specify the element you want to test");if("string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={tolerance:0,container:document.querySelector(t)}),"string"==typeof t.container&&(t.container=document.querySelector(t.container)),t instanceof HTMLElement&&(t={tolerance:0,container:t}),!t.container)throw new Error("You should specify a container element");var r=t.container.getBoundingClientRect();return(e.offsetTop+e.clientHeight-t.tolerance>t.container.scrollTop&&e.offsetLeft+e.clientWidth-t.tolerance>t.container.scrollLeft&&e.offsetLeft+t.tolerance0&&void 0!==arguments[0]?arguments[0]:{tolerance:0,debounce:100,container:window};this.options={},this.trackedElements={},Object.defineProperties(this.options,{container:{configurable:!1,enumerable:!1,get:function(){var e=void 0;return"string"==typeof n.container?e=document.querySelector(n.container):n.container instanceof HTMLElement&&(e=n.container),e||window},set:function(e){n.container=e}},debounce:{get:function(){return parseInt(n.debounce,10)||100},set:function(e){n.debounce=e}},tolerance:{get:function(){return parseInt(n.tolerance,10)||0},set:function(e){n.tolerance=e}}}),Object.defineProperty(this,"_scroll",{enumerable:!1,configurable:!1,writable:!1,value:this._debouncedScroll.call(this)}),e=document.querySelector("body"),t=function(){Object.keys(a.trackedElements).forEach((function(e){a.on("enter",e),a.on("leave",e)}))},(r=window.MutationObserver||window.WebKitMutationObserver)?new r(t).observe(e,{childList:!0,subtree:!0}):(e.addEventListener("DOMNodeInserted",t,!1),e.addEventListener("DOMNodeRemoved",t,!1)),this.attach()}return Object.defineProperties(r.prototype,{_debouncedScroll:{configurable:!1,writable:!1,enumerable:!1,value:function(){var r=this,a=void 0;return function(){clearTimeout(a),a=setTimeout((function(){!function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0},n=Object.keys(r),i=void 0;n.length&&(i=a.container===window?e:t,n.forEach((function(e){r[e].nodes.forEach((function(t){if(i(t.node,a)?(t.wasVisible=t.isVisible,t.isVisible=!0):(t.wasVisible=t.isVisible,t.isVisible=!1),!0===t.isVisible&&!1===t.wasVisible){if(!r[e].enter)return;Object.keys(r[e].enter).forEach((function(a){"function"==typeof r[e].enter[a]&&r[e].enter[a](t.node,"enter")}))}if(!1===t.isVisible&&!0===t.wasVisible){if(!r[e].leave)return;Object.keys(r[e].leave).forEach((function(a){"function"==typeof r[e].leave[a]&&r[e].leave[a](t.node,"leave")}))}}))})))}(r.trackedElements,r.options)}),r.options.debounce)}}},attach:{configurable:!1,writable:!1,enumerable:!1,value:function(){var e=this.options.container;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.addEventListener("scroll",this._scroll,{passive:!0}),window.addEventListener("resize",this._scroll,{passive:!0}),this._scroll(),this.attached=!0}},destroy:{configurable:!1,writable:!1,enumerable:!1,value:function(){this.options.container.removeEventListener("scroll",this._scroll),window.removeEventListener("resize",this._scroll),this.attached=!1}},off:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){var a=Object.keys(this.trackedElements[t].enter||{}),n=Object.keys(this.trackedElements[t].leave||{});if({}.hasOwnProperty.call(this.trackedElements,t))if(r){if(this.trackedElements[t][e]){var i="function"==typeof r?r.name:r;delete this.trackedElements[t][e][i]}}else delete this.trackedElements[t][e];a.length||n.length||delete this.trackedElements[t]}},on:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){if(!e)throw new Error("No event given. Choose either enter or leave");if(!t)throw new Error("No selector to track");if(["enter","leave"].indexOf(e)<0)throw new Error(e+" event is not supported");({}).hasOwnProperty.call(this.trackedElements,t)||(this.trackedElements[t]={}),this.trackedElements[t].nodes=[];for(var a=0,n=document.querySelectorAll(t);a{let s=e[t];"string"==typeof s&&(s={texture:s}),s.textureScale||(s.textureScale=1),Object(i.d)(r.options.assetRoot,"minecraft","",s.texture).then(e=>{let t=function(e){let t=(new a.TextureLoader).load(e,(function(){t.magFilter=a.NearestFilter,t.minFilter=a.NearestFilter,t.anisotropy=0,t.needsUpdate=!0;let e=new a.MeshBasicMaterial({map:t,transparent:!0,side:a.DoubleSide,alphaTest:.5});e.userData.layer=s,n(e)}))};if(s.uv){s.uv=[s.uv[0]*s.textureScale,s.uv[1]*s.textureScale,s.uv[2]*s.textureScale,s.uv[3]*s.textureScale];let r=new Image;r.onload=function(){let e=document.createElement("canvas");e.width=s.uv[2]-s.uv[0],e.height=s.uv[3]-s.uv[1],e.getContext("2d").drawImage(r,s.uv[0],s.uv[1],s.uv[2]-s.uv[0],s.uv[3]-s.uv[1],0,0,s.uv[2]-s.uv[0],s.uv[3]-s.uv[1]),t(e.toDataURL("image/png"))},r.crossOrigin="anonymous",r.src=e}else t(e)})}));Promise.all(n).then(e=>{let n=new a.Object3D,i=0,o=0;for(let t=0;ti&&(i=f),h>o&&(o=h);let d=new a.PlaneGeometry(f,h),p=new a.Mesh(d,s);if(p.name=s.userData.layer.texture.toLowerCase()+(s.userData.layer.name?"_"+s.userData.layer.name.toLowerCase():""),p.position.set(0,0,0),p.applyMatrix((new a.Matrix4).makeTranslation(f/2,h/2,0)),s.userData.layer.pos?p.applyMatrix((new a.Matrix4).makeTranslation(s.userData.layer.pos[0],-h-s.userData.layer.pos[1],0)):p.applyMatrix((new a.Matrix4).makeTranslation(0,-h,0)),s.userData.layer.layer&&(p.layers.set(s.userData.layer.layer),r._camera.layers.enable(s.userData.layer.layer)),n.add(p),r.options.showOutlines){let e=new a.BoxHelper(p,16711680);n.add(e),s.userData.layer.layer&&e.layers.set(s.userData.layer.layer)}}n.applyMatrix((new a.Matrix4).makeTranslation(-i/2,o/2,0)),r.addToScene(n),r.gui=n,r.attached||(r._camera.position.set(0,0,Math.max(i,o)),r._camera.fov=2*Math.atan(Math.max(i,o)/(2*Math.max(i,o)))*(180/Math.PI),r._camera.updateProjectionMatrix()),"function"==typeof t&&t()})}}u.Positions=o.a,u.Helper=s.a,"undefined"!=typeof window&&(window.GuiRender=u),void 0!==e&&(e.GuiRender=u),t.default=u}.call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(9);var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),e.scene=new n.Scene,e.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),e.quad.frustumCulled=!1,e.scene.add(e.quad),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((a=i)&&a.__esModule?a:{default:a}).default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:this.clock.getDelta(),t=this.renderer.getRenderTarget(),r=!1,a=void 0,n=void 0,i=this.passes.length;for(n=0;n{if(e.options.useWebWorkers){let a=u()(c);a.addEventListener("message",e=>{r.push(...e.data.parsedModelList),t()}),a.postMessage({func:"parseModel",model:i,modelOptions:i,parsedModelList:r,assetRoot:e.options.assetRoot})}else Object(s.e)(i,i,r,e.options.assetRoot).then(()=>{t()})}))}return Promise.all(a)})(a,e,n).then(()=>(function(e,t){console.timeEnd("parseModels"),console.time("loadAndMergeModels");let r=[];console.log("Loading Model JSON data & merging...");let a={};for(let e=0;e{let a=n[t],i=Object(s.d)(a);if(console.debug("loadAndMerge "+i),p.hasOwnProperty(i))r();else if(e.options.useWebWorkers){let t=u()(c);t.addEventListener("message",e=>{p[i]=e.data.mergedModel,r()}),t.postMessage({func:"loadAndMergeModel",model:a,assetRoot:e.options.assetRoot})}else Object(s.b)(a,e.options.assetRoot).then(e=>{p[i]=e,r()})}));return Promise.all(r)})(a,n)).then(()=>(function(e,t){console.timeEnd("loadAndMergeModels"),console.time("loadModelTextures");let r=[];console.log("Loading Textures...");let a={};for(let e=0;e{let a=n[t],i=Object(s.d)(a);console.debug("loadTexture "+i);let o=p[i];if(m.hasOwnProperty(i))r();else{if(!o)return console.warn("Missing merged model"),console.warn(a.name),void r();if(!o.textures)return console.warn("The model doesn't have any textures!"),console.warn("Please make sure you're using the proper file."),console.warn(a.name),void r();if(e.options.useWebWorkers){let t=u()(c);t.addEventListener("message",e=>{m[i]=e.data.textures,r()}),t.postMessage({func:"loadTextures",textures:o.textures,assetRoot:e.options.assetRoot})}else Object(s.c)(o.textures,e.options.assetRoot).then(e=>{m[i]=e,r()})}}));return Promise.all(r)})(a,n)).then(()=>(function(e,r){console.timeEnd("loadModelTextures"),console.time("doModelRender"),console.log("Rendering Models...");let a=[];for(let n=0;n{let i=r[n],o=p[Object(s.d)(i)],l=m[Object(s.d)(i)],u=i.offset||[0,0,0],c=i.rotation||[0,0,0],f=i.scale||[1,1,1];if(i.options.hasOwnProperty("display")&&o.hasOwnProperty("display")&&o.display.hasOwnProperty(i.options.display)){let e=o.display[i.options.display];e.hasOwnProperty("translation")&&(u=[u[0]+e.translation[0],u[1]+e.translation[1],u[2]+e.translation[2]]),e.hasOwnProperty("rotation")&&(c=[c[0]+e.rotation[0],c[1]+e.rotation[1],c[2]+e.rotation[2]]),e.hasOwnProperty("scale")&&(f=[e.scale[0],e.scale[1],e.scale[2]])}S(e,o,l,o.textures,i.type,i.name,i.variant,u,c,f).then(r=>{if(r.firstInstance){let a=new t.Object3D;a.add(r.mesh),e.models.push(a),e.addToScene(a)}a(r)})}));return Promise.all(a)})(a,n)).then(e=>{console.timeEnd("doModelRender"),console.debug(e),"function"==typeof r&&r()})}}let S=function(e,r,n,i,o,l,u,c,f,h){return new Promise(d=>{if(r.hasOwnProperty("elements")){let p=Object(s.d)({type:o,name:l,variant:u}),m=v[p],g=function(r,a){r.userData.modelType=o,r.userData.modelName=l;let n=new t.Vector3,i=new t.Vector3,u=new t.Quaternion,m={key:p,index:a,offset:c,scale:h,rotation:f};f&&r.setQuaternionAt(a,u.setFromEuler(new t.Euler(Object(s.f)(f[0]),Object(s.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(s.f)(f[2])))),c&&(r.setPositionAt(a,n.set(c[0],c[1],c[2])),e.instancePositionMap[c[0]+"_"+c[1]+"_"+c[2]]=m),h&&r.setScaleAt(a,i.set(h[0],h[1],h[2])),r.needsUpdate(),d({mesh:r,firstInstance:0===a})},y=function(e,r){let a;if(e.translate(-8,-8,-8),x.hasOwnProperty(p))console.debug("Using cached instance ("+p+")"),a=x[p];else{console.debug("Caching new model instance "+p+" (with "+m+" instances)");let n=new t.InstancedMesh(e,r,m,!1,!1,!1);a={instance:n,index:0},x[p]=a;let i=new t.Vector3,o=new t.Vector3(1,1,1),s=new t.Quaternion;for(let e=0;e{let a=l.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_"+(o.__comment?o.__comment.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_":"");F(o.to[0]-o.from[0],o.to[1]-o.from[1],o.to[2]-o.from[2],a+Date.now(),o.faces,u,n,i,e.options.assetRoot,a).then(e=>{e.applyMatrix((new t.Matrix4).makeTranslation((o.to[0]-o.from[0])/2,(o.to[1]-o.from[1])/2,(o.to[2]-o.from[2])/2)),e.applyMatrix((new t.Matrix4).makeTranslation(o.from[0],o.from[1],o.from[2])),o.rotation&&O(e,new t.Vector3(o.rotation.origin[0],o.rotation.origin[1],o.rotation.origin[2]),new t.Vector3("x"===o.rotation.axis?1:0,"y"===o.rotation.axis?1:0,"z"===o.rotation.axis?1:0),Object(s.f)(o.rotation.angle)),r(e)})}))}Promise.all(b).then(e=>{let t=Object(a.c)(e,!0);t.sourceSize=e.length,y(t.geometry,t.materials,e.length);for(let t=0;t{c&&e.applyMatrix((new t.Matrix4).makeTranslation(c[0],c[1],c[2])),f&&e.rotation.set(Object(s.f)(f[0]),Object(s.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(s.f)(f[2])),h&&e.scale.set(h[0],h[1],h[2]),d({mesh:e,firstInstance:!0})})})};function M(e,r,a,n){let i=x[e];if(i&&i.instance){let e,o=i.instance;e=n?r||[1,1,1]:[0,0,0];let s=new t.Vector3;return o.setScaleAt(a,s.set(e[0],e[1],e[2])),o}}function T(e,t){let r={};for(let a of e){let e=this.instancePositionMap[a[0]+"_"+a[1]+"_"+a[2]];if(e){let a=M(e.key,e.scale,e.index,t);a&&(r[e.key]=a)}}for(let e of Object.values(r))e.needsUpdate()}E.prototype.setVisibilityAtMulti=T,E.prototype.setVisibilityAt=function(e,t,r,a){T([[e,t,r]],a)},E.prototype.setVisibilityOfType=function(e,t,r,a){let n=x[Object(s.d)({type:e,name:t,variant:r})];if(n&&n.instance){n.instance.visible=a}};let P=function(e,r){return new Promise(a=>{let n=function(r,n,i){let o=new t.PlaneGeometry(n,i),s=new t.Mesh(o,r);s.name=e,s.receiveShadow=!0,a(s)};if(r){let a=0,i=0,s=[];for(let e in r)r.hasOwnProperty(e)&&s.push(new Promise(t=>{let n=new Image;n.onload=function(){n.width>a&&(a=n.width),n.height>i&&(i=n.height),t(n)},n.src=r[e]}));Promise.all(s).then(r=>{let s=document.createElement("canvas");s.width=a,s.height=i;let l=s.getContext("2d");for(let e=0;e{let A,E=e+"_"+r+"_"+a;w.hasOwnProperty(E)?(console.debug("Using cached Geometry ("+E+")"),A=w[E]):(A=new t.BoxGeometry(e,r,a),console.debug("Caching Geometry "+E),w[E]=A);let S=function(e){let r=new t.Mesh(A,e);r.name=i,r.receiveShadow=!0,x(r)};if(c){let e=[];for(let r=0;r<6;r++)e.push(new Promise(e=>{let a=h[r];if(!l.hasOwnProperty(a))return void e(null);let f=l[a],w=f.texture.substr(1);if(!c.hasOwnProperty(w)||!c[w])return console.warn("Missing texture '"+w+"' for face "+a+" in model "+i),void e(null);let x=w+"_"+a+"_"+v,A=r=>{let l=function(r){let n=r.dataUrl,o=r.dataUrlHash,l=r.hasTransparency;if(b.hasOwnProperty(o))return console.debug("Using cached Material ("+o+", without meta)"),void e(b[o]);let u=p[w];u.startsWith("#")&&(u=p[i.substr(1)]),console.debug("Pre-Caching Material "+o+", without meta"),b[o]=new t.MeshBasicMaterial({map:null,transparent:l,side:l?t.DoubleSide:t.FrontSide,alphaTest:.5,name:a+"_"+w+"_"+u});let c=function(t){console.debug("Finalizing Cached Material "+o+", without meta"),b[o].map=t,b[o].needsUpdate=!0,e(b[o])};if(g.hasOwnProperty(o))return console.debug("Using cached Texture ("+o+")"),void c(g[o]);console.debug("Pre-Caching Texture "+o),g[o]=(new t.TextureLoader).load(n,(function(e){e.magFilter=t.NearestFilter,e.minFilter=t.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,f.hasOwnProperty("rotation")&&(e.center.x=.5,e.center.y=.5,e.rotation=Object(s.f)(f.rotation)),console.debug("Caching Texture "+o),g[o]=e,c(e)}))};if(r.height>r.width&&r.height%r.width==0){let a=p[w];a.startsWith("#")&&(a=p[a.substr(1)]),-1!==a.indexOf("/")&&(a=a.substr(a.indexOf("/")+1)),Object(n.e)(a,m).then(a=>{!function(r,a){let n=r.dataUrlHash,i=r.hasTransparency;if(b.hasOwnProperty(n))return console.debug("Using cached Material ("+n+", with meta)"),void e(b[n]);console.debug("Pre-Caching Material "+n+", with meta"),b[n]=new t.MeshBasicMaterial({map:null,transparent:i,side:i?t.DoubleSide:t.FrontSide,alphaTest:.5});let s=1;a.hasOwnProperty("animation")&&a.animation.hasOwnProperty("frametime")&&(s=a.animation.frametime);let l=Math.floor(r.height/r.width);console.log("Generating animated texture...");let u=[];for(let e=0;e{let n=document.createElement("canvas");n.width=r.width,n.height=r.width,n.getContext("2d").drawImage(r.canvas,0,e*r.width,r.width,r.width,0,0,r.width,r.width);let i=n.toDataURL("image/png"),s=o(i);if(g.hasOwnProperty(s))return console.debug("Using cached Texture ("+s+")"),void a(g[s]);console.debug("Pre-Caching Texture "+s),g[s]=(new t.TextureLoader).load(i,(function(e){e.magFilter=t.NearestFilter,e.minFilter=t.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,console.debug("Caching Texture "+s+", without meta"),g[s]=e,a(e)}))}));Promise.all(u).then(t=>{let r=0,a=0;_.push(()=>{r>=s&&(r=0,b[n].map=t[a],a++),a>=t.length&&(a=0),r+=.1}),console.debug("Finalizing Cached Material "+n+", with meta"),b[n].map=t[0],b[n].needsUpdate=!0,e(b[n])})}(r,a)}).catch(()=>{l(r)})}else l(r)};if(y.hasOwnProperty(x)){let e=y[x];if(e.hasOwnProperty("img")){console.debug("Waiting for canvas image that's already loading ("+x+")"),e.img.waitingForCanvas.push((function(e){A(e)}))}else console.debug("Using cached canvas ("+x+")"),A(y[x])}else{let t=new Image;t.onerror=function(t){console.warn(t),e(null)},t.waitingForCanvas=[],t.onload=function(){let e=(e=>{let t=f.uv;t||(t=u[a].uv),t=[Object(n.f)(t[0],e.width),Object(n.f)(t[1],e.height),Object(n.f)(t[2],e.width),Object(n.f)(t[3],e.height)];let r=document.createElement("canvas");r.width=Math.abs(t[2]-t[0]),r.height=Math.abs(t[3]-t[1]);let i,s=r.getContext("2d");s.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),r.width,r.height,0,0,r.width,r.height),f.hasOwnProperty("tintindex")?i=d[f.tintindex]:v.startsWith("water_")&&(i="blue"),i&&(s.fillStyle=i,s.globalCompositeOperation="multiply",s.fillRect(0,0,r.width,r.height),s.globalAlpha=1,s.globalCompositeOperation="destination-in",s.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),r.width,r.height,0,0,r.width,r.height));let l=s.getImageData(0,0,r.width,r.height).data,c=!1;for(let e=3;eS(e))}else{let e=[];for(let r=0;r<6;r++)e.push(new t.MeshBasicMaterial({color:f[r+2],wireframe:!0}));S(e)}})};function O(e,t,r,a){e.position.sub(t),e.position.applyAxisAngle(r,a),e.position.add(t),e.rotateOnAxis(r,a)}E.cache={loadedTextures:m,mergedModels:p,instanceCount:v,texture:g,canvas:y,material:b,geometry:w,instances:x,animated:_,resetInstances:function(){Object(s.a)(v),Object(s.a)(x)},clearAll:function(){Object(s.a)(m),Object(s.a)(p),Object(s.a)(v),Object(s.a)(g),Object(s.a)(y),Object(s.a)(b),Object(s.a)(w),Object(s.a)(x),_.splice(0,_.length)}},E.ModelConverter=i.a,"undefined"!=typeof window&&(window.ModelRender=E,window.ModelConverter=i.a),void 0!==e&&(e.ModelRender=E)}).call(this,r(4))},function(e,t,r){e.exports=function(e){const t=parseInt(e.REVISION)>=96;r(87)(e);var a=new e.MeshDepthMaterial;a.depthPacking=e.RGBADepthPacking,a.clipping=!0,a.defines={INSTANCE_TRANSFORM:""};var n=e.ShaderLib.distanceRGBA,i=e.UniformsUtils.clone(n.uniforms),o=new e.ShaderMaterial({defines:{USE_SHADOWMAP:"",INSTANCE_TRANSFORM:""},uniforms:i,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,clipping:!0});return e.InstancedMesh=function(t,r,n,i,s,l){e.Mesh.call(this,(new e.InstancedBufferGeometry).copy(t)),this._dynamic=!!i,this._uniformScale=!!l,this._colors=!!s,this.numInstances=n,this._setAttributes(),this.material=r,this.frustumCulled=!1,this.customDepthMaterial=a,this.customDistanceMaterial=o},e.InstancedMesh.prototype=Object.create(e.Mesh.prototype),e.InstancedMesh.constructor=e.InstancedMesh,Object.defineProperties(e.InstancedMesh.prototype,{material:{set:function(e){let t=function(e){e.defines?(e.defines.INSTANCE_TRANSFORM="",this._uniformScale?e.defines.INSTANCE_UNIFORM="":delete e.defines.INSTANCE_UNIFORM,this._colors?e.defines.INSTANCE_COLOR="":delete e.defines.INSTANCE_COLOR):(e.defines={INSTANCE_TRANSFORM:""},this._uniformScale&&(e.defines.INSTANCE_UNIFORM=""),this._colors&&(e.defines.INSTANCE_COLOR=""))};if(Array.isArray(e)){e=e.slice(0);for(let r=0;r{const n=r[a];let i;t?i=new e.InstancedBufferAttribute(...n):(i=new e.InstancedBufferAttribute(n[0],n[1],n[3])).normalized=n[2],i.dynamic=this._dynamic,this.geometry.addAttribute(a,i)})},e.InstancedMesh}},function(e,t,r){e.exports=function(e){return/InstancedMesh/.test(e.REVISION)?e:(r(88)(e),e.REVISION+="_InstancedMesh",e)}},function(e,t,r){e.exports=function(e){e.ShaderChunk.begin_vertex=r(89),e.ShaderChunk.color_fragment=r(90),e.ShaderChunk.color_pars_fragment=r(91),e.ShaderChunk.color_vertex=r(92),e.ShaderChunk.defaultnormal_vertex=r(93),e.ShaderChunk.uv_pars_vertex=r(94)}},function(e,t){e.exports=["#ifndef INSTANCE_TRANSFORM","vec3 transformed = vec3( position );","#else","#ifndef INSTANCE_MATRIX","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","vec3 transformed = ( _instanceMatrix * vec4( position , 1. )).xyz;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","diffuseColor.rgb *= vColor;","#endif","#if defined(INSTANCE_COLOR)","diffuseColor.rgb *= vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","varying vec3 vColor;","#endif","#if defined( INSTANCE_COLOR )","varying vec3 vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","vColor.xyz = color.xyz;","#endif","#if defined( INSTANCE_COLOR ) && defined( INSTANCE_TRANSFORM )","vInstanceColor = instanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef FLIP_SIDED","objectNormal = -objectNormal;","#endif","#ifndef INSTANCE_TRANSFORM","vec3 transformedNormal = normalMatrix * objectNormal;","#else","#ifndef INSTANCE_MATRIX ","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","#ifndef INSTANCE_UNIFORM","vec3 transformedNormal = transposeMat3( inverse( mat3( modelViewMatrix * _instanceMatrix ) ) ) * objectNormal ;","#else","vec3 transformedNormal = ( modelViewMatrix * _instanceMatrix * vec4( objectNormal , 0.0 ) ).xyz;","#endif","#endif"].join("\n")},function(e,t){e.exports=["#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )","varying vec2 vUv;","uniform mat3 uvTransform;","#endif","#ifdef INSTANCE_TRANSFORM","mat3 inverse(mat3 m) {","float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];","float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];","float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];","float b01 = a22 * a11 - a12 * a21;","float b11 = -a22 * a10 + a12 * a20;","float b21 = a21 * a10 - a11 * a20;","float det = a00 * b01 + a01 * b11 + a02 * b21;","return mat3(b01, (-a22 * a01 + a02 * a21), ( a12 * a01 - a02 * a11),","b11, ( a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),","b21, (-a21 * a00 + a01 * a20), ( a11 * a00 - a01 * a10)) / det;","}","attribute vec3 instancePosition;","attribute vec4 instanceQuaternion;","attribute vec3 instanceScale;","#if defined( INSTANCE_COLOR )","attribute vec3 instanceColor;","varying vec3 vInstanceColor;","#endif","mat4 getInstanceMatrix(){","vec4 q = instanceQuaternion;","vec3 s = instanceScale;","vec3 v = instancePosition;","vec3 q2 = q.xyz + q.xyz;","vec3 a = q.xxx * q2.xyz;","vec3 b = q.yyz * q2.yzz;","vec3 c = q.www * q2.xyz;","vec3 r0 = vec3( 1.0 - (b.x + b.z) , a.y + c.z , a.z - c.y ) * s.xxx;","vec3 r1 = vec3( a.y - c.z , 1.0 - (a.x + b.z) , b.y + c.x ) * s.yyy;","vec3 r2 = vec3( a.z + c.y , b.y - c.x , 1.0 - (a.x + b.x) ) * s.zzz;","return mat4(","r0 , 0.0,","r1 , 0.0,","r2 , 0.0,","v , 1.0",");","}","#endif"].join("\n")},function(e,t,r){"use strict";var a={};(0,r(10).assign)(a,r(96),r(98),r(32)),e.exports=a},function(e,t,r){"use strict";var a=r(48),n=r(10),i=r(51),o=r(30),s=r(31),l=Object.prototype.toString,u=0,c=-1,f=0,h=8;function d(e){if(!(this instanceof d))return new d(e);this.options=n.assign({level:c,method:h,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&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 r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==u)throw new Error(o[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,p))!==u)throw new Error(o[r]);this._dict_set=!0}}function p(e,t){var r=new d(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}d.prototype.push=function(e,t){var r,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=i.string2buf(e):"[object ArrayBuffer]"===l.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 n.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=a.deflate(s,o))&&r!==u)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(n.shrinkBuf(s.output,s.next_out))):this.onData(n.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u):2!==o||(this.onEnd(u),s.avail_out=0,!0)},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=d,t.deflate=p,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},function(e,t,r){"use strict";var a=r(10),n=4,i=0,o=1,s=2;function l(e){for(var t=e.length;--t>=0;)e[t]=0}var u=0,c=1,f=2,h=29,d=256,p=d+1+h,m=30,v=19,g=2*p+1,y=15,b=16,w=7,x=256,_=16,A=17,E=18,S=[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],M=[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],T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(p+2));l(F);var O=new Array(2*m);l(O);var L=new Array(512);l(L);var C=new Array(256);l(C);var k=new Array(h);l(k);var R,I,N,D=new Array(m);function U(e,t,r,a,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=a,this.max_length=n,this.has_stree=e&&e.length}function j(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function B(e){return e<256?L[e]:L[256+(e>>>7)]}function V(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function z(e,t,r){e.bi_valid>b-r?(e.bi_buf|=t<>b-e.bi_valid,e.bi_valid+=r-b):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function X(e,t,r){var a,n,i=new Array(y+1),o=0;for(a=1;a<=y;a++)i[a]=o=o+r[a-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=H(i[s]++,s))}}function Y(e){var t;for(t=0;t8?V(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,a){var n=2*t,i=2*r;return e[n]>1;r>=1;r--)Q(e,i,r);n=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Q(e,i,1),a=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=a,i[2*n]=i[2*r]+i[2*a],e.depth[n]=(e.depth[r]>=e.depth[a]?e.depth[r]:e.depth[a])+1,i[2*r+1]=i[2*a+1]=n,e.heap[1]=n++,Q(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,a,n,i,o,s,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(i=0;i<=y;i++)e.bl_count[i]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(i=p,m++),l[2*a+1]=i,a>u||(e.bl_count[i]++,o=0,a>=d&&(o=h[a-d]),s=l[2*a],e.opt_len+=s*(i+o),f&&(e.static_len+=s*(c[2*a+1]+o)));if(0!==m){do{for(i=p-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(i=p;0!==i;i--)for(a=e.bl_count[i];0!==a;)(n=e.heap[--r])>u||(l[2*n+1]!==i&&(e.opt_len+=(i-l[2*n+1])*l[2*n],l[2*n+1]=i),a--)}}(e,t),X(i,u,e.bl_count)}function J(e,t,r){var a,n,i=-1,o=t[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(r+1)+1]=65535,a=0;a<=r;a++)n=o,o=t[2*(a+1)+1],++s>=7;a0?(e.strm.data_type===s&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&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 o;for(t=32;t=3&&0===e.bl_tree[2*P[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),l=e.opt_len+3+7>>>3,(u=e.static_len+3+7>>>3)<=l&&(l=u)):l=u=r+5,r+4<=l&&-1!==t?te(e,t,r,a):e.strategy===n||u===l?(z(e,(c<<1)+(a?1:0),3),Z(e,F,O)):(z(e,(f<<1)+(a?1:0),3),function(e,t,r,a){var n;for(z(e,t-257,5),z(e,r-1,5),z(e,a-4,4),n=0;n>>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&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(C[r]+d+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){z(e,c<<1,3),G(e,x,F),function(e){16===e.bi_valid?(V(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,r){"use strict";var a=r(52),n=r(10),i=r(51),o=r(32),s=r(30),l=r(31),u=r(101),c=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new u,a.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=i.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=a.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,l,u,f,h=this.strm,d=this.options.chunkSize,p=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?h.input=i.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new n.Buf8(d),h.next_out=0,h.avail_out=d),(r=a.inflate(h,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(r=a.inflateSetDictionary(this.strm,p)),r===o.Z_BUF_ERROR&&!0===m&&(r=o.Z_OK,m=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==o.Z_STREAM_END&&(0!==h.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=i.utf8border(h.output,h.next_out),u=h.next_out-l,f=i.buf2string(h.output,l),h.next_out=u,h.avail_out=d-u,u&&n.arraySet(h.output,h.output,l,u,0),this.onData(f)):this.onData(n.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(m=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},function(e,t,r){"use strict";e.exports=function(e,t){var r,a,n,i,o,s,l,u,c,f,h,d,p,m,v,g,y,b,w,x,_,A,E,S,M;r=e.state,a=e.next_in,S=e.input,n=a+(e.avail_in-5),i=e.next_out,M=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,f=r.wnext,h=r.window,d=r.hold,p=r.bits,m=r.lencode,v=r.distcode,g=(1<>>=w=b>>>24,p-=w,0===(w=b>>>16&255))M[i++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(d&(1<>>=w,p-=w),p<15&&(d+=S[a++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=v[(65535&b)+(d&(1<l){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=w,p-=w,_>(w=i-o)){if((w=_-w)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(A=0,E=h,0===f){if(A+=u-w,w2;)M[i++]=E[A++],M[i++]=E[A++],M[i++]=E[A++],x-=3;x&&(M[i++]=E[A++],x>1&&(M[i++]=E[A++]))}else{A=i-_;do{M[i++]=M[A++],M[i++]=M[A++],M[i++]=M[A++],x-=3}while(x>2);x&&(M[i++]=M[A++],x>1&&(M[i++]=M[A++]))}break}}break}}while(a>3,d&=(1<<(p-=x<<3))-1,e.next_in=a,e.next_out=i,e.avail_in=a=1&&0===I[M];M--);if(T>M&&(T=M),0===M)return u[c++]=20971520,u[c++]=20971520,h.bits=1,0;for(S=1;S0&&(0===e||1!==M))return-1;for(N[1]=0,A=1;A<15;A++)N[A+1]=N[A]+I[A];for(E=0;E852||2===e&&L>592)return 1;for(;;){b=A-F,f[E]y?(w=D[U+f[E]],x=k[R+f[E]]):(w=96,x=0),d=1<>F)+(p-=d)]=b<<24|w<<16|x|0}while(0!==p);for(d=1<>=1;if(0!==d?(C&=d-1,C+=d):C=0,E++,0==--I[A]){if(A===M)break;A=t[r+f[E]]}if(A>T&&(C&v)!==m){for(0===F&&(F=T),g+=S,O=1<<(P=A-F);P+F852||2===e&&L>592)return 1;u[m=C&v]=T<<24|P<<16|g-c|0}}return 0!==C&&(u[g+C]=A-F<<24|64<<16|0),h.bits=T,0}},function(e,t,r){"use strict";e.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}},function(e,t,r){"use strict";(function(e){var a=r(7).Buffer,n=r(105).Transform,i=r(116),o=r(59),s=r(25).ok,l=r(7).kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";i.Z_MIN_WINDOWBITS=8,i.Z_MAX_WINDOWBITS=15,i.Z_DEFAULT_WINDOWBITS=15,i.Z_MIN_CHUNK=64,i.Z_MAX_CHUNK=1/0,i.Z_DEFAULT_CHUNK=16384,i.Z_MIN_MEMLEVEL=1,i.Z_MAX_MEMLEVEL=9,i.Z_DEFAULT_MEMLEVEL=8,i.Z_MIN_LEVEL=-1,i.Z_MAX_LEVEL=9,i.Z_DEFAULT_LEVEL=i.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(i),f=0;f=l?o=new RangeError(u):t=a.concat(n,i),n=[],e.close(),r(o,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)})),e.on("end",s),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=a.from(t)),!a.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function b(e){if(!(this instanceof b))return new b(e);T.call(this,e,i.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);T.call(this,e,i.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,i.GZIP)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,i.GUNZIP)}function A(e){if(!(this instanceof A))return new A(e);T.call(this,e,i.DEFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);T.call(this,e,i.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,i.UNZIP)}function M(e){return e===i.Z_NO_FLUSH||e===i.Z_PARTIAL_FLUSH||e===i.Z_SYNC_FLUSH||e===i.Z_FULL_FLUSH||e===i.Z_FINISH||e===i.Z_BLOCK}function T(e,r){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,n.call(this,e),e.flush&&!M(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!M(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||i.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:i.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!a.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new i.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){P(s),s._hadError=!0;var a=new Error(e);a.errno=r,a.code=t.codes[r],s.emit("error",a)};var l=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(l=e.level);var u=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,l,e.memLevel||t.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=a.allocUnsafe(this._chunkSize),this._offset=0,this._level=l,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function P(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function F(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),t.Deflate=b,t.Inflate=w,t.Gzip=x,t.Gunzip=_,t.DeflateRaw=A,t.InflateRaw=E,t.Unzip=S,t.createDeflate=function(e){return new b(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new A(e)},t.createInflateRaw=function(e){return new E(e)},t.createGzip=function(e){return new x(e)},t.createGunzip=function(e){return new _(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new b(t),e,r)},t.deflateSync=function(e,t){return y(new b(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new x(t),e,r)},t.gzipSync=function(e,t){return y(new x(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new A(t),e,r)},t.deflateRawSync=function(e,t){return y(new A(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new S(t),e,r)},t.unzipSync=function(e,t){return y(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new w(t),e,r)},t.inflateSync=function(e,t){return y(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new _(t),e,r)},t.gunzipSync=function(e,t){return y(new _(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new E(t),e,r)},t.inflateRawSync=function(e,t){return y(new E(t),e)},o.inherits(T,n),T.prototype.params=function(r,a,n){if(rt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(a!=t.Z_FILTERED&&a!=t.Z_HUFFMAN_ONLY&&a!=t.Z_RLE&&a!=t.Z_FIXED&&a!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+a);if(this._level!==r||this._strategy!==a){var o=this;this.flush(i.Z_SYNC_FLUSH,(function(){s(o._handle,"zlib binding closed"),o._handle.params(r,a),o._hadError||(o._level=r,o._strategy=a,n&&n())}))}else e.nextTick(n)},T.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},T.prototype._flush=function(e){this._transform(a.alloc(0),"",e)},T.prototype.flush=function(t,r){var n=this,o=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=i.Z_FULL_FLUSH),o.ended?r&&e.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",(function(){return n.flush(t,r)})):(this._flushFlag=t,this.write(a.alloc(0),"",r))},T.prototype.close=function(t){P(this,t),e.nextTick(F,this)},T.prototype._transform=function(e,t,r){var n,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||a.isBuffer(e)?this._handle?(s?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||i.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},T.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,c=this,f="function"==typeof r;if(!f){var h,d=[],p=0;this.on("error",(function(e){h=e})),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw h;if(p>=l)throw P(this),new RangeError(u);var v=a.concat(d,p);return P(this),v}s(this._handle,"zlib binding closed");var g=this._handle.write(t,e,o,n,this._buffer,this._offset,i);function y(l,u){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var h=i-u;if(s(h>=0,"have should not go down"),h>0){var m=c._buffer.slice(c._offset,c._offset+h);c._offset+=h,f?c.push(m):(d.push(m),p+=m.length)}if((0===u||c._offset>=c._chunkSize)&&(i=c._chunkSize,c._offset=0,c._buffer=a.allocUnsafe(c._chunkSize)),0===u){if(o+=n-l,n=l,!f)return!0;var v=c._handle.write(t,e,o,n,c._buffer,c._offset,c._chunkSize);return v.callback=y,void(v.buffer=e)}if(!f)return!1;r()}}g.buffer=e,g.callback=y},o.inherits(b,T),o.inherits(w,T),o.inherits(x,T),o.inherits(_,T),o.inherits(A,T),o.inherits(E,T),o.inherits(S,T)}).call(this,r(5))},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],a=t[1];return 3*(r+a)/4-a},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));1===n?(t=e[r-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var n,i,o=[],s=t;s>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,a,n){var i,o,s=8*n-a-1,l=(1<>1,c=-7,f=r?n-1:0,h=r?-1:1,d=e[t+f];for(f+=h,i=d&(1<<-c)-1,d>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=h,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=a;c>0;o=256*o+e[t+f],f+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,a),i-=u}return(d?-1:1)*o*Math.pow(2,i-a)},t.write=function(e,t,r,a,n,i){var o,s,l,u=8*i-n-1,c=(1<>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=a?0:i-1,p=a?1:-1,m=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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,n),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;e[r+d]=255&s,d+=p,s/=256,n-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,u-=8);e[r+d-p]|=128*m}},function(e,t,r){e.exports=n;var a=r(18).EventEmitter;function n(){a.call(this)}r(6)(n,a),n.Readable=r(33),n.Writable=r(112),n.Duplex=r(113),n.Transform=r(114),n.PassThrough=r(115),n.Stream=n,n.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===a.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var a=r(23).Buffer,n=r(108);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,t.copy(r,n),s+=o.data.length,o=o.next;return i},e}(),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var a=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(n.call(setTimeout,a,arguments),clearTimeout)},t.setInterval=function(){return new i(n.call(setInterval,a,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(a,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(110),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(4))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var a,n,i,o,s,l=1,u={},c=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?a=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},a=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(n=f.documentElement,a=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):a=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),a=function(t){e.postMessage(o+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;rt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,n(this.init_done,"close before init"),n(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,a,n,i,o){return this._write(!0,e,t,r,a,n,i,o)},c.prototype.writeSync=function(e,t,r,a,n,i,o){return this._write(!1,e,t,r,a,n,i,o)},c.prototype._write=function(r,i,o,s,l,u,c,f){if(n.equal(arguments.length,8),n(this.init_done,"write before init"),n(this.mode!==t.NONE,"already finalized"),n.equal(!1,this.write_in_progress,"write already in progress"),n.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,n.equal(!1,void 0===i,"must provide flush value"),this.write_in_progress=!0,i!==t.Z_NO_FLUSH&&i!==t.Z_PARTIAL_FLUSH&&i!==t.Z_SYNC_FLUSH&&i!==t.Z_FULL_FLUSH&&i!==t.Z_FINISH&&i!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=e.alloc(0),l=0,s=0),this.strm.avail_in=l,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=u,this.strm.next_out=c,this.flush=i,!r)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return a.nextTick((function(){h._process(),h._after()})),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,r,a,i,o){n(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),n(e>=8&&e<=15,"invalid windowBits"),n(r>=-1&&r<=9,"invalid compression level"),n(a>=1&&a<=9,"invalid memlevel"),n(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,a,i,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,r,a,n,l){switch(this.level=e,this.windowBits=r,this.memLevel=a,this.strategy=n,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new i,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=l,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=o.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=c}).call(this,r(7).Buffer,r(5))},function(e,t,r){"use strict"; + */function n(e,t){if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);n=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(e[s],t[s],r,a))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function x(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,a){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(a=r,r=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),a=(r&&r.name?" ("+r.name+").":".")+(a?" "+a:"."),e&&!n&&g(n,r,"Missing expected exception"+a);var i="string"==typeof a,s=!e&&n&&!r;if((!e&&o.isError(n)&&i&&x(n,r)||s)&&g(n,r,"Got unwanted exception"+a),e&&n&&r&&!x(n,r)||!e&&n)throw n}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(v(e.actual),128)+" "+e.operator+" "+m(v(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var a=r.stack,n=p(t),i=a.indexOf("\n"+n);if(i>=0){var o=a.indexOf("\n",i+1);a=a.substring(o+1)}this.stack=a}}},o.inherits(h.AssertionError,Error),h.fail=g,h.ok=y,h.equal=function(e,t,r){e!=t&&g(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){b(e,t,!1)||g(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){b(e,t,!0)||g(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){b(e,t,!1)&&g(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,a){b(t,r,!0)&&g(t,r,a,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){_(!0,e,t,r)},h.doesNotThrow=function(e,t,r){_(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=a((function e(t,r){t||g(t,!0,r,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var A=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(30);Object.defineProperty(t,"CopyShader",{enumerable:!0,get:function(){return d(a).default}});var n=r(9);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return d(n).default}});var i=r(46);Object.defineProperty(t,"ShaderPass",{enumerable:!0,get:function(){return d(i).default}});var o=r(81);Object.defineProperty(t,"RenderingPass",{enumerable:!0,get:function(){return d(o).default}});var s=r(82);Object.defineProperty(t,"TexturePass",{enumerable:!0,get:function(){return d(s).default}});var l=r(83);Object.defineProperty(t,"RenderPass",{enumerable:!0,get:function(){return d(l).default}});var u=r(47);Object.defineProperty(t,"MaskPass",{enumerable:!0,get:function(){return d(u).default}});var c=r(48);Object.defineProperty(t,"ClearMaskPass",{enumerable:!0,get:function(){return d(c).default}});var f=r(84);Object.defineProperty(t,"ClearPass",{enumerable:!0,get:function(){return d(f).default}});var h=r(85);function d(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"default",{enumerable:!0,get:function(){return d(h).default}})},function(e,t,r){var a,n,i,o,s;a=r(183),n=r(77).utf8,i=r(184),o=r(77).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):n.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var r=a.bytesToWords(e),l=8*e.length,u=1732584193,c=-271733879,f=-1732584194,h=271733878,d=0;d>>24)|4278255360&(r[d]<<24|r[d]>>>8);r[l>>>5]|=128<>>9<<4)]=l;var p=s._ff,m=s._gg,v=s._hh,g=s._ii;for(d=0;d>>0,c=c+b>>>0,f=f+w>>>0,h=h+x>>>0}return a.endian([u,c,f,h])})._ff=function(e,t,r,a,n,i,o){var s=e+(t&r|~t&a)+(n>>>0)+o;return(s<>>32-i)+t},s._gg=function(e,t,r,a,n,i,o){var s=e+(t&a|r&~a)+(n>>>0)+o;return(s<>>32-i)+t},s._hh=function(e,t,r,a,n,i,o){var s=e+(t^r^a)+(n>>>0)+o;return(s<>>32-i)+t},s._ii=function(e,t,r,a,n,i,o){var s=e+(r^(t|~a))+(n>>>0)+o;return(s<>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=a.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?o.bytesToString(r):a.bytesToHex(r)}},function(e,t,r){function a(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var a=r(r.s=ENTRY_MODULE);return a.default||a}var n="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+n+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e,t,a){var s={};s[a]=[];var l=t.toString(),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return s;for(var c,f=u[1],h=new RegExp("(\\\\n|\\W)"+o(f)+i,"g");c=h.exec(l);)"dll-reference"!==c[3]&&s[a].push(c[3]);for(h=new RegExp("\\("+o(f)+'\\("(dll-reference\\s('+n+'))"\\)\\)'+i,"g");c=h.exec(l);)e[c[2]]||(s[a].push(c[1]),e[c[2]]=r(c[1]).m),s[c[2]]=s[c[2]]||[],s[c[2]].push(c[4]);for(var d,p=Object.keys(s),m=0;m0}),!1)}e.exports=function(e,t){t=t||{};var n={main:r.m},i=t.all?{main:Object.keys(n.main)}:function(e,t){for(var r={main:[t]},a={main:[]},n={main:{}};l(r);)for(var i=Object.keys(r),o=0;o-1?a:i.nextTick;y.WritableState=g;var u=r(20);u.inherits=r(6);var c={deprecate:r(58)},f=r(56),h=r(24).Buffer,d=n.Uint8Array||function(){};var p,m=r(57);function v(){}function g(e,t){s=s||r(14),e=e||{};var a=t instanceof s;this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:a&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,a=r.sync,n=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,a,n){--t.pendingcb,r?(i.nextTick(n,a),i.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",a)):(n(a),e._writableState.errorEmitted=!0,e.emit("error",a),E(e,t))}(e,r,a,t,n);else{var o=_(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),a?l(w,e,r,o,n):w(e,r,o,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(s=s||r(14),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,r,a,n,i,o){t.writelen=a,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,i,t.onwrite),t.sync=!1}function w(e,t,r,a){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,a(),E(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var a=t.bufferedRequestCount,n=new Array(a),i=t.corkedRequestsFree;i.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,b(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),E(e,t)}))}function E(e,t){var r=_(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(A,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(y,f),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var a,n=this._writableState,o=!1,s=!n.objectMode&&(a=e,h.isBuffer(a)||a instanceof d);return s&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}(this,r):(s||function(e,t,r,a){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),i.nextTick(a,o),n=!1),n}(this,n,e,r))&&(n.pendingcb++,o=function(e,t,r,a,n,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,r));return t}(t,a,n);a!==o&&(r=!0,n="buffer",a=o)}var s=t.objectMode?1:a.length;t.length+=s;var l=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var a=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||a.finished||function(e,t,r){t.ending=!0,E(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,a,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(5),r(112).setImmediate,r(4))},function(e,t,r){"use strict";var a=r(131),n=r(37),i=r(16),o=r(61),s=r(133);function l(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof o)return p(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var n,i,s,c=u.call(this,t,r);return c&&(n=c.schema,t=c.root,s=c.baseId),n instanceof o?i=n.validate||e.call(this,n.schema,t,void 0,s):void 0!==n&&(i=p(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,s)),i}function u(e,t){var r=a.parse(t),n=v(r),i=m(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==i){var s=y(n),l=this._refs[s];if("string"==typeof l)return c.call(this,e,l,r);if(l instanceof o)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[s])instanceof o))return;if(l.validate||this._compile(l),s==y(t))return{schema:l,root:e,baseId:i};e=l}if(!e.schema)return;i=m(this._getId(e.schema))}return h.call(this,r,i,e.schema,e)}function c(e,t,r){var a=u.call(this,e,t);if(a){var n=a.schema,i=a.baseId;e=a.root;var o=this._getId(n);return o&&(i=b(i,o)),h.call(this,r,i,n,e)}}e.exports=l,l.normalizeId=y,l.fullPath=m,l.url=b,l.ids=function(e){var t=y(this._getId(e)),r={"":t},o={"":m(t,!1)},l={},u=this;return s(e,{allKeys:!0},(function(e,t,s,c,f,h,d){if(""!==t){var p=u._getId(e),m=r[c],v=o[c]+"/"+f;if(void 0!==d&&(v+="/"+("number"==typeof d?d:i.escapeFragment(d))),"string"==typeof p){p=m=y(m?a.resolve(m,p):p);var g=u._refs[p];if("string"==typeof g&&(g=u._refs[g]),g&&g.schema){if(!n(e,g.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=y(v))if("#"==p[0]){if(l[p]&&!n(e,l[p]))throw new Error('id "'+p+'" resolves to more than one schema');l[p]=e}else u._refs[p]=v}r[t]=m,o[t]=v}})),l},l.inlineRef=p,l.schema=u;var f=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function h(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var n=e.fragment.split("/"),o=1;o{if(e.file){let r=new FileReader;r.onload=function(){let e=this.result,r=new Uint8Array(e);t(r)},r.readAsArrayBuffer(e.file)}else if(e.url){let r=new XMLHttpRequest;r.open("GET",e.url,!0),r.responseType="arraybuffer",r.onloadend=function(){if(200===r.status){let e=new Uint8Array(r.response||r.responseText);t(e)}},r.send()}else e.raw?e.raw instanceof Uint8Array?t(e.raw):t(new Uint8Array(e.raw)):r()})}function o(e,t){return new Promise((r,a)=>{if("compound"===e.type)if(e.value.hasOwnProperty("blocks")&&(e.value.hasOwnProperty("palette")||e.value.hasOwnProperty("palettes"))){let a;if(e.value.hasOwnProperty("palette"))a=e.value.palette.value.value;else{if(void 0===t&&(t=0),t>=e.value.palettes.value.value.length||!e.value.palettes.value.value[t])return void console.warn("Specified palette index ("+t+") is outside of available palettes ("+e.value.palettes.value.value.length+")");a=e.value.palettes.value.value[t].value}let n=[];for(let e=0;e{let n=e.value.Width.value,i=e.value.Height.value,o=e.value.Length.value,s=function(t,r,a){let i=(r*o+a)*n+t;return{id:255&(e.value.Blocks.value[i]||0),data:e.value.Data.value[i]||0}},l=function(e,r){let a=t.blocks[e+":"+r];return a||(console.warn("Missing legacy mapping for "+e+":"+r),"minecraft:air")},u=[];for(let e=0;e{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);o(r).then(e=>{t(e)})})})},n.prototype.schematicToModels=function(e,t){i(e).then(e=>{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);let a=new XMLHttpRequest;a.open("GET","https://minerender.org/res/idsToNames.json",!0),a.onloadend=function(){if(200===a.status){console.log(a.response||a.responseText);let e=JSON.parse(a.response||a.responseText);s(r,e).then(e=>t(e))}},a.send()})})},n.loadNBT=i,n.parseStructureData=o,n.parseSchematicData=s;let l={stained_glass:function(e){return e.color.value+"_stained_glass"},planks:function(e){return e.variant.value+"_planks"}};n.prototype.constructor=n,window.ModelConverter=n,t.a=n},function(e,t,r){const a=r(105),n=r(122).ProtoDef,i=r(181).compound,o=JSON.stringify(r(182)),s=o.replace(/(i[0-9]+)/g,"l$1");function l(e){const t=new n;return t.addType("compound",i),t.addTypes(JSON.parse(e?s:o)),t}const u=l(!1),c=l(!0);function f(e,t){return(t?c:u).parsePacketBuffer("nbt",e).data}const h=function(e){let t=!0;return 31!==e[0]&&(t=!1),139!==e[1]&&(t=!1),t};e.exports={writeUncompressed:function(e,t){return(t?c:u).createPacketBuffer("nbt",e)},parseUncompressed:f,simplify:function e(t){return function t(r,a){return"compound"===a?Object.keys(r).reduce((function(t,a){return t[a]=e(r[a]),t}),{}):"list"===a?r.value.map((function(e){return t(e,r.type)})):r}(t.value,t.type)},parse:function(e,t,r){let n=!1;"function"==typeof t?r=t:n=t,h(e)?a.gunzip(e,(function(t,a){t?r(t,e):r(null,f(a,n))})):r(null,f(e,n))},proto:u,protoLE:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(){function e(e,t){for(var r=0;r4?9:0)}function $(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ae(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ne(e,t){var r,a,n=e.max_chain_length,i=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-D?e.strstart-(e.w_size-D):0,u=e.window,c=e.w_mask,f=e.prev,h=e.strstart+N,d=u[i+o-1],p=u[i+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===d&&u[r]===u[i]&&u[++r]===u[i+1]){i+=2,r++;do{}while(u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&io){if(e.match_start=t,o=a,a>=s)break;d=u[i+o-1],p=u[i+o]}}}while((t=f[t&c])>l&&0!=--n);return o<=e.lookahead?o:e.lookahead}function ie(e){var t,r,a,i,l,u,c,f,h,d,p=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-D)){n.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;do{a=e.head[--t],e.head[t]=a>=p?a-p:0}while(--r);t=r=p;do{a=e.prev[--t],e.prev[t]=a>=p?a-p:0}while(--r);i+=p}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,f=e.strstart+e.lookahead,h=i,d=void 0,(d=u.avail_in)>h&&(d=h),r=0===d?0:(u.avail_in-=d,n.arraySet(c,u.input,u.next_in,d,f),1===u.state.wrap?u.adler=o(u.adler,c,d,f):2===u.state.wrap&&(u.adler=s(u.adler,c,d,f)),u.next_in+=d,u.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=I)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I)if(a=i._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-I,a=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<15&&(s=2,a-=16),i<1||i>T||r!==M||a<8||a>15||t<0||t>9||o<0||o>A)return K(e,v);8===a&&(a=9);var l=new ue;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=a,l.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ie(e),0===e.lookahead&&t===u)return Y;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+r;if((0===e.strstart||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,te(e,!1),0===e.strm.avail_out))return Y;if(e.strstart-e.block_start>=e.w_size-D&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===h?(te(e,!0),0===e.strm.avail_out?q:Q):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),Y)})),new le(4,4,8,4,oe),new le(4,5,16,8,oe),new le(4,6,32,32,oe),new le(4,4,16,16,se),new le(8,16,32,32,se),new le(8,16,128,128,se),new le(8,32,128,256,se),new le(32,128,258,1024,se),new le(32,258,258,4096,se)],t.deflateInit=function(e,t){return he(e,t,M,P,F,E)},t.deflateInit2=he,t.deflateReset=fe,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?v:(e.state.gzhead=t,p):v},t.deflate=function(e,t){var r,n,o,l;if(!e||!e.state||t>d||t<0)return e?K(e,v):v;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===X&&t!==h)return K(e,0===e.avail_out?y:v);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===j)if(2===n.wrap)e.adler=0,re(n,31),re(n,139),re(n,8),n.gzhead?(re(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),re(n,255&n.gzhead.time),re(n,n.gzhead.time>>8&255),re(n,n.gzhead.time>>16&255),re(n,n.gzhead.time>>24&255),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(re(n,255&n.gzhead.extra.length),re(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=s(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=B):(re(n,0),re(n,0),re(n,0),re(n,0),re(n,0),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,Z),n.status=H);else{var g=M+(n.w_bits-8<<4)<<8;g|=(n.strategy>=x||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(g|=U),g+=31-g%31,n.status=H,ae(n,g),0!==n.strstart&&(ae(n,e.adler>>>16),ae(n,65535&e.adler)),e.adler=1}if(n.status===B)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending!==n.pending_buf_size));)re(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=V)}else n.status=V;if(n.status===V)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=z)}else n.status=z;if(n.status===z)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=G)}else n.status=G;if(n.status===G&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ee(e),n.pending+2<=n.pending_buf_size&&(re(n,255&e.adler),re(n,e.adler>>8&255),e.adler=0,n.status=H)):n.status=H),0!==n.pending){if(ee(e),0===e.avail_out)return n.last_flush=-1,p}else if(0===e.avail_in&&J(t)<=J(r)&&t!==h)return K(e,y);if(n.status===X&&0!==e.avail_in)return K(e,y);if(0!==e.avail_in||0!==n.lookahead||t!==u&&n.status!==X){var b=n.strategy===x?function(e,t){for(var r;;){if(0===e.lookahead&&(ie(e),0===e.lookahead)){if(t===u)return Y;break}if(e.match_length=0,r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===h?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):n.strategy===_?function(e,t){for(var r,a,n,o,s=e.window;;){if(e.lookahead<=N){if(ie(e),e.lookahead<=N&&t===u)return Y;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(a=s[n=e.strstart-1])===s[++n]&&a===s[++n]&&a===s[++n]){o=e.strstart+N;do{}while(a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&ne.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=i._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===h?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):a[n.level].func(n,t);if(b!==q&&b!==Q||(n.status=X),b===Y||b===q)return 0===e.avail_out&&(n.last_flush=-1),p;if(b===W&&(t===c?i._tr_align(n):t!==d&&(i._tr_stored_block(n,0,0,!1),t===f&&($(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),ee(e),0===e.avail_out))return n.last_flush=-1,p}return t!==h?p:n.wrap<=0?m:(2===n.wrap?(re(n,255&e.adler),re(n,e.adler>>8&255),re(n,e.adler>>16&255),re(n,e.adler>>24&255),re(n,255&e.total_in),re(n,e.total_in>>8&255),re(n,e.total_in>>16&255),re(n,e.total_in>>24&255)):(ae(n,e.adler>>>16),ae(n,65535&e.adler)),ee(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?p:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==j&&t!==B&&t!==V&&t!==z&&t!==G&&t!==H&&t!==X?K(e,v):(e.state=null,t===H?K(e,g):p):v},t.deflateSetDictionary=function(e,t){var r,a,i,s,l,u,c,f,h=t.length;if(!e||!e.state)return v;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==j||r.lookahead)return v;for(1===s&&(e.adler=o(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&($(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new n.Buf8(r.w_size),n.arraySet(f,t,h-r.w_size,r.w_size,0),t=f,h=r.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=h,e.next_in=0,e.input=t,ie(r);r.lookahead>=I;){a=r.strstart,i=r.lookahead-(I-1);do{r.ins_h=(r.ins_h<>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{i=i+(n=n+t[a++]|0)|0}while(--o);n%=65521,i%=65521}return n|i<<16|0}},function(e,t,r){"use strict";var a=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,n){var i=a,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}},function(e,t,r){"use strict";var a=r(10),n=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var o=new a.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&i||!e.subarray&&n))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var r="",o=0;o>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new a.Buf8(e.length),r=0,n=t.length;r4)u[a++]=65533,r+=i-1;else{for(n&=2===i?31:3===i?15:7;i>1&&r1?u[a++]=65533:n<65536?u[a++]=n:(n-=65536,u[a++]=55296|n>>10&1023,u[a++]=56320|1023&n)}return l(u,a)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+o[e[r]]>t?r:t}},function(e,t,r){"use strict";var a=r(10),n=r(50),i=r(51),o=r(102),s=r(103),l=0,u=1,c=2,f=4,h=5,d=6,p=0,m=1,v=2,g=-2,y=-3,b=-4,w=-5,x=8,_=1,A=2,E=3,S=4,M=5,T=6,P=7,F=8,O=9,L=10,C=11,k=12,R=13,I=14,N=15,D=16,U=17,j=18,B=19,V=20,z=21,G=22,H=23,X=24,Y=25,W=26,q=27,Q=28,Z=29,K=30,J=31,$=32,ee=852,te=592,re=15;function ae(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ne(){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 a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(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=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new a.Buf32(ee),t.distcode=t.distdyn=new a.Buf32(te),t.sane=1,t.back=-1,p):g}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):g}function se(e,t){var r,a;return e&&e.state?(a=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?g:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=r,a.wbits=t,oe(e))):g}function le(e,t){var r,a;return e?(a=new ne,e.state=a,a.window=null,(r=se(e,t))!==p&&(e.state=null),r):g}var ue,ce,fe=!0;function he(e){if(fe){var t;for(ue=new a.Buf32(512),ce=new a.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,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,ce,0,e.work,{bits:5}),fe=!1}e.lencode=ue,e.lenbits=9,e.distcode=ce,e.distbits=5}function de(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(a.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),a.arraySet(o.window,t,r-n,i,o.wnext),(n-=i)?(a.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=i(r.check,Te,2,0),se=0,le=0,r.mode=A;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=K;break}if((15&se)!==x){e.msg="unknown compression method",r.mode=K;break}if(le-=4,_e=8+(15&(se>>>=4)),0===r.wbits)r.wbits=_e;else if(_e>r.wbits){e.msg="invalid window size",r.mode=K;break}r.dmax=1<<_e,e.adler=r.check=1,r.mode=512&se?L:k,se=0,le=0;break;case A:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8&1),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=E;case E:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,Te[2]=se>>>16&255,Te[3]=se>>>24&255,r.check=i(r.check,Te,4,0)),se=0,le=0,r.mode=S;case S:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=M;case M:if(1024&r.flags){for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0}else r.head&&(r.head.extra=null);r.mode=T;case T:if(1024&r.flags&&((fe=r.length)>ie&&(fe=ie),fe&&(r.head&&(_e=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),a.arraySet(r.head.extra,ee,re,fe,_e)),512&r.flags&&(r.check=i(r.check,ee,fe,re)),ie-=fe,re+=fe,r.length-=fe),r.length))break e;r.length=0,r.mode=P;case P:if(2048&r.flags){if(0===ie)break e;fe=0;do{_e=ee[re+fe++],r.head&&_e&&r.length<65536&&(r.head.name+=String.fromCharCode(_e))}while(_e&&fe>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=k;break;case L:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>=7&le,le-=7&le,r.mode=q;break}for(;le<3;){if(0===ie)break e;ie--,se+=ee[re++]<>>=1)){case 0:r.mode=I;break;case 1:if(he(r),r.mode=V,t===d){se>>>=2,le-=2;break e}break;case 2:r.mode=U;break;case 3:e.msg="invalid block type",r.mode=K}se>>>=2,le-=2;break;case I:for(se>>>=7&le,le-=7≤le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=K;break}if(r.length=65535&se,se=0,le=0,r.mode=N,t===d)break e;case N:r.mode=D;case D:if(fe=r.length){if(fe>ie&&(fe=ie),fe>oe&&(fe=oe),0===fe)break e;a.arraySet(te,ee,re,fe,ne),ie-=fe,re+=fe,oe-=fe,ne+=fe,r.length-=fe;break}r.mode=k;break;case U:for(;le<14;){if(0===ie)break e;ie--,se+=ee[re++]<>>=5,le-=5,r.ndist=1+(31&se),se>>>=5,le-=5,r.ncode=4+(15&se),se>>>=4,le-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=K;break}r.have=0,r.mode=j;case j:for(;r.have>>=3,le-=3}for(;r.have<19;)r.lens[Pe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},Ae=s(l,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid code lengths set",r.mode=K;break}r.have=0,r.mode=B;case B:for(;r.have>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=ve,le-=ve,r.lens[r.have++]=ye;else{if(16===ye){for(Se=ve+2;le>>=ve,le-=ve,0===r.have){e.msg="invalid bit length repeat",r.mode=K;break}_e=r.lens[r.have-1],fe=3+(3&se),se>>>=2,le-=2}else if(17===ye){for(Se=ve+3;le>>=ve)),se>>>=3,le-=3}else{for(Se=ve+7;le>>=ve)),se>>>=7,le-=7}if(r.have+fe>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=K;break}for(;fe--;)r.lens[r.have++]=_e}}if(r.mode===K)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=K;break}if(r.lenbits=9,Ee={bits:r.lenbits},Ae=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid literal/lengths set",r.mode=K;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},Ae=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,Ae){e.msg="invalid distances set",r.mode=K;break}if(r.mode=V,t===d)break e;case V:r.mode=z;case z:if(ie>=6&&oe>=258){e.next_out=ne,e.avail_out=oe,e.next_in=re,e.avail_in=ie,r.hold=se,r.bits=le,o(e,ce),ne=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,ie=e.avail_in,se=r.hold,le=r.bits,r.mode===k&&(r.back=-1);break}for(r.back=0;ge=(Me=r.lencode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,r.length=ye,0===ge){r.mode=W;break}if(32&ge){r.back=-1,r.mode=k;break}if(64&ge){e.msg="invalid literal/length code",r.mode=K;break}r.extra=15&ge,r.mode=G;case G:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=H;case H:for(;ge=(Me=r.distcode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,64&ge){e.msg="invalid distance code",r.mode=K;break}r.offset=ye,r.extra=15&ge,r.mode=X;case X:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=K;break}r.mode=Y;case Y:if(0===oe)break e;if(fe=ce-oe,r.offset>fe){if((fe=r.offset-fe)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=K;break}fe>r.wnext?(fe-=r.wnext,pe=r.wsize-fe):pe=r.wnext-fe,fe>r.length&&(fe=r.length),me=r.window}else me=te,pe=ne-r.offset,fe=r.length;fe>oe&&(fe=oe),oe-=fe,r.length-=fe;do{te[ne++]=me[pe++]}while(--fe);0===r.length&&(r.mode=z);break;case W:if(0===oe)break e;te[ne++]=r.length,oe--,r.mode=z;break;case q:if(r.wrap){for(;le<32;){if(0===ie)break e;ie--,se|=ee[re++]<0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),a?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?x(e,o,t,!1):M(e,o)):x(e,o,t,!1))):a||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(S,e):S(e))}function S(e){d("emit readable"),e.emit("readable"),O(e)}function M(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var a;ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++a}return t.length-=a,n}(e,t):function(e,t){var r=u.allocUnsafe(e),a=t.head,n=1;a.data.copy(r),e-=a.data.length;for(;a=a.next;){var i=a.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++n,a.next?t.head=a.next:t.head=t.tail=null):(t.head=a,a.data=i.slice(o));break}++n}return t.length-=n,r}(e,t);return a}(e,t.buffer,t.decoder),r);var r}function C(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(k,t,e))}function k(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var r=0,a=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):E(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&C(this),null;var a,n=t.needReadable;return d("need readable",n),(0===t.length||t.length-e0?L(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&C(this)),null!==a&&this.emit("data",a),a},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var l=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?c:b;function u(t,a){d("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,d("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",v),e.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",b),r.removeListener("data",m),h=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){d("onend"),e.end()}i.endEmitted?n.nextTick(l):r.once("end",l),e.on("unpipe",u);var f=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",f);var h=!1;var p=!1;function m(t){d("ondata"),p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==R(i.pipes,e))&&!h&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(t){d("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){d("onfinish"),e.removeListener("close",g),b()}function b(){d("unpipe"),r.unpipe(e)}return r.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",r),i.flowing||(d("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i=i)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(e){return"[Circular]"}default:return e}})),l=a[r];r=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),p(r)?a.showHidden=r:r&&t._extend(a,r),y(a.showHidden)&&(a.showHidden=!1),y(a.depth)&&(a.depth=2),y(a.colors)&&(a.colors=!1),y(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=l),c(a,e,a.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function c(e,r,a){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(a,e);return g(n)||(n=c(e,n,a)),n}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(A(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return f(r)}var u,w="",E=!1,S=["{","}"];(d(r)&&(E=!0,S=["[","]"]),A(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),x(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+f(r)),0!==o.length||E&&0!=r.length?a<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=E?function(e,t,r,a,n){for(var i=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,w,S)):S[0]+w+S[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,a,n,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),P(a,n)||(o="["+n+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(i&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function d(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===E(e)}function _(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function A(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(y(i)&&(i=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var a=e.pid;o[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,a,e)}}else o[r]=function(){};return o[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=d,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=b,t.isObject=w,t.isDate=x,t.isError=_,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(121);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(6),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),a=r.length;a--;)e[r[a]]=t[r[a]];return e};var F="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(F&&e[F]){var t;if("function"!=typeof(t=e[F]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,F,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,a=new Promise((function(e,a){t=e,r=a})),n=[],i=0;i",y=d?">":"<",b=void 0;if(v){var w=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+i,_="exclType"+i,A="exclIsNumber"+i,E="' + "+(T="op"+i)+" + '";n+=" var schemaExcl"+i+" = "+w+"; ",n+=" var "+x+"; var "+_+" = typeof "+(w="schemaExcl"+i)+"; if ("+_+" != 'boolean' && "+_+" != 'undefined' && "+_+" != 'number') { ";var S;b=p;(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var M=n;n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+_+" == 'number' ? ( ("+x+" = "+a+" === undefined || "+w+" "+g+"= "+a+") ? "+f+" "+y+"= "+w+" : "+f+" "+y+" "+a+" ) : ( ("+x+" = "+w+" === true) ? "+f+" "+y+"= "+a+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { var op"+i+" = "+x+" ? '"+g+"' : '"+g+"='; ",void 0===s&&(b=p,u=e.errSchemaPath+"/"+p,a=w,h=v)}else{E=g;if((A="number"==typeof m)&&h){var T="'"+E+"'";n+=" if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" ( "+a+" === undefined || "+m+" "+g+"= "+a+" ? "+f+" "+y+"= "+m+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { "}else{A&&void 0===s?(x=!0,b=p,u=e.errSchemaPath+"/"+p,a=m,y+="="):(A&&(a=Math[d?"min":"max"](m,s)),m===(!A||a)?(x=!0,b=p,u=e.errSchemaPath+"/"+p,y+="="):(x=!1,E+="="));T="'"+E+"'";n+=" if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+" "+y+" "+a+" || "+f+" !== "+f+") { "}}b=b||t,(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+T+", limit: "+a+", exclusive: "+x+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+E+" ",n+=h?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";M=n;return n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),h=e.opts.$data&&s&&s.$data;h?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+".length "+("maxItems"==t?">":"<")+" "+a+") { ";var d=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=h?"' + "+a+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),h=e.opts.$data&&s&&s.$data;h?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s;var d="maxLength"==t?">":"<";n+="if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?n+=" "+f+".length ":n+=" ucs2length("+f+") ",n+=" "+d+" "+a+") { ";var p=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=h?"' + "+a+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),h=e.opts.$data&&s&&s.$data;h?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" Object.keys("+f+").length "+("maxProperties"==t?">":"<")+" "+a+") { ";var d=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(d||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=h?"' + "+a+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},function(e){e.exports=JSON.parse('{"switch":{"title":"switch","type":"array","items":[{"enum":["switch"]},{"type":"object","properties":{"compareTo":{"$ref":"definitions#/definitions/contextualizedFieldName"},"compareToValue":{"type":"string"},"fields":{"type":"object","patternProperties":{"^[-a-zA-Z0-9 _:]+$":{"$ref":"dataType"}},"additionalProperties":false},"default":{"$ref":"dataType"}},"oneOf":[{"required":["compareTo","fields"]},{"required":["compareToValue","fields"]}],"additionalProperties":false}],"additionalItems":false},"option":{"title":"option","type":"array","items":[{"enum":["option"]},{"$ref":"dataType"}],"additionalItems":false}}')},function(e,t,r){"use strict";(function(t,a){var n;e.exports=S,S.ReadableState=E;r(19).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(71),s=r(7).Buffer,l=t.Uint8Array||function(){};var u,c=r(174);u=c&&c.debuglog?c.debuglog("stream"):function(){};var f,h,d,p=r(175),m=r(72),v=r(73).getHighWaterMark,g=r(17).codes,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,x=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6)(S,o);var _=m.errorOrDestroy,A=["error","close","destroy","pause","resume"];function E(e,t,a){n=n||r(18),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",a),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(25).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(18),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function M(e,t,r,a,n){u("readableAddChunk",t);var i,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}(e,o);else if(n||(i=function(e,t){var r;a=t,s.isBuffer(a)||a instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var a;return r}(o,t)),i)_(e,i);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),a)o.endEmitted?_(e,new x):T(e,o,t,!0);else if(o.ended)_(e,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):C(e,o)):T(e,o,t,!1)}else a||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,a.nextTick(L,e))}function L(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function C(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(k,e,t))}function k(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){u("readable nexttick read 0"),e.read(0)}function N(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,a.nextTick(B,t,e))}function B(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function V(e,t){for(var r=0,a=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=F(e,t))&&t.ended)return 0===t.length&&j(this),null;var a,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==a&&this.emit("data",a),a},S.prototype._read=function(e){_(this,new w("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?l:v;function s(t,a){u("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",d),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",v),r.removeListener("data",h),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){u("onend"),e.end()}n.endEmitted?a.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var f=!1;function h(t){u("ondata");var a=e.write(t);u("dest.write",a),!1===a&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!f&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(t){u("onerror",t),v(),e.removeListener("error",d),0===i(e,"error")&&_(e,t)}function p(){e.removeListener("finish",m),v()}function m(){u("onfinish"),e.removeListener("close",p),v()}function v(){u("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",d),e.once("close",p),e.once("finish",m),e.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?O(this):n.reading||a.nextTick(I,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&a.nextTick(R,this),r},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||a.nextTick(R,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(N,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(a=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,L(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=f.destroy,S.prototype._undestroy=f.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this,r(4),r(5))},function(e,t,r){"use strict";e.exports=c;var a=r(17).codes,n=a.ERR_METHOD_NOT_IMPLEMENTED,i=a.ERR_MULTIPLE_CALLBACK,o=a.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=a.ERR_TRANSFORM_WITH_LENGTH_0,l=r(18);function u(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(null===a)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),a(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{i=!0,o.needsUpdate=!0,u&&(u.needsUpdate=!0);let c=-1;32===o.image.height?c=0:64===o.image.height?c=1:console.error("Couldn't detect texture version. Invalid dimensions: "+o.image.width+"x"+o.image.height),console.log("Skin Texture Version: "+c),o.magFilter=t.NearestFilter,o.minFilter=t.NearestFilter,o.anisotropy=0,u&&(u.magFilter=t.NearestFilter,u.minFilter=t.NearestFilter,u.anisotropy=0,u.format=t.RGBFormat),32===o.image.height&&(o.format=t.RGBFormat),n.attached||n._scene?console.log("[SkinRender] is attached - skipping scene init"):super.initScene((function(){n.element.dispatchEvent(new CustomEvent("skinRender",{detail:{playerModel:n.playerModel}}))})),console.log("Slim: "+f);let h=function(e,r,n,i,o){console.log("capeType: "+o);let u=new t.Object3D;u.name="headGroup",u.position.x=0,u.position.y=28,u.position.z=0,u.translateOnAxis(new t.Vector3(0,1,0),-4);let c=s(e,8,8,8,a.a.head[n],i,"head");if(c.translateOnAxis(new t.Vector3(0,1,0),4),u.add(c),n>=1){let r=s(e,8.504,8.504,8.504,a.a.hat,i,"hat",!0);r.translateOnAxis(new t.Vector3(0,1,0),4),u.add(r)}let f=new t.Object3D;f.name="bodyGroup",f.position.x=0,f.position.y=18,f.position.z=0;let h=s(e,8,12,4,a.a.body[n],i,"body");if(f.add(h),n>=1){let t=s(e,8.504,12.504,4.504,a.a.jacket,i,"jacket",!0);f.add(t)}let d=new t.Object3D;d.name="leftArmGroup",d.position.x=i?-5.5:-6,d.position.y=18,d.position.z=0,d.translateOnAxis(new t.Vector3(0,1,0),4);let p=s(e,i?3:4,12,4,a.a.leftArm[n],i,"leftArm");if(p.translateOnAxis(new t.Vector3(0,1,0),-4),d.add(p),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.leftSleeve,i,"leftSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),d.add(r)}let m=new t.Object3D;m.name="rightArmGroup",m.position.x=i?5.5:6,m.position.y=18,m.position.z=0,m.translateOnAxis(new t.Vector3(0,1,0),4);let v=s(e,i?3:4,12,4,a.a.rightArm[n],i,"rightArm");if(v.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(v),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.rightSleeve,i,"rightSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(r)}let g=new t.Object3D;g.name="leftLegGroup",g.position.x=-2,g.position.y=6,g.position.z=0,g.translateOnAxis(new t.Vector3(0,1,0),4);let y=s(e,4,12,4,a.a.leftLeg[n],i,"leftLeg");if(y.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(y),n>=1){let r=s(e,4.504,12.504,4.504,a.a.leftTrousers,i,"leftTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(r)}let b=new t.Object3D;b.name="rightLegGroup",b.position.x=2,b.position.y=6,b.position.z=0,b.translateOnAxis(new t.Vector3(0,1,0),4);let w=s(e,4,12,4,a.a.rightLeg[n],i,"rightLeg");if(w.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(w),n>=1){let r=s(e,4.504,12.504,4.504,a.a.rightTrousers,i,"rightTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(r)}let x=new t.Object3D;if(x.add(u),x.add(f),x.add(d),x.add(m),x.add(g),x.add(b),r){console.log(a.a);let e=a.a.capeRelative;"optifine"===o&&(e=a.a.capeOptifineRelative),"labymod"===o&&(e=a.a.capeLabymodRelative),e=JSON.parse(JSON.stringify(e)),console.log(e);for(let t in e)e[t].x*=r.image.width,e[t].w*=r.image.width,e[t].y*=r.image.height,e[t].h*=r.image.height;console.log(e);let n=new t.Object3D;n.name="capeGroup",n.position.x=0,n.position.y=16,n.position.z=-2.5,n.translateOnAxis(new t.Vector3(0,1,0),8),n.translateOnAxis(new t.Vector3(0,0,1),.5);let i=s(r,10,16,1,e,!1,"cape");i.rotation.x=l(10),i.translateOnAxis(new t.Vector3(0,1,0),-8),i.translateOnAxis(new t.Vector3(0,0,1),-.5),i.rotation.y=l(180),n.add(i),x.add(n)}return x}(o,u,c,f,e._capeType?e._capeType:e.optifine?"optifine":"minecraft");n.addToScene(h),n.playerModel=h,"function"==typeof r&&r()};n._skinImage=new Image,n._skinImage.crossOrigin="anonymous",n._capeImage=new Image,n._capeImage.crossOrigin="anonymous";let c=void 0!==e.cape||void 0!==e.capeUrl||void 0!==e.capeData||void 0!==e.mineskin,f=!1,h=!1,d=!1,p=new t.Texture,m=new t.Texture;if(p.image=n._skinImage,n._skinImage.onload=function(){if(n._skinImage){if(h=!0,console.log("Skin Image Loaded"),void 0===e.slim&&32!==n._skinImage.height){let e=document.createElement("canvas"),t=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,t.drawImage(n._skinImage,0,0),console.log("Slim Detection:");let r=t.getImageData(46,52,1,12).data,a=t.getImageData(54,20,1,12).data,i=!0;for(let e=3;e<48;e+=4){if(255===r[e]){i=!1;break}if(255===a[e]){i=!1;break}}console.log(i),i&&(f=!0)}if(n.options.makeNonTransparentOpaque&&32!==n._skinImage.height){let e=document.createElement("canvas"),a=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,a.drawImage(n._skinImage,0,0);let i=document.createElement("canvas"),o=i.getContext("2d");i.width=n._skinImage.width,i.height=n._skinImage.height;let s=a.getImageData(0,0,e.width,e.height),l=s.data;function r(e,t){return e>0&&t>0&&e<32&&t<32||(e>32&&t>16&&e<64&&t<32||e>16&&t>48&&e<48&&t<64)}for(let t=0;t178||r(n,i))&&(l[t+3]=255)}o.putImageData(s,0,0),console.log(i.toDataURL()),p=new t.CanvasTexture(i)}!h||!d&&c||i||o(p,m)}},n._skinImage.onerror=function(e){console.warn("Skin Image Error"),console.warn(e)},console.log("Has Cape: "+c),c?(m.image=n._capeImage,n._capeImage.onload=function(){n._capeImage&&(d=!0,console.log("Cape Image Loaded"),d&&h&&(i||o(p,m)))},n._capeImage.onerror=function(e){console.warn("Cape Image Error"),console.warn(e),d=!0,h&&(i||o(p))}):(m=null,n._capeImage=null),"string"==typeof e)0===e.indexOf("http")?n._skinImage.src=e:e.length<=16?u("https://minerender.org/nameToUuid.php?name="+e,(function(t,r){if(t)return console.log(t);console.log(r),n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e)})):e.length<=36?image.src="https://crafatar.com/skins/"+e+"?overlay":n._skinImage.src=e;else{if("object"!=typeof e)throw new Error("Invalid texture value");if(e.url?n._skinImage.src=e.url:e.data?n._skinImage.src=e.data:e.username?u("https://minerender.org/nameToUuid.php?name="+e.username,(function(t,r){if(t)return console.log(t);n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e.username)+"?overlay"})):e.uuid?n._skinImage.src="https://crafatar.com/skins/"+e.uuid+"?overlay":e.mineskin&&(n._skinImage.src="https://api.mineskin.org/render/texture/"+e.mineskin),e.cape)if(e.cape.length>36){u(e.cape.startsWith("http")?e.cape:"https://api.capes.dev/get/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else{let t="https://api.capes.dev/load/";e.capeUser?t+=e.capeUser:e.username?t+=e.username:e.uuid?t+=e.uuid:console.warn("Couldn't find a user to get a cape from"),u(t+="/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else e.capeUrl?n._capeImage.src=e.capeUrl:e.capeData?n._capeImage.src=e.capeData:e.mineskin&&(n._capeImage.src="https://api.mineskin.org/render/texture/"+e.mineskin+"/cape");f=e.slim}}resize(e,t){return this._resize(e,t)}reset(){this._skinImage=null,this._capeImage=null,this._animId&&cancelAnimationFrame(this._animId),this._canvas&&this._canvas.remove()}getPlayerModel(){return this.playerModel}getModelByName(e){return this._scene.getObjectByName(e,!0)}toggleSkinPart(e,t){this._scene.getObjectByName(e,!0).visible=t}}function s(e,r,a,n,i,o,s,l){let u=e.image.width,c=e.image.height,f=new t.BoxGeometry(r,a,n),h=new t.MeshBasicMaterial({map:e,transparent:l||!1,alphaTest:.1,side:l?t.DoubleSide:t.FrontSide});f.computeBoundingBox(),f.faceVertexUvs[0]=[];let d=["right","left","top","bottom","front","back"],p=[];for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{tolerance:0};if(!e)throw new Error("You should specify the element you want to test");"string"==typeof e&&(e=document.querySelector(e));var r=e.getBoundingClientRect();return(r.bottom-t.tolerance>0&&r.right-t.tolerance>0&&r.left+t.tolerance<(window.innerWidth||document.documentElement.clientWidth)&&r.top+t.tolerance<(window.innerHeight||document.documentElement.clientHeight))}function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0,container:""};if(!e)throw new Error("You should specify the element you want to test");if("string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={tolerance:0,container:document.querySelector(t)}),"string"==typeof t.container&&(t.container=document.querySelector(t.container)),t instanceof HTMLElement&&(t={tolerance:0,container:t}),!t.container)throw new Error("You should specify a container element");var r=t.container.getBoundingClientRect();return(e.offsetTop+e.clientHeight-t.tolerance>t.container.scrollTop&&e.offsetLeft+e.clientWidth-t.tolerance>t.container.scrollLeft&&e.offsetLeft+t.tolerance0&&void 0!==arguments[0]?arguments[0]:{tolerance:0,debounce:100,container:window};this.options={},this.trackedElements={},Object.defineProperties(this.options,{container:{configurable:!1,enumerable:!1,get:function(){var e=void 0;return"string"==typeof n.container?e=document.querySelector(n.container):n.container instanceof HTMLElement&&(e=n.container),e||window},set:function(e){n.container=e}},debounce:{get:function(){return parseInt(n.debounce,10)||100},set:function(e){n.debounce=e}},tolerance:{get:function(){return parseInt(n.tolerance,10)||0},set:function(e){n.tolerance=e}}}),Object.defineProperty(this,"_scroll",{enumerable:!1,configurable:!1,writable:!1,value:this._debouncedScroll.call(this)}),e=document.querySelector("body"),t=function(){Object.keys(a.trackedElements).forEach((function(e){a.on("enter",e),a.on("leave",e)}))},(r=window.MutationObserver||window.WebKitMutationObserver)?new r(t).observe(e,{childList:!0,subtree:!0}):(e.addEventListener("DOMNodeInserted",t,!1),e.addEventListener("DOMNodeRemoved",t,!1)),this.attach()}return Object.defineProperties(r.prototype,{_debouncedScroll:{configurable:!1,writable:!1,enumerable:!1,value:function(){var r=this,a=void 0;return function(){clearTimeout(a),a=setTimeout((function(){!function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0},n=Object.keys(r),i=void 0;n.length&&(i=a.container===window?e:t,n.forEach((function(e){r[e].nodes.forEach((function(t){if(i(t.node,a)?(t.wasVisible=t.isVisible,t.isVisible=!0):(t.wasVisible=t.isVisible,t.isVisible=!1),!0===t.isVisible&&!1===t.wasVisible){if(!r[e].enter)return;Object.keys(r[e].enter).forEach((function(a){"function"==typeof r[e].enter[a]&&r[e].enter[a](t.node,"enter")}))}if(!1===t.isVisible&&!0===t.wasVisible){if(!r[e].leave)return;Object.keys(r[e].leave).forEach((function(a){"function"==typeof r[e].leave[a]&&r[e].leave[a](t.node,"leave")}))}}))})))}(r.trackedElements,r.options)}),r.options.debounce)}}},attach:{configurable:!1,writable:!1,enumerable:!1,value:function(){var e=this.options.container;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.addEventListener("scroll",this._scroll,{passive:!0}),window.addEventListener("resize",this._scroll,{passive:!0}),this._scroll(),this.attached=!0}},destroy:{configurable:!1,writable:!1,enumerable:!1,value:function(){this.options.container.removeEventListener("scroll",this._scroll),window.removeEventListener("resize",this._scroll),this.attached=!1}},off:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){var a=Object.keys(this.trackedElements[t].enter||{}),n=Object.keys(this.trackedElements[t].leave||{});if({}.hasOwnProperty.call(this.trackedElements,t))if(r){if(this.trackedElements[t][e]){var i="function"==typeof r?r.name:r;delete this.trackedElements[t][e][i]}}else delete this.trackedElements[t][e];a.length||n.length||delete this.trackedElements[t]}},on:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){if(!e)throw new Error("No event given. Choose either enter or leave");if(!t)throw new Error("No selector to track");if(["enter","leave"].indexOf(e)<0)throw new Error(e+" event is not supported");({}).hasOwnProperty.call(this.trackedElements,t)||(this.trackedElements[t]={}),this.trackedElements[t].nodes=[];for(var a=0,n=document.querySelectorAll(t);a{let s=e[t];"string"==typeof s&&(s={texture:s}),s.textureScale||(s.textureScale=1),Object(i.d)(r.options.assetRoot,"minecraft","",s.texture).then(e=>{let t=function(e){let t=(new a.TextureLoader).load(e,(function(){t.magFilter=a.NearestFilter,t.minFilter=a.NearestFilter,t.anisotropy=0,t.needsUpdate=!0;let e=new a.MeshBasicMaterial({map:t,transparent:!0,side:a.DoubleSide,alphaTest:.5});e.userData.layer=s,n(e)}))};if(s.uv){s.uv=[s.uv[0]*s.textureScale,s.uv[1]*s.textureScale,s.uv[2]*s.textureScale,s.uv[3]*s.textureScale];let r=new Image;r.onload=function(){let e=document.createElement("canvas");e.width=s.uv[2]-s.uv[0],e.height=s.uv[3]-s.uv[1],e.getContext("2d").drawImage(r,s.uv[0],s.uv[1],s.uv[2]-s.uv[0],s.uv[3]-s.uv[1],0,0,s.uv[2]-s.uv[0],s.uv[3]-s.uv[1]),t(e.toDataURL("image/png"))},r.crossOrigin="anonymous",r.src=e}else t(e)})}));Promise.all(n).then(e=>{let n=new a.Object3D,i=0,o=0;for(let t=0;ti&&(i=f),h>o&&(o=h);let d=new a.PlaneGeometry(f,h),p=new a.Mesh(d,s);if(p.name=s.userData.layer.texture.toLowerCase()+(s.userData.layer.name?"_"+s.userData.layer.name.toLowerCase():""),p.position.set(0,0,0),p.applyMatrix((new a.Matrix4).makeTranslation(f/2,h/2,0)),s.userData.layer.pos?p.applyMatrix((new a.Matrix4).makeTranslation(s.userData.layer.pos[0],-h-s.userData.layer.pos[1],0)):p.applyMatrix((new a.Matrix4).makeTranslation(0,-h,0)),s.userData.layer.layer&&(p.layers.set(s.userData.layer.layer),r._camera.layers.enable(s.userData.layer.layer)),n.add(p),r.options.showOutlines){let e=new a.BoxHelper(p,16711680);n.add(e),s.userData.layer.layer&&e.layers.set(s.userData.layer.layer)}}n.applyMatrix((new a.Matrix4).makeTranslation(-i/2,o/2,0)),r.addToScene(n),r.gui=n,r.attached||(r._camera.position.set(0,0,Math.max(i,o)),r._camera.fov=2*Math.atan(Math.max(i,o)/(2*Math.max(i,o)))*(180/Math.PI),r._camera.updateProjectionMatrix()),"function"==typeof t&&t()})}}u.Positions=o.a,u.Helper=s.a,"undefined"!=typeof window&&(window.GuiRender=u),void 0!==e&&(e.GuiRender=u),t.default=u}.call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(9);var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),e.scene=new n.Scene,e.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),e.quad.frustumCulled=!1,e.scene.add(e.quad),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((a=i)&&a.__esModule?a:{default:a}).default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:this.clock.getDelta(),t=this.renderer.getRenderTarget(),r=!1,a=void 0,n=void 0,i=this.passes.length;for(n=0;n0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*a;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?s(l=e,i,"day")||s(l,n,"hour")||s(l,a,"minute")||s(l,r,"second")||l+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=n)return Math.round(e/n)+"h";if(e>=a)return Math.round(e/a)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";(function(e){var t=r(0),a=(r(42),r(43),r(13)),n=r(2),i=r(44),o=r(28),s=r(1),l=r(29),u=r.n(l),c=(r(76),r(185),r(12));r(89)(t);const f=c("minerender"),h=186;String.prototype.replaceAll=function(e,t){return this.replace(new RegExp(e,"g"),t)};const d=[16711680,65535,255,128,16711935,8388736,8421376,65280,32768,16776960,8388608,32896],p=["east","west","up","down","south","north"],m=["lightgreen"],v={},g={},y={},b={},w={},x={},_={},A={},E=[];let S={camera:{type:"perspective",x:35,y:25,z:20,target:[0,0,0]},type:"block",centerCubes:!1,assetRoot:n.a,useWebWorkers:!1};class M extends a.b{constructor(e,t){super(e,S,t),this.renderType="ModelRender",this.models=[],this.instancePositionMap={},this.attached=!1}render(e,r){let a=this;a.attached||a._scene?console.log("[ModelRender] is attached - skipping scene init"):super.initScene((function(){for(let e=0;e{if(e.options.useWebWorkers){let a=u()(h);a.addEventListener("message",e=>{r.push(...e.data.parsedModelList),t()}),a.postMessage({func:"parseModel",model:i,modelOptions:i,parsedModelList:r,assetRoot:e.options.assetRoot})}else Object(s.e)(i,i,r,e.options.assetRoot).then(()=>{t()})}))}return Promise.all(a)})(a,e,n).then(()=>(function(e,t){console.timeEnd("parseModels"),console.time("loadAndMergeModels");let r=[];console.log("Loading Model JSON data & merging...");let a={};for(let e=0;e{let a=n[t],i=Object(s.d)(a);if(f("loadAndMerge "+i),v.hasOwnProperty(i))r();else if(e.options.useWebWorkers){let t=u()(h);t.addEventListener("message",e=>{v[i]=e.data.mergedModel,r()}),t.postMessage({func:"loadAndMergeModel",model:a,assetRoot:e.options.assetRoot})}else Object(s.b)(a,e.options.assetRoot).then(e=>{v[i]=e,r()})}));return Promise.all(r)})(a,n)).then(()=>(function(e,t){console.timeEnd("loadAndMergeModels"),console.time("loadModelTextures");let r=[];console.log("Loading Textures...");let a={};for(let e=0;e{let a=n[t],i=Object(s.d)(a);f("loadTexture "+i);let o=v[i];if(g.hasOwnProperty(i))r();else{if(!o)return console.warn("Missing merged model"),console.warn(a.name),void r();if(!o.textures)return console.warn("The model doesn't have any textures!"),console.warn("Please make sure you're using the proper file."),console.warn(a.name),void r();if(e.options.useWebWorkers){let t=u()(h);t.addEventListener("message",e=>{g[i]=e.data.textures,r()}),t.postMessage({func:"loadTextures",textures:o.textures,assetRoot:e.options.assetRoot})}else Object(s.c)(o.textures,e.options.assetRoot).then(e=>{g[i]=e,r()})}}));return Promise.all(r)})(a,n)).then(()=>(function(e,r){console.timeEnd("loadModelTextures"),console.time("doModelRender"),console.log("Rendering Models...");let a=[];for(let n=0;n{let i=r[n],o=v[Object(s.d)(i)],l=g[Object(s.d)(i)],u=i.offset||[0,0,0],c=i.rotation||[0,0,0],f=i.scale||[1,1,1];if(i.options.hasOwnProperty("display")&&o.hasOwnProperty("display")&&o.display.hasOwnProperty(i.options.display)){let e=o.display[i.options.display];e.hasOwnProperty("translation")&&(u=[u[0]+e.translation[0],u[1]+e.translation[1],u[2]+e.translation[2]]),e.hasOwnProperty("rotation")&&(c=[c[0]+e.rotation[0],c[1]+e.rotation[1],c[2]+e.rotation[2]]),e.hasOwnProperty("scale")&&(f=[e.scale[0],e.scale[1],e.scale[2]])}T(e,o,l,o.textures,i.type,i.name,i.variant,u,c,f).then(r=>{if(r.firstInstance){let a=new t.Object3D;a.add(r.mesh),e.models.push(a),e.addToScene(a)}a(r)})}));return Promise.all(a)})(a,n)).then(e=>{console.timeEnd("doModelRender"),f(e),"function"==typeof r&&r()})}}let T=function(e,r,n,i,o,l,u,c,h,d){return new Promise(p=>{if(r.hasOwnProperty("elements")){let m=Object(s.d)({type:o,name:l,variant:u}),v=y[m],g=function(r,a){r.userData.modelType=o,r.userData.modelName=l;let n=new t.Vector3,i=new t.Vector3,u=new t.Quaternion,f={key:m,index:a,offset:c,scale:d,rotation:h};h&&r.setQuaternionAt(a,u.setFromEuler(new t.Euler(Object(s.f)(h[0]),Object(s.f)(Math.abs(h[0])>0?h[1]:-h[1]),Object(s.f)(h[2])))),c&&(r.setPositionAt(a,n.set(c[0],c[1],c[2])),e.instancePositionMap[c[0]+"_"+c[1]+"_"+c[2]]=f),d&&r.setScaleAt(a,i.set(d[0],d[1],d[2])),r.needsUpdate(),p({mesh:r,firstInstance:0===a})},b=function(e,r){let a;if(e.translate(-8,-8,-8),A.hasOwnProperty(m))f("Using cached instance ("+m+")"),a=A[m];else{f("Caching new model instance "+m+" (with "+v+" instances)");let n=new t.InstancedMesh(e,r,v,!1,!1,!1);a={instance:n,index:0},A[m]=a;let i=new t.Vector3,o=new t.Vector3(1,1,1),s=new t.Quaternion;for(let e=0;e{let a=l.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_"+(o.__comment?o.__comment.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_":"");L(o.to[0]-o.from[0],o.to[1]-o.from[1],o.to[2]-o.from[2],a+Date.now(),o.faces,u,n,i,e.options.assetRoot,a).then(e=>{e.applyMatrix((new t.Matrix4).makeTranslation((o.to[0]-o.from[0])/2,(o.to[1]-o.from[1])/2,(o.to[2]-o.from[2])/2)),e.applyMatrix((new t.Matrix4).makeTranslation(o.from[0],o.from[1],o.from[2])),o.rotation&&C(e,new t.Vector3(o.rotation.origin[0],o.rotation.origin[1],o.rotation.origin[2]),new t.Vector3("x"===o.rotation.axis?1:0,"y"===o.rotation.axis?1:0,"z"===o.rotation.axis?1:0),Object(s.f)(o.rotation.angle)),r(e)})}))}Promise.all(w).then(e=>{let t=Object(a.c)(e,!0);t.sourceSize=e.length,b(t.geometry,t.materials,e.length);for(let t=0;t{c&&e.applyMatrix((new t.Matrix4).makeTranslation(c[0],c[1],c[2])),h&&e.rotation.set(Object(s.f)(h[0]),Object(s.f)(Math.abs(h[0])>0?h[1]:-h[1]),Object(s.f)(h[2])),d&&e.scale.set(d[0],d[1],d[2]),p({mesh:e,firstInstance:!0})})})};function P(e,r,a,n){let i=A[e];if(i&&i.instance){let e,o=i.instance;e=n?r||[1,1,1]:[0,0,0];let s=new t.Vector3;return o.setScaleAt(a,s.set(e[0],e[1],e[2])),o}}function F(e,t){let r={};for(let a of e){let e=this.instancePositionMap[a[0]+"_"+a[1]+"_"+a[2]];if(e){let a=P(e.key,e.scale,e.index,t);a&&(r[e.key]=a)}}for(let e of Object.values(r))e.needsUpdate()}M.prototype.setVisibilityAtMulti=F,M.prototype.setVisibilityAt=function(e,t,r,a){F([[e,t,r]],a)},M.prototype.setVisibilityOfType=function(e,t,r,a){let n=A[Object(s.d)({type:e,name:t,variant:r})];if(n&&n.instance){n.instance.visible=a}};let O=function(e,r){return new Promise(a=>{let n=function(r,n,i){let o=new t.PlaneGeometry(n,i),s=new t.Mesh(o,r);s.name=e,s.receiveShadow=!0,a(s)};if(r){let a=0,i=0,s=[];for(let e in r)r.hasOwnProperty(e)&&s.push(new Promise(t=>{let n=new Image;n.onload=function(){n.width>a&&(a=n.width),n.height>i&&(i=n.height),t(n)},n.src=r[e]}));Promise.all(s).then(r=>{let s=document.createElement("canvas");s.width=a,s.height=i;let l=s.getContext("2d");for(let e=0;e{let A,S=e+"_"+r+"_"+a;_.hasOwnProperty(S)?(f("Using cached Geometry ("+S+")"),A=_[S]):(A=new t.BoxGeometry(e,r,a),f("Caching Geometry "+S),_[S]=A);let M=function(e){let r=new t.Mesh(A,e);r.name=i,r.receiveShadow=!0,y(r)};if(c){let e=[];for(let r=0;r<6;r++)e.push(new Promise(e=>{let a=p[r];if(!l.hasOwnProperty(a))return void e(null);let d=l[a],y=d.texture.substr(1);if(!c.hasOwnProperty(y)||!c[y])return console.warn("Missing texture '"+y+"' for face "+a+" in model "+i),void e(null);let _=y+"_"+a+"_"+g,A=r=>{let l=function(r){let n=r.dataUrl,o=r.dataUrlHash,l=r.hasTransparency;if(x.hasOwnProperty(o))return f("Using cached Material ("+o+", without meta)"),void e(x[o]);let u=h[y];u.startsWith("#")&&(u=h[i.substr(1)]),f("Pre-Caching Material "+o+", without meta"),x[o]=new t.MeshBasicMaterial({map:null,transparent:l,side:l?t.DoubleSide:t.FrontSide,alphaTest:.5,name:a+"_"+y+"_"+u});let c=function(t){f("Finalizing Cached Material "+o+", without meta"),x[o].map=t,x[o].needsUpdate=!0,e(x[o])};if(b.hasOwnProperty(o))return f("Using cached Texture ("+o+")"),void c(b[o]);f("Pre-Caching Texture "+o),b[o]=(new t.TextureLoader).load(n,(function(e){e.magFilter=t.NearestFilter,e.minFilter=t.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,d.hasOwnProperty("rotation")&&(e.center.x=.5,e.center.y=.5,e.rotation=Object(s.f)(d.rotation)),f("Caching Texture "+o),b[o]=e,c(e)}))};if(r.height>r.width&&r.height%r.width==0){let a=h[y];a.startsWith("#")&&(a=h[a.substr(1)]),-1!==a.indexOf("/")&&(a=a.substr(a.indexOf("/")+1)),Object(n.e)(a,v).then(a=>{!function(r,a){let n=r.dataUrlHash,i=r.hasTransparency;if(x.hasOwnProperty(n))return f("Using cached Material ("+n+", with meta)"),void e(x[n]);f("Pre-Caching Material "+n+", with meta"),x[n]=new t.MeshBasicMaterial({map:null,transparent:i,side:i?t.DoubleSide:t.FrontSide,alphaTest:.5});let s=1;a.hasOwnProperty("animation")&&a.animation.hasOwnProperty("frametime")&&(s=a.animation.frametime);let l=Math.floor(r.height/r.width);console.log("Generating animated texture...");let u=[];for(let e=0;e{let n=document.createElement("canvas");n.width=r.width,n.height=r.width,n.getContext("2d").drawImage(r.canvas,0,e*r.width,r.width,r.width,0,0,r.width,r.width);let i=n.toDataURL("image/png"),s=o(i);if(b.hasOwnProperty(s))return f("Using cached Texture ("+s+")"),void a(b[s]);f("Pre-Caching Texture "+s),b[s]=(new t.TextureLoader).load(i,(function(e){e.magFilter=t.NearestFilter,e.minFilter=t.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,f("Caching Texture "+s+", without meta"),b[s]=e,a(e)}))}));Promise.all(u).then(t=>{let r=0,a=0;E.push(()=>{r>=s&&(r=0,x[n].map=t[a],a++),a>=t.length&&(a=0),r+=.1}),f("Finalizing Cached Material "+n+", with meta"),x[n].map=t[0],x[n].needsUpdate=!0,e(x[n])})}(r,a)}).catch(()=>{l(r)})}else l(r)};if(w.hasOwnProperty(_)){let e=w[_];if(e.hasOwnProperty("img")){f("Waiting for canvas image that's already loading ("+_+")"),e.img.waitingForCanvas.push((function(e){A(e)}))}else f("Using cached canvas ("+_+")"),A(w[_])}else{let t=new Image;t.onerror=function(t){console.warn(t),e(null)},t.waitingForCanvas=[],t.onload=function(){let e=(e=>{let t=d.uv;t||(t=u[a].uv),t=[Object(n.f)(t[0],e.width),Object(n.f)(t[1],e.height),Object(n.f)(t[2],e.width),Object(n.f)(t[3],e.height)];let r=document.createElement("canvas");r.width=Math.abs(t[2]-t[0]),r.height=Math.abs(t[3]-t[1]);let i,s=r.getContext("2d");s.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),r.width,r.height,0,0,r.width,r.height),d.hasOwnProperty("tintindex")?i=m[d.tintindex]:g.startsWith("water_")&&(i="blue"),i&&(s.fillStyle=i,s.globalCompositeOperation="multiply",s.fillRect(0,0,r.width,r.height),s.globalAlpha=1,s.globalCompositeOperation="destination-in",s.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),r.width,r.height,0,0,r.width,r.height));let l=s.getImageData(0,0,r.width,r.height).data,c=!1;for(let e=3;eM(e))}else{let e=[];for(let r=0;r<6;r++)e.push(new t.MeshBasicMaterial({color:d[r+2],wireframe:!0}));M(e)}})};function C(e,t,r,a){e.position.sub(t),e.position.applyAxisAngle(r,a),e.position.add(t),e.rotateOnAxis(r,a)}M.cache={loadedTextures:g,mergedModels:v,instanceCount:y,texture:b,canvas:w,material:x,geometry:_,instances:A,animated:E,resetInstances:function(){Object(s.a)(y),Object(s.a)(A)},clearAll:function(){Object(s.a)(g),Object(s.a)(v),Object(s.a)(y),Object(s.a)(b),Object(s.a)(w),Object(s.a)(x),Object(s.a)(_),Object(s.a)(A),E.splice(0,E.length)}},M.ModelConverter=i.a,"undefined"!=typeof window&&(window.ModelRender=M,window.ModelConverter=i.a),void 0!==e&&(e.ModelRender=M)}).call(this,r(4))},function(e,t,r){e.exports=function(e){const t=parseInt(e.REVISION)>=96;r(90)(e);var a=new e.MeshDepthMaterial;a.depthPacking=e.RGBADepthPacking,a.clipping=!0,a.defines={INSTANCE_TRANSFORM:""};var n=e.ShaderLib.distanceRGBA,i=e.UniformsUtils.clone(n.uniforms),o=new e.ShaderMaterial({defines:{USE_SHADOWMAP:"",INSTANCE_TRANSFORM:""},uniforms:i,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,clipping:!0});return e.InstancedMesh=function(t,r,n,i,s,l){e.Mesh.call(this,(new e.InstancedBufferGeometry).copy(t)),this._dynamic=!!i,this._uniformScale=!!l,this._colors=!!s,this.numInstances=n,this._setAttributes(),this.material=r,this.frustumCulled=!1,this.customDepthMaterial=a,this.customDistanceMaterial=o},e.InstancedMesh.prototype=Object.create(e.Mesh.prototype),e.InstancedMesh.constructor=e.InstancedMesh,Object.defineProperties(e.InstancedMesh.prototype,{material:{set:function(e){let t=function(e){e.defines?(e.defines.INSTANCE_TRANSFORM="",this._uniformScale?e.defines.INSTANCE_UNIFORM="":delete e.defines.INSTANCE_UNIFORM,this._colors?e.defines.INSTANCE_COLOR="":delete e.defines.INSTANCE_COLOR):(e.defines={INSTANCE_TRANSFORM:""},this._uniformScale&&(e.defines.INSTANCE_UNIFORM=""),this._colors&&(e.defines.INSTANCE_COLOR=""))};if(Array.isArray(e)){e=e.slice(0);for(let r=0;r{const n=r[a];let i;t?i=new e.InstancedBufferAttribute(...n):(i=new e.InstancedBufferAttribute(n[0],n[1],n[3])).normalized=n[2],i.dynamic=this._dynamic,this.geometry.addAttribute(a,i)})},e.InstancedMesh}},function(e,t,r){e.exports=function(e){return/InstancedMesh/.test(e.REVISION)?e:(r(91)(e),e.REVISION+="_InstancedMesh",e)}},function(e,t,r){e.exports=function(e){e.ShaderChunk.begin_vertex=r(92),e.ShaderChunk.color_fragment=r(93),e.ShaderChunk.color_pars_fragment=r(94),e.ShaderChunk.color_vertex=r(95),e.ShaderChunk.defaultnormal_vertex=r(96),e.ShaderChunk.uv_pars_vertex=r(97)}},function(e,t){e.exports=["#ifndef INSTANCE_TRANSFORM","vec3 transformed = vec3( position );","#else","#ifndef INSTANCE_MATRIX","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","vec3 transformed = ( _instanceMatrix * vec4( position , 1. )).xyz;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","diffuseColor.rgb *= vColor;","#endif","#if defined(INSTANCE_COLOR)","diffuseColor.rgb *= vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","varying vec3 vColor;","#endif","#if defined( INSTANCE_COLOR )","varying vec3 vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","vColor.xyz = color.xyz;","#endif","#if defined( INSTANCE_COLOR ) && defined( INSTANCE_TRANSFORM )","vInstanceColor = instanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef FLIP_SIDED","objectNormal = -objectNormal;","#endif","#ifndef INSTANCE_TRANSFORM","vec3 transformedNormal = normalMatrix * objectNormal;","#else","#ifndef INSTANCE_MATRIX ","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","#ifndef INSTANCE_UNIFORM","vec3 transformedNormal = transposeMat3( inverse( mat3( modelViewMatrix * _instanceMatrix ) ) ) * objectNormal ;","#else","vec3 transformedNormal = ( modelViewMatrix * _instanceMatrix * vec4( objectNormal , 0.0 ) ).xyz;","#endif","#endif"].join("\n")},function(e,t){e.exports=["#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )","varying vec2 vUv;","uniform mat3 uvTransform;","#endif","#ifdef INSTANCE_TRANSFORM","mat3 inverse(mat3 m) {","float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];","float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];","float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];","float b01 = a22 * a11 - a12 * a21;","float b11 = -a22 * a10 + a12 * a20;","float b21 = a21 * a10 - a11 * a20;","float det = a00 * b01 + a01 * b11 + a02 * b21;","return mat3(b01, (-a22 * a01 + a02 * a21), ( a12 * a01 - a02 * a11),","b11, ( a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),","b21, (-a21 * a00 + a01 * a20), ( a11 * a00 - a01 * a10)) / det;","}","attribute vec3 instancePosition;","attribute vec4 instanceQuaternion;","attribute vec3 instanceScale;","#if defined( INSTANCE_COLOR )","attribute vec3 instanceColor;","varying vec3 vInstanceColor;","#endif","mat4 getInstanceMatrix(){","vec4 q = instanceQuaternion;","vec3 s = instanceScale;","vec3 v = instancePosition;","vec3 q2 = q.xyz + q.xyz;","vec3 a = q.xxx * q2.xyz;","vec3 b = q.yyz * q2.yzz;","vec3 c = q.www * q2.xyz;","vec3 r0 = vec3( 1.0 - (b.x + b.z) , a.y + c.z , a.z - c.y ) * s.xxx;","vec3 r1 = vec3( a.y - c.z , 1.0 - (a.x + b.z) , b.y + c.x ) * s.yyy;","vec3 r2 = vec3( a.z + c.y , b.y - c.x , 1.0 - (a.x + b.x) ) * s.zzz;","return mat4(","r0 , 0.0,","r1 , 0.0,","r2 , 0.0,","v , 1.0",");","}","#endif"].join("\n")},function(e,t,r){"use strict";var a={};(0,r(10).assign)(a,r(99),r(101),r(33)),e.exports=a},function(e,t,r){"use strict";var a=r(49),n=r(10),i=r(52),o=r(31),s=r(32),l=Object.prototype.toString,u=0,c=-1,f=0,h=8;function d(e){if(!(this instanceof d))return new d(e);this.options=n.assign({level:c,method:h,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&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 r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==u)throw new Error(o[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,p))!==u)throw new Error(o[r]);this._dict_set=!0}}function p(e,t){var r=new d(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}d.prototype.push=function(e,t){var r,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=i.string2buf(e):"[object ArrayBuffer]"===l.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 n.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=a.deflate(s,o))&&r!==u)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(n.shrinkBuf(s.output,s.next_out))):this.onData(n.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u):2!==o||(this.onEnd(u),s.avail_out=0,!0)},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=d,t.deflate=p,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},function(e,t,r){"use strict";var a=r(10),n=4,i=0,o=1,s=2;function l(e){for(var t=e.length;--t>=0;)e[t]=0}var u=0,c=1,f=2,h=29,d=256,p=d+1+h,m=30,v=19,g=2*p+1,y=15,b=16,w=7,x=256,_=16,A=17,E=18,S=[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],M=[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],T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(p+2));l(F);var O=new Array(2*m);l(O);var L=new Array(512);l(L);var C=new Array(256);l(C);var k=new Array(h);l(k);var R,I,N,D=new Array(m);function U(e,t,r,a,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=a,this.max_length=n,this.has_stree=e&&e.length}function j(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function B(e){return e<256?L[e]:L[256+(e>>>7)]}function V(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function z(e,t,r){e.bi_valid>b-r?(e.bi_buf|=t<>b-e.bi_valid,e.bi_valid+=r-b):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function X(e,t,r){var a,n,i=new Array(y+1),o=0;for(a=1;a<=y;a++)i[a]=o=o+r[a-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=H(i[s]++,s))}}function Y(e){var t;for(t=0;t8?V(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,a){var n=2*t,i=2*r;return e[n]>1;r>=1;r--)Q(e,i,r);n=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Q(e,i,1),a=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=a,i[2*n]=i[2*r]+i[2*a],e.depth[n]=(e.depth[r]>=e.depth[a]?e.depth[r]:e.depth[a])+1,i[2*r+1]=i[2*a+1]=n,e.heap[1]=n++,Q(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,a,n,i,o,s,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(i=0;i<=y;i++)e.bl_count[i]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(i=p,m++),l[2*a+1]=i,a>u||(e.bl_count[i]++,o=0,a>=d&&(o=h[a-d]),s=l[2*a],e.opt_len+=s*(i+o),f&&(e.static_len+=s*(c[2*a+1]+o)));if(0!==m){do{for(i=p-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(i=p;0!==i;i--)for(a=e.bl_count[i];0!==a;)(n=e.heap[--r])>u||(l[2*n+1]!==i&&(e.opt_len+=(i-l[2*n+1])*l[2*n],l[2*n+1]=i),a--)}}(e,t),X(i,u,e.bl_count)}function J(e,t,r){var a,n,i=-1,o=t[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(r+1)+1]=65535,a=0;a<=r;a++)n=o,o=t[2*(a+1)+1],++s>=7;a0?(e.strm.data_type===s&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&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 o;for(t=32;t=3&&0===e.bl_tree[2*P[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),l=e.opt_len+3+7>>>3,(u=e.static_len+3+7>>>3)<=l&&(l=u)):l=u=r+5,r+4<=l&&-1!==t?te(e,t,r,a):e.strategy===n||u===l?(z(e,(c<<1)+(a?1:0),3),Z(e,F,O)):(z(e,(f<<1)+(a?1:0),3),function(e,t,r,a){var n;for(z(e,t-257,5),z(e,r-1,5),z(e,a-4,4),n=0;n>>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&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(C[r]+d+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){z(e,c<<1,3),G(e,x,F),function(e){16===e.bi_valid?(V(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,r){"use strict";var a=r(53),n=r(10),i=r(52),o=r(33),s=r(31),l=r(32),u=r(104),c=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new u,a.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=i.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=a.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,l,u,f,h=this.strm,d=this.options.chunkSize,p=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?h.input=i.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new n.Buf8(d),h.next_out=0,h.avail_out=d),(r=a.inflate(h,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(r=a.inflateSetDictionary(this.strm,p)),r===o.Z_BUF_ERROR&&!0===m&&(r=o.Z_OK,m=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==o.Z_STREAM_END&&(0!==h.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=i.utf8border(h.output,h.next_out),u=h.next_out-l,f=i.buf2string(h.output,l),h.next_out=u,h.avail_out=d-u,u&&n.arraySet(h.output,h.output,l,u,0),this.onData(f)):this.onData(n.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(m=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},function(e,t,r){"use strict";e.exports=function(e,t){var r,a,n,i,o,s,l,u,c,f,h,d,p,m,v,g,y,b,w,x,_,A,E,S,M;r=e.state,a=e.next_in,S=e.input,n=a+(e.avail_in-5),i=e.next_out,M=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,f=r.wnext,h=r.window,d=r.hold,p=r.bits,m=r.lencode,v=r.distcode,g=(1<>>=w=b>>>24,p-=w,0===(w=b>>>16&255))M[i++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(d&(1<>>=w,p-=w),p<15&&(d+=S[a++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=v[(65535&b)+(d&(1<l){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=w,p-=w,_>(w=i-o)){if((w=_-w)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(A=0,E=h,0===f){if(A+=u-w,w2;)M[i++]=E[A++],M[i++]=E[A++],M[i++]=E[A++],x-=3;x&&(M[i++]=E[A++],x>1&&(M[i++]=E[A++]))}else{A=i-_;do{M[i++]=M[A++],M[i++]=M[A++],M[i++]=M[A++],x-=3}while(x>2);x&&(M[i++]=M[A++],x>1&&(M[i++]=M[A++]))}break}}break}}while(a>3,d&=(1<<(p-=x<<3))-1,e.next_in=a,e.next_out=i,e.avail_in=a=1&&0===I[M];M--);if(T>M&&(T=M),0===M)return u[c++]=20971520,u[c++]=20971520,h.bits=1,0;for(S=1;S0&&(0===e||1!==M))return-1;for(N[1]=0,A=1;A<15;A++)N[A+1]=N[A]+I[A];for(E=0;E852||2===e&&L>592)return 1;for(;;){b=A-F,f[E]y?(w=D[U+f[E]],x=k[R+f[E]]):(w=96,x=0),d=1<>F)+(p-=d)]=b<<24|w<<16|x|0}while(0!==p);for(d=1<>=1;if(0!==d?(C&=d-1,C+=d):C=0,E++,0==--I[A]){if(A===M)break;A=t[r+f[E]]}if(A>T&&(C&v)!==m){for(0===F&&(F=T),g+=S,O=1<<(P=A-F);P+F852||2===e&&L>592)return 1;u[m=C&v]=T<<24|P<<16|g-c|0}}return 0!==C&&(u[g+C]=A-F<<24|64<<16|0),h.bits=T,0}},function(e,t,r){"use strict";e.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}},function(e,t,r){"use strict";(function(e){var a=r(7).Buffer,n=r(108).Transform,i=r(119),o=r(60),s=r(26).ok,l=r(7).kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";i.Z_MIN_WINDOWBITS=8,i.Z_MAX_WINDOWBITS=15,i.Z_DEFAULT_WINDOWBITS=15,i.Z_MIN_CHUNK=64,i.Z_MAX_CHUNK=1/0,i.Z_DEFAULT_CHUNK=16384,i.Z_MIN_MEMLEVEL=1,i.Z_MAX_MEMLEVEL=9,i.Z_DEFAULT_MEMLEVEL=8,i.Z_MIN_LEVEL=-1,i.Z_MAX_LEVEL=9,i.Z_DEFAULT_LEVEL=i.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(i),f=0;f=l?o=new RangeError(u):t=a.concat(n,i),n=[],e.close(),r(o,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)})),e.on("end",s),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=a.from(t)),!a.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function b(e){if(!(this instanceof b))return new b(e);T.call(this,e,i.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);T.call(this,e,i.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,i.GZIP)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,i.GUNZIP)}function A(e){if(!(this instanceof A))return new A(e);T.call(this,e,i.DEFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);T.call(this,e,i.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,i.UNZIP)}function M(e){return e===i.Z_NO_FLUSH||e===i.Z_PARTIAL_FLUSH||e===i.Z_SYNC_FLUSH||e===i.Z_FULL_FLUSH||e===i.Z_FINISH||e===i.Z_BLOCK}function T(e,r){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,n.call(this,e),e.flush&&!M(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!M(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||i.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:i.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!a.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new i.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){P(s),s._hadError=!0;var a=new Error(e);a.errno=r,a.code=t.codes[r],s.emit("error",a)};var l=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(l=e.level);var u=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,l,e.memLevel||t.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=a.allocUnsafe(this._chunkSize),this._offset=0,this._level=l,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function P(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function F(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),t.Deflate=b,t.Inflate=w,t.Gzip=x,t.Gunzip=_,t.DeflateRaw=A,t.InflateRaw=E,t.Unzip=S,t.createDeflate=function(e){return new b(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new A(e)},t.createInflateRaw=function(e){return new E(e)},t.createGzip=function(e){return new x(e)},t.createGunzip=function(e){return new _(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new b(t),e,r)},t.deflateSync=function(e,t){return y(new b(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new x(t),e,r)},t.gzipSync=function(e,t){return y(new x(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new A(t),e,r)},t.deflateRawSync=function(e,t){return y(new A(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new S(t),e,r)},t.unzipSync=function(e,t){return y(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new w(t),e,r)},t.inflateSync=function(e,t){return y(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new _(t),e,r)},t.gunzipSync=function(e,t){return y(new _(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new E(t),e,r)},t.inflateRawSync=function(e,t){return y(new E(t),e)},o.inherits(T,n),T.prototype.params=function(r,a,n){if(rt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(a!=t.Z_FILTERED&&a!=t.Z_HUFFMAN_ONLY&&a!=t.Z_RLE&&a!=t.Z_FIXED&&a!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+a);if(this._level!==r||this._strategy!==a){var o=this;this.flush(i.Z_SYNC_FLUSH,(function(){s(o._handle,"zlib binding closed"),o._handle.params(r,a),o._hadError||(o._level=r,o._strategy=a,n&&n())}))}else e.nextTick(n)},T.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},T.prototype._flush=function(e){this._transform(a.alloc(0),"",e)},T.prototype.flush=function(t,r){var n=this,o=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=i.Z_FULL_FLUSH),o.ended?r&&e.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",(function(){return n.flush(t,r)})):(this._flushFlag=t,this.write(a.alloc(0),"",r))},T.prototype.close=function(t){P(this,t),e.nextTick(F,this)},T.prototype._transform=function(e,t,r){var n,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||a.isBuffer(e)?this._handle?(s?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||i.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},T.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,c=this,f="function"==typeof r;if(!f){var h,d=[],p=0;this.on("error",(function(e){h=e})),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw h;if(p>=l)throw P(this),new RangeError(u);var v=a.concat(d,p);return P(this),v}s(this._handle,"zlib binding closed");var g=this._handle.write(t,e,o,n,this._buffer,this._offset,i);function y(l,u){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var h=i-u;if(s(h>=0,"have should not go down"),h>0){var m=c._buffer.slice(c._offset,c._offset+h);c._offset+=h,f?c.push(m):(d.push(m),p+=m.length)}if((0===u||c._offset>=c._chunkSize)&&(i=c._chunkSize,c._offset=0,c._buffer=a.allocUnsafe(c._chunkSize)),0===u){if(o+=n-l,n=l,!f)return!0;var v=c._handle.write(t,e,o,n,c._buffer,c._offset,c._chunkSize);return v.callback=y,void(v.buffer=e)}if(!f)return!1;r()}}g.buffer=e,g.callback=y},o.inherits(b,T),o.inherits(w,T),o.inherits(x,T),o.inherits(_,T),o.inherits(A,T),o.inherits(E,T),o.inherits(S,T)}).call(this,r(5))},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],a=t[1];return 3*(r+a)/4-a},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));1===n?(t=e[r-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var n,i,o=[],s=t;s>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,a,n){var i,o,s=8*n-a-1,l=(1<>1,c=-7,f=r?n-1:0,h=r?-1:1,d=e[t+f];for(f+=h,i=d&(1<<-c)-1,d>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=h,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=a;c>0;o=256*o+e[t+f],f+=h,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,a),i-=u}return(d?-1:1)*o*Math.pow(2,i-a)},t.write=function(e,t,r,a,n,i){var o,s,l,u=8*i-n-1,c=(1<>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=a?0:i-1,p=a?1:-1,m=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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,n),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;e[r+d]=255&s,d+=p,s/=256,n-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,u-=8);e[r+d-p]|=128*m}},function(e,t,r){e.exports=n;var a=r(19).EventEmitter;function n(){a.call(this)}r(6)(n,a),n.Readable=r(34),n.Writable=r(115),n.Duplex=r(116),n.Transform=r(117),n.PassThrough=r(118),n.Stream=n,n.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===a.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var a=r(24).Buffer,n=r(111);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,t.copy(r,n),s+=o.data.length,o=o.next;return i},e}(),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var a=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(n.call(setTimeout,a,arguments),clearTimeout)},t.setInterval=function(){return new i(n.call(setInterval,a,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(a,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(113),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(4))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var a,n,i,o,s,l=1,u={},c=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?a=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},a=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(n=f.documentElement,a=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):a=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),a=function(t){e.postMessage(o+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;rt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,n(this.init_done,"close before init"),n(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,a,n,i,o){return this._write(!0,e,t,r,a,n,i,o)},c.prototype.writeSync=function(e,t,r,a,n,i,o){return this._write(!1,e,t,r,a,n,i,o)},c.prototype._write=function(r,i,o,s,l,u,c,f){if(n.equal(arguments.length,8),n(this.init_done,"write before init"),n(this.mode!==t.NONE,"already finalized"),n.equal(!1,this.write_in_progress,"write already in progress"),n.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,n.equal(!1,void 0===i,"must provide flush value"),this.write_in_progress=!0,i!==t.Z_NO_FLUSH&&i!==t.Z_PARTIAL_FLUSH&&i!==t.Z_SYNC_FLUSH&&i!==t.Z_FULL_FLUSH&&i!==t.Z_FINISH&&i!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=e.alloc(0),l=0,s=0),this.strm.avail_in=l,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=u,this.strm.next_out=c,this.flush=i,!r)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return a.nextTick((function(){h._process(),h._after()})),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,r,a,i,o){n(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),n(e>=8&&e<=15,"invalid windowBits"),n(r>=-1&&r<=9,"invalid compression level"),n(a>=1&&a<=9,"invalid memlevel"),n(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,a,i,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,r,a,n,l){switch(this.level=e,this.windowBits=r,this.memLevel=a,this.strategy=n,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new i,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=l,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=o.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=c}).call(this,r(7).Buffer,r(5))},function(e,t,r){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT -*/var a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach((function(e){a[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,l=o(e),u=1;u({path:r+"."+e.path,val:e.val})))),e}e.exports=class{constructor(e=!0){this.types={},this.validator=e?new s:null,this.addDefaultTypes()}addDefaultTypes(){this.addTypes(r(166)),this.addTypes(r(167)),this.addTypes(r(168)),this.addTypes(r(169))}addProtocol(e,t){const r=this;this.validator&&this.validator.validateProtocol(e),function e(t,a){void 0!==t&&(t.types&&r.addTypes(t.types),e(o(t,a.shift()),a))}(e,t)}addType(e,t,r=!0){if("native"!==t)if(l(t)){this.validator&&(r&&this.validator.validateType(t),this.validator.addType(e));let{type:n,typeArgs:o}=a(t);this.types[e]=o?function(e,t){const r=JSON.stringify(t),a=i(t,u,[]);function n(e){const t=JSON.parse(r);return a.forEach(r=>{!function(e,t,r){const a=e.split(".").reverse();for(;a.length>1;)r=r[a.pop()];r[a.pop()]=t}(r.path,e[r.val],t)}),t}return[function(t,r,a,i){return e[0].call(this,t,r,n(a),i)},function(t,r,a,i,o){return e[1].call(this,t,r,a,n(i),o)},function(t,r,a){return"function"==typeof e[2]?e[2].call(this,t,n(r),a):e[2]}]}(this.types[n],o):this.types[n]}else this.validator&&(t[3]?this.validator.addType(e,t[3]):this.validator.addType(e)),this.types[e]=t;else this.validator&&this.validator.addType(e)}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t],!1)),this.validator&&Object.keys(e).forEach(t=>{l(e[t])&&this.validator.validateType(e[t])})}read(e,t,r,n){let{type:i,typeArgs:o}=a(r);const s=this.types[i];if(!s)throw new Error("missing data type: "+i);return s[0].call(this,e,t,o,n)}write(e,t,r,n,i){let{type:o,typeArgs:s}=a(n);const l=this.types[o];if(!l)throw new Error("missing data type: "+o);return l[1].call(this,e,t,r,s,i)}sizeOf(e,t,r){let{type:n,typeArgs:i}=a(t);const o=this.types[n];if(!o)throw new Error("missing data type: "+n);return"function"==typeof o[2]?o[2].call(this,e,i,r):o[2]}createPacketBuffer(e,r){const a=n(()=>this.sizeOf(r,e,{}),e=>{throw e.message=`SizeOf error for ${e.field} : ${e.message}`,e}),i=t.allocUnsafe(a);return n(()=>this.write(r,i,0,e,{}),e=>{throw e.message=`Write error for ${e.field} : ${e.message}`,e}),i}parsePacketBuffer(e,t){const{value:r,size:a}=n(()=>this.read(t,0,e,{}),e=>{throw e.message=`Read error for ${e.field} : ${e.message}`,e});return{data:r,metadata:{size:a},buffer:t.slice(0,a)}}}}).call(this,r(7).Buffer)},function(e,t,r){(function(e,r){var a=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,l=1/0,u=9007199254740991,c="[object Arguments]",f="[object Array]",h="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Function]",v="[object GeneratorFunction]",g="[object Map]",y="[object Number]",b="[object Object]",w="[object RegExp]",x="[object Set]",_="[object String]",A="[object Symbol]",E="[object ArrayBuffer]",S="[object DataView]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,P=/^\./,F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,L=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[c]=k[f]=k[E]=k[h]=k[S]=k[d]=k[p]=k[m]=k[g]=k[y]=k[b]=k[w]=k[x]=k[_]=k["[object WeakMap]"]=!1;var R="object"==typeof e&&e&&e.Object===Object&&e,I="object"==typeof self&&self&&self.Object===Object&&self,N=R||I||Function("return this")(),D=t&&!t.nodeType&&t,U=D&&"object"==typeof r&&r&&!r.nodeType&&r,j=U&&U.exports===D&&R.process,B=function(){try{return j&&j.binding("util")}catch(e){}}(),V=B&&B.isTypedArray;function z(e,t,r,a){var n=-1,i=e?e.length:0;for(a&&i&&(r=e[++n]);++n-1},Me.prototype.set=function(e,t){var r=this.__data__,a=Le(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},Te.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||Me),string:new Se}},Te.prototype.delete=function(e){return He(this,e).delete(e)},Te.prototype.get=function(e){return He(this,e).get(e)},Te.prototype.has=function(e){return He(this,e).has(e)},Te.prototype.set=function(e,t){return He(this,e).set(e,t),this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,i),this},Pe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.clear=function(){this.__data__=new Me},Fe.prototype.delete=function(e){return this.__data__.delete(e)},Fe.prototype.get=function(e){return this.__data__.get(e)},Fe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Me){var n=r.__data__;if(!he||n.lengthu))return!1;var f=i.get(e);if(f&&i.get(t))return f==t;var h=-1,d=!0,p=n&o?new Pe:void 0;for(i.set(e,t),i.set(t,e);++h-1&&e%1==0&&e-1&&e%1==0&&e<=u}function st(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function lt(e){return!!e&&"object"==typeof e}function ut(e){return"symbol"==typeof e||lt(e)&&ne.call(e)==A}var ct=V?function(e){return function(t){return e(t)}}(V):function(e){return lt(e)&&ot(e.length)&&!!k[ne.call(e)]};function ft(e){return nt(e)?Oe(e):Ve(e)}function ht(e){return e}r.exports=function(e,t,r){var a=at(e)?z:H,n=arguments.length<3;return a(e,Be(t),r,n,Re)}}).call(this,r(4),r(123)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){(function(t){var r="Expected a function",a="__lodash_hash_undefined__",n=1/0,i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,c=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,p="object"==typeof t&&t&&t.Object===Object&&t,m="object"==typeof self&&self&&self.Object===Object&&self,v=p||m||Function("return this")();var g,y=Array.prototype,b=Function.prototype,w=Object.prototype,x=v["__core-js_shared__"],_=(g=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",A=b.toString,E=w.hasOwnProperty,S=w.toString,M=RegExp("^"+A.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=v.Symbol,P=y.splice,F=B(v,"Map"),O=B(Object,"create"),L=T?T.prototype:void 0,C=L?L.toString:void 0;function k(e){var t=-1,r=e?e.length:0;for(this.clear();++t-1},R.prototype.set=function(e,t){var r=this.__data__,a=N(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},I.prototype.clear=function(){this.__data__={hash:new k,map:new(F||R),string:new k}},I.prototype.delete=function(e){return j(this,e).delete(e)},I.prototype.get=function(e){return j(this,e).get(e)},I.prototype.has=function(e){return j(this,e).has(e)},I.prototype.set=function(e,t){return j(this,e).set(e,t),this};var V=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}(t);var r=[];return c.test(e)&&r.push(""),e.replace(f,(function(e,t,a,n){r.push(a?n.replace(h,"$1"):t||e)})),r}));function z(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-n?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(r);var a=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=a.cache;if(i.has(n))return i.get(n);var o=e.apply(this,r);return a.cache=i.set(n,o),o};return a.cache=new(G.Cache||I),a}G.Cache=I;var H=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==s}e.exports=function(e,t,r){var a=null==e?void 0:D(e,t);return void 0===a?r:a}}).call(this,r(4))},function(e,t,r){const a=r(126),n=r(25);class i{constructor(e){this.createAjvInstance(e),this.addDefaultTypes()}createAjvInstance(e){this.typesSchemas={},this.compiled=!1,this.ajv=new a({verbose:!0}),this.ajv.addSchema(r(160),"definitions"),this.ajv.addSchema(r(161),"protocol"),e&&Object.keys(e).forEach(t=>this.addType(t,e[t]))}addDefaultTypes(){this.addTypes(r(162)),this.addTypes(r(163)),this.addTypes(r(164)),this.addTypes(r(165))}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t]))}typeToSchemaName(e){return e.replace("|","_")}addType(e,t){const r=this.typeToSchemaName(e);null==this.typesSchemas[r]&&(t||(t={oneOf:[{enum:[e]},{type:"array",items:[{enum:[e]},{oneOf:[{type:"object"},{type:"array"}]}]}]}),this.typesSchemas[r]=t,this.compiled?this.createAjvInstance(this.typesSchemas):this.ajv.addSchema(t,r),this.ajv.removeSchema("dataType"),this.ajv.addSchema({title:"dataType",oneOf:[{enum:["native"]}].concat(Object.keys(this.typesSchemas).map(e=>({$ref:this.typeToSchemaName(e)})))},"dataType"))}validateType(e){let t=this.ajv.validate("dataType",e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}validateTypeGoingInside(e){if(Array.isArray(e)){n.ok(null!=this.typesSchemas[this.typeToSchemaName(e[0])],e+" is an undefined type");let t=this.ajv.validate(e[0],e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}else{if("native"==e)return;n.ok(null!=this.typesSchemas[this.typeToSchemaName(e)],e+" is an undefined type")}}validateProtocol(e){let t=this.ajv.validate("protocol",e);n.ok(t,JSON.stringify(this.ajv.errors,null,2)),function e(t,r,a){const n=new i(r.typesSchemas);Object.keys(t).forEach(r=>{"types"==r?(Object.keys(t[r]).forEach(e=>n.addType(e)),Object.keys(t[r]).forEach(e=>{try{n.validateType(t[r][e],a+"."+r+"."+e)}catch(t){throw new Error("Error at "+a+"."+r+"."+e)}})):e(t[r],n,a+"."+r)})}(e,this,"root")}}e.exports=i},function(e,t,r){"use strict";var a=r(127),n=r(35),i=r(131),o=r(60),s=r(61),l=r(132),u=r(133),c=r(154),f=r(15);e.exports=g,g.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var n=r(t);!0!==r.$async&&(this.errors=r.errors);return n},g.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},g.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var i=0;i=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:t,baseId:r},{index:a,compiling:!1})}function h(e,t,r){var a=d.call(this,e,t,r);a>=0&&this._compilations.splice(a,1)}function d(e,t,r){for(var a=0;a({path:r+"."+e.path,val:e.val})))),e}e.exports=class{constructor(e=!0){this.types={},this.validator=e?new s:null,this.addDefaultTypes()}addDefaultTypes(){this.addTypes(r(169)),this.addTypes(r(170)),this.addTypes(r(171)),this.addTypes(r(172))}addProtocol(e,t){const r=this;this.validator&&this.validator.validateProtocol(e),function e(t,a){void 0!==t&&(t.types&&r.addTypes(t.types),e(o(t,a.shift()),a))}(e,t)}addType(e,t,r=!0){if("native"!==t)if(l(t)){this.validator&&(r&&this.validator.validateType(t),this.validator.addType(e));let{type:n,typeArgs:o}=a(t);this.types[e]=o?function(e,t){const r=JSON.stringify(t),a=i(t,u,[]);function n(e){const t=JSON.parse(r);return a.forEach(r=>{!function(e,t,r){const a=e.split(".").reverse();for(;a.length>1;)r=r[a.pop()];r[a.pop()]=t}(r.path,e[r.val],t)}),t}return[function(t,r,a,i){return e[0].call(this,t,r,n(a),i)},function(t,r,a,i,o){return e[1].call(this,t,r,a,n(i),o)},function(t,r,a){return"function"==typeof e[2]?e[2].call(this,t,n(r),a):e[2]}]}(this.types[n],o):this.types[n]}else this.validator&&(t[3]?this.validator.addType(e,t[3]):this.validator.addType(e)),this.types[e]=t;else this.validator&&this.validator.addType(e)}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t],!1)),this.validator&&Object.keys(e).forEach(t=>{l(e[t])&&this.validator.validateType(e[t])})}read(e,t,r,n){let{type:i,typeArgs:o}=a(r);const s=this.types[i];if(!s)throw new Error("missing data type: "+i);return s[0].call(this,e,t,o,n)}write(e,t,r,n,i){let{type:o,typeArgs:s}=a(n);const l=this.types[o];if(!l)throw new Error("missing data type: "+o);return l[1].call(this,e,t,r,s,i)}sizeOf(e,t,r){let{type:n,typeArgs:i}=a(t);const o=this.types[n];if(!o)throw new Error("missing data type: "+n);return"function"==typeof o[2]?o[2].call(this,e,i,r):o[2]}createPacketBuffer(e,r){const a=n(()=>this.sizeOf(r,e,{}),e=>{throw e.message=`SizeOf error for ${e.field} : ${e.message}`,e}),i=t.allocUnsafe(a);return n(()=>this.write(r,i,0,e,{}),e=>{throw e.message=`Write error for ${e.field} : ${e.message}`,e}),i}parsePacketBuffer(e,t){const{value:r,size:a}=n(()=>this.read(t,0,e,{}),e=>{throw e.message=`Read error for ${e.field} : ${e.message}`,e});return{data:r,metadata:{size:a},buffer:t.slice(0,a)}}}}).call(this,r(7).Buffer)},function(e,t,r){(function(e,r){var a=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,l=1/0,u=9007199254740991,c="[object Arguments]",f="[object Array]",h="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Function]",v="[object GeneratorFunction]",g="[object Map]",y="[object Number]",b="[object Object]",w="[object RegExp]",x="[object Set]",_="[object String]",A="[object Symbol]",E="[object ArrayBuffer]",S="[object DataView]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,P=/^\./,F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,L=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[c]=k[f]=k[E]=k[h]=k[S]=k[d]=k[p]=k[m]=k[g]=k[y]=k[b]=k[w]=k[x]=k[_]=k["[object WeakMap]"]=!1;var R="object"==typeof e&&e&&e.Object===Object&&e,I="object"==typeof self&&self&&self.Object===Object&&self,N=R||I||Function("return this")(),D=t&&!t.nodeType&&t,U=D&&"object"==typeof r&&r&&!r.nodeType&&r,j=U&&U.exports===D&&R.process,B=function(){try{return j&&j.binding("util")}catch(e){}}(),V=B&&B.isTypedArray;function z(e,t,r,a){var n=-1,i=e?e.length:0;for(a&&i&&(r=e[++n]);++n-1},Me.prototype.set=function(e,t){var r=this.__data__,a=Le(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},Te.prototype.clear=function(){this.__data__={hash:new Se,map:new(he||Me),string:new Se}},Te.prototype.delete=function(e){return He(this,e).delete(e)},Te.prototype.get=function(e){return He(this,e).get(e)},Te.prototype.has=function(e){return He(this,e).has(e)},Te.prototype.set=function(e,t){return He(this,e).set(e,t),this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,i),this},Pe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.clear=function(){this.__data__=new Me},Fe.prototype.delete=function(e){return this.__data__.delete(e)},Fe.prototype.get=function(e){return this.__data__.get(e)},Fe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Me){var n=r.__data__;if(!he||n.lengthu))return!1;var f=i.get(e);if(f&&i.get(t))return f==t;var h=-1,d=!0,p=n&o?new Pe:void 0;for(i.set(e,t),i.set(t,e);++h-1&&e%1==0&&e-1&&e%1==0&&e<=u}function st(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function lt(e){return!!e&&"object"==typeof e}function ut(e){return"symbol"==typeof e||lt(e)&&ne.call(e)==A}var ct=V?function(e){return function(t){return e(t)}}(V):function(e){return lt(e)&&ot(e.length)&&!!k[ne.call(e)]};function ft(e){return nt(e)?Oe(e):Ve(e)}function ht(e){return e}r.exports=function(e,t,r){var a=at(e)?z:H,n=arguments.length<3;return a(e,Be(t),r,n,Re)}}).call(this,r(4),r(126)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){(function(t){var r="Expected a function",a="__lodash_hash_undefined__",n=1/0,i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,c=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,h=/\\(\\)?/g,d=/^\[object .+?Constructor\]$/,p="object"==typeof t&&t&&t.Object===Object&&t,m="object"==typeof self&&self&&self.Object===Object&&self,v=p||m||Function("return this")();var g,y=Array.prototype,b=Function.prototype,w=Object.prototype,x=v["__core-js_shared__"],_=(g=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",A=b.toString,E=w.hasOwnProperty,S=w.toString,M=RegExp("^"+A.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=v.Symbol,P=y.splice,F=B(v,"Map"),O=B(Object,"create"),L=T?T.prototype:void 0,C=L?L.toString:void 0;function k(e){var t=-1,r=e?e.length:0;for(this.clear();++t-1},R.prototype.set=function(e,t){var r=this.__data__,a=N(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},I.prototype.clear=function(){this.__data__={hash:new k,map:new(F||R),string:new k}},I.prototype.delete=function(e){return j(this,e).delete(e)},I.prototype.get=function(e){return j(this,e).get(e)},I.prototype.has=function(e){return j(this,e).has(e)},I.prototype.set=function(e,t){return j(this,e).set(e,t),this};var V=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}(t);var r=[];return c.test(e)&&r.push(""),e.replace(f,(function(e,t,a,n){r.push(a?n.replace(h,"$1"):t||e)})),r}));function z(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-n?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(r);var a=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=a.cache;if(i.has(n))return i.get(n);var o=e.apply(this,r);return a.cache=i.set(n,o),o};return a.cache=new(G.Cache||I),a}G.Cache=I;var H=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==s}e.exports=function(e,t,r){var a=null==e?void 0:D(e,t);return void 0===a?r:a}}).call(this,r(4))},function(e,t,r){const a=r(129),n=r(26);class i{constructor(e){this.createAjvInstance(e),this.addDefaultTypes()}createAjvInstance(e){this.typesSchemas={},this.compiled=!1,this.ajv=new a({verbose:!0}),this.ajv.addSchema(r(163),"definitions"),this.ajv.addSchema(r(164),"protocol"),e&&Object.keys(e).forEach(t=>this.addType(t,e[t]))}addDefaultTypes(){this.addTypes(r(165)),this.addTypes(r(166)),this.addTypes(r(167)),this.addTypes(r(168))}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t]))}typeToSchemaName(e){return e.replace("|","_")}addType(e,t){const r=this.typeToSchemaName(e);null==this.typesSchemas[r]&&(t||(t={oneOf:[{enum:[e]},{type:"array",items:[{enum:[e]},{oneOf:[{type:"object"},{type:"array"}]}]}]}),this.typesSchemas[r]=t,this.compiled?this.createAjvInstance(this.typesSchemas):this.ajv.addSchema(t,r),this.ajv.removeSchema("dataType"),this.ajv.addSchema({title:"dataType",oneOf:[{enum:["native"]}].concat(Object.keys(this.typesSchemas).map(e=>({$ref:this.typeToSchemaName(e)})))},"dataType"))}validateType(e){let t=this.ajv.validate("dataType",e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}validateTypeGoingInside(e){if(Array.isArray(e)){n.ok(null!=this.typesSchemas[this.typeToSchemaName(e[0])],e+" is an undefined type");let t=this.ajv.validate(e[0],e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}else{if("native"==e)return;n.ok(null!=this.typesSchemas[this.typeToSchemaName(e)],e+" is an undefined type")}}validateProtocol(e){let t=this.ajv.validate("protocol",e);n.ok(t,JSON.stringify(this.ajv.errors,null,2)),function e(t,r,a){const n=new i(r.typesSchemas);Object.keys(t).forEach(r=>{"types"==r?(Object.keys(t[r]).forEach(e=>n.addType(e)),Object.keys(t[r]).forEach(e=>{try{n.validateType(t[r][e],a+"."+r+"."+e)}catch(t){throw new Error("Error at "+a+"."+r+"."+e)}})):e(t[r],n,a+"."+r)})}(e,this,"root")}}e.exports=i},function(e,t,r){"use strict";var a=r(130),n=r(36),i=r(134),o=r(61),s=r(62),l=r(135),u=r(136),c=r(157),f=r(16);e.exports=g,g.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var n=r(t);!0!==r.$async&&(this.errors=r.errors);return n},g.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},g.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var i=0;i=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:t,baseId:r},{index:a,compiling:!1})}function h(e,t,r){var a=d.call(this,e,t,r);a>=0&&this._compilations.splice(a,1)}function d(e,t,r){for(var a=0;a1){t[0]=t[0].slice(0,-1);for(var a=t.length-1,n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(e){throw new RangeError(d[e])}function g(e,t){var r=e.split("@"),a="";r.length>1&&(a=r[0]+"@",e=r[1]);var n=function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(h,".")).split("."),t).join(".");return a+n}function y(e){for(var t=[],r=0,a=e.length;r=55296&&n<=56319&&r>1,e+=p(e/t);e>455;a+=36)e=p(e/35);return p(a+36*e/(e+38))},x=function(e){var t,r=[],a=e.length,n=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var l=0;l=128&&v("not-basic"),r.push(e.charCodeAt(l));for(var c=s>0?s+1:0;c=a&&v("invalid-input");var m=(t=e.charCodeAt(c++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>p((u-n)/h))&&v("overflow"),n+=m*h;var g=d<=o?1:d>=o+26?26:d-o;if(mp(u/y)&&v("overflow"),h*=y}var b=r.length+1;o=w(n-f,b,0==f),p(n/b)>u-i&&v("overflow"),i+=p(n/b),n%=b,r.splice(n++,0,i)}return String.fromCodePoint.apply(String,r)},_=function(e){var t=[],r=(e=y(e)).length,a=128,n=0,i=72,o=!0,s=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(o=(c=f.next()).done);o=!0){var h=c.value;h<128&&t.push(m(h))}}catch(e){s=!0,l=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw l}}var d=t.length,g=d;for(d&&t.push("-");g=a&&Tp((u-n)/P)&&v("overflow"),n+=(x-a)*P,a=x;var F=!0,O=!1,L=void 0;try{for(var C,k=e[Symbol.iterator]();!(F=(C=k.next()).done);F=!0){var R=C.value;if(Ru&&v("overflow"),R==a){for(var I=n,N=36;;N+=36){var D=N<=i?1:N>=i+26?26:N-i;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function M(e){for(var t="",r=0,a=e.length;r=194&&n<224){if(a-r>=6){var i=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&n)<<6|63&i)}else t+=e.substr(r,6);r+=6}else if(n>=224){if(a-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function T(e,t){function r(e){var r=M(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,n)),e}function P(e){return e.replace(/^0*(.*)/,"$1")||"0"}function F(e,t){var r=e.match(t.IPV4ADDRESS)||[],a=l(r,2)[1];return a?a.split(".").map(P).join("."):e}function O(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=l(r,3),n=a[1],i=a[2];if(n){for(var o=n.toLowerCase().split("::").reverse(),s=l(o,2),u=s[0],c=s[1],f=c?c.split(":").map(P):[],h=u.split(":").map(P),d=t.IPV4ADDRESS.test(h[h.length-1]),p=d?7:8,m=h.length-p,v=Array(p),g=0;g1){var w=v.slice(0,y.index),x=v.slice(y.index+y.length);b=w.join(":")+"::"+x.join(":")}else b=v.join(":");return i&&(b+="%"+i),b}return e}var L=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,C=void 0==="".match(/(){0}/)[1];function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(L);if(n){C?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=O(F(r.host,a),a)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var i=E[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)T(r,a);else{if(r.host&&(t.domainHost||i&&i.domainHost))try{r.host=A.toASCII(r.host.replace(a.PCT_ENCODED,M).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}T(r,o)}i&&i.parse&&i.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var R=/^\.\.?\//,I=/^\/\.(\/|$)/,N=/^\/\.\.(\/|$)/,D=/^\/?(?:.|\n)*?(?=\/|$)/;function U(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(I))e=e.replace(I,"/");else if(e.match(N))e=e.replace(N,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(D);if(!r)throw new Error("Unexpected dot segment condition");var a=r[0];e=e.slice(a.length),t.push(a)}return t.join("")}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,a=[],n=E[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||n&&n.domainHost)try{e.host=t.iri?A.toUnicode(e.host):A.toASCII(e.host.replace(r.PCT_ENCODED,M).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}T(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var i=function(e,t){var r=!1!==t.iri?s:o,a=[];return void 0!==e.userinfo&&(a.push(e.userinfo),a.push("@")),void 0!==e.host&&a.push(O(F(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"==typeof e.port&&(a.push(":"),a.push(e.port.toString(10))),a.length?a.join(""):void 0}(e,t);if(void 0!==i&&("suffix"!==t.reference&&a.push("//"),a.push(i),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||n&&n.absolutePath||(l=U(l)),void 0===i&&(l=l.replace(/^\/\//,"/%2F")),a.push(l)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function B(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=k(j(e,r),r),t=k(j(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=U(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=U(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function V(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,M)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},G={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},H={},X="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",W=r(r("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+r("%"+Y+Y)),q=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Q=new RegExp(X,"g"),Z=new RegExp(W,"g"),K=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',q),"g"),J=new RegExp(t("[^]",X,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),$=J;function ee(e){var t=M(e);return t.match(Q)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,i={},o=r.query.split("&"),s=0,l=o.length;s=55296&&t<=56319&&n%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,d=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",a.copy(m[e])}function v(e){var t=e.match(n);if(!t)return!1;var r=+t[1],a=+t[2],o=+t[3];return a>=1&&a<=12&&o>=1&&o<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[a])}function g(e,t){var r=e.match(o);if(!r)return!1;var a=r[1],n=r[2],i=r[3],s=r[5];return(a<=23&&n<=59&&i<=59||23==a&&59==n&&60==i)&&(!t||s)}e.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":h,"json-pointer-uri-fragment":d,"relative-json-pointer":p},m.full={date:v,time:g,"date-time":function(e){var t=e.split(y);return 2==t.length&&v(t[0])&&g(t[1],!0)},uri:function(e){return b.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/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-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":h,"json-pointer-uri-fragment":d,"relative-json-pointer":p};var y=/t|\s/i;var b=/\/|:/;var w=/[^\\]\\Z/;function x(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},function(e,t,r){"use strict";var a=r(134),n=r(15).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=n(t),e.types=n(["number","integer","string","array","object","boolean","null"]),e.forEach((function(r){r.rules=r.rules.map((function(r){var n;if("object"==typeof r){var i=Object.keys(r)[0];n=r[i],r=i,n.forEach((function(r){t.push(r),e.all[r]=!0}))}return t.push(r),e.all[r]={keyword:r,code:a[r],implements:n}})),e.all.$comment={keyword:"$comment",code:a.$comment},r.type&&(e.types[r.type]=r)})),e.keywords=n(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},function(e,t,r){"use strict";e.exports={$ref:r(135),allOf:r(136),anyOf:r(137),$comment:r(138),const:r(139),contains:r(140),dependencies:r(141),enum:r(142),format:r(143),if:r(144),items:r(145),maximum:r(63),minimum:r(63),maxItems:r(64),minItems:r(64),maxLength:r(65),minLength:r(65),maxProperties:r(66),minProperties:r(66),multipleOf:r(146),not:r(147),oneOf:r(148),pattern:r(149),properties:r(150),propertyNames:r(151),required:r(152),uniqueItems:r(153),validate:r(62)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n,i=" ",o=e.level,s=e.dataLevel,l=e.schema[t],u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(s||""),h="valid"+o;if("#"==l||"#/"==l)e.isRoot?(a=e.async,n="validate"):(a=!0===e.root.schema.$async,n="root.refVal[0]");else{var d=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===d){var p=e.MissingRefError.message(e.baseId,l);if("fail"==e.opts.missingRefs){e.logger.error(p),(y=y||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,l,p);e.logger.warn(p),c&&(i+=" if (true) { ")}}else if(d.inline){var v=e.util.copy(e);v.level++;var g="valid"+v.level;v.schema=d.schema,v.schemaPath="",v.errSchemaPath=l,i+=" "+e.validate(v).replace(/validate\.schema/g,d.code)+" ",c&&(i+=" if ("+g+") { ")}else a=!0===d.$async||e.async&&!1!==d.$async,n=d.code}if(n){var y;(y=y||[]).push(i),i="",e.opts.passContext?i+=" "+n+".call(this, ":i+=" "+n+"( ",i+=" "+f+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var b=i+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(i=y.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(i+=" var "+h+"; "),i+=" try { await "+b+"; ",c&&(i+=" "+h+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(i+=" "+h+" = false; "),i+=" } ",c&&(i+=" if ("+h+") { ")}else i+=" if (!"+b+") { if (vErrors === null) vErrors = "+n+".errors; else vErrors = vErrors.concat("+n+".errors); errors = vErrors.length; } ",c&&(i+=" else { ")}return i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.schema[t],i=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,l=e.util.copy(e),u="";l.level++;var c="valid"+l.level,f=l.baseId,h=!0,d=n;if(d)for(var p,m=-1,v=d.length-1;m0:e.util.schemaHasRules(p,e.RULES.all))&&(h=!1,l.schema=p,l.schemaPath=i+"["+m+"]",l.errSchemaPath=o+"/"+m,a+=" "+e.validate(l)+" ",l.baseId=f,s&&(a+=" if ("+c+") { ",u+="}"));return s&&(a+=h?" if (true) { ":" "+u.slice(0,-1)+" "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,h="errs__"+n,d=e.util.copy(e),p="";d.level++;var m="valid"+d.level;if(o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var v=d.baseId;a+=" var "+h+" = errors; var "+f+" = false; ";var g=e.compositeRule;e.compositeRule=d.compositeRule=!0;var y=o;if(y)for(var b,w=-1,x=y.length-1;w0:e.util.schemaHasRules(o,e.RULES.all);if(a+="var "+h+" = errors;var "+f+";",b){var w=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" var "+p+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var x=c+"["+m+"]";d.dataPathArr[v]=m;var _=e.validate(d);d.baseId=y,e.util.varOccurences(_,g)<2?a+=" "+e.util.varReplace(_,g,x)+" ":a+=" var "+g+" = "+x+"; "+_+" ",a+=" if ("+p+") break; } ",e.compositeRule=d.compositeRule=w,a+=" if (!"+p+") {"}else a+=" if ("+c+".length == 0) {";var A=A||[];A.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;return a=A.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",b&&(a+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,h=e.util.copy(e),d="";h.level++;var p="valid"+h.level,m={},v={},g=e.opts.ownProperties;for(x in o){var y=o[x],b=Array.isArray(y)?v:m;b[x]=y}a+="var "+f+" = errors;";var w=e.errorPath;for(var x in a+="var missing"+n+";",v)if((b=v[x]).length){if(a+=" if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),u){a+=" && ( ";var _=b;if(_)for(var A=-1,E=_.length-1;A0:e.util.schemaHasRules(y,e.RULES.all))&&(a+=" "+p+" = true; if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),a+=") { ",h.schema=y,h.schemaPath=s+e.util.getProperty(x),h.errSchemaPath=l+"/"+e.util.escapeFragment(x),a+=" "+e.validate(h)+" ",h.baseId=I,a+=" } ",u&&(a+=" if ("+p+") { ",d+="}"))}return u&&(a+=" "+d+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,h=e.opts.$data&&o&&o.$data;h&&(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var d="i"+n,p="schema"+n;h||(a+=" var "+p+" = validate.schema"+s+";"),a+="var "+f+";",h&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=f+" = false;for (var "+d+"=0; "+d+"<"+p+".length; "+d+"++) if (equal("+c+", "+p+"["+d+"])) { "+f+" = true; break; }",h&&(a+=" } "),a+=" if (!"+f+") { ";var m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var v=a;return a=m.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||"");if(!1===e.opts.format)return u&&(a+=" if (true) { "),a;var f,h=e.opts.$data&&o&&o.$data;h?(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",f="schema"+n):f=o;var d=e.opts.unknownFormats,p=Array.isArray(d);if(h){a+=" var "+(m="format"+n)+" = formats["+f+"]; var "+(v="isObject"+n)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(g="formatType"+n)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+n+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",h&&(a+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),a+=" (","ignore"!=d&&(a+=" ("+f+" && !"+m+" ",p&&(a+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),a+=") || "),a+=" ("+m+" && "+g+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?a+=" (async"+n+" ? await "+m+"("+c+") : "+m+"("+c+")) ":a+=" "+m+"("+c+") ",a+=" : "+m+".test("+c+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==d)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(a+=" if (true) { "),a;if(p&&d.indexOf(o)>=0)return u&&(a+=" if (true) { "),a;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,g=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var y=!0===m.async;m=m.validate}if(g!=r)return u&&(a+=" if (true) { "),a;if(y){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(b="formats"+e.util.getProperty(o)+".validate")+"("+c+"))) { "}else{a+=" if (! ";var b="formats"+e.util.getProperty(o);v&&(b+=".validate"),a+="function"==typeof m?" "+b+"("+c+") ":" "+b+".test("+c+") ",a+=") { "}}var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=h?""+f:""+e.util.toQuotedString(o),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=h?"' + "+f+" + '":""+e.util.escapeQuotes(o),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+s:""+e.util.toQuotedString(o),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var x=a;return a=w.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,h="errs__"+n,d=e.util.copy(e);d.level++;var p="valid"+d.level,m=e.schema.then,v=e.schema.else,g=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),b=d.baseId;if(g||y){var w;d.createErrors=!1,d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" var "+h+" = errors; var "+f+" = true; ";var x=e.compositeRule;e.compositeRule=d.compositeRule=!0,a+=" "+e.validate(d)+" ",d.baseId=b,d.createErrors=!0,a+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=d.compositeRule=x,g?(a+=" if ("+p+") { ",d.schema=e.schema.then,d.schemaPath=e.schemaPath+".then",d.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(d)+" ",d.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'then'; ":w="'then'",a+=" } ",y&&(a+=" else { ")):a+=" if (!"+p+") { ",y&&(d.schema=e.schema.else,d.schemaPath=e.schemaPath+".else",d.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(d)+" ",d.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'else'; ":w="'else'",a+=" } "),a+=" if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",u&&(a+=" else { "),a=e.util.cleanUpCode(a)}else u&&(a+=" if (true) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,h="errs__"+n,d=e.util.copy(e),p="";d.level++;var m="valid"+d.level,v="i"+n,g=d.dataLevel=e.dataLevel+1,y="data"+g,b=e.baseId;if(a+="var "+h+" = errors;var "+f+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){a+=" "+f+" = "+c+".length <= "+o.length+"; ";var x=l;l=e.errSchemaPath+"/additionalItems",a+=" if (!"+f+") { ";var _=_||[];_.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var A=a;a=_.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+A+"]); ":a+=" validate.errors = ["+A+"]; return false; ":a+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l=x,u&&(p+="}",a+=" else { ")}var E=o;if(E)for(var S,M=-1,T=E.length-1;M0:e.util.schemaHasRules(S,e.RULES.all)){a+=" "+m+" = true; if ("+c+".length > "+M+") { ";var P=c+"["+M+"]";d.schema=S,d.schemaPath=s+"["+M+"]",d.errSchemaPath=l+"/"+M,d.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,!0),d.dataPathArr[g]=M;var F=e.validate(d);d.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",a+=" } ",u&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){d.schema=w,d.schemaPath=e.schemaPath+".additionalItems",d.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+c+".length > "+o.length+") { for (var "+v+" = "+o.length+"; "+v+" < "+c+".length; "+v+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";d.dataPathArr[g]=v;F=e.validate(d);d.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" } } ",u&&(a+=" if ("+m+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";d.dataPathArr[g]=v;F=e.validate(d);d.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" }"}return u&&(a+=" "+p+" if ("+h+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),h=e.opts.$data&&s&&s.$data;h?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="var division"+i+";if (",h&&(n+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),n+=" (division"+i+" = "+f+" / "+a+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+i+" !== parseInt(division"+i+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=d.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,h=e.util.copy(e);h.level++;var d="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+f+" = errors; ";var p,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(p=h.opts.allErrors,h.opts.allErrors=!1),a+=" "+e.validate(h)+" ",h.createErrors=!0,p&&(h.opts.allErrors=p),e.compositeRule=h.compositeRule=m,a+=" if ("+d+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(a+=" if (false) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,h="errs__"+n,d=e.util.copy(e),p="";d.level++;var m="valid"+d.level,v=d.baseId,g="prevValid"+n,y="passingSchemas"+n;a+="var "+h+" = errors , "+g+" = false , "+f+" = false , "+y+" = null; ";var b=e.compositeRule;e.compositeRule=d.compositeRule=!0;var w=o;if(w)for(var x,_=-1,A=w.length-1;_0:e.util.schemaHasRules(x,e.RULES.all))?(d.schema=x,d.schemaPath=s+"["+_+"]",d.errSchemaPath=l+"/"+_,a+=" "+e.validate(d)+" ",d.baseId=v):a+=" var "+m+" = true; ",_&&(a+=" if ("+m+" && "+g+") { "+f+" = false; "+y+" = ["+y+", "+_+"]; } else { ",p+="}"),a+=" if ("+m+") { "+f+" = "+g+" = true; "+y+" = "+_+"; }";return e.compositeRule=d.compositeRule=b,a+=p+"if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),h=e.opts.$data&&s&&s.$data;h?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'string') || "),n+=" !"+(h?"(new RegExp("+a+"))":e.usePattern(s))+".test("+f+") ) { ";var d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",n+=h?""+a:""+e.util.toQuotedString(s),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match pattern \"",n+=h?"' + "+a+" + '":""+e.util.escapeQuotes(s),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+e.util.toQuotedString(s),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=d.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,h=e.util.copy(e),d="";h.level++;var p="valid"+h.level,m="key"+n,v="idx"+n,g=h.dataLevel=e.dataLevel+1,y="data"+g,b="dataProperties"+n,w=Object.keys(o||{}),x=e.schema.patternProperties||{},_=Object.keys(x),A=e.schema.additionalProperties,E=w.length||_.length,S=!1===A,M="object"==typeof A&&Object.keys(A).length,T=e.opts.removeAdditional,P=S||M||T,F=e.opts.ownProperties,O=e.baseId,L=e.schema.required;if(L&&(!e.opts.$data||!L.$data)&&L.length8)a+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var k=w;if(k)for(var R=-1,I=k.length-1;R0:e.util.schemaHasRules(K,e.RULES.all)){var J=e.util.getProperty(q),$=(H=c+J,Y&&void 0!==K.default);h.schema=K,h.schemaPath=s+J,h.errSchemaPath=l+"/"+e.util.escapeFragment(q),h.errorPath=e.util.getPath(e.errorPath,q,e.opts.jsonPointers),h.dataPathArr[g]=e.util.toQuotedString(q);X=e.validate(h);if(h.baseId=O,e.util.varOccurences(X,y)<2){X=e.util.varReplace(X,y,H);var ee=H}else{ee=y;a+=" var "+y+" = "+H+"; "}if($)a+=" "+X+" ";else{if(C&&C[q]){a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = false; ";j=e.errorPath,V=l;var te,re=e.util.escapeQuotes(q);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,q,e.opts.jsonPointers)),l=e.errSchemaPath+"/required",(te=te||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+re+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";z=a;a=te.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+z+"]); ":a+=" validate.errors = ["+z+"]; return false; ":a+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=V,e.errorPath=j,a+=" } else { "}else u?(a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = true; } else { "):(a+=" if ("+ee+" !== undefined ",F&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=" ) { ");a+=" "+X+" } "}}u&&(a+=" if ("+p+") { ",d+="}")}}if(_.length){var ae=_;if(ae)for(var ne,ie=-1,oe=ae.length-1;ie0:e.util.schemaHasRules(K,e.RULES.all)){h.schema=K,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ne),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ne),a+=F?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+b+".length; "+v+"++) { var "+m+" = "+b+"["+v+"]; ":" for (var "+m+" in "+c+") { ",a+=" if ("+e.usePattern(ne)+".test("+m+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);H=c+"["+m+"]";h.dataPathArr[g]=m;X=e.validate(h);h.baseId=O,e.util.varOccurences(X,y)<2?a+=" "+e.util.varReplace(X,y,H)+" ":a+=" var "+y+" = "+H+"; "+X+" ",u&&(a+=" if (!"+p+") break; "),a+=" } ",u&&(a+=" else "+p+" = true; "),a+=" } ",u&&(a+=" if ("+p+") { ",d+="}")}}}return u&&(a+=" "+d+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,h=e.util.copy(e);h.level++;var d="valid"+h.level;if(a+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=l;var p="key"+n,m="idx"+n,v="i"+n,g="' + "+p+" + '",y="data"+(h.dataLevel=e.dataLevel+1),b="dataProperties"+n,w=e.opts.ownProperties,x=e.baseId;w&&(a+=" var "+b+" = undefined; "),a+=w?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+b+".length; "+m+"++) { var "+p+" = "+b+"["+m+"]; ":" for (var "+p+" in "+c+") { ",a+=" var startErrs"+n+" = errors; ";var _=p,A=e.compositeRule;e.compositeRule=h.compositeRule=!0;var E=e.validate(h);h.baseId=x,e.util.varOccurences(E,y)<2?a+=" "+e.util.varReplace(E,y,_)+" ":a+=" var "+y+" = "+_+"; "+E+" ",e.compositeRule=h.compositeRule=A,a+=" if (!"+d+") { for (var "+v+"=startErrs"+n+"; "+v+"0:e.util.schemaHasRules(b,e.RULES.all))||(p[p.length]=v)}}else p=o;if(h||p.length){var w=e.errorPath,x=h||p.length>=e.opts.loopRequired,_=e.opts.ownProperties;if(u)if(a+=" var missing"+n+"; ",x){h||(a+=" var "+d+" = validate.schema"+s+"; ");var A="' + "+(F="schema"+n+"["+(M="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),a+=" var "+f+" = true; ",h&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=" for (var "+M+" = 0; "+M+" < "+d+".length; "+M+"++) { "+f+" = "+c+"["+d+"["+M+"]] !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", "+d+"["+M+"]) "),a+="; if (!"+f+") break; } ",h&&(a+=" } "),a+=" if (!"+f+") { ",(P=P||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+A+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;a=P.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var S=p;if(S)for(var M=-1,T=S.length-1;M 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(p.indexOf("object")>=0||p.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var v="checkDataType"+(m?"s":"");n+=" if ("+e.util[v](p,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",d&&(n+=" } "),n+=" if (!"+h+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var y=n;n=g.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { ")}else c&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";var a=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,t){for(var r=0;r(e[t]=function(e,t,r,n){return[(t,n)=>{if(n+r>t.length)throw new a;return{value:t[e](n),size:r}},(e,a,n)=>(a[t](e,n),n+r),r,n]}(n[t][0],n[t][1],n[t][2],r(20)[t]),e),{});i.i64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32BE(t),e.readInt32BE(t+4)],size:8}},function(e,t,r){return t.writeInt32BE(e[0],r),t.writeInt32BE(e[1],r+4),r+8},8,r(20).i64],i.li64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32LE(t+4),e.readInt32LE(t)],size:8}},function(e,t,r){return t.writeInt32LE(e[0],r+4),t.writeInt32LE(e[1],r),r+8},8,r(20).li64],i.u64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32BE(t),e.readUInt32BE(t+4)],size:8}},function(e,t,r){return t.writeUInt32BE(e[0],r),t.writeUInt32BE(e[1],r+4),r+8},8,r(20).u64],i.lu64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32LE(t+4),e.readUInt32LE(t)],size:8}},function(e,t,r){return t.writeUInt32LE(e[0],r+4),t.writeUInt32LE(e[1],r),r+8},8,r(20).lu64],e.exports=i},function(e,t,r){(function(t){const a=r(25),{getCount:n,sendCount:i,calcCount:o,PartialReadError:s}=r(14);function l(e,t){return e===t||parseInt(e)===parseInt(t)}function u(e){return(1<e.length)throw new s;const o=e.readUInt8(i);if(r|=(127&o)<>>=7;return t.writeUInt8(e,r+a),r+a+1},function(e){let t=0;for(;-128&e;)e>>>=7,t++;return t+1},r(11).varint],bool:[function(e,t){if(t+1>e.length)throw new s;return{value:!!e.readInt8(t),size:1}},function(e,t,r){return t.writeInt8(+e,r),r+1},1,r(11).bool],pstring:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a),l=t+i,u=l+o;if(u>e.length)throw new s("Missing characters in string, found size is "+e.length+" expected size was "+u);return{value:e.toString("utf8",l,u),size:u-t}},function(e,r,a,n,o){const s=t.byteLength(e,"utf8");return a=i.call(this,s,r,a,n,o),r.write(e,a,s,"utf8"),a+s},function(e,r,a){const n=t.byteLength(e,"utf8");return o.call(this,n,r,a)+n},r(11).pstring],buffer:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a);if((t+=i)+o>e.length)throw new s;return{value:e.slice(t,t+o),size:i+o}},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.copy(t,r),r+e.length},function(e,t,r){return o.call(this,e.length,t,r)+e.length},r(11).buffer],void:[function(){return{value:void 0,size:0}},function(e,t,r){return r},0,r(11).void],bitfield:[function(e,t,r){const a=t;let n=null,i=0;const o={};return o.value=r.reduce((r,{size:a,signed:o,name:l})=>{let c=a,f=0;for(;c>0;){if(0===i){if(e.length>i-r,i-=r,c-=r}return o&&f>=1<{const l=e[s];if(!o&&l<0||o&&l<-(1<=1<=(1<= "+o?1<0;){const e=Math.min(8-i,a);n=n<>a-e&u(e),a-=e,8===(i+=e)&&(t[r++]=n,i=0,n=0)}}),0!==i&&(t[r++]=n<<8-i);return r},function(e,t){return Math.ceil(t.reduce((e,{size:t})=>e+t,0)/8)},r(11).bitfield],cstring:[function(e,t){let r=0;for(;t+rthis.read(e,t,r.type,a),n)),i.size+=u,t+=u,i.value.push(o);return i},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.reduce((e,r,i)=>s(()=>this.write(r,t,e,a.type,n),i),r)},function(e,t,r){let a=o.call(this,e.length,t,r);return a=e.reduce((e,a,n)=>s(()=>e+this.sizeOf(a,t.type,r),n),a)},r(38).array],count:[function(e,t,{type:r},a){return this.read(e,t,r,a)},function(e,t,r,{countFor:n,type:i},o){return this.write(a(n,o).length,t,r,i,o)},function(e,{countFor:t,type:r},n){return this.sizeOf(a(t,n).length,r,n)},r(38).count],container:[function(e,t,r,a){const n={value:{"..":a},size:0};return r.forEach(({type:r,name:a,anon:i})=>{s(()=>{const o=this.read(e,t,r,n.value);n.size+=o.size,t+=o.size,i?void 0!==o.value&&Object.keys(o.value).forEach(e=>{n.value[e]=o.value[e]}):n.value[a]=o.value},a||"unknown")}),delete n.value[".."],n},function(e,t,r,a,n){return e[".."]=n,r=a.reduce((r,{type:a,name:n,anon:i})=>s(()=>this.write(i?e:e[n],t,r,a,e),n||"unknown"),r),delete e[".."],r},function(e,t,r){e[".."]=r;const a=t.reduce((t,{type:r,name:a,anon:n})=>t+s(()=>this.sizeOf(n?e:e[a],r,e),a||"unknown"),0);return delete e[".."],a},r(38).container]}},function(e,t,r){const{getField:a,getFieldInfo:n,tryDoc:i,PartialReadError:o}=r(14);e.exports={switch:[function(e,t,{compareTo:r,fields:o,compareToValue:s,default:l},u){if(r=void 0!==s?s:a(r,u),void 0===o[r]&&void 0===l)throw new Error(r+" has no associated fieldInfo in switch");const c=void 0===o[r],f=c?l:o[r],h=n(f);return i(()=>this.read(e,t,h,u),c?"default":r)},function(e,t,r,{compareTo:o,fields:s,compareToValue:l,default:u},c){if(o=void 0!==l?l:a(o,c),void 0===s[o]&&void 0===u)throw new Error(o+" has no associated fieldInfo in switch");const f=void 0===s[o],h=n(f?u:s[o]);return i(()=>this.write(e,t,r,h,c),f?"default":o)},function(e,{compareTo:t,fields:r,compareToValue:o,default:s},l){if(t=void 0!==o?o:a(t,l),void 0===r[t]&&void 0===s)throw new Error(t+" has no associated fieldInfo in switch");const u=void 0===r[t],c=n(u?s:r[t]);return i(()=>this.sizeOf(e,c,l),u?"default":t)},r(68).switch],option:[function(e,t,r,a){if(e.length0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,a,n=o.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=n,a=s,o.prototype.copy.call(t,r,a),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(i===n.length?a+=n:a+=n.slice(0,e),0==(e-=i)){i===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(i));break}++r}return this.length-=r,a}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,i=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,i),0==(e-=i)){i===n.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(i));break}++a}return this.length-=a,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&h.forEach(l),i||(h.forEach(l),f(c))}))}));return t.reduce(u)}},function(e,t){e.exports={compound:[function(e,t,r,a){const n={value:{},size:0};for(;;){const r=this.read(e,t,"i8",a);if(0===r.value){t+=r.size,n.size+=r.size;break}const i=this.read(e,t,"nbt",a);t+=i.size,n.size+=i.size,n.value[i.value.name]={type:i.value.type,value:i.value.value}}return n},function(e,t,r,a,n){const i=this;return Object.keys(e).map((function(a){r=i.write({name:a,type:e[a].type,value:e[a].value},t,r,"nbt",n)})),r=this.write(0,t,r,"i8",n)},function(e,t,r){const a=this;return 1+Object.keys(e).reduce((function(t,n){return t+a.sizeOf({name:n,type:e[n].type,value:e[n].value},"nbt",r)}),0)}]}},function(e){e.exports=JSON.parse('{"container":"native","i8":"native","switch":"native","compound":"native","i16":"native","i32":"native","i64":"native","f32":"native","f64":"native","pstring":"native","shortString":["pstring",{"countType":"i16"}],"byteArray":["array",{"countType":"i32","type":"i8"}],"list":["container",[{"name":"type","type":"nbtMapper"},{"name":"value","type":["array",{"countType":"i32","type":["nbtSwitch",{"type":"type"}]}]}]],"intArray":["array",{"countType":"i32","type":"i32"}],"longArray":["array",{"countType":"i32","type":"i64"}],"nbtMapper":["mapper",{"type":"i8","mappings":{"0":"end","1":"byte","2":"short","3":"int","4":"long","5":"float","6":"double","7":"byteArray","8":"string","9":"list","10":"compound","11":"intArray","12":"longArray"}}],"nbtSwitch":["switch",{"compareTo":"$type","fields":{"end":"void","byte":"i8","short":"i16","int":"i32","long":"i64","float":"f32","double":"f64","byteArray":"byteArray","string":"shortString","list":"list","compound":"compound","intArray":"intArray","longArray":"longArray"}}],"nbt":["container",[{"name":"type","type":"nbtMapper"},{"name":"name","type":"shortString"},{"name":"value","type":["nbtSwitch",{"type":"type"}]}]]}')},function(e,t){var r,a;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&a.rotl(e,8)|4278255360&a.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,a=0;r>>5]|=e[r]<<24-a%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],a=0,n=0;a>>6-2*n);return t}},e.exports=a},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} +!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var a=t.length-1,n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(e){throw new RangeError(d[e])}function g(e,t){var r=e.split("@"),a="";r.length>1&&(a=r[0]+"@",e=r[1]);var n=function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(h,".")).split("."),t).join(".");return a+n}function y(e){for(var t=[],r=0,a=e.length;r=55296&&n<=56319&&r>1,e+=p(e/t);e>455;a+=36)e=p(e/35);return p(a+36*e/(e+38))},x=function(e){var t,r=[],a=e.length,n=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var l=0;l=128&&v("not-basic"),r.push(e.charCodeAt(l));for(var c=s>0?s+1:0;c=a&&v("invalid-input");var m=(t=e.charCodeAt(c++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>p((u-n)/h))&&v("overflow"),n+=m*h;var g=d<=o?1:d>=o+26?26:d-o;if(mp(u/y)&&v("overflow"),h*=y}var b=r.length+1;o=w(n-f,b,0==f),p(n/b)>u-i&&v("overflow"),i+=p(n/b),n%=b,r.splice(n++,0,i)}return String.fromCodePoint.apply(String,r)},_=function(e){var t=[],r=(e=y(e)).length,a=128,n=0,i=72,o=!0,s=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(o=(c=f.next()).done);o=!0){var h=c.value;h<128&&t.push(m(h))}}catch(e){s=!0,l=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw l}}var d=t.length,g=d;for(d&&t.push("-");g=a&&Tp((u-n)/P)&&v("overflow"),n+=(x-a)*P,a=x;var F=!0,O=!1,L=void 0;try{for(var C,k=e[Symbol.iterator]();!(F=(C=k.next()).done);F=!0){var R=C.value;if(Ru&&v("overflow"),R==a){for(var I=n,N=36;;N+=36){var D=N<=i?1:N>=i+26?26:N-i;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function M(e){for(var t="",r=0,a=e.length;r=194&&n<224){if(a-r>=6){var i=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&n)<<6|63&i)}else t+=e.substr(r,6);r+=6}else if(n>=224){if(a-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function T(e,t){function r(e){var r=M(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,n)),e}function P(e){return e.replace(/^0*(.*)/,"$1")||"0"}function F(e,t){var r=e.match(t.IPV4ADDRESS)||[],a=l(r,2)[1];return a?a.split(".").map(P).join("."):e}function O(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=l(r,3),n=a[1],i=a[2];if(n){for(var o=n.toLowerCase().split("::").reverse(),s=l(o,2),u=s[0],c=s[1],f=c?c.split(":").map(P):[],h=u.split(":").map(P),d=t.IPV4ADDRESS.test(h[h.length-1]),p=d?7:8,m=h.length-p,v=Array(p),g=0;g1){var w=v.slice(0,y.index),x=v.slice(y.index+y.length);b=w.join(":")+"::"+x.join(":")}else b=v.join(":");return i&&(b+="%"+i),b}return e}var L=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,C=void 0==="".match(/(){0}/)[1];function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(L);if(n){C?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=O(F(r.host,a),a)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var i=E[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)T(r,a);else{if(r.host&&(t.domainHost||i&&i.domainHost))try{r.host=A.toASCII(r.host.replace(a.PCT_ENCODED,M).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}T(r,o)}i&&i.parse&&i.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var R=/^\.\.?\//,I=/^\/\.(\/|$)/,N=/^\/\.\.(\/|$)/,D=/^\/?(?:.|\n)*?(?=\/|$)/;function U(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(I))e=e.replace(I,"/");else if(e.match(N))e=e.replace(N,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(D);if(!r)throw new Error("Unexpected dot segment condition");var a=r[0];e=e.slice(a.length),t.push(a)}return t.join("")}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,a=[],n=E[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||n&&n.domainHost)try{e.host=t.iri?A.toUnicode(e.host):A.toASCII(e.host.replace(r.PCT_ENCODED,M).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}T(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var i=function(e,t){var r=!1!==t.iri?s:o,a=[];return void 0!==e.userinfo&&(a.push(e.userinfo),a.push("@")),void 0!==e.host&&a.push(O(F(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"==typeof e.port&&(a.push(":"),a.push(e.port.toString(10))),a.length?a.join(""):void 0}(e,t);if(void 0!==i&&("suffix"!==t.reference&&a.push("//"),a.push(i),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||n&&n.absolutePath||(l=U(l)),void 0===i&&(l=l.replace(/^\/\//,"/%2F")),a.push(l)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function B(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=k(j(e,r),r),t=k(j(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=U(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=U(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function V(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,M)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},G={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},H={},X="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",W=r(r("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+r("%"+Y+Y)),q=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Q=new RegExp(X,"g"),Z=new RegExp(W,"g"),K=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',q),"g"),J=new RegExp(t("[^]",X,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),$=J;function ee(e){var t=M(e);return t.match(Q)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,i={},o=r.query.split("&"),s=0,l=o.length;s=55296&&t<=56319&&n%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,d=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",a.copy(m[e])}function v(e){var t=e.match(n);if(!t)return!1;var r=+t[1],a=+t[2],o=+t[3];return a>=1&&a<=12&&o>=1&&o<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[a])}function g(e,t){var r=e.match(o);if(!r)return!1;var a=r[1],n=r[2],i=r[3],s=r[5];return(a<=23&&n<=59&&i<=59||23==a&&59==n&&60==i)&&(!t||s)}e.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d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2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":h,"json-pointer-uri-fragment":d,"relative-json-pointer":p},m.full={date:v,time:g,"date-time":function(e){var t=e.split(y);return 2==t.length&&v(t[0])&&g(t[1],!0)},uri:function(e){return b.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a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25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":h,"json-pointer-uri-fragment":d,"relative-json-pointer":p};var y=/t|\s/i;var b=/\/|:/;var w=/[^\\]\\Z/;function x(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},function(e,t,r){"use strict";var a=r(137),n=r(16).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=n(t),e.types=n(["number","integer","string","array","object","boolean","null"]),e.forEach((function(r){r.rules=r.rules.map((function(r){var n;if("object"==typeof r){var i=Object.keys(r)[0];n=r[i],r=i,n.forEach((function(r){t.push(r),e.all[r]=!0}))}return t.push(r),e.all[r]={keyword:r,code:a[r],implements:n}})),e.all.$comment={keyword:"$comment",code:a.$comment},r.type&&(e.types[r.type]=r)})),e.keywords=n(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},function(e,t,r){"use strict";e.exports={$ref:r(138),allOf:r(139),anyOf:r(140),$comment:r(141),const:r(142),contains:r(143),dependencies:r(144),enum:r(145),format:r(146),if:r(147),items:r(148),maximum:r(64),minimum:r(64),maxItems:r(65),minItems:r(65),maxLength:r(66),minLength:r(66),maxProperties:r(67),minProperties:r(67),multipleOf:r(149),not:r(150),oneOf:r(151),pattern:r(152),properties:r(153),propertyNames:r(154),required:r(155),uniqueItems:r(156),validate:r(63)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n,i=" ",o=e.level,s=e.dataLevel,l=e.schema[t],u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(s||""),h="valid"+o;if("#"==l||"#/"==l)e.isRoot?(a=e.async,n="validate"):(a=!0===e.root.schema.$async,n="root.refVal[0]");else{var d=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===d){var p=e.MissingRefError.message(e.baseId,l);if("fail"==e.opts.missingRefs){e.logger.error(p),(y=y||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,l,p);e.logger.warn(p),c&&(i+=" if (true) { ")}}else if(d.inline){var v=e.util.copy(e);v.level++;var g="valid"+v.level;v.schema=d.schema,v.schemaPath="",v.errSchemaPath=l,i+=" "+e.validate(v).replace(/validate\.schema/g,d.code)+" ",c&&(i+=" if ("+g+") { ")}else a=!0===d.$async||e.async&&!1!==d.$async,n=d.code}if(n){var y;(y=y||[]).push(i),i="",e.opts.passContext?i+=" "+n+".call(this, ":i+=" "+n+"( ",i+=" "+f+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var b=i+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(i=y.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(i+=" var "+h+"; "),i+=" try { await "+b+"; ",c&&(i+=" "+h+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(i+=" "+h+" = false; "),i+=" } ",c&&(i+=" if ("+h+") { ")}else i+=" if (!"+b+") { if (vErrors === null) vErrors = "+n+".errors; else vErrors = vErrors.concat("+n+".errors); errors = vErrors.length; } ",c&&(i+=" else { ")}return i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.schema[t],i=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,l=e.util.copy(e),u="";l.level++;var c="valid"+l.level,f=l.baseId,h=!0,d=n;if(d)for(var p,m=-1,v=d.length-1;m0:e.util.schemaHasRules(p,e.RULES.all))&&(h=!1,l.schema=p,l.schemaPath=i+"["+m+"]",l.errSchemaPath=o+"/"+m,a+=" "+e.validate(l)+" ",l.baseId=f,s&&(a+=" if ("+c+") { ",u+="}"));return s&&(a+=h?" if (true) { ":" "+u.slice(0,-1)+" "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,h="errs__"+n,d=e.util.copy(e),p="";d.level++;var m="valid"+d.level;if(o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var v=d.baseId;a+=" var "+h+" = errors; var "+f+" = false; ";var g=e.compositeRule;e.compositeRule=d.compositeRule=!0;var y=o;if(y)for(var b,w=-1,x=y.length-1;w0:e.util.schemaHasRules(o,e.RULES.all);if(a+="var "+h+" = errors;var "+f+";",b){var w=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" var "+p+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var x=c+"["+m+"]";d.dataPathArr[v]=m;var _=e.validate(d);d.baseId=y,e.util.varOccurences(_,g)<2?a+=" "+e.util.varReplace(_,g,x)+" ":a+=" var "+g+" = "+x+"; "+_+" ",a+=" if ("+p+") break; } ",e.compositeRule=d.compositeRule=w,a+=" if (!"+p+") {"}else a+=" if ("+c+".length == 0) {";var A=A||[];A.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;return a=A.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",b&&(a+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,h=e.util.copy(e),d="";h.level++;var p="valid"+h.level,m={},v={},g=e.opts.ownProperties;for(x in o){var y=o[x],b=Array.isArray(y)?v:m;b[x]=y}a+="var "+f+" = errors;";var w=e.errorPath;for(var x in a+="var missing"+n+";",v)if((b=v[x]).length){if(a+=" if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),u){a+=" && ( ";var _=b;if(_)for(var A=-1,E=_.length-1;A0:e.util.schemaHasRules(y,e.RULES.all))&&(a+=" "+p+" = true; if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),a+=") { ",h.schema=y,h.schemaPath=s+e.util.getProperty(x),h.errSchemaPath=l+"/"+e.util.escapeFragment(x),a+=" "+e.validate(h)+" ",h.baseId=I,a+=" } ",u&&(a+=" if ("+p+") { ",d+="}"))}return u&&(a+=" "+d+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,h=e.opts.$data&&o&&o.$data;h&&(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var d="i"+n,p="schema"+n;h||(a+=" var "+p+" = validate.schema"+s+";"),a+="var "+f+";",h&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=f+" = false;for (var "+d+"=0; "+d+"<"+p+".length; "+d+"++) if (equal("+c+", "+p+"["+d+"])) { "+f+" = true; break; }",h&&(a+=" } "),a+=" if (!"+f+") { ";var m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var v=a;return a=m.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||"");if(!1===e.opts.format)return u&&(a+=" if (true) { "),a;var f,h=e.opts.$data&&o&&o.$data;h?(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",f="schema"+n):f=o;var d=e.opts.unknownFormats,p=Array.isArray(d);if(h){a+=" var "+(m="format"+n)+" = formats["+f+"]; var "+(v="isObject"+n)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(g="formatType"+n)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+n+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",h&&(a+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),a+=" (","ignore"!=d&&(a+=" ("+f+" && !"+m+" ",p&&(a+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),a+=") || "),a+=" ("+m+" && "+g+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?a+=" (async"+n+" ? await "+m+"("+c+") : "+m+"("+c+")) ":a+=" "+m+"("+c+") ",a+=" : "+m+".test("+c+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==d)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(a+=" if (true) { "),a;if(p&&d.indexOf(o)>=0)return u&&(a+=" if (true) { "),a;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,g=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var y=!0===m.async;m=m.validate}if(g!=r)return u&&(a+=" if (true) { "),a;if(y){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(b="formats"+e.util.getProperty(o)+".validate")+"("+c+"))) { "}else{a+=" if (! ";var b="formats"+e.util.getProperty(o);v&&(b+=".validate"),a+="function"==typeof m?" "+b+"("+c+") ":" "+b+".test("+c+") ",a+=") { "}}var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=h?""+f:""+e.util.toQuotedString(o),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=h?"' + "+f+" + '":""+e.util.escapeQuotes(o),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=h?"validate.schema"+s:""+e.util.toQuotedString(o),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var x=a;return a=w.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,h="errs__"+n,d=e.util.copy(e);d.level++;var p="valid"+d.level,m=e.schema.then,v=e.schema.else,g=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),b=d.baseId;if(g||y){var w;d.createErrors=!1,d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" var "+h+" = errors; var "+f+" = true; ";var x=e.compositeRule;e.compositeRule=d.compositeRule=!0,a+=" "+e.validate(d)+" ",d.baseId=b,d.createErrors=!0,a+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=d.compositeRule=x,g?(a+=" if ("+p+") { ",d.schema=e.schema.then,d.schemaPath=e.schemaPath+".then",d.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(d)+" ",d.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'then'; ":w="'then'",a+=" } ",y&&(a+=" else { ")):a+=" if (!"+p+") { ",y&&(d.schema=e.schema.else,d.schemaPath=e.schemaPath+".else",d.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(d)+" ",d.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'else'; ":w="'else'",a+=" } "),a+=" if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",u&&(a+=" else { "),a=e.util.cleanUpCode(a)}else u&&(a+=" if (true) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,h="errs__"+n,d=e.util.copy(e),p="";d.level++;var m="valid"+d.level,v="i"+n,g=d.dataLevel=e.dataLevel+1,y="data"+g,b=e.baseId;if(a+="var "+h+" = errors;var "+f+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){a+=" "+f+" = "+c+".length <= "+o.length+"; ";var x=l;l=e.errSchemaPath+"/additionalItems",a+=" if (!"+f+") { ";var _=_||[];_.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var A=a;a=_.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+A+"]); ":a+=" validate.errors = ["+A+"]; return false; ":a+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l=x,u&&(p+="}",a+=" else { ")}var E=o;if(E)for(var S,M=-1,T=E.length-1;M0:e.util.schemaHasRules(S,e.RULES.all)){a+=" "+m+" = true; if ("+c+".length > "+M+") { ";var P=c+"["+M+"]";d.schema=S,d.schemaPath=s+"["+M+"]",d.errSchemaPath=l+"/"+M,d.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,!0),d.dataPathArr[g]=M;var F=e.validate(d);d.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",a+=" } ",u&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){d.schema=w,d.schemaPath=e.schemaPath+".additionalItems",d.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+c+".length > "+o.length+") { for (var "+v+" = "+o.length+"; "+v+" < "+c+".length; "+v+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";d.dataPathArr[g]=v;F=e.validate(d);d.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" } } ",u&&(a+=" if ("+m+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";d.dataPathArr[g]=v;F=e.validate(d);d.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" }"}return u&&(a+=" "+p+" if ("+h+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),h=e.opts.$data&&s&&s.$data;h?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="var division"+i+";if (",h&&(n+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),n+=" (division"+i+" = "+f+" / "+a+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+i+" !== parseInt(division"+i+") ",n+=" ) ",h&&(n+=" ) "),n+=" ) { ";var d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=h?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=d.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,h=e.util.copy(e);h.level++;var d="valid"+h.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+f+" = errors; ";var p,m=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(p=h.opts.allErrors,h.opts.allErrors=!1),a+=" "+e.validate(h)+" ",h.createErrors=!0,p&&(h.opts.allErrors=p),e.compositeRule=h.compositeRule=m,a+=" if ("+d+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(a+=" if (false) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,h="errs__"+n,d=e.util.copy(e),p="";d.level++;var m="valid"+d.level,v=d.baseId,g="prevValid"+n,y="passingSchemas"+n;a+="var "+h+" = errors , "+g+" = false , "+f+" = false , "+y+" = null; ";var b=e.compositeRule;e.compositeRule=d.compositeRule=!0;var w=o;if(w)for(var x,_=-1,A=w.length-1;_0:e.util.schemaHasRules(x,e.RULES.all))?(d.schema=x,d.schemaPath=s+"["+_+"]",d.errSchemaPath=l+"/"+_,a+=" "+e.validate(d)+" ",d.baseId=v):a+=" var "+m+" = true; ",_&&(a+=" if ("+m+" && "+g+") { "+f+" = false; "+y+" = ["+y+", "+_+"]; } else { ",p+="}"),a+=" if ("+m+") { "+f+" = "+g+" = true; "+y+" = "+_+"; }";return e.compositeRule=d.compositeRule=b,a+=p+"if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),h=e.opts.$data&&s&&s.$data;h?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",h&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'string') || "),n+=" !"+(h?"(new RegExp("+a+"))":e.usePattern(s))+".test("+f+") ) { ";var d=d||[];d.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",n+=h?""+a:""+e.util.toQuotedString(s),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match pattern \"",n+=h?"' + "+a+" + '":""+e.util.escapeQuotes(s),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+e.util.toQuotedString(s),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=d.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,h=e.util.copy(e),d="";h.level++;var p="valid"+h.level,m="key"+n,v="idx"+n,g=h.dataLevel=e.dataLevel+1,y="data"+g,b="dataProperties"+n,w=Object.keys(o||{}),x=e.schema.patternProperties||{},_=Object.keys(x),A=e.schema.additionalProperties,E=w.length||_.length,S=!1===A,M="object"==typeof A&&Object.keys(A).length,T=e.opts.removeAdditional,P=S||M||T,F=e.opts.ownProperties,O=e.baseId,L=e.schema.required;if(L&&(!e.opts.$data||!L.$data)&&L.length8)a+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var k=w;if(k)for(var R=-1,I=k.length-1;R0:e.util.schemaHasRules(K,e.RULES.all)){var J=e.util.getProperty(q),$=(H=c+J,Y&&void 0!==K.default);h.schema=K,h.schemaPath=s+J,h.errSchemaPath=l+"/"+e.util.escapeFragment(q),h.errorPath=e.util.getPath(e.errorPath,q,e.opts.jsonPointers),h.dataPathArr[g]=e.util.toQuotedString(q);X=e.validate(h);if(h.baseId=O,e.util.varOccurences(X,y)<2){X=e.util.varReplace(X,y,H);var ee=H}else{ee=y;a+=" var "+y+" = "+H+"; "}if($)a+=" "+X+" ";else{if(C&&C[q]){a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = false; ";j=e.errorPath,V=l;var te,re=e.util.escapeQuotes(q);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,q,e.opts.jsonPointers)),l=e.errSchemaPath+"/required",(te=te||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+re+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";z=a;a=te.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+z+"]); ":a+=" validate.errors = ["+z+"]; return false; ":a+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=V,e.errorPath=j,a+=" } else { "}else u?(a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = true; } else { "):(a+=" if ("+ee+" !== undefined ",F&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=" ) { ");a+=" "+X+" } "}}u&&(a+=" if ("+p+") { ",d+="}")}}if(_.length){var ae=_;if(ae)for(var ne,ie=-1,oe=ae.length-1;ie0:e.util.schemaHasRules(K,e.RULES.all)){h.schema=K,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ne),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ne),a+=F?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+b+".length; "+v+"++) { var "+m+" = "+b+"["+v+"]; ":" for (var "+m+" in "+c+") { ",a+=" if ("+e.usePattern(ne)+".test("+m+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);H=c+"["+m+"]";h.dataPathArr[g]=m;X=e.validate(h);h.baseId=O,e.util.varOccurences(X,y)<2?a+=" "+e.util.varReplace(X,y,H)+" ":a+=" var "+y+" = "+H+"; "+X+" ",u&&(a+=" if (!"+p+") break; "),a+=" } ",u&&(a+=" else "+p+" = true; "),a+=" } ",u&&(a+=" if ("+p+") { ",d+="}")}}}return u&&(a+=" "+d+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,h=e.util.copy(e);h.level++;var d="valid"+h.level;if(a+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=l;var p="key"+n,m="idx"+n,v="i"+n,g="' + "+p+" + '",y="data"+(h.dataLevel=e.dataLevel+1),b="dataProperties"+n,w=e.opts.ownProperties,x=e.baseId;w&&(a+=" var "+b+" = undefined; "),a+=w?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+b+".length; "+m+"++) { var "+p+" = "+b+"["+m+"]; ":" for (var "+p+" in "+c+") { ",a+=" var startErrs"+n+" = errors; ";var _=p,A=e.compositeRule;e.compositeRule=h.compositeRule=!0;var E=e.validate(h);h.baseId=x,e.util.varOccurences(E,y)<2?a+=" "+e.util.varReplace(E,y,_)+" ":a+=" var "+y+" = "+_+"; "+E+" ",e.compositeRule=h.compositeRule=A,a+=" if (!"+d+") { for (var "+v+"=startErrs"+n+"; "+v+"0:e.util.schemaHasRules(b,e.RULES.all))||(p[p.length]=v)}}else p=o;if(h||p.length){var w=e.errorPath,x=h||p.length>=e.opts.loopRequired,_=e.opts.ownProperties;if(u)if(a+=" var missing"+n+"; ",x){h||(a+=" var "+d+" = validate.schema"+s+"; ");var A="' + "+(F="schema"+n+"["+(M="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),a+=" var "+f+" = true; ",h&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=" for (var "+M+" = 0; "+M+" < "+d+".length; "+M+"++) { "+f+" = "+c+"["+d+"["+M+"]] !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", "+d+"["+M+"]) "),a+="; if (!"+f+") break; } ",h&&(a+=" } "),a+=" if (!"+f+") { ",(P=P||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+A+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;a=P.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var S=p;if(S)for(var M=-1,T=S.length-1;M 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(p.indexOf("object")>=0||p.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+h+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var v="checkDataType"+(m?"s":"");n+=" if ("+e.util[v](p,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",d&&(n+=" } "),n+=" if (!"+h+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var y=n;n=g.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { ")}else c&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";var a=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,t){for(var r=0;r(e[t]=function(e,t,r,n){return[(t,n)=>{if(n+r>t.length)throw new a;return{value:t[e](n),size:r}},(e,a,n)=>(a[t](e,n),n+r),r,n]}(n[t][0],n[t][1],n[t][2],r(21)[t]),e),{});i.i64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32BE(t),e.readInt32BE(t+4)],size:8}},function(e,t,r){return t.writeInt32BE(e[0],r),t.writeInt32BE(e[1],r+4),r+8},8,r(21).i64],i.li64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32LE(t+4),e.readInt32LE(t)],size:8}},function(e,t,r){return t.writeInt32LE(e[0],r+4),t.writeInt32LE(e[1],r),r+8},8,r(21).li64],i.u64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32BE(t),e.readUInt32BE(t+4)],size:8}},function(e,t,r){return t.writeUInt32BE(e[0],r),t.writeUInt32BE(e[1],r+4),r+8},8,r(21).u64],i.lu64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32LE(t+4),e.readUInt32LE(t)],size:8}},function(e,t,r){return t.writeUInt32LE(e[0],r+4),t.writeUInt32LE(e[1],r),r+8},8,r(21).lu64],e.exports=i},function(e,t,r){(function(t){const a=r(26),{getCount:n,sendCount:i,calcCount:o,PartialReadError:s}=r(15);function l(e,t){return e===t||parseInt(e)===parseInt(t)}function u(e){return(1<e.length)throw new s;const o=e.readUInt8(i);if(r|=(127&o)<>>=7;return t.writeUInt8(e,r+a),r+a+1},function(e){let t=0;for(;-128&e;)e>>>=7,t++;return t+1},r(11).varint],bool:[function(e,t){if(t+1>e.length)throw new s;return{value:!!e.readInt8(t),size:1}},function(e,t,r){return t.writeInt8(+e,r),r+1},1,r(11).bool],pstring:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a),l=t+i,u=l+o;if(u>e.length)throw new s("Missing characters in string, found size is "+e.length+" expected size was "+u);return{value:e.toString("utf8",l,u),size:u-t}},function(e,r,a,n,o){const s=t.byteLength(e,"utf8");return a=i.call(this,s,r,a,n,o),r.write(e,a,s,"utf8"),a+s},function(e,r,a){const n=t.byteLength(e,"utf8");return o.call(this,n,r,a)+n},r(11).pstring],buffer:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a);if((t+=i)+o>e.length)throw new s;return{value:e.slice(t,t+o),size:i+o}},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.copy(t,r),r+e.length},function(e,t,r){return o.call(this,e.length,t,r)+e.length},r(11).buffer],void:[function(){return{value:void 0,size:0}},function(e,t,r){return r},0,r(11).void],bitfield:[function(e,t,r){const a=t;let n=null,i=0;const o={};return o.value=r.reduce((r,{size:a,signed:o,name:l})=>{let c=a,f=0;for(;c>0;){if(0===i){if(e.length>i-r,i-=r,c-=r}return o&&f>=1<{const l=e[s];if(!o&&l<0||o&&l<-(1<=1<=(1<= "+o?1<0;){const e=Math.min(8-i,a);n=n<>a-e&u(e),a-=e,8===(i+=e)&&(t[r++]=n,i=0,n=0)}}),0!==i&&(t[r++]=n<<8-i);return r},function(e,t){return Math.ceil(t.reduce((e,{size:t})=>e+t,0)/8)},r(11).bitfield],cstring:[function(e,t){let r=0;for(;t+rthis.read(e,t,r.type,a),n)),i.size+=u,t+=u,i.value.push(o);return i},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.reduce((e,r,i)=>s(()=>this.write(r,t,e,a.type,n),i),r)},function(e,t,r){let a=o.call(this,e.length,t,r);return a=e.reduce((e,a,n)=>s(()=>e+this.sizeOf(a,t.type,r),n),a)},r(39).array],count:[function(e,t,{type:r},a){return this.read(e,t,r,a)},function(e,t,r,{countFor:n,type:i},o){return this.write(a(n,o).length,t,r,i,o)},function(e,{countFor:t,type:r},n){return this.sizeOf(a(t,n).length,r,n)},r(39).count],container:[function(e,t,r,a){const n={value:{"..":a},size:0};return r.forEach(({type:r,name:a,anon:i})=>{s(()=>{const o=this.read(e,t,r,n.value);n.size+=o.size,t+=o.size,i?void 0!==o.value&&Object.keys(o.value).forEach(e=>{n.value[e]=o.value[e]}):n.value[a]=o.value},a||"unknown")}),delete n.value[".."],n},function(e,t,r,a,n){return e[".."]=n,r=a.reduce((r,{type:a,name:n,anon:i})=>s(()=>this.write(i?e:e[n],t,r,a,e),n||"unknown"),r),delete e[".."],r},function(e,t,r){e[".."]=r;const a=t.reduce((t,{type:r,name:a,anon:n})=>t+s(()=>this.sizeOf(n?e:e[a],r,e),a||"unknown"),0);return delete e[".."],a},r(39).container]}},function(e,t,r){const{getField:a,getFieldInfo:n,tryDoc:i,PartialReadError:o}=r(15);e.exports={switch:[function(e,t,{compareTo:r,fields:o,compareToValue:s,default:l},u){if(r=void 0!==s?s:a(r,u),void 0===o[r]&&void 0===l)throw new Error(r+" has no associated fieldInfo in switch");const c=void 0===o[r],f=c?l:o[r],h=n(f);return i(()=>this.read(e,t,h,u),c?"default":r)},function(e,t,r,{compareTo:o,fields:s,compareToValue:l,default:u},c){if(o=void 0!==l?l:a(o,c),void 0===s[o]&&void 0===u)throw new Error(o+" has no associated fieldInfo in switch");const f=void 0===s[o],h=n(f?u:s[o]);return i(()=>this.write(e,t,r,h,c),f?"default":o)},function(e,{compareTo:t,fields:r,compareToValue:o,default:s},l){if(t=void 0!==o?o:a(t,l),void 0===r[t]&&void 0===s)throw new Error(t+" has no associated fieldInfo in switch");const u=void 0===r[t],c=n(u?s:r[t]);return i(()=>this.sizeOf(e,c,l),u?"default":t)},r(69).switch],option:[function(e,t,r,a){if(e.length0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,a,n=o.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=n,a=s,o.prototype.copy.call(t,r,a),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(i===n.length?a+=n:a+=n.slice(0,e),0==(e-=i)){i===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(i));break}++r}return this.length-=r,a}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,i=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,i),0==(e-=i)){i===n.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(i));break}++a}return this.length-=a,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&h.forEach(l),i||(h.forEach(l),f(c))}))}));return t.reduce(u)}},function(e,t){e.exports={compound:[function(e,t,r,a){const n={value:{},size:0};for(;;){const r=this.read(e,t,"i8",a);if(0===r.value){t+=r.size,n.size+=r.size;break}const i=this.read(e,t,"nbt",a);t+=i.size,n.size+=i.size,n.value[i.value.name]={type:i.value.type,value:i.value.value}}return n},function(e,t,r,a,n){const i=this;return Object.keys(e).map((function(a){r=i.write({name:a,type:e[a].type,value:e[a].value},t,r,"nbt",n)})),r=this.write(0,t,r,"i8",n)},function(e,t,r){const a=this;return 1+Object.keys(e).reduce((function(t,n){return t+a.sizeOf({name:n,type:e[n].type,value:e[n].value},"nbt",r)}),0)}]}},function(e){e.exports=JSON.parse('{"container":"native","i8":"native","switch":"native","compound":"native","i16":"native","i32":"native","i64":"native","f32":"native","f64":"native","pstring":"native","shortString":["pstring",{"countType":"i16"}],"byteArray":["array",{"countType":"i32","type":"i8"}],"list":["container",[{"name":"type","type":"nbtMapper"},{"name":"value","type":["array",{"countType":"i32","type":["nbtSwitch",{"type":"type"}]}]}]],"intArray":["array",{"countType":"i32","type":"i32"}],"longArray":["array",{"countType":"i32","type":"i64"}],"nbtMapper":["mapper",{"type":"i8","mappings":{"0":"end","1":"byte","2":"short","3":"int","4":"long","5":"float","6":"double","7":"byteArray","8":"string","9":"list","10":"compound","11":"intArray","12":"longArray"}}],"nbtSwitch":["switch",{"compareTo":"$type","fields":{"end":"void","byte":"i8","short":"i16","int":"i32","long":"i64","float":"f32","double":"f64","byteArray":"byteArray","string":"shortString","list":"list","compound":"compound","intArray":"intArray","longArray":"longArray"}}],"nbt":["container",[{"name":"type","type":"nbtMapper"},{"name":"name","type":"shortString"},{"name":"value","type":["nbtSwitch",{"type":"type"}]}]]}')},function(e,t){var r,a;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&a.rotl(e,8)|4278255360&a.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,a=0;r>>5]|=e[r]<<24-a%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],a=0,n=0;a>>6-2*n);return t}},e.exports=a},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ -e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict"},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return n}));var a=r(1);function n(e){console.debug("New Worker!"),e.addEventListener("message",t=>{let r=t.data;"parseModel"===r.func?Object(a.e)(r.model,r.modelOptions,[],r.assetRoot).then(t=>{e.postMessage({msg:"done",parsedModelList:t}),close()}):"loadAndMergeModel"===r.func?Object(a.b)(r.model,r.assetRoot).then(t=>{e.postMessage({msg:"done",mergedModel:t}),close()}):"loadTextures"===r.func?Object(a.c)(r.textures,r.assetRoot).then(t=>{e.postMessage({msg:"done",textures:t}),close()}):(console.warn("Unknown function '"+r.func+"' for ModelWorker"),console.warn(r),close())})}}]); \ No newline at end of file +e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict"},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return o}));var a=r(1),n=r(12);const i=n("minerender");function o(e){i("New Worker!"),e.addEventListener("message",t=>{let r=t.data;"parseModel"===r.func?Object(a.e)(r.model,r.modelOptions,[],r.assetRoot).then(t=>{e.postMessage({msg:"done",parsedModelList:t}),close()}):"loadAndMergeModel"===r.func?Object(a.b)(r.model,r.assetRoot).then(t=>{e.postMessage({msg:"done",mergedModel:t}),close()}):"loadTextures"===r.func?Object(a.c)(r.textures,r.assetRoot).then(t=>{e.postMessage({msg:"done",textures:t}),close()}):(console.warn("Unknown function '"+r.func+"' for ModelWorker"),console.warn(r),close())})}}]); \ No newline at end of file diff --git a/dist/model.js b/dist/model.js index b0e80d25..177f7d30 100644 --- a/dist/model.js +++ b/dist/model.js @@ -1,8 +1,8 @@ /*! - * MineRender 1.4.6 + * MineRender 1.4.7 * (c) 2018, Haylee Schäfer (inventivetalent) / MIT License * https://minerender.org - * Build #1612195849082 / Mon Feb 01 2021 17:10:49 GMT+0100 (GMT+01:00) + * Build #1612197069607 / Mon Feb 01 2021 17:31:09 GMT+0100 (GMT+01:00) */ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache @@ -317,6 +317,28 @@ eval("(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefg /***/ }), +/***/ "./node_modules/debug/src/browser.js": +/*!*******************************************!*\ + !*** ./node_modules/debug/src/browser.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(/*! ./debug */ \"./node_modules/debug/src/debug.js\");\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/process/browser.js */ \"./node_modules/node-libs-browser/node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/debug/src/browser.js?"); + +/***/ }), + +/***/ "./node_modules/debug/src/debug.js": +/*!*****************************************!*\ + !*** ./node_modules/debug/src/debug.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n\n//# sourceURL=webpack:///./node_modules/debug/src/debug.js?"); + +/***/ }), + /***/ "./node_modules/deepmerge/dist/cjs.js": /*!********************************************!*\ !*** ./node_modules/deepmerge/dist/cjs.js ***! @@ -442,6 +464,17 @@ eval("(function(){\r\n var crypt = __webpack_require__(/*! crypt */ \"./node_mo /***/ }), +/***/ "./node_modules/ms/index.js": +/*!**********************************!*\ + !*** ./node_modules/ms/index.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n\n//# sourceURL=webpack:///./node_modules/ms/index.js?"); + +/***/ }), + /***/ "./node_modules/node-libs-browser/node_modules/process/browser.js": /*!************************************************************************!*\ !*** ./node_modules/node-libs-browser/node_modules/process/browser.js ***! @@ -2037,7 +2070,7 @@ eval("function webpackBootstrapFunc (modules) {\n/******/ // The module cache\n /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_ROOT\", function() { return DEFAULT_ROOT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureAsBase64\", function() { return loadTextureAsBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadBlockState\", function() { return loadBlockState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureMeta\", function() { return loadTextureMeta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath\", function() { return loadJsonFromPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath_\", function() { return loadJsonFromPath_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleUv\", function() { return scaleUv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trimCanvas\", function() { return trimCanvas; });\n/**\r\n * Default asset root\r\n * @type {string}\r\n */\r\nconst DEFAULT_ROOT = \"https://assets.mcasset.cloud/1.13\";\r\n/**\r\n * Texture cache\r\n * @type {Object.}\r\n */\r\nconst textureCache = {};\r\n/**\r\n * Texture callbacks\r\n * @type {Object.}\r\n */\r\nconst textureCallbacks = {};\r\n\r\n/**\r\n * Model cache\r\n * @type {Object.}\r\n */\r\nconst modelCache = {};\r\n/**\r\n * Model callbacks\r\n * @type {Object.}\r\n */\r\nconst modelCallbacks = {};\r\n\r\n\r\n/**\r\n * Loads a Mincraft texture an returns it as Base64\r\n *\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} namespace Namespace, usually 'minecraft'\r\n * @param {string} dir Directory of the texture\r\n * @param {string} name Name of the texture\r\n * @returns {Promise}\r\n */\r\nfunction loadTextureAsBase64(root, namespace, dir, name) {\r\n return new Promise((resolve, reject) => {\r\n loadTexture(root, namespace, dir, name, resolve, reject);\r\n })\r\n};\r\n\r\n/**\r\n * Load a texture as base64 - shouldn't be used directly\r\n * @see loadTextureAsBase64\r\n * @ignore\r\n */\r\nfunction loadTexture(root, namespace, dir, name, resolve, reject, forceLoad) {\r\n let path = \"/assets/\" + namespace + \"/textures\" + dir + name + \".png\";\r\n\r\n if (textureCache.hasOwnProperty(path)) {\r\n if (textureCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(textureCache[path]);\r\n return;\r\n }\r\n\r\n if (!textureCallbacks.hasOwnProperty(path) || textureCallbacks[path].length === 0 || forceLoad) {\r\n // https://gist.github.com/oliyh/db3d1a582aefe6d8fee9 / https://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', root + path, true);\r\n xhr.responseType = 'arraybuffer';\r\n xhr.onloadend = function () {\r\n if (xhr.status === 200) {\r\n let arr = new Uint8Array(xhr.response || xhr.responseText);\r\n let raw = String.fromCharCode.apply(null, arr);\r\n let b64 = btoa(raw);\r\n let dataURL = \"data:image/png;base64,\" + b64;\r\n\r\n textureCache[path] = dataURL;\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[0](dataURL);\r\n }\r\n }\r\n } else {\r\n if (DEFAULT_ROOT === root) {\r\n textureCache[path] = \"__invalid\";\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n loadTexture(DEFAULT_ROOT, namespace, dir, name, resolve, reject, true)\r\n }\r\n }\r\n };\r\n xhr.send();\r\n\r\n // init array\r\n if (!textureCallbacks.hasOwnProperty(path))\r\n textureCallbacks[path] = [];\r\n }\r\n\r\n // add the promise callback\r\n textureCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n\r\n/**\r\n * Loads a blockstate file and returns the contained JSON\r\n * @param {string} state Name of the blockstate\r\n * @param {string} assetRoot Asset root, see {@link DEFAULT_ROOT}\r\n * @returns {Promise}\r\n */\r\nfunction loadBlockState(state, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/blockstates/\" + state + \".json\")\r\n};\r\n\r\nfunction loadTextureMeta(texture, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/textures/block/\" + texture + \".png.mcmeta\")\r\n}\r\n\r\n/**\r\n * Loads a model file and returns the contained JSON\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} path Path to the model file\r\n * @returns {Promise}\r\n */\r\nfunction loadJsonFromPath(root, path) {\r\n return new Promise((resolve, reject) => {\r\n loadJsonFromPath_(root, path, resolve, reject);\r\n })\r\n}\r\n\r\n/**\r\n * Load a model - shouldn't used directly\r\n * @see loadJsonFromPath\r\n * @ignore\r\n */\r\nfunction loadJsonFromPath_(root, path, resolve, reject, forceLoad) {\r\n if (modelCache.hasOwnProperty(path)) {\r\n if (modelCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(Object.assign({}, modelCache[path]));\r\n return;\r\n }\r\n\r\n if (!modelCallbacks.hasOwnProperty(path) || modelCallbacks[path].length === 0 || forceLoad) {\r\n console.log(root + path)\r\n fetch(root + path, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"json data:\", data);\r\n modelCache[path] = data;\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let dataCopy = Object.assign({}, data);\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[0](dataCopy);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n console.warn(err);\r\n if (DEFAULT_ROOT === root) {\r\n modelCache[path] = \"__invalid\";\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n // Try again with default root\r\n loadJsonFromPath_(DEFAULT_ROOT, path, resolve, reject, true);\r\n }\r\n });\r\n\r\n if (!modelCallbacks.hasOwnProperty(path))\r\n modelCallbacks[path] = [];\r\n }\r\n\r\n modelCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n/**\r\n * Scales UV values\r\n * @param {number} uv UV value\r\n * @param {number} size\r\n * @param {number} [scale=16]\r\n * @returns {number}\r\n */\r\nfunction scaleUv(uv, size, scale) {\r\n if (uv === 0) return 0;\r\n return size / (scale || 16) * uv;\r\n}\r\n\r\n\r\n// https://gist.github.com/remy/784508\r\nfunction trimCanvas(c) {\r\n let ctx = c.getContext('2d'),\r\n copy = document.createElement('canvas').getContext('2d'),\r\n pixels = ctx.getImageData(0, 0, c.width, c.height),\r\n l = pixels.data.length,\r\n i,\r\n bound = {\r\n top: null,\r\n left: null,\r\n right: null,\r\n bottom: null\r\n },\r\n x, y;\r\n\r\n for (i = 0; i < l; i += 4) {\r\n if (pixels.data[i + 3] !== 0) {\r\n x = (i / 4) % c.width;\r\n y = ~~((i / 4) / c.width);\r\n\r\n if (bound.top === null) {\r\n bound.top = y;\r\n }\r\n\r\n if (bound.left === null) {\r\n bound.left = x;\r\n } else if (x < bound.left) {\r\n bound.left = x;\r\n }\r\n\r\n if (bound.right === null) {\r\n bound.right = x;\r\n } else if (bound.right < x) {\r\n bound.right = x;\r\n }\r\n\r\n if (bound.bottom === null) {\r\n bound.bottom = y;\r\n } else if (bound.bottom < y) {\r\n bound.bottom = y;\r\n }\r\n }\r\n }\r\n\r\n let trimHeight = bound.bottom - bound.top,\r\n trimWidth = bound.right - bound.left,\r\n trimmed = ctx.getImageData(bound.left, bound.top, trimWidth, trimHeight);\r\n\r\n copy.canvas.width = trimWidth;\r\n copy.canvas.height = trimHeight;\r\n copy.putImageData(trimmed, 0, 0);\r\n\r\n // open new window with trimmed image:\r\n return copy.canvas;\r\n}\n\n//# sourceURL=webpack:///./src/functions.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_ROOT\", function() { return DEFAULT_ROOT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureAsBase64\", function() { return loadTextureAsBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadBlockState\", function() { return loadBlockState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureMeta\", function() { return loadTextureMeta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath\", function() { return loadJsonFromPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath_\", function() { return loadJsonFromPath_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleUv\", function() { return scaleUv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trimCanvas\", function() { return trimCanvas; });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_0__);\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__(\"minerender\");\r\n\r\n/**\r\n * Default asset root\r\n * @type {string}\r\n */\r\nconst DEFAULT_ROOT = \"https://assets.mcasset.cloud/1.13\";\r\n/**\r\n * Texture cache\r\n * @type {Object.}\r\n */\r\nconst textureCache = {};\r\n/**\r\n * Texture callbacks\r\n * @type {Object.}\r\n */\r\nconst textureCallbacks = {};\r\n\r\n/**\r\n * Model cache\r\n * @type {Object.}\r\n */\r\nconst modelCache = {};\r\n/**\r\n * Model callbacks\r\n * @type {Object.}\r\n */\r\nconst modelCallbacks = {};\r\n\r\n\r\n/**\r\n * Loads a Mincraft texture an returns it as Base64\r\n *\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} namespace Namespace, usually 'minecraft'\r\n * @param {string} dir Directory of the texture\r\n * @param {string} name Name of the texture\r\n * @returns {Promise}\r\n */\r\nfunction loadTextureAsBase64(root, namespace, dir, name) {\r\n return new Promise((resolve, reject) => {\r\n loadTexture(root, namespace, dir, name, resolve, reject);\r\n })\r\n};\r\n\r\n/**\r\n * Load a texture as base64 - shouldn't be used directly\r\n * @see loadTextureAsBase64\r\n * @ignore\r\n */\r\nfunction loadTexture(root, namespace, dir, name, resolve, reject, forceLoad) {\r\n let path = \"/assets/\" + namespace + \"/textures\" + dir + name + \".png\";\r\n\r\n if (textureCache.hasOwnProperty(path)) {\r\n if (textureCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(textureCache[path]);\r\n return;\r\n }\r\n\r\n if (!textureCallbacks.hasOwnProperty(path) || textureCallbacks[path].length === 0 || forceLoad) {\r\n // https://gist.github.com/oliyh/db3d1a582aefe6d8fee9 / https://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', root + path, true);\r\n xhr.responseType = 'arraybuffer';\r\n xhr.onloadend = function () {\r\n if (xhr.status === 200) {\r\n let arr = new Uint8Array(xhr.response || xhr.responseText);\r\n let raw = String.fromCharCode.apply(null, arr);\r\n let b64 = btoa(raw);\r\n let dataURL = \"data:image/png;base64,\" + b64;\r\n\r\n textureCache[path] = dataURL;\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[0](dataURL);\r\n }\r\n }\r\n } else {\r\n if (DEFAULT_ROOT === root) {\r\n textureCache[path] = \"__invalid\";\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n loadTexture(DEFAULT_ROOT, namespace, dir, name, resolve, reject, true)\r\n }\r\n }\r\n };\r\n xhr.send();\r\n\r\n // init array\r\n if (!textureCallbacks.hasOwnProperty(path))\r\n textureCallbacks[path] = [];\r\n }\r\n\r\n // add the promise callback\r\n textureCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n\r\n/**\r\n * Loads a blockstate file and returns the contained JSON\r\n * @param {string} state Name of the blockstate\r\n * @param {string} assetRoot Asset root, see {@link DEFAULT_ROOT}\r\n * @returns {Promise}\r\n */\r\nfunction loadBlockState(state, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/blockstates/\" + state + \".json\")\r\n};\r\n\r\nfunction loadTextureMeta(texture, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/textures/block/\" + texture + \".png.mcmeta\")\r\n}\r\n\r\n/**\r\n * Loads a model file and returns the contained JSON\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} path Path to the model file\r\n * @returns {Promise}\r\n */\r\nfunction loadJsonFromPath(root, path) {\r\n return new Promise((resolve, reject) => {\r\n loadJsonFromPath_(root, path, resolve, reject);\r\n })\r\n}\r\n\r\n/**\r\n * Load a model - shouldn't used directly\r\n * @see loadJsonFromPath\r\n * @ignore\r\n */\r\nfunction loadJsonFromPath_(root, path, resolve, reject, forceLoad) {\r\n if (modelCache.hasOwnProperty(path)) {\r\n if (modelCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(Object.assign({}, modelCache[path]));\r\n return;\r\n }\r\n\r\n if (!modelCallbacks.hasOwnProperty(path) || modelCallbacks[path].length === 0 || forceLoad) {\r\n debug(root + path)\r\n fetch(root + path, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n debug(\"json data:\", data);\r\n modelCache[path] = data;\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let dataCopy = Object.assign({}, data);\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[0](dataCopy);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n console.warn(err);\r\n if (DEFAULT_ROOT === root) {\r\n modelCache[path] = \"__invalid\";\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n // Try again with default root\r\n loadJsonFromPath_(DEFAULT_ROOT, path, resolve, reject, true);\r\n }\r\n });\r\n\r\n if (!modelCallbacks.hasOwnProperty(path))\r\n modelCallbacks[path] = [];\r\n }\r\n\r\n modelCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n/**\r\n * Scales UV values\r\n * @param {number} uv UV value\r\n * @param {number} size\r\n * @param {number} [scale=16]\r\n * @returns {number}\r\n */\r\nfunction scaleUv(uv, size, scale) {\r\n if (uv === 0) return 0;\r\n return size / (scale || 16) * uv;\r\n}\r\n\r\n\r\n// https://gist.github.com/remy/784508\r\nfunction trimCanvas(c) {\r\n let ctx = c.getContext('2d'),\r\n copy = document.createElement('canvas').getContext('2d'),\r\n pixels = ctx.getImageData(0, 0, c.width, c.height),\r\n l = pixels.data.length,\r\n i,\r\n bound = {\r\n top: null,\r\n left: null,\r\n right: null,\r\n bottom: null\r\n },\r\n x, y;\r\n\r\n for (i = 0; i < l; i += 4) {\r\n if (pixels.data[i + 3] !== 0) {\r\n x = (i / 4) % c.width;\r\n y = ~~((i / 4) / c.width);\r\n\r\n if (bound.top === null) {\r\n bound.top = y;\r\n }\r\n\r\n if (bound.left === null) {\r\n bound.left = x;\r\n } else if (x < bound.left) {\r\n bound.left = x;\r\n }\r\n\r\n if (bound.right === null) {\r\n bound.right = x;\r\n } else if (bound.right < x) {\r\n bound.right = x;\r\n }\r\n\r\n if (bound.bottom === null) {\r\n bound.bottom = y;\r\n } else if (bound.bottom < y) {\r\n bound.bottom = y;\r\n }\r\n }\r\n }\r\n\r\n let trimHeight = bound.bottom - bound.top,\r\n trimWidth = bound.right - bound.left,\r\n trimmed = ctx.getImageData(bound.left, bound.top, trimWidth, trimHeight);\r\n\r\n copy.canvas.width = trimWidth;\r\n copy.canvas.height = trimHeight;\r\n copy.putImageData(trimmed, 0, 0);\r\n\r\n // open new window with trimmed image:\r\n return copy.canvas;\r\n}\r\n\n\n//# sourceURL=webpack:///./src/functions.js?"); /***/ }), @@ -2061,7 +2094,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return worker; });\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n\r\n\r\nfunction worker(self) {\r\n console.debug(\"New Worker!\")\r\n self.addEventListener(\"message\", event => {\r\n let msg = event.data;\r\n\r\n if (msg.func === \"parseModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"parseModel\"])(msg.model, msg.modelOptions, [], msg.assetRoot).then((parsedModelList) => {\r\n self.postMessage({msg: \"done\",parsedModelList:parsedModelList})\r\n close();\r\n })\r\n } else if (msg.func === \"loadAndMergeModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadAndMergeModel\"])(msg.model, msg.assetRoot).then((mergedModel) => {\r\n self.postMessage({msg: \"done\",mergedModel:mergedModel});\r\n close();\r\n })\r\n } else if (msg.func === \"loadTextures\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextures\"])(msg.textures, msg.assetRoot).then((textures) => {\r\n self.postMessage({msg: \"done\",textures:textures});\r\n close();\r\n })\r\n } else {\r\n console.warn(\"Unknown function '\" + msg.func + \"' for ModelWorker\");\r\n console.warn(msg);\r\n close();\r\n }\r\n })\r\n};\r\n\n\n//# sourceURL=webpack:///./src/model/ModelWorker.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return worker; });\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_1__(\"minerender\");\r\n\r\nfunction worker(self) {\r\n debug(\"New Worker!\")\r\n self.addEventListener(\"message\", event => {\r\n let msg = event.data;\r\n\r\n if (msg.func === \"parseModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"parseModel\"])(msg.model, msg.modelOptions, [], msg.assetRoot).then((parsedModelList) => {\r\n self.postMessage({msg: \"done\",parsedModelList:parsedModelList})\r\n close();\r\n })\r\n } else if (msg.func === \"loadAndMergeModel\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadAndMergeModel\"])(msg.model, msg.assetRoot).then((mergedModel) => {\r\n self.postMessage({msg: \"done\",mergedModel:mergedModel});\r\n close();\r\n })\r\n } else if (msg.func === \"loadTextures\") {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextures\"])(msg.textures, msg.assetRoot).then((textures) => {\r\n self.postMessage({msg: \"done\",textures:textures});\r\n close();\r\n })\r\n } else {\r\n console.warn(\"Unknown function '\" + msg.func + \"' for ModelWorker\");\r\n console.warn(msg);\r\n close();\r\n }\r\n })\r\n};\r\n\n\n//# sourceURL=webpack:///./src/model/ModelWorker.js?"); /***/ }), @@ -2073,7 +2106,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _renderBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../renderBase */ \"./src/renderBase.js\");\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var _modelConverter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modelConverter */ \"./src/model/modelConverter.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! md5 */ \"./node_modules/md5/md5.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! webworkify-webpack */ \"./node_modules/webworkify-webpack/index.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _skin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../skin */ \"./src/skin/index.js\");\n/* harmony import */ var onscreen_lib_methods_off__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! onscreen/lib/methods/off */ \"./node_modules/onscreen/lib/methods/off.js\");\n\r\n\r\n__webpack_require__(/*! three-instanced-mesh */ \"./node_modules/three-instanced-mesh/index.js\")(three__WEBPACK_IMPORTED_MODULE_0__);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst ModelWorker = /*require.resolve*/(/*! ./ModelWorker.js */ \"./src/model/ModelWorker.js\");\r\n\r\n\r\nString.prototype.replaceAll = function (search, replacement) {\r\n let target = this;\r\n return target.replace(new RegExp(search, 'g'), replacement);\r\n};\r\n\r\nconst colors = [\r\n 0xFF0000,\r\n 0x00FFFF,\r\n 0x0000FF,\r\n 0x000080,\r\n 0xFF00FF,\r\n 0x800080,\r\n 0x808000,\r\n 0x00FF00,\r\n 0x008000,\r\n 0xFFFF00,\r\n 0x800000,\r\n 0x008080,\r\n];\r\n\r\nconst FACE_ORDER = [\"east\", \"west\", \"up\", \"down\", \"south\", \"north\"];\r\nconst TINTS = [\"lightgreen\"];\r\n\r\nconst mergedModelCache = {};\r\nconst loadedTextureCache = {};\r\nconst modelInstances = {};\r\n\r\nconst textureCache = {};\r\nconst canvasCache = {};\r\nconst materialCache = {};\r\nconst geometryCache = {};\r\nconst instanceCache = {};\r\n\r\nconst animatedTextures = [];\r\n\r\n/**\r\n * @see defaultOptions\r\n * @property {string} type alternative way to specify the model type (block/item)\r\n * @property {boolean} [centerCubes=false] center the cube's rotation point\r\n * @property {string} [assetRoot=DEFAULT_ROOT] root to get asset files from\r\n */\r\nlet defOptions = {\r\n camera: {\r\n type: \"perspective\",\r\n x: 35,\r\n y: 25,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n type: \"block\",\r\n centerCubes: false,\r\n assetRoot: _functions__WEBPACK_IMPORTED_MODULE_4__[\"DEFAULT_ROOT\"],\r\n useWebWorkers: false\r\n};\r\n\r\n/**\r\n * A renderer for Minecraft models, i.e. blocks & items\r\n */\r\nclass ModelRender extends _renderBase__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\r\n\r\n /**\r\n * @param {Object} [options] The options for this renderer, see {@link defaultOptions}\r\n * @param {string} [options.assetRoot=DEFAULT_ROOT] root to get asset files from\r\n *\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, element) {\r\n super(options, defOptions, element);\r\n\r\n this.renderType = \"ModelRender\";\r\n\r\n this.models = [];\r\n this.instancePositionMap = {};\r\n this.attached = false;\r\n }\r\n\r\n /**\r\n * Does the actual rendering\r\n * @param {(string[]|Object[])} models Array of models to render - Either strings in the format / or objects\r\n * @param {string} [models[].type=block] either 'block' or 'item'\r\n * @param {string} models[].model if 'type' is given, just the block/item name otherwise '/'\r\n * @param {number[]} [models[].offset] [x,y,z] array of the offset\r\n * @param {number[]} [models[].rotation] [x,y,z] array of the rotation\r\n * @param {string} [models[].blockstate] name of a blockstate to be used to determine the models (only for blocks)\r\n * @param {string} [models[].variant=normal] if 'blockstate' is given, the block variant to use\r\n * @param {function} [cb] Callback when rendering finished\r\n */\r\n render(models, cb) {\r\n let modelRender = this;\r\n\r\n if (!modelRender.attached && !modelRender._scene) {// Don't init scene if attached, since we already have an available scene\r\n super.initScene(function () {\r\n // Animate textures\r\n for (let i = 0; i < animatedTextures.length; i++) {\r\n animatedTextures[i]();\r\n }\r\n\r\n modelRender.element.dispatchEvent(new CustomEvent(\"modelRender\", {detail: {models: modelRender.models}}));\r\n });\r\n } else {\r\n console.log(\"[ModelRender] is attached - skipping scene init\");\r\n }\r\n\r\n let parsedModelList = [];\r\n\r\n parseModels(modelRender, models, parsedModelList)\r\n .then(() => loadAndMergeModels(modelRender, parsedModelList))\r\n .then(() => loadModelTextures(modelRender, parsedModelList))\r\n .then(() => doModelRender(modelRender, parsedModelList))\r\n .then((renderedModels) => {\r\n console.timeEnd(\"doModelRender\");\r\n console.debug(renderedModels)\r\n if (typeof cb === \"function\") cb();\r\n })\r\n\r\n }\r\n\r\n}\r\n\r\n\r\nfunction parseModels(modelRender, models, parsedModelList) {\r\n console.time(\"parseModels\");\r\n console.log(\"Parsing Models...\");\r\n let parsePromises = [];\r\n for (let i = 0; i < models.length; i++) {\r\n let model = models[i];\r\n\r\n // parsePromises.push(parseModel(model, model, parsedModelList, modelRender.options.assetRoot))\r\n parsePromises.push(new Promise(resolve => {\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n parsedModelList.push(...event.data.parsedModelList);\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"parseModel\",\r\n model: model,\r\n modelOptions: model,\r\n parsedModelList: parsedModelList,\r\n assetRoot: modelRender.options.assetRoot\r\n })\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"parseModel\"])(model, model, parsedModelList, modelRender.options.assetRoot).then(() => {\r\n resolve();\r\n })\r\n }\r\n }))\r\n\r\n }\r\n\r\n return Promise.all(parsePromises);\r\n}\r\n\r\n\r\nfunction loadAndMergeModels(modelRender, parsedModelList) {\r\n console.timeEnd(\"parseModels\");\r\n console.time(\"loadAndMergeModels\");\r\n\r\n let jsonPromises = [];\r\n\r\n console.log(\"Loading Model JSON data & merging...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i]);\r\n modelInstances[cacheKey] = (modelInstances[cacheKey] || 0) + 1;\r\n uniqueModels[cacheKey] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n console.debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n jsonPromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n console.debug(\"loadAndMerge \" + cacheKey);\r\n\r\n\r\n if (mergedModelCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n mergedModelCache[cacheKey] = event.data.mergedModel;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadAndMergeModel\",\r\n model: model,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadAndMergeModel\"])(model, modelRender.options.assetRoot).then((mergedModel) => {\r\n mergedModelCache[cacheKey] = mergedModel;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n return Promise.all(jsonPromises);\r\n}\r\n\r\nfunction loadModelTextures(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadAndMergeModels\");\r\n console.time(\"loadModelTextures\");\r\n\r\n let texturePromises = [];\r\n\r\n console.log(\"Loading Textures...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n uniqueModels[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i])] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n console.debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n texturePromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n console.debug(\"loadTexture \" + cacheKey);\r\n let mergedModel = mergedModelCache[cacheKey];\r\n\r\n if (loadedTextureCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel) {\r\n console.warn(\"Missing merged model\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel.textures) {\r\n console.warn(\"The model doesn't have any textures!\");\r\n console.warn(\"Please make sure you're using the proper file.\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n loadedTextureCache[cacheKey] = event.data.textures;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadTextures\",\r\n textures: mergedModel.textures,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadTextures\"])(mergedModel.textures, modelRender.options.assetRoot).then((textures) => {\r\n loadedTextureCache[cacheKey] = textures;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n\r\n return Promise.all(texturePromises);\r\n}\r\n\r\nfunction doModelRender(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadModelTextures\");\r\n console.time(\"doModelRender\");\r\n\r\n console.log(\"Rendering Models...\");\r\n\r\n let renderPromises = [];\r\n\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n renderPromises.push(new Promise(resolve => {\r\n let model = parsedModelList[i];\r\n\r\n let mergedModel = mergedModelCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n let textures = loadedTextureCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n\r\n let offset = model.offset || [0, 0, 0];\r\n let rotation = model.rotation || [0, 0, 0];\r\n let scale = model.scale || [1, 1, 1];\r\n\r\n if (model.options.hasOwnProperty(\"display\")) {\r\n if (mergedModel.hasOwnProperty(\"display\")) {\r\n if (mergedModel.display.hasOwnProperty(model.options.display)) {\r\n let displayData = mergedModel.display[model.options.display];\r\n\r\n if (displayData.hasOwnProperty(\"translation\")) {\r\n offset = [offset[0] + displayData.translation[0], offset[1] + displayData.translation[1], offset[2] + displayData.translation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"rotation\")) {\r\n rotation = [rotation[0] + displayData.rotation[0], rotation[1] + displayData.rotation[1], rotation[2] + displayData.rotation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"scale\")) {\r\n scale = [displayData.scale[0], displayData.scale[1], displayData.scale[2]];\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n\r\n renderModel(modelRender, mergedModel, textures, mergedModel.textures, model.type, model.name, model.variant, offset, rotation, scale).then((renderedModel) => {\r\n\r\n if (renderedModel.firstInstance) {\r\n let container = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\r\n container.add(renderedModel.mesh);\r\n\r\n modelRender.models.push(container);\r\n modelRender.addToScene(container);\r\n }\r\n\r\n resolve(renderedModel);\r\n })\r\n }))\r\n }\r\n\r\n return Promise.all(renderPromises);\r\n}\r\n\r\n\r\nlet renderModel = function (modelRender, model, textures, textureNames, type, name, variant, offset, rotation, scale) {\r\n return new Promise((resolve) => {\r\n if (model.hasOwnProperty(\"elements\")) {// block OR item with block parent\r\n let modelKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant});\r\n let instanceCount = modelInstances[modelKey];\r\n\r\n let applyModelTransforms = function (mesh, instanceIndex) {\r\n mesh.userData.modelType = type;\r\n mesh.userData.modelName = name;\r\n\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n let instanceInfo = {\r\n key: modelKey,\r\n index: instanceIndex,\r\n offset: offset,\r\n scale: scale,\r\n rotation: rotation\r\n };\r\n\r\n if (rotation) {\r\n mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new three__WEBPACK_IMPORTED_MODULE_0__[\"Euler\"](Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]))));\r\n }\r\n if (offset) {\r\n mesh.setPositionAt(instanceIndex, _v3o.set(offset[0], offset[1], offset[2]));\r\n modelRender.instancePositionMap[offset[0] + \"_\" + offset[1] + \"_\" + offset[2]] = instanceInfo;\r\n }\r\n if (scale) {\r\n mesh.setScaleAt(instanceIndex, _v3s.set(scale[0], scale[1], scale[2]));\r\n }\r\n\r\n mesh.needsUpdate();\r\n\r\n // mesh.position = _v3o;\r\n // Object.defineProperty(mesh.position,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(x, this.y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, this.y, z));\r\n // }\r\n // })\r\n //\r\n // mesh.rotation = new THREE.Euler(toRadians(rotation[0]), toRadians(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), toRadians(rotation[2]));\r\n // Object.defineProperty(mesh.rotation,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(x), toRadians(this.y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(this.y), toRadians(z))));\r\n // }\r\n // });\r\n //\r\n // mesh.scale = _v3s;\r\n\r\n resolve({\r\n mesh: mesh,\r\n firstInstance: instanceIndex === 0\r\n });\r\n };\r\n\r\n let finalizeCubeModel = function (geometry, materials) {\r\n geometry.translate(-8, -8, -8);\r\n\r\n\r\n let cachedInstance;\r\n\r\n if (!instanceCache.hasOwnProperty(modelKey)) {\r\n console.debug(\"Caching new model instance \" + modelKey + \" (with \" + instanceCount + \" instances)\");\r\n let newInstance = new three__WEBPACK_IMPORTED_MODULE_0__[\"InstancedMesh\"](\r\n geometry,\r\n materials,\r\n instanceCount,\r\n false,\r\n false,\r\n false);\r\n cachedInstance = {\r\n instance: newInstance,\r\n index: 0\r\n };\r\n instanceCache[modelKey] = cachedInstance;\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](1, 1, 1);\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n for (let i = 0; i < instanceCount; i++) {\r\n\r\n newInstance.setQuaternionAt(i, _q);\r\n newInstance.setPositionAt(i, _v3o);\r\n newInstance.setScaleAt(i, _v3s);\r\n\r\n }\r\n } else {\r\n console.debug(\"Using cached instance (\" + modelKey + \")\");\r\n cachedInstance = instanceCache[modelKey];\r\n\r\n }\r\n\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n };\r\n\r\n if (instanceCache.hasOwnProperty(modelKey)) {\r\n console.debug(\"Using cached model instance (\" + modelKey + \")\");\r\n let cachedInstance = instanceCache[modelKey];\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n return;\r\n }\r\n\r\n // Render the elements\r\n let promises = [];\r\n for (let i = 0; i < model.elements.length; i++) {\r\n let element = model.elements[i];\r\n\r\n // // From net.minecraft.client.renderer.block.model.BlockPart.java#47 - https://yeleha.co/2JcqSr4\r\n let fallbackFaces = {\r\n down: {\r\n uv: [element.from[0], 16 - element.to[2], element.to[0], 16 - element.from[2]],\r\n texture: \"#down\"\r\n },\r\n up: {\r\n uv: [element.from[0], element.from[2], element.to[0], element.to[2]],\r\n texture: \"#up\"\r\n },\r\n north: {\r\n uv: [16 - element.to[0], 16 - element.to[1], 16 - element.from[0], 16 - element.from[1]],\r\n texture: \"#north\"\r\n },\r\n south: {\r\n uv: [element.from[0], 16 - element.to[1], element.to[0], 16 - element.from[1]],\r\n texture: \"#south\"\r\n },\r\n west: {\r\n uv: [element.from[2], 16 - element.to[1], element.to[2], 16 - element.from[2]],\r\n texture: \"#west\"\r\n },\r\n east: {\r\n uv: [16 - element.to[2], 16 - element.to[1], 16 - element.from[2], 16 - element.from[1]],\r\n texture: \"#east\"\r\n }\r\n };\r\n\r\n promises.push(new Promise((resolve) => {\r\n let baseName = name.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" + (element.__comment ? element.__comment.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" : \"\");\r\n createCube(element.to[0] - element.from[0], element.to[1] - element.from[1], element.to[2] - element.from[2],\r\n baseName + Date.now(),\r\n element.faces, fallbackFaces, textures, textureNames, modelRender.options.assetRoot, baseName)\r\n .then((cube) => {\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation((element.to[0] - element.from[0]) / 2, (element.to[1] - element.from[1]) / 2, (element.to[2] - element.from[2]) / 2));\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(element.from[0], element.from[1], element.from[2]));\r\n\r\n if (element.rotation) {\r\n rotateAboutPoint(cube,\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.origin[0], element.rotation.origin[1], element.rotation.origin[2]),\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.axis === \"x\" ? 1 : 0, element.rotation.axis === \"y\" ? 1 : 0, element.rotation.axis === \"z\" ? 1 : 0),\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(element.rotation.angle));\r\n }\r\n\r\n resolve(cube);\r\n })\r\n }));\r\n\r\n\r\n }\r\n\r\n Promise.all(promises).then((cubes) => {\r\n let mergedCubes = Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"mergeCubeMeshes\"])(cubes, true);\r\n mergedCubes.sourceSize = cubes.length;\r\n finalizeCubeModel(mergedCubes.geometry, mergedCubes.materials, cubes.length);\r\n for (let i = 0; i < cubes.length; i++) {\r\n Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"deepDisposeMesh\"])(cubes[i], true);\r\n }\r\n })\r\n } else {// 2d item\r\n createPlane(name + \"_\" + Date.now(), textures).then((plane) => {\r\n if (offset) {\r\n plane.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(offset[0], offset[1], offset[2]))\r\n }\r\n if (rotation) {\r\n plane.rotation.set(Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]));\r\n }\r\n if (scale) {\r\n plane.scale.set(scale[0], scale[1], scale[2]);\r\n }\r\n\r\n resolve({\r\n mesh: plane,\r\n firstInstance: true\r\n });\r\n })\r\n }\r\n })\r\n};\r\n\r\nfunction setVisibilityOfInstance(meshKey, visibleScale, instanceIndex, visible) {\r\n let instance = instanceCache[meshKey];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n let newScale;\r\n if (visible) {\r\n if (visibleScale) {\r\n newScale = visibleScale;\r\n } else {\r\n newScale = [1, 1, 1];\r\n }\r\n } else {\r\n newScale = [0, 0, 0];\r\n }\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n mesh.setScaleAt(instanceIndex, _v3s.set(newScale[0], newScale[1], newScale[2]));\r\n return mesh;\r\n }\r\n}\r\n\r\nfunction setVisibilityAtMulti(positions, visible) {\r\n let updatedMeshes = {};\r\n for (let pos of positions) {\r\n let info = this.instancePositionMap[pos[0] + \"_\" + pos[1] + \"_\" + pos[2]];\r\n if (info) {\r\n let mesh = setVisibilityOfInstance(info.key, info.scale, info.index, visible);\r\n if (mesh) {\r\n updatedMeshes[info.key] = mesh;\r\n }\r\n }\r\n }\r\n for (let mesh of Object.values(updatedMeshes)) {\r\n mesh.needsUpdate();\r\n }\r\n}\r\n\r\nfunction setVisibilityAt(x, y, z, visible) {\r\n setVisibilityAtMulti([[x, y, z]], visible);\r\n}\r\n\r\nModelRender.prototype.setVisibilityAtMulti = setVisibilityAtMulti;\r\nModelRender.prototype.setVisibilityAt = setVisibilityAt;\r\n\r\nfunction setVisibilityOfType(type, name, variant, visible) {\r\n let instance = instanceCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant})];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n mesh.visible = visible;\r\n }\r\n}\r\n\r\nModelRender.prototype.setVisibilityOfType = setVisibilityOfType;\r\n\r\nlet createDot = function (c) {\r\n let dotGeometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"Geometry\"]();\r\n dotGeometry.vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]());\r\n let dotMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"PointsMaterial\"]({size: 5, sizeAttenuation: false, color: c});\r\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Points\"](dotGeometry, dotMaterial);\r\n};\r\n\r\nlet createPlane = function (name, textures) {\r\n return new Promise((resolve) => {\r\n\r\n let materialLoaded = function (material, width, height) {\r\n let geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"PlaneGeometry\"](width, height);\r\n let plane = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, material);\r\n plane.name = name;\r\n plane.receiveShadow = true;\r\n\r\n resolve(plane);\r\n };\r\n\r\n if (textures) {\r\n let w = 0, h = 0;\r\n let promises = [];\r\n for (let t in textures) {\r\n if (textures.hasOwnProperty(t)) {\r\n promises.push(new Promise((resolve) => {\r\n let img = new Image();\r\n img.onload = function () {\r\n if (img.width > w) w = img.width;\r\n if (img.height > h) h = img.height;\r\n resolve(img);\r\n };\r\n img.src = textures[t];\r\n }))\r\n }\r\n }\r\n Promise.all(promises).then((images) => {\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = w;\r\n canvas.height = h;\r\n let context = canvas.getContext(\"2d\");\r\n\r\n for (let i = 0; i < images.length; i++) {\r\n let img = images[i];\r\n context.drawImage(img, 0, 0);\r\n }\r\n\r\n let data = canvas.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \")\");\r\n materialLoaded(materialCache[hash], w, h);\r\n return;\r\n }\r\n\r\n let textureLoaded = function (texture) {\r\n let material = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: texture,\r\n transparent: true,\r\n side: three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"],\r\n alphaTest: 0.5,\r\n name: name\r\n });\r\n\r\n // Add material to cache\r\n console.debug(\"Caching Material \" + hash);\r\n materialCache[hash] = material;\r\n\r\n materialLoaded(material, w, h);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n console.debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n });\r\n }\r\n\r\n })\r\n};\r\n\r\n\r\n/// From https://github.com/InventivetalentDev/SkinRender/blob/master/js/render/skin.js#L353\r\nlet createCube = function (width, height, depth, name, faces, fallbackFaces, textures, textureNames, assetRoot, baseName) {\r\n return new Promise((resolve) => {\r\n let geometryKey = width + \"_\" + height + \"_\" + depth;\r\n let geometry;\r\n if (geometryCache.hasOwnProperty(geometryKey)) {\r\n console.debug(\"Using cached Geometry (\" + geometryKey + \")\");\r\n geometry = geometryCache[geometryKey];\r\n } else {\r\n geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BoxGeometry\"](width, height, depth);\r\n console.debug(\"Caching Geometry \" + geometryKey);\r\n geometryCache[geometryKey] = geometry;\r\n }\r\n\r\n let materialsLoaded = function (materials) {\r\n let cube = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, materials);\r\n cube.name = name;\r\n cube.receiveShadow = true;\r\n\r\n resolve(cube);\r\n };\r\n if (textures) {\r\n let promises = [];\r\n for (let i = 0; i < 6; i++) {\r\n promises.push(new Promise((resolve) => {\r\n let f = FACE_ORDER[i];\r\n if (!faces.hasOwnProperty(f)) {\r\n // console.warn(\"Missing face: \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n let face = faces[f];\r\n let textureRef = face.texture.substr(1);\r\n if (!textures.hasOwnProperty(textureRef) || !textures[textureRef]) {\r\n console.warn(\"Missing texture '\" + textureRef + \"' for face \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let canvasKey = textureRef + \"_\" + f + \"_\" + baseName;\r\n\r\n let processImgToCanvasData = (img) => {\r\n let uv = face.uv;\r\n if (!uv) {\r\n // console.warn(\"Missing UV mapping for face \" + f + \" in model \" + name + \". Using defaults\");\r\n uv = fallbackFaces[f].uv;\r\n }\r\n\r\n // Scale the uv values to match the image width, so we can support resource packs with higher-resolution textures\r\n uv = [\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[0], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[1], img.height),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[2], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[3], img.height)\r\n ];\r\n\r\n\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = Math.abs(uv[2] - uv[0]);\r\n canvas.height = Math.abs(uv[3] - uv[1]);\r\n\r\n let context = canvas.getContext(\"2d\");\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n let tintColor;\r\n if (face.hasOwnProperty(\"tintindex\")) {\r\n tintColor = TINTS[face.tintindex];\r\n } else if (baseName.startsWith(\"water_\")) {\r\n tintColor = \"blue\";\r\n }\r\n\r\n if (tintColor) {\r\n context.fillStyle = tintColor;\r\n context.globalCompositeOperation = 'multiply';\r\n context.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n context.globalAlpha = 1;\r\n context.globalCompositeOperation = 'destination-in';\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n // context.globalAlpha = 0.5;\r\n // context.beginPath();\r\n // context.fillStyle = \"green\";\r\n // context.rect(0, 0, uv[2] - uv[0], uv[3] - uv[1]);\r\n // context.fill();\r\n // context.globalAlpha = 1.0;\r\n }\r\n\r\n let canvasData = context.getImageData(0, 0, canvas.width, canvas.height).data;\r\n let hasTransparency = false;\r\n for (let i = 3; i < (canvas.width * canvas.height); i += 4) {\r\n if (canvasData[i] < 255) {\r\n hasTransparency = true;\r\n break;\r\n }\r\n }\r\n\r\n let dataUrl = canvas.toDataURL(\"image/png\");\r\n let dataHash = md5__WEBPACK_IMPORTED_MODULE_6__(dataUrl);\r\n\r\n let d = {\r\n canvas: canvas,\r\n data: canvasData,\r\n dataUrl: dataUrl,\r\n dataUrlHash: dataHash,\r\n hasTransparency: hasTransparency,\r\n width: canvas.width,\r\n height: canvas.height\r\n };\r\n console.debug(\"Caching new canvas (\" + canvasKey + \"/\" + dataHash + \")\")\r\n canvasCache[canvasKey] = d;\r\n return d;\r\n };\r\n\r\n let loadTextureFromCanvas = (canvas) => {\r\n\r\n\r\n let loadTextureDefault = function (canvas) {\r\n let data = canvas.dataUrl;\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \", without meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n let n = textureNames[textureRef];\r\n if (n.startsWith(\"#\")) {\r\n n = textureNames[name.substr(1)];\r\n }\r\n console.debug(\"Pre-Caching Material \" + hash + \", without meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5,\r\n name: f + \"_\" + textureRef + \"_\" + n\r\n });\r\n\r\n let textureLoaded = function (texture) {\r\n // Add material to cache\r\n console.debug(\"Finalizing Cached Material \" + hash + \", without meta\");\r\n materialCache[hash].map = texture;\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture from cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n if (face.hasOwnProperty(\"rotation\")) {\r\n texture.center.x = .5;\r\n texture.center.y = .5;\r\n texture.rotation = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(face.rotation);\r\n }\r\n\r\n console.debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n };\r\n\r\n let loadTextureWithMeta = function (canvas, meta) {\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n console.debug(\"Using cached Material (\" + hash + \", with meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Material \" + hash + \", with meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5\r\n });\r\n\r\n let frametime = 1;\r\n if (meta.hasOwnProperty(\"animation\")) {\r\n if (meta.animation.hasOwnProperty(\"frametime\")) {\r\n frametime = meta.animation.frametime;\r\n }\r\n }\r\n\r\n let parts = Math.floor(canvas.height / canvas.width);\r\n\r\n console.log(\"Generating animated texture...\");\r\n\r\n let promises1 = [];\r\n for (let i = 0; i < parts; i++) {\r\n promises1.push(new Promise((resolve) => {\r\n let canvas1 = document.createElement(\"canvas\");\r\n canvas1.width = canvas.width;\r\n canvas1.height = canvas.width;\r\n let context1 = canvas1.getContext(\"2d\");\r\n context1.drawImage(canvas.canvas, 0, i * canvas.width, canvas.width, canvas.width, 0, 0, canvas.width, canvas.width);\r\n\r\n let data = canvas1.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n console.debug(\"Using cached Texture (\" + hash + \")\");\r\n resolve(textureCache[hash]);\r\n return;\r\n }\r\n\r\n console.debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n console.debug(\"Caching Texture \" + hash + \", without meta\");\r\n // add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n resolve(texture);\r\n });\r\n }));\r\n }\r\n\r\n Promise.all(promises1).then((textures) => {\r\n\r\n let frameCounter = 0;\r\n let textureIndex = 0;\r\n animatedTextures.push(() => {// called on render\r\n if (frameCounter >= frametime) {\r\n frameCounter = 0;\r\n\r\n // Set new texture\r\n materialCache[hash].map = textures[textureIndex];\r\n\r\n textureIndex++;\r\n }\r\n if (textureIndex >= textures.length) {\r\n textureIndex = 0;\r\n }\r\n frameCounter += 0.1;// game ticks TODO: figure out the proper value for this\r\n })\r\n\r\n // Add material to cache\r\n console.debug(\"Finalizing Cached Material \" + hash + \", with meta\");\r\n materialCache[hash].map = textures[0];\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n });\r\n };\r\n\r\n if ((canvas.height > canvas.width) && (canvas.height % canvas.width === 0)) {// Taking a guess that this is an animated texture\r\n let name = textureNames[textureRef];\r\n if (name.startsWith(\"#\")) {\r\n name = textureNames[name.substr(1)];\r\n }\r\n if (name.indexOf(\"/\") !== -1) {\r\n name = name.substr(name.indexOf(\"/\") + 1);\r\n }\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"loadTextureMeta\"])(name, assetRoot).then((meta) => {\r\n loadTextureWithMeta(canvas, meta);\r\n }).catch(() => {// Guessed wrong :shrug:\r\n loadTextureDefault(canvas);\r\n })\r\n } else {\r\n loadTextureDefault(canvas);\r\n }\r\n };\r\n\r\n\r\n if (canvasCache.hasOwnProperty(canvasKey)) {\r\n let cachedCanvas = canvasCache[canvasKey];\r\n\r\n if (cachedCanvas.hasOwnProperty(\"img\")) {\r\n console.debug(\"Waiting for canvas image that's already loading (\" + canvasKey + \")\")\r\n let img = cachedCanvas.img;\r\n img.waitingForCanvas.push(function (canvas) {\r\n loadTextureFromCanvas(canvas);\r\n });\r\n } else {\r\n console.debug(\"Using cached canvas (\" + canvasKey + \")\")\r\n loadTextureFromCanvas(canvasCache[canvasKey]);\r\n }\r\n } else {\r\n let img = new Image();\r\n img.onerror = function (err) {\r\n console.warn(err);\r\n resolve(null);\r\n };\r\n img.waitingForCanvas = [];\r\n img.onload = function () {\r\n let canvasData = processImgToCanvasData(img);\r\n loadTextureFromCanvas(canvasData);\r\n\r\n for (let c = 0; c < img.waitingForCanvas.length; c++) {\r\n img.waitingForCanvas[c](canvasData);\r\n }\r\n };\r\n console.debug(\"Pre-caching canvas (\" + canvasKey + \")\");\r\n canvasCache[canvasKey] = {\r\n img: img\r\n };\r\n img.src = textures[textureRef];\r\n }\r\n }));\r\n }\r\n Promise.all(promises).then(materials => materialsLoaded(materials))\r\n } else {\r\n let materials = [];\r\n for (let i = 0; i < 6; i++) {\r\n materials.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n color: colors[i + 2],\r\n wireframe: true\r\n }))\r\n }\r\n materialsLoaded(materials);\r\n }\r\n\r\n // if (textures) {\r\n // applyCubeTextureToGeometry(geometry, texture, uv, width, height, depth);\r\n // }\r\n\r\n\r\n })\r\n};\r\n\r\n/// https://stackoverflow.com/questions/42812861/three-js-pivot-point/42866733#42866733\r\n// obj - your object (THREE.Object3D or derived)\r\n// point - the point of rotation (THREE.Vector3)\r\n// axis - the axis of rotation (normalized THREE.Vector3)\r\n// theta - radian value of rotation\r\nfunction rotateAboutPoint(obj, point, axis, theta) {\r\n obj.position.sub(point); // remove the offset\r\n obj.position.applyAxisAngle(axis, theta); // rotate the POSITION\r\n obj.position.add(point); // re-add the offset\r\n\r\n obj.rotateOnAxis(axis, theta); // rotate the OBJECT\r\n}\r\n\r\nModelRender.cache = {\r\n loadedTextures: loadedTextureCache,\r\n mergedModels: mergedModelCache,\r\n instanceCount: modelInstances,\r\n\r\n texture: textureCache,\r\n canvas: canvasCache,\r\n material: materialCache,\r\n geometry: geometryCache,\r\n instances: instanceCache,\r\n\r\n animated: animatedTextures,\r\n\r\n\r\n resetInstances: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n },\r\n clearAll: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(loadedTextureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(mergedModelCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(textureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(canvasCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(materialCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(geometryCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n animatedTextures.splice(0, animatedTextures.length);\r\n }\r\n};\r\nModelRender.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n\r\nif (typeof window !== \"undefined\") {\r\n window.ModelRender = ModelRender;\r\n window.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n}\r\nif (typeof global !== \"undefined\")\r\n global.ModelRender = ModelRender;\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (ModelRender);\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./src/model/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _renderBase__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../renderBase */ \"./src/renderBase.js\");\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var _modelConverter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modelConverter */ \"./src/model/modelConverter.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! md5 */ \"./node_modules/md5/md5.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _modelFunctions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./modelFunctions */ \"./src/model/modelFunctions.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! webworkify-webpack */ \"./node_modules/webworkify-webpack/index.js\");\n/* harmony import */ var webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(webworkify_webpack__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _skin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../skin */ \"./src/skin/index.js\");\n/* harmony import */ var onscreen_lib_methods_off__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! onscreen/lib/methods/off */ \"./node_modules/onscreen/lib/methods/off.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_11__);\n\r\n\r\n__webpack_require__(/*! three-instanced-mesh */ \"./node_modules/three-instanced-mesh/index.js\")(three__WEBPACK_IMPORTED_MODULE_0__);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_11__(\"minerender\");\r\n\r\nconst ModelWorker = /*require.resolve*/(/*! ./ModelWorker.js */ \"./src/model/ModelWorker.js\");\r\n\r\n\r\nString.prototype.replaceAll = function (search, replacement) {\r\n let target = this;\r\n return target.replace(new RegExp(search, 'g'), replacement);\r\n};\r\n\r\nconst colors = [\r\n 0xFF0000,\r\n 0x00FFFF,\r\n 0x0000FF,\r\n 0x000080,\r\n 0xFF00FF,\r\n 0x800080,\r\n 0x808000,\r\n 0x00FF00,\r\n 0x008000,\r\n 0xFFFF00,\r\n 0x800000,\r\n 0x008080,\r\n];\r\n\r\nconst FACE_ORDER = [\"east\", \"west\", \"up\", \"down\", \"south\", \"north\"];\r\nconst TINTS = [\"lightgreen\"];\r\n\r\nconst mergedModelCache = {};\r\nconst loadedTextureCache = {};\r\nconst modelInstances = {};\r\n\r\nconst textureCache = {};\r\nconst canvasCache = {};\r\nconst materialCache = {};\r\nconst geometryCache = {};\r\nconst instanceCache = {};\r\n\r\nconst animatedTextures = [];\r\n\r\n/**\r\n * @see defaultOptions\r\n * @property {string} type alternative way to specify the model type (block/item)\r\n * @property {boolean} [centerCubes=false] center the cube's rotation point\r\n * @property {string} [assetRoot=DEFAULT_ROOT] root to get asset files from\r\n */\r\nlet defOptions = {\r\n camera: {\r\n type: \"perspective\",\r\n x: 35,\r\n y: 25,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n type: \"block\",\r\n centerCubes: false,\r\n assetRoot: _functions__WEBPACK_IMPORTED_MODULE_4__[\"DEFAULT_ROOT\"],\r\n useWebWorkers: false\r\n};\r\n\r\n/**\r\n * A renderer for Minecraft models, i.e. blocks & items\r\n */\r\nclass ModelRender extends _renderBase__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\r\n\r\n /**\r\n * @param {Object} [options] The options for this renderer, see {@link defaultOptions}\r\n * @param {string} [options.assetRoot=DEFAULT_ROOT] root to get asset files from\r\n *\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, element) {\r\n super(options, defOptions, element);\r\n\r\n this.renderType = \"ModelRender\";\r\n\r\n this.models = [];\r\n this.instancePositionMap = {};\r\n this.attached = false;\r\n }\r\n\r\n /**\r\n * Does the actual rendering\r\n * @param {(string[]|Object[])} models Array of models to render - Either strings in the format / or objects\r\n * @param {string} [models[].type=block] either 'block' or 'item'\r\n * @param {string} models[].model if 'type' is given, just the block/item name otherwise '/'\r\n * @param {number[]} [models[].offset] [x,y,z] array of the offset\r\n * @param {number[]} [models[].rotation] [x,y,z] array of the rotation\r\n * @param {string} [models[].blockstate] name of a blockstate to be used to determine the models (only for blocks)\r\n * @param {string} [models[].variant=normal] if 'blockstate' is given, the block variant to use\r\n * @param {function} [cb] Callback when rendering finished\r\n */\r\n render(models, cb) {\r\n let modelRender = this;\r\n\r\n if (!modelRender.attached && !modelRender._scene) {// Don't init scene if attached, since we already have an available scene\r\n super.initScene(function () {\r\n // Animate textures\r\n for (let i = 0; i < animatedTextures.length; i++) {\r\n animatedTextures[i]();\r\n }\r\n\r\n modelRender.element.dispatchEvent(new CustomEvent(\"modelRender\", {detail: {models: modelRender.models}}));\r\n });\r\n } else {\r\n console.log(\"[ModelRender] is attached - skipping scene init\");\r\n }\r\n\r\n let parsedModelList = [];\r\n\r\n parseModels(modelRender, models, parsedModelList)\r\n .then(() => loadAndMergeModels(modelRender, parsedModelList))\r\n .then(() => loadModelTextures(modelRender, parsedModelList))\r\n .then(() => doModelRender(modelRender, parsedModelList))\r\n .then((renderedModels) => {\r\n console.timeEnd(\"doModelRender\");\r\n debug(renderedModels)\r\n if (typeof cb === \"function\") cb();\r\n })\r\n\r\n }\r\n\r\n}\r\n\r\n\r\nfunction parseModels(modelRender, models, parsedModelList) {\r\n console.time(\"parseModels\");\r\n console.log(\"Parsing Models...\");\r\n let parsePromises = [];\r\n for (let i = 0; i < models.length; i++) {\r\n let model = models[i];\r\n\r\n // parsePromises.push(parseModel(model, model, parsedModelList, modelRender.options.assetRoot))\r\n parsePromises.push(new Promise(resolve => {\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n parsedModelList.push(...event.data.parsedModelList);\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"parseModel\",\r\n model: model,\r\n modelOptions: model,\r\n parsedModelList: parsedModelList,\r\n assetRoot: modelRender.options.assetRoot\r\n })\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"parseModel\"])(model, model, parsedModelList, modelRender.options.assetRoot).then(() => {\r\n resolve();\r\n })\r\n }\r\n }))\r\n\r\n }\r\n\r\n return Promise.all(parsePromises);\r\n}\r\n\r\n\r\nfunction loadAndMergeModels(modelRender, parsedModelList) {\r\n console.timeEnd(\"parseModels\");\r\n console.time(\"loadAndMergeModels\");\r\n\r\n let jsonPromises = [];\r\n\r\n console.log(\"Loading Model JSON data & merging...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i]);\r\n modelInstances[cacheKey] = (modelInstances[cacheKey] || 0) + 1;\r\n uniqueModels[cacheKey] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n jsonPromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n debug(\"loadAndMerge \" + cacheKey);\r\n\r\n\r\n if (mergedModelCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n mergedModelCache[cacheKey] = event.data.mergedModel;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadAndMergeModel\",\r\n model: model,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadAndMergeModel\"])(model, modelRender.options.assetRoot).then((mergedModel) => {\r\n mergedModelCache[cacheKey] = mergedModel;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n return Promise.all(jsonPromises);\r\n}\r\n\r\nfunction loadModelTextures(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadAndMergeModels\");\r\n console.time(\"loadModelTextures\");\r\n\r\n let texturePromises = [];\r\n\r\n console.log(\"Loading Textures...\");\r\n let uniqueModels = {};\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n uniqueModels[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(parsedModelList[i])] = parsedModelList[i];\r\n }\r\n let uniqueModelList = Object.values(uniqueModels);\r\n debug(uniqueModelList.length + \" unique models\");\r\n for (let i = 0; i < uniqueModelList.length; i++) {\r\n texturePromises.push(new Promise(resolve => {\r\n let model = uniqueModelList[i];\r\n let cacheKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model);\r\n debug(\"loadTexture \" + cacheKey);\r\n let mergedModel = mergedModelCache[cacheKey];\r\n\r\n if (loadedTextureCache.hasOwnProperty(cacheKey)) {\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel) {\r\n console.warn(\"Missing merged model\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (!mergedModel.textures) {\r\n console.warn(\"The model doesn't have any textures!\");\r\n console.warn(\"Please make sure you're using the proper file.\");\r\n console.warn(model.name);\r\n resolve();\r\n return;\r\n }\r\n\r\n if (modelRender.options.useWebWorkers) {\r\n let w = webworkify_webpack__WEBPACK_IMPORTED_MODULE_8___default()(ModelWorker);\r\n w.addEventListener('message', event => {\r\n loadedTextureCache[cacheKey] = event.data.textures;\r\n resolve();\r\n });\r\n w.postMessage({\r\n func: \"loadTextures\",\r\n textures: mergedModel.textures,\r\n assetRoot: modelRender.options.assetRoot\r\n });\r\n } else {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"loadTextures\"])(mergedModel.textures, modelRender.options.assetRoot).then((textures) => {\r\n loadedTextureCache[cacheKey] = textures;\r\n resolve();\r\n })\r\n }\r\n }))\r\n }\r\n\r\n\r\n return Promise.all(texturePromises);\r\n}\r\n\r\nfunction doModelRender(modelRender, parsedModelList) {\r\n console.timeEnd(\"loadModelTextures\");\r\n console.time(\"doModelRender\");\r\n\r\n console.log(\"Rendering Models...\");\r\n\r\n let renderPromises = [];\r\n\r\n for (let i = 0; i < parsedModelList.length; i++) {\r\n renderPromises.push(new Promise(resolve => {\r\n let model = parsedModelList[i];\r\n\r\n let mergedModel = mergedModelCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n let textures = loadedTextureCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])(model)];\r\n\r\n let offset = model.offset || [0, 0, 0];\r\n let rotation = model.rotation || [0, 0, 0];\r\n let scale = model.scale || [1, 1, 1];\r\n\r\n if (model.options.hasOwnProperty(\"display\")) {\r\n if (mergedModel.hasOwnProperty(\"display\")) {\r\n if (mergedModel.display.hasOwnProperty(model.options.display)) {\r\n let displayData = mergedModel.display[model.options.display];\r\n\r\n if (displayData.hasOwnProperty(\"translation\")) {\r\n offset = [offset[0] + displayData.translation[0], offset[1] + displayData.translation[1], offset[2] + displayData.translation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"rotation\")) {\r\n rotation = [rotation[0] + displayData.rotation[0], rotation[1] + displayData.rotation[1], rotation[2] + displayData.rotation[2]];\r\n }\r\n if (displayData.hasOwnProperty(\"scale\")) {\r\n scale = [displayData.scale[0], displayData.scale[1], displayData.scale[2]];\r\n }\r\n\r\n }\r\n }\r\n }\r\n\r\n\r\n renderModel(modelRender, mergedModel, textures, mergedModel.textures, model.type, model.name, model.variant, offset, rotation, scale).then((renderedModel) => {\r\n\r\n if (renderedModel.firstInstance) {\r\n let container = new three__WEBPACK_IMPORTED_MODULE_0__[\"Object3D\"]();\r\n container.add(renderedModel.mesh);\r\n\r\n modelRender.models.push(container);\r\n modelRender.addToScene(container);\r\n }\r\n\r\n resolve(renderedModel);\r\n })\r\n }))\r\n }\r\n\r\n return Promise.all(renderPromises);\r\n}\r\n\r\n\r\nlet renderModel = function (modelRender, model, textures, textureNames, type, name, variant, offset, rotation, scale) {\r\n return new Promise((resolve) => {\r\n if (model.hasOwnProperty(\"elements\")) {// block OR item with block parent\r\n let modelKey = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant});\r\n let instanceCount = modelInstances[modelKey];\r\n\r\n let applyModelTransforms = function (mesh, instanceIndex) {\r\n mesh.userData.modelType = type;\r\n mesh.userData.modelName = name;\r\n\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n let instanceInfo = {\r\n key: modelKey,\r\n index: instanceIndex,\r\n offset: offset,\r\n scale: scale,\r\n rotation: rotation\r\n };\r\n\r\n if (rotation) {\r\n mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new three__WEBPACK_IMPORTED_MODULE_0__[\"Euler\"](Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]))));\r\n }\r\n if (offset) {\r\n mesh.setPositionAt(instanceIndex, _v3o.set(offset[0], offset[1], offset[2]));\r\n modelRender.instancePositionMap[offset[0] + \"_\" + offset[1] + \"_\" + offset[2]] = instanceInfo;\r\n }\r\n if (scale) {\r\n mesh.setScaleAt(instanceIndex, _v3s.set(scale[0], scale[1], scale[2]));\r\n }\r\n\r\n mesh.needsUpdate();\r\n\r\n // mesh.position = _v3o;\r\n // Object.defineProperty(mesh.position,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(x, this.y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, y, this.z));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.position,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setPositionAt(instanceIndex, _v3o.set(this.x, this.y, z));\r\n // }\r\n // })\r\n //\r\n // mesh.rotation = new THREE.Euler(toRadians(rotation[0]), toRadians(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), toRadians(rotation[2]));\r\n // Object.defineProperty(mesh.rotation,\"x\",{\r\n // get:function () {\r\n // return this._x||0;\r\n // },\r\n // set:function (x) {\r\n // this._x=x;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(x), toRadians(this.y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"y\",{\r\n // get:function () {\r\n // return this._y||0;\r\n // },\r\n // set:function (y) {\r\n // this._y=y;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(y), toRadians(this.z))));\r\n // }\r\n // });\r\n // Object.defineProperty(mesh.rotation,\"z\",{\r\n // get:function () {\r\n // return this._z||0;\r\n // },\r\n // set:function (z) {\r\n // this._z=z;\r\n // mesh.setQuaternionAt(instanceIndex, _q.setFromEuler(new THREE.Euler(toRadians(this.x), toRadians(this.y), toRadians(z))));\r\n // }\r\n // });\r\n //\r\n // mesh.scale = _v3s;\r\n\r\n resolve({\r\n mesh: mesh,\r\n firstInstance: instanceIndex === 0\r\n });\r\n };\r\n\r\n let finalizeCubeModel = function (geometry, materials) {\r\n geometry.translate(-8, -8, -8);\r\n\r\n\r\n let cachedInstance;\r\n\r\n if (!instanceCache.hasOwnProperty(modelKey)) {\r\n debug(\"Caching new model instance \" + modelKey + \" (with \" + instanceCount + \" instances)\");\r\n let newInstance = new three__WEBPACK_IMPORTED_MODULE_0__[\"InstancedMesh\"](\r\n geometry,\r\n materials,\r\n instanceCount,\r\n false,\r\n false,\r\n false);\r\n cachedInstance = {\r\n instance: newInstance,\r\n index: 0\r\n };\r\n instanceCache[modelKey] = cachedInstance;\r\n let _v3o = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](1, 1, 1);\r\n let _q = new three__WEBPACK_IMPORTED_MODULE_0__[\"Quaternion\"]();\r\n\r\n for (let i = 0; i < instanceCount; i++) {\r\n\r\n newInstance.setQuaternionAt(i, _q);\r\n newInstance.setPositionAt(i, _v3o);\r\n newInstance.setScaleAt(i, _v3s);\r\n\r\n }\r\n } else {\r\n debug(\"Using cached instance (\" + modelKey + \")\");\r\n cachedInstance = instanceCache[modelKey];\r\n\r\n }\r\n\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n };\r\n\r\n if (instanceCache.hasOwnProperty(modelKey)) {\r\n debug(\"Using cached model instance (\" + modelKey + \")\");\r\n let cachedInstance = instanceCache[modelKey];\r\n applyModelTransforms(cachedInstance.instance, cachedInstance.index++);\r\n return;\r\n }\r\n\r\n // Render the elements\r\n let promises = [];\r\n for (let i = 0; i < model.elements.length; i++) {\r\n let element = model.elements[i];\r\n\r\n // // From net.minecraft.client.renderer.block.model.BlockPart.java#47 - https://yeleha.co/2JcqSr4\r\n let fallbackFaces = {\r\n down: {\r\n uv: [element.from[0], 16 - element.to[2], element.to[0], 16 - element.from[2]],\r\n texture: \"#down\"\r\n },\r\n up: {\r\n uv: [element.from[0], element.from[2], element.to[0], element.to[2]],\r\n texture: \"#up\"\r\n },\r\n north: {\r\n uv: [16 - element.to[0], 16 - element.to[1], 16 - element.from[0], 16 - element.from[1]],\r\n texture: \"#north\"\r\n },\r\n south: {\r\n uv: [element.from[0], 16 - element.to[1], element.to[0], 16 - element.from[1]],\r\n texture: \"#south\"\r\n },\r\n west: {\r\n uv: [element.from[2], 16 - element.to[1], element.to[2], 16 - element.from[2]],\r\n texture: \"#west\"\r\n },\r\n east: {\r\n uv: [16 - element.to[2], 16 - element.to[1], 16 - element.from[2], 16 - element.from[1]],\r\n texture: \"#east\"\r\n }\r\n };\r\n\r\n promises.push(new Promise((resolve) => {\r\n let baseName = name.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" + (element.__comment ? element.__comment.replaceAll(\" \", \"_\").replaceAll(\"-\", \"_\").toLowerCase() + \"_\" : \"\");\r\n createCube(element.to[0] - element.from[0], element.to[1] - element.from[1], element.to[2] - element.from[2],\r\n baseName + Date.now(),\r\n element.faces, fallbackFaces, textures, textureNames, modelRender.options.assetRoot, baseName)\r\n .then((cube) => {\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation((element.to[0] - element.from[0]) / 2, (element.to[1] - element.from[1]) / 2, (element.to[2] - element.from[2]) / 2));\r\n cube.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(element.from[0], element.from[1], element.from[2]));\r\n\r\n if (element.rotation) {\r\n rotateAboutPoint(cube,\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.origin[0], element.rotation.origin[1], element.rotation.origin[2]),\r\n new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"](element.rotation.axis === \"x\" ? 1 : 0, element.rotation.axis === \"y\" ? 1 : 0, element.rotation.axis === \"z\" ? 1 : 0),\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(element.rotation.angle));\r\n }\r\n\r\n resolve(cube);\r\n })\r\n }));\r\n\r\n\r\n }\r\n\r\n Promise.all(promises).then((cubes) => {\r\n let mergedCubes = Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"mergeCubeMeshes\"])(cubes, true);\r\n mergedCubes.sourceSize = cubes.length;\r\n finalizeCubeModel(mergedCubes.geometry, mergedCubes.materials, cubes.length);\r\n for (let i = 0; i < cubes.length; i++) {\r\n Object(_renderBase__WEBPACK_IMPORTED_MODULE_3__[\"deepDisposeMesh\"])(cubes[i], true);\r\n }\r\n })\r\n } else {// 2d item\r\n createPlane(name + \"_\" + Date.now(), textures).then((plane) => {\r\n if (offset) {\r\n plane.applyMatrix(new three__WEBPACK_IMPORTED_MODULE_0__[\"Matrix4\"]().makeTranslation(offset[0], offset[1], offset[2]))\r\n }\r\n if (rotation) {\r\n plane.rotation.set(Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[0]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(Math.abs(rotation[0]) > 0 ? rotation[1] : -rotation[1]), Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(rotation[2]));\r\n }\r\n if (scale) {\r\n plane.scale.set(scale[0], scale[1], scale[2]);\r\n }\r\n\r\n resolve({\r\n mesh: plane,\r\n firstInstance: true\r\n });\r\n })\r\n }\r\n })\r\n};\r\n\r\nfunction setVisibilityOfInstance(meshKey, visibleScale, instanceIndex, visible) {\r\n let instance = instanceCache[meshKey];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n let newScale;\r\n if (visible) {\r\n if (visibleScale) {\r\n newScale = visibleScale;\r\n } else {\r\n newScale = [1, 1, 1];\r\n }\r\n } else {\r\n newScale = [0, 0, 0];\r\n }\r\n let _v3s = new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]();\r\n mesh.setScaleAt(instanceIndex, _v3s.set(newScale[0], newScale[1], newScale[2]));\r\n return mesh;\r\n }\r\n}\r\n\r\nfunction setVisibilityAtMulti(positions, visible) {\r\n let updatedMeshes = {};\r\n for (let pos of positions) {\r\n let info = this.instancePositionMap[pos[0] + \"_\" + pos[1] + \"_\" + pos[2]];\r\n if (info) {\r\n let mesh = setVisibilityOfInstance(info.key, info.scale, info.index, visible);\r\n if (mesh) {\r\n updatedMeshes[info.key] = mesh;\r\n }\r\n }\r\n }\r\n for (let mesh of Object.values(updatedMeshes)) {\r\n mesh.needsUpdate();\r\n }\r\n}\r\n\r\nfunction setVisibilityAt(x, y, z, visible) {\r\n setVisibilityAtMulti([[x, y, z]], visible);\r\n}\r\n\r\nModelRender.prototype.setVisibilityAtMulti = setVisibilityAtMulti;\r\nModelRender.prototype.setVisibilityAt = setVisibilityAt;\r\n\r\nfunction setVisibilityOfType(type, name, variant, visible) {\r\n let instance = instanceCache[Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"modelCacheKey\"])({type: type, name: name, variant: variant})];\r\n if (instance && instance.instance) {\r\n let mesh = instance.instance;\r\n mesh.visible = visible;\r\n }\r\n}\r\n\r\nModelRender.prototype.setVisibilityOfType = setVisibilityOfType;\r\n\r\nlet createDot = function (c) {\r\n let dotGeometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"Geometry\"]();\r\n dotGeometry.vertices.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"Vector3\"]());\r\n let dotMaterial = new three__WEBPACK_IMPORTED_MODULE_0__[\"PointsMaterial\"]({size: 5, sizeAttenuation: false, color: c});\r\n return new three__WEBPACK_IMPORTED_MODULE_0__[\"Points\"](dotGeometry, dotMaterial);\r\n};\r\n\r\nlet createPlane = function (name, textures) {\r\n return new Promise((resolve) => {\r\n\r\n let materialLoaded = function (material, width, height) {\r\n let geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"PlaneGeometry\"](width, height);\r\n let plane = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, material);\r\n plane.name = name;\r\n plane.receiveShadow = true;\r\n\r\n resolve(plane);\r\n };\r\n\r\n if (textures) {\r\n let w = 0, h = 0;\r\n let promises = [];\r\n for (let t in textures) {\r\n if (textures.hasOwnProperty(t)) {\r\n promises.push(new Promise((resolve) => {\r\n let img = new Image();\r\n img.onload = function () {\r\n if (img.width > w) w = img.width;\r\n if (img.height > h) h = img.height;\r\n resolve(img);\r\n };\r\n img.src = textures[t];\r\n }))\r\n }\r\n }\r\n Promise.all(promises).then((images) => {\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = w;\r\n canvas.height = h;\r\n let context = canvas.getContext(\"2d\");\r\n\r\n for (let i = 0; i < images.length; i++) {\r\n let img = images[i];\r\n context.drawImage(img, 0, 0);\r\n }\r\n\r\n let data = canvas.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \")\");\r\n materialLoaded(materialCache[hash], w, h);\r\n return;\r\n }\r\n\r\n let textureLoaded = function (texture) {\r\n let material = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: texture,\r\n transparent: true,\r\n side: three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"],\r\n alphaTest: 0.5,\r\n name: name\r\n });\r\n\r\n // Add material to cache\r\n debug(\"Caching Material \" + hash);\r\n materialCache[hash] = material;\r\n\r\n materialLoaded(material, w, h);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n });\r\n }\r\n\r\n })\r\n};\r\n\r\n\r\n/// From https://github.com/InventivetalentDev/SkinRender/blob/master/js/render/skin.js#L353\r\nlet createCube = function (width, height, depth, name, faces, fallbackFaces, textures, textureNames, assetRoot, baseName) {\r\n return new Promise((resolve) => {\r\n let geometryKey = width + \"_\" + height + \"_\" + depth;\r\n let geometry;\r\n if (geometryCache.hasOwnProperty(geometryKey)) {\r\n debug(\"Using cached Geometry (\" + geometryKey + \")\");\r\n geometry = geometryCache[geometryKey];\r\n } else {\r\n geometry = new three__WEBPACK_IMPORTED_MODULE_0__[\"BoxGeometry\"](width, height, depth);\r\n debug(\"Caching Geometry \" + geometryKey);\r\n geometryCache[geometryKey] = geometry;\r\n }\r\n\r\n let materialsLoaded = function (materials) {\r\n let cube = new three__WEBPACK_IMPORTED_MODULE_0__[\"Mesh\"](geometry, materials);\r\n cube.name = name;\r\n cube.receiveShadow = true;\r\n\r\n resolve(cube);\r\n };\r\n if (textures) {\r\n let promises = [];\r\n for (let i = 0; i < 6; i++) {\r\n promises.push(new Promise((resolve) => {\r\n let f = FACE_ORDER[i];\r\n if (!faces.hasOwnProperty(f)) {\r\n // console.warn(\"Missing face: \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n let face = faces[f];\r\n let textureRef = face.texture.substr(1);\r\n if (!textures.hasOwnProperty(textureRef) || !textures[textureRef]) {\r\n console.warn(\"Missing texture '\" + textureRef + \"' for face \" + f + \" in model \" + name);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let canvasKey = textureRef + \"_\" + f + \"_\" + baseName;\r\n\r\n let processImgToCanvasData = (img) => {\r\n let uv = face.uv;\r\n if (!uv) {\r\n // console.warn(\"Missing UV mapping for face \" + f + \" in model \" + name + \". Using defaults\");\r\n uv = fallbackFaces[f].uv;\r\n }\r\n\r\n // Scale the uv values to match the image width, so we can support resource packs with higher-resolution textures\r\n uv = [\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[0], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[1], img.height),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[2], img.width),\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"scaleUv\"])(uv[3], img.height)\r\n ];\r\n\r\n\r\n let canvas = document.createElement(\"canvas\");\r\n canvas.width = Math.abs(uv[2] - uv[0]);\r\n canvas.height = Math.abs(uv[3] - uv[1]);\r\n\r\n let context = canvas.getContext(\"2d\");\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n let tintColor;\r\n if (face.hasOwnProperty(\"tintindex\")) {\r\n tintColor = TINTS[face.tintindex];\r\n } else if (baseName.startsWith(\"water_\")) {\r\n tintColor = \"blue\";\r\n }\r\n\r\n if (tintColor) {\r\n context.fillStyle = tintColor;\r\n context.globalCompositeOperation = 'multiply';\r\n context.fillRect(0, 0, canvas.width, canvas.height);\r\n\r\n context.globalAlpha = 1;\r\n context.globalCompositeOperation = 'destination-in';\r\n context.drawImage(img, Math.min(uv[0], uv[2]), Math.min(uv[1], uv[3]), canvas.width, canvas.height, 0, 0, canvas.width, canvas.height);\r\n\r\n // context.globalAlpha = 0.5;\r\n // context.beginPath();\r\n // context.fillStyle = \"green\";\r\n // context.rect(0, 0, uv[2] - uv[0], uv[3] - uv[1]);\r\n // context.fill();\r\n // context.globalAlpha = 1.0;\r\n }\r\n\r\n let canvasData = context.getImageData(0, 0, canvas.width, canvas.height).data;\r\n let hasTransparency = false;\r\n for (let i = 3; i < (canvas.width * canvas.height); i += 4) {\r\n if (canvasData[i] < 255) {\r\n hasTransparency = true;\r\n break;\r\n }\r\n }\r\n\r\n let dataUrl = canvas.toDataURL(\"image/png\");\r\n let dataHash = md5__WEBPACK_IMPORTED_MODULE_6__(dataUrl);\r\n\r\n let d = {\r\n canvas: canvas,\r\n data: canvasData,\r\n dataUrl: dataUrl,\r\n dataUrlHash: dataHash,\r\n hasTransparency: hasTransparency,\r\n width: canvas.width,\r\n height: canvas.height\r\n };\r\n debug(\"Caching new canvas (\" + canvasKey + \"/\" + dataHash + \")\")\r\n canvasCache[canvasKey] = d;\r\n return d;\r\n };\r\n\r\n let loadTextureFromCanvas = (canvas) => {\r\n\r\n\r\n let loadTextureDefault = function (canvas) {\r\n let data = canvas.dataUrl;\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \", without meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n let n = textureNames[textureRef];\r\n if (n.startsWith(\"#\")) {\r\n n = textureNames[name.substr(1)];\r\n }\r\n debug(\"Pre-Caching Material \" + hash + \", without meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5,\r\n name: f + \"_\" + textureRef + \"_\" + n\r\n });\r\n\r\n let textureLoaded = function (texture) {\r\n // Add material to cache\r\n debug(\"Finalizing Cached Material \" + hash + \", without meta\");\r\n materialCache[hash].map = texture;\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n };\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture from cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n textureLoaded(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n if (face.hasOwnProperty(\"rotation\")) {\r\n texture.center.x = .5;\r\n texture.center.y = .5;\r\n texture.rotation = Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"toRadians\"])(face.rotation);\r\n }\r\n\r\n debug(\"Caching Texture \" + hash);\r\n // Add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n textureLoaded(texture);\r\n });\r\n };\r\n\r\n let loadTextureWithMeta = function (canvas, meta) {\r\n let hash = canvas.dataUrlHash;\r\n let hasTransparency = canvas.hasTransparency;\r\n\r\n if (materialCache.hasOwnProperty(hash)) {// Use material from cache\r\n debug(\"Using cached Material (\" + hash + \", with meta)\");\r\n resolve(materialCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Material \" + hash + \", with meta\");\r\n materialCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n map: null,\r\n transparent: hasTransparency,\r\n side: hasTransparency ? three__WEBPACK_IMPORTED_MODULE_0__[\"DoubleSide\"] : three__WEBPACK_IMPORTED_MODULE_0__[\"FrontSide\"],\r\n alphaTest: 0.5\r\n });\r\n\r\n let frametime = 1;\r\n if (meta.hasOwnProperty(\"animation\")) {\r\n if (meta.animation.hasOwnProperty(\"frametime\")) {\r\n frametime = meta.animation.frametime;\r\n }\r\n }\r\n\r\n let parts = Math.floor(canvas.height / canvas.width);\r\n\r\n console.log(\"Generating animated texture...\");\r\n\r\n let promises1 = [];\r\n for (let i = 0; i < parts; i++) {\r\n promises1.push(new Promise((resolve) => {\r\n let canvas1 = document.createElement(\"canvas\");\r\n canvas1.width = canvas.width;\r\n canvas1.height = canvas.width;\r\n let context1 = canvas1.getContext(\"2d\");\r\n context1.drawImage(canvas.canvas, 0, i * canvas.width, canvas.width, canvas.width, 0, 0, canvas.width, canvas.width);\r\n\r\n let data = canvas1.toDataURL(\"image/png\");\r\n let hash = md5__WEBPACK_IMPORTED_MODULE_6__(data);\r\n\r\n if (textureCache.hasOwnProperty(hash)) {// Use texture to cache\r\n debug(\"Using cached Texture (\" + hash + \")\");\r\n resolve(textureCache[hash]);\r\n return;\r\n }\r\n\r\n debug(\"Pre-Caching Texture \" + hash);\r\n textureCache[hash] = new three__WEBPACK_IMPORTED_MODULE_0__[\"TextureLoader\"]().load(data, function (texture) {\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__[\"NearestFilter\"];\r\n texture.anisotropy = 0;\r\n texture.needsUpdate = true;\r\n\r\n debug(\"Caching Texture \" + hash + \", without meta\");\r\n // add texture to cache\r\n textureCache[hash] = texture;\r\n\r\n resolve(texture);\r\n });\r\n }));\r\n }\r\n\r\n Promise.all(promises1).then((textures) => {\r\n\r\n let frameCounter = 0;\r\n let textureIndex = 0;\r\n animatedTextures.push(() => {// called on render\r\n if (frameCounter >= frametime) {\r\n frameCounter = 0;\r\n\r\n // Set new texture\r\n materialCache[hash].map = textures[textureIndex];\r\n\r\n textureIndex++;\r\n }\r\n if (textureIndex >= textures.length) {\r\n textureIndex = 0;\r\n }\r\n frameCounter += 0.1;// game ticks TODO: figure out the proper value for this\r\n })\r\n\r\n // Add material to cache\r\n debug(\"Finalizing Cached Material \" + hash + \", with meta\");\r\n materialCache[hash].map = textures[0];\r\n materialCache[hash].needsUpdate = true;\r\n\r\n resolve(materialCache[hash]);\r\n });\r\n };\r\n\r\n if ((canvas.height > canvas.width) && (canvas.height % canvas.width === 0)) {// Taking a guess that this is an animated texture\r\n let name = textureNames[textureRef];\r\n if (name.startsWith(\"#\")) {\r\n name = textureNames[name.substr(1)];\r\n }\r\n if (name.indexOf(\"/\") !== -1) {\r\n name = name.substr(name.indexOf(\"/\") + 1);\r\n }\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_4__[\"loadTextureMeta\"])(name, assetRoot).then((meta) => {\r\n loadTextureWithMeta(canvas, meta);\r\n }).catch(() => {// Guessed wrong :shrug:\r\n loadTextureDefault(canvas);\r\n })\r\n } else {\r\n loadTextureDefault(canvas);\r\n }\r\n };\r\n\r\n\r\n if (canvasCache.hasOwnProperty(canvasKey)) {\r\n let cachedCanvas = canvasCache[canvasKey];\r\n\r\n if (cachedCanvas.hasOwnProperty(\"img\")) {\r\n debug(\"Waiting for canvas image that's already loading (\" + canvasKey + \")\")\r\n let img = cachedCanvas.img;\r\n img.waitingForCanvas.push(function (canvas) {\r\n loadTextureFromCanvas(canvas);\r\n });\r\n } else {\r\n debug(\"Using cached canvas (\" + canvasKey + \")\")\r\n loadTextureFromCanvas(canvasCache[canvasKey]);\r\n }\r\n } else {\r\n let img = new Image();\r\n img.onerror = function (err) {\r\n console.warn(err);\r\n resolve(null);\r\n };\r\n img.waitingForCanvas = [];\r\n img.onload = function () {\r\n let canvasData = processImgToCanvasData(img);\r\n loadTextureFromCanvas(canvasData);\r\n\r\n for (let c = 0; c < img.waitingForCanvas.length; c++) {\r\n img.waitingForCanvas[c](canvasData);\r\n }\r\n };\r\n debug(\"Pre-caching canvas (\" + canvasKey + \")\");\r\n canvasCache[canvasKey] = {\r\n img: img\r\n };\r\n img.src = textures[textureRef];\r\n }\r\n }));\r\n }\r\n Promise.all(promises).then(materials => materialsLoaded(materials))\r\n } else {\r\n let materials = [];\r\n for (let i = 0; i < 6; i++) {\r\n materials.push(new three__WEBPACK_IMPORTED_MODULE_0__[\"MeshBasicMaterial\"]({\r\n color: colors[i + 2],\r\n wireframe: true\r\n }))\r\n }\r\n materialsLoaded(materials);\r\n }\r\n\r\n // if (textures) {\r\n // applyCubeTextureToGeometry(geometry, texture, uv, width, height, depth);\r\n // }\r\n\r\n\r\n })\r\n};\r\n\r\n/// https://stackoverflow.com/questions/42812861/three-js-pivot-point/42866733#42866733\r\n// obj - your object (THREE.Object3D or derived)\r\n// point - the point of rotation (THREE.Vector3)\r\n// axis - the axis of rotation (normalized THREE.Vector3)\r\n// theta - radian value of rotation\r\nfunction rotateAboutPoint(obj, point, axis, theta) {\r\n obj.position.sub(point); // remove the offset\r\n obj.position.applyAxisAngle(axis, theta); // rotate the POSITION\r\n obj.position.add(point); // re-add the offset\r\n\r\n obj.rotateOnAxis(axis, theta); // rotate the OBJECT\r\n}\r\n\r\nModelRender.cache = {\r\n loadedTextures: loadedTextureCache,\r\n mergedModels: mergedModelCache,\r\n instanceCount: modelInstances,\r\n\r\n texture: textureCache,\r\n canvas: canvasCache,\r\n material: materialCache,\r\n geometry: geometryCache,\r\n instances: instanceCache,\r\n\r\n animated: animatedTextures,\r\n\r\n\r\n resetInstances: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n },\r\n clearAll: function () {\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(loadedTextureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(mergedModelCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(modelInstances);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(textureCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(canvasCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(materialCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(geometryCache);\r\n Object(_modelFunctions__WEBPACK_IMPORTED_MODULE_7__[\"deleteObjectProperties\"])(instanceCache);\r\n animatedTextures.splice(0, animatedTextures.length);\r\n }\r\n};\r\nModelRender.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n\r\nif (typeof window !== \"undefined\") {\r\n window.ModelRender = ModelRender;\r\n window.ModelConverter = _modelConverter__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\r\n}\r\nif (typeof global !== \"undefined\")\r\n global.ModelRender = ModelRender;\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = (ModelRender);\r\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node_modules/webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./src/model/index.js?"); /***/ }), @@ -2097,7 +2130,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var pako /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModel\", function() { return parseModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadAndMergeModel\", function() { return loadAndMergeModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modelCacheKey\", function() { return modelCacheKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findMatchingVariant\", function() { return findMatchingVariant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"variantStringToObject\", function() { return variantStringToObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModelType\", function() { return parseModelType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadModel\", function() { return loadModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextures\", function() { return loadTextures; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeParents\", function() { return mergeParents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadians\", function() { return toRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deleteObjectProperties\", function() { return deleteObjectProperties; });\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_1__);\n\r\n\r\n\r\nfunction parseModel(model, modelOptions, parsedModelList, assetRoot) {\r\n return new Promise(resolve => {\r\n let type = \"block\";\r\n let offset;\r\n let rotation;\r\n let scale;\r\n\r\n if (typeof model === \"string\") {\r\n let parsed = parseModelType(model);\r\n model = parsed.model;\r\n type = parsed.type;\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (typeof model === \"object\") {\r\n if (model.hasOwnProperty(\"offset\")) {\r\n offset = model[\"offset\"];\r\n }\r\n if (model.hasOwnProperty(\"rotation\")) {\r\n rotation = model[\"rotation\"];\r\n }\r\n if (model.hasOwnProperty(\"scale\")) {\r\n scale = model[\"scale\"];\r\n }\r\n\r\n if (model.hasOwnProperty(\"model\")) {\r\n if (model.hasOwnProperty(\"type\")) {\r\n type = model[\"type\"];\r\n model = model[\"model\"];\r\n } else {\r\n let parsed = parseModelType(model[\"model\"]);\r\n model = parsed.model;\r\n type = parsed.type;\r\n }\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (model.hasOwnProperty(\"blockstate\")) {\r\n type = \"block\";\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadBlockState\"])(model.blockstate, assetRoot).then((blockstate) => {\r\n if (blockstate.hasOwnProperty(\"variants\")) {\r\n\r\n if (model.hasOwnProperty(\"variant\")) {\r\n let variantKey = findMatchingVariant(blockstate.variants, model.variant);\r\n if (variantKey === null) {\r\n console.warn(\"Missing variant key for \" + model.blockstate + \": \" + model.variant);\r\n console.warn(blockstate.variants);\r\n resolve(null);\r\n return;\r\n }\r\n let variant = blockstate.variants[variantKey];\r\n if (!variant) {\r\n console.warn(\"Missing variant for \" + model.blockstate + \": \" + model.variant);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else {\r\n let variant;\r\n if (blockstate.variants.hasOwnProperty(\"normal\")) {\r\n variant = blockstate.variants.normal;\r\n } else if (blockstate.variants.hasOwnProperty(\"\")) {\r\n variant = blockstate.variants[\"\"];\r\n } else {\r\n variant = blockstate.variants[Object.keys(blockstate.variants)[0]]\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n resolve(parsedModelList);\r\n }\r\n } else if (blockstate.hasOwnProperty(\"multipart\")) {\r\n for (let j = 0; j < blockstate.multipart.length; j++) {\r\n let cond = blockstate.multipart[j];\r\n let apply = cond.apply;\r\n let when = cond.when;\r\n\r\n rotation = [0, 0, 0];\r\n\r\n if (!when) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n } else if (model.hasOwnProperty(\"multipart\")) {\r\n let multipartConditions = model.multipart;\r\n\r\n let applies = false;\r\n if (when.hasOwnProperty(\"OR\")) {\r\n for (let k = 0; k < when.OR.length; k++) {\r\n if (applies) break;\r\n for (let c in when.OR[k]) {\r\n if (applies) break;\r\n if (when.OR[k].hasOwnProperty(c)) {\r\n let expected = when.OR[k][c];\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n for (let c in when) {// this SHOULD be a single case, but iterating makes it a bit easier\r\n if (applies) break;\r\n if (when.hasOwnProperty(c)) {\r\n let expected = String(when[c]);\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (applies) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n }\r\n }\r\n }\r\n\r\n resolve(parsedModelList);\r\n }\r\n }).catch(()=>{\r\n resolve(parsedModelList);\r\n })\r\n }\r\n\r\n }\r\n })\r\n}\r\n\r\nfunction loadAndMergeModel(model, assetRoot) {\r\n return loadModel(model.name, model.type, assetRoot)\r\n .then(modelData => mergeParents(modelData, model.name, assetRoot))\r\n .then(merged => {\r\n console.debug(model.name + \" merged:\");\r\n console.debug(merged);\r\n if (!merged.hasOwnProperty(\"elements\")) {\r\n if (model.name === \"lava\" || model.name === \"water\") {\r\n merged.elements = [\r\n {\r\n \"from\": [0, 0, 0],\r\n \"to\": [16, 16, 16],\r\n \"faces\": {\r\n \"down\": {\"texture\": \"#particle\", \"cullface\": \"down\"},\r\n \"up\": {\"texture\": \"#particle\", \"cullface\": \"up\"},\r\n \"north\": {\"texture\": \"#particle\", \"cullface\": \"north\"},\r\n \"south\": {\"texture\": \"#particle\", \"cullface\": \"south\"},\r\n \"west\": {\"texture\": \"#particle\", \"cullface\": \"west\"},\r\n \"east\": {\"texture\": \"#particle\", \"cullface\": \"east\"}\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n return merged;\r\n })\r\n}\r\n\r\n\r\n\r\n// Utils\r\n\r\nfunction modelCacheKey(model) {\r\n return model.type + \"__\" + model.name /*+ \"[\" + (model.variant || \"default\") + \"]\"*/;\r\n}\r\n\r\nfunction findMatchingVariant(variants, selector) {\r\n if (!Array.isArray(variants)) variants = Object.keys(variants);\r\n\r\n if (!selector || selector === \"\" || selector.length === 0) return \"\";\r\n let selectorObj = variantStringToObject(selector);\r\n for (let i = 0; i < variants.length; i++) {\r\n let variantObj = variantStringToObject(variants[i]);\r\n\r\n let matches = true;\r\n for (let k in selectorObj) {\r\n if (selectorObj.hasOwnProperty(k)) {\r\n if (variantObj.hasOwnProperty(k)) {\r\n if (selectorObj[k] !== variantObj[k]) {\r\n matches = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (matches) return variants[i];\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction variantStringToObject(str) {\r\n let split = str.split(\",\");\r\n let obj = {};\r\n for (let i = 0; i < split.length; i++) {\r\n let spl = split[i];\r\n let split1 = spl.split(\"=\");\r\n obj[split1[0]] = split1[1];\r\n }\r\n return obj;\r\n}\r\n\r\nfunction parseModelType(string) {\r\n if (string.startsWith(\"block/\")) {\r\n // if (type === \"item\") {\r\n // throw new Error(\"Tried to mix block/item models\");\r\n // }\r\n return {\r\n type: \"block\",\r\n model: string.substr(\"block/\".length)\r\n }\r\n } else if (string.startsWith(\"item/\")) {\r\n // if (type === \"block\") {\r\n // throw new Error(\"Tried to mix item/block models\");\r\n // }\r\n return {\r\n type: \"item\",\r\n model: string.substr(\"item/\".length)\r\n }\r\n }\r\n return {\r\n type: \"block\",\r\n model: \"string\"\r\n }\r\n}\r\n\r\nfunction loadModel(model, type/* block OR item */, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n if (typeof model === \"string\") {\r\n if (model.startsWith(\"{\") && model.endsWith(\"}\")) {// JSON string\r\n resolve(JSON.parse(model));\r\n } else if (model.startsWith(\"http\")) {// URL\r\n fetch(model, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"model data:\", data);\r\n resolve(data);\r\n })\r\n } else {// model name -> use local data\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + (type || \"block\") + \"/\" + model + \".json\").then((data) => {\r\n resolve(data);\r\n })\r\n }\r\n } else if (typeof model === \"object\") {// JSON object\r\n resolve(model);\r\n } else {\r\n console.warn(\"Invalid model\");\r\n reject();\r\n }\r\n });\r\n};\r\n\r\nfunction loadTextures(textureNames, assetRoot) {\r\n return new Promise((resolve) => {\r\n let promises = [];\r\n let filteredNames = [];\r\n\r\n let names = Object.keys(textureNames);\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n let texture = textureNames[name];\r\n if (texture.startsWith(\"#\")) {// reference to another texture, no need to load\r\n continue;\r\n }\r\n filteredNames.push(name);\r\n promises.push(Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextureAsBase64\"])(assetRoot, \"minecraft\", \"/\", texture));\r\n }\r\n Promise.all(promises).then((textures) => {\r\n let mappedTextures = {};\r\n for (let i = 0; i < textures.length; i++) {\r\n mappedTextures[filteredNames[i]] = textures[i];\r\n }\r\n\r\n // Fill in the referenced textures\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n if (!mappedTextures.hasOwnProperty(name) && textureNames.hasOwnProperty(name)) {\r\n let ref = textureNames[name].substr(1);\r\n mappedTextures[name] = mappedTextures[ref];\r\n }\r\n }\r\n\r\n resolve(mappedTextures);\r\n });\r\n })\r\n};\r\n\r\n\r\nfunction mergeParents(model, modelName, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n mergeParents_(model, modelName, [], [], assetRoot, resolve, reject);\r\n });\r\n};\r\nlet mergeParents_ = function (model, name, stack, hierarchy, assetRoot, resolve, reject) {\r\n stack.push(model);\r\n\r\n if (!model.hasOwnProperty(\"parent\") || model[\"parent\"] === \"builtin/generated\" || model[\"parent\"] === \"builtin/entity\") {// already at the highest parent OR we reach the builtin parent which seems to be the hardcoded stuff that's not in the json files\r\n let merged = {};\r\n for (let i = stack.length - 1; i >= 0; i--) {\r\n merged = deepmerge__WEBPACK_IMPORTED_MODULE_1___default()(merged, stack[i]);\r\n }\r\n\r\n hierarchy.unshift(name);\r\n merged.hierarchy = hierarchy;\r\n resolve(merged);\r\n return;\r\n }\r\n\r\n let parent = model[\"parent\"];\r\n delete model[\"parent\"];// remove the child's parent so it will be replaced by the parent's parent\r\n hierarchy.push(parent);\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + parent + \".json\").then((parentData) => {\r\n let mergedModel = Object.assign({}, model, parentData);\r\n mergeParents_(mergedModel, name, stack, hierarchy, assetRoot, resolve, reject);\r\n }).catch(reject);\r\n\r\n};\r\n\r\nfunction toRadians(angle) {\r\n return angle * (Math.PI / 180);\r\n}\r\n\r\nfunction deleteObjectProperties(obj) {\r\n Object.keys(obj).forEach(function (key) {\r\n delete obj[key];\r\n });\r\n}\r\n\n\n//# sourceURL=webpack:///./src/model/modelFunctions.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModel\", function() { return parseModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadAndMergeModel\", function() { return loadAndMergeModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modelCacheKey\", function() { return modelCacheKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findMatchingVariant\", function() { return findMatchingVariant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"variantStringToObject\", function() { return variantStringToObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseModelType\", function() { return parseModelType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadModel\", function() { return loadModel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextures\", function() { return loadTextures; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeParents\", function() { return mergeParents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadians\", function() { return toRadians; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deleteObjectProperties\", function() { return deleteObjectProperties; });\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../functions */ \"./src/functions.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_2__);\n\r\n\r\n\r\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_2__(\"minerender\");\r\n\r\nfunction parseModel(model, modelOptions, parsedModelList, assetRoot) {\r\n return new Promise(resolve => {\r\n let type = \"block\";\r\n let offset;\r\n let rotation;\r\n let scale;\r\n\r\n if (typeof model === \"string\") {\r\n let parsed = parseModelType(model);\r\n model = parsed.model;\r\n type = parsed.type;\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (typeof model === \"object\") {\r\n if (model.hasOwnProperty(\"offset\")) {\r\n offset = model[\"offset\"];\r\n }\r\n if (model.hasOwnProperty(\"rotation\")) {\r\n rotation = model[\"rotation\"];\r\n }\r\n if (model.hasOwnProperty(\"scale\")) {\r\n scale = model[\"scale\"];\r\n }\r\n\r\n if (model.hasOwnProperty(\"model\")) {\r\n if (model.hasOwnProperty(\"type\")) {\r\n type = model[\"type\"];\r\n model = model[\"model\"];\r\n } else {\r\n let parsed = parseModelType(model[\"model\"]);\r\n model = parsed.model;\r\n type = parsed.type;\r\n }\r\n\r\n parsedModelList.push({\r\n name: model,\r\n type: type,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else if (model.hasOwnProperty(\"blockstate\")) {\r\n type = \"block\";\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadBlockState\"])(model.blockstate, assetRoot).then((blockstate) => {\r\n if (blockstate.hasOwnProperty(\"variants\")) {\r\n\r\n if (model.hasOwnProperty(\"variant\")) {\r\n let variantKey = findMatchingVariant(blockstate.variants, model.variant);\r\n if (variantKey === null) {\r\n console.warn(\"Missing variant key for \" + model.blockstate + \": \" + model.variant);\r\n console.warn(blockstate.variants);\r\n resolve(null);\r\n return;\r\n }\r\n let variant = blockstate.variants[variantKey];\r\n if (!variant) {\r\n console.warn(\"Missing variant for \" + model.blockstate + \": \" + model.variant);\r\n resolve(null);\r\n return;\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n resolve(parsedModelList);\r\n } else {\r\n let variant;\r\n if (blockstate.variants.hasOwnProperty(\"normal\")) {\r\n variant = blockstate.variants.normal;\r\n } else if (blockstate.variants.hasOwnProperty(\"\")) {\r\n variant = blockstate.variants[\"\"];\r\n } else {\r\n variant = blockstate.variants[Object.keys(blockstate.variants)[0]]\r\n }\r\n\r\n let variants = [];\r\n if (!Array.isArray(variant)) {\r\n variants = [variant];\r\n } else {\r\n variants = variant;\r\n }\r\n\r\n rotation = [0, 0, 0];\r\n\r\n let v = variants[Math.floor(Math.random() * variants.length)];\r\n if (variant.hasOwnProperty(\"x\")) {\r\n rotation[0] = v.x;\r\n }\r\n if (variant.hasOwnProperty(\"y\")) {\r\n rotation[1] = v.y;\r\n }\r\n if (variant.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = v.z;\r\n }\r\n let parsed = parseModelType(v.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n variant: model.variant,\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n resolve(parsedModelList);\r\n }\r\n } else if (blockstate.hasOwnProperty(\"multipart\")) {\r\n for (let j = 0; j < blockstate.multipart.length; j++) {\r\n let cond = blockstate.multipart[j];\r\n let apply = cond.apply;\r\n let when = cond.when;\r\n\r\n rotation = [0, 0, 0];\r\n\r\n if (!when) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n });\r\n } else if (model.hasOwnProperty(\"multipart\")) {\r\n let multipartConditions = model.multipart;\r\n\r\n let applies = false;\r\n if (when.hasOwnProperty(\"OR\")) {\r\n for (let k = 0; k < when.OR.length; k++) {\r\n if (applies) break;\r\n for (let c in when.OR[k]) {\r\n if (applies) break;\r\n if (when.OR[k].hasOwnProperty(c)) {\r\n let expected = when.OR[k][c];\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n for (let c in when) {// this SHOULD be a single case, but iterating makes it a bit easier\r\n if (applies) break;\r\n if (when.hasOwnProperty(c)) {\r\n let expected = String(when[c]);\r\n let expectedArray = expected.split(\"|\");\r\n\r\n let given = multipartConditions[c];\r\n for (let k = 0; k < expectedArray.length; k++) {\r\n if (expectedArray[k] === given) {\r\n applies = true;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (applies) {\r\n if (apply.hasOwnProperty(\"x\")) {\r\n rotation[0] = apply.x;\r\n }\r\n if (apply.hasOwnProperty(\"y\")) {\r\n rotation[1] = apply.y;\r\n }\r\n if (apply.hasOwnProperty(\"z\")) {// Not actually used by MC, but why not?\r\n rotation[2] = apply.z;\r\n }\r\n let parsed = parseModelType(apply.model);\r\n parsedModelList.push({\r\n name: parsed.model,\r\n type: \"block\",\r\n offset: offset,\r\n rotation: rotation,\r\n scale: scale,\r\n options: modelOptions\r\n })\r\n }\r\n }\r\n }\r\n\r\n resolve(parsedModelList);\r\n }\r\n }).catch(()=>{\r\n resolve(parsedModelList);\r\n })\r\n }\r\n\r\n }\r\n })\r\n}\r\n\r\nfunction loadAndMergeModel(model, assetRoot) {\r\n return loadModel(model.name, model.type, assetRoot)\r\n .then(modelData => mergeParents(modelData, model.name, assetRoot))\r\n .then(merged => {\r\n debug(model.name + \" merged:\");\r\n debug(merged);\r\n if (!merged.hasOwnProperty(\"elements\")) {\r\n if (model.name === \"lava\" || model.name === \"water\") {\r\n merged.elements = [\r\n {\r\n \"from\": [0, 0, 0],\r\n \"to\": [16, 16, 16],\r\n \"faces\": {\r\n \"down\": {\"texture\": \"#particle\", \"cullface\": \"down\"},\r\n \"up\": {\"texture\": \"#particle\", \"cullface\": \"up\"},\r\n \"north\": {\"texture\": \"#particle\", \"cullface\": \"north\"},\r\n \"south\": {\"texture\": \"#particle\", \"cullface\": \"south\"},\r\n \"west\": {\"texture\": \"#particle\", \"cullface\": \"west\"},\r\n \"east\": {\"texture\": \"#particle\", \"cullface\": \"east\"}\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n return merged;\r\n })\r\n}\r\n\r\n\r\n\r\n// Utils\r\n\r\nfunction modelCacheKey(model) {\r\n return model.type + \"__\" + model.name /*+ \"[\" + (model.variant || \"default\") + \"]\"*/;\r\n}\r\n\r\nfunction findMatchingVariant(variants, selector) {\r\n if (!Array.isArray(variants)) variants = Object.keys(variants);\r\n\r\n if (!selector || selector === \"\" || selector.length === 0) return \"\";\r\n let selectorObj = variantStringToObject(selector);\r\n for (let i = 0; i < variants.length; i++) {\r\n let variantObj = variantStringToObject(variants[i]);\r\n\r\n let matches = true;\r\n for (let k in selectorObj) {\r\n if (selectorObj.hasOwnProperty(k)) {\r\n if (variantObj.hasOwnProperty(k)) {\r\n if (selectorObj[k] !== variantObj[k]) {\r\n matches = false;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (matches) return variants[i];\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction variantStringToObject(str) {\r\n let split = str.split(\",\");\r\n let obj = {};\r\n for (let i = 0; i < split.length; i++) {\r\n let spl = split[i];\r\n let split1 = spl.split(\"=\");\r\n obj[split1[0]] = split1[1];\r\n }\r\n return obj;\r\n}\r\n\r\nfunction parseModelType(string) {\r\n if (string.startsWith(\"block/\")) {\r\n // if (type === \"item\") {\r\n // throw new Error(\"Tried to mix block/item models\");\r\n // }\r\n return {\r\n type: \"block\",\r\n model: string.substr(\"block/\".length)\r\n }\r\n } else if (string.startsWith(\"item/\")) {\r\n // if (type === \"block\") {\r\n // throw new Error(\"Tried to mix item/block models\");\r\n // }\r\n return {\r\n type: \"item\",\r\n model: string.substr(\"item/\".length)\r\n }\r\n }\r\n return {\r\n type: \"block\",\r\n model: \"string\"\r\n }\r\n}\r\n\r\nfunction loadModel(model, type/* block OR item */, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n if (typeof model === \"string\") {\r\n if (model.startsWith(\"{\") && model.endsWith(\"}\")) {// JSON string\r\n resolve(JSON.parse(model));\r\n } else if (model.startsWith(\"http\")) {// URL\r\n fetch(model, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"model data:\", data);\r\n resolve(data);\r\n })\r\n } else {// model name -> use local data\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + (type || \"block\") + \"/\" + model + \".json\").then((data) => {\r\n resolve(data);\r\n })\r\n }\r\n } else if (typeof model === \"object\") {// JSON object\r\n resolve(model);\r\n } else {\r\n console.warn(\"Invalid model\");\r\n reject();\r\n }\r\n });\r\n};\r\n\r\nfunction loadTextures(textureNames, assetRoot) {\r\n return new Promise((resolve) => {\r\n let promises = [];\r\n let filteredNames = [];\r\n\r\n let names = Object.keys(textureNames);\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n let texture = textureNames[name];\r\n if (texture.startsWith(\"#\")) {// reference to another texture, no need to load\r\n continue;\r\n }\r\n filteredNames.push(name);\r\n promises.push(Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadTextureAsBase64\"])(assetRoot, \"minecraft\", \"/\", texture));\r\n }\r\n Promise.all(promises).then((textures) => {\r\n let mappedTextures = {};\r\n for (let i = 0; i < textures.length; i++) {\r\n mappedTextures[filteredNames[i]] = textures[i];\r\n }\r\n\r\n // Fill in the referenced textures\r\n for (let i = 0; i < names.length; i++) {\r\n let name = names[i];\r\n if (!mappedTextures.hasOwnProperty(name) && textureNames.hasOwnProperty(name)) {\r\n let ref = textureNames[name].substr(1);\r\n mappedTextures[name] = mappedTextures[ref];\r\n }\r\n }\r\n\r\n resolve(mappedTextures);\r\n });\r\n })\r\n};\r\n\r\n\r\nfunction mergeParents(model, modelName, assetRoot) {\r\n return new Promise((resolve, reject) => {\r\n mergeParents_(model, modelName, [], [], assetRoot, resolve, reject);\r\n });\r\n};\r\nlet mergeParents_ = function (model, name, stack, hierarchy, assetRoot, resolve, reject) {\r\n stack.push(model);\r\n\r\n if (!model.hasOwnProperty(\"parent\") || model[\"parent\"] === \"builtin/generated\" || model[\"parent\"] === \"builtin/entity\") {// already at the highest parent OR we reach the builtin parent which seems to be the hardcoded stuff that's not in the json files\r\n let merged = {};\r\n for (let i = stack.length - 1; i >= 0; i--) {\r\n merged = deepmerge__WEBPACK_IMPORTED_MODULE_1___default()(merged, stack[i]);\r\n }\r\n\r\n hierarchy.unshift(name);\r\n merged.hierarchy = hierarchy;\r\n resolve(merged);\r\n return;\r\n }\r\n\r\n let parent = model[\"parent\"];\r\n delete model[\"parent\"];// remove the child's parent so it will be replaced by the parent's parent\r\n hierarchy.push(parent);\r\n\r\n Object(_functions__WEBPACK_IMPORTED_MODULE_0__[\"loadJsonFromPath\"])(assetRoot, \"/assets/minecraft/models/\" + parent + \".json\").then((parentData) => {\r\n let mergedModel = Object.assign({}, model, parentData);\r\n mergeParents_(mergedModel, name, stack, hierarchy, assetRoot, resolve, reject);\r\n }).catch(reject);\r\n\r\n};\r\n\r\nfunction toRadians(angle) {\r\n return angle * (Math.PI / 180);\r\n}\r\n\r\nfunction deleteObjectProperties(obj) {\r\n Object.keys(obj).forEach(function (key) {\r\n delete obj[key];\r\n });\r\n}\r\n\n\n//# sourceURL=webpack:///./src/model/modelFunctions.js?"); /***/ }), @@ -2109,7 +2142,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultOptions\", function() { return defaultOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepDisposeMesh\", function() { return deepDisposeMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeMeshes__\", function() { return mergeMeshes__; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeCubeMeshes\", function() { return mergeCubeMeshes; });\n/* harmony import */ var _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/OrbitControls */ \"./src/lib/OrbitControls.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! threejs-ext */ \"./node_modules/threejs-ext/dist/index.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(threejs_ext__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @johh/three-effectcomposer */ \"./node_modules/@johh/three-effectcomposer/dist/index.js\");\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! onscreen */ \"./node_modules/onscreen/dist/on-screen.umd.js\");\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(onscreen__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions */ \"./src/functions.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @property {boolean} showAxes Debugging - Show the scene's axes\r\n * @property {boolean} showOutlines Debugging - Show bounding boxes\r\n * @property {boolean} showGrid Debugging - Show coordinate grid\r\n *\r\n * @property {object} controls Controls settings\r\n * @property {boolean} [controls.enabled=true] Toggle controls\r\n * @property {boolean} [controls.zoom=true] Toggle zoom\r\n * @property {boolean} [controls.rotate=true] Toggle rotation\r\n * @property {boolean} [controls.pan=true] Toggle panning\r\n *\r\n * @property {object} camera Camera settings\r\n * @property {string} [camera.type=perspective] Camera type\r\n * @property {number} camera.x Camera X-position\r\n * @property {number} camera.y Camera Y-Position\r\n * @property {number} camera.z Camera Z-Position\r\n * @property {number[]} camera.target [x,y,z] array where the camera should look\r\n */\r\nconst defaultOptions = {\r\n showAxes: false,\r\n showGrid: false,\r\n autoResize: false,\r\n controls: {\r\n enabled: true,\r\n zoom: true,\r\n rotate: true,\r\n pan: true,\r\n keys: true\r\n },\r\n camera: {\r\n type: \"perspective\",\r\n x: 20,\r\n y: 35,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n canvas: {\r\n width: undefined,\r\n height: undefined\r\n },\r\n pauseHidden: true,\r\n forceContext: false,\r\n sendStats: true\r\n};\r\n\r\n/**\r\n * Base class for all Renders\r\n */\r\nclass Render {\r\n\r\n /**\r\n * @param {object} options The options for this renderer, see {@link defaultOptions}\r\n * @param {object} defOptions Additional default options, provided by the individual renders\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, defOptions, element) {\r\n /**\r\n * DOM Element to attach the renderer to\r\n * @type {HTMLElement}\r\n */\r\n this.element = element || document.body;\r\n /**\r\n * Combined options\r\n * @type {{} & defaultOptions & defOptions & options}\r\n */\r\n this.options = Object.assign({}, defaultOptions, defOptions, options);\r\n\r\n this.renderType = \"_Base_\";\r\n }\r\n\r\n /**\r\n * @param {boolean} [trim=false] whether to trim transparent pixels\r\n * @param {string} [mime=image/png] mime type of the image\r\n * @returns {string} The content of the renderer's canvas as a Base64 encoded image\r\n */\r\n toImage(trim, mime) {\r\n if (!mime) mime = \"image/png\";\r\n if (this._renderer) {\r\n if (!trim) {\r\n return this._renderer.domElement.toDataURL(mime);\r\n } else {\r\n // Clone the canvas onto a 2d context, so we can trim it properly\r\n let newCanvas = document.createElement('canvas');\r\n let context = newCanvas.getContext('2d');\r\n\r\n newCanvas.width = this._renderer.domElement.width;\r\n newCanvas.height = this._renderer.domElement.height;\r\n\r\n context.drawImage(this._renderer.domElement, 0, 0);\r\n\r\n let trimmed = Object(_functions__WEBPACK_IMPORTED_MODULE_6__[\"trimCanvas\"])(newCanvas);\r\n return trimmed.toDataURL(mime);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Export the current scene content in the .obj format (only geometries, no textures)\r\n * @returns {string} the .obj file content\r\n */\r\n toObj() {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"OBJExporter\"]();\r\n return exporter.parse(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Export the current scene content in the .gltf format (geometries + textures)\r\n * @returns {Promise} a promise which resolves with the .gltf file content\r\n */\r\n toGLTF(exportOptions) {\r\n return new Promise((resolve, reject) => {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"GLTFExporter\"]();\r\n exporter.parse(this._scene, (gltf) => {\r\n resolve(gltf);\r\n }, exportOptions)\r\n } else {\r\n reject();\r\n }\r\n })\r\n }\r\n\r\n toPLY(exportOptions) {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"PLYExporter\"]();\r\n return exporter.parse(this._scene, exportOptions);\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the scene\r\n * @param renderCb\r\n * @param doNotAnimate\r\n * @protected\r\n */\r\n initScene(renderCb, doNotAnimate) {\r\n let renderObj = this;\r\n\r\n console.log(\" \");\r\n console.log('%c ', 'font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;');\r\n console.log(\"MineRender/\" + (renderObj.renderType || renderObj.constructor.name) + \"/\" + \"1.4.6\");\r\n console.log(( false ? undefined : \"DEVELOPMENT\") + \" build\");\r\n console.log(\"Built @ \" + \"2021-02-01T16:10:49.094Z\");\r\n console.log(\" \");\r\n\r\n if (renderObj.options.sendStats) {\r\n // Send stats\r\n\r\n let iframe = false;\r\n try {\r\n iframe = window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n let hostname;\r\n try{\r\n hostname = new URL(iframe ? document.referrer : window.location).hostname;\r\n }catch (e) {\r\n console.warn(\"Failed to get hostname\");\r\n }\r\n\r\n jquery__WEBPACK_IMPORTED_MODULE_5__[\"post\"]({\r\n url: \"https://minerender.org/stats.php\",\r\n data: {\r\n action: \"init\",\r\n type: renderObj.renderType,\r\n host: hostname,\r\n source: (iframe ? \"iframe\" : \"javascript\")\r\n }\r\n });\r\n }\r\n\r\n // Scene INIT\r\n let scene = new three__WEBPACK_IMPORTED_MODULE_3__[\"Scene\"]();\r\n renderObj._scene = scene;\r\n let camera;\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"OrthographicCamera\"]((renderObj.options.canvas.width || window.innerWidth) / -2, (renderObj.options.canvas.width || window.innerWidth) / 2, (renderObj.options.canvas.height || window.innerHeight) / 2, (renderObj.options.canvas.height || window.innerHeight) / -2, 1, 1000);\r\n } else {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"PerspectiveCamera\"](75, (renderObj.options.canvas.width || window.innerWidth) / (renderObj.options.canvas.height || window.innerHeight), 5, 1000);\r\n }\r\n renderObj._camera = camera;\r\n\r\n if (renderObj.options.camera.zoom) {\r\n camera.zoom = renderObj.options.camera.zoom;\r\n }\r\n\r\n let renderer = new three__WEBPACK_IMPORTED_MODULE_3__[\"WebGLRenderer\"]({alpha: true, antialias: true, preserveDrawingBuffer: true});\r\n renderObj._renderer = renderer;\r\n renderer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderer.setClearColor(0x000000, 0);\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.shadowMap.enabled = true;\r\n renderer.shadowMap.type = three__WEBPACK_IMPORTED_MODULE_3__[\"PCFSoftShadowMap\"];\r\n renderObj.element.appendChild(renderObj._canvas = renderer.domElement);\r\n\r\n let composer = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default.a(renderer);\r\n composer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderObj._composer = composer;\r\n let ssaaRenderPass = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"SSAARenderPass\"](scene, camera);\r\n ssaaRenderPass.unbiased = true;\r\n composer.addPass(ssaaRenderPass);\r\n // let renderPass = new RenderPass(scene, camera);\r\n // renderPass.enabled = false;\r\n // composer.addPass(renderPass);\r\n let copyPass = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"ShaderPass\"](_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"CopyShader\"]);\r\n copyPass.renderToScreen = true;\r\n composer.addPass(copyPass);\r\n\r\n if (renderObj.options.autoResize) {\r\n renderObj._resizeListener = function () {\r\n let width = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetWidth : window.innerWidth;\r\n let height = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetHeight : window.innerHeight;\r\n\r\n renderObj._resize(width, height);\r\n };\r\n window.addEventListener(\"resize\", renderObj._resizeListener);\r\n }\r\n renderObj._resize = function (width, height) {\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera.left = width / -2;\r\n camera.right = width / 2;\r\n camera.top = height / 2;\r\n camera.bottom = height / -2;\r\n } else {\r\n camera.aspect = width / height;\r\n }\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(width, height);\r\n composer.setSize(width, height);\r\n };\r\n\r\n // Helpers\r\n if (renderObj.options.showAxes) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"AxesHelper\"](50));\r\n }\r\n if (renderObj.options.showGrid) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"GridHelper\"](100, 100));\r\n }\r\n\r\n let light = new three__WEBPACK_IMPORTED_MODULE_3__[\"AmbientLight\"](0xFFFFFF); // soft white light\r\n scene.add(light);\r\n\r\n // Init controls\r\n let controls = new _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__[\"default\"](camera, renderer.domElement);\r\n renderObj._controls = controls;\r\n controls.enableZoom = renderObj.options.controls.zoom;\r\n controls.enableRotate = renderObj.options.controls.rotate;\r\n controls.enablePan = renderObj.options.controls.pan;\r\n controls.enableKeys = renderObj.options.controls.keys;\r\n controls.target.set(renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]);\r\n\r\n // Set camera location & target\r\n camera.position.x = renderObj.options.camera.x;\r\n camera.position.y = renderObj.options.camera.y;\r\n camera.position.z = renderObj.options.camera.z;\r\n camera.lookAt(new three__WEBPACK_IMPORTED_MODULE_3__[\"Vector3\"](renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]));\r\n\r\n // Do the render!\r\n let animate = function () {\r\n renderObj._animId = requestAnimationFrame(animate);\r\n\r\n if (renderObj.onScreen) {\r\n if (typeof renderCb === \"function\") renderCb();\r\n\r\n composer.render();\r\n }\r\n };\r\n renderObj._animate = animate;\r\n\r\n if (!doNotAnimate) {\r\n animate();\r\n }\r\n\r\n renderObj.onScreen = true;// default to true, in case the checking is disabled\r\n let id = \"minerender-canvas-\" + renderObj._scene.uuid + \"-\" + Date.now();\r\n renderObj._canvas.id = id;\r\n if (renderObj.options.pauseHidden) {\r\n renderObj.onScreen = false;// set to false if the check is enabled\r\n let os = new onscreen__WEBPACK_IMPORTED_MODULE_4___default.a();\r\n renderObj._onScreenObserver = os;\r\n\r\n os.on(\"enter\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = true;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextRestore();\r\n }\r\n })\r\n os.on(\"leave\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = false;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextLoss();\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Adds an object to the scene & sets userData.renderType to this renderer's type\r\n * @param toAdd object to add\r\n */\r\n addToScene(toAdd) {\r\n let renderObj = this;\r\n if (renderObj._scene && toAdd) {\r\n toAdd.userData.renderType = renderObj.renderType;\r\n renderObj._scene.add(toAdd);\r\n }\r\n }\r\n\r\n /**\r\n * Clears the scene\r\n * @param onlySelfType whether to remove only objects whose type is equal to this renderer's type (useful for combined render)\r\n * @param filterFn Filter function to check which children of the scene to remove\r\n */\r\n clearScene(onlySelfType, filterFn) {\r\n if (onlySelfType || filterFn) {\r\n for (let i = this._scene.children.length - 1; i >= 0; i--) {\r\n let child = this._scene.children[i];\r\n if (filterFn) {\r\n let shouldKeep = filterFn(child);\r\n if (shouldKeep) {\r\n continue;\r\n }\r\n }\r\n if (onlySelfType) {\r\n if (child.userData.renderType !== this.renderType) {\r\n continue;\r\n }\r\n }\r\n deepDisposeMesh(child, true);\r\n this._scene.remove(child);\r\n }\r\n } else {\r\n while (this._scene.children.length > 0) {\r\n this._scene.remove(this._scene.children[0]);\r\n }\r\n }\r\n };\r\n\r\n dispose() {\r\n cancelAnimationFrame(this._animId);\r\n if (this._onScreenObserver) {\r\n this._onScreenObserver.destroy();\r\n }\r\n\r\n this.clearScene();\r\n\r\n this._canvas.remove();\r\n let el = this.element;\r\n while (el.firstChild) {\r\n el.removeChild(el.firstChild);\r\n }\r\n\r\n if (this.options.autoResize) {\r\n window.removeEventListener(\"resize\", this._resizeListener);\r\n }\r\n };\r\n\r\n}\r\n\r\n// https://stackoverflow.com/questions/27217388/use-multiple-materials-for-merged-geometries-in-three-js/44485364#44485364\r\nfunction deepDisposeMesh(obj, removeChildren) {\r\n if (!obj) return;\r\n if (obj.geometry && obj.geometry.dispose) obj.geometry.dispose();\r\n if (obj.material && obj.material.dispose) obj.material.dispose();\r\n if (obj.texture && obj.texture.dispose) obj.texture.dispose();\r\n if (obj.children) {\r\n let children = obj.children;\r\n for (let i = 0; i < children.length; i++) {\r\n deepDisposeMesh(children[i], removeChildren);\r\n }\r\n\r\n if (removeChildren) {\r\n for (let i = obj.children.length - 1; i >= 0; i--) {\r\n obj.remove(children[i]);\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction mergeMeshes__(meshes, toBufferGeometry) {\r\n let finalGeometry,\r\n materials = [],\r\n mergedGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"](),\r\n mergedMesh;\r\n\r\n meshes.forEach(function (mesh, index) {\r\n mesh.updateMatrix();\r\n mesh.geometry.faces.forEach(function (face) {\r\n face.materialIndex = 0;\r\n });\r\n mergedGeometry.merge(mesh.geometry, mesh.matrix, index);\r\n materials.push(mesh.material);\r\n });\r\n\r\n mergedGeometry.groupsNeedUpdate = true;\r\n\r\n if (toBufferGeometry) {\r\n finalGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedGeometry);\r\n } else {\r\n finalGeometry = mergedGeometry;\r\n }\r\n\r\n mergedMesh = new three__WEBPACK_IMPORTED_MODULE_3__[\"Mesh\"](finalGeometry, materials);\r\n mergedMesh.geometry.computeFaceNormals();\r\n mergedMesh.geometry.computeVertexNormals();\r\n\r\n return mergedMesh;\r\n\r\n}\r\n\r\nfunction mergeCubeMeshes(cubes, toBuffer) {\r\n cubes = cubes.filter(c => !!c);\r\n\r\n let mergedCubes = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"]();\r\n let mergedMaterials = [];\r\n for (let i = 0; i < cubes.length; i++) {\r\n let offset = i * Math.max(cubes[i].material.length, 1);\r\n mergedCubes.merge(cubes[i].geometry, cubes[i].matrix, offset);\r\n for (let j = 0; j < cubes[i].material.length; j++) {\r\n mergedMaterials.push(cubes[i].material[j]);\r\n }\r\n // for (let j = 0; j < cubes[i].geometry.faces.length; j++) {\r\n // cubes[i].geometry.faces[j].materialIndex=offset-1+j;\r\n // }\r\n\r\n deepDisposeMesh(cubes[i], true);\r\n }\r\n mergedCubes.mergeVertices();\r\n return {\r\n geometry: toBuffer ? new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedCubes) : mergedCubes,\r\n materials: mergedMaterials\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./src/renderBase.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultOptions\", function() { return defaultOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepDisposeMesh\", function() { return deepDisposeMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeMeshes__\", function() { return mergeMeshes__; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeCubeMeshes\", function() { return mergeCubeMeshes; });\n/* harmony import */ var _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/OrbitControls */ \"./src/lib/OrbitControls.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! threejs-ext */ \"./node_modules/threejs-ext/dist/index.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(threejs_ext__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @johh/three-effectcomposer */ \"./node_modules/@johh/three-effectcomposer/dist/index.js\");\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! onscreen */ \"./node_modules/onscreen/dist/on-screen.umd.js\");\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(onscreen__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions */ \"./src/functions.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @property {boolean} showAxes Debugging - Show the scene's axes\r\n * @property {boolean} showOutlines Debugging - Show bounding boxes\r\n * @property {boolean} showGrid Debugging - Show coordinate grid\r\n *\r\n * @property {object} controls Controls settings\r\n * @property {boolean} [controls.enabled=true] Toggle controls\r\n * @property {boolean} [controls.zoom=true] Toggle zoom\r\n * @property {boolean} [controls.rotate=true] Toggle rotation\r\n * @property {boolean} [controls.pan=true] Toggle panning\r\n *\r\n * @property {object} camera Camera settings\r\n * @property {string} [camera.type=perspective] Camera type\r\n * @property {number} camera.x Camera X-position\r\n * @property {number} camera.y Camera Y-Position\r\n * @property {number} camera.z Camera Z-Position\r\n * @property {number[]} camera.target [x,y,z] array where the camera should look\r\n */\r\nconst defaultOptions = {\r\n showAxes: false,\r\n showGrid: false,\r\n autoResize: false,\r\n controls: {\r\n enabled: true,\r\n zoom: true,\r\n rotate: true,\r\n pan: true,\r\n keys: true\r\n },\r\n camera: {\r\n type: \"perspective\",\r\n x: 20,\r\n y: 35,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n canvas: {\r\n width: undefined,\r\n height: undefined\r\n },\r\n pauseHidden: true,\r\n forceContext: false,\r\n sendStats: true\r\n};\r\n\r\n/**\r\n * Base class for all Renders\r\n */\r\nclass Render {\r\n\r\n /**\r\n * @param {object} options The options for this renderer, see {@link defaultOptions}\r\n * @param {object} defOptions Additional default options, provided by the individual renders\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, defOptions, element) {\r\n /**\r\n * DOM Element to attach the renderer to\r\n * @type {HTMLElement}\r\n */\r\n this.element = element || document.body;\r\n /**\r\n * Combined options\r\n * @type {{} & defaultOptions & defOptions & options}\r\n */\r\n this.options = Object.assign({}, defaultOptions, defOptions, options);\r\n\r\n this.renderType = \"_Base_\";\r\n }\r\n\r\n /**\r\n * @param {boolean} [trim=false] whether to trim transparent pixels\r\n * @param {string} [mime=image/png] mime type of the image\r\n * @returns {string} The content of the renderer's canvas as a Base64 encoded image\r\n */\r\n toImage(trim, mime) {\r\n if (!mime) mime = \"image/png\";\r\n if (this._renderer) {\r\n if (!trim) {\r\n return this._renderer.domElement.toDataURL(mime);\r\n } else {\r\n // Clone the canvas onto a 2d context, so we can trim it properly\r\n let newCanvas = document.createElement('canvas');\r\n let context = newCanvas.getContext('2d');\r\n\r\n newCanvas.width = this._renderer.domElement.width;\r\n newCanvas.height = this._renderer.domElement.height;\r\n\r\n context.drawImage(this._renderer.domElement, 0, 0);\r\n\r\n let trimmed = Object(_functions__WEBPACK_IMPORTED_MODULE_6__[\"trimCanvas\"])(newCanvas);\r\n return trimmed.toDataURL(mime);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Export the current scene content in the .obj format (only geometries, no textures)\r\n * @returns {string} the .obj file content\r\n */\r\n toObj() {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"OBJExporter\"]();\r\n return exporter.parse(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Export the current scene content in the .gltf format (geometries + textures)\r\n * @returns {Promise} a promise which resolves with the .gltf file content\r\n */\r\n toGLTF(exportOptions) {\r\n return new Promise((resolve, reject) => {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"GLTFExporter\"]();\r\n exporter.parse(this._scene, (gltf) => {\r\n resolve(gltf);\r\n }, exportOptions)\r\n } else {\r\n reject();\r\n }\r\n })\r\n }\r\n\r\n toPLY(exportOptions) {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"PLYExporter\"]();\r\n return exporter.parse(this._scene, exportOptions);\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the scene\r\n * @param renderCb\r\n * @param doNotAnimate\r\n * @protected\r\n */\r\n initScene(renderCb, doNotAnimate) {\r\n let renderObj = this;\r\n\r\n console.log(\" \");\r\n console.log('%c ', 'font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;');\r\n console.log(\"MineRender/\" + (renderObj.renderType || renderObj.constructor.name) + \"/\" + \"1.4.7\");\r\n console.log(( false ? undefined : \"DEVELOPMENT\") + \" build\");\r\n console.log(\"Built @ \" + \"2021-02-01T16:31:09.608Z\");\r\n console.log(\" \");\r\n\r\n if (renderObj.options.sendStats) {\r\n // Send stats\r\n\r\n let iframe = false;\r\n try {\r\n iframe = window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n let hostname;\r\n try{\r\n hostname = new URL(iframe ? document.referrer : window.location).hostname;\r\n }catch (e) {\r\n console.warn(\"Failed to get hostname\");\r\n }\r\n\r\n jquery__WEBPACK_IMPORTED_MODULE_5__[\"post\"]({\r\n url: \"https://minerender.org/stats.php\",\r\n data: {\r\n action: \"init\",\r\n type: renderObj.renderType,\r\n host: hostname,\r\n source: (iframe ? \"iframe\" : \"javascript\")\r\n }\r\n });\r\n }\r\n\r\n // Scene INIT\r\n let scene = new three__WEBPACK_IMPORTED_MODULE_3__[\"Scene\"]();\r\n renderObj._scene = scene;\r\n let camera;\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"OrthographicCamera\"]((renderObj.options.canvas.width || window.innerWidth) / -2, (renderObj.options.canvas.width || window.innerWidth) / 2, (renderObj.options.canvas.height || window.innerHeight) / 2, (renderObj.options.canvas.height || window.innerHeight) / -2, 1, 1000);\r\n } else {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"PerspectiveCamera\"](75, (renderObj.options.canvas.width || window.innerWidth) / (renderObj.options.canvas.height || window.innerHeight), 5, 1000);\r\n }\r\n renderObj._camera = camera;\r\n\r\n if (renderObj.options.camera.zoom) {\r\n camera.zoom = renderObj.options.camera.zoom;\r\n }\r\n\r\n let renderer = new three__WEBPACK_IMPORTED_MODULE_3__[\"WebGLRenderer\"]({alpha: true, antialias: true, preserveDrawingBuffer: true});\r\n renderObj._renderer = renderer;\r\n renderer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderer.setClearColor(0x000000, 0);\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.shadowMap.enabled = true;\r\n renderer.shadowMap.type = three__WEBPACK_IMPORTED_MODULE_3__[\"PCFSoftShadowMap\"];\r\n renderObj.element.appendChild(renderObj._canvas = renderer.domElement);\r\n\r\n let composer = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default.a(renderer);\r\n composer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderObj._composer = composer;\r\n let ssaaRenderPass = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"SSAARenderPass\"](scene, camera);\r\n ssaaRenderPass.unbiased = true;\r\n composer.addPass(ssaaRenderPass);\r\n // let renderPass = new RenderPass(scene, camera);\r\n // renderPass.enabled = false;\r\n // composer.addPass(renderPass);\r\n let copyPass = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"ShaderPass\"](_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"CopyShader\"]);\r\n copyPass.renderToScreen = true;\r\n composer.addPass(copyPass);\r\n\r\n if (renderObj.options.autoResize) {\r\n renderObj._resizeListener = function () {\r\n let width = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetWidth : window.innerWidth;\r\n let height = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetHeight : window.innerHeight;\r\n\r\n renderObj._resize(width, height);\r\n };\r\n window.addEventListener(\"resize\", renderObj._resizeListener);\r\n }\r\n renderObj._resize = function (width, height) {\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera.left = width / -2;\r\n camera.right = width / 2;\r\n camera.top = height / 2;\r\n camera.bottom = height / -2;\r\n } else {\r\n camera.aspect = width / height;\r\n }\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(width, height);\r\n composer.setSize(width, height);\r\n };\r\n\r\n // Helpers\r\n if (renderObj.options.showAxes) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"AxesHelper\"](50));\r\n }\r\n if (renderObj.options.showGrid) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"GridHelper\"](100, 100));\r\n }\r\n\r\n let light = new three__WEBPACK_IMPORTED_MODULE_3__[\"AmbientLight\"](0xFFFFFF); // soft white light\r\n scene.add(light);\r\n\r\n // Init controls\r\n let controls = new _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__[\"default\"](camera, renderer.domElement);\r\n renderObj._controls = controls;\r\n controls.enableZoom = renderObj.options.controls.zoom;\r\n controls.enableRotate = renderObj.options.controls.rotate;\r\n controls.enablePan = renderObj.options.controls.pan;\r\n controls.enableKeys = renderObj.options.controls.keys;\r\n controls.target.set(renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]);\r\n\r\n // Set camera location & target\r\n camera.position.x = renderObj.options.camera.x;\r\n camera.position.y = renderObj.options.camera.y;\r\n camera.position.z = renderObj.options.camera.z;\r\n camera.lookAt(new three__WEBPACK_IMPORTED_MODULE_3__[\"Vector3\"](renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]));\r\n\r\n // Do the render!\r\n let animate = function () {\r\n renderObj._animId = requestAnimationFrame(animate);\r\n\r\n if (renderObj.onScreen) {\r\n if (typeof renderCb === \"function\") renderCb();\r\n\r\n composer.render();\r\n }\r\n };\r\n renderObj._animate = animate;\r\n\r\n if (!doNotAnimate) {\r\n animate();\r\n }\r\n\r\n renderObj.onScreen = true;// default to true, in case the checking is disabled\r\n let id = \"minerender-canvas-\" + renderObj._scene.uuid + \"-\" + Date.now();\r\n renderObj._canvas.id = id;\r\n if (renderObj.options.pauseHidden) {\r\n renderObj.onScreen = false;// set to false if the check is enabled\r\n let os = new onscreen__WEBPACK_IMPORTED_MODULE_4___default.a();\r\n renderObj._onScreenObserver = os;\r\n\r\n os.on(\"enter\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = true;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextRestore();\r\n }\r\n })\r\n os.on(\"leave\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = false;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextLoss();\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Adds an object to the scene & sets userData.renderType to this renderer's type\r\n * @param toAdd object to add\r\n */\r\n addToScene(toAdd) {\r\n let renderObj = this;\r\n if (renderObj._scene && toAdd) {\r\n toAdd.userData.renderType = renderObj.renderType;\r\n renderObj._scene.add(toAdd);\r\n }\r\n }\r\n\r\n /**\r\n * Clears the scene\r\n * @param onlySelfType whether to remove only objects whose type is equal to this renderer's type (useful for combined render)\r\n * @param filterFn Filter function to check which children of the scene to remove\r\n */\r\n clearScene(onlySelfType, filterFn) {\r\n if (onlySelfType || filterFn) {\r\n for (let i = this._scene.children.length - 1; i >= 0; i--) {\r\n let child = this._scene.children[i];\r\n if (filterFn) {\r\n let shouldKeep = filterFn(child);\r\n if (shouldKeep) {\r\n continue;\r\n }\r\n }\r\n if (onlySelfType) {\r\n if (child.userData.renderType !== this.renderType) {\r\n continue;\r\n }\r\n }\r\n deepDisposeMesh(child, true);\r\n this._scene.remove(child);\r\n }\r\n } else {\r\n while (this._scene.children.length > 0) {\r\n this._scene.remove(this._scene.children[0]);\r\n }\r\n }\r\n };\r\n\r\n dispose() {\r\n cancelAnimationFrame(this._animId);\r\n if (this._onScreenObserver) {\r\n this._onScreenObserver.destroy();\r\n }\r\n\r\n this.clearScene();\r\n\r\n this._canvas.remove();\r\n let el = this.element;\r\n while (el.firstChild) {\r\n el.removeChild(el.firstChild);\r\n }\r\n\r\n if (this.options.autoResize) {\r\n window.removeEventListener(\"resize\", this._resizeListener);\r\n }\r\n };\r\n\r\n}\r\n\r\n// https://stackoverflow.com/questions/27217388/use-multiple-materials-for-merged-geometries-in-three-js/44485364#44485364\r\nfunction deepDisposeMesh(obj, removeChildren) {\r\n if (!obj) return;\r\n if (obj.geometry && obj.geometry.dispose) obj.geometry.dispose();\r\n if (obj.material && obj.material.dispose) obj.material.dispose();\r\n if (obj.texture && obj.texture.dispose) obj.texture.dispose();\r\n if (obj.children) {\r\n let children = obj.children;\r\n for (let i = 0; i < children.length; i++) {\r\n deepDisposeMesh(children[i], removeChildren);\r\n }\r\n\r\n if (removeChildren) {\r\n for (let i = obj.children.length - 1; i >= 0; i--) {\r\n obj.remove(children[i]);\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction mergeMeshes__(meshes, toBufferGeometry) {\r\n let finalGeometry,\r\n materials = [],\r\n mergedGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"](),\r\n mergedMesh;\r\n\r\n meshes.forEach(function (mesh, index) {\r\n mesh.updateMatrix();\r\n mesh.geometry.faces.forEach(function (face) {\r\n face.materialIndex = 0;\r\n });\r\n mergedGeometry.merge(mesh.geometry, mesh.matrix, index);\r\n materials.push(mesh.material);\r\n });\r\n\r\n mergedGeometry.groupsNeedUpdate = true;\r\n\r\n if (toBufferGeometry) {\r\n finalGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedGeometry);\r\n } else {\r\n finalGeometry = mergedGeometry;\r\n }\r\n\r\n mergedMesh = new three__WEBPACK_IMPORTED_MODULE_3__[\"Mesh\"](finalGeometry, materials);\r\n mergedMesh.geometry.computeFaceNormals();\r\n mergedMesh.geometry.computeVertexNormals();\r\n\r\n return mergedMesh;\r\n\r\n}\r\n\r\nfunction mergeCubeMeshes(cubes, toBuffer) {\r\n cubes = cubes.filter(c => !!c);\r\n\r\n let mergedCubes = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"]();\r\n let mergedMaterials = [];\r\n for (let i = 0; i < cubes.length; i++) {\r\n let offset = i * Math.max(cubes[i].material.length, 1);\r\n mergedCubes.merge(cubes[i].geometry, cubes[i].matrix, offset);\r\n for (let j = 0; j < cubes[i].material.length; j++) {\r\n mergedMaterials.push(cubes[i].material[j]);\r\n }\r\n // for (let j = 0; j < cubes[i].geometry.faces.length; j++) {\r\n // cubes[i].geometry.faces[j].materialIndex=offset-1+j;\r\n // }\r\n\r\n deepDisposeMesh(cubes[i], true);\r\n }\r\n mergedCubes.mergeVertices();\r\n return {\r\n geometry: toBuffer ? new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedCubes) : mergedCubes,\r\n materials: mergedMaterials\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./src/renderBase.js?"); /***/ }), diff --git a/dist/model.min.js b/dist/model.min.js index 216f907f..985678d4 100644 --- a/dist/model.min.js +++ b/dist/model.min.js @@ -1,16 +1,16 @@ /*! - * MineRender 1.4.6 + * MineRender 1.4.7 * (c) 2018, Haylee Schäfer (inventivetalent) / MIT License * https://minerender.org - * Build #1612195849082 / Mon Feb 01 2021 17:10:49 GMT+0100 (GMT+01:00) - */!function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=77)}([function(e,t){e.exports=THREE},function(e,t,r){"use strict";r.d(t,"e",(function(){return o})),r.d(t,"b",(function(){return s})),r.d(t,"d",(function(){return l})),r.d(t,"c",(function(){return f})),r.d(t,"f",(function(){return h})),r.d(t,"a",(function(){return p}));var a=r(3),n=r(41),i=r.n(n);function o(e,t,r,n){return new Promise(i=>{let o,s,l,f="block";if("string"==typeof e){let a=c(e);e=a.model,f=a.type,r.push({name:e,type:f,options:t}),i(r)}else if("object"==typeof e)if(e.hasOwnProperty("offset")&&(o=e.offset),e.hasOwnProperty("rotation")&&(s=e.rotation),e.hasOwnProperty("scale")&&(l=e.scale),e.hasOwnProperty("model")){if(e.hasOwnProperty("type"))f=e.type,e=e.model;else{let t=c(e.model);e=t.model,f=t.type}r.push({name:e,type:f,offset:o,rotation:s,scale:l,options:t}),i(r)}else e.hasOwnProperty("blockstate")&&(f="block",Object(a.b)(e.blockstate,n).then(a=>{if(a.hasOwnProperty("variants"))if(e.hasOwnProperty("variant")){let n=function(e,t){Array.isArray(e)||(e=Object.keys(e));if(!t||""===t||0===t.length)return"";let r=u(t);for(let t=0;t{i(r)}))})}function s(e,t){return function(e,t,r){return new Promise((n,i)=>{"string"==typeof e?e.startsWith("{")&&e.endsWith("}")?n(JSON.parse(e)):e.startsWith("http")?fetch(e,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{console.log("model data:",e),n(e)}):Object(a.c)(r,"/assets/minecraft/models/"+(t||"block")+"/"+e+".json").then(e=>{n(e)}):"object"==typeof e?n(e):(console.warn("Invalid model"),i())})}(e.name,e.type,t).then(r=>(function(e,t,r){return new Promise((a,n)=>{d(e,t,[],[],r,a,n)})})(r,e.name,t)).then(t=>(console.debug(e.name+" merged:"),console.debug(t),t.hasOwnProperty("elements")||"lava"!==e.name&&"water"!==e.name||(t.elements=[{from:[0,0,0],to:[16,16,16],faces:{down:{texture:"#particle",cullface:"down"},up:{texture:"#particle",cullface:"up"},north:{texture:"#particle",cullface:"north"},south:{texture:"#particle",cullface:"south"},west:{texture:"#particle",cullface:"west"},east:{texture:"#particle",cullface:"east"}}}]),t))}function l(e){return e.type+"__"+e.name}function u(e){let t=e.split(","),r={};for(let e=0;e{let n=[],i=[],o=Object.keys(e);for(let r=0;r{let a={};for(let e=0;e=0;t--)e=i()(e,r[t]);return n.unshift(t),e.hierarchy=n,void s(e)}let u=e.parent;delete e.parent,n.push(u),Object(a.c)(o,"/assets/minecraft/models/"+u+".json").then(a=>{let i=Object.assign({},e,a);d(i,t,r,n,o,s,l)}).catch(l)};function h(e){return e*(Math.PI/180)}function p(e){Object.keys(e).forEach((function(t){delete e[t]}))}},function(e,t,r){"use strict";t.a={head:[{left:{x:0,y:16,w:8,h:8,flipX:!1},front:{x:8,y:16,w:8,h:8},right:{x:16,y:16,w:8,h:8,flipX:!1},back:{x:24,y:16,w:8,h:8},top:{x:8,y:24,w:8,h:8},bottom:{x:16,y:24,w:8,h:8,flipX:!0,flipY:!0}},{left:{x:0,y:48,w:8,h:8,flipX:!1},front:{x:8,y:48,w:8,h:8},right:{x:16,y:48,w:8,h:8,flipX:!1},back:{x:24,y:48,w:8,h:8},top:{x:8,y:56,w:8,h:8},bottom:{x:16,y:56,w:8,h:8,flipX:!0,flipY:!0}}],body:[{left:{x:16,y:0,w:4,h:12,flipX:!0},front:{x:20,y:0,w:8,h:12},right:{x:28,y:0,w:4,h:12,flipX:!0},back:{x:32,y:0,w:8,h:12},top:{x:20,y:12,w:8,h:4},bottom:{x:28,y:12,w:8,h:4,flipY:!0,flipX:!0}},{left:{x:16,y:32,w:4,h:12,flipX:!1},front:{x:20,y:32,w:8,h:12},right:{x:28,y:32,w:4,h:12,flipX:!1},back:{x:32,y:32,w:8,h:12},top:{x:20,y:44,w:8,h:4},bottom:{x:28,y:44,w:8,h:4,flipY:!0,flipX:!0}}],rightArm:[{left:{x:40,y:0,w:4,h:12,flipX:!1},front:{x:44,y:0,w:4,h:12,flipX:!1},right:{x:48,y:0,w:4,h:12,flipX:!1},back:{x:52,y:0,w:4,h:12,flipX:!1},top:{x:44,y:12,w:4,h:4,flipX:!1},bottom:{x:48,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:32,y:0,w:4,h:12,flipX:!1},front:{x:36,y:0,w:4,h:12,sw:3,flipX:!1},right:{x:40,y:0,w:4,h:12,sx:39,flipX:!1},back:{x:44,y:0,w:4,h:12,sx:43,sw:3,flipX:!1},top:{x:36,y:12,w:4,h:4,sw:3,flipX:!1},bottom:{x:40,y:12,w:4,h:4,sx:39,sw:3,flipY:!0,flipX:!0}}],leftArm:[{left:{x:40,y:0,w:4,h:12,flipX:!1},front:{x:44,y:0,w:4,h:12,flipX:!1},right:{x:48,y:0,w:4,h:12,flipX:!1},back:{x:52,y:0,w:4,h:12,flipX:!1},top:{x:44,y:12,w:4,h:4,flipX:!1},bottom:{x:48,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:40,y:32,w:4,h:12,flipX:!1},front:{x:44,y:32,w:4,h:12,sw:3,flipX:!1},right:{x:48,y:32,w:4,h:12,sx:47,flipX:!1},back:{x:52,y:32,w:4,h:12,sx:51,sw:3,flipX:!1},top:{x:44,y:44,w:4,h:4,sw:3,flipX:!1},bottom:{x:48,y:44,w:4,h:4,sx:47,sw:3,flipY:!0,flipX:!0}}],rightLeg:[{left:{x:0,y:0,w:4,h:12,flipX:!1},front:{x:4,y:0,w:4,h:12,flipX:!1},right:{x:8,y:0,w:4,h:12,flipX:!1},back:{x:12,y:0,w:4,h:12},top:{x:4,y:12,w:4,h:4,flipX:!1},bottom:{x:8,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:16,y:0,w:4,h:12,flipX:!1},front:{x:20,y:0,w:4,h:12,flipX:!1},right:{x:24,y:0,w:4,h:12,flipX:!1},back:{x:28,y:0,w:4,h:12,flipX:!1},top:{x:20,y:12,w:4,h:4,flipX:!1},bottom:{x:24,y:12,w:4,h:4,flipY:!0,flipX:!0}}],leftLeg:[{left:{x:0,y:0,w:4,h:12,flipX:!1},front:{x:4,y:0,w:4,h:12,flipX:!1},right:{x:8,y:0,w:4,h:12,flipX:!1},back:{x:12,y:0,w:4,h:12,flipX:!0},top:{x:4,y:12,w:4,h:4,flipX:!1},bottom:{x:8,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:0,y:32,w:4,h:12,flipX:!1},front:{x:4,y:32,w:4,h:12,flipX:!1},right:{x:8,y:32,w:4,h:12,flipX:!1},back:{x:12,y:32,w:4,h:12,flipX:!1},top:{x:4,y:44,w:4,h:4,flipX:!1},bottom:{x:8,y:44,w:4,h:4,flipY:!0,flipX:!0}}],hat:{left:{x:32,y:48,w:8,h:8},front:{x:40,y:48,w:8,h:8},right:{x:48,y:48,w:8,h:8},back:{x:56,y:48,w:8,h:8},top:{x:40,y:56,w:8,h:8,flipX:!1},bottom:{x:48,y:56,w:8,h:8,flipY:!0,flipX:!0}},jacket:{left:{x:16,y:16,w:4,h:12},front:{x:20,y:16,w:8,h:12},right:{x:28,y:16,w:4,h:12},back:{x:32,y:16,w:8,h:12},top:{x:20,y:28,w:8,h:4},bottom:{x:28,y:28,w:8,h:4,flipY:!0,flipX:!0}},rightSleeve:{left:{x:48,y:0,w:4,h:12},front:{x:52,y:0,w:4,h:12,sw:3},right:{x:56,y:0,w:4,h:12,sx:55},back:{x:60,y:0,w:4,h:12,sx:59,sw:3},top:{x:52,y:12,w:4,h:4,sw:3},bottom:{x:56,y:12,w:4,h:4,sx:55,sw:3,flipY:!0,flipX:!0}},leftSleeve:{left:{x:40,y:16,w:4,h:12},front:{x:44,y:16,w:4,h:12,sw:3},right:{x:48,y:16,w:4,h:12,sx:47},back:{x:52,y:16,w:4,h:12,sx:51,sw:3},top:{x:44,y:28,w:4,h:4,sw:3},bottom:{x:48,y:28,w:4,h:4,sx:47,sw:3,flipY:!0,flipX:!0}},rightTrousers:{left:{x:0,y:0,w:4,h:12},front:{x:4,y:0,w:4,h:12},right:{x:8,y:0,w:4,h:12},back:{x:12,y:0,w:4,h:12},top:{x:4,y:12,w:4,h:4},bottom:{x:8,y:12,w:4,h:4,flipY:!0,flipX:!0}},leftTrousers:{left:{x:0,y:16,w:4,h:12},front:{x:4,y:16,w:4,h:12},right:{x:8,y:16,w:4,h:12},back:{x:12,y:16,w:4,h:12},top:{x:4,y:28,w:4,h:4},bottom:{x:8,y:28,w:4,h:4,flipY:!0,flipX:!0}},cape:{right:{x:0,y:5,w:1,h:16},front:{x:1,y:5,w:10,h:16},left:{x:11,y:5,w:1,h:16},back:{x:12,y:5,w:10,h:16},top:{x:1,y:21,w:10,h:1},bottom:{x:11,y:21,w:10,h:1}},capeRelative:{right:{x:0,y:15/32,w:1/64,h:.5},front:{x:1/64,y:15/32,w:10/64,h:.5},left:{x:11/64,y:15/32,w:1/64,h:.5},back:{x:.1875,y:15/32,w:10/64,h:.5},top:{x:1/64,y:31/32,w:10/64,h:1/32},bottom:{x:11/64,y:31/32,w:10/64,h:1/32}},capeOptifineRelative:{right:{x:0,y:10/44,w:2/92,h:32/44},front:{x:2/92,y:10/44,w:20/92,h:32/44},left:{x:22/92,y:10/44,w:2/92,h:32/44},back:{x:24/92,y:10/44,w:20/92,h:32/44},top:{x:2/92,y:42/44,w:20/92,h:2/44},bottom:{x:22/92,y:42/44,w:20/92,h:2/44}},capeOptifine:{right:{x:0,y:10,w:2,h:32},front:{x:2,y:10,w:20,h:32},left:{x:22,y:10,w:2,h:32},back:{x:24,y:10,w:20,h:32},top:{x:2,y:42,w:20,h:2},bottom:{x:22,y:42,w:20,h:2}},capeLabymodRelative:{right:{x:0,y:0,w:1/22,h:16/17},front:{x:1/22,y:0,w:10/22,h:16/17},left:{x:.5,y:0,w:1/22,h:16/17},back:{x:12/22,y:0,w:10/22,h:16/17},top:{x:1/22,y:16/17,w:10/22,h:1/17},bottom:{x:.5,y:16/17,w:10/22,h:1/17}}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return a})),r.d(t,"d",(function(){return l})),r.d(t,"b",(function(){return u})),r.d(t,"e",(function(){return c})),r.d(t,"c",(function(){return f})),r.d(t,"f",(function(){return d})),r.d(t,"g",(function(){return h}));const a="https://assets.mcasset.cloud/1.13",n={},i={},o={},s={};function l(e,t,r,o){return new Promise((s,l)=>{!function e(t,r,o,s,l,u,c){let f="/assets/"+r+"/textures"+o+s+".png";if(n.hasOwnProperty(f))return"__invalid"===n[f]?void u():void l(n[f]);if(!i.hasOwnProperty(f)||0===i[f].length||c){let c=new XMLHttpRequest;c.open("GET",t+f,!0),c.responseType="arraybuffer",c.onloadend=function(){if(200===c.status){let e=new Uint8Array(c.response||c.responseText),t=String.fromCharCode.apply(null,e),r="data:image/png;base64,"+btoa(t);if(n[f]=r,i.hasOwnProperty(f))for(;i[f].length>0;){i[f].shift(0)[0](r)}}else if(a===t){if(n[f]="__invalid",i.hasOwnProperty(f))for(;i[f].length>0;){i[f].shift(0)[1]()}}else e(a,r,o,s,l,u,!0)},c.send(),i.hasOwnProperty(f)||(i[f]=[])}i[f].push([l,u])}(e,t,r,o,s,l)})}function u(e,t){return f(t,"/assets/minecraft/blockstates/"+e+".json")}function c(e,t){return f(t,"/assets/minecraft/textures/block/"+e+".png.mcmeta")}function f(e,t){return new Promise((r,n)=>{!function e(t,r,n,i,l){if(o.hasOwnProperty(r))return"__invalid"===o[r]?void i():void n(Object.assign({},o[r]));s.hasOwnProperty(r)&&0!==s[r].length&&!l||(console.log(t+r),fetch(t+r,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{if(console.log("json data:",e),o[r]=e,s.hasOwnProperty(r))for(;s[r].length>0;){let t=Object.assign({},e);s[r].shift(0)[0](t)}}).catch(l=>{if(console.warn(l),a===t){if(o[r]="__invalid",s.hasOwnProperty(r))for(;s[r].length>0;){s[r].shift(0)[1]()}}else e(a,r,n,i,!0)}),s.hasOwnProperty(r)||(s[r]=[]));s[r].push([n,i])}(e,t,r,n)})}function d(e,t,r){return 0===e?0:t/(r||16)*e}function h(e){let t,r,a,n=e.getContext("2d"),i=document.createElement("canvas").getContext("2d"),o=n.getImageData(0,0,e.width,e.height),s=o.data.length,l={top:null,left:null,right:null,bottom:null};for(t=0;t1)for(var r=1;r{let o,s,l,u="block";if("string"==typeof e){let a=d(e);e=a.model,u=a.type,r.push({name:e,type:u,options:t}),i(r)}else if("object"==typeof e)if(e.hasOwnProperty("offset")&&(o=e.offset),e.hasOwnProperty("rotation")&&(s=e.rotation),e.hasOwnProperty("scale")&&(l=e.scale),e.hasOwnProperty("model")){if(e.hasOwnProperty("type"))u=e.type,e=e.model;else{let t=d(e.model);e=t.model,u=t.type}r.push({name:e,type:u,offset:o,rotation:s,scale:l,options:t}),i(r)}else e.hasOwnProperty("blockstate")&&(u="block",Object(a.b)(e.blockstate,n).then(a=>{if(a.hasOwnProperty("variants"))if(e.hasOwnProperty("variant")){let n=function(e,t){Array.isArray(e)||(e=Object.keys(e));if(!t||""===t||0===t.length)return"";let r=f(t);for(let t=0;t{i(r)}))})}function u(e,t){return function(e,t,r){return new Promise((n,i)=>{"string"==typeof e?e.startsWith("{")&&e.endsWith("}")?n(JSON.parse(e)):e.startsWith("http")?fetch(e,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{console.log("model data:",e),n(e)}):Object(a.c)(r,"/assets/minecraft/models/"+(t||"block")+"/"+e+".json").then(e=>{n(e)}):"object"==typeof e?n(e):(console.warn("Invalid model"),i())})}(e.name,e.type,t).then(r=>(function(e,t,r){return new Promise((a,n)=>{p(e,t,[],[],r,a,n)})})(r,e.name,t)).then(t=>(s(e.name+" merged:"),s(t),t.hasOwnProperty("elements")||"lava"!==e.name&&"water"!==e.name||(t.elements=[{from:[0,0,0],to:[16,16,16],faces:{down:{texture:"#particle",cullface:"down"},up:{texture:"#particle",cullface:"up"},north:{texture:"#particle",cullface:"north"},south:{texture:"#particle",cullface:"south"},west:{texture:"#particle",cullface:"west"},east:{texture:"#particle",cullface:"east"}}}]),t))}function c(e){return e.type+"__"+e.name}function f(e){let t=e.split(","),r={};for(let e=0;e{let n=[],i=[],o=Object.keys(e);for(let r=0;r{let a={};for(let e=0;e=0;t--)e=i()(e,r[t]);return n.unshift(t),e.hierarchy=n,void s(e)}let u=e.parent;delete e.parent,n.push(u),Object(a.c)(o,"/assets/minecraft/models/"+u+".json").then(a=>{let i=Object.assign({},e,a);p(i,t,r,n,o,s,l)}).catch(l)};function m(e){return e*(Math.PI/180)}function v(e){Object.keys(e).forEach((function(t){delete e[t]}))}},function(e,t,r){"use strict";t.a={head:[{left:{x:0,y:16,w:8,h:8,flipX:!1},front:{x:8,y:16,w:8,h:8},right:{x:16,y:16,w:8,h:8,flipX:!1},back:{x:24,y:16,w:8,h:8},top:{x:8,y:24,w:8,h:8},bottom:{x:16,y:24,w:8,h:8,flipX:!0,flipY:!0}},{left:{x:0,y:48,w:8,h:8,flipX:!1},front:{x:8,y:48,w:8,h:8},right:{x:16,y:48,w:8,h:8,flipX:!1},back:{x:24,y:48,w:8,h:8},top:{x:8,y:56,w:8,h:8},bottom:{x:16,y:56,w:8,h:8,flipX:!0,flipY:!0}}],body:[{left:{x:16,y:0,w:4,h:12,flipX:!0},front:{x:20,y:0,w:8,h:12},right:{x:28,y:0,w:4,h:12,flipX:!0},back:{x:32,y:0,w:8,h:12},top:{x:20,y:12,w:8,h:4},bottom:{x:28,y:12,w:8,h:4,flipY:!0,flipX:!0}},{left:{x:16,y:32,w:4,h:12,flipX:!1},front:{x:20,y:32,w:8,h:12},right:{x:28,y:32,w:4,h:12,flipX:!1},back:{x:32,y:32,w:8,h:12},top:{x:20,y:44,w:8,h:4},bottom:{x:28,y:44,w:8,h:4,flipY:!0,flipX:!0}}],rightArm:[{left:{x:40,y:0,w:4,h:12,flipX:!1},front:{x:44,y:0,w:4,h:12,flipX:!1},right:{x:48,y:0,w:4,h:12,flipX:!1},back:{x:52,y:0,w:4,h:12,flipX:!1},top:{x:44,y:12,w:4,h:4,flipX:!1},bottom:{x:48,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:32,y:0,w:4,h:12,flipX:!1},front:{x:36,y:0,w:4,h:12,sw:3,flipX:!1},right:{x:40,y:0,w:4,h:12,sx:39,flipX:!1},back:{x:44,y:0,w:4,h:12,sx:43,sw:3,flipX:!1},top:{x:36,y:12,w:4,h:4,sw:3,flipX:!1},bottom:{x:40,y:12,w:4,h:4,sx:39,sw:3,flipY:!0,flipX:!0}}],leftArm:[{left:{x:40,y:0,w:4,h:12,flipX:!1},front:{x:44,y:0,w:4,h:12,flipX:!1},right:{x:48,y:0,w:4,h:12,flipX:!1},back:{x:52,y:0,w:4,h:12,flipX:!1},top:{x:44,y:12,w:4,h:4,flipX:!1},bottom:{x:48,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:40,y:32,w:4,h:12,flipX:!1},front:{x:44,y:32,w:4,h:12,sw:3,flipX:!1},right:{x:48,y:32,w:4,h:12,sx:47,flipX:!1},back:{x:52,y:32,w:4,h:12,sx:51,sw:3,flipX:!1},top:{x:44,y:44,w:4,h:4,sw:3,flipX:!1},bottom:{x:48,y:44,w:4,h:4,sx:47,sw:3,flipY:!0,flipX:!0}}],rightLeg:[{left:{x:0,y:0,w:4,h:12,flipX:!1},front:{x:4,y:0,w:4,h:12,flipX:!1},right:{x:8,y:0,w:4,h:12,flipX:!1},back:{x:12,y:0,w:4,h:12},top:{x:4,y:12,w:4,h:4,flipX:!1},bottom:{x:8,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:16,y:0,w:4,h:12,flipX:!1},front:{x:20,y:0,w:4,h:12,flipX:!1},right:{x:24,y:0,w:4,h:12,flipX:!1},back:{x:28,y:0,w:4,h:12,flipX:!1},top:{x:20,y:12,w:4,h:4,flipX:!1},bottom:{x:24,y:12,w:4,h:4,flipY:!0,flipX:!0}}],leftLeg:[{left:{x:0,y:0,w:4,h:12,flipX:!1},front:{x:4,y:0,w:4,h:12,flipX:!1},right:{x:8,y:0,w:4,h:12,flipX:!1},back:{x:12,y:0,w:4,h:12,flipX:!0},top:{x:4,y:12,w:4,h:4,flipX:!1},bottom:{x:8,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:0,y:32,w:4,h:12,flipX:!1},front:{x:4,y:32,w:4,h:12,flipX:!1},right:{x:8,y:32,w:4,h:12,flipX:!1},back:{x:12,y:32,w:4,h:12,flipX:!1},top:{x:4,y:44,w:4,h:4,flipX:!1},bottom:{x:8,y:44,w:4,h:4,flipY:!0,flipX:!0}}],hat:{left:{x:32,y:48,w:8,h:8},front:{x:40,y:48,w:8,h:8},right:{x:48,y:48,w:8,h:8},back:{x:56,y:48,w:8,h:8},top:{x:40,y:56,w:8,h:8,flipX:!1},bottom:{x:48,y:56,w:8,h:8,flipY:!0,flipX:!0}},jacket:{left:{x:16,y:16,w:4,h:12},front:{x:20,y:16,w:8,h:12},right:{x:28,y:16,w:4,h:12},back:{x:32,y:16,w:8,h:12},top:{x:20,y:28,w:8,h:4},bottom:{x:28,y:28,w:8,h:4,flipY:!0,flipX:!0}},rightSleeve:{left:{x:48,y:0,w:4,h:12},front:{x:52,y:0,w:4,h:12,sw:3},right:{x:56,y:0,w:4,h:12,sx:55},back:{x:60,y:0,w:4,h:12,sx:59,sw:3},top:{x:52,y:12,w:4,h:4,sw:3},bottom:{x:56,y:12,w:4,h:4,sx:55,sw:3,flipY:!0,flipX:!0}},leftSleeve:{left:{x:40,y:16,w:4,h:12},front:{x:44,y:16,w:4,h:12,sw:3},right:{x:48,y:16,w:4,h:12,sx:47},back:{x:52,y:16,w:4,h:12,sx:51,sw:3},top:{x:44,y:28,w:4,h:4,sw:3},bottom:{x:48,y:28,w:4,h:4,sx:47,sw:3,flipY:!0,flipX:!0}},rightTrousers:{left:{x:0,y:0,w:4,h:12},front:{x:4,y:0,w:4,h:12},right:{x:8,y:0,w:4,h:12},back:{x:12,y:0,w:4,h:12},top:{x:4,y:12,w:4,h:4},bottom:{x:8,y:12,w:4,h:4,flipY:!0,flipX:!0}},leftTrousers:{left:{x:0,y:16,w:4,h:12},front:{x:4,y:16,w:4,h:12},right:{x:8,y:16,w:4,h:12},back:{x:12,y:16,w:4,h:12},top:{x:4,y:28,w:4,h:4},bottom:{x:8,y:28,w:4,h:4,flipY:!0,flipX:!0}},cape:{right:{x:0,y:5,w:1,h:16},front:{x:1,y:5,w:10,h:16},left:{x:11,y:5,w:1,h:16},back:{x:12,y:5,w:10,h:16},top:{x:1,y:21,w:10,h:1},bottom:{x:11,y:21,w:10,h:1}},capeRelative:{right:{x:0,y:15/32,w:1/64,h:.5},front:{x:1/64,y:15/32,w:10/64,h:.5},left:{x:11/64,y:15/32,w:1/64,h:.5},back:{x:.1875,y:15/32,w:10/64,h:.5},top:{x:1/64,y:31/32,w:10/64,h:1/32},bottom:{x:11/64,y:31/32,w:10/64,h:1/32}},capeOptifineRelative:{right:{x:0,y:10/44,w:2/92,h:32/44},front:{x:2/92,y:10/44,w:20/92,h:32/44},left:{x:22/92,y:10/44,w:2/92,h:32/44},back:{x:24/92,y:10/44,w:20/92,h:32/44},top:{x:2/92,y:42/44,w:20/92,h:2/44},bottom:{x:22/92,y:42/44,w:20/92,h:2/44}},capeOptifine:{right:{x:0,y:10,w:2,h:32},front:{x:2,y:10,w:20,h:32},left:{x:22,y:10,w:2,h:32},back:{x:24,y:10,w:20,h:32},top:{x:2,y:42,w:20,h:2},bottom:{x:22,y:42,w:20,h:2}},capeLabymodRelative:{right:{x:0,y:0,w:1/22,h:16/17},front:{x:1/22,y:0,w:10/22,h:16/17},left:{x:.5,y:0,w:1/22,h:16/17},back:{x:12/22,y:0,w:10/22,h:16/17},top:{x:1/22,y:16/17,w:10/22,h:1/17},bottom:{x:.5,y:16/17,w:10/22,h:1/17}}}},function(e,t,r){"use strict";r.d(t,"a",(function(){return i})),r.d(t,"d",(function(){return c})),r.d(t,"b",(function(){return f})),r.d(t,"e",(function(){return d})),r.d(t,"c",(function(){return h})),r.d(t,"f",(function(){return p})),r.d(t,"g",(function(){return m}));var a=r(11);const n=a("minerender"),i="https://assets.mcasset.cloud/1.13",o={},s={},l={},u={};function c(e,t,r,a){return new Promise((n,l)=>{!function e(t,r,a,n,l,u,c){let f="/assets/"+r+"/textures"+a+n+".png";if(o.hasOwnProperty(f))return"__invalid"===o[f]?void u():void l(o[f]);if(!s.hasOwnProperty(f)||0===s[f].length||c){let c=new XMLHttpRequest;c.open("GET",t+f,!0),c.responseType="arraybuffer",c.onloadend=function(){if(200===c.status){let e=new Uint8Array(c.response||c.responseText),t=String.fromCharCode.apply(null,e),r="data:image/png;base64,"+btoa(t);if(o[f]=r,s.hasOwnProperty(f))for(;s[f].length>0;){s[f].shift(0)[0](r)}}else if(i===t){if(o[f]="__invalid",s.hasOwnProperty(f))for(;s[f].length>0;){s[f].shift(0)[1]()}}else e(i,r,a,n,l,u,!0)},c.send(),s.hasOwnProperty(f)||(s[f]=[])}s[f].push([l,u])}(e,t,r,a,n,l)})}function f(e,t){return h(t,"/assets/minecraft/blockstates/"+e+".json")}function d(e,t){return h(t,"/assets/minecraft/textures/block/"+e+".png.mcmeta")}function h(e,t){return new Promise((r,a)=>{!function e(t,r,a,o,s){if(l.hasOwnProperty(r))return"__invalid"===l[r]?void o():void a(Object.assign({},l[r]));u.hasOwnProperty(r)&&0!==u[r].length&&!s||(n(t+r),fetch(t+r,{mode:"cors",redirect:"follow"}).then(e=>e.json()).then(e=>{if(n("json data:",e),l[r]=e,u.hasOwnProperty(r))for(;u[r].length>0;){let t=Object.assign({},e);u[r].shift(0)[0](t)}}).catch(n=>{if(console.warn(n),i===t){if(l[r]="__invalid",u.hasOwnProperty(r))for(;u[r].length>0;){u[r].shift(0)[1]()}}else e(i,r,a,o,!0)}),u.hasOwnProperty(r)||(u[r]=[]));u[r].push([a,o])}(e,t,r,a)})}function p(e,t,r){return 0===e?0:t/(r||16)*e}function m(e){let t,r,a,n=e.getContext("2d"),i=document.createElement("canvas").getContext("2d"),o=n.getImageData(0,0,e.width,e.height),s=o.data.length,l={top:null,left:null,right:null,bottom:null};for(t=0;t1)for(var r=1;r * @license MIT */ -var a=r(100),n=r(101),i=r(52);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(a)return V(e).length;t=(""+t).toLowerCase(),a=!0}}function m(e,t,r){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function v(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function g(e,t,r,a,n){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,a)),l.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,n);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,a,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,a,n){var i,o=1,s=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,d=0;dn&&(a=n):a=n;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");a>i/2&&(a=i/2);for(var o=0;o>8,n=r%256,i.push(n),i.push(a);return i}(t,e.length-r),e,r,a)}function S(e,t,r){return 0===t&&r===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[n+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[n+1],o=e[n+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[n+1],o=e[n+2],s=e[n+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),n+=f}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var r="",a=0;for(;a0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,a,n){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(a>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(i,o),u=this.slice(a,n),c=e.slice(t,r),f=0;fn)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;na)&&(r=a);for(var n="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,a,n,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function k(e,t,r,a){t<0&&(t=65535+t+1);for(var n=0,i=Math.min(e.length-r,2);n>>8*(a?n:1-n)}function I(e,t,r,a){t<0&&(t=4294967295+t+1);for(var n=0,i=Math.min(e.length-r,4);n>>8*(a?n:3-n)&255}function N(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,a,i){return i||N(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function U(e,t,r,a,i){return i||N(e,0,r,8),n.write(e,t,r,a,52,8),r+8}l.prototype.slice=function(e,t){var r,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t0&&(n*=256);)a+=this[e+--t]*n;return a},l.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=this[e],n=1,i=0;++i=(n*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=t,n=1,i=this[e+--a];a>0&&(n*=256);)i+=this[e+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,a){(e=+e,t|=0,r|=0,a)||R(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+n]=e/i&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,a){if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return a.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,a){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;rn(e,t))}class s extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e,Error.captureStackTrace(this,this.constructor.name)}}e.exports={getField:r,getFieldInfo:a,addErrorField:n,getCount:function(e,t,{count:n,countType:i},s){let l=0,u=0;return"number"==typeof n?l=n:void 0!==n?l=r(n,s):void 0!==i?({size:u,value:l}=o(()=>this.read(e,t,a(i),s),"$count")):l=0,{count:l,size:u}},sendCount:function(e,t,r,{count:n,countType:i},o){return void 0!==n&&e!==n||void 0!==i&&(r=this.write(e,t,r,a(i),o)),r},calcCount:function(e,{count:t,countType:r},n){return void 0===t&&void 0!==r?o(()=>this.sizeOf(e,a(r),n),"$count"):0},tryCatch:i,tryDoc:o,PartialReadError:class extends s{constructor(e){super(e),this.partialReadError=!0}}}},function(e,t,r){"use strict";function a(e,t,r){var a=r?" !== ":" === ",n=r?" || ":" && ",i=r?"!":"",o=r?"":"!";switch(e){case"null":return t+a+"null";case"array":return i+"Array.isArray("+t+")";case"object":return"("+i+t+n+"typeof "+t+a+'"object"'+n+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+a+'"number"'+n+o+"("+t+" % 1)"+n+t+a+t+")";default:return"typeof "+t+a+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:a,checkDataTypes:function(e,t){switch(e.length){case 1:return a(e[0],t,!0);default:var r="",n=i(e);for(var o in n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)r+=(r?" && ":"")+a(o,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],a=0;a=t)throw new Error("Cannot access property/index "+a+" levels up, current level is "+t);return r[t-a]}if(a>t)throw new Error("Cannot access data "+a+" levels up, current level is "+t);if(i="data"+(t-a||""),!n)return i}for(var s=i,u=n.split("/"),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,n,o,s;if("string"==typeof t&&(n="not ",t.substr(!o||o<0?0:+o,n.length)===n)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(a," ").concat(i(t,"type"));else{var l=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(a," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var n=r(68),i=r(72);r(6)(u,n);for(var o=a(i.prototype),s=0;sp||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,R=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),k=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,1),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var n=l.domElement===document?l.domElement.body:l.domElement;if(l.object instanceof a.PerspectiveCamera){var i=l.object.position;e.copy(i).sub(l.target);var o=e.length();o*=Math.tan(l.object.fov/2*Math.PI/180),R(2*t*o/n.clientHeight,l.object.matrix),k(2*r*o/n.clientHeight,l.object.matrix)}else l.object instanceof a.OrthographicCamera?(R(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),k(r*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object instanceof a.PerspectiveCamera?g/=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object instanceof a.PerspectiveCamera?g*=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(c),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}(e),h=d.TOUCH_DOLLY;break;case 3:if(!1===l.enablePan)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom)return;if(h!==d.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.subVectors(T,M),P.y>0?D(F()):P.y<0&&N(F()),M.copy(T),l.update()}(e);break;case 3:if(!1===l.enablePan)return;if(h!==d.TOUCH_PAN)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()}n.prototype=Object.create(a.EventDispatcher.prototype),n.prototype.constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var i=r(20),o=r(25),s=r.n(o),l=r(76),u=r.n(l),c=r(40),f=r(3);r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return m}));const d={showAxes:!1,showGrid:!1,autoResize:!1,controls:{enabled:!0,zoom:!0,rotate:!0,pan:!0,keys:!0},camera:{type:"perspective",x:20,y:35,z:20,target:[0,0,0]},canvas:{width:void 0,height:void 0},pauseHidden:!0,forceContext:!1,sendStats:!0};class h{constructor(e,t,r){this.element=r||document.body,this.options=Object.assign({},d,t,e),this.renderType="_Base_"}toImage(e,t){if(t||(t="image/png"),this._renderer){if(e){let e=document.createElement("canvas"),r=e.getContext("2d");return e.width=this._renderer.domElement.width,e.height=this._renderer.domElement.height,r.drawImage(this._renderer.domElement,0,0),Object(f.g)(e).toDataURL(t)}return this._renderer.domElement.toDataURL(t)}}toObj(){if(this._scene){return(new i.OBJExporter).parse(this._scene)}}toGLTF(e){return new Promise((t,r)=>{if(this._scene){(new i.GLTFExporter).parse(this._scene,e=>{t(e)},e)}else r()})}toPLY(e){if(this._scene){return(new i.PLYExporter).parse(this._scene,e)}}initScene(e,t){let r=this;if(console.log(" "),console.log("%c ","font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;"),console.log("MineRender/"+(r.renderType||r.constructor.name)+"/1.4.6"),console.log("PRODUCTION build"),console.log("Built @ 2021-02-01T16:10:49.105Z"),console.log(" "),r.options.sendStats){let e,t=!1;try{t=window.self!==window.top}catch(e){return!0}try{e=new URL(t?document.referrer:window.location).hostname}catch(e){console.warn("Failed to get hostname")}c.post({url:"https://minerender.org/stats.php",data:{action:"init",type:r.renderType,host:e,source:t?"iframe":"javascript"}})}let l,f=new a.Scene;r._scene=f,l="orthographic"===r.options.camera.type?new a.OrthographicCamera((r.options.canvas.width||window.innerWidth)/-2,(r.options.canvas.width||window.innerWidth)/2,(r.options.canvas.height||window.innerHeight)/2,(r.options.canvas.height||window.innerHeight)/-2,1,1e3):new a.PerspectiveCamera(75,(r.options.canvas.width||window.innerWidth)/(r.options.canvas.height||window.innerHeight),5,1e3),r._camera=l,r.options.camera.zoom&&(l.zoom=r.options.camera.zoom);let d=new a.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});r._renderer=d,d.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),d.setClearColor(0,0),d.setPixelRatio(window.devicePixelRatio),d.shadowMap.enabled=!0,d.shadowMap.type=a.PCFSoftShadowMap,r.element.appendChild(r._canvas=d.domElement);let h=new s.a(d);h.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),r._composer=h;let p=new i.SSAARenderPass(f,l);p.unbiased=!0,h.addPass(p);let m=new o.ShaderPass(o.CopyShader);m.renderToScreen=!0,h.addPass(m),r.options.autoResize&&(r._resizeListener=function(){let e=r.element&&r.element!==document.body?r.element.offsetWidth:window.innerWidth,t=r.element&&r.element!==document.body?r.element.offsetHeight:window.innerHeight;r._resize(e,t)},window.addEventListener("resize",r._resizeListener)),r._resize=function(e,t){"orthographic"===r.options.camera.type?(l.left=e/-2,l.right=e/2,l.top=t/2,l.bottom=t/-2):l.aspect=e/t,l.updateProjectionMatrix(),d.setSize(e,t),h.setSize(e,t)},r.options.showAxes&&f.add(new a.AxesHelper(50)),r.options.showGrid&&f.add(new a.GridHelper(100,100));let v=new a.AmbientLight(16777215);f.add(v);let g=new n(l,d.domElement);r._controls=g,g.enableZoom=r.options.controls.zoom,g.enableRotate=r.options.controls.rotate,g.enablePan=r.options.controls.pan,g.enableKeys=r.options.controls.keys,g.target.set(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]),l.position.x=r.options.camera.x,l.position.y=r.options.camera.y,l.position.z=r.options.camera.z,l.lookAt(new a.Vector3(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]));let y=function(){r._animId=requestAnimationFrame(y),r.onScreen&&("function"==typeof e&&e(),h.render())};r._animate=y,t||y(),r.onScreen=!0;let b="minerender-canvas-"+r._scene.uuid+"-"+Date.now();if(r._canvas.id=b,r.options.pauseHidden){r.onScreen=!1;let e=new u.a;r._onScreenObserver=e,e.on("enter","#"+b,(e,t)=>{r.onScreen=!0,r.options.forceContext&&r._renderer.forceContextRestore()}),e.on("leave","#"+b,(e,t)=>{r.onScreen=!1,r.options.forceContext&&r._renderer.forceContextLoss()})}}addToScene(e){let t=this;t._scene&&e&&(e.userData.renderType=t.renderType,t._scene.add(e))}clearScene(e,t){if(e||t)for(let r=this._scene.children.length-1;r>=0;r--){let a=this._scene.children[r];if(t){if(t(a))continue}e&&a.userData.renderType!==this.renderType||(p(a,!0),this._scene.remove(a))}else for(;this._scene.children.length>0;)this._scene.remove(this._scene.children[0])}dispose(){cancelAnimationFrame(this._animId),this._onScreenObserver&&this._onScreenObserver.destroy(),this.clearScene(),this._canvas.remove();let e=this.element;for(;e.firstChild;)e.removeChild(e.firstChild);this.options.autoResize&&window.removeEventListener("resize",this._resizeListener)}}function p(e,t){if(e&&(e.geometry&&e.geometry.dispose&&e.geometry.dispose(),e.material&&e.material.dispose&&e.material.dispose(),e.texture&&e.texture.dispose&&e.texture.dispose(),e.children)){let r=e.children;for(let e=0;e=0;t--)e.remove(r[t])}}function m(e,t){e=e.filter(e=>!!e);let r=new a.Geometry,n=[];for(let t=0;t0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function f(){for(var e=[],t=0;t0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=n[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=m(l,u);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;a--)this.removeListener(e,t[a]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(7).Buffer)},function(e){e.exports=JSON.parse('{"i8":{"enum":["i8"]},"u8":{"enum":["u8"]},"i16":{"enum":["i16"]},"u16":{"enum":["u16"]},"i32":{"enum":["i32"]},"u32":{"enum":["u32"]},"f32":{"enum":["f32"]},"f64":{"enum":["f64"]},"li8":{"enum":["li8"]},"lu8":{"enum":["lu8"]},"li16":{"enum":["li16"]},"lu16":{"enum":["lu16"]},"li32":{"enum":["li32"]},"lu32":{"enum":["lu32"]},"lf32":{"enum":["lf32"]},"lf64":{"enum":["lf64"]},"i64":{"enum":["i64"]},"li64":{"enum":["li64"]},"u64":{"enum":["u64"]},"lu64":{"enum":["lu64"]}}')},function(module,exports,__webpack_require__){ +var a=r(103),n=r(104),i=r(53);function o(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(a)return V(e).length;t=(""+t).toLowerCase(),a=!0}}function m(e,t,r){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return F(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function v(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function g(e,t,r,a,n){if(0===e.length)return-1;if("string"==typeof r?(a=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,a)),l.isBuffer(t))return 0===t.length?-1:y(e,t,r,a,n);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,a,n);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,a,n){var i,o=1,s=e.length,l=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var f=!0,d=0;dn&&(a=n):a=n;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");a>i/2&&(a=i/2);for(var o=0;o>8,n=r%256,i.push(n),i.push(a);return i}(t,e.length-r),e,r,a)}function S(e,t,r){return 0===t&&r===e.length?a.fromByteArray(e):a.fromByteArray(e.slice(t,r))}function M(e,t,r){r=Math.min(e.length,r);for(var a=[],n=t;n239?4:u>223?3:u>191?2:1;if(n+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(i=e[n+1]))&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[n+1],o=e[n+2],128==(192&i)&&128==(192&o)&&(l=(15&u)<<12|(63&i)<<6|63&o)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[n+1],o=e[n+2],s=e[n+3],128==(192&i)&&128==(192&o)&&128==(192&s)&&(l=(15&u)<<18|(63&i)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,a.push(c>>>10&1023|55296),c=56320|1023&c),a.push(c),n+=f}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var r="",a=0;for(;a0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,a,n){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===a&&(a=0),void 0===n&&(n=this.length),t<0||r>e.length||a<0||n>this.length)throw new RangeError("out of range index");if(a>=n&&t>=r)return 0;if(a>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(n>>>=0)-(a>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(i,o),u=this.slice(a,n),c=e.slice(t,r),f=0;fn)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var i=!1;;)switch(a){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return x(this,e,t,r);case"latin1":case"binary":return _(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),i=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(e,t,r){var a="";r=Math.min(e.length,r);for(var n=t;na)&&(r=a);for(var n="",i=t;ir)throw new RangeError("Trying to access beyond buffer length")}function k(e,t,r,a,n,i){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw new RangeError("Index out of range")}function R(e,t,r,a){t<0&&(t=65535+t+1);for(var n=0,i=Math.min(e.length-r,2);n>>8*(a?n:1-n)}function I(e,t,r,a){t<0&&(t=4294967295+t+1);for(var n=0,i=Math.min(e.length-r,4);n>>8*(a?n:3-n)&255}function N(e,t,r,a,n,i){if(r+a>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,a,i){return i||N(e,0,r,4),n.write(e,t,r,a,23,4),r+4}function U(e,t,r,a,i){return i||N(e,0,r,8),n.write(e,t,r,a,52,8),r+8}l.prototype.slice=function(e,t){var r,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t0&&(n*=256);)a+=this[e+--t]*n;return a},l.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=this[e],n=1,i=0;++i=(n*=128)&&(a-=Math.pow(2,8*t)),a},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||C(e,t,this.length);for(var a=t,n=1,i=this[e+--a];a>0&&(n*=256);)i+=this[e+--a]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,a){(e=+e,t|=0,r|=0,a)||k(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,i=0;for(this[t]=255&e;++i=0&&(i*=256);)this[t+n]=e/i&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):I(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}var i=0,o=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,a){if(e=+e,t|=0,!a){var n=Math.pow(2,8*r-1);k(this,e,t,r,n-1,-n)}var i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):I(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||k(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):I(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,a){if(r||(r=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t=0;--n)e[n+t]=this[n+r];else if(i<1e3||!l.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===a){(t-=3)>-1&&i.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(e){return a.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,a){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}).call(this,r(5))},function(e,t,r){"use strict";var a=r(22),n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var i=r(19);i.inherits=r(6);var o=r(54),s=r(34);i.inherits(f,o);for(var l=n(s.prototype),u=0;un(e,t))}class s extends Error{constructor(e){super(e),this.name=this.constructor.name,this.message=e,Error.captureStackTrace(this,this.constructor.name)}}e.exports={getField:r,getFieldInfo:a,addErrorField:n,getCount:function(e,t,{count:n,countType:i},s){let l=0,u=0;return"number"==typeof n?l=n:void 0!==n?l=r(n,s):void 0!==i?({size:u,value:l}=o(()=>this.read(e,t,a(i),s),"$count")):l=0,{count:l,size:u}},sendCount:function(e,t,r,{count:n,countType:i},o){return void 0!==n&&e!==n||void 0!==i&&(r=this.write(e,t,r,a(i),o)),r},calcCount:function(e,{count:t,countType:r},n){return void 0===t&&void 0!==r?o(()=>this.sizeOf(e,a(r),n),"$count"):0},tryCatch:i,tryDoc:o,PartialReadError:class extends s{constructor(e){super(e),this.partialReadError=!0}}}},function(e,t,r){"use strict";function a(e,t,r){var a=r?" !== ":" === ",n=r?" || ":" && ",i=r?"!":"",o=r?"":"!";switch(e){case"null":return t+a+"null";case"array":return i+"Array.isArray("+t+")";case"object":return"("+i+t+n+"typeof "+t+a+'"object"'+n+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+a+'"number"'+n+o+"("+t+" % 1)"+n+t+a+t+")";default:return"typeof "+t+a+'"'+e+'"'}}e.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:a,checkDataTypes:function(e,t){switch(e.length){case 1:return a(e[0],t,!0);default:var r="",n=i(e);for(var o in n.array&&n.object&&(r=n.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete n.null,delete n.array,delete n.object),n.number&&delete n.integer,n)r+=(r?" && ":"")+a(o,t,!0);return r}},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],a=0;a=t)throw new Error("Cannot access property/index "+a+" levels up, current level is "+t);return r[t-a]}if(a>t)throw new Error("Cannot access data "+a+" levels up, current level is "+t);if(i="data"+(t-a||""),!n)return i}for(var s=i,u=n.split("/"),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,n,o,s;if("string"==typeof t&&(n="not ",t.substr(!o||o<0?0:+o,n.length)===n)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(a," ").concat(i(t,"type"));else{var l=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(a," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var n=r(69),i=r(73);r(6)(u,n);for(var o=a(i.prototype),s=0;sp||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,k=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),R=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,1),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var n=l.domElement===document?l.domElement.body:l.domElement;if(l.object instanceof a.PerspectiveCamera){var i=l.object.position;e.copy(i).sub(l.target);var o=e.length();o*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*o/n.clientHeight,l.object.matrix),R(2*r*o/n.clientHeight,l.object.matrix)}else l.object instanceof a.OrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),R(r*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object instanceof a.PerspectiveCamera?g/=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object instanceof a.PerspectiveCamera?g*=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(c),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}(e),h=d.TOUCH_DOLLY;break;case 3:if(!1===l.enablePan)return;!function(e){A.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientWidth*l.rotateSpeed),L(2*Math.PI*_.y/t.clientHeight*l.rotateSpeed),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom)return;if(h!==d.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.subVectors(T,M),P.y>0?D(F()):P.y<0&&N(F()),M.copy(T),l.update()}(e);break;case 3:if(!1===l.enablePan)return;if(h!==d.TOUCH_PAN)return;!function(e){E.set(e.touches[0].pageX,e.touches[0].pageY),S.subVectors(E,A),I(S.x,S.y),A.copy(E),l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()}n.prototype=Object.create(a.EventDispatcher.prototype),n.prototype.constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var i=r(21),o=r(26),s=r.n(o),l=r(77),u=r.n(l),c=r(41),f=r(3);r.d(t,"b",(function(){return h})),r.d(t,"a",(function(){return p})),r.d(t,"c",(function(){return m}));const d={showAxes:!1,showGrid:!1,autoResize:!1,controls:{enabled:!0,zoom:!0,rotate:!0,pan:!0,keys:!0},camera:{type:"perspective",x:20,y:35,z:20,target:[0,0,0]},canvas:{width:void 0,height:void 0},pauseHidden:!0,forceContext:!1,sendStats:!0};class h{constructor(e,t,r){this.element=r||document.body,this.options=Object.assign({},d,t,e),this.renderType="_Base_"}toImage(e,t){if(t||(t="image/png"),this._renderer){if(e){let e=document.createElement("canvas"),r=e.getContext("2d");return e.width=this._renderer.domElement.width,e.height=this._renderer.domElement.height,r.drawImage(this._renderer.domElement,0,0),Object(f.g)(e).toDataURL(t)}return this._renderer.domElement.toDataURL(t)}}toObj(){if(this._scene){return(new i.OBJExporter).parse(this._scene)}}toGLTF(e){return new Promise((t,r)=>{if(this._scene){(new i.GLTFExporter).parse(this._scene,e=>{t(e)},e)}else r()})}toPLY(e){if(this._scene){return(new i.PLYExporter).parse(this._scene,e)}}initScene(e,t){let r=this;if(console.log(" "),console.log("%c ","font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;"),console.log("MineRender/"+(r.renderType||r.constructor.name)+"/1.4.7"),console.log("PRODUCTION build"),console.log("Built @ 2021-02-01T16:31:09.617Z"),console.log(" "),r.options.sendStats){let e,t=!1;try{t=window.self!==window.top}catch(e){return!0}try{e=new URL(t?document.referrer:window.location).hostname}catch(e){console.warn("Failed to get hostname")}c.post({url:"https://minerender.org/stats.php",data:{action:"init",type:r.renderType,host:e,source:t?"iframe":"javascript"}})}let l,f=new a.Scene;r._scene=f,l="orthographic"===r.options.camera.type?new a.OrthographicCamera((r.options.canvas.width||window.innerWidth)/-2,(r.options.canvas.width||window.innerWidth)/2,(r.options.canvas.height||window.innerHeight)/2,(r.options.canvas.height||window.innerHeight)/-2,1,1e3):new a.PerspectiveCamera(75,(r.options.canvas.width||window.innerWidth)/(r.options.canvas.height||window.innerHeight),5,1e3),r._camera=l,r.options.camera.zoom&&(l.zoom=r.options.camera.zoom);let d=new a.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});r._renderer=d,d.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),d.setClearColor(0,0),d.setPixelRatio(window.devicePixelRatio),d.shadowMap.enabled=!0,d.shadowMap.type=a.PCFSoftShadowMap,r.element.appendChild(r._canvas=d.domElement);let h=new s.a(d);h.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),r._composer=h;let p=new i.SSAARenderPass(f,l);p.unbiased=!0,h.addPass(p);let m=new o.ShaderPass(o.CopyShader);m.renderToScreen=!0,h.addPass(m),r.options.autoResize&&(r._resizeListener=function(){let e=r.element&&r.element!==document.body?r.element.offsetWidth:window.innerWidth,t=r.element&&r.element!==document.body?r.element.offsetHeight:window.innerHeight;r._resize(e,t)},window.addEventListener("resize",r._resizeListener)),r._resize=function(e,t){"orthographic"===r.options.camera.type?(l.left=e/-2,l.right=e/2,l.top=t/2,l.bottom=t/-2):l.aspect=e/t,l.updateProjectionMatrix(),d.setSize(e,t),h.setSize(e,t)},r.options.showAxes&&f.add(new a.AxesHelper(50)),r.options.showGrid&&f.add(new a.GridHelper(100,100));let v=new a.AmbientLight(16777215);f.add(v);let g=new n(l,d.domElement);r._controls=g,g.enableZoom=r.options.controls.zoom,g.enableRotate=r.options.controls.rotate,g.enablePan=r.options.controls.pan,g.enableKeys=r.options.controls.keys,g.target.set(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]),l.position.x=r.options.camera.x,l.position.y=r.options.camera.y,l.position.z=r.options.camera.z,l.lookAt(new a.Vector3(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]));let y=function(){r._animId=requestAnimationFrame(y),r.onScreen&&("function"==typeof e&&e(),h.render())};r._animate=y,t||y(),r.onScreen=!0;let b="minerender-canvas-"+r._scene.uuid+"-"+Date.now();if(r._canvas.id=b,r.options.pauseHidden){r.onScreen=!1;let e=new u.a;r._onScreenObserver=e,e.on("enter","#"+b,(e,t)=>{r.onScreen=!0,r.options.forceContext&&r._renderer.forceContextRestore()}),e.on("leave","#"+b,(e,t)=>{r.onScreen=!1,r.options.forceContext&&r._renderer.forceContextLoss()})}}addToScene(e){let t=this;t._scene&&e&&(e.userData.renderType=t.renderType,t._scene.add(e))}clearScene(e,t){if(e||t)for(let r=this._scene.children.length-1;r>=0;r--){let a=this._scene.children[r];if(t){if(t(a))continue}e&&a.userData.renderType!==this.renderType||(p(a,!0),this._scene.remove(a))}else for(;this._scene.children.length>0;)this._scene.remove(this._scene.children[0])}dispose(){cancelAnimationFrame(this._animId),this._onScreenObserver&&this._onScreenObserver.destroy(),this.clearScene(),this._canvas.remove();let e=this.element;for(;e.firstChild;)e.removeChild(e.firstChild);this.options.autoResize&&window.removeEventListener("resize",this._resizeListener)}}function p(e,t){if(e&&(e.geometry&&e.geometry.dispose&&e.geometry.dispose(),e.material&&e.material.dispose&&e.material.dispose(),e.texture&&e.texture.dispose&&e.texture.dispose(),e.children)){let r=e.children;for(let e=0;e=0;t--)e.remove(r[t])}}function m(e,t){e=e.filter(e=>!!e);let r=new a.Geometry,n=[];for(let t=0;t0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,s=l,console&&console.warn&&console.warn(s)}return e}function f(){for(var e=[],t=0;t0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=n[e];if(void 0===l)return!1;if("function"==typeof l)i(l,this,t);else{var u=l.length,c=m(l,u);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,n=i;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1=0;a--)this.removeListener(e,t[a]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(7).Buffer)},function(e){e.exports=JSON.parse('{"i8":{"enum":["i8"]},"u8":{"enum":["u8"]},"i16":{"enum":["i16"]},"u16":{"enum":["u16"]},"i32":{"enum":["i32"]},"u32":{"enum":["u32"]},"f32":{"enum":["f32"]},"f64":{"enum":["f64"]},"li8":{"enum":["li8"]},"lu8":{"enum":["lu8"]},"li16":{"enum":["li16"]},"lu16":{"enum":["lu16"]},"li32":{"enum":["li32"]},"lu32":{"enum":["lu32"]},"lf32":{"enum":["lf32"]},"lf64":{"enum":["lf64"]},"i64":{"enum":["i64"]},"li64":{"enum":["li64"]},"u64":{"enum":["u64"]},"lu64":{"enum":["lu64"]}}')},function(module,exports,__webpack_require__){ /*! * The three.js expansion library v0.92.0 * Collected by Jusfoun Visualization Department @@ -28,24 +28,24 @@ var a=r(100),n=r(101),i=r(52);function o(){return l.TYPED_ARRAY_SUPPORT?21474836 * The three.js LICENSE * http://threejs.org/license */ -!function(e,t){for(var r in t)e[r]=t[r]}(exports,function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){e.exports=__webpack_require__(0)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1};Object.assign(a.prototype,{setSize:function(e,t){},render:function(e,t,r,a,n){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(1),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t){o.default.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof n.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=n.UniformsUtils.clone(e.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new n.Scene,this.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)}}),t.default=s},function(e,t,r){!function(e){"use strict";function t(){}function r(e,r){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===r||r,this.encoder=new t}function a(){}function n(){}t.prototype.s2u=function(e){for(var t=this.s2uTable,r="",a=0;a=0&&n<=126||n>=161&&n<=223)&&a0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},a.prototype={constructor:a,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],a=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=a}},n.prototype.parsePmd=function(e,t){var a,n={},i=new r(e);return n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left",function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),function(){var e,t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r0&&(a.englishModelName=i.getSjisStringsAsUnicode(20),a.englishComment=i.getSjisStringsAsUnicode(256)),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneNames=[];for(var t=0;t=2.0 are supported. Use LegacyGLTFLoader instead.")):(m.extensionsUsed&&(m.extensionsUsed.indexOf(r.KHR_LIGHTS)>=0&&(p[r.KHR_LIGHTS]=new i(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_UNLIT)>=0&&(p[r.KHR_MATERIALS_UNLIT]=new o(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(p[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new d),m.extensionsUsed.indexOf(r.KHR_DRACO_MESH_COMPRESSION)>=0&&(p[r.KHR_DRACO_MESH_COMPRESSION]=new f(this.dracoLoader)),m.extensionsUsed.indexOf(r.MSFT_TEXTURE_DDS)>=0&&(p[r.MSFT_TEXTURE_DDS]=new n)),new U(m,p,{path:t||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse((function(e,t,r,a,n){l({scene:e,scenes:t,cameras:r,animations:a,asset:n})}),u))}};var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(){if(!a.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=new a.DDSLoader}function i(e){this.name=r.KHR_LIGHTS,this.lights={};var t=(e.extensions&&e.extensions[r.KHR_LIGHTS]||{}).lights||{};for(var n in t){var i,o=t[n],s=(new a.Color).fromArray(o.color);switch(o.type){case"directional":(i=new a.DirectionalLight(s)).target.position.set(0,0,1),i.add(i.target);break;case"point":i=new a.PointLight(s);break;case"spot":i=new a.SpotLight(s),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;case"ambient":i=new a.AmbientLight(s)}i&&(i.decay=2,void 0!==o.intensity&&(i.intensity=o.intensity),i.name=o.name||"light_"+n,this.lights[n]=i)}}function o(e){this.name=r.KHR_MATERIALS_UNLIT}o.prototype.getMaterialType=function(e){return a.MeshBasicMaterial},o.prototype.extendParams=function(e,t,r){var n=[];e.color=new a.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var o=i.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture.index))}return Promise.all(n)};var s="glTF",l=12,u={JSON:1313821514,BIN:5130562};function c(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,l);if(this.header={magic:a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,l),i=0;i",s).replace("#include ",l).replace("#include ",u).replace("#include ",c).replace("#include ",f);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new a.Color).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=d,e.uniforms=o,e.defines={STANDARD:""},e.color=new a.Color(1,1,1),e.opacity=1;var h=[];if(Array.isArray(n.diffuseFactor)){var p=n.diffuseFactor;e.color.fromArray(p),e.opacity=p[3]}if(void 0!==n.diffuseTexture&&h.push(r.assignTexture(e,"map",n.diffuseTexture.index)),e.emissive=new a.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new a.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var m=n.specularGlossinessTexture.index;h.push(r.assignTexture(e,"glossinessMap",m)),h.push(r.assignTexture(e,"specularMap",m))}return Promise.all(h)},createMaterial:function(e){var t=new a.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var r=this.specularGlossinessParams,a=0,n=r.length;a=2&&(n[i+1]=e.getY(i)),r>=3&&(n[i+2]=e.getZ(i)),r>=4&&(n[i+3]=e.getW(i));return new a.BufferAttribute(n,r,e.normalized)}return e.clone()}function U(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new t,this.primitiveCache=[],this.textureLoader=new a.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function j(e,t,r){var a=t.attributes;for(var n in a){var i=T[n],o=r[a[n]];i&&(i in e.attributes||e.addAttribute(i,o))}void 0===t.indices||e.index||e.setIndex(r[t.indices])}return U.prototype.parse=function(e,t){var r=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then((function(t){var a=t.scenes||[],n=a[r.scene||0],i=t.animations||[],o=r.asset,s=t.cameras||[];e(n,a,s,i,o)})).catch(t)},U.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},i=0,o=t.length;i=2&&o.setY(T,A[E*l+1]),l>=3&&o.setZ(T,A[E*l+2]),l>=4&&o.setW(T,A[E*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},U.prototype.loadTexture=function(e){var t,n=this,i=this.json,o=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=i.textures[e],c=u.extensions||{},f=(t=c[r.MSFT_TEXTURE_DDS]?i.images[c[r.MSFT_TEXTURE_DDS].source]:i.images[u.source]).uri,d=!1;return void 0!==t.bufferView&&(f=n.getDependency("bufferView",t.bufferView).then((function(e){d=!0;var r=new Blob([e],{type:t.mimeType});return f=l.createObjectURL(r)}))),Promise.resolve(f).then((function(e){var t=a.Loader.Handlers.get(e);return t||(t=c[r.MSFT_TEXTURE_DDS]?n.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(r,a){t.load(R(e,o.path),r,void 0,a)}))})).then((function(e){!0===d&&l.revokeObjectURL(f),e.flipY=!1,void 0!==u.name&&(e.name=u.name),c[r.MSFT_TEXTURE_DDS]||(e.format=void 0!==u.format?E[u.format]:a.RGBAFormat),void 0!==u.internalFormat&&e.format!==E[u.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==u.type?S[u.type]:a.UnsignedByteType;var t=(i.samplers||{})[u.sampler]||{};return e.magFilter=_[t.magFilter]||a.LinearFilter,e.minFilter=_[t.minFilter]||a.LinearMipMapLinearFilter,e.wrapS=A[t.wrapS]||a.RepeatWrapping,e.wrapT=A[t.wrapT]||a.RepeatWrapping,e}))},U.prototype.assignTexture=function(e,t,r){return this.getDependency("texture",r).then((function(r){e[t]=r}))},U.prototype.loadMaterial=function(e){this.json;var t,n=this.extensions,i=this.json.materials[e],o={},s=i.extensions||{},l=[];if(s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(i),l.push(u.extendParams(o,i,this))}else if(s[r.KHR_MATERIALS_UNLIT]){var c=n[r.KHR_MATERIALS_UNLIT];t=c.getMaterialType(i),l.push(c.extendParams(o,i,this))}else{t=a.MeshStandardMaterial;var f=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(f.baseColorFactor)){var d=f.baseColorFactor;o.color.fromArray(d),o.opacity=d[3]}if(void 0!==f.baseColorTexture&&l.push(this.assignTexture(o,"map",f.baseColorTexture.index)),o.metalness=void 0!==f.metallicFactor?f.metallicFactor:1,o.roughness=void 0!==f.roughnessFactor?f.roughnessFactor:1,void 0!==f.metallicRoughnessTexture){var h=f.metallicRoughnessTexture.index;l.push(this.assignTexture(o,"metalnessMap",h)),l.push(this.assignTexture(o,"roughnessMap",h))}}!0===i.doubleSided&&(o.side=a.DoubleSide);var p=i.alphaMode||O;return p===C?o.transparent=!0:(o.transparent=!1,p===L&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"normalMap",i.normalTexture.index)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale&&o.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"aoMap",i.occlusionTexture.index)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==a.MeshBasicMaterial&&l.push(this.assignTexture(o,"emissiveMap",i.emissiveTexture.index)),Promise.all(l).then((function(){var e;return e=t===a.ShaderMaterial?n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==i.name&&(e.name=i.name),e.normalScale&&(e.normalScale.y=-e.normalScale.y),e.map&&(e.map.encoding=a.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=a.sRGBEncoding),i.extras&&(e.userData=i.extras),e}))},U.prototype.loadGeometries=function(e){var t=this,n=this.extensions,i=this.primitiveCache;return this.getDependencies("accessor").then((function(o){for(var s=[],l=0,u=e.length;l1))return _;_.name+="_"+c,s.add(_)}return s}))}))},U.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new a.PerspectiveCamera(a.Math.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new a.OrthographicCamera(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar)),void 0!==r.name&&(t.name=r.name),r.extras&&(t.userData=r.extras),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},U.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},U.prototype.loadAnimation=function(e){this.json;var t=this.json.animations[e];return this.getMultiDependencies(["accessor","node"]).then((function(r){for(var n=[],i=0,o=t.channels.length;i1&&(s.name+="_instance_"+i[o.mesh]++)}else if(void 0!==o.camera)s=e.cameras[o.camera];else if(o.extensions&&o.extensions[r.KHR_LIGHTS]&&void 0!==o.extensions[r.KHR_LIGHTS].light){s=t[r.KHR_LIGHTS].lights[o.extensions[r.KHR_LIGHTS].light]}else s=new a.Object3D;if(void 0!==o.name&&(s.name=a.PropertyBinding.sanitizeNodeName(o.name)),o.extras&&(s.userData=o.extras),void 0!==o.matrix){var d=new a.Matrix4;d.fromArray(o.matrix),s.applyMatrix(d)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return s}))},U.prototype.loadScene=function(){function e(t,r,n,i,o){var s=i[t],l=n.nodes[t];if(void 0!==l.skin)for(var u=!0===s.isGroup?s.children:[s],c=0,f=u.length;c(n=s.indexOf("\n"))&&i=e.byteLength||!(a=r(e)))return t(1,"no header found");if(!(n=a.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(u.valid|=1,u.programtype=n[1],u.string+=a+"\n";!1!==(a=r(e));)if(u.string+=a+"\n","#"!==a.charAt(0)){if((n=a.match(i))&&(u.gamma=parseFloat(n[1],10)),(n=a.match(o))&&(u.exposure=parseFloat(n[1],10)),(n=a.match(s))&&(u.valid|=2,u.format=n[1]),(n=a.match(l))&&(u.valid|=4,u.height=parseInt(n[1],10),u.width=parseInt(n[2],10)),2&u.valid&&4&u.valid)break}else u.comments+=a+"\n";return 2&u.valid?4&u.valid?u:t(3,"missing image size specifier"):t(3,"missing format specifier")}(n);if(-1!==i){var o=i.width,s=i.height,l=function(e,r,a){var n,i,o,s,l,u,c,f,d,h,p,m,v,g=r,y=a;if(g<8||g>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(g!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(n=new Uint8Array(4*r*a))||!n.length)return t(4,"unable to allocate buffer space");for(i=0,o=0,f=4*g,v=new Uint8Array(4),u=new Uint8Array(f);y>0&&oe.byteLength)return t(1);if(v[0]=e[o++],v[1]=e[o++],v[2]=e[o++],v[3]=e[o++],2!=v[0]||2!=v[1]||(v[2]<<8|v[3])!=g)return t(3,"bad rgbe scanline format");for(c=0;c128)&&(s-=128),0===s||c+s>f)return t(3,"bad scanline data");if(m)for(l=e[o++],d=0;d0){var x=[];for(var w in v)h=v[w],x[w]=h.name;m="Adding mesh(es) ("+x.length+": "+x+") from input mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)"}else m="Not adding mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)";var _=this.callbacks.onProgress;t.isValid(_)&&_(new CustomEvent("MeshBuilderEvent",{detail:{type:"progress",modelName:e.params.meshName,text:m,numericalValue:e.progress.numericalValue}}));return v},r.prototype.updateMaterials=function(e){var r,a,i=e.materials.materialCloneInstructions;if(t.isValid(i)){var o=i.materialNameOrg,s=this.materials[o];if(t.isValid(o)){r=s.clone(),a=i.materialName,r.name=a;var l=i.materialProperties;for(var u in l)r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&(r[u]=l[u]);this.materials[a]=r}else console.warn('Requested material "'+o+'" is not available!')}var c=e.materials.serializedMaterials;if(t.isValid(c)&&Object.keys(c).length>0){var f,d=new n.MaterialLoader;for(a in c)f=c[a],t.isValid(f)&&(r=d.parse(f),this.logging.enabled&&console.info('De-serialized material with name "'+a+'" will be added.'),this.materials[a]=r)}if(c=e.materials.runtimeMaterials,t.isValid(c)&&Object.keys(c).length>0)for(a in c)r=c[a],this.logging.enabled&&console.info('Material with name "'+a+'" will be added.'),this.materials[a]=r},r.prototype.getMaterialsJSON=function(){var e,t={};for(var r in this.materials)e=this.materials[r],t[r]=e.toJSON();return t},r.prototype.getMaterials=function(){return this.materials},r}(),s.WorkerRunnerRefImpl=function(){function e(){var e=this;self.addEventListener("message",(function(t){e.processMessage(t.data)}),!1)}return e.prototype.applyProperties=function(e,t){var r,a,n;for(r in t)a="set"+r.substring(0,1).toLocaleUpperCase()+r.substring(1),n=t[r],"function"==typeof e[a]?e[a](n):e.hasOwnProperty(r)&&(e[r]=n)},e.prototype.processMessage=function(e){if("run"===e.cmd){var t={callbackMeshBuilder:function(e){self.postMessage(e)},callbackProgress:function(t){e.logging.enabled&&e.logging.debug&&console.debug("WorkerRunner: progress: "+t)}},r=new Parser;"function"==typeof r.setLogging&&r.setLogging(e.logging.enabled,e.logging.debug),this.applyProperties(r,e.params),this.applyProperties(r,e.materials),this.applyProperties(r,t),r.workerScope=self,r.parse(e.data.input,e.data.options),e.logging.enabled&&console.log("WorkerRunner: Run complete!"),t.callbackMeshBuilder({cmd:"complete",msg:"WorkerRunner completed run."})}else console.error("WorkerRunner: Received unknown command: "+e.cmd)},e}(),s.WorkerSupport=function(){var e="2.2.0",t=s.Validator,r=function(){function e(){this._reset()}return e.prototype._reset=function(){this.logging={enabled:!0,debug:!1},this.worker=null,this.runnerImplName=null,this.callbacks={meshBuilder:null,onLoad:null},this.terminateRequested=!1,this.queuedMessage=null,this.started=!1,this.forceCopy=!1},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.setForceCopy=function(e){this.forceCopy=!0===e},e.prototype.initWorker=function(e,t){this.runnerImplName=t;var r=new Blob([e],{type:"application/javascript"});this.worker=new Worker(o.URL.createObjectURL(r)),this.worker.onmessage=this._receiveWorkerMessage,this.worker.runtimeRef=this,this._postMessage()},e.prototype._receiveWorkerMessage=function(e){var t=e.data;switch(t.cmd){case"meshData":case"materialData":case"imageData":this.runtimeRef.callbacks.meshBuilder(t);break;case"complete":this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run is complete. Terminating application on request!"),this.runtimeRef._terminate());break;case"error":console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Reported error: "+t.msg),this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run reported error. Terminating application on request!"),this.runtimeRef._terminate());break;default:console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Received unknown command: "+t.cmd)}},e.prototype.setCallbacks=function(e,r){this.callbacks.meshBuilder=t.verifyInput(e,this.callbacks.meshBuilder),this.callbacks.onLoad=t.verifyInput(r,this.callbacks.onLoad)},e.prototype.run=function(e){if(t.isValid(this.queuedMessage))console.warn("Already processing message. Rejecting new run instruction");else{if(this.queuedMessage=e,this.started=!0,!t.isValid(this.callbacks.meshBuilder))throw'Unable to run as no "MeshBuilder" callback is set.';if(!t.isValid(this.callbacks.onLoad))throw'Unable to run as no "onLoad" callback is set.';"run"!==e.cmd&&(e.cmd="run"),t.isValid(e.logging)?(e.logging.enabled=!0===e.logging.enabled,e.logging.debug=!0===e.logging.debug):e.logging={enabled:!0,debug:!1},this._postMessage()}},e.prototype._postMessage=function(){var e;t.isValid(this.queuedMessage)&&t.isValid(this.worker)&&(this.queuedMessage.data.input instanceof ArrayBuffer?(e=this.forceCopy?this.queuedMessage.data.input.slice(0):this.queuedMessage.data.input,this.worker.postMessage(this.queuedMessage,[e])):this.worker.postMessage(this.queuedMessage))},e.prototype.setTerminateRequested=function(e){this.terminateRequested=!0===e,this.terminateRequested&&t.isValid(this.worker)&&!t.isValid(this.queuedMessage)&&this.started&&(this.logging.enabled&&console.info("Worker is terminated immediately as it is not running!"),this._terminate())},e.prototype._terminate=function(){this.worker.terminate(),this._reset()},e}();function a(){if(console.info("Using THREE.LoaderSupport.WorkerSupport version: "+e),this.logging={enabled:!0,debug:!1},void 0===o.Worker)throw"This browser does not support web workers!";if(void 0===o.Blob)throw"This browser does not support Blob!";if("function"!=typeof o.URL.createObjectURL)throw"This browser does not support Object creation from URL!";this.loaderWorker=new r}a.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t,this.loaderWorker.setLogging(this.logging.enabled,this.logging.debug)},a.prototype.setForceWorkerDataCopy=function(e){this.loaderWorker.setForceCopy(e)},a.prototype.validate=function(e,r,a,o,u){if(!t.isValid(this.loaderWorker.worker)){this.logging.enabled&&(console.info("WorkerSupport: Building worker code..."),console.time("buildWebWorkerCode")),t.isValid(u)?this.logging.enabled&&console.info('WorkerSupport: Using "'+u.name+'" as Runner class for worker.'):(u=s.WorkerRunnerRefImpl,this.logging.enabled&&console.info('WorkerSupport: Using DEFAULT "THREE.LoaderSupport.WorkerRunnerRefImpl" as Runner class for worker.'));var c=e(i,l);c+="var Parser = "+r+";\n\n",c+=l(u.name,u),c+="new "+u.name+"();\n\n";var f=this;if(t.isValid(a)&&a.length>0){var d="";!function e(t,r){if(0===r.length)f.loaderWorker.initWorker(d+c,u.name),f.logging.enabled&&console.timeEnd("buildWebWorkerCode");else{var a=new n.FileLoader;a.setPath(t),a.setResponseType("text"),a.load(r[0],(function(a){d+=a,e(t,r)})),r.shift()}}(o,a)}else this.loaderWorker.initWorker(c,u.name),this.logging.enabled&&console.timeEnd("buildWebWorkerCode")}},a.prototype.setCallbacks=function(e,t){this.loaderWorker.setCallbacks(e,t)},a.prototype.run=function(e){this.loaderWorker.run(e)},a.prototype.setTerminateRequested=function(e){this.loaderWorker.setTerminateRequested(e)};var i=function(e,t){var r,a=e+" = {\n";for(var n in t)"string"==typeof(r=t[n])||r instanceof String?a+="\t"+n+': "'+(r=(r=r.replace("\n","\\n")).replace("\r","\\r"))+'",\n':r instanceof Array?a+="\t"+n+": ["+r+"],\n":Number.isInteger(r)?a+="\t"+n+": "+r+",\n":"function"==typeof r&&(a+="\t"+n+": "+r+",\n");return a+="}\n\n"},l=function(e,r,a,n,i){var o,s,l="",u=t.isValid(a)?a:r.name;for(var c in i=t.verifyInput(i,[]),r.prototype)o=r.prototype[c],"constructor"===c?s="\tfunction "+u+o.toString().replace("function","")+";\n\n":"function"==typeof o&&i.indexOf(c)<0&&(l+="\t"+u+".prototype."+c+" = "+o.toString()+";\n\n");l+="\treturn "+u+";\n",l+="})();\n\n";var f="";return t.isValid(n)&&(f+="\n",f+=u+".prototype = Object.create( "+n+".prototype );\n",f+=u+".constructor = "+u+";\n",f+="\n"),t.isValid(s)?l=e+" = (function () {\n\n"+f+s+l:(s=e+" = (function () {\n\n",l=(s+=f+"\t"+r.prototype.constructor.toString()+"\n\n")+l),l};return a}(),s.WorkerDirector=function(){var e="2.2.0",t=s.Validator,r=16,a=8192;function i(n){if(console.info("Using THREE.LoaderSupport.WorkerDirector version: "+e),this.logging={enabled:!0,debug:!1},this.maxQueueSize=a,this.maxWebWorkers=r,this.crossOrigin=null,!t.isValid(n))throw"Provided invalid classDef: "+n;this.workerDescription={classDef:n,globalCallbacks:{},workerSupports:{},forceWorkerDataCopy:!0},this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0,this.callbackOnFinishedProcessing=null}return i.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},i.prototype.getMaxQueueSize=function(){return this.maxQueueSize},i.prototype.getMaxWebWorkers=function(){return this.maxWebWorkers},i.prototype.setCrossOrigin=function(e){this.crossOrigin=e},i.prototype.setForceWorkerDataCopy=function(e){this.workerDescription.forceWorkerDataCopy=!0===e},i.prototype.prepareWorkers=function(e,i,o){t.isValid(e)&&(this.workerDescription.globalCallbacks=e),this.maxQueueSize=Math.min(i,a),this.maxWebWorkers=Math.min(o,r),this.maxWebWorkers=Math.min(this.maxWebWorkers,this.maxQueueSize),this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0;for(var s=0;s0&&this.instructionQueuePointer0},i.prototype.processQueue=function(){var e,t;for(var r in this.workerDescription.workerSupports)(t=this.workerDescription.workerSupports[r]).inUse||(this.instructionQueuePointer=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},i[c]=r;else if(r)if("ka"===u||"kd"===u||"ks"===u){var f=c.split(a,3);r[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else r[u]=c}}var d=new n.MaterialCreator(this.texturePath||this.path,this.materialOptions);return d.setCrossOrigin(this.crossOrigin),d.setManager(this.manager),d.setMaterials(i),d}},(n.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:a.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:a.RepeatWrapping}).prototype={constructor:n.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var r in e){var a=e[r],n={};for(var i in t[r]=n,a){var o=!0,s=a[i],l=i.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(n[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,r=this.materialsInfo[e],n={name:e,side:this.side};function i(e,r){if(!n[e]){var a,i,o=t.getTextureParams(r,n),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(i=o.url)||""===i?"":/^https?:\/\//i.test(i)?i:a+i));s.repeat.copy(o.scale),s.offset.copy(o.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,n[e]=s}}for(var o in r){var s,l=r[o];if(""!==l)switch(o.toLowerCase()){case"kd":n.color=(new a.Color).fromArray(l);break;case"ks":n.specular=(new a.Color).fromArray(l);break;case"map_kd":i("map",l);break;case"map_ks":i("specularMap",l);break;case"norm":i("normalMap",l);break;case"map_bump":case"bump":i("bumpMap",l);break;case"ns":n.shininess=parseFloat(l);break;case"d":(s=parseFloat(l))<1&&(n.opacity=s,n.transparent=!0);break;case"tr":s=parseFloat(l),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var r,n={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},i=e.split(/\s+/);return(r=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),(r=i.indexOf("-s"))>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),(r=i.indexOf("-o"))>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n},loadTexture:function(e,t,r,n,i){var o,s=a.Loader.Handlers.get(e),l=void 0!==this.manager?this.manager:a.DefaultLoadingManager;return null===s&&(s=new a.TextureLoader(l)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,r,n,i),void 0!==t&&(o.mapping=t),o}},t.default=n},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _three=__webpack_require__(0),THREE=_interopRequireWildcard(_three);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var Volume=function(e,t,r,a,n){if(arguments.length>0){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,a){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(n);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(n);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(n);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(n);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(n);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(n);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw"Error in THREE.Volume constructor : this type is not supported in JavaScript";case"Float32":case"float32":case"float":this.data=new Float32Array(n);break;case"Float64":case"float64":case"double":this.data=new Float64Array(n);break;default:this.data=new Uint8Array(n)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw"Error in THREE.Volume constructor, lengths are not matching arrayBuffer size"}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new THREE.Matrix3,this.matrix.identity();var i=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return i},set:function(e){i=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});var o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[]};Volume.prototype={constructor:Volume,getData:function(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]},access:function(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e},reverseAccess:function(e){var t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]},map:function(e,t){var r=this.data.length;t=t||this;for(var a=0;a.9})),jDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[1]))>.9})),kDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[2]))>.9})),argumentsWithInversion=["volume.xLength-1-","volume.yLength-1-","volume.zLength-1-"],argArray=[iDirection,jDirection,kDirection].map((function(e,t){return(e.dot(base[t])>0?"":argumentsWithInversion[t])+(e===axisInIJK?"IJKIndex":e.argVar)})),argString=argArray.join(",");return sliceAccess=eval("(function sliceAccess (i,j) {return volume.access( "+argString+");})"),{iLength:iLength,jLength:jLength,sliceAccess:sliceAccess,matrix:planeMatrix,planeWidth:planeWidth,planeHeight:planeHeight}},extractSlice:function(e,t){var r=new THREE.VolumeSlice(this,t,e);return this.sliceList.push(r),r},repaintAllSlices:function(){return this.sliceList.forEach((function(e){e.repaint()})),this},computeMinMax:function(){var e=1/0,t=-1/0,r=this.data.length,a=0;for(a=0;a","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","float l = linearToRelativeLuminance( texel.rgb );","gl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","uniform sampler2D luminanceMap;","#else","uniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","#ifdef ADAPTED_LUMINANCE","float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","#else","float fLumAvg = averageLuminance;","#endif","float fLumPixel = linearToRelativeLuminance( vColor );","float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","return fLumCompressed * vColor;","}","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-e*e/(2*t*t))}var r,a,n,i,o=2*Math.ceil(3*e)+1;for(o>25&&(o=25),i=.5*(o-1),a=new Array(o),n=0,r=0;r","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","vec2 aspectcorrect = vec2( 1.0, aspect );","float viewZ = getViewZ( getDepth( vUv ) );","float factor = ( focus + viewZ );","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},tSize:{value:new a.Vector2(256,256)},center:{value:new a.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float dx = rand( vUv + time );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","if(byp<1) {","vec2 p = vUv;","float xs = floor(gl_FragCoord.x / 0.5);","float ys = floor(gl_FragCoord.y / 0.5);","vec4 normal = texture2D (tDisp, p*seed*seed);","if(p.ydistortion_x-col_s*seed) {","if(seed_x>0.){","p.y = 1. - (p.y + distortion_y);","}","else {","p.y = distortion_y;","}","}","if(p.xdistortion_y-col_s*seed) {","if(seed_y>0.){","p.x=distortion_x;","}","else {","p.x = 1. - (p.x + distortion_x);","}","}","p.x+=normal.x*seed_x*(seed/5.);","p.y+=normal.y*seed_y*(seed/5.);","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, p + offset);","vec4 cga = texture2D(tDiffuse, p);","vec4 cb = texture2D(tDiffuse, p - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","gl_FragColor = gl_FragColor+ snow;","}","else {","gl_FragColor=texture2D (tDiffuse, vUv);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","vUV = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","return a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","return sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","float dist = hypot( coord.x - p.x, coord.y - p.y );","float rad = channel;","if ( shape == SHAPE_DOT ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","} else if ( shape == SHAPE_ELLIPSE ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","if ( dist != 0.0 ) {","float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","}","} else if ( shape == SHAPE_LINE ) {","rad = pow( abs( rad ), 1.5) * rad_max;","float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","dist = hypot( normal.x * dot_p, normal.y * dot_p );","} else if ( shape == SHAPE_SQUARE ) {","float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","float sin_t = abs( sin( theta ) );","float cos_t = abs( cos( theta ) );","rad = pow( abs( rad ), 1.4 );","rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","}","return rad - dist;","}","struct Cell {","vec2 normal;","vec2 p1;","vec2 p2;","vec2 p3;","vec2 p4;","float samp2;","float samp1;","float samp3;","float samp4;","};","vec4 getSample( vec2 point ) {","vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","float step = PI2 / float( samples );","float dist = radius * 0.66;","for ( int i = 0; i < samples; ++i ) {","float r = base + step * float( i );","vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","}","tex /= float( samples ) + 1.0;","return tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","if ( channel == 0 ) {","c.samp1 = getSample( c.p1 ).r;","c.samp2 = getSample( c.p2 ).r;","c.samp3 = getSample( c.p3 ).r;","c.samp4 = getSample( c.p4 ).r;","} else if (channel == 1) {","c.samp1 = getSample( c.p1 ).g;","c.samp2 = getSample( c.p2 ).g;","c.samp3 = getSample( c.p3 ).g;","c.samp4 = getSample( c.p4 ).g;","} else {","c.samp1 = getSample( c.p1 ).b;","c.samp3 = getSample( c.p3 ).b;","c.samp2 = getSample( c.p2 ).b;","c.samp4 = getSample( c.p4 ).b;","}","dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","res = clamp( res, 0.0, 1.0 );","return res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","Cell c;","vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","float threshold = step * 0.5;","float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","float offset_normal = mod( hypot( offset.x, offset.y ), step );","float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","c.normal = n;","c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","if ( scatter != 0.0 ) {","float off_mag = scatter * threshold * 0.5;","float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","c.p1.x += cos( off_angle ) * off_mag;","c.p1.y += sin( off_angle ) * off_mag;","}","float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","c.p2.x = c.p1.x - n.x * normal_step;","c.p2.y = c.p1.y - n.y * normal_step;","c.p3.x = c.p1.x + n.y * line_step;","c.p3.y = c.p1.y - n.x * line_step;","c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","return c;","}","float blendColour( float a, float b, float t ) {","if ( blendingMode == BLENDING_LINEAR ) {","return blend( a, b, 1.0 - t );","} else if ( blendingMode == BLENDING_ADD ) {","return blend( a, min( 1.0, a + b ), t );","} else if ( blendingMode == BLENDING_MULTIPLY ) {","return blend( a, max( 0.0, a * b ), t );","} else if ( blendingMode == BLENDING_LIGHTER ) {","return blend( a, max( a, b ), t );","} else if ( blendingMode == BLENDING_DARKER ) {","return blend( a, min( a, b ), t );","} else {","return blend( a, b, 1.0 - t );","}","}","void main() {","if ( ! disable ) {","vec2 p = vec2( vUV.x * width, vUV.y * height );","vec2 origin = vec2( 0, 0 );","float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","Cell cell_r = getReferenceCell( p, origin, rotateR, radius );","Cell cell_g = getReferenceCell( p, origin, rotateG, radius );","Cell cell_b = getReferenceCell( p, origin, rotateB, radius );","float r = getDotColour( cell_r, p, 0, rotateR, aa );","float g = getDotColour( cell_g, p, 1, rotateG, aa );","float b = getDotColour( cell_b, p, 2, rotateB, aa );","vec4 colour = texture2D( tDiffuse, vUV );","r = blendColour( r, colour.r, blending );","g = blendColour( g, colour.g, blending );","b = blendColour( b, colour.b, blending );","if ( greyscale ) {","r = g = b = (r + b + g) / 3.0;","}","gl_FragColor = vec4( r, g, b, 1.0 );","} else {","gl_FragColor = texture2D( tDiffuse, vUV );","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{type:"t",value:null},tDiffuse:{type:"t",value:null},tNormal:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},cameraProjectionMatrix:{type:"m4",value:new a.Matrix4},cameraInverseProjectionMatrix:{type:"m4",value:new a.Matrix4},scale:{type:"f",value:1},intensity:{type:"f",value:.1},bias:{type:"f",value:.5},minResolution:{type:"f",value:0},kernelRadius:{type:"f",value:100},randomSeed:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},sampleUvOffsets:{type:"v2v",value:[new a.Vector2(0,0)]},sampleWeights:{type:"1fv",value:[1]},tDepth:{type:"t",value:null},cameraNear:{type:"f",value:10},cameraFar:{type:"f",value:1e3},depthCutoff:{type:"f",value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","float depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={createSampleWeights:function(e,t){for(var r=function(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)},a=[],n=0;n<=e;n++)a.push(r(n,t));return a},createSampleOffsets:function(e,t){for(var r=[],a=0;a<=e;a++)r.push(t.clone().multiplyScalar(a));return r},configure:function(e,t,r,n){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=a.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=a.createSampleWeights(t,r),e.needsUpdate=!0}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","t = abs( C - Ctop );","delta.y = max( max( t.r, t.g ), t.b );","vec2 edges = step( threshold, delta.xy );","if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){n.default.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==o?o:0,void 0===i.default&&console.error("THREE.SSAARenderPass relies on THREE.CopyShader");var s=i.default;this.copyUniforms=a.UniformsUtils.clone(s.uniforms),this.copyMaterial=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.camera2=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene2=new a.Scene,this.quad2=new a.Mesh(new a.PlaneBufferGeometry(2,2),this.copyMaterial),this.quad2.frustumCulled=!1,this.scene2.add(this.quad2)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var n=s.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1;var o=e.getClearColor().getHex(),l=e.getClearAlpha(),u=1/n.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;for(var c=r.width,f=r.height,d=0;d","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );","float gg = fract( coord.t * ( size.y / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float readDepth( const in vec2 coord ) {","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","#ifdef USE_LOGDEPTHBUF","float logz = unpackRGBAToDepth( texture2D( tDepth, coord ) );","float w = pow(2.0, (logz / logDepthBufFC)) - 1.0;","float z = (logz / w) + 1.0;","#else","float z = unpackRGBAToDepth( texture2D( tDepth, coord ) );","#endif","return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 8.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + radius * vv;","vec2 coord2 = vUv - radius * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float ao = 0.0;","float dz = 1.0 / float( samples );","float l = 0.0;","float z = 1.0 - dz / 2.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","float pw = cos( l ) * r;","float ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{type:"t",value:null},luminosityThreshold:{type:"f",value:1},smoothWidth:{type:"f",value:1},defaultColor:{type:"c",value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(0)},defaultOpacity:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","gl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var n=r(40);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}));var i=r(48);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}));var o=r(90);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}));var s=r(112);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})}));var l=r(144);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VRControls=t.TransformControls=t.TrackballControls=t.PointerLockControls=t.OrthographicTrackballControls=t.OrbitControls=t.FlyControls=t.FirstPersonControls=t.EditorControls=t.DragControls=t.DeviceOrientationControls=void 0;var a=p(r(29)),n=p(r(30)),i=p(r(31)),o=p(r(32)),s=p(r(33)),l=p(r(34)),u=p(r(35)),c=p(r(36)),f=p(r(37)),d=p(r(38)),h=p(r(39));function p(e){return e&&e.__esModule?e:{default:e}}t.DeviceOrientationControls=a.default,t.DragControls=n.default,t.EditorControls=i.default,t.FirstPersonControls=o.default,t.FlyControls=s.default,t.OrbitControls=l.default,t.OrthographicTrackballControls=u.default,t.PointerLockControls=c.default,t.TrackballControls=f.default,t.TransformControls=d.default,t.VRControls=h.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r,n,i,o,s=function(e){t.deviceOrientation=e},l=function(){t.screenOrientation=window.orientation||0},u=(r=new a.Vector3(0,0,1),n=new a.Euler,i=new a.Quaternion,o=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),function(e,t,a,s,l){n.set(a,t,-s,"YXZ"),e.setFromEuler(n),e.multiply(o),e.multiply(i.setFromAxisAngle(r,-l))});this.connect=function(){l(),window.addEventListener("orientationchange",l,!1),window.addEventListener("deviceorientation",s,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",l,!1),window.removeEventListener("deviceorientation",s,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var r=e.alpha?a.Math.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?a.Math.degToRad(e.beta):0,i=e.gamma?a.Math.degToRad(e.gamma):0,o=t.screenOrientation?a.Math.degToRad(t.screenOrientation):0;u(t.object.quaternion,r,n,i,o)}}},this.dispose=function(){t.disconnect()},this.connect()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t,r){if(e instanceof a.Camera){console.warn("THREE.DragControls: Constructor now expects ( objects, camera, domElement )");var n=e;e=t,t=n}var i=new a.Plane,o=new a.Raycaster,s=new a.Vector2,l=new a.Vector3,u=new a.Vector3,c=null,f=null,d=this;function h(){r.addEventListener("mousemove",m,!1),r.addEventListener("mousedown",v,!1),r.addEventListener("mouseup",g,!1),r.addEventListener("mouseleave",g,!1),r.addEventListener("touchmove",y,!1),r.addEventListener("touchstart",b,!1),r.addEventListener("touchend",w,!1)}function p(){r.removeEventListener("mousemove",m,!1),r.removeEventListener("mousedown",v,!1),r.removeEventListener("mouseup",g,!1),r.removeEventListener("mouseleave",g,!1),r.removeEventListener("touchmove",y,!1),r.removeEventListener("touchstart",b,!1),r.removeEventListener("touchend",w,!1)}function m(a){a.preventDefault();var n=r.getBoundingClientRect();if(s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c});o.setFromCamera(s,t);var h=o.intersectObjects(e);if(h.length>0){var p=h[0].object;i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),p.position),f!==p&&(d.dispatchEvent({type:"hoveron",object:p}),r.style.cursor="pointer",f=p)}else null!==f&&(d.dispatchEvent({type:"hoveroff",object:f}),r.style.cursor="auto",f=null)}function v(a){a.preventDefault(),o.setFromCamera(s,t);var n=o.intersectObjects(e);n.length>0&&(c=n[0].object,o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function g(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}function y(e){e.preventDefault(),e=e.changedTouches[0];var a=r.getBoundingClientRect();if(s.x=(e.clientX-a.left)/a.width*2-1,s.y=-(e.clientY-a.top)/a.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c})}function b(a){a.preventDefault(),a=a.changedTouches[0];var n=r.getBoundingClientRect();s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t);var f=o.intersectObjects(e);f.length>0&&(c=f[0].object,i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),c.position),o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function w(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}h(),this.enabled=!0,this.activate=h,this.deactivate=p,this.dispose=function(){p()},this.setObjects=function(){console.error("THREE.DragControls: setObjects() has been removed.")},this.on=function(e,t){console.warn("THREE.DragControls: on() has been deprecated. Use addEventListener() instead."),d.addEventListener(e,t)},this.off=function(e,t){console.warn("THREE.DragControls: off() has been deprecated. Use removeEventListener() instead."),d.removeEventListener(e,t)},this.notify=function(e){console.error("THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead."),d.dispatchEvent({type:e})}};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){t=void 0!==t?t:document,this.enabled=!0,this.center=new a.Vector3,this.panSpeed=.001,this.zoomSpeed=.001,this.rotationSpeed=.005;var r=this,n=new a.Vector3,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2},o=i.NONE,s=this.center,l=new a.Matrix3,u=new a.Vector2,c=new a.Vector2,f=new a.Spherical,d={type:"change"};function h(e){!1!==r.enabled&&(0===e.button?o=i.ROTATE:1===e.button?o=i.ZOOM:2===e.button&&(o=i.PAN),c.set(e.clientX,e.clientY),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",m,!1),t.addEventListener("mouseout",m,!1),t.addEventListener("dblclick",m,!1))}function p(e){if(!1!==r.enabled){u.set(e.clientX,e.clientY);var t=u.x-c.x,n=u.y-c.y;o===i.ROTATE?r.rotate(new a.Vector3(-t*r.rotationSpeed,-n*r.rotationSpeed,0)):o===i.ZOOM?r.zoom(new a.Vector3(0,0,n)):o===i.PAN&&r.pan(new a.Vector3(-t,n,0)),c.set(e.clientX,e.clientY)}}function m(e){t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),o=i.NONE}function v(e){e.preventDefault(),r.zoom(new a.Vector3(0,0,e.deltaY))}function g(e){e.preventDefault()}this.focus=function(t){var n,i=(new a.Box3).setFromObject(t);!1===i.isEmpty()?(s.copy(i.getCenter()),n=i.getBoundingSphere().radius):(s.setFromMatrixPosition(t.matrixWorld),n=.1);var o=new a.Vector3(0,0,1);o.applyQuaternion(e.quaternion),o.multiplyScalar(4*n),e.position.copy(s).add(o),r.dispatchEvent(d)},this.pan=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.panSpeed),t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),s.add(t),r.dispatchEvent(d)},this.zoom=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.zoomSpeed),t.length()>a||(t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),r.dispatchEvent(d))},this.rotate=function(t){n.copy(e.position).sub(s),f.setFromVector3(n),f.theta+=t.x,f.phi+=t.y,f.makeSafe(),n.setFromSpherical(f),e.position.copy(s).add(n),e.lookAt(s),r.dispatchEvent(d)},this.dispose=function(){t.removeEventListener("contextmenu",g,!1),t.removeEventListener("mousedown",h,!1),t.removeEventListener("wheel",v,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),t.removeEventListener("touchstart",x,!1),t.removeEventListener("touchmove",_,!1)},t.addEventListener("contextmenu",g,!1),t.addEventListener("mousedown",h,!1),t.addEventListener("wheel",v,!1);var y=[new a.Vector3,new a.Vector3,new a.Vector3],b=[new a.Vector3,new a.Vector3,new a.Vector3],w=null;function x(e){if(!1!==r.enabled){switch(e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0);break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0),w=y[0].distanceTo(y[1])}b[0].copy(y[0]),b[1].copy(y[1])}}function _(e){if(!1!==r.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0),r.rotate(y[0].sub(o(y[0],b)).multiplyScalar(-r.rotationSpeed));break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0);var t=y[0].distanceTo(y[1]);r.zoom(new a.Vector3(0,0,w-t)),w=t;var n=y[0].clone().sub(o(y[0],b)),i=y[1].clone().sub(o(y[1],b));n.x=-n.x,i.x=-i.x,r.pan(n.add(i).multiplyScalar(.5))}b[0].copy(y[0]),b[1].copy(y[1])}function o(e,t){var r=t[0];for(var a in t)r.distanceTo(e)>t[a].distanceTo(e)&&(r=t[a]);return r}}t.addEventListener("touchstart",x,!1),t.addEventListener("touchmove",_,!1)};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e){e.preventDefault()}this.object=e,this.target=new a.Vector3(0,0,0),this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.lookSpeed=.005,this.lookVertical=!0,this.autoForward=!1,this.activeLook=!0,this.heightSpeed=!1,this.heightCoef=1,this.heightMin=0,this.heightMax=1,this.constrainVertical=!1,this.verticalMin=0,this.verticalMax=Math.PI,this.autoSpeedFactor=0,this.mouseX=0,this.mouseY=0,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.moveForward=!1,this.moveBackward=!1,this.moveLeft=!1,this.moveRight=!1,this.mouseDragOn=!1,this.viewHalfX=0,this.viewHalfY=0,this.domElement!==document&&this.domElement.setAttribute("tabindex",-1),this.handleResize=function(){this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)},this.onMouseDown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0},this.onMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1},this.onMouseMove=function(e){this.domElement===document?(this.mouseX=e.pageX-this.viewHalfX,this.mouseY=e.pageY-this.viewHalfY):(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)},this.onKeyDown=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0}},this.onKeyUp=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}},this.update=function(e){if(!1!==this.enabled){if(this.heightSpeed){var t=a.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;var r=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(r+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(r),this.moveLeft&&this.object.translateX(-r),this.moveRight&&this.object.translateX(r),this.moveUp&&this.object.translateY(r),this.moveDown&&this.object.translateY(-r);var n=e*this.lookSpeed;this.activeLook||(n=0);var i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon+=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*i),this.lat=Math.max(-85,Math.min(85,this.lat)),this.phi=a.Math.degToRad(90-this.lat),this.theta=a.Math.degToRad(this.lon),this.constrainVertical&&(this.phi=a.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax));var o=this.target,s=this.object.position;o.x=s.x+100*Math.sin(this.phi)*Math.cos(this.theta),o.y=s.y+100*Math.cos(this.phi),o.z=s.z+100*Math.sin(this.phi)*Math.sin(this.theta),this.object.lookAt(o)}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",r,!1),this.domElement.removeEventListener("mousedown",i,!1),this.domElement.removeEventListener("mousemove",n,!1),this.domElement.removeEventListener("mouseup",o,!1),window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",l,!1)};var n=u(this,this.onMouseMove),i=u(this,this.onMouseDown),o=u(this,this.onMouseUp),s=u(this,this.onKeyDown),l=u(this,this.onKeyUp);function u(e,t){return function(){t.apply(e,arguments)}}this.domElement.addEventListener("contextmenu",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mouseup",o,!1),window.addEventListener("keydown",s,!1),window.addEventListener("keyup",l,!1),this.handleResize()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e,t){return function(){t.apply(e,arguments)}}function n(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this.tmpQuaternion=new a.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new a.Vector3(0,0,0),this.rotationVector=new a.Vector3(0,0,0),this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)},this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),r=t.size[0]/2,a=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-a)/a,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){var t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order)},this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",n,!1),this.domElement.removeEventListener("mousedown",o,!1),this.domElement.removeEventListener("mousemove",i,!1),this.domElement.removeEventListener("mouseup",s,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",u,!1)};var i=r(this,this.mousemove),o=r(this,this.mousedown),s=r(this,this.mouseup),l=r(this,this.keydown),u=r(this,this.keyup);this.domElement.addEventListener("contextmenu",n,!1),this.domElement.addEventListener("mousemove",i,!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mouseup",s,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",u,!1),this.updateMovementVector(),this.updateRotationVector()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),h=d.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&h===d.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),y.set(0,0,0)),g=1,!!(b||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,R=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),k=function(){var e=new a.Vector3;return function(t,r){!0===l.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var a=l.domElement===document?l.domElement.body:l.domElement;if(l.object.isPerspectiveCamera){var n=l.object.position;e.copy(n).sub(l.target);var i=e.length();i*=Math.tan(l.object.fov/2*Math.PI/180),R(2*t*i/a.clientHeight,l.object.matrix),k(2*r*i/a.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(R(t*(l.object.right-l.object.left)/l.object.zoom/a.clientWidth,l.object.matrix),k(r*(l.object.top-l.object.bottom)/l.object.zoom/a.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object.isPerspectiveCamera?g/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object.isPerspectiveCamera?g*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(c),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);A.set(n,i)}}(e),h=d.TOUCH_DOLLY_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;if(h!==d.TOUCH_DOLLY_PAN)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.set(0,Math.pow(T.y/M.y,l.zoomSpeed)),N(P.y),M.copy(T)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);E.set(n,i),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E)}l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.radius=0,this.rotateSpeed=1,this.zoomSpeed=1.2,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.keys=[65,83,68],this.target=new a.Vector3;var i=!0,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector3,c=new a.Vector3,f=new a.Vector2,d=new a.Vector2,h=0,p=0,m=new a.Vector2,v=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom;var g={type:"change"},y={type:"start"},b={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}this.radius=.5*Math.min(this.screen.width,this.screen.height),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var w,x,_,A,E,S,M=(w=new a.Vector2,function(e,t){return w.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),w}),T=function(){var e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(a,i){n.set((a-.5*r.screen.width-r.screen.left)/r.radius,(.5*r.screen.height+r.screen.top-i)/r.radius,0);var o=n.length();return r.noRoll?o1?n.normalize():n.z=Math.sqrt(1-o*o),l.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(n.y),e.add(t.copy(r.object.up).cross(l).setLength(n.x)),e.add(l.setLength(n.z)),e}}();function P(e){!1!==r.enabled&&(window.removeEventListener("keydown",P),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function F(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",P,!1))}function O(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(m.copy(M(e.pageX,e.pageY)),v.copy(m)):(f.copy(M(e.pageX,e.pageY)),d.copy(f)):(u.copy(T(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",L,!1),document.addEventListener("mouseup",C,!1),r.dispatchEvent(y))}function L(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||v.copy(M(e.pageX,e.pageY)):d.copy(M(e.pageX,e.pageY)):c.copy(T(e.pageX,e.pageY)))}function C(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",C),r.dispatchEvent(b))}function R(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),f.y+=.01*e.deltaY,r.dispatchEvent(y),r.dispatchEvent(b))}function k(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,u.copy(T(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;case 2:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=h=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(M(i,s)),v.copy(m);break;default:o=n.NONE}r.dispatchEvent(y)}}function I(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(i,s));break;default:o=n.NONE}}function N(e){if(!1!==r.enabled){switch(e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;case 2:h=p=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,a=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(t,a)),m.copy(v)}o=n.NONE,r.dispatchEvent(b)}}function D(e){e.preventDefault()}this.rotateCamera=(x=new a.Vector3,_=new a.Quaternion,function(){var e=Math.acos(u.dot(c)/u.length()/c.length());e&&(x.crossVectors(u,c).normalize(),e*=r.rotateSpeed,_.setFromAxisAngle(x,-e),l.applyQuaternion(_),r.object.up.applyQuaternion(_),c.applyQuaternion(_),r.staticMoving?u.copy(c):(_.setFromAxisAngle(x,e*(r.dynamicDampingFactor-1)),u.applyQuaternion(_)),i=!0)}),this.zoomCamera=function(){if(o===n.TOUCH_ZOOM_PAN){var e=p/h;h=p,r.object.zoom*=e,i=!0}else{e=1+(d.y-f.y)*r.zoomSpeed;Math.abs(e-1)>1e-6&&e>0&&(r.object.zoom/=e,r.staticMoving?f.copy(d):f.y+=(d.y-f.y)*this.dynamicDampingFactor,i=!0)}},this.panCamera=(A=new a.Vector2,E=new a.Vector3,S=new a.Vector3,function(){if(A.copy(v).sub(m),A.lengthSq()){var e=(r.object.right-r.object.left)/r.object.zoom,t=(r.object.top-r.object.bottom)/r.object.zoom;A.x*=e,A.y*=t,S.copy(l).cross(r.object.up).setLength(A.x),S.add(E.copy(r.object.up).setLength(A.y)),r.object.position.add(S),r.target.add(S),r.staticMoving?m.copy(v):m.add(A.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)),i=!0}}),this.update=function(){l.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||(r.zoomCamera(),i&&r.object.updateProjectionMatrix()),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,l),r.object.lookAt(r.target),i&&(r.dispatchEvent(g),i=!1)},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.left=r.left0,r.object.right=r.right0,r.object.top=r.top0,r.object.bottom=r.bottom0,r.object.lookAt(r.target),r.dispatchEvent(g),i=!1},this.dispose=function(){this.domElement.removeEventListener("contextmenu",D,!1),this.domElement.removeEventListener("mousedown",O,!1),this.domElement.removeEventListener("wheel",R,!1),this.domElement.removeEventListener("touchstart",k,!1),this.domElement.removeEventListener("touchend",N,!1),this.domElement.removeEventListener("touchmove",I,!1),document.removeEventListener("mousemove",L,!1),document.removeEventListener("mouseup",C,!1),window.removeEventListener("keydown",P,!1),window.removeEventListener("keyup",F,!1)},this.domElement.addEventListener("contextmenu",D,!1),this.domElement.addEventListener("mousedown",O,!1),this.domElement.addEventListener("wheel",R,!1),this.domElement.addEventListener("touchstart",k,!1),this.domElement.addEventListener("touchend",N,!1),this.domElement.addEventListener("touchmove",I,!1),window.addEventListener("keydown",P,!1),window.addEventListener("keyup",F,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;e.rotation.set(0,0,0);var r=new a.Object3D;r.add(e);var n=new a.Object3D;n.position.y=10,n.add(r);var i,o,s=Math.PI/2,l=function(e){if(!1!==t.enabled){var a=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;n.rotation.y-=.002*a,r.rotation.x-=.002*i,r.rotation.x=Math.max(-s,Math.min(s,r.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",l,!1)},document.addEventListener("mousemove",l,!1),this.enabled=!1,this.getObject=function(){return n},this.getDirection=(i=new a.Vector3(0,0,-1),o=new a.Euler(0,0,0,"YXZ"),function(e){return o.set(r.rotation.x,n.rotation.y,0),e.copy(i).applyEuler(o),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new a.Vector3;var i=new a.Vector3,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector2,c=new a.Vector2,f=new a.Vector3,d=0,h=new a.Vector2,p=new a.Vector2,m=0,v=0,g=new a.Vector2,y=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var b={type:"change"},w={type:"start"},x={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var _,A,E,S,M,T,P,F,O,L,C,R=(_=new a.Vector2,function(e,t){return _.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),_}),k=function(){var e=new a.Vector2;return function(t,a){return e.set((t-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-a))/r.screen.width),e}}();function I(e){!1!==r.enabled&&(window.removeEventListener("keydown",I),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function N(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",I,!1))}function D(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(g.copy(R(e.pageX,e.pageY)),y.copy(g)):(h.copy(R(e.pageX,e.pageY)),p.copy(h)):(c.copy(k(e.pageX,e.pageY)),u.copy(c)),document.addEventListener("mousemove",U,!1),document.addEventListener("mouseup",j,!1),r.dispatchEvent(w))}function U(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||y.copy(R(e.pageX,e.pageY)):p.copy(R(e.pageX,e.pageY)):(u.copy(c),c.copy(k(e.pageX,e.pageY))))}function j(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",j),r.dispatchEvent(x))}function B(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:h.y-=.025*e.deltaY;break;case 1:h.y-=.01*e.deltaY;break;default:h.y-=25e-5*e.deltaY}r.dispatchEvent(w),r.dispatchEvent(x)}}function V(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,c.copy(k(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;default:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=m=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;g.copy(R(i,s)),y.copy(g)}r.dispatchEvent(w)}}function z(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:u.copy(c),c.copy(k(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=Math.sqrt(t*t+a*a);var n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;y.copy(R(n,i))}}function G(e){if(!1!==r.enabled){switch(e.touches.length){case 0:o=n.NONE;break;case 1:o=n.TOUCH_ROTATE,c.copy(k(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c)}r.dispatchEvent(x)}}function H(e){!1!==r.enabled&&e.preventDefault()}this.rotateCamera=(E=new a.Vector3,S=new a.Quaternion,M=new a.Vector3,T=new a.Vector3,P=new a.Vector3,F=new a.Vector3,function(){F.set(c.x-u.x,c.y-u.y,0),(A=F.length())?(l.copy(r.object.position).sub(r.target),M.copy(l).normalize(),T.copy(r.object.up).normalize(),P.crossVectors(T,M).normalize(),T.setLength(c.y-u.y),P.setLength(c.x-u.x),F.copy(T.add(P)),E.crossVectors(F,l).normalize(),A*=r.rotateSpeed,S.setFromAxisAngle(E,A),l.applyQuaternion(S),r.object.up.applyQuaternion(S),f.copy(E),d=A):!r.staticMoving&&d&&(d*=Math.sqrt(1-r.dynamicDampingFactor),l.copy(r.object.position).sub(r.target),S.setFromAxisAngle(f,d),l.applyQuaternion(S),r.object.up.applyQuaternion(S)),u.copy(c)}),this.zoomCamera=function(){var e;o===n.TOUCH_ZOOM_PAN?(e=m/v,m=v,l.multiplyScalar(e)):(1!==(e=1+(p.y-h.y)*r.zoomSpeed)&&e>0&&l.multiplyScalar(e),r.staticMoving?h.copy(p):h.y+=(p.y-h.y)*this.dynamicDampingFactor)},this.panCamera=(O=new a.Vector2,L=new a.Vector3,C=new a.Vector3,function(){O.copy(y).sub(g),O.lengthSq()&&(O.multiplyScalar(l.length()*r.panSpeed),C.copy(l).cross(r.object.up).setLength(O.x),C.add(L.copy(r.object.up).setLength(O.y)),r.object.position.add(C),r.target.add(C),r.staticMoving?g.copy(y):g.add(O.subVectors(y,g).multiplyScalar(r.dynamicDampingFactor)))}),this.checkDistances=function(){r.noZoom&&r.noPan||(l.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,l.setLength(r.maxDistance)),h.copy(p)),l.lengthSq()1e-6&&(r.dispatchEvent(b),i.copy(r.object.position))},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(b),i.copy(r.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",H,!1),this.domElement.removeEventListener("mousedown",D,!1),this.domElement.removeEventListener("wheel",B,!1),this.domElement.removeEventListener("touchstart",V,!1),this.domElement.removeEventListener("touchend",G,!1),this.domElement.removeEventListener("touchmove",z,!1),document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",I,!1),window.removeEventListener("keyup",N,!1)},this.domElement.addEventListener("contextmenu",H,!1),this.domElement.addEventListener("mousedown",D,!1),this.domElement.addEventListener("wheel",B,!1),this.domElement.addEventListener("touchstart",V,!1),this.domElement.addEventListener("touchend",G,!1),this.domElement.addEventListener("touchmove",z,!1),window.addEventListener("keydown",I,!1),window.addEventListener("keyup",N,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){var e=function(e){a.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.side=a.FrontSide,this.transparent=!0,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(e.prototype=Object.create(a.MeshBasicMaterial.prototype)).constructor=e;var t=function(e){a.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.transparent=!0,this.linewidth=1,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(t.prototype=Object.create(a.LineBasicMaterial.prototype)).constructor=t;var r=new e({visible:!1,transparent:!1}),n=function(){this.init=function(){a.Object3D.call(this),this.handles=new a.Object3D,this.pickers=new a.Object3D,this.planes=new a.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new a.PlaneBufferGeometry(50,50,2,2),t=new a.MeshBasicMaterial({visible:!1,side:a.DoubleSide}),r={XY:new a.Mesh(e,t),YZ:new a.Mesh(e,t),XZ:new a.Mesh(e,t),XYZE:new a.Mesh(e,t)};for(var n in this.activePlane=r.XYZE,r.YZ.rotation.set(0,Math.PI/2,0),r.XZ.rotation.set(-Math.PI/2,0,0),r)r[n].name=n,this.planes.add(r[n]),this.planes[n]=r[n];var i=function(e,t){for(var r in e)for(n=e[r].length;n--;){var a=e[r][n][0],i=e[r][n][1],o=e[r][n][2];a.name=r,a.renderOrder=1/0,i&&a.position.set(i[0],i[1],i[2]),o&&a.rotation.set(o[0],o[1],o[2]),t.add(a)}};i(this.handleGizmos,this.handles),i(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof a.Mesh){e.updateMatrix();var t=e.geometry.clone();t.applyMatrix(e.matrix),e.geometry=t,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))},this.highlight=function(e){this.traverse((function(t){t.material&&t.material.highlight&&(t.name===e?t.material.highlight(!0):t.material.highlight(!1))}))}};(n.prototype=Object.create(a.Object3D.prototype)).constructor=n,n.prototype.update=function(e,t){var r=new a.Vector3(0,0,0),n=new a.Vector3(0,1,0),i=new a.Matrix4;this.traverse((function(a){-1!==a.name.search("E")?a.quaternion.setFromRotationMatrix(i.lookAt(t,r,n)):-1===a.name.search("X")&&-1===a.name.search("Y")&&-1===a.name.search("Z")||a.quaternion.setFromEuler(e)}))};var i=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.CylinderGeometry(0,.05,.2,12,1,!1));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),new e({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),r)]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()};(i.prototype=Object.create(n.prototype)).constructor=i;var o=function(){n.call(this);var e=function(e,t,r){var n=new a.BufferGeometry,i=[];r=r||1;for(var o=0;o<=64*r;++o)"x"===t&&i.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&i.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&i.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return n.addAttribute("position",new a.Float32BufferAttribute(i,3)),n};this.handleGizmos={X:[[new a.Line(new e(1,"x",.5),new t({color:16711680}))]],Y:[[new a.Line(new e(1,"y",.5),new t({color:65280}))]],Z:[[new a.Line(new e(1,"z",.5),new t({color:255}))]],E:[[new a.Line(new e(1.25,"z",1),new t({color:13421568}))]],XYZE:[[new a.Line(new e(1,"z",1),new t({color:7895160}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusBufferGeometry(1.25,.12,2,24),r)]],XYZE:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,2,24),r)]]},this.pickerGizmos.XYZE[0][0].visible=!1,this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){n.prototype.update.apply(this,arguments);var r=new a.Matrix4,i=new a.Euler(0,0,1),o=new a.Quaternion,s=new a.Vector3(1,0,0),l=new a.Vector3(0,1,0),u=new a.Vector3(0,0,1),c=new a.Quaternion,f=new a.Quaternion,d=new a.Quaternion,h=t.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),r.makeRotationFromQuaternion(o).getInverse(r),h.applyMatrix4(r),this.traverse((function(e){o.setFromEuler(i),"X"===e.name&&(c.setFromAxisAngle(s,Math.atan2(-h.y,h.z)),o.multiplyQuaternions(o,c),e.quaternion.copy(o)),"Y"===e.name&&(f.setFromAxisAngle(l,Math.atan2(h.x,h.z)),o.multiplyQuaternions(o,f),e.quaternion.copy(o)),"Z"===e.name&&(d.setFromAxisAngle(u,Math.atan2(h.y,h.x)),o.multiplyQuaternions(o,d),e.quaternion.copy(o))}))},this.init()};(o.prototype=Object.create(n.prototype)).constructor=o;var s=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.BoxGeometry(.125,.125,.125));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.125,.125,.125),new e({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.4,.4,.4),r)]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()};(s.prototype=Object.create(n.prototype)).constructor=s;var l=function(e,t){a.Object3D.call(this),t=void 0!==t?t:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var r=this,n="translate",l=!1,u={translate:new i,rotate:new o,scale:new s};for(var c in u){var f=u[c];f.visible=c===n,this.add(f)}var d={type:"change"},h={type:"mouseDown"},p={type:"mouseUp",mode:n},m={type:"objectChange"},v=new a.Raycaster,g=new a.Vector2,y=new a.Vector3,b=new a.Vector3,w=new a.Vector3,x=new a.Vector3,_=1,A=new a.Matrix4,E=new a.Vector3,S=new a.Matrix4,M=new a.Vector3,T=new a.Quaternion,P=new a.Vector3(1,0,0),F=new a.Vector3(0,1,0),O=new a.Vector3(0,0,1),L=new a.Quaternion,C=new a.Quaternion,R=new a.Quaternion,k=new a.Quaternion,I=new a.Quaternion,N=new a.Vector3,D=new a.Vector3,U=new a.Matrix4,j=new a.Matrix4,B=new a.Vector3,V=new a.Vector3,z=new a.Euler,G=new a.Matrix4,H=new a.Vector3,X=new a.Euler;function Y(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,u[n].pickers.children),a=null;t&&(a=t.object.name,e.preventDefault()),r.axis!==a&&(r.axis=a,r.update(),r.dispatchEvent(d))}}function W(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=e.changedTouches?e.changedTouches[0]:e;if(0===t.button||void 0===t.button){var a=Z(t,u[n].pickers.children);if(a){e.preventDefault(),e.stopPropagation(),r.axis=a.object.name,r.dispatchEvent(h),r.update(),E.copy(H).sub(V).normalize(),u[n].setActivePlane(r.axis,E);var i=Z(t,[u[n].activePlane]);i&&(N.copy(r.object.position),D.copy(r.object.scale),U.extractRotation(r.object.matrix),G.extractRotation(r.object.matrixWorld),j.extractRotation(r.object.parent.matrixWorld),B.setFromMatrixScale(S.getInverse(r.object.parent.matrixWorld)),b.copy(i.point))}}l=!0}}function q(e){if(void 0!==r.object&&null!==r.axis&&!1!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,[u[n].activePlane]);!1!==t&&(e.preventDefault(),e.stopPropagation(),y.copy(t.point),"translate"===n?(y.sub(b),y.multiply(B),"local"===r.space&&(y.applyMatrix4(S.getInverse(G)),-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(U),r.object.position.copy(N),r.object.position.add(y)),"world"!==r.space&&-1===r.axis.search("XYZ")||(-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(S.getInverse(j)),r.object.position.copy(N),r.object.position.add(y)),null!==r.translationSnap&&("local"===r.space&&r.object.position.applyMatrix4(S.getInverse(G)),-1!==r.axis.search("X")&&(r.object.position.x=Math.round(r.object.position.x/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Y")&&(r.object.position.y=Math.round(r.object.position.y/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Z")&&(r.object.position.z=Math.round(r.object.position.z/r.translationSnap)*r.translationSnap),"local"===r.space&&r.object.position.applyMatrix4(G))):"scale"===n?(y.sub(b),y.multiply(B),"local"===r.space&&("XYZ"===r.axis?(_=1+y.y/Math.max(D.x,D.y,D.z),r.object.scale.x=D.x*_,r.object.scale.y=D.y*_,r.object.scale.z=D.z*_):(y.applyMatrix4(S.getInverse(G)),"X"===r.axis&&(r.object.scale.x=D.x*(1+y.x/D.x)),"Y"===r.axis&&(r.object.scale.y=D.y*(1+y.y/D.y)),"Z"===r.axis&&(r.object.scale.z=D.z*(1+y.z/D.z))))):"rotate"===n&&(y.sub(V),y.multiply(B),M.copy(b).sub(V),M.multiply(B),"E"===r.axis?(y.applyMatrix4(S.getInverse(A)),M.applyMatrix4(S.getInverse(A)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),I.setFromAxisAngle(E,w.z-x.z),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,I),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"XYZE"===r.axis?(I.setFromEuler(y.clone().cross(M).normalize()),T.setFromRotationMatrix(S.getInverse(j)),C.setFromAxisAngle(I,-y.clone().angleTo(M)),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,C),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"local"===r.space?(y.applyMatrix4(S.getInverse(G)),M.applyMatrix4(S.getInverse(G)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),L.setFromRotationMatrix(U),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),R.setFromAxisAngle(F,w.y-x.y),k.setFromAxisAngle(O,w.z-x.z)),"X"===r.axis&&L.multiplyQuaternions(L,C),"Y"===r.axis&&L.multiplyQuaternions(L,R),"Z"===r.axis&&L.multiplyQuaternions(L,k),r.object.quaternion.copy(L)):"world"===r.space&&(w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),R.setFromAxisAngle(F,w.y-x.y),k.setFromAxisAngle(O,w.z-x.z)),L.setFromRotationMatrix(G),"X"===r.axis&&T.multiplyQuaternions(T,C),"Y"===r.axis&&T.multiplyQuaternions(T,R),"Z"===r.axis&&T.multiplyQuaternions(T,k),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T))),r.update(),r.dispatchEvent(d),r.dispatchEvent(m))}}function Q(e){e.preventDefault(),void 0!==e.button&&0!==e.button||(l&&null!==r.axis&&(p.mode=n,r.dispatchEvent(p)),l=!1,"TouchEvent"in window&&e instanceof TouchEvent?(r.axis=null,r.update(),r.dispatchEvent(d)):Y(e))}function Z(r,a){var n=t.getBoundingClientRect(),i=(r.clientX-n.left)/n.width,o=(r.clientY-n.top)/n.height;g.set(2*i-1,-2*o+1),v.setFromCamera(g,e);var s=v.intersectObjects(a,!0);return!!s[0]&&s[0]}t.addEventListener("mousedown",W,!1),t.addEventListener("touchstart",W,!1),t.addEventListener("mousemove",Y,!1),t.addEventListener("touchmove",Y,!1),t.addEventListener("mousemove",q,!1),t.addEventListener("touchmove",q,!1),t.addEventListener("mouseup",Q,!1),t.addEventListener("mouseout",Q,!1),t.addEventListener("touchend",Q,!1),t.addEventListener("touchcancel",Q,!1),t.addEventListener("touchleave",Q,!1),this.dispose=function(){t.removeEventListener("mousedown",W),t.removeEventListener("touchstart",W),t.removeEventListener("mousemove",Y),t.removeEventListener("touchmove",Y),t.removeEventListener("mousemove",q),t.removeEventListener("touchmove",q),t.removeEventListener("mouseup",Q),t.removeEventListener("mouseout",Q),t.removeEventListener("touchend",Q),t.removeEventListener("touchcancel",Q),t.removeEventListener("touchleave",Q)},this.attach=function(e){this.object=e,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return n},this.setMode=function(e){for(var t in"scale"===(n=e||n)&&(r.space="local"),u)u[t].visible=t===n;this.update(),r.dispatchEvent(d)},this.setTranslationSnap=function(e){r.translationSnap=e},this.setRotationSnap=function(e){r.rotationSnap=e},this.setSize=function(e){r.size=e,this.update(),r.dispatchEvent(d)},this.setSpace=function(e){r.space=e,this.update(),r.dispatchEvent(d)},this.update=function(){void 0!==r.object&&(r.object.updateMatrixWorld(),V.setFromMatrixPosition(r.object.matrixWorld),z.setFromRotationMatrix(S.extractRotation(r.object.matrixWorld)),e.updateMatrixWorld(),H.setFromMatrixPosition(e.matrixWorld),X.setFromRotationMatrix(S.extractRotation(e.matrixWorld)),_=V.distanceTo(H)/6*r.size,this.position.copy(V),this.scale.set(_,_,_),e instanceof a.PerspectiveCamera?E.copy(H).sub(V).normalize():e instanceof a.OrthographicCamera&&E.copy(H).normalize(),"local"===r.space?u[n].update(z,E):"world"===r.space&&u[n].update(new a.Euler,E),u[n].highlight(r.axis))}};return(l.prototype=Object.create(a.Object3D.prototype)).constructor=l,l}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){var r,n,i=this,o=new a.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")})).catch((function(){console.warn("THREE.VRControls: Unable to get VR Displays")})),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return o},this.update=function(){var t;r&&(r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(i.scale))},this.dispose=function(){r=null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedGeometryExporter=t.STLExporter=t.STLBinaryExporter=t.PLYExporter=t.OBJExporter=t.MMDExporter=t.GLTFExporter=void 0;var a=c(r(41)),n=c(r(42)),i=c(r(43)),o=c(r(44)),s=c(r(45)),l=c(r(46)),u=c(r(47));function c(e){return e&&e.__esModule?e:{default:e}}t.GLTFExporter=a.default,t.MMDExporter=n.default,t.OBJExporter=i.default,t.PLYExporter=o.default,t.STLBinaryExporter=s.default,t.STLExporter=l.default,t.TypedGeometryExporter=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987},i={1003:n.NEAREST,1004:n.NEAREST_MIPMAP_NEAREST,1005:n.NEAREST_MIPMAP_LINEAR,1006:n.LINEAR,1007:n.LINEAR_MIPMAP_NEAREST,1008:n.LINEAR_MIPMAP_LINEAR},o={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},s=function(){};s.prototype={constructor:s,parse:function(e,t,r){(r=Object.assign({},{trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,animations:[],forceIndices:!1,forcePowerOfTwoTextures:!1},r)).animations.length>0&&(r.trs=!0);var s,l={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},u=0,c=[],f=[],d=new Map,h=[],p={},m={attributes:new Map,materials:new Map,textures:new Map};function v(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}function g(e){return 4*Math.ceil(e/4)}function y(e,t){t=t||0;var r=g(e.byteLength);if(r!==e.byteLength){var a=new Uint8Array(r);if(a.set(new Uint8Array(e)),0!==t)for(var n=e.byteLength;n0)&&(t.alphaMode=e.opacity<1?"BLEND":"MASK",e.alphaTest>0&&.5!==e.alphaTest&&(t.alphaCutoff=e.alphaTest)),e.side===a.DoubleSide&&(t.doubleSided=!0),""!==e.name&&(t.name=e.name),l.materials.push(t);var i=l.materials.length-1;return m.materials.set(e,i),i}function S(e){var t,i=e.geometry;if(e.isLineSegments)t=n.LINES;else if(e.isLineLoop)t=n.LINE_LOOP;else if(e.isLine)t=n.LINE_STRIP;else if(e.isPoints)t=n.POINTS;else{if(!i.isBufferGeometry){var o=new a.BufferGeometry;o.fromGeometry(i),i=o}e.drawMode===a.TriangleFanDrawMode?(console.warn("GLTFExporter: TriangleFanDrawMode and wireframe incompatible."),t=n.TRIANGLE_FAN):t=e.drawMode===a.TriangleStripDrawMode?e.material.wireframe?n.LINE_STRIP:n.TRIANGLE_STRIP:e.material.wireframe?n.LINES:n.TRIANGLES}var s={},u={},c=[],f=[],d={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},h=i.getAttribute("normal");for(var p in void 0===h||function(e){if(m.attributes.has(e))return!1;for(var t=new a.Vector3,r=0,n=e.count;r5e-4)return!1;return!0}(h)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.addAttribute("normal",function(e){if(m.attributes.has(e))return m.textures.get(e);for(var t=e.clone(),r=new a.Vector3,n=0,i=t.count;n0){var b=[],x=[],_={};if(void 0!==e.morphTargetDictionary)for(var A in e.morphTargetDictionary)_[e.morphTargetDictionary[A]]=A;for(var S=0;S0&&(s.extras={},s.extras.targetNames=x)}var C=r.forceIndices,R=Array.isArray(e.material);if(R&&0===e.geometry.groups.length)return null;!C&&null===i.index&&R&&(console.warn("THREE.GLTFExporter: Creating index for non-indexed multi-material mesh."),C=!0);var k=!1;if(null===i.index&&C){for(var I=[],N=(S=0,i.attributes.position.count);S0&&(j.targets=f),null!==i.index&&(j.indices=w(i.index,i,U[S].start,U[S].count));var B=E(D[U[S].materialIndex]);null!==B&&(j.material=B),c.push(j)}return k&&i.setIndex(null),s.primitives=c,l.meshes||(l.meshes=[]),l.meshes.push(s),l.meshes.length-1}function M(e,t){l.animations||(l.animations=[]);for(var r=[],n=[],i=0;i0)try{t.extras=JSON.parse(JSON.stringify(e.userData))}catch(e){throw new Error("THREE.GLTFExporter: userData can't be serialized")}if(e.isMesh||e.isLine||e.isPoints){var s=S(e);null!==s&&(t.mesh=s)}else e.isCamera&&(t.camera=function(e){l.cameras||(l.cameras=[]);var t=e.isOrthographicCamera,r={type:t?"orthographic":"perspective"};return t?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:a.Math.degToRad(e.fov)/e.aspect,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),l.cameras.push(r),l.cameras.length-1}(e));if(e.isSkinnedMesh&&h.push(e),e.children.length>0){for(var u=[],c=0,f=e.children.length;c0&&(t.children=u)}l.nodes.push(t);var g=l.nodes.length-1;return d.set(e,g),g}function F(e){l.scenes||(l.scenes=[],l.scene=0);var t={nodes:[]};""!==e.name&&(t.name=e.name),l.scenes.push(t);for(var a=[],n=0,i=e.children.length;n0&&(t.nodes=a)}!function(e){e=e instanceof Array?e:[e];for(var t=[],n=0;n0&&function(e){var t=new a.Scene;t.name="AuxScene";for(var r=0;r0&&(l.extensionsUsed=a),l.buffers&&l.buffers.length>0){l.buffers[0].byteLength=e.size;var n=new window.FileReader;if(!0===r.binary){n.readAsArrayBuffer(e),n.onloadend=function(){var e=y(n.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,e.byteLength,!0),r.setUint32(4,5130562,!0);var a=y(function(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0,a=e.length;r255?32:n}return t.buffer}(JSON.stringify(l)),32),i=new DataView(new ArrayBuffer(8));i.setUint32(0,a.byteLength,!0),i.setUint32(4,1313821514,!0);var o=new ArrayBuffer(12),s=new DataView(o);s.setUint32(0,1179937895,!0),s.setUint32(4,2,!0);var u=12+i.byteLength+a.byteLength+r.byteLength+e.byteLength;s.setUint32(8,u,!0);var c=new Blob([o,i,a,r,e],{type:"application/octet-stream"}),f=new window.FileReader;f.readAsArrayBuffer(c),f.onloadend=function(){t(f.result)}}}else n.readAsDataURL(e),n.onloadend=function(){var e=n.result;l.buffers[0].uri=e,t(l)}}else t(l)}))}},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(0)),n=i(r(4));function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.default=function(){var e;this.parseVpd=function(t,r,i){if(!0!==t.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);var t=e.toString();-1===t.indexOf(".")&&(t+=".");var r=(t+="000000").indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function s(e){for(var t=[],r=0,a=e.length;r255?(u.push(l>>8&255),u.push(255&l)):u.push(255&l)}return new Uint8Array(u)}(x):x}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(){};n.prototype={constructor:n,parse:function(e){var t,r,n,i,o,s="",l=0,u=0,c=0,f=new a.Vector3,d=new a.Vector3,h=new a.Vector2,p=[];return e.traverse((function(e){e instanceof a.Mesh&&function(e){var n=0,m=0,v=0,g=e.geometry,y=new a.Matrix3;if(g instanceof a.Geometry&&(g=(new a.BufferGeometry).setFromObject(e)),g instanceof a.BufferGeometry){var b=g.getAttribute("position"),w=g.getAttribute("normal"),x=g.getAttribute("uv"),_=g.getIndex();if(s+="o "+e.name+"\n",e.material&&e.material.name&&(s+="usemtl "+e.material.name+"\n"),void 0!==b)for(t=0,i=b.count;t=200)return void n("THREE.AssimpJSONLoader: Unsupported assimp2json file format version.")}t(i.parse(r,o))}),r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=new Array(e.length),a=0;a0&&i.addAttribute("normal",new a.Float32BufferAttribute(l,3)),u.length>0&&i.addAttribute("uv",new a.Float32BufferAttribute(u,2)),c.length>0&&i.addAttribute("color",new a.Float32BufferAttribute(c,3)),i.computeBoundingSphere(),i})),o=r(e.materials,(function(e){var t=new a.MeshPhongMaterial;for(var r in e.properties){var i=e.properties[r],o=i.key,s=i.value;switch(o){case"$tex.file":var l=i.semantic;if(1===l||2===l||5===l||6===l){var u;switch(l){case 1:u="map";break;case 2:u="specularMap";break;case 5:u="bumpMap";break;case 6:u="normalMap"}var c=n.load(s);c.wrapS=c.wrapT=a.RepeatWrapping,t[u]=c}break;case"?mat.name":t.name=s;break;case"$clr.diffuse":t.color.fromArray(s);break;case"$clr.specular":t.specular.fromArray(s);break;case"$clr.emissive":t.emissive.fromArray(s);break;case"$mat.shininess":t.shininess=s;break;case"$mat.shadingm":t.flatShading=1===s;break;case"$mat.opacity":s<1&&(t.opacity=s,t.transparent=!0)}}return t}));return function e(t,r,n,i){var o,s,l=new a.Object3D;for(l.name=r.name||"",l.matrix=(new a.Matrix4).fromArray(r.transformation).transpose(),l.matrix.decompose(l.position,l.quaternion,l.scale),o=0;r.meshes&&o0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(var e=0;e=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;for(var r=e.hierarchy[0].keys,a=0;ae){t=this.keys[a],r=this.keys[a+1];break}if(this.keys[a].time4&&(r.length=4);var n=0;for(a=0;a<4;a++)n+=r[a].w*r[a].w;n=Math.sqrt(n);for(a=0;a<4;a++)r[a].w=r[a].w/n,e[a]=r[a].i,t[a]=r[a].w}function k(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(var r in e.children){var a=k(e.children[r],t);if(a)return a}}function I(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e,t){if(0!=this.mBones.length){for(var r=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var o=C(u=i.toTHREE(e),e);this.threeNode.add(o);for(var s=0;s0&&n.addAttribute("normal",new a.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&n.addAttribute("color",new a.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&n.addAttribute("uv",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&n.addAttribute("uv1",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&n.addAttribute("tangents",new a.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&n.addAttribute("bitangents",new a.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){for(var i=[],o=[],s=0;s0&&(r=new a.SkinnedMesh(n,t)),this.threeNode=r,r}}function N(){this.mNumIndices=0,this.mIndices=[]}function D(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new a.Vector3(this.x,this.y,this.z)}}function U(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new a.Color(this.r,this.g,this.b,1)}}function j(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new a.Quaternion(this.x,this.y,this.z,this.w)}}function B(){this.mVertexId=0,this.mWeight=0}function V(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}function z(){this.mTime=0,this.mValue=null}function G(){this.mTime=0,this.mValue=null}function H(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new a.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(var r=0;r0)var r=this.mAnimations[0].toTHREE(this);return{object:e,animation:r}}}function ie(){this.elements=[[],[],[],[]],this.toTHREE=function(){for(var e=new a.Matrix4,t=0;t<4;++t)for(var r=0;r<4;++r)e.elements[4*t+r]=this.elements[r][t];return e}}var oe=!0;function se(e){var t=e.getFloat32(e.readOffset,oe);return e.readOffset+=4,t}function le(e){var t=e.getFloat64(e.readOffset,oe);return e.readOffset+=8,t}function ue(e){var t=e.getUint16(e.readOffset,oe);return e.readOffset+=2,t}function ce(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function fe(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function de(e){var t=new D;return t.x=se(e),t.y=se(e),t.z=se(e),t}function he(e){var t=new U;return t.r=se(e),t.g=se(e),t.b=se(e),t}function pe(e){var t=new V,r=ce(e);return e.ReadBytes(t.data,1,r),t.toString()}function me(e){var t=new B;return t.mVertexId=ce(e),t.mWeight=se(e),t}function ve(e){for(var t=new ie,r=0;r<4;++r)for(var a=0;a<4;++a)t.elements[r][a]=se(e);return t}function ge(e){var t=new z;return t.mTime=le(e),t.mValue=de(e),t}function ye(e){var t=new G;return t.mTime=le(e),t.mValue=function(e){var t=new j;return t.w=se(e),t.x=se(e),t.y=se(e),t.z=se(e),t}(e),t}function be(e,t,r){for(var a=0;a0,Re=ue(r)>0,Ce)throw"Shortened binaries are not supported!";if(r.Seek(256,ke),r.Seek(128,ke),r.Seek(64,ke),!Re)return Le(r,t),t.toTHREE();var a=fe(r),n=r.FileSize()-r.Tell(),i=[];r.Read(i,1,n);var o=[];uncompress(o,a,i,n),Le(new ArrayBuffer(o),t)}(e)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){function e(){this.id=0,this.data=null}function t(){}t.prototype={set:function(e,t){this[e]=t},get:function(e,t){return this.hasOwnProperty(e)?this[e]:t}};var r=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.trunk=new a.Object3D,this.materialFactory=void 0,this._url="",this._baseDir="",this._data=void 0,this._ptr=0,this._version=[],this._streaming=!1,this._optimized_for_accuracy=!1,this._compression=0,this._bodylen=4294967295,this._blocks=[new e],this._accuracyMatrix=!1,this._accuracyGeo=!1,this._accuracyProps=!1};return r.prototype={constructor:r,load:function(e,t,r,n){var i=this;this._url=e,this._baseDir=e.substr(0,e.lastIndexOf("/")+1);var o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){var t=e.byteLength;for(this._ptr=0,this._data=new DataView(e),this._parseHeader(),0!=this._compression&&console.error("compressed AWD not supported"),this._streaming||this._bodylen==e.byteLength-this._ptr||console.error("AWDLoader: body len does not match file length",this._bodylen,t-this._ptr);this._ptr1)for(r=new a.Object3D,p=0;p191&&a<224){var n=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((31&a)<<6|63&n)}else{n=this._data.getUint8(this._ptr++,!0);var i=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((15&a)<<12|(63&n)<<6|63&i)}}return t.join("")}},r}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),r,n)},parse:function(e){function t(e){var t=new a.BufferGeometry,r=e.indices,n=e.positions,i=e.normals,o=e.uvs;t.setIndex(r);for(var s=2,l=n.length;s0&&t.push(new a.VectorKeyframeTrack(n+".position",i,o)),s.length>0&&t.push(new a.QuaternionKeyframeTrack(n+".quaternion",i,s)),l.length>0&&t.push(new a.VectorKeyframeTrack(n+".scale",i,l)),t}function A(e,t,r){var a,n,i,o=!0;for(n=0,i=e.length;n=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function S(e,t,r){for(;t0&&t0&&h.addAttribute("position",new a.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&h.addAttribute("normal",new a.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&h.addAttribute("color",new a.Float32BufferAttribute(l.array,l.stride)),s.array.length>0&&h.addAttribute("uv",new a.Float32BufferAttribute(s.array,s.stride)),u.length>0&&h.addAttribute("skinIndex",new a.Float32BufferAttribute(u,c)),f.length>0&&h.addAttribute("skinWeight",new a.Float32BufferAttribute(f,d)),n.data=h,n.type=e[0].type,n.materialKeys=p,n}function fe(e,t,r,a){var n=e.p,i=e.stride,o=e.vcount;function s(e){for(var t=n[e+r]*u,i=t+u;t4)for(var g=1,y=h-2;g<=y;g++){p=c+i*g,m=c+i*(g+1);s(c+0*i),s(p),s(m)}c+=i*h}else for(f=0,d=n.length;f=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ge(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;rn.limits.max||t>8&255,d>>16&255,d>>24&255))),r;p=!0,o=64,r.format=a.RGBAFormat}r.mipmapCount=1,131072&f[2]&&!1!==t&&(r.mipmapCount=Math.max(1,f[7]));var m=f[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=f[4],r.height=f[3];for(var v=f[1]+4,g=r.isCubemap?6:1,y=0;y>1,1),w=Math.max(w>>1,1)}return r},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="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},n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var i=function(e){this.timeLoaded=0,this.manager=e||n.DefaultLoadingManager,this.materials=null,this.verbosity=0,this.attributeOptions={},this.drawMode=n.TrianglesDrawMode,this.nativeAttributeMap={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"}};i.prototype={constructor:i,load:function(e,t,r,a){var i=this,o=new n.FileLoader(i.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.load(e,(function(e){i.decodeDracoFile(e,t)}),r,a)},setPath:function(e){this.path=e},setCrossOrigin:function(e){this.crossOrigin=e},setVerbosity:function(e){this.verbosity=e},setDrawMode:function(e){this.drawMode=e},setSkipDequantization:function(e,t){var r=!0;void 0!==t&&(r=t),this.getAttributeOptions(e).skipDequantization=r},decodeDracoFile:function(e,t,r){var a=this;i.getDecoderModule().then((function(n){a.decodeDracoFileInternal(e,n.decoder,t,r||{})}))},decodeDracoFileInternal:function(e,t,r,a){var n=new t.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength);var i=new t.Decoder,o=i.GetEncodedGeometryType(n);if(o==t.TRIANGULAR_MESH)this.verbosity>0&&console.log("Loaded a mesh.");else{if(o!=t.POINT_CLOUD){var s="THREE.DRACOLoader: Unknown geometry type.";throw console.error(s),new Error(s)}this.verbosity>0&&console.log("Loaded a point cloud.")}r(this.convertDracoGeometryTo3JS(t,i,o,n,a))},addAttributeToGeometry:function(e,t,r,a,i,o,s){if(0===i.ptr){var l="THREE.DRACOLoader: No attribute "+a;throw console.error(l),new Error(l)}var u=i.num_components(),c=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,c);var f=r.num_points()*u;s[a]=new Float32Array(f);for(var d=0;d0&&console.log("Number of faces loaded: "+c.toString())):c=0;var d=o.num_points(),h=o.num_attributes();this.verbosity>0&&(console.log("Number of points loaded: "+d.toString()),console.log("Number of attributes loaded: "+h.toString()));var p=t.GetAttributeId(o,e.POSITION);if(-1==p){u="THREE.DRACOLoader: No position attribute found.";throw console.error(u),e.destroy(t),e.destroy(o),new Error(u)}var m=t.GetAttribute(o,p),v={},g=new n.BufferGeometry;for(var y in this.nativeAttributeMap)if(void 0===i[y]){var b=t.GetAttributeId(o,e[this.nativeAttributeMap[y]]);if(-1!==b){this.verbosity>0&&console.log("Loaded "+y+" attribute.");var w=t.GetAttribute(o,b);this.addAttributeToGeometry(e,t,o,y,w,g,v)}}for(var y in i){var x=i[y];w=t.GetAttributeByUniqueId(o,x);this.addAttributeToGeometry(e,t,o,y,w,g,v)}if(r==e.TRIANGULAR_MESH)if(this.drawMode===n.TriangleStripDrawMode){var _=new e.DracoInt32Array;t.GetTriangleStripsFromMesh(o,_);v.indices=new Uint32Array(_.size());for(var A=0;A<_.size();++A)v.indices[A]=_.GetValue(A);e.destroy(_)}else{var E=3*c;v.indices=new Uint32Array(E);var S=new e.DracoInt32Array;for(A=0;A65535?n.Uint32BufferAttribute:n.Uint16BufferAttribute)(v.indices,1));var T=new e.AttributeQuantizationTransform;if(T.InitFromAttribute(m)){g.attributes.position.isQuantized=!0,g.attributes.position.maxRange=T.range(),g.attributes.position.numQuantizationBits=T.quantization_bits(),g.attributes.position.minValues=new Float32Array(3);for(A=0;A<3;++A)g.attributes.position.minValues[A]=T.min_value(A)}return e.destroy(T),e.destroy(t),e.destroy(o),this.decode_time=f-l,this.import_time=performance.now()-f,this.verbosity>0&&(console.log("Decode time: "+this.decode_time),console.log("Import time: "+this.import_time)),g},isVersionSupported:function(e,t){i.getDecoderModule().then((function(r){t(r.decoder.isVersionSupported(e))}))},getAttributeOptions:function(e){return void 0===this.attributeOptions[e]&&(this.attributeOptions[e]={}),this.attributeOptions[e]}},i.decoderPath="./",i.decoderConfig={},i.decoderModulePromise=null,i.setDecoderPath=function(e){i.decoderPath=e},i.setDecoderConfig=function(e){var t=i.decoderConfig.wasmBinary;i.decoderConfig=e||{},i.releaseDecoderModule(),t&&(i.decoderConfig.wasmBinary=t)},i.releaseDecoderModule=function(){i.decoderModulePromise=null},i.getDecoderModule=function(){var e=this,t=i.decoderPath,r=i.decoderConfig,n=i.decoderModulePromise;return n||("undefined"!=typeof DracoDecoderModule?n=Promise.resolve():"object"!==("undefined"==typeof WebAssembly?"undefined":a(WebAssembly))||"js"===r.type?n=i._loadScript(t+"draco_decoder.js"):(r.wasmBinaryFile=t+"draco_decoder.wasm",n=i._loadScript(t+"draco_wasm_wrapper.js").then((function(){return i._loadArrayBuffer(r.wasmBinaryFile)})).then((function(e){r.wasmBinary=e}))),n=n.then((function(){return new Promise((function(t){r.onModuleLoaded=function(r){e.timeLoaded=performance.now(),t({decoder:r})},DracoDecoderModule(r)}))})),i.decoderModulePromise=n,n)},i._loadScript=function(e){var t=document.getElementById("decoder_script");null!==t&&t.parentNode.removeChild(t);var r=document.getElementsByTagName("head")[0],a=document.createElement("script");return a.id="decoder_script",a.type="text/javascript",a.src=e,new Promise((function(e){a.onload=e,r.appendChild(a)}))},i._loadArrayBuffer=function(e){var t=new n.FileLoader;return t.setResponseType("arraybuffer"),new Promise((function(r,a){t.load(e,r,void 0,a)}))},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.sourceTexture=e,this.resolution=t,this.views=[{t:[1,0,0],u:[0,-1,0]},{t:[-1,0,0],u:[0,-1,0]},{t:[0,1,0],u:[0,0,1]},{t:[0,-1,0],u:[0,0,-1]},{t:[0,0,1],u:[0,-1,0]},{t:[0,0,-1],u:[0,-1,0]}],this.camera=new a.PerspectiveCamera(90,1,.1,10),this.boxMesh=new a.Mesh(new a.BoxBufferGeometry(1,1,1),this.getShader()),this.boxMesh.material.side=a.BackSide,this.scene=new a.Scene,this.scene.add(this.boxMesh);var r={format:a.RGBAFormat,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.renderTarget=new a.WebGLRenderTargetCube(this.resolution,this.resolution,r)};n.prototype={constructor:n,update:function(e){for(var t=0;t<6;t++){this.renderTarget.activeCubeFace=t;var r=this.views[t];this.camera.position.set(0,0,0),this.camera.up.set(r.u[0],r.u[1],r.u[2]),this.camera.lookAt(r.t[0],r.t[1],r.t[2]),e.render(this.scene,this.camera,this.renderTarget,!0)}return this.renderTarget.texture},getShader:function(){var e=new a.ShaderMaterial({uniforms:{equirectangularMap:{value:this.sourceTexture}},vertexShader:"varying vec3 localPosition;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tlocalPosition = position;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \n\t\t\t\tvarying vec3 localPosition;\n\t\t\t\tuniform sampler2D equirectangularMap;\n\t\t\t\t\n\t\t\t\tvec2 EquiangularSampleUV(vec3 v) {\n\t\t\t vec2 uv = vec2(atan(v.z, v.x), asin(v.y));\n\t\t\t uv *= vec2(0.1591, 0.3183); // inverse atan\n\t\t\t uv += 0.5;\n\t\t\t return uv;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = EquiangularSampleUV(normalize(localPosition));\n \t\t\tvec3 color = texture2D(equirectangularMap, uv).rgb;\n \t\t\t\n\t\t\t\t\tgl_FragColor = vec4( color, 1.0 );\n\t\t\t\t}",blending:a.CustomBlending,premultipliedAlpha:!1,blendSrc:a.OneFactor,blendDst:a.ZeroFactor,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.ZeroFactor,blendEquation:a.AddEquation});return e.type="EquiangularToCubeGenerator",e},dispose:function(){this.boxMesh.geometry.dispose(),this.boxMesh.material.dispose(),this.renderTarget.dispose()}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};(n.prototype=Object.create(a.DataTextureLoader.prototype))._parser=function(e){var t=65536,r=t>>3,n=14,i=65537,o=1<>r&(1<a)return!1;g(6,d,h,e,f);var p=v.l;if(d=v.c,h=v.lc,s[n]=p,p==u){if(f.value-r.value>a)throw"Something wrong with hufUnpackEncTable";g(8,d,h,e,f);var m=v.l+c;if(d=v.c,h=v.lc,n+m>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}else if(p>=l){if(n+(m=p-l+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}}!function(e){for(var t=0;t<=58;++t)y[t]=0;for(t=0;t0;--t){var a=r+y[t]>>1;y[t]=r,r=a}for(t=0;t0&&(e[t]=n|y[n]++<<6)}}(s)}function w(e){return 63&e}function x(e){return e>>6}var _={c:0,lc:0};function A(e,t,r,a){e=e<<8|I(r,a),t+=8,_.c=e,_.lc=t}var E={c:0,lc:0};function S(e,t,r,a,n,i,o,s,l,u){if(e==t){a<8&&(A(r,a,n,o),r=_.c,a=_.lc);var c=r>>(a-=8);if(out+c>oe)throw"Issue with getCode";for(var f=out[-1];c-- >0;)s[l.value++]=f}else{if(!(l.value32767?t-65536:t}var T={a:0,b:0};function P(e,t){var r=M(e),a=M(t),n=r+(1&a)+(a>>1),i=n,o=n-a;T.a=i,T.b=o}function F(e,t,r,a,n,i,o){for(var s,l=r>n?n:r,u=1;u<=l;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var c,f,d,h,p=0,m=p+i*(n-s),v=i*u,g=i*s,y=a*u,b=a*s;p<=m;p+=g){for(var w=p,x=p+a*(r-s);w<=x;w+=b){var _=w+y,A=(E=w+v)+y;P(t[w+e],t[E+e]),c=T.a,d=T.b,P(t[_+e],t[A+e]),f=T.a,h=T.b,P(c,f),t[w+e]=T.a,t[_+e]=T.b,P(d,h),t[E+e]=T.a,t[A+e]=T.b}if(r&u){var E=w+v;P(t[w+e],t[E+e]),c=T.a,t[E+e]=T.b,t[w+e]=c}}if(n&u)for(w=p,x=p+a*(r-s);w<=x;w+=b){_=w+y;P(t[w+e],t[_+e]),c=T.a,t[_+e]=T.b,t[w+e]=c}s=u,u>>=1}return p}function O(e,t,r,a,l,u,c){var f=r.value,d=k(t,r),h=k(t,r);r.value+=4;var p=k(t,r);if(r.value+=4,d<0||d>=i||h<0||h>=i)throw"Something wrong with HUF_ENCSIZE";var m=new Array(i),v=new Array(o);if(function(e){for(var t=0;t8*(a-(r.value-f)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var i=x(e[t]),o=w(e[t]);if(i>>o)throw"Invalid table entry";if(o>n){if((c=a[i>>o-n]).len)throw"Invalid table entry";if(c.lit++,c.p){var s=c.p;c.p=new Array(c.lit);for(var l=0;l0;l--){var c;if((c=a[(i<=n;){if((b=t[d>>h-n&s]).len)h-=b.len,S(b.lit,l,d,h,r,0,i,c,f,p),d=E.c,h=E.lc;else{if(!b.p)throw"hufDecode issues";var v;for(v=0;v=g&&x(e[b.p[v]])==(d>>h-g&(1<>=y,h-=y;h>0;){var b;if(!(b=t[d<=r)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(h<=p)for(var m=0;m>3]&1<<(7&n))&&(r[a++]=n);for(var i=a-1;a>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function j(e,t){var r=e.getUint16(t.value,!0);return t.value+=p,r}function B(e,t){return U(j(e,t))}function V(e,t,r,a,n){if("string"===a||"iccProfile"===a)return function(e,t,r){var a=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,a}(t,r,n);if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value0&&void 0!==r[l[0].ID]&&(0!==(i=r[l[0].ID]).indexOf("blob:")&&0!==i.indexOf("data:")||t.setPath(void 0));o="tga"===e.FileName.slice(-3).toLowerCase()?n.Loader.Handlers.get(".tga").load(i):t.load(i);return t.setPath(s),o}(e,t,r,a);i.ID=e.id,i.name=e.attrName;var o=e.WrapModeU,s=e.WrapModeV,l=void 0!==o?o.value:0,u=void 0!==s?s.value:0;if(i.wrapS=0===l?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===u?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){var c=e.Scaling.value;i.repeat.x=c[0],i.repeat.y=c[1]}return i}function i(e,t,r,i){var s=t.id,l=t.attrName,u=t.ShadingModel;if("object"===(void 0===u?"undefined":a(u))&&(u=u.value),!i.has(s))return null;var c,f=function(e,t,r,a,i){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value);t.Diffuse?s.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new n.Color).fromArray(t.DiffuseColor.value));t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value);t.Emissive?s.emissive=(new n.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new n.Color).fromArray(t.EmissiveColor.value));t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value));t.Opacity&&(s.opacity=parseFloat(t.Opacity.value));s.opacity<1&&(s.transparent=!0);t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value);t.Shininess&&(s.shininess=t.Shininess.value);t.Specular?s.specular=(new n.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new n.Color).fromArray(t.SpecularColor.value));return i.get(a).children.forEach((function(t){var a=t.relationship;switch(a){case"Bump":s.bumpMap=r.get(t.ID);break;case"DiffuseColor":s.map=o(e,r,t.ID,i);break;case"DisplacementColor":s.displacementMap=o(e,r,t.ID,i);break;case"EmissiveColor":s.emissiveMap=o(e,r,t.ID,i);break;case"NormalMap":s.normalMap=o(e,r,t.ID,i);break;case"ReflectionColor":s.envMap=o(e,r,t.ID,i),s.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":s.specularMap=o(e,r,t.ID,i);break;case"TransparentColor":s.alphaMap=o(e,r,t.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a)}})),s}(e,t,r,s,i);switch(u.toLowerCase()){case"phong":c=new n.MeshPhongMaterial;break;case"lambert":c=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',u),c=new n.MeshPhongMaterial({color:3342591})}return c.setValues(f),c.name=l,c}function o(e,t,r,a){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=a.get(r).children[0].ID),t.get(r)}function s(e,t){var r=[];return e.children.forEach((function(e){var a=t[e.ID];if("Cluster"===a.attrType){var i={ID:e.ID,indices:[],weights:[],transform:(new n.Matrix4).fromArray(a.Transform.a),transformLink:(new n.Matrix4).fromArray(a.TransformLink.a),linkMode:a.Mode};"Indexes"in a&&(i.indices=a.Indexes.a,i.weights=a.Weights.a),r.push(i)}})),{rawBones:r,bones:[]}}function l(e,t,r,a){for(var n=[],i=0;i0&&o.addAttribute("color",new n.Float32BufferAttribute(l.colors,3));r&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(l.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(l.vertexWeights,4)),o.FBX_Deformer=r);if(l.normal.length>0){var d=new n.Float32BufferAttribute(l.normal,3);(new n.Matrix3).getNormalMatrix(i).applyToBufferAttribute(d),o.addAttribute("normal",d)}if(l.uvs.forEach((function(e,t){var r="uv"+(t+1).toString();0===t&&(r="uv"),o.addAttribute(r,new n.Float32BufferAttribute(l.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){var h=l.materialIndex[0],p=0;if(l.materialIndex.forEach((function(e,t){e!==h&&(o.addGroup(p,t-p,h),h=e,p=t)})),o.groups.length>0){var m=o.groups[o.groups.length-1],v=m.start+m.count;v!==l.materialIndex.length&&o.addGroup(v,l.materialIndex.length-v,h)}0===o.groups.length&&o.addGroup(0,l.materialIndex.length,l.materialIndex[0])}return function(e,t,r,a,i){if(null===a)return;t.morphAttributes.position=[],t.morphAttributes.normal=[],a.rawTargets.forEach((function(a){var o=e.Objects.Geometry[a.geoID];void 0!==o&&function(e,t,r,a){var i=new n.BufferGeometry;r.attrName&&(i.name=r.attrName);for(var o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],s=void 0!==t.Vertices?t.Vertices.a.slice():[],l=void 0!==r.Vertices?r.Vertices.a:[],u=void 0!==r.Indexes?r.Indexes.a:[],f=0;f4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);var y=[0,0,0,0],b=[0,0,0,0];v.forEach((function(e,t){var r=e,a=m[t];b.forEach((function(e,t,n){if(r>e){n[t]=r,r=e;var i=y[t];y[t]=a,a=i}}))})),m=y,v=b}for(;v.length<4;)v.push(0),m.push(0);for(var w=0;w<4;++w)u.push(v[w]),c.push(m[w])}if(e.normal){g=h(d,r,f,e.normal);o.push(g[0],g[1],g[2])}if(e.material&&"AllSame"!==e.material.mappingType)var x=h(d,r,f,e.material)[0];e.uv&&e.uv.forEach((function(e,t){var a=h(d,r,f,e);void 0===l[t]&&(l[t]=[]),l[t].push(a[0]),l[t].push(a[1])})),a++,p&&(!function(e,t,r,a,n,i,o,s,l,u){for(var c=2;c=f.length&&f===C(c,0,f.length))o=(new M).parse(e);else{var d=C(e);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;for(var a=0;a0,u="string"==typeof o.Content&&""!==o.Content;if(l||u){var c=t(n[i]);a[o.RelativeFilename||o.Filename]=c}}}}for(var s in r){var f=r[s];void 0!==a[f]?r[s]=a[f]:r[s]=r[s].split("\\").pop()}return r}(o),_=function(e,t,r){var a=new Map;if("Material"in e.Objects){var n=e.Objects.Material;for(var o in n){var s=i(e,n[o],t,r);null!==s&&a.set(parseInt(o),s)}}return a}(o,function(e,t,a,n){var i=new Map;if("Texture"in e.Objects){var o=e.Objects.Texture;for(var s in o){var l=r(o[s],t,a,n);i.set(parseInt(s),l)}}return i}(o,new n.TextureLoader(this.manager).setPath(a),x,h),h),A=function(e,t){var r={},a={};if("Deformer"in e.Objects){var n=e.Objects.Deformer;for(var i in n){var o=n[i],u=t.get(parseInt(i));if("Skin"===o.attrType){var c=s(u,n);c.ID=i,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),c.geometryID=u.parents[0].ID,r[i]=c}else if("BlendShape"===o.attrType){var f={id:i};f.rawTargets=l(u,o,n,t),f.id=i,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),f.parentGeoID=u.parents[0].ID,a[i]=f}}}return{skeletons:r,morphTargets:a}}(o,h),E=function(e,t,r){var a=new Map;if("Geometry"in e.Objects){var n=e.Objects.Geometry;for(var i in n){var o=t.get(parseInt(i)),s=u(e,o,n[i],r);a.set(parseInt(i),s)}}return a}(o,h,A);return function(e,t,r,a,i){var o=new n.Group,s=function(e,t,r,a,i){var o=new Map,s=e.Objects.Model;for(var l in s){var u=parseInt(l),c=s[l],f=i.get(u),d=p(f,t,u,c.attrName);if(!d){switch(c.attrType){case"Camera":d=m(e,f);break;case"Light":d=v(e,f);break;case"Mesh":d=g(e,f,r,a);break;case"NurbsCurve":d=y(f,r);break;case"LimbNode":case"Null":default:d=new n.Group}d.name=n.PropertyBinding.sanitizeNodeName(c.attrName),d.ID=u}b(e,d,c),o.set(u,d)}return o}(e,r,a,i,t),l=e.Objects.Model;return s.forEach((function(r){var a=l[r.ID];!function(e,t,r,a,i){if("LookAtProperty"in r){a.get(t.ID).children.forEach((function(r){if("LookAtProperty"===r.relationship){var a=e.Objects.Model[r.ID];if("Lcl_Translation"in a){var o=a.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(o),i.add(t.target)):t.lookAt((new n.Vector3).fromArray(o))}}}))}}(e,r,a,t,o),t.get(r.ID).parents.forEach((function(e){var t=s.get(e.ID);void 0!==t&&t.add(r)})),null===r.parent&&o.add(r)})),function(e,t,r,a,i){var o=function(e){var t={};if("Pose"in e.Objects){var r=e.Objects.Pose;for(var a in r)if("BindPose"===r[a].attrType){var i=r[a].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new n.Matrix4).fromArray(e.Matrix.a)})):t[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return t}(e);for(var s in t){var l=t[s];i.get(parseInt(l.ID)).parents.forEach((function(e){if(r.has(e.ID)){var t=e.ID;i.get(t).parents.forEach((function(e){a.has(e.ID)&&a.get(e.ID).bind(new n.Skeleton(l.bones),o[e.ID])}))}}))}}(e,r,a,s,t),function(e,t,r){r.animations=[];var a=function(e,t){if(void 0===e.Objects.AnimationCurve)return;var r=function(e){var t=e.Objects.AnimationCurveNode,r=new Map;for(var a in t){var n=t[a];if(null!==n.attrName.match(/S|R|T/)){var i={id:n.id,attr:n.attrName,curves:{}};r.set(i.id,i)}}return r}(e);!function(e,t,r){var a=e.Objects.AnimationCurve;for(var n in a){var i={id:a[n].id,times:a[n].KeyTime.a.map(O),values:a[n].KeyValueFloat.a},o=t.get(i.id);if(void 0!==o){var s=o.parents[0].ID,l=o.parents[0].relationship;l.match(/X/)?r.get(s).curves.x=i:l.match(/Y/)?r.get(s).curves.y=i:l.match(/Z/)&&(r.get(s).curves.z=i)}}}(e,t,r);var a=function(e,t,r){var a=e.Objects.AnimationLayer,i=new Map;for(var o in a){var s=[],l=t.get(parseInt(o));if(void 0!==l)l.children.forEach((function(a,i){if(r.has(a.ID)){var o=r.get(a.ID);if(void 0!==o.curves.x||void 0!==o.curves.y||void 0!==o.curves.z){if(void 0===s[i]){var l;t.get(a.ID).parents.forEach((function(e){void 0!==e.relationship&&(l=e.ID)}));var u=e.Objects.Model[l.toString()],c={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};"Lcl_Translation"in u&&(c.initialPosition=u.Lcl_Translation.value),"Lcl_Rotation"in u&&(c.initialRotation=u.Lcl_Rotation.value),"Lcl_Scaling"in u&&(c.initialScale=u.Lcl_Scaling.value),"PreRotation"in u&&(c.preRotations=u.PreRotation.value),s[i]=c}s[i][o.attr]=o}}})),i.set(parseInt(o),s)}return i}(e,t,r);return function(e,t,r){var a=e.Objects.AnimationStack,n={};for(var i in a){var o=t.get(parseInt(i)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=r.get(o[0].ID);n[i]={name:a[i].attrName,layer:s}}return n}(e,t,a)}(e,t);if(void 0===a)return;for(var i in a){var o=w(a[i]);r.animations.push(o)}}(e,t,o),function(e,t){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var r=e.GlobalSettings.AmbientColor.value,a=r[0],i=r[1],o=r[2];if(0!==a||0!==i||0!==o){var s=new n.Color(a,i,o);t.add(new n.AmbientLight(s,1))}}}(e,o),o}(o,h,A.skeletons,E,_)}});var d=[];function h(e,t,r,a){var n;switch(a.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=r;break;case"AllSame":n=a.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+a.mappingType)}"IndexToDirect"===a.referenceType&&(n=a.indices[n]);var i=n*a.dataSize,o=i+a.dataSize;return function(e,t,r,a){for(var n=r,i=0;n1?s=l:l.length>0?s=l[0]:(s=new n.MeshPhongMaterial({color:13421772}),l.push(s)),"color"in o.attributes&&l.forEach((function(e){e.vertexColors=n.VertexColors})),o.FBX_Deformer?(l.forEach((function(e){e.skinning=!0})),i=new n.SkinnedMesh(o,s)):i=new n.Mesh(o,s),i}function y(e,t){var r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),a=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,a)}function b(e,t,r){if("RotationOrder"in r){var a=parseInt(r.RotationOrder.value,10);a>0&&a<6?console.warn("THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.",["XYZ","XZY","YZX","ZXY","YXZ","ZYX","SphericXYZ"][a]):6===a&&console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.")}if("Lcl_Translation"in r&&t.position.fromArray(r.Lcl_Translation.value),"Lcl_Rotation"in r){var i=r.Lcl_Rotation.value.map(n.Math.degToRad);i.push("ZYX"),t.quaternion.setFromEuler((new n.Euler).fromArray(i))}if("Lcl_Scaling"in r&&t.scale.fromArray(r.Lcl_Scaling.value),"PreRotation"in r){var o=r.PreRotation.value.map(n.Math.degToRad);o[3]="ZYX";var s=(new n.Euler).fromArray(o);s=(new n.Quaternion).setFromEuler(s),t.quaternion.premultiply(s)}}function w(e){var t=[];return e.layer.forEach((function(e){t=t.concat(function(e){var t=[];if(void 0!==e.T&&Object.keys(e.T.curves).length>0){var r=x(e.modelName,e.T.curves,e.initialPosition,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=function(e,t,r,a){void 0!==t.x&&(E(t.x),t.x.values=t.x.values.map(n.Math.degToRad));void 0!==t.y&&(E(t.y),t.y.values=t.y.values.map(n.Math.degToRad));void 0!==t.z&&(E(t.z),t.z.values=t.z.values.map(n.Math.degToRad));var i=A(t),o=_(i,t,r);void 0!==a&&((a=a.map(n.Math.degToRad)).push("ZYX"),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a));for(var s=new n.Quaternion,l=new n.Euler,u=[],c=0;c0){var i=x(e.modelName,e.S.curves,e.initialScale,"scale");void 0!==i&&t.push(i)}return t}(e))})),new n.AnimationClip(e.name,-1,t)}function x(e,t,r,a){var i=A(t),o=_(i,t,r);return new n.VectorKeyframeTrack(e+"."+a,i,o)}function _(e,t,r){var a=r,n=[],i=-1,o=-1,s=-1;return e.forEach((function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(s=t.z.times.indexOf(e)),-1!==i){var r=t.x.values[i];n.push(r),a[0]=r}else n.push(a[0]);if(-1!==o){var l=t.y.values[o];n.push(l),a[1]=l}else n.push(a[1]);if(-1!==s){var u=t.z.values[s];n.push(u),a[2]=u}else n.push(a[2])})),n}function A(e){var t=[];return void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})).filter((function(e,t,r){return r.indexOf(e)==t}))}function E(e){for(var t=1;t=180){for(var i=n/180,o=a/i,s=r+o,l=e.times[t-1],u=(e.times[t]-l)/i,c=l+u,f=[],d=[];c1&&(r=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:r,type:a}},parseNodeProperty:function(e,t,r){var a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===a&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());var i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===a){var o=n.split(",").slice(1),s=parseInt(o[0]),l=parseInt(o[1]),u=n.split(",").slice(3);a="connections",function(e,t){for(var r=0,a=e.length,n=t.length;r=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var r={},a=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32(),i=(t>=7500?e.getUint64():e.getUint32(),e.getUint8()),o=e.getString(i);if(0===a)return null;for(var s=[],l=0;l0?s[0]:"",c=s.length>1?s[1]:"",f=s.length>2?s[2]:"";for(r.singleProperty=1===n&&e.getOffset()===a;a>e.getOffset();){var d=this.parseNode(e,t);null!==d&&this.parseSubNode(o,r,d)}return r.propertyList=s,"number"==typeof u&&(r.id=u),""!==c&&(r.attrName=c),""!==f&&(r.attrType=f),""!==o&&(r.name=o),r},parseSubNode:function(e,t,r){if(!0===r.singleProperty){var a=r.propertyList[0];Array.isArray(a)?(t[r.name]=r,r.a=a):t[r.name]=a}else if("Connections"===e&&"C"===r.name){var n=[];r.propertyList.forEach((function(e,t){0!==t&&n.push(e)})),void 0===t.connections&&(t.connections=[]),t.connections.push(n)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){var i,o=r.propertyList[0],s=r.propertyList[1],l=r.propertyList[2],u=r.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),i="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[o]={type:s,type2:l,flag:u,value:i}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var r=e.getUint32();return e.getArrayBuffer(r);case"S":r=e.getUint32();return e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var a=e.getUint32(),n=e.getUint32(),i=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}void 0===window.Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var o=new T(new Zlib.Inflate(new Uint8Array(e.getArrayBuffer(i))).decompress().buffer);switch(t){case"b":case"c":return o.getBooleanArray(a);case"d":return o.getFloat64Array(a);case"f":return o.getFloat32Array(a);case"i":return o.getInt32Array(a);case"l":return o.getInt64Array(a)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}),Object.assign(T.prototype,{getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],r=0;r=0&&(t=t.slice(0,a)),n.LoaderUtils.decodeText(t)}}),Object.assign(P.prototype,{add:function(e,t){this[e]=t}}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.splitLayer=!1};n.prototype.load=function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},n.prototype.parse=function(e){var t={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},r=[],n=void 0,i=new a.LineBasicMaterial({color:16711680});i.name="path";var o=new a.LineBasicMaterial({color:65280});function s(e){n={vertex:[],pathVertex:[],z:e.z},r.push(n)}function l(e,r){return t.relative?r:r-e}function u(e,r){return t.relative?e+r:r}o.name="extruded";for(var c,f,d=e.replace(/;.+/g,"").split("\n"),h=0;h0&&(g.extruding=l(t.e,g.e)>0,null!=n&&g.z==n.z||s(g)),c=t,f=g,void 0===n&&s(c),g.extruding?(n.vertex.push(c.x,c.y,c.z),n.vertex.push(f.x,f.y,f.z)):(n.pathVertex.push(c.x,c.y,c.z),n.pathVertex.push(f.x,f.y,f.z)),t=g}else if("G2"===m||"G3"===m)console.warn("THREE.GCodeLoader: Arc command not supported");else if("G90"===m)t.relative=!1;else if("G91"===m)t.relative=!0;else if("G92"===m){(g=t).x=void 0!==v.x?v.x:g.x,g.y=void 0!==v.y?v.y:g.y,g.z=void 0!==v.z?v.z:g.z,g.e=void 0!==v.e?v.e:g.e,t=g}else console.warn("THREE.GCodeLoader: Command not supported:"+m)}function y(e,t){var r=new a.BufferGeometry;r.addAttribute("position",new a.Float32BufferAttribute(e,3));var n=new a.LineSegments(r,t?o:i);n.name="layer"+h,b.add(n)}var b=new a.Group;if(b.name="gcode",this.splitLayer)for(h=0;h>16&32768,i=a>>12&2047,o=a>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&a):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)}return function(e,t,a,n){var i=e[t+3],o=Math.pow(2,i-128)/255;a[n+0]=r(e[t+0]*o),a[n+1]=r(e[t+1]*o),a[n+2]=r(e[t+2]*o)}}(),l=new n.CubeTexture;l.type=e,l.encoding=e===n.UnsignedByteType?n.RGBEEncoding:n.LinearEncoding,l.format=e===n.UnsignedByteType?n.RGBAFormat:n.RGBFormat,l.minFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.magFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.generateMipmaps=l.encoding!==n.RGBEEncoding,l.anisotropy=0;var u=this.hdrLoader,c=0;function f(r,a,i,f){var d=new n.FileLoader(this.manager);d.setResponseType("arraybuffer"),d.load(t[r],(function(t){c++;var i=u._parser(t);if(i){if(e===n.FloatType){for(var f=i.data.length/4*3,d=new Float32Array(f),h=0;h>8&65280|e>>24&255},e.prototype.mipmaps=function(t){for(var r=[],a=e.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight,o=t?this.numberOfMipmapLevels:1,s=0;s0?o():t(n.mergeVmds(i))}),r,a)}()},s.prototype.loadAudio=function(e,t,r,n){var i=new a.AudioListener,o=new a.Audio(i);new a.AudioLoader(this.manager).load(e,(function(e){o.setBuffer(e),t(o,i)}),r,n)},s.prototype.loadVpd=function(e,t,r,a,n){var i=this;(n&&"unicode"===n.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this)(e,(function(e){t(i.parseVpd(e))}),r,a)},s.prototype.parseModel=function(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}},s.prototype.parsePmd=function(e){return this.parser.parsePmd(e,!0)},s.prototype.parsePmx=function(e){return this.parser.parsePmx(e,!0)},s.prototype.parseVmd=function(e){return this.parser.parseVmd(e,!0)},s.prototype.parseVpd=function(e){return this.parser.parseVpd(e,!0)},s.prototype.mergeVmds=function(e){return this.parser.mergeVmds(e)},s.prototype.pourVmdIntoModel=function(e,t,r){this.createAnimation(e,t,r)},s.prototype.pourVmdIntoCamera=function(e,t,r){var n=new s.DataCreationHelper;!function(){for(var i,o,l=n.createOrderedMotionArray(t.cameras),u=[],c=[],f=[],d=[],h=[],p=[],m=[],v=[],g=[],y=new a.Quaternion,b=new a.Euler,w=new a.Vector3,x=new a.Vector3,_=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},A=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},E=function(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();for(var o=n.length/r.length,l=3===o?12:4,u=1,c=2,f=r.length;cu){r[u]=r[c];for(d=0;d=a?r.skinIndices[a]:0);for(a=0;a<4;a++)l.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t=0&&(l.limitation=new a.Vector3(1,0,0)),s.links.push(l)}t.push(s)}else for(r=0;r=0?c:u);var p=h.load(s,(function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,n=t.height;f.width=r,f.height=n,d.clearRect(0,0,r,n),d.translate(r/2,n/2),d.rotate(.5*Math.PI),d.translate(-r/2,-n/2),d.drawImage(t,0,0),e.image=d.getImageData(0,0,r,n)}e.flipY=!1,e.wrapS=a.RepeatWrapping,e.wrapT=a.RepeatWrapping;for(var i=0;i=0?(x.push(w.slice(0,_)),x.push(w.slice(_+1))):x.push(w);for(var A=0;A=0||E.indexOf(".spa")>=0?(b.envMap=m(E,{sphericalReflectionMapping:!0}),E.indexOf(".sph")>=0?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation):b.map=m(E)}}}else{if(-1!==y.textureIndex){var E=e.textures[y.textureIndex];b.map=m(E)}if(-1!==y.envTextureIndex&&(1===y.envFlag||2==y.envFlag)){E=e.textures[y.envTextureIndex];b.envMap=m(E,{sphericalReflectionMapping:!0}),1===y.envFlag?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation}}var S=void 0===b.map?1:.2;b.emissive=new a.Color(y.ambient[0]*S,y.ambient[1]*S,y.ambient[2]*S),p.push(b)}for(g=0;g0,y.morphTargets=o.morphTargets.length>0,y.lights=!0,y.side="pmx"===e.metadata.format&&1==(1&T.flag)?a.DoubleSide:M.side,y.transparent=M.transparent,y.fog=!0,y.blending=a.CustomBlending,y.blendSrc=a.SrcAlphaFactor,y.blendDst=a.OneMinusSrcAlphaFactor,y.blendSrcAlpha=a.SrcAlphaFactor,y.blendDstAlpha=a.DstAlphaFactor,void 0!==M.map){y.faceOffset=M.faceOffset,y.faceNum=M.faceNum,y.map=v(M.map,l),function(e){e.map.readyCallbacks.push((function(t){function r(e,t){var r=e.width,a=e.height,n=Math.round(t.x*r)%r,i=Math.round(t.y*a)%a;n<0&&(n+=r),i<0&&(i+=a);var o=i*r+n;return e.data[4*o+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),n=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var n=e.width,i=e.height;if(e.data.length/(n*i)!=4)return!1;for(var o=0;o=this.duration;)this.currentTime-=this.duration;return!(this.currentTime=this.duration}},a.MMDGrantSolver=function(e){this.mesh=e},a.MMDGrantSolver.prototype={constructor:a.MMDGrantSolver,update:(o=new a.Quaternion,function(){for(var e=0;e0)}},setAnimations:function(){for(var e=0;e0&&0!==e.action._clip.tracks[0].name.indexOf(".bones")||(e.target._root.looped=!0)}));for(var t=!1,r=!1,n=0;n0&&0===i.tracks[0].name.indexOf(".morphTargetInfluences")?r||(o.play(),r=!0):t||(o.play(),t=!0)}t&&(e.ikSolver=new a.CCDIKSolver(e),void 0!==e.geometry.grants&&(e.grantSolver=new a.MMDGrantSolver(e)))}},setCameraAnimation:function(e){void 0!==e.animations&&(e.mixer=new a.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())},unifyAnimationDuration:function(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,n=0;n0,i=!0,s={};var l=function(e,n){null==n&&(n=1);var o=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,o=2;break;case"sshort":s=Int16Array,o=2;break;case"uint":s=Uint32Array,o=4;break;case"sint":s=Int32Array,o=4;break;case"float":s=Float32Array,o=4;break;case"complex":case"double":s=Float64Array,o=8}var l=new s(t.slice(r,r+=n*o));return a!=i&&(l=function(e,t){for(var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=0;ai;n--,i++){var o=r[i];r[i]=r[n],r[n]=o}return e}(l,o)),1==n?l[0]:l}("uchar",e.byteLength),u=l.length,c=null,f=0;for(p=1;p13)&&32!==a?n+=String.fromCharCode(a):(""!==n&&(l[u]=c(n,o),u++),n="");return""!==n&&(l[u]=c(n,o),u++),l}(t);else if("raw"===s.encoding){for(var h=new Uint8Array(t.length),p=0;p0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,n=this.object.geometry.vertices;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){var a=this.normals,n=this.object.geometry.normals;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addColor:function(e,t,r){var a=this.colors,n=this.object.geometry.colors;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addUV:function(e,t,r){var a=this.uvs,n=this.object.geometry.uvs;n.push(a[e+0],a[e+1]),n.push(a[t+0],a[t+1]),n.push(a[r+0],a[r+1])},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,a,n,i,o,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),f=this.parseVertexIndex(t,u),d=this.parseVertexIndex(r,u);if(this.addVertex(c,f,d),void 0!==a&&""!==a){var h=this.uvs.length;c=this.parseUVIndex(a,h),f=this.parseUVIndex(n,h),d=this.parseUVIndex(i,h),this.addUV(c,f,d)}if(void 0!==o&&""!==o){var p=this.normals.length;c=this.parseNormalIndex(o,p),f=o===s?c:this.parseNormalIndex(s,p),d=o===l?c:this.parseNormalIndex(l,p),this.addNormal(c,f,d)}this.colors.length>0&&this.addColor(c,f,d)},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,r=0,a=e.length;r0){var w=b.split("/");v.push(w)}}var x=v[0];for(g=1,y=v.length-1;g1){var C=c[1].trim().toLowerCase();o.object.smooth="0"!==C&&"off"!==C}else o.object.smooth=!0;(Y=o.object.currentMaterial())&&(Y.smooth=o.object.smooth)}o.finalize();var R=new a.Group;R.materialLibraries=[].concat(o.materialLibraries);for(d=0,h=o.objects.length;d0?B.addAttribute("normal",new a.Float32BufferAttribute(I.normals,3)):B.computeVertexNormals(),I.colors.length>0&&(j=!0,B.addAttribute("color",new a.Float32BufferAttribute(I.colors,3))),I.uvs.length>0&&B.addAttribute("uv",new a.Float32BufferAttribute(I.uvs,2));for(var V,z=[],G=0,H=N.length;G1){for(G=0,H=N.length;Gf){f=d;var r='Download of "'+e.url+'": '+(100*d).toFixed(2)+"%";u.onProgress("progressLoad",r,d)}}}var h=new a.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.load(e.url,c,i,o)}},r.prototype.run=function(e,r){this._applyPrepData(e);var a=e.checkResourceDescriptorFiles(e.resources,[{ext:"obj",type:"ArrayBuffer",ignore:!1},{ext:"mtl",type:"String",ignore:!1},{ext:"zip",type:"String",ignore:!0}]);t.isValid(r)&&(this.terminateWorkerOnLoad=!1,this.workerSupport=r,this.logging.enabled=this.workerSupport.logging.enabled,this.logging.debug=this.workerSupport.logging.debug);var n=this;this._loadMtl(a.mtl,(function(t){null!==t&&n.meshBuilder.setMaterials(t),n._loadObj(a.obj,n.callbacks.onLoad,null,null,n.callbacks.onMeshAlter,e.useAsync)}),e.crossOrigin,e.materialOptions)},r.prototype._applyPrepData=function(e){t.isValid(e)&&(this.setLogging(e.logging.enabled,e.logging.debug),this.setModelName(e.modelName),this.setStreamMeshesTo(e.streamMeshesTo),this.meshBuilder.setMaterials(e.materials),this.setUseIndices(e.useIndices),this.setDisregardNormals(e.disregardNormals),this.setMaterialPerSmoothingGroup(e.materialPerSmoothingGroup),this._setCallbacks(e.getCallbacks()))},r.prototype.parse=function(e){if(!t.isValid(e))return console.warn("Provided content is not a valid ArrayBuffer or String."),this.loaderRootNode;this.logging.enabled&&console.time("OBJLoader2 parse: "+this.modelName),this.meshBuilder.init();var r=new o;r.setLogging(this.logging.enabled,this.logging.debug),r.setMaterialPerSmoothingGroup(this.materialPerSmoothingGroup),r.setUseIndices(this.useIndices),r.setDisregardNormals(this.disregardNormals),r.setMaterials(this.meshBuilder.getMaterials());var a=this;r.setCallbackMeshBuilder((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}));if(r.setCallbackProgress((function(e,t){a.onProgress("progressParse",e,t)})),e instanceof ArrayBuffer||e instanceof Uint8Array)this.logging.enabled&&console.info("Parsing arrayBuffer..."),r.parse(e);else{if(!("string"==typeof e||e instanceof String))throw"Provided content was neither of type String nor Uint8Array! Aborting...";this.logging.enabled&&console.info("Parsing text..."),r.parseText(e)}return this.logging.enabled&&console.timeEnd("OBJLoader2 parse: "+this.modelName),this.loaderRootNode},r.prototype.parseAsync=function(e,r){var a=this,n=!1,i=function(){r({detail:{loaderRootNode:a.loaderRootNode,modelName:a.modelName,instanceNo:a.instanceNo}}),n&&a.logging.enabled&&console.timeEnd("OBJLoader2 parseAsync: "+a.modelName)};t.isValid(e)?n=!0:(console.warn("Provided content is not a valid ArrayBuffer."),i()),n&&this.logging.enabled&&console.time("OBJLoader2 parseAsync: "+this.modelName),this.meshBuilder.init();this.workerSupport.validate((function(e,r){var a="";return a+="/**\n",a+=" * This code was constructed by OBJLoader2 buildCode.\n",a+=" */\n\n",a+="THREE = { LoaderSupport: {} };\n\n",a+=e("LoaderSupport.Validator",t),a+=r("Parser",o)}),"Parser"),this.workerSupport.setCallbacks((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}),i),a.terminateWorkerOnLoad&&this.workerSupport.setTerminateRequested(!0);var s={},l=this.meshBuilder.getMaterials();for(var u in l)s[u]=u;this.workerSupport.run({params:{useAsync:!0,materialPerSmoothingGroup:this.materialPerSmoothingGroup,useIndices:this.useIndices,disregardNormals:this.disregardNormals},logging:{enabled:this.logging.enabled,debug:this.logging.debug},materials:{materials:s},data:{input:e,options:null}})};var o=function(){function e(){this.callbackProgress=null,this.callbackMeshBuilder=null,this.contentRef=null,this.legacyMode=!1,this.materials={},this.useAsync=!1,this.materialPerSmoothingGroup=!1,this.useIndices=!1,this.disregardNormals=!1,this.vertices=[],this.colors=[],this.normals=[],this.uvs=[],this.rawMesh={objectName:"",groupName:"",activeMtlName:"",mtllibName:"",faceType:-1,subGroups:[],subGroupInUse:null,smoothingGroup:{splitMaterials:!1,normalized:-1,real:-1},counts:{doubleIndicesCount:0,faceCount:0,mtlCount:0,smoothingGroupCount:0}},this.inputObjectCount=1,this.outputObjectCount=1,this.globalCounts={vertices:0,faces:0,doubleIndicesCount:0,lineByte:0,currentByte:0,totalBytes:0},this.logging={enabled:!0,debug:!1}}return e.prototype.resetRawMesh=function(){this.rawMesh.subGroups=[],this.rawMesh.subGroupInUse=null,this.rawMesh.smoothingGroup.normalized=-1,this.rawMesh.smoothingGroup.real=-1,this.pushSmoothingGroup(1),this.rawMesh.counts.doubleIndicesCount=0,this.rawMesh.counts.faceCount=0,this.rawMesh.counts.mtlCount=0,this.rawMesh.counts.smoothingGroupCount=0},e.prototype.setUseAsync=function(e){this.useAsync=e},e.prototype.setMaterialPerSmoothingGroup=function(e){this.materialPerSmoothingGroup=e},e.prototype.setUseIndices=function(e){this.useIndices=e},e.prototype.setDisregardNormals=function(e){this.disregardNormals=e},e.prototype.setMaterials=function(e){this.materials=n.default.Validator.verifyInput(e,this.materials),this.materials=n.default.Validator.verifyInput(this.materials,{})},e.prototype.setCallbackMeshBuilder=function(e){if(!n.default.Validator.isValid(e))throw'Unable to run as no "MeshBuilder" callback is set.';this.callbackMeshBuilder=e},e.prototype.setCallbackProgress=function(e){this.callbackProgress=e},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.configure=function(){if(this.pushSmoothingGroup(1),this.logging.enabled){var e=Object.keys(this.materials),t="OBJLoader2.Parser configuration:"+(e.length>0?"\n\tmaterialNames:\n\t\t- "+e.join("\n\t\t- "):"\n\tmaterialNames: None")+"\n\tuseAsync: "+this.useAsync+"\n\tmaterialPerSmoothingGroup: "+this.materialPerSmoothingGroup+"\n\tuseIndices: "+this.useIndices+"\n\tdisregardNormals: "+this.disregardNormals+"\n\tcallbackMeshBuilderName: "+this.callbackMeshBuilder.name+"\n\tcallbackProgressName: "+this.callbackProgress.name;console.info(t)}},e.prototype.parse=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parse"),this.configure();var t=new Uint8Array(e);this.contentRef=t;var r=t.byteLength;this.globalCounts.totalBytes=r;for(var a,n=new Array(128),i="",o=0,s=0,l=0;l0&&(n[o++]=i),i="";break;case 47:i.length>0&&(n[o++]=i),s++,i="";break;case 10:i.length>0&&(n[o++]=i),i="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=l,this.processLine(n,o,s),o=0,s=0;break;case 13:break;default:i+=String.fromCharCode(a)}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parse")},e.prototype.parseText=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parseText"),this.configure(),this.legacyMode=!0,this.contentRef=e;var t=e.length;this.globalCounts.totalBytes=t;for(var r,a=new Array(128),n="",i=0,o=0,s=0;s0&&(a[i++]=n),n="";break;case"/":n.length>0&&(a[i++]=n),o++,n="";break;case"\n":n.length>0&&(a[i++]=n),n="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=s,this.processLine(a,i,o),i=0,o=0;break;case"\r":break;default:n+=r}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parseText")},e.prototype.processLine=function(e,t,r){if(!(t<1)){var a,n,i,o,s=function(e,t,r,a){var n="";if(a>r){var i;if(t)for(i=r;i4&&(this.colors.push(parseFloat(e[4])),this.colors.push(parseFloat(e[5])),this.colors.push(parseFloat(e[6])));break;case"vt":this.uvs.push(parseFloat(e[1])),this.uvs.push(parseFloat(e[2]));break;case"vn":this.normals.push(parseFloat(e[1])),this.normals.push(parseFloat(e[2])),this.normals.push(parseFloat(e[3]));break;case"f":if(a=t-1,0===r)for(this.checkFaceType(0),i=2,n=a;i0?n-1:n+a.vertices.length/3),o=a.rawMesh.subGroupInUse.vertices;o.push(a.vertices[i++]),o.push(a.vertices[i++]),o.push(a.vertices[i]);var s=a.colors.length>0?i:null;if(null!==s){var l=a.rawMesh.subGroupInUse.colors;l.push(a.colors[s++]),l.push(a.colors[s++]),l.push(a.colors[s])}if(t){var u=parseInt(t),c=2*(u>0?u-1:u+a.uvs.length/2),f=a.rawMesh.subGroupInUse.uvs;f.push(a.uvs[c++]),f.push(a.uvs[c])}if(r){var d=parseInt(r),h=3*(d>0?d-1:d+a.normals.length/3),p=a.rawMesh.subGroupInUse.normals;p.push(a.normals[h++]),p.push(a.normals[h++]),p.push(a.normals[h])}};if(this.useIndices){var o=e+(t?"_"+t:"_n")+(r?"_"+r:"_n"),s=this.rawMesh.subGroupInUse.indexMappings[o];n.default.Validator.isValid(s)?this.rawMesh.counts.doubleIndicesCount++:(s=this.rawMesh.subGroupInUse.vertices.length/3,i(),this.rawMesh.subGroupInUse.indexMappings[o]=s,this.rawMesh.subGroupInUse.indexMappingsCount++),this.rawMesh.subGroupInUse.indices.push(s)}else i();this.rawMesh.counts.faceCount++},e.prototype.createRawMeshReport=function(e){return"Input Object number: "+e+"\n\tObject name: "+this.rawMesh.objectName+"\n\tGroup name: "+this.rawMesh.groupName+"\n\tMtllib name: "+this.rawMesh.mtllibName+"\n\tVertex count: "+this.vertices.length/3+"\n\tNormal count: "+this.normals.length/3+"\n\tUV count: "+this.uvs.length/2+"\n\tSmoothingGroup count: "+this.rawMesh.counts.smoothingGroupCount+"\n\tMaterial count: "+this.rawMesh.counts.mtlCount+"\n\tReal MeshOutputGroup count: "+this.rawMesh.subGroups.length},e.prototype.finalizeRawMesh=function(){var e,t,r=[],a=0,n=0,i=0,o=0,s=0,l=0;for(var u in this.rawMesh.subGroups)if((e=this.rawMesh.subGroups[u]).vertices.length>0){if((t=e.indices).length>0&&n>0)for(var c in t)t[c]=t[c]+n;r.push(e),a+=e.vertices.length,n+=e.indexMappingsCount,i+=e.indices.length,o+=e.colors.length,l+=e.uvs.length,s+=e.normals.length}var f=null;return r.length>0&&(f={name:""!==this.rawMesh.groupName?this.rawMesh.groupName:this.rawMesh.objectName,subGroups:r,absoluteVertexCount:a,absoluteIndexCount:i,absoluteColorCount:o,absoluteNormalCount:s,absoluteUvCount:l,faceCount:this.rawMesh.counts.faceCount,doubleIndicesCount:this.rawMesh.counts.doubleIndicesCount}),f},e.prototype.processCompletedMesh=function(){var e=this.finalizeRawMesh();if(n.default.Validator.isValid(e)){if(this.colors.length>0&&this.colors.length!==this.vertices.length)throw"Vertex Colors were detected, but vertex count and color count do not match!";this.logging.enabled&&this.logging.debug&&console.debug(this.createRawMeshReport(this.inputObjectCount)),this.inputObjectCount++,this.buildMesh(e);var t=this.globalCounts.currentByte/this.globalCounts.totalBytes;return this.callbackProgress("Completed [o: "+this.rawMesh.objectName+" g:"+this.rawMesh.groupName+"] Total progress: "+(100*t).toFixed(2)+"%",t),this.resetRawMesh(),!0}return!1},e.prototype.buildMesh=function(e){var t=e.subGroups,r=new Float32Array(e.absoluteVertexCount);this.globalCounts.vertices+=e.absoluteVertexCount/3,this.globalCounts.faces+=e.faceCount,this.globalCounts.doubleIndicesCount+=e.doubleIndicesCount;var a,i,o,s,l,u,c,f=e.absoluteIndexCount>0?new Uint32Array(e.absoluteIndexCount):null,d=e.absoluteColorCount>0?new Float32Array(e.absoluteColorCount):null,h=e.absoluteNormalCount>0?new Float32Array(e.absoluteNormalCount):null,p=e.absoluteUvCount>0?new Float32Array(e.absoluteUvCount):null,m=n.default.Validator.isValid(d),v=[],g=t.length>1,y=0,b=[],w=[],x=0,_=0,A=0,E=0,S=0,M=0,T=0;for(var P in t)if(t.hasOwnProperty(P)){if(c=(a=t[P]).materialName,u=this.rawMesh.faceType<4?c+(m?"_vertexColor":"")+(0===a.smoothingGroup?"_flat":""):6===this.rawMesh.faceType?"defaultPointMaterial":"defaultLineMaterial",s=this.materials[c],l=this.materials[u],!n.default.Validator.isValid(s)&&!n.default.Validator.isValid(l)){var F=m?"defaultVertexColorMaterial":"defaultMaterial";s=this.materials[F],this.logging.enabled&&console.warn('object_group "'+a.objectName+"_"+a.groupName+'" was defined with unresolvable material "'+c+'"! Assigning "'+F+'".'),(c=F)===u&&(l=s,u=F)}if(!n.default.Validator.isValid(l)){var O={materialNameOrg:c,materialName:u,materialProperties:{vertexColors:m?2:0,flatShading:0===a.smoothingGroup}},L={cmd:"materialData",materials:{materialCloneInstructions:O}};this.callbackMeshBuilder(L),this.useAsync&&(this.materials[u]=O)}if(g?((i=b[u])||(i=y,b[u]=y,v.push(u),y++),o={start:M,count:T=this.useIndices?a.indices.length:a.vertices.length/3,index:i},w.push(o),M+=T):v.push(u),r.set(a.vertices,x),x+=a.vertices.length,f&&(f.set(a.indices,_),_+=a.indices.length),d&&(d.set(a.colors,A),A+=a.colors.length),h&&(h.set(a.normals,E),E+=a.normals.length),p&&(p.set(a.uvs,S),S+=a.uvs.length),this.logging.enabled&&this.logging.debug){var C=n.default.Validator.isValid(i)?"\n\t\tmaterialIndex: "+i:"",R="\tOutput Object no.: "+this.outputObjectCount+"\n\t\tgroupName: "+a.groupName+"\n\t\tIndex: "+a.index+"\n\t\tfaceType: "+this.rawMesh.faceType+"\n\t\tmaterialName: "+a.materialName+"\n\t\tsmoothingGroup: "+a.smoothingGroup+C+"\n\t\tobjectName: "+a.objectName+"\n\t\t#vertices: "+a.vertices.length/3+"\n\t\t#indices: "+a.indices.length+"\n\t\t#colors: "+a.colors.length/3+"\n\t\t#uvs: "+a.uvs.length/2+"\n\t\t#normals: "+a.normals.length/3;console.debug(R)}}this.outputObjectCount++,this.callbackMeshBuilder({cmd:"meshData",progress:{numericalValue:this.globalCounts.currentByte/this.globalCounts.totalBytes},params:{meshName:e.name},materials:{multiMaterial:g,materialNames:v,materialGroups:w},buffers:{vertices:r,indices:f,colors:d,normals:h,uvs:p},geometryType:this.rawMesh.faceType<4?0:6===this.rawMesh.faceType?2:1},[r.buffer],n.default.Validator.isValid(f)?[f.buffer]:null,n.default.Validator.isValid(d)?[d.buffer]:null,n.default.Validator.isValid(h)?[h.buffer]:null,n.default.Validator.isValid(p)?[p.buffer]:null)},e.prototype.finalizeParsing=function(){if(this.logging.enabled&&console.info("Global output object count: "+this.outputObjectCount),this.processCompletedMesh()&&this.logging.enabled){var e="Overall counts: \n\tVertices: "+this.globalCounts.vertices+"\n\tFaces: "+this.globalCounts.faces+"\n\tMultiple definitions: "+this.globalCounts.doubleIndicesCount;console.info(e)}},e}();return r.prototype.loadMtl=function(e,t,r,a,i){var o=new n.default.ResourceDescriptor(e,"MTL");o.setContent(t),this._loadMtl(o,r,a,i)},r.prototype._loadMtl=function(e,r,n,o){void 0===i.default&&console.error('"THREE.MTLLoader" is not available. "THREE.OBJLoader2" requires it for loading MTL files.'),t.isValid(e)&&this.logging.enabled&&console.time("Loading MTL: "+e.name);var s=[],l=this,u=function(a){var n=[];if(t.isValid(a))for(var i in a.preload(),n=a.materials)n.hasOwnProperty(i)&&(s[i]=n[i]);t.isValid(e)&&l.logging.enabled&&console.timeEnd("Loading MTL: "+e.name),r(s,a)};if(t.isValid(e)&&(t.isValid(e.content)||t.isValid(e.url))){var c=new i.default(this.manager);if(n=t.verifyInput(n,"anonymous"),c.setCrossOrigin(n),c.setPath(e.path),t.isValid(o)&&c.setMaterialOptions(o),t.isValid(e.content))u(t.isValid(e.content)?c.parse(e.content):null);else if(t.isValid(e.url)){new a.FileLoader(this.manager).load(e.url,(function(t){e.content=t,u(c.parse(t))}),this._onProgress,this._onError)}}else u()},r}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.littleEndian=!0};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(e,(function(r){t(i.parse(r,e))}),r,n)},parse:function(e,t){var r=a.LoaderUtils.decodeText(e),n=function(e){var t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),a=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=a[1],t.headerLen=a[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(var n=0,i=t.fields.length;n0&&v.addAttribute("position",new a.Float32BufferAttribute(i,3)),o.length>0&&v.addAttribute("normal",new a.Float32BufferAttribute(o,3)),s.length>0&&v.addAttribute("color",new a.Float32BufferAttribute(s,3)),v.computeBoundingSphere();var g=new a.PointsMaterial({size:.005});s.length>0?g.vertexColors=!0:g.color.setHex(16777215*Math.random());var y=new a.Points(v,g),b=t.split("").reverse().join("");return b=(b=/([^\/]*)/.exec(b))[1].split("").reverse().join(""),y.name=b,y}console.error("THREE.PCDLoader: binary_compressed files are not supported")}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function n(e,t){var r=parseInt(m[v].substr(e,t));if(r){var a=function(e,t){return"s"+Math.min(e,t)+"e"+Math.max(e,t)}(y,r);void 0===p[a]&&(d.push([y-1,r-1,1]),p[a]=d.length-1)}}for(var i,o,s,l,u,c={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},f=[],d=[],h={},p={},m=e.split("\n"),v=0,g=m.length;v=t.elements[u].count&&(u++,c=0);var h=n(t.elements[u].properties,d);s(a,t.elements[u].name,h),c++}}return o(a)}function o(e){var t=new a.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.addAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.addAttribute("normal",new a.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.addAttribute("uv",new a.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.addAttribute("color",new a.Float32BufferAttribute(e.colors,3)),t.computeBoundingSphere(),t}function s(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){var a=r.vertex_indices||r.vertex_index;3===a.length?e.indices.push(a[0],a[1],a[2]):4===a.length&&(e.indices.push(a[0],a[1],a[3]),e.indices.push(a[1],a[2],a[3]))}}function l(e,t,r,a){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,a),2];case"uint16":case"ushort":return[e.getUint16(t,a),2];case"int32":case"int":return[e.getInt32(t,a),4];case"uint32":case"uint":return[e.getUint32(t,a),4];case"float32":case"float":return[e.getFloat32(t,a),4];case"float64":case"double":return[e.getFloat64(t,a),8]}}function u(e,t,r,a){for(var n,i={},o=0,s=0;s>7&1),s=n>>6&1,l=1==(n>>5&1),u=31&n,c=0,f=0;if(l?(c=(t[2]<<16)+(t[3]<<8)+t[4],f=(t[5]<<16)+(t[6]<<8)+t[7]):(c=t[2]+(t[3]<<8)+(t[4]<<16),f=t[5]+(t[6]<<8)+(t[7]<<16)),0===a)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==a)throw new Error("PRWM decoder: Unsupported format version: "+a);if(!o){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==f)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}var d,h,p,m,v,g,y,b,w=8,x={};for(b=0;b>7&1,m=1+(n>>4&3),w++,g=i(e,v=r[15&n],w=4*Math.ceil(w/4),m*c,l),w+=v.BYTES_PER_ELEMENT*m*c,x[d]={type:p,cardinality:m,values:g}}return w=4*Math.ceil(w/4),y=null,o&&(y=i(e,1===s?Uint32Array:Uint16Array,w,f,l)),{version:a,attributes:x,indices:y}}(e),s=Object.keys(o.attributes),l=new a.BufferGeometry;for(n=0;n0;return 25===h?(r=p?a.RGBA_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,t=4):24===h?(r=p?a.RGBA_PVRTC_2BPPV1_Format:a.RGB_PVRTC_2BPPV1_Format,t=2):console.error("THREE.PVRLoader: Unknown PVR format:",h),e.dataPtr=o,e.bpp=t,e.format=r,e.width=l,e.height=s,e.numSurfaces=d,e.numMipmaps=u+1,e.isCubemap=6===d,n._extract(e)},n._extract=function(e){var t,r={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},a=e.buffer,n=e.dataPtr,i=e.bpp,o=e.numSurfaces,s=0,l=0,u=0,c=0,f=0;2===i?(l=8,u=4):(l=4,u=4),t=l*u*i/8,r.mipmaps.length=e.numMipmaps*o;for(var d=0;d>d,p=e.height>>d;(c=h/l)<2&&(c=2),(f=p/u)<2&&(f=2),s=c*f*t;for(var m=0;m>5&31)/31,n=(_>>10&31)/31):(t=o,r=s,n=l)}for(var A=1;A<=3;A++){var E=y+12*A;m.push(c.getFloat32(E,!0)),m.push(c.getFloat32(E+4,!0)),m.push(c.getFloat32(E+8,!0)),v.push(b,w,x),d&&i.push(t,r,n)}}return p.addAttribute("position",new a.BufferAttribute(new Float32Array(m),3)),p.addAttribute("normal",new a.BufferAttribute(new Float32Array(v),3)),d&&(p.addAttribute("color",new a.BufferAttribute(new Float32Array(i),3)),p.hasColors=!0,p.alpha=u),p}(r):function(e){for(var t,r=new a.BufferGeometry,n=/facet([\s\S]*?)endfacet/g,i=0,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+o+o+o,"g"),l=new RegExp("normal"+o+o+o,"g"),u=[],c=[],f=new a.Vector3;null!==(t=n.exec(e));){for(var d=0,h=0,p=t[0];null!==(t=l.exec(p));)f.x=parseFloat(t[1]),f.y=parseFloat(t[2]),f.z=parseFloat(t[3]),h++;for(;null!==(t=s.exec(p));)u.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),c.push(f.x,f.y,f.z),d++;1!==h&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==d&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}return r.addAttribute("position",new a.Float32BufferAttribute(u,3)),r.addAttribute("normal",new a.Float32BufferAttribute(c,3)),r}("string"!=typeof(t=e)?a.LoaderUtils.decodeText(new Uint8Array(t)):t)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e,t,a,n,i,o,s,l){n=n*Math.PI/180,t=Math.abs(t),a=Math.abs(a);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,f=Math.cos(n)*u+Math.sin(n)*c,d=-Math.sin(n)*u+Math.cos(n)*c,h=t*t,p=a*a,m=f*f,v=d*d,g=m/h+v/p;if(g>1){var y=Math.sqrt(g);h=(t*=y)*t,p=(a*=y)*a}var b=h*v+p*m,w=(h*p-b)/b,x=Math.sqrt(Math.max(0,w));i===o&&(x=-x);var _=x*t*d/a,A=-x*a*f/t,E=Math.cos(n)*_-Math.sin(n)*A+(s.x+l.x)/2,S=Math.sin(n)*_+Math.cos(n)*A+(s.y+l.y)/2,M=r(1,0,(f-_)/t,(d-A)/a),T=r((f-_)/t,(d-A)/a,(-f-_)/t,(-d-A)/a)%(2*Math.PI);e.currentPath.absellipse(E,S,t,a,M,M+T,0===o,n)}function r(e,t,r,a){var n=e*r+t*a,i=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+a*a),o=Math.acos(Math.max(-1,Math.min(1,n/i)));return e*a-t*r<0&&(o=-o),o}function n(e,t){return t=Object.assign({},t),e.hasAttribute("fill")&&(t.fill=e.getAttribute("fill")),""!==e.style.fill&&(t.fill=e.style.fill),t}function i(e){return"none"!==e.fill&&"transparent"!==e.fill}function o(e,t){return 2*e-(t-e)}function s(e){for(var t=e.split(/[\s,]+|(?=\s?[+\-])/),r=0;r0){var p=[];for(u=0;u=t.end)return 0;this.position=t.cur;try{var r=this.readChunk(e);return t.cur+=r.size,r.id}catch(e){return this.debugMessage("Unable to read chunk at "+this.position),0}},resetPosition:function(){this.position-=6},readByte:function(e){var t=e.getUint8(this.position,!0);return this.position+=1,t},readFloat:function(e){try{var t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}},readInt:function(e){var t=e.getInt32(this.position,!0);return this.position+=4,t},readShort:function(e){var t=e.getInt16(this.position,!0);return this.position+=2,t},readDWord:function(e){var t=e.getUint32(this.position,!0);return this.position+=4,t},readWord:function(e){var t=e.getUint16(this.position,!0);return this.position+=2,t},readString:function(e,t){for(var r="",a=0;a256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case a:case n:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;var g=!1,y=!1,b=!1;switch(v.image_type){case i:g=!0,y=!0;break;case r:y=!0;break;case o:g=!0;break;case a:break;case s:g=!0,b=!0;break;case n:b=!0}var w=document.createElement("canvas");w.width=v.width,w.height=v.height;var x=w.getContext("2d"),_=x.createImageData(v.width,v.height),A=function(e,t,r,a,n){var i,o,s,l;if(o=r.pixel_size>>3,s=r.width*r.height*o,t&&(l=n.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,c,f;i=new Uint8Array(s);for(var d=0,h=new Uint8Array(o);d>u){default:case d:i=0,s=1,m=t,o=0,p=1,g=r;break;case c:i=0,s=1,m=t,o=r-1,p=-1,g=-1;break;case h:i=t-1,s=-1,m=-1,o=0,p=1,g=r;break;case f:i=t-1,s=-1,m=-1,o=r-1,p=-1,g=-1}if(b)switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f++)l=s[f],e[4*(u+d*c)+0]=l,e[4*(u+d*c)+1]=l,e[4*(u+d*c)+2]=l,e[4*(u+d*c)+3]=255}(e,o,p,g,i,s,m,a);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=2)e[4*(l+f*u)+0]=s[c+0],e[4*(l+f*u)+1]=s[c+0],e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+3]=s[c+1]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s,l){var u,c,f,d=l,h=0,p=v.width;for(f=t;f!==a;f+=r)for(c=n;c!==o;c+=i,h++)u=s[h],e[4*(c+p*f)+3]=255,e[4*(c+p*f)+2]=d[3*u+0],e[4*(c+p*f)+1]=d[3*u+1],e[4*(c+p*f)+0]=d[3*u+2]}(e,o,p,g,i,s,m,a,n);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f+=2)l=s[f+0]+(s[f+1]<<8),e[4*(u+d*c)+0]=(31744&l)>>7,e[4*(u+d*c)+1]=(992&l)>>2,e[4*(u+d*c)+2]=(31&l)>>3,e[4*(u+d*c)+3]=32768&l?0:255}(e,o,p,g,i,s,m,a);break;case 24:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=3)e[4*(l+f*u)+3]=255,e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2]}(e,o,p,g,i,s,m,a);break;case 32:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=4)e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2],e[4*(l+f*u)+3]=s[c+3]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}}(_.data,v.width,v.height,A.pixel_data,A.palettes);return x.putImageData(_,0,0),w}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.reversed=!1};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){var t,r=[];e.forEach((function(e){"m"===e.type.toLowerCase()?(t=[e],r.push(t)):"z"!==e.type.toLowerCase()&&t.push(e)}));var a=[];return r.forEach((function(e){var t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};a.push(t);for(var r=e.length-1;r>0;r--){var n=e[r];t={type:n.type};void 0!==n.x2&&void 0!==n.y2?(t.x1=n.x2,t.y1=n.y2,t.x2=n.x1,t.y2=n.y1):void 0!==n.x1&&void 0!==n.y1&&(t.x1=n.x1,t.y1=n.y1),t.x=e[r-1].x,t.y=e[r-1].y,a.push(t)}})),a}return"undefined"==typeof opentype?(console.warn("THREE.TTFLoader: The loader requires opentype.js. Make sure it's included before using the loader."),null):function(e,r){for(var a=Math.round,n={},i=1e5/(72*(e.unitsPerEm||2048)),o=0;o-1;o--){var s=i[o];if(/{.*[{\[]/.test(s))(l=s.split("{").join("{\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);else if(/\].*}/.test(s)){var l;(l=s.split("]").join("]\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l)}if(/}.*}/.test(s))(l=s.split("}").join("}\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);/^\b[^\s]+\b$/.test(s.trim())?(i[o+1]=s+" "+i[o+1].trim(),i.splice(o,1)):s.indexOf("coord")>-1&&s.indexOf("[")<0&&s.indexOf("{")<0&&(i[o]+=" Coordinate {}")}var u=i.shift();return/V1.0/.exec(u)?console.warn("THREE.VRMLLoader: V1.0 not supported yet."):/V2.0/.exec(u)&&function(e,n){var i={},o=/(\b|\-|\+)([\d\.e]+)/,s=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g,l=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g;function u(e,t,r,n,i){for(var o=!0===i?1:-1,s=[],l={},u={},c=0;cu.y:m.y>=l.y&&m.y0)for(var d=0;d0&&this.indexes.push(c),c=[]):c.push(parseInt(i[d])));/]/.exec(t)&&(c.length>0&&this.indexes.push(c),c=[],this.isRecordingFaces=!1,e[this.recordingFieldname]=this.indexes)}else if(this.isRecordingPoints){if("Coordinate"==e.nodeType)for(;null!==(i=l.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2]),z:parseFloat(i[3])},this.points.push(n);if("TextureCoordinate"==e.nodeType)for(;null!==(i=s.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2])},this.points.push(n);/]/.exec(t)&&(this.isRecordingPoints=!1,e.points=this.points)}else if(this.isRecordingAngles){if(i.length>0)for(d=0;d-1&&"PointLight"===o.nodeType&&(o.nodeType="AmbientLight");var c=void 0===o.on||o.on,f=void 0!==o.intensity?o.intensity:1,d=new a.Color;if(o.color&&d.copy(o.color),"AmbientLight"===o.nodeType)(l=new a.AmbientLight(d,f)).visible=c,s.add(l);else if("PointLight"===o.nodeType){var h=0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),(l=new a.PointLight(d,f,h)).visible=c,s.add(l)}else if("SpotLight"===o.nodeType){f=1,h=0;var p=Math.PI/3;c=!0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),void 0!==o.cutOffAngle&&(p=o.cutOffAngle),(l=new a.SpotLight(d,f,h,p,0)).visible=c,s.add(l)}else if("Transform"===o.nodeType||"Group"===o.nodeType){if(l=new a.Object3D,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),void 0!==o.translation){var m=o.translation;l.position.set(m.x,m.y,m.z)}if(void 0!==o.rotation){var v=o.rotation;l.quaternion.setFromAxisAngle(new a.Vector3(v.x,v.y,v.z),v.w)}if(void 0!==o.scale){var g=o.scale;l.scale.set(g.x,g.y,g.z)}s.add(l)}else if("Shape"===o.nodeType)l=new a.Mesh,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),s.add(l);else if("Background"===o.nodeType){var y=2e4,b=new a.SphereBufferGeometry(y,20,20),w=new a.MeshBasicMaterial({fog:!1,side:a.BackSide});if(o.skyColor.length>1)u(b,y,o.skyAngle,o.skyColor,!0),w.vertexColors=a.VertexColors;else{var x=o.skyColor[0];w.color.setRGB(x.r,x.b,x.g)}if(n.add(new a.Mesh(b,w)),void 0!==o.groundColor){y=12e3;var _=new a.SphereBufferGeometry(y,20,20,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),A=new a.MeshBasicMaterial({fog:!1,side:a.BackSide,vertexColors:a.VertexColors});u(_,y,o.groundAngle,o.groundColor,!1),n.add(new a.Mesh(_,A))}}else{if(/geometry/.exec(o.string)){if("Box"===o.nodeType){g=o.size;s.geometry=new a.BoxBufferGeometry(g.x,g.y,g.z)}else if("Cylinder"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.radius,o.radius,o.height);else if("Cone"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.topRadius,o.bottomRadius,o.height);else if("Sphere"===o.nodeType)s.geometry=new a.SphereBufferGeometry(o.radius);else if("IndexedFaceSet"===o.nodeType){var E,S,M,T,P,F=new a.BufferGeometry,O=[],L=[];for(B=0,M=o.children.length;B-1){var C=/DEF\s+([^\s]+)/.exec(V.string)[1];i[C]=O.slice(0)}if(V.string.indexOf("USE")>-1){W=/USE\s+([^\s]+)/.exec(V.string)[1];O=i[W]}}}var R=0;if(o.coordIndex){var k=[],I=[];for(E=new a.Vector3,S=new a.Vector2,B=0,M=o.coordIndex.length;B=3&&R0&&F.addAttribute("uv",new a.Float32BufferAttribute(L,2)),F.computeVertexNormals(),F.computeBoundingSphere(),/DEF/.exec(o.string)&&(F.name=/DEF ([^\s]+)/.exec(o.string)[1],i[F.name]=F),s.geometry=F}return}if(/appearance/.exec(o.string)){for(var B=0;B>1^-(1&c),a[n]=s*(l+o),n+=i}},n.prototype.decompressIndices_=function(e,t,r,a,n){for(var i=0,o=0;o>1,p=e.charCodeAt(u+4)+1>>1,m=e.charCodeAt(u+5)+1>>1;l[s++]=n[0]*(c+h),l[s++]=n[1]*(f+p),l[s++]=n[2]*(d+m),l[s++]=n[0]*h,l[s++]=n[1]*p,l[s++]=n[2]*m}return l},n.prototype.decompressMesh=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=u,d=new Float32Array(o*c),h=0;h>1^-(1&f);l[c]+=d,s[t*u+c]=l[c],o[t*u+c]=a[c]*(l[c]+r[c])}},n.prototype.accumulateNormal=function(e,t,r,a,n){var i=a[8*e],o=a[8*e+1],s=a[8*e+2],l=a[8*t],u=a[8*t+1],c=a[8*t+2],f=a[8*r],d=a[8*r+1],h=a[8*r+2];l-=i,f-=i,i=(u-=o)*(h-=s)-(c-=s)*(d-=o),o=c*f-l*h,s=l*d-u*f,n[3*e]+=i,n[3*e+1]+=o,n[3*e+2]+=s,n[3*t]+=i,n[3*t+1]+=o,n[3*t+2]+=s,n[3*r]+=i,n[3*r+1]+=o,n[3*r+2]+=s},n.prototype.decompressMesh2=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=t.codeRange[0],d=3*t.codeRange[2],h=new Uint16Array(d),p=new Int32Array(3*c),m=new Uint16Array(o),v=new Uint16Array(o*c),g=new Float32Array(o*c),y=0,b=0,w=0;w>1^-(1&O))+v[o*A+F]+v[o*E+F]-v[o*S+F];m[F]=L,v[o*y+F]=L,g[o*y+F]=l[F]*(L+s[F])}y++}else this.copyAttrib(o,v,m,P);this.accumulateNormal(A,E,P,v,p)}else{var C=y-(x-_);h[b++]=C,x===_?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,C);var R=y-(x=e.charCodeAt(f++));h[b++]=R,0===x?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,R);var k=y-(x=e.charCodeAt(f++));if(h[b++]=k,0===x){for(F=0;F<5;F++)m[F]=(v[o*C+F]+v[o*R+F])/2;this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++)}else this.copyAttrib(o,v,m,k);this.accumulateNormal(C,R,k,v,p)}}for(w=0;w>1^-(1&j)),g[o*w+6]=U*N+(B>>1^-(1&B)),g[o*w+7]=U*D+(V>>1^-(1&V))}i(a,n,g,h,void 0,t)},n.prototype.downloadMesh=function(e,t,r,a,n){var i=this,s=0;o(e,(function(e){!function(e){for(;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=new s(3*f/4-(i="="===e[f-2]?2:"="===e[f-1]?1:0)),a=i>0?f-4:f;var d=0;for(t=0,r=0;t>16,o[d++]=(65280&n)>>8,o[d++]=255&n;return 2===i?(n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[d++]=255&n):1===i&&(n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[d++]=n>>8&255,o[d++]=255&n),o}function n(e,a){var n,i,s,l,u=0;if("UInt64"===o.attributes.header_type?u=8:"UInt32"===o.attributes.header_type&&(u=4),"binary"===e.attributes.format&&a){var c,f,d,h,p,m;if("Float32"===e.attributes.type)var v=new Float32Array;else if("Int64"===e.attributes.type)v=new Int32Array;f=(c=r(e["#text"]))[0];for(var g=1;g0?3-h%3:0,(p=[]).push(m),d=3*u;for(g=0;g0){r.attributes={};for(var a=0;a0&&(v[g].text=n(v[g],f)),g++;switch(d[h]){case"PointData":var b=parseInt(c.attributes.NumberOfPoints),w=m.attributes.Normals;if(b>0)for(var x=0,_=v.length;x<_;x++)if(w===v[x].attributes.Name){var A=v[x].attributes.NumberOfComponents;(l=new Float32Array(b*A)).set(v[x].text,0)}break;case"Points":if((b=parseInt(c.attributes.NumberOfPoints))>0){A=m.DataArray.attributes.NumberOfComponents;(s=new Float32Array(b*A)).set(m.DataArray.text,0)}break;case"Strips":var E=parseInt(c.attributes.NumberOfStrips);if(E>0){var S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);var T=E+S.length;u=new Uint32Array(3*T-9*E);var P=0;for(x=0,_=E;x<_;x++){for(var F=[],O=0,L=M[x],C=0;O0&&(C=M[x-1]);var R=0;for(L=M[x],C=0;R0&&(C=M[x-1])}}break;case"Polys":var k=parseInt(c.attributes.NumberOfPolys);if(k>0){S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);T=k+S.length;u=new Uint32Array(3*T-9*k);P=0;var I=0;for(x=0,_=k,C=0;x<_;){var N=[];for(O=0,L=M[x];O=3)for(var C=parseInt(L[0]),R=1,k=0;k=3){var I,N;for(k=0;k=u.byteLength)break}var A=new a.BufferGeometry;return A.setIndex(new a.BufferAttribute(h,1)),A.addAttribute("position",new a.BufferAttribute(f,3)),d.length===f.length&&A.addAttribute("normal",new a.BufferAttribute(d,3)),A}(e)}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(var r=t;r-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,a=0;a127)return!0;return!1}},{key:"ensureBinary",value:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),r=0;r0&&(this.baseDir=this.url.substr(0,this.url.lastIndexOf("/")+1));this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this.mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var a=this._data.indexOf("{",r)+1,n=this._data.indexOf("}",r),i=this._data.indexOf("{",a)+1;if(!(a>0&&n>a)){r=-1===a?this._data.length:n+1;break}var o={children:[]},s=this._readLine(this._data.substr(r,a-r-1)).trim(),l=s.split(/ /g);if(l.length>0?(o.type=l[0],l.length>=2?o.name=l[1]:o.name=l[0]+this.Hierarchies.children.length):(o.name=s,o.type=""),"Animation"===o.type){o.data=this._data.substr(i,n-i).trim();var u=this._hierarchieParse(o,n+1);r=u.end,o.children=u.parent.children}else{var c=this._data.lastIndexOf(";",i>0?Math.min(i,n):n);if(o.data=this._data.substr(a,c-a).trim(),i<=0||n0||!this._currentObject.worked?setTimeout((function(){e.mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.Geometry=new a.Geometry,this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new s,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new a.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new a.Bone;if(e.name=this._currentFrame.name,e.applyMatrix(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(var t in this.HieStack)this.HieStack[t].name===this._currentFrame.parentName&&this.HieStack[t].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,a=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,n=0,(a=this._currentObject.data.indexOf(";;",e)+1)<=0&&(a=this._currentObject.data.length)}else{var o=0;switch(t){case 0:o=this._currentObject.data.indexOf(",",e)+1;break;case 1:o=this._currentObject.data.indexOf(";,",e)+1}switch((0===o||o>a)&&(o=a,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,o-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,o-e))}break;case"MeshNormals":switch(t){case 0:this._readNormalVector1(this._currentObject.data.substr(e,o-e));break;case 1:this._readNormalFace1(this._currentObject.data.substr(e,o-e),n)}}e=o+1,n++,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.Geometry.vertices.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))),this._currentGeo.Geometry.skinIndices.push(new a.Vector4(0,0,0,0)),this._currentGeo.Geometry.skinWeights.push(new a.Vector4(1,0,0,0)),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.Geometry.faces.push(new a.Face3(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),new a.Vector3(1,1,1).normalize()))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.normalVectors.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])))}},{key:"_readNormalFace1",value:function(e,t){var r=this._readLine(e.trim()).substr(2,e.length-4).split(","),a=parseInt(r[0],10),n=this._currentGeo.normalVectors[a];a=parseInt(r[1],10);var i=this._currentGeo.normalVectors[a];a=parseInt(r[2],10);var o=this._currentGeo.normalVectors[a];this._currentGeo.Geometry.faces[t].vertexNormals=[n,i,o]}},{key:"_setMeshNormals",value:function(){for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var a=this._currentObject.data.indexOf(",",e)+1;-1===a&&(a=this._currentObject.data.indexOf(";;",e)+1,t=2,r=0);var n=this._currentObject.data.substr(e,a-e),i=this._readLine(n.trim()).split(";");this._currentGeo.normalVectors.push([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]),e=a+1}}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshTextureCoords",value:function(){this._tmpUvArray=[],this._currentGeo.Geometry.faceVertexUvs=[],this._currentGeo.Geometry.faceVertexUvs.push([]);for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),o=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),1-parseFloat(o[1]))):this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),parseFloat(o[1]))),e=n+1}}if(e>=this._currentObject.data.length)break}this._currentGeo.Geometry.faceVertexUvs[0]=[];for(var s=0;s=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new a.MeshPhongMaterial({color:16777215*Math.random()});e.side=a.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t),i=this._readLine(n.trim()).split(";");e.color.r=parseFloat(i[0]),e.color.g=parseFloat(i[1]),e.color.b=parseFloat(i[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(n)),t=r+1,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t);var o=this._readLine(n.trim()).split(";");e.specular.r=parseFloat(o[0]),e.specular.g=parseFloat(o[1]),e.specular.b=parseFloat(o[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),n=this._currentObject.data.substr(t,r-t);var s=this._readLine(n.trim()).split(";");e.emissive.r=parseFloat(s[0]),e.emissive.g=parseFloat(s[1]),e.emissive.b=parseFloat(s[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var u=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(this.baseDir+u);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(this.baseDir+u),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(this.baseDir+u),e.normalScale=new a.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(this.baseDir+u);break;case"LightMapFilename":e.lightMap=this.texloader.load(this.baseDir+u)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new o,t=0,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);t=r+1,e.boneName=n.substr(1,n.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(r=this._currentObject.data.indexOf(";",t))+1,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);for(var i=this._readLine(n.trim()).split(","),s=0;s0)for(var o=0;o0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(var r=0;r4&&console.log("warn! over 4 bone weight! :"+s)}}for(var u=0;u0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,i&&e.context.disable(e.context.STENCIL_TEST),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new a.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new a.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionX,e.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.context.enable(e.context.STENCIL_TEST),e.render(this.scene,this.camera,r,!1),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:new a.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),s.BlurDirectionX=new a.Vector2(1,0),s.BlurDirectionY=new a.Vector2(0,1),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=r(1),i=(a=n)&&a.__esModule?a:{default:a};var o=function(e,t,r,a,n){i.default.call(this),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=a,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};o.prototype=Object.assign(Object.create(i.default.prototype),{constructor:o,render:function(e,t,r,a,n){var i,o,s=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),o=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),this.clearColor&&e.setClearColor(i,o),this.scene.overrideMaterial=null,e.autoClear=s}}),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=c(r(1)),i=c(r(19)),o=c(r(20)),s=c(r(2)),l=c(r(21)),u=c(r(22));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e,t,r,u,c){(n.default.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==r&&r,this.supportsNormalTexture=void 0!==u&&u,this.oldClearColor=new a.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==c?new a.Vector2(c.x,c.y):new a.Vector2(256,256),this.saoRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.NearestFilter,magFilter:a.NearestFilter,format:a.RGBAFormat}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((r=new a.DepthTexture).type=a.UnsignedShortType,r.minFilter=a.NearestFilter,r.maxFilter=a.NearestFilter,this.beautyRenderTarget.depthTexture=r,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.normalMaterial=new a.MeshNormalMaterial,this.normalMaterial.blending=a.NoBlending,void 0===i.default&&console.error("THREE.SAOPass relies on THREE.SAOShader"),this.saoMaterial=new a.ShaderMaterial({defines:Object.assign({},i.default.defines),fragmentShader:i.default.fragmentShader,vertexShader:i.default.vertexShader,uniforms:a.UniformsUtils.clone(i.default.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=a.NoBlending,void 0===o.default&&console.error("THREE.SAOPass relies on THREE.DepthLimitedBlurShader"),this.vBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=a.NoBlending,this.hBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=a.NoBlending,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.CopyShader"),this.materialCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(s.default.uniforms),vertexShader:s.default.vertexShader,fragmentShader:s.default.fragmentShader,blending:a.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=a.CustomBlending,this.materialCopy.blendSrc=a.DstColorFactor,this.materialCopy.blendDst=a.ZeroFactor,this.materialCopy.blendEquation=a.AddEquation,this.materialCopy.blendSrcAlpha=a.DstAlphaFactor,this.materialCopy.blendDstAlpha=a.ZeroFactor,this.materialCopy.blendEquationAlpha=a.AddEquation,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.UnpackDepthRGBAShader"),this.depthCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(l.default.uniforms),vertexShader:l.default.vertexShader,fragmentShader:l.default.fragmentShader,blending:a.NoBlending}),this.quadCamera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.quadScene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quadScene.add(this.quad)};f.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},f.prototype=Object.assign(Object.create(n.default.prototype),{constructor:f,render:function(e,t,r,n,i){if(this.renderToScreen&&(this.materialCopy.blending=a.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,e.clearTarget(this.depthRenderTarget),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(u.default.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(0,1)),u.default.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.render(this.scene,this.camera,this.beautyRenderTarget,!0),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var l=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,l=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?l.blending=a.CustomBlending:l.blending=a.NoBlending,this.renderPass(e,l,this.renderToScreen?null:r),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}},renderPass:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.quad.material=t,e.render(this.quadScene,this.quadCamera,r,l),e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},renderOverride:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1,a=t.clearColor||a,n=t.clearAlpha||n;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.scene.overrideMaterial=t,e.render(this.scene,this.camera,r,l),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}}),t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){n.default.call(this),void 0===i.default&&console.error("THREE.SavePass relies on THREE.CopyShader");var t=i.default;this.textureID="tDiffuse",this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new a.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBFormat,stencilBuffer:!1}),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,e.render(this.scene,this.camera,this.renderTarget,this.clear)}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(23));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),this.edgesRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var r=new Image;r.src=this.getAreaTexture(),this.areaTexture=new a.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=a.RGBFormat,this.areaTexture.minFilter=a.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.needsUpdate=!0,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),this.searchTexture=new a.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=a.NearestFilter,this.searchTexture.minFilter=a.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.needsUpdate=!0,this.searchTexture.flipY=!1,void 0===i.default&&console.error("THREE.SMAAPass relies on THREE.SMAAShader"),this.uniformsEdges=a.UniformsUtils.clone(i.default[0].uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new a.ShaderMaterial({defines:Object.assign({},i.default[0].defines),uniforms:this.uniformsEdges,vertexShader:i.default[0].vertexShader,fragmentShader:i.default[0].fragmentShader}),this.uniformsWeights=a.UniformsUtils.clone(i.default[1].uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new a.ShaderMaterial({defines:Object.assign({},i.default[1].defines),uniforms:this.uniformsWeights,vertexShader:i.default[1].vertexShader,fragmentShader:i.default[1].fragmentShader}),this.uniformsBlend=a.UniformsUtils.clone(i.default[2].uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new a.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:i.default[2].vertexShader,fragmentShader:i.default[2].fragmentShader}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniformsEdges.tDiffuse.value=r.texture,this.quad.material=this.materialEdges,e.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,e.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=r.texture,this.quad.material=this.materialBlend,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJ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6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(3)),i=o(r(25));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){if(void 0===i.default)return console.warn("THREE.SSAOPass depends on THREE.SSAOShader"),new n.default;n.default.call(this,i.default),this.width=void 0!==r?r:512,this.height=void 0!==o?o:256,this.renderToScreen=!1,this.camera2=t,this.scene2=e,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.depthRenderTarget=new a.WebGLRenderTarget(this.width,this.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter}),this.uniforms.tDepth.value=this.depthRenderTarget.texture,this.uniforms.size.value.set(this.width,this.height),this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far,this.uniforms.radius.value=4,this.uniforms.onlyAO.value=!1,this.uniforms.aoClamp.value=.25,this.uniforms.lumInfluence.value=.7;Object.defineProperties(this,{radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},onlyAO:{get:function(){return this.uniforms.onlyAO.value},set:function(e){this.uniforms.onlyAO.value=e}},aoClamp:{get:function(){return this.uniforms.aoClamp.value},set:function(e){this.uniforms.aoClamp.value=e}},lumInfluence:{get:function(){return this.uniforms.lumInfluence.value},set:function(e){this.uniforms.lumInfluence.value=e}}})};(s.prototype=Object.create(n.default.prototype)).render=function(e,t,r,a,i){this.scene2.overrideMaterial=this.depthMaterial,e.render(this.scene2,this.camera2,this.depthRenderTarget,!0),this.scene2.overrideMaterial=null,n.default.prototype.render.call(this,e,t,r,a,i)},s.prototype.setScene=function(e){this.scene2=e},s.prototype.setCamera=function(e){this.camera2=e,this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far},s.prototype.setSize=function(e,t){this.width=e,this.height=t,this.uniforms.size.value.set(this.width,this.height),this.depthRenderTarget.setSize(this.width,this.height)},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(24),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t,r){void 0===o.default&&console.error("THREE.TAARenderPass relies on THREE.SSAARenderPass"),o.default.call(this,e,t,r),this.sampleLevel=0,this.accumulate=!1};s.JitterVectors=o.default.JitterVectors,s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a){if(!this.accumulate)return o.default.prototype.render.call(this,e,t,r,a),void(this.accumulateIndex=-1);var i=s.JitterVectors[5];this.sampleRenderTarget||(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),this.holdRenderTarget||(this.holdRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.holdRenderTarget.texture.name="TAARenderPass.hold"),this.accumulate&&-1===this.accumulateIndex&&(o.default.prototype.render.call(this,e,this.holdRenderTarget,r,a),this.accumulateIndex=0);var l=e.autoClear;e.autoClear=!1;var u=1/i.length;if(this.accumulateIndex>=0&&this.accumulateIndex=i.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}var h=this.accumulateIndex*u;h>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.render(this.scene2,this.camera2,t,!0)),h<1&&(this.copyUniforms.opacity.value=1-h,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.render(this.scene2,this.camera2,t,0===h)),e.autoClear=l}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),void 0===i.default&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=i.default;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=a.UniformsUtils.clone(r.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){var i=e.autoClear;e.autoClear=!1,this.quad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),e.autoClear=i}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=s(r(1)),i=s(r(2)),o=s(r(26));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e,t,r,s){n.default.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=s,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);var l={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var u=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new a.WebGLRenderTarget(u,c,l),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var f=0;f\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new a.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),l.BlurDirectionX=new a.Vector2(1,0),l.BlurDirectionY=new a.Vector2(0,1),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaterRefractionShader=t.VignetteShader=t.VerticalTiltShiftShader=t.VerticalBlurShader=t.UnpackDepthRGBAShader=t.TriangleBlurShader=t.ToneMapShader=t.TechnicolorShader=t.SSAOShader=t.SobelOperatorShader=t.SMAAShader=t.SepiaShader=t.SAOShader=t.RGBShiftShader=t.PixelShader=t.ParallaxShader=t.NormalMapShader=t.MirrorShader=t.LuminosityShader=t.LuminosityHighPassShader=t.KaleidoShader=t.HueSaturationShader=t.HorizontalTiltShiftShader=t.HorizontalBlurShader=t.HalftoneShader=t.GammaCorrectionShader=t.FXAAShader=t.FresnelShader=t.FreiChenShader=t.FocusShader=t.FilmShader=t.DotScreenShader=t.DOFMipMapShader=t.DigitalGlitch=t.DepthLimitedBlurShader=t.CopyShader=t.ConvolutionShader=t.ColorifyShader=t.ColorCorrectionShader=t.BrightnessContrastShader=t.BokehShader2=t.BokehShader=t.BlurShaderUtils=t.BlendShader=t.BleachBypassShader=t.BasicShader=void 0;var a=Q(r(113)),n=Q(r(114)),i=Q(r(115)),o=Q(r(22)),s=Q(r(14)),l=Q(r(116)),u=Q(r(117)),c=Q(r(118)),f=Q(r(119)),d=Q(r(13)),h=Q(r(2)),p=Q(r(20)),m=Q(r(17)),v=Q(r(120)),g=Q(r(15)),y=Q(r(16)),b=Q(r(121)),w=Q(r(122)),x=Q(r(123)),_=Q(r(124)),A=Q(r(125)),E=Q(r(18)),S=Q(r(126)),M=Q(r(127)),T=Q(r(128)),P=Q(r(129)),F=Q(r(26)),O=Q(r(11)),L=Q(r(130)),C=Q(r(131)),R=(Q(r(132)),Q(r(133))),k=Q(r(134)),I=Q(r(135)),N=Q(r(19)),D=Q(r(136)),U=Q(r(23)),j=Q(r(137)),B=Q(r(25)),V=Q(r(138)),z=Q(r(12)),G=Q(r(139)),H=Q(r(21)),X=Q(r(140)),Y=Q(r(141)),W=Q(r(142)),q=Q(r(143));function Q(e){return e&&e.__esModule?e:{default:e}}t.BasicShader=a.default,t.BleachBypassShader=n.default,t.BlendShader=i.default,t.BlurShaderUtils=o.default,t.BokehShader=s.default,t.BokehShader2=l.default,t.BrightnessContrastShader=u.default,t.ColorCorrectionShader=c.default,t.ColorifyShader=f.default,t.ConvolutionShader=d.default,t.CopyShader=h.default,t.DepthLimitedBlurShader=p.default,t.DigitalGlitch=m.default,t.DOFMipMapShader=v.default,t.DotScreenShader=g.default,t.FilmShader=y.default,t.FocusShader=b.default,t.FreiChenShader=w.default,t.FresnelShader=x.default,t.FXAAShader=_.default,t.GammaCorrectionShader=A.default,t.HalftoneShader=E.default,t.HorizontalBlurShader=S.default,t.HorizontalTiltShiftShader=M.default,t.HueSaturationShader=T.default,t.KaleidoShader=P.default,t.LuminosityHighPassShader=F.default,t.LuminosityShader=O.default,t.MirrorShader=L.default,t.NormalMapShader=C.default,t.ParallaxShader=R.default,t.PixelShader=k.default,t.RGBShiftShader=I.default,t.SAOShader=N.default,t.SepiaShader=D.default,t.SMAAShader=U.default,t.SobelOperatorShader=j.default,t.SSAOShader=B.default,t.TechnicolorShader=V.default,t.ToneMapShader=z.default,t.TriangleBlurShader=G.default,t.UnpackDepthRGBAShader=H.default,t.VerticalBlurShader=X.default,t.VerticalTiltShiftShader=Y.default,t.VignetteShader=W.default,t.WaterRefractionShader=q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","vec4 texel1 = texture2D( tDiffuse1, vUv );","vec4 texel2 = texture2D( tDiffuse2, vUv );","gl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float penta(vec2 coords) {","//pentagonal shape","float scale = float(rings) - 1.3;","vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","vec4 one = vec4( 1.0 );","vec4 P = vec4((coords),vec2(scale, scale));","vec4 dist = vec4(0.0);","float inorout = -4.0;","dist.x = dot( P, HS0 );","dist.y = dot( P, HS1 );","dist.z = dot( P, HS2 );","dist.w = dot( P, HS3 );","dist = smoothstep( -feather, feather, dist );","inorout += dot( dist, one );","dist.x = dot( P, HS4 );","dist.y = HS5.w - abs( P.z );","dist = smoothstep( -feather, feather, dist );","inorout += dist.x;","return clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","// Depth buffer blur","float d = 0.0;","float kernel[9];","vec2 offset[9];","vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","offset[0] = vec2(-wh.x,-wh.y);","offset[1] = vec2( 0.0, -wh.y);","offset[2] = vec2( wh.x -wh.y);","offset[3] = vec2(-wh.x, 0.0);","offset[4] = vec2( 0.0, 0.0);","offset[5] = vec2( wh.x, 0.0);","offset[6] = vec2(-wh.x, wh.y);","offset[7] = vec2( 0.0, wh.y);","offset[8] = vec2( wh.x, wh.y);","kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","for( int i=0; i<9; i++ ) {","float tmp = getDepth( coords + offset[ i ] );","d += tmp * kernel[i];","}","return d;","}","vec3 color(vec2 coords,float blur) {","//processing the sample","vec3 col = vec3(0.0);","vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","vec3 lumcoeff = vec3(0.299,0.587,0.114);","float lum = dot(col.rgb, lumcoeff);","float thresh = max((lum-threshold)*gain, 0.0);","return col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","float edge = 0.002*depth; //distance based edge smoothing","float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","return col;","}","float linearize(float depth) {","return -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","float dist = distance(vUv.xy, vec2(0.5,0.5));","dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","return clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","float rings2 = float(rings);","float step = PI*2.0 / float(ringsamples);","float pw = cos(j*step)*i;","float ph = sin(j*step)*i;","float p = 1.0;","if (pentagon) {","p = penta(vec2(pw,ph));","}","col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","return 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","//scene depth calculation","float depth = linearize( getDepth( vUv.xy ) );","// Blur depth?","if (depthblur) {","depth = linearize(bdepth(vUv.xy));","}","//focal plane calculation","float fDepth = focalDepth;","if (shaderFocus) {","fDepth = linearize( getDepth( focusCoords ) );","}","// dof blur factor calculation","float blur = 0.0;","if (manualdof) {","float a = depth-fDepth; // Focal plane","float b = (a-fdofstart)/fdofdist; // Far DoF","float c = (-a-ndofstart)/ndofdist; // Near Dof","blur = (a>0.0) ? b : c;","} else {","float f = focalLength; // focal length in mm","float d = fDepth*1000.0; // focal plane in mm","float o = depth*1000.0; // depth in mm","float a = (o*f)/(o-f);","float b = (d*f)/(d-f);","float c = (d-f)/(d*fstop*CoC);","blur = abs(a-b)*c;","}","blur = clamp(blur,0.0,1.0);","// calculation of pattern for dithering","vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","// getting blur x and y step factor","float w = (1.0/textureWidth)*blur*maxblur+noise.x;","float h = (1.0/textureHeight)*blur*maxblur+noise.y;","// calculation of final color","vec3 col = vec3(0.0);","if(blur < 0.05) {","//some optimization thingy","col = texture2D(tColor, vUv.xy).rgb;","} else {","col = texture2D(tColor, vUv.xy).rgb;","float s = 1.0;","int ringsamples;","for (int i = 1; i <= rings; i++) {","/*unboxstart*/","ringsamples = i * samples;","for (int j = 0 ; j < maxringsamples ; j++) {","if (j >= ringsamples) break;","s += gather(float(i), float(j), ringsamples, col, w, h, blur);","}","/*unboxend*/","}","col /= s; //divide by sample count","}","if (showFocus) {","col = debugFocus(col, blur, depth);","}","if (vignetting) {","col *= vignette();","}","gl_FragColor.rgb = col;","gl_FragColor.a = 1.0;","} "].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},powRGB:{value:new a.Vector3(2,2,2)},mulRGB:{value:new a.Vector3(1,1,1)},addRGB:{value:new a.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},color:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},aspect:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","G[0] = g0,","G[1] = g1,","G[2] = g2,","G[3] = g3,","G[4] = g4,","G[5] = g5,","G[6] = g6,","G[7] = g7,","G[8] = g8;","mat3 I;","float cnv[9];","vec3 sample;","for (float i=0.0; i<3.0; i++) {","for (float j=0.0; j<3.0; j++) {","sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","I[int(i)][int(j)] = length(sample);","}","}","for (int i=0; i<9; i++) {","float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","cnv[i] = dp3 * dp3;","}","float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","vec3 I = worldPosition.xyz - cameraPosition;","vReflect = reflect( I, worldNormal );","vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","vec4 refractedColor = vec4( 1.0 );","refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immedates."," // Immedates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","gl_FragColor = LinearToGamma( tex, float( GAMMA_FACTOR ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 p = vUv - 0.5;","float r = length(p);","float a = atan(p.y, p.x) + angle;","float tau = 2. * 3.1416 ;","a = mod(a, tau/sides);","a = abs(a - tau/sides/2.) ;","p = r * vec2(cos(a), sin(a));","vec4 color = texture2D(tDiffuse, p + 0.5);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","vec2 p = vUv;","if (side == 0){","if (p.x > 0.5) p.x = 1.0 - p.x;","}else if (side == 1){","if (p.x < 0.5) p.x = 1.0 - p.x;","}else if (side == 2){","if (p.y < 0.5) p.y = 1.0 - p.y;","}else if (side == 3){","if (p.y > 0.5) p.y = 1.0 - p.y;","} ","vec4 color = texture2D(tDiffuse, p);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{heightMap:{value:null},resolution:{value:new a.Vector2(512,512)},scale:{value:new a.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));a.ShaderLib.ocean_sim_vertex={vertexShader:["varying vec2 vUV;","void main (void) {","vUV = position.xy * 0.5 + 0.5;","gl_Position = vec4(position, 1.0 );","}"].join("\n")},a.ShaderLib.ocean_subtransform={uniforms:{u_input:{value:null},u_transformSize:{value:512},u_subtransformSize:{value:250}},fragmentShader:["precision highp float;","#include ","uniform sampler2D u_input;","uniform float u_transformSize;","uniform float u_subtransformSize;","varying vec2 vUV;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","void main (void) {","#ifdef HORIZONTAL","float index = vUV.x * u_transformSize - 0.5;","#else","float index = vUV.y * u_transformSize - 0.5;","#endif","float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);","#ifdef HORIZONTAL","vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","#else","vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;","#endif","float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);","vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));","vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);","vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);","gl_FragColor = vec4(outputA, outputB);","}"].join("\n")},a.ShaderLib.ocean_initial_spectrum={uniforms:{u_wind:{value:new a.Vector2(10,10)},u_resolution:{value:512},u_size:{value:250}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","const float CM = 0.23;","uniform vec2 u_wind;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + pow2(k / KM)));","}","float tanh (float x) {","return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 K = (2.0 * PI * vec2(n, m)) / u_size;","float k = length(K);","float l_wind = length(u_wind);","float Omega = 0.84;","float kp = G * pow2(Omega / l_wind);","float c = omega(k) / k;","float cp = omega(kp) / kp;","float Lpm = exp(-1.25 * pow2(kp / k));","float gamma = 1.7;","float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));","float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));","float Jp = pow(gamma, Gamma);","float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));","float alphap = 0.006 * sqrt(Omega);","float Bl = 0.5 * alphap * cp / c * Fp;","float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);","float uStar = 0.41 * l_wind / log(10.0 / z0);","float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));","float Fm = exp(-0.25 * pow2(k / KM - 1.0));","float Bh = 0.5 * alpham * CM / c * Fm * Lpm;","float a0 = log(2.0) / 4.0;","float am = 0.13 * uStar / CM;","float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));","float cosPhi = dot(normalize(u_wind), normalize(K));","float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));","float dk = 2.0 * PI / u_size;","float h = sqrt(S / 2.0) * dk;","if (K.x == 0.0 && K.y == 0.0) {","h = 0.0;","}","gl_FragColor = vec4(h, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_phase={uniforms:{u_phases:{value:null},u_deltaTime:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform sampler2D u_phases;","uniform float u_deltaTime;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","float deltaTime = 1.0 / 60.0;","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","float deltaPhase = omega(length(waveVector)) * u_deltaTime;","phase = mod(phase + deltaPhase, 2.0 * PI);","gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_spectrum={uniforms:{u_size:{value:null},u_resolution:{value:null},u_choppiness:{value:null},u_phases:{value:null},u_initialSpectrum:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform float u_size;","uniform float u_resolution;","uniform float u_choppiness;","uniform sampler2D u_phases;","uniform sampler2D u_initialSpectrum;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","vec2 multiplyByI (vec2 z) {","return vec2(-z[1], z[0]);","}","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","vec2 phaseVector = vec2(cos(phase), sin(phase));","vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;","vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;","h0Star.y *= -1.0;","vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));","vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;","vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;","if (waveVector.x == 0.0 && waveVector.y == 0.0) {","h = vec2(0.0);","hX = vec2(0.0);","hZ = vec2(0.0);","}","gl_FragColor = vec4(hX + multiplyByI(h), hZ);","}"].join("\n")},a.ShaderLib.ocean_normals={uniforms:{u_displacementMap:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform float u_resolution;","uniform float u_size;","void main (void) {","float texel = 1.0 / u_resolution;","float texelSize = u_size / u_resolution;","vec3 center = texture2D(u_displacementMap, vUV).rgb;","vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;","vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;","vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;","vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;","vec3 topRight = cross(right, top);","vec3 topLeft = cross(top, left);","vec3 bottomLeft = cross(left, bottom);","vec3 bottomRight = cross(bottom, right);","gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);","}"].join("\n")},a.ShaderLib.ocean_main={uniforms:{u_displacementMap:{value:null},u_normalMap:{value:null},u_geometrySize:{value:null},u_size:{value:null},u_projectionMatrix:{value:null},u_viewMatrix:{value:null},u_cameraPosition:{value:null},u_skyColor:{value:null},u_oceanColor:{value:null},u_sunDirection:{value:null},u_exposure:{value:null}},vertexShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform mat4 u_projectionMatrix;","uniform mat4 u_viewMatrix;","uniform float u_size;","uniform float u_geometrySize;","uniform sampler2D u_displacementMap;","void main (void) {","vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);","vPos = newPos;","vUV = uv;","gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);","}"].join("\n"),fragmentShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform sampler2D u_normalMap;","uniform vec3 u_cameraPosition;","uniform vec3 u_oceanColor;","uniform vec3 u_skyColor;","uniform vec3 u_sunDirection;","uniform float u_exposure;","vec3 hdr (vec3 color, float exposure) {","return 1.0 - exp(-color * exposure);","}","void main (void) {","vec3 normal = texture2D(u_normalMap, vUV).rgb;","vec3 view = normalize(u_cameraPosition - vPos);","float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);","vec3 sky = fresnel * u_skyColor;","float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);","vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;","vec3 color = sky + water;","gl_FragColor = vec4(hdr(color, u_exposure), 1.0);","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","vUv = uv;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vViewPosition = -mvPosition.xyz;","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","vec2 parallaxMap( in vec3 V ) {","float initialHeight = texture2D( bumpMap, vUv ).r;","vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","return vUv - texCoordOffset;","}","#else","vec2 parallaxMap( in vec3 V ) {","float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","float layerHeight = 1.0 / numLayers;","float currentLayerHeight = 0.0;","vec2 dtex = parallaxScale * V.xy / V.z / numLayers;","vec2 currentTextureCoords = vUv;","float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","for ( int i = 0; i < 30; i += 1 ) {","if ( heightFromTexture <= currentLayerHeight ) {","break;","}","currentLayerHeight += layerHeight;","currentTextureCoords -= dtex;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","}","#ifdef USE_STEEP_PARALLAX","return currentTextureCoords;","#elif defined( USE_RELIEF_PARALLAX )","vec2 deltaTexCoord = dtex / 2.0;","float deltaHeight = layerHeight / 2.0;","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","const int numSearches = 5;","for ( int i = 0; i < numSearches; i += 1 ) {","deltaTexCoord /= 2.0;","deltaHeight /= 2.0;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","if( heightFromTexture > currentLayerHeight ) {","currentTextureCoords -= deltaTexCoord;","currentLayerHeight += deltaHeight;","} else {","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","}","}","return currentTextureCoords;","#elif defined( USE_OCLUSION_PARALLAX )","vec2 prevTCoords = currentTextureCoords + dtex;","float nextH = heightFromTexture - currentLayerHeight;","float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","float weight = nextH / ( nextH - prevH );","return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","#else","return vUv;","#endif","}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","vec2 texDx = dFdx( vUv );","vec2 texDy = dFdy( vUv );","vec3 vSigmaX = dFdx( surfPosition );","vec3 vSigmaY = dFdy( surfPosition );","vec3 vR1 = cross( vSigmaY, surfNormal );","vec3 vR2 = cross( surfNormal, vSigmaX );","float fDet = dot( vSigmaX, vR1 );","vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","vec3 vProjVtex;","vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","vProjVtex.z = dot( surfNormal, viewPosition );","return parallaxMap( vProjVtex );","}","void main() {","vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","gl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, vUv + offset);","vec4 cga = texture2D(tDiffuse, vUv);","vec4 cb = texture2D(tDiffuse, vUv - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","gl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","gl_FragColor = newTex;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{texture:{value:null},delta:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = rand( vUv );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{color:{type:"c",value:null},time:{type:"f",value:0},tDiffuse:{type:"t",value:null},tDudv:{type:"t",value:null},textureMatrix:{type:"m4",value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Volume=void 0;var a,n=r(10),i=(a=n)&&a.__esModule?a:{default:a};t.Volume=i.default}]))},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,a,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,a)}));case 4:return t.nextTick((function(){e.call(null,r,a,n)}));default:for(i=new Array(s-1),o=0;o>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return n>0&&(e.lastNeed=n-1),n;if(--a=0)return n>0&&(e.lastNeed=n-2),n;if(--a=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";(function(t){var a=r(114); +!function(e,t){for(var r in t)e[r]=t[r]}(exports,function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}([function(e,t){e.exports=__webpack_require__(0)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1};Object.assign(a.prototype,{setSize:function(e,t){},render:function(e,t,r,a,n){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(1),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t){o.default.call(this),this.textureID=void 0!==t?t:"tDiffuse",e instanceof n.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=n.UniformsUtils.clone(e.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new n.Scene,this.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)}}),t.default=s},function(e,t,r){!function(e){"use strict";function t(){}function r(e,r){this.dv=new DataView(e),this.offset=0,this.littleEndian=void 0===r||r,this.encoder=new t}function a(){}function n(){}t.prototype.s2u=function(e){for(var t=this.s2uTable,r="",a=0;a=0&&n<=126||n>=161&&n<=223)&&a0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},a.prototype={constructor:a,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],a=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=a}},n.prototype.parsePmd=function(e,t){var a,n={},i=new r(e);return n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left",function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),function(){var e,t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r0&&(a.englishModelName=i.getSjisStringsAsUnicode(20),a.englishComment=i.getSjisStringsAsUnicode(256)),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneNames=[];for(var t=0;t=2.0 are supported. Use LegacyGLTFLoader instead.")):(m.extensionsUsed&&(m.extensionsUsed.indexOf(r.KHR_LIGHTS)>=0&&(p[r.KHR_LIGHTS]=new i(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_UNLIT)>=0&&(p[r.KHR_MATERIALS_UNLIT]=new o(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(p[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new d),m.extensionsUsed.indexOf(r.KHR_DRACO_MESH_COMPRESSION)>=0&&(p[r.KHR_DRACO_MESH_COMPRESSION]=new f(this.dracoLoader)),m.extensionsUsed.indexOf(r.MSFT_TEXTURE_DDS)>=0&&(p[r.MSFT_TEXTURE_DDS]=new n)),new U(m,p,{path:t||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse((function(e,t,r,a,n){l({scene:e,scenes:t,cameras:r,animations:a,asset:n})}),u))}};var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(){if(!a.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=new a.DDSLoader}function i(e){this.name=r.KHR_LIGHTS,this.lights={};var t=(e.extensions&&e.extensions[r.KHR_LIGHTS]||{}).lights||{};for(var n in t){var i,o=t[n],s=(new a.Color).fromArray(o.color);switch(o.type){case"directional":(i=new a.DirectionalLight(s)).target.position.set(0,0,1),i.add(i.target);break;case"point":i=new a.PointLight(s);break;case"spot":i=new a.SpotLight(s),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;case"ambient":i=new a.AmbientLight(s)}i&&(i.decay=2,void 0!==o.intensity&&(i.intensity=o.intensity),i.name=o.name||"light_"+n,this.lights[n]=i)}}function o(e){this.name=r.KHR_MATERIALS_UNLIT}o.prototype.getMaterialType=function(e){return a.MeshBasicMaterial},o.prototype.extendParams=function(e,t,r){var n=[];e.color=new a.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var o=i.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture.index))}return Promise.all(n)};var s="glTF",l=12,u={JSON:1313821514,BIN:5130562};function c(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,l);if(this.header={magic:a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,l),i=0;i",s).replace("#include ",l).replace("#include ",u).replace("#include ",c).replace("#include ",f);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new a.Color).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=d,e.uniforms=o,e.defines={STANDARD:""},e.color=new a.Color(1,1,1),e.opacity=1;var h=[];if(Array.isArray(n.diffuseFactor)){var p=n.diffuseFactor;e.color.fromArray(p),e.opacity=p[3]}if(void 0!==n.diffuseTexture&&h.push(r.assignTexture(e,"map",n.diffuseTexture.index)),e.emissive=new a.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new a.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var m=n.specularGlossinessTexture.index;h.push(r.assignTexture(e,"glossinessMap",m)),h.push(r.assignTexture(e,"specularMap",m))}return Promise.all(h)},createMaterial:function(e){var t=new a.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var r=this.specularGlossinessParams,a=0,n=r.length;a=2&&(n[i+1]=e.getY(i)),r>=3&&(n[i+2]=e.getZ(i)),r>=4&&(n[i+3]=e.getW(i));return new a.BufferAttribute(n,r,e.normalized)}return e.clone()}function U(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new t,this.primitiveCache=[],this.textureLoader=new a.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function j(e,t,r){var a=t.attributes;for(var n in a){var i=T[n],o=r[a[n]];i&&(i in e.attributes||e.addAttribute(i,o))}void 0===t.indices||e.index||e.setIndex(r[t.indices])}return U.prototype.parse=function(e,t){var r=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then((function(t){var a=t.scenes||[],n=a[r.scene||0],i=t.animations||[],o=r.asset,s=t.cameras||[];e(n,a,s,i,o)})).catch(t)},U.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},i=0,o=t.length;i=2&&o.setY(T,A[E*l+1]),l>=3&&o.setZ(T,A[E*l+2]),l>=4&&o.setW(T,A[E*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},U.prototype.loadTexture=function(e){var t,n=this,i=this.json,o=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=i.textures[e],c=u.extensions||{},f=(t=c[r.MSFT_TEXTURE_DDS]?i.images[c[r.MSFT_TEXTURE_DDS].source]:i.images[u.source]).uri,d=!1;return void 0!==t.bufferView&&(f=n.getDependency("bufferView",t.bufferView).then((function(e){d=!0;var r=new Blob([e],{type:t.mimeType});return f=l.createObjectURL(r)}))),Promise.resolve(f).then((function(e){var t=a.Loader.Handlers.get(e);return t||(t=c[r.MSFT_TEXTURE_DDS]?n.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(r,a){t.load(k(e,o.path),r,void 0,a)}))})).then((function(e){!0===d&&l.revokeObjectURL(f),e.flipY=!1,void 0!==u.name&&(e.name=u.name),c[r.MSFT_TEXTURE_DDS]||(e.format=void 0!==u.format?E[u.format]:a.RGBAFormat),void 0!==u.internalFormat&&e.format!==E[u.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==u.type?S[u.type]:a.UnsignedByteType;var t=(i.samplers||{})[u.sampler]||{};return e.magFilter=_[t.magFilter]||a.LinearFilter,e.minFilter=_[t.minFilter]||a.LinearMipMapLinearFilter,e.wrapS=A[t.wrapS]||a.RepeatWrapping,e.wrapT=A[t.wrapT]||a.RepeatWrapping,e}))},U.prototype.assignTexture=function(e,t,r){return this.getDependency("texture",r).then((function(r){e[t]=r}))},U.prototype.loadMaterial=function(e){this.json;var t,n=this.extensions,i=this.json.materials[e],o={},s=i.extensions||{},l=[];if(s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(i),l.push(u.extendParams(o,i,this))}else if(s[r.KHR_MATERIALS_UNLIT]){var c=n[r.KHR_MATERIALS_UNLIT];t=c.getMaterialType(i),l.push(c.extendParams(o,i,this))}else{t=a.MeshStandardMaterial;var f=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(f.baseColorFactor)){var d=f.baseColorFactor;o.color.fromArray(d),o.opacity=d[3]}if(void 0!==f.baseColorTexture&&l.push(this.assignTexture(o,"map",f.baseColorTexture.index)),o.metalness=void 0!==f.metallicFactor?f.metallicFactor:1,o.roughness=void 0!==f.roughnessFactor?f.roughnessFactor:1,void 0!==f.metallicRoughnessTexture){var h=f.metallicRoughnessTexture.index;l.push(this.assignTexture(o,"metalnessMap",h)),l.push(this.assignTexture(o,"roughnessMap",h))}}!0===i.doubleSided&&(o.side=a.DoubleSide);var p=i.alphaMode||O;return p===C?o.transparent=!0:(o.transparent=!1,p===L&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"normalMap",i.normalTexture.index)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale&&o.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"aoMap",i.occlusionTexture.index)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==a.MeshBasicMaterial&&l.push(this.assignTexture(o,"emissiveMap",i.emissiveTexture.index)),Promise.all(l).then((function(){var e;return e=t===a.ShaderMaterial?n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==i.name&&(e.name=i.name),e.normalScale&&(e.normalScale.y=-e.normalScale.y),e.map&&(e.map.encoding=a.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=a.sRGBEncoding),i.extras&&(e.userData=i.extras),e}))},U.prototype.loadGeometries=function(e){var t=this,n=this.extensions,i=this.primitiveCache;return this.getDependencies("accessor").then((function(o){for(var s=[],l=0,u=e.length;l1))return _;_.name+="_"+c,s.add(_)}return s}))}))},U.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new a.PerspectiveCamera(a.Math.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new a.OrthographicCamera(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar)),void 0!==r.name&&(t.name=r.name),r.extras&&(t.userData=r.extras),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},U.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},U.prototype.loadAnimation=function(e){this.json;var t=this.json.animations[e];return this.getMultiDependencies(["accessor","node"]).then((function(r){for(var n=[],i=0,o=t.channels.length;i1&&(s.name+="_instance_"+i[o.mesh]++)}else if(void 0!==o.camera)s=e.cameras[o.camera];else if(o.extensions&&o.extensions[r.KHR_LIGHTS]&&void 0!==o.extensions[r.KHR_LIGHTS].light){s=t[r.KHR_LIGHTS].lights[o.extensions[r.KHR_LIGHTS].light]}else s=new a.Object3D;if(void 0!==o.name&&(s.name=a.PropertyBinding.sanitizeNodeName(o.name)),o.extras&&(s.userData=o.extras),void 0!==o.matrix){var d=new a.Matrix4;d.fromArray(o.matrix),s.applyMatrix(d)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return s}))},U.prototype.loadScene=function(){function e(t,r,n,i,o){var s=i[t],l=n.nodes[t];if(void 0!==l.skin)for(var u=!0===s.isGroup?s.children:[s],c=0,f=u.length;c(n=s.indexOf("\n"))&&i=e.byteLength||!(a=r(e)))return t(1,"no header found");if(!(n=a.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(u.valid|=1,u.programtype=n[1],u.string+=a+"\n";!1!==(a=r(e));)if(u.string+=a+"\n","#"!==a.charAt(0)){if((n=a.match(i))&&(u.gamma=parseFloat(n[1],10)),(n=a.match(o))&&(u.exposure=parseFloat(n[1],10)),(n=a.match(s))&&(u.valid|=2,u.format=n[1]),(n=a.match(l))&&(u.valid|=4,u.height=parseInt(n[1],10),u.width=parseInt(n[2],10)),2&u.valid&&4&u.valid)break}else u.comments+=a+"\n";return 2&u.valid?4&u.valid?u:t(3,"missing image size specifier"):t(3,"missing format specifier")}(n);if(-1!==i){var o=i.width,s=i.height,l=function(e,r,a){var n,i,o,s,l,u,c,f,d,h,p,m,v,g=r,y=a;if(g<8||g>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(g!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(n=new Uint8Array(4*r*a))||!n.length)return t(4,"unable to allocate buffer space");for(i=0,o=0,f=4*g,v=new Uint8Array(4),u=new Uint8Array(f);y>0&&oe.byteLength)return t(1);if(v[0]=e[o++],v[1]=e[o++],v[2]=e[o++],v[3]=e[o++],2!=v[0]||2!=v[1]||(v[2]<<8|v[3])!=g)return t(3,"bad rgbe scanline format");for(c=0;c128)&&(s-=128),0===s||c+s>f)return t(3,"bad scanline data");if(m)for(l=e[o++],d=0;d0){var x=[];for(var w in v)h=v[w],x[w]=h.name;m="Adding mesh(es) ("+x.length+": "+x+") from input mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)"}else m="Not adding mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)";var _=this.callbacks.onProgress;t.isValid(_)&&_(new CustomEvent("MeshBuilderEvent",{detail:{type:"progress",modelName:e.params.meshName,text:m,numericalValue:e.progress.numericalValue}}));return v},r.prototype.updateMaterials=function(e){var r,a,i=e.materials.materialCloneInstructions;if(t.isValid(i)){var o=i.materialNameOrg,s=this.materials[o];if(t.isValid(o)){r=s.clone(),a=i.materialName,r.name=a;var l=i.materialProperties;for(var u in l)r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&(r[u]=l[u]);this.materials[a]=r}else console.warn('Requested material "'+o+'" is not available!')}var c=e.materials.serializedMaterials;if(t.isValid(c)&&Object.keys(c).length>0){var f,d=new n.MaterialLoader;for(a in c)f=c[a],t.isValid(f)&&(r=d.parse(f),this.logging.enabled&&console.info('De-serialized material with name "'+a+'" will be added.'),this.materials[a]=r)}if(c=e.materials.runtimeMaterials,t.isValid(c)&&Object.keys(c).length>0)for(a in c)r=c[a],this.logging.enabled&&console.info('Material with name "'+a+'" will be added.'),this.materials[a]=r},r.prototype.getMaterialsJSON=function(){var e,t={};for(var r in this.materials)e=this.materials[r],t[r]=e.toJSON();return t},r.prototype.getMaterials=function(){return this.materials},r}(),s.WorkerRunnerRefImpl=function(){function e(){var e=this;self.addEventListener("message",(function(t){e.processMessage(t.data)}),!1)}return e.prototype.applyProperties=function(e,t){var r,a,n;for(r in t)a="set"+r.substring(0,1).toLocaleUpperCase()+r.substring(1),n=t[r],"function"==typeof e[a]?e[a](n):e.hasOwnProperty(r)&&(e[r]=n)},e.prototype.processMessage=function(e){if("run"===e.cmd){var t={callbackMeshBuilder:function(e){self.postMessage(e)},callbackProgress:function(t){e.logging.enabled&&e.logging.debug&&console.debug("WorkerRunner: progress: "+t)}},r=new Parser;"function"==typeof r.setLogging&&r.setLogging(e.logging.enabled,e.logging.debug),this.applyProperties(r,e.params),this.applyProperties(r,e.materials),this.applyProperties(r,t),r.workerScope=self,r.parse(e.data.input,e.data.options),e.logging.enabled&&console.log("WorkerRunner: Run complete!"),t.callbackMeshBuilder({cmd:"complete",msg:"WorkerRunner completed run."})}else console.error("WorkerRunner: Received unknown command: "+e.cmd)},e}(),s.WorkerSupport=function(){var e="2.2.0",t=s.Validator,r=function(){function e(){this._reset()}return e.prototype._reset=function(){this.logging={enabled:!0,debug:!1},this.worker=null,this.runnerImplName=null,this.callbacks={meshBuilder:null,onLoad:null},this.terminateRequested=!1,this.queuedMessage=null,this.started=!1,this.forceCopy=!1},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.setForceCopy=function(e){this.forceCopy=!0===e},e.prototype.initWorker=function(e,t){this.runnerImplName=t;var r=new Blob([e],{type:"application/javascript"});this.worker=new Worker(o.URL.createObjectURL(r)),this.worker.onmessage=this._receiveWorkerMessage,this.worker.runtimeRef=this,this._postMessage()},e.prototype._receiveWorkerMessage=function(e){var t=e.data;switch(t.cmd){case"meshData":case"materialData":case"imageData":this.runtimeRef.callbacks.meshBuilder(t);break;case"complete":this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run is complete. Terminating application on request!"),this.runtimeRef._terminate());break;case"error":console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Reported error: "+t.msg),this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run reported error. Terminating application on request!"),this.runtimeRef._terminate());break;default:console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Received unknown command: "+t.cmd)}},e.prototype.setCallbacks=function(e,r){this.callbacks.meshBuilder=t.verifyInput(e,this.callbacks.meshBuilder),this.callbacks.onLoad=t.verifyInput(r,this.callbacks.onLoad)},e.prototype.run=function(e){if(t.isValid(this.queuedMessage))console.warn("Already processing message. Rejecting new run instruction");else{if(this.queuedMessage=e,this.started=!0,!t.isValid(this.callbacks.meshBuilder))throw'Unable to run as no "MeshBuilder" callback is set.';if(!t.isValid(this.callbacks.onLoad))throw'Unable to run as no "onLoad" callback is set.';"run"!==e.cmd&&(e.cmd="run"),t.isValid(e.logging)?(e.logging.enabled=!0===e.logging.enabled,e.logging.debug=!0===e.logging.debug):e.logging={enabled:!0,debug:!1},this._postMessage()}},e.prototype._postMessage=function(){var e;t.isValid(this.queuedMessage)&&t.isValid(this.worker)&&(this.queuedMessage.data.input instanceof ArrayBuffer?(e=this.forceCopy?this.queuedMessage.data.input.slice(0):this.queuedMessage.data.input,this.worker.postMessage(this.queuedMessage,[e])):this.worker.postMessage(this.queuedMessage))},e.prototype.setTerminateRequested=function(e){this.terminateRequested=!0===e,this.terminateRequested&&t.isValid(this.worker)&&!t.isValid(this.queuedMessage)&&this.started&&(this.logging.enabled&&console.info("Worker is terminated immediately as it is not running!"),this._terminate())},e.prototype._terminate=function(){this.worker.terminate(),this._reset()},e}();function a(){if(console.info("Using THREE.LoaderSupport.WorkerSupport version: "+e),this.logging={enabled:!0,debug:!1},void 0===o.Worker)throw"This browser does not support web workers!";if(void 0===o.Blob)throw"This browser does not support Blob!";if("function"!=typeof o.URL.createObjectURL)throw"This browser does not support Object creation from URL!";this.loaderWorker=new r}a.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t,this.loaderWorker.setLogging(this.logging.enabled,this.logging.debug)},a.prototype.setForceWorkerDataCopy=function(e){this.loaderWorker.setForceCopy(e)},a.prototype.validate=function(e,r,a,o,u){if(!t.isValid(this.loaderWorker.worker)){this.logging.enabled&&(console.info("WorkerSupport: Building worker code..."),console.time("buildWebWorkerCode")),t.isValid(u)?this.logging.enabled&&console.info('WorkerSupport: Using "'+u.name+'" as Runner class for worker.'):(u=s.WorkerRunnerRefImpl,this.logging.enabled&&console.info('WorkerSupport: Using DEFAULT "THREE.LoaderSupport.WorkerRunnerRefImpl" as Runner class for worker.'));var c=e(i,l);c+="var Parser = "+r+";\n\n",c+=l(u.name,u),c+="new "+u.name+"();\n\n";var f=this;if(t.isValid(a)&&a.length>0){var d="";!function e(t,r){if(0===r.length)f.loaderWorker.initWorker(d+c,u.name),f.logging.enabled&&console.timeEnd("buildWebWorkerCode");else{var a=new n.FileLoader;a.setPath(t),a.setResponseType("text"),a.load(r[0],(function(a){d+=a,e(t,r)})),r.shift()}}(o,a)}else this.loaderWorker.initWorker(c,u.name),this.logging.enabled&&console.timeEnd("buildWebWorkerCode")}},a.prototype.setCallbacks=function(e,t){this.loaderWorker.setCallbacks(e,t)},a.prototype.run=function(e){this.loaderWorker.run(e)},a.prototype.setTerminateRequested=function(e){this.loaderWorker.setTerminateRequested(e)};var i=function(e,t){var r,a=e+" = {\n";for(var n in t)"string"==typeof(r=t[n])||r instanceof String?a+="\t"+n+': "'+(r=(r=r.replace("\n","\\n")).replace("\r","\\r"))+'",\n':r instanceof Array?a+="\t"+n+": ["+r+"],\n":Number.isInteger(r)?a+="\t"+n+": "+r+",\n":"function"==typeof r&&(a+="\t"+n+": "+r+",\n");return a+="}\n\n"},l=function(e,r,a,n,i){var o,s,l="",u=t.isValid(a)?a:r.name;for(var c in i=t.verifyInput(i,[]),r.prototype)o=r.prototype[c],"constructor"===c?s="\tfunction "+u+o.toString().replace("function","")+";\n\n":"function"==typeof o&&i.indexOf(c)<0&&(l+="\t"+u+".prototype."+c+" = "+o.toString()+";\n\n");l+="\treturn "+u+";\n",l+="})();\n\n";var f="";return t.isValid(n)&&(f+="\n",f+=u+".prototype = Object.create( "+n+".prototype );\n",f+=u+".constructor = "+u+";\n",f+="\n"),t.isValid(s)?l=e+" = (function () {\n\n"+f+s+l:(s=e+" = (function () {\n\n",l=(s+=f+"\t"+r.prototype.constructor.toString()+"\n\n")+l),l};return a}(),s.WorkerDirector=function(){var e="2.2.0",t=s.Validator,r=16,a=8192;function i(n){if(console.info("Using THREE.LoaderSupport.WorkerDirector version: "+e),this.logging={enabled:!0,debug:!1},this.maxQueueSize=a,this.maxWebWorkers=r,this.crossOrigin=null,!t.isValid(n))throw"Provided invalid classDef: "+n;this.workerDescription={classDef:n,globalCallbacks:{},workerSupports:{},forceWorkerDataCopy:!0},this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0,this.callbackOnFinishedProcessing=null}return i.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},i.prototype.getMaxQueueSize=function(){return this.maxQueueSize},i.prototype.getMaxWebWorkers=function(){return this.maxWebWorkers},i.prototype.setCrossOrigin=function(e){this.crossOrigin=e},i.prototype.setForceWorkerDataCopy=function(e){this.workerDescription.forceWorkerDataCopy=!0===e},i.prototype.prepareWorkers=function(e,i,o){t.isValid(e)&&(this.workerDescription.globalCallbacks=e),this.maxQueueSize=Math.min(i,a),this.maxWebWorkers=Math.min(o,r),this.maxWebWorkers=Math.min(this.maxWebWorkers,this.maxQueueSize),this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0;for(var s=0;s0&&this.instructionQueuePointer0},i.prototype.processQueue=function(){var e,t;for(var r in this.workerDescription.workerSupports)(t=this.workerDescription.workerSupports[r]).inUse||(this.instructionQueuePointer=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},i[c]=r;else if(r)if("ka"===u||"kd"===u||"ks"===u){var f=c.split(a,3);r[u]=[parseFloat(f[0]),parseFloat(f[1]),parseFloat(f[2])]}else r[u]=c}}var d=new n.MaterialCreator(this.texturePath||this.path,this.materialOptions);return d.setCrossOrigin(this.crossOrigin),d.setManager(this.manager),d.setMaterials(i),d}},(n.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:a.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:a.RepeatWrapping}).prototype={constructor:n.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var r in e){var a=e[r],n={};for(var i in t[r]=n,a){var o=!0,s=a[i],l=i.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(n[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,r=this.materialsInfo[e],n={name:e,side:this.side};function i(e,r){if(!n[e]){var a,i,o=t.getTextureParams(r,n),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(i=o.url)||""===i?"":/^https?:\/\//i.test(i)?i:a+i));s.repeat.copy(o.scale),s.offset.copy(o.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,n[e]=s}}for(var o in r){var s,l=r[o];if(""!==l)switch(o.toLowerCase()){case"kd":n.color=(new a.Color).fromArray(l);break;case"ks":n.specular=(new a.Color).fromArray(l);break;case"map_kd":i("map",l);break;case"map_ks":i("specularMap",l);break;case"norm":i("normalMap",l);break;case"map_bump":case"bump":i("bumpMap",l);break;case"ns":n.shininess=parseFloat(l);break;case"d":(s=parseFloat(l))<1&&(n.opacity=s,n.transparent=!0);break;case"tr":s=parseFloat(l),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var r,n={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},i=e.split(/\s+/);return(r=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),(r=i.indexOf("-s"))>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),(r=i.indexOf("-o"))>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n},loadTexture:function(e,t,r,n,i){var o,s=a.Loader.Handlers.get(e),l=void 0!==this.manager?this.manager:a.DefaultLoadingManager;return null===s&&(s=new a.TextureLoader(l)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,r,n,i),void 0!==t&&(o.mapping=t),o}},t.default=n},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _three=__webpack_require__(0),THREE=_interopRequireWildcard(_three);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var Volume=function(e,t,r,a,n){if(arguments.length>0){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,a){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(n);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(n);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(n);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(n);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(n);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(n);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw"Error in THREE.Volume constructor : this type is not supported in JavaScript";case"Float32":case"float32":case"float":this.data=new Float32Array(n);break;case"Float64":case"float64":case"double":this.data=new Float64Array(n);break;default:this.data=new Uint8Array(n)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw"Error in THREE.Volume constructor, lengths are not matching arrayBuffer size"}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new THREE.Matrix3,this.matrix.identity();var i=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return i},set:function(e){i=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});var o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[]};Volume.prototype={constructor:Volume,getData:function(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]},access:function(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e},reverseAccess:function(e){var t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]},map:function(e,t){var r=this.data.length;t=t||this;for(var a=0;a.9})),jDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[1]))>.9})),kDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[2]))>.9})),argumentsWithInversion=["volume.xLength-1-","volume.yLength-1-","volume.zLength-1-"],argArray=[iDirection,jDirection,kDirection].map((function(e,t){return(e.dot(base[t])>0?"":argumentsWithInversion[t])+(e===axisInIJK?"IJKIndex":e.argVar)})),argString=argArray.join(",");return sliceAccess=eval("(function sliceAccess (i,j) {return volume.access( "+argString+");})"),{iLength:iLength,jLength:jLength,sliceAccess:sliceAccess,matrix:planeMatrix,planeWidth:planeWidth,planeHeight:planeHeight}},extractSlice:function(e,t){var r=new THREE.VolumeSlice(this,t,e);return this.sliceList.push(r),r},repaintAllSlices:function(){return this.sliceList.forEach((function(e){e.repaint()})),this},computeMinMax:function(){var e=1/0,t=-1/0,r=this.data.length,a=0;for(a=0;a","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","float l = linearToRelativeLuminance( texel.rgb );","gl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","uniform sampler2D luminanceMap;","#else","uniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","#ifdef ADAPTED_LUMINANCE","float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","#else","float fLumAvg = averageLuminance;","#endif","float fLumPixel = linearToRelativeLuminance( vColor );","float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","return fLumCompressed * vColor;","}","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-e*e/(2*t*t))}var r,a,n,i,o=2*Math.ceil(3*e)+1;for(o>25&&(o=25),i=.5*(o-1),a=new Array(o),n=0,r=0;r","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","vec2 aspectcorrect = vec2( 1.0, aspect );","float viewZ = getViewZ( getDepth( vUv ) );","float factor = ( focus + viewZ );","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},tSize:{value:new a.Vector2(256,256)},center:{value:new a.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float dx = rand( vUv + time );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","if(byp<1) {","vec2 p = vUv;","float xs = floor(gl_FragCoord.x / 0.5);","float ys = floor(gl_FragCoord.y / 0.5);","vec4 normal = texture2D (tDisp, p*seed*seed);","if(p.ydistortion_x-col_s*seed) {","if(seed_x>0.){","p.y = 1. - (p.y + distortion_y);","}","else {","p.y = distortion_y;","}","}","if(p.xdistortion_y-col_s*seed) {","if(seed_y>0.){","p.x=distortion_x;","}","else {","p.x = 1. - (p.x + distortion_x);","}","}","p.x+=normal.x*seed_x*(seed/5.);","p.y+=normal.y*seed_y*(seed/5.);","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, p + offset);","vec4 cga = texture2D(tDiffuse, p);","vec4 cb = texture2D(tDiffuse, p - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","gl_FragColor = gl_FragColor+ snow;","}","else {","gl_FragColor=texture2D (tDiffuse, vUv);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","vUV = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","return a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","return sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","float dist = hypot( coord.x - p.x, coord.y - p.y );","float rad = channel;","if ( shape == SHAPE_DOT ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","} else if ( shape == SHAPE_ELLIPSE ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","if ( dist != 0.0 ) {","float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","}","} else if ( shape == SHAPE_LINE ) {","rad = pow( abs( rad ), 1.5) * rad_max;","float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","dist = hypot( normal.x * dot_p, normal.y * dot_p );","} else if ( shape == SHAPE_SQUARE ) {","float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","float sin_t = abs( sin( theta ) );","float cos_t = abs( cos( theta ) );","rad = pow( abs( rad ), 1.4 );","rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","}","return rad - dist;","}","struct Cell {","vec2 normal;","vec2 p1;","vec2 p2;","vec2 p3;","vec2 p4;","float samp2;","float samp1;","float samp3;","float samp4;","};","vec4 getSample( vec2 point ) {","vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","float step = PI2 / float( samples );","float dist = radius * 0.66;","for ( int i = 0; i < samples; ++i ) {","float r = base + step * float( i );","vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","}","tex /= float( samples ) + 1.0;","return tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","if ( channel == 0 ) {","c.samp1 = getSample( c.p1 ).r;","c.samp2 = getSample( c.p2 ).r;","c.samp3 = getSample( c.p3 ).r;","c.samp4 = getSample( c.p4 ).r;","} else if (channel == 1) {","c.samp1 = getSample( c.p1 ).g;","c.samp2 = getSample( c.p2 ).g;","c.samp3 = getSample( c.p3 ).g;","c.samp4 = getSample( c.p4 ).g;","} else {","c.samp1 = getSample( c.p1 ).b;","c.samp3 = getSample( c.p3 ).b;","c.samp2 = getSample( c.p2 ).b;","c.samp4 = getSample( c.p4 ).b;","}","dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","res = clamp( res, 0.0, 1.0 );","return res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","Cell c;","vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","float threshold = step * 0.5;","float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","float offset_normal = mod( hypot( offset.x, offset.y ), step );","float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","c.normal = n;","c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","if ( scatter != 0.0 ) {","float off_mag = scatter * threshold * 0.5;","float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","c.p1.x += cos( off_angle ) * off_mag;","c.p1.y += sin( off_angle ) * off_mag;","}","float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","c.p2.x = c.p1.x - n.x * normal_step;","c.p2.y = c.p1.y - n.y * normal_step;","c.p3.x = c.p1.x + n.y * line_step;","c.p3.y = c.p1.y - n.x * line_step;","c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","return c;","}","float blendColour( float a, float b, float t ) {","if ( blendingMode == BLENDING_LINEAR ) {","return blend( a, b, 1.0 - t );","} else if ( blendingMode == BLENDING_ADD ) {","return blend( a, min( 1.0, a + b ), t );","} else if ( blendingMode == BLENDING_MULTIPLY ) {","return blend( a, max( 0.0, a * b ), t );","} else if ( blendingMode == BLENDING_LIGHTER ) {","return blend( a, max( a, b ), t );","} else if ( blendingMode == BLENDING_DARKER ) {","return blend( a, min( a, b ), t );","} else {","return blend( a, b, 1.0 - t );","}","}","void main() {","if ( ! disable ) {","vec2 p = vec2( vUV.x * width, vUV.y * height );","vec2 origin = vec2( 0, 0 );","float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","Cell cell_r = getReferenceCell( p, origin, rotateR, radius );","Cell cell_g = getReferenceCell( p, origin, rotateG, radius );","Cell cell_b = getReferenceCell( p, origin, rotateB, radius );","float r = getDotColour( cell_r, p, 0, rotateR, aa );","float g = getDotColour( cell_g, p, 1, rotateG, aa );","float b = getDotColour( cell_b, p, 2, rotateB, aa );","vec4 colour = texture2D( tDiffuse, vUV );","r = blendColour( r, colour.r, blending );","g = blendColour( g, colour.g, blending );","b = blendColour( b, colour.b, blending );","if ( greyscale ) {","r = g = b = (r + b + g) / 3.0;","}","gl_FragColor = vec4( r, g, b, 1.0 );","} else {","gl_FragColor = texture2D( tDiffuse, vUV );","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{type:"t",value:null},tDiffuse:{type:"t",value:null},tNormal:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},cameraProjectionMatrix:{type:"m4",value:new a.Matrix4},cameraInverseProjectionMatrix:{type:"m4",value:new a.Matrix4},scale:{type:"f",value:1},intensity:{type:"f",value:.1},bias:{type:"f",value:.5},minResolution:{type:"f",value:0},kernelRadius:{type:"f",value:100},randomSeed:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},sampleUvOffsets:{type:"v2v",value:[new a.Vector2(0,0)]},sampleWeights:{type:"1fv",value:[1]},tDepth:{type:"t",value:null},cameraNear:{type:"f",value:10},cameraFar:{type:"f",value:1e3},depthCutoff:{type:"f",value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","float depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={createSampleWeights:function(e,t){for(var r=function(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)},a=[],n=0;n<=e;n++)a.push(r(n,t));return a},createSampleOffsets:function(e,t){for(var r=[],a=0;a<=e;a++)r.push(t.clone().multiplyScalar(a));return r},configure:function(e,t,r,n){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=a.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=a.createSampleWeights(t,r),e.needsUpdate=!0}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","t = abs( C - Ctop );","delta.y = max( max( t.r, t.g ), t.b );","vec2 edges = step( threshold, delta.xy );","if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){n.default.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==o?o:0,void 0===i.default&&console.error("THREE.SSAARenderPass relies on THREE.CopyShader");var s=i.default;this.copyUniforms=a.UniformsUtils.clone(s.uniforms),this.copyMaterial=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.camera2=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene2=new a.Scene,this.quad2=new a.Mesh(new a.PlaneBufferGeometry(2,2),this.copyMaterial),this.quad2.frustumCulled=!1,this.scene2.add(this.quad2)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var n=s.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1;var o=e.getClearColor().getHex(),l=e.getClearAlpha(),u=1/n.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;for(var c=r.width,f=r.height,d=0;d","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );","float gg = fract( coord.t * ( size.y / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float readDepth( const in vec2 coord ) {","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","#ifdef USE_LOGDEPTHBUF","float logz = unpackRGBAToDepth( texture2D( tDepth, coord ) );","float w = pow(2.0, (logz / logDepthBufFC)) - 1.0;","float z = (logz / w) + 1.0;","#else","float z = unpackRGBAToDepth( texture2D( tDepth, coord ) );","#endif","return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 8.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + radius * vv;","vec2 coord2 = vUv - radius * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float ao = 0.0;","float dz = 1.0 / float( samples );","float l = 0.0;","float z = 1.0 - dz / 2.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","float pw = cos( l ) * r;","float ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{type:"t",value:null},luminosityThreshold:{type:"f",value:1},smoothWidth:{type:"f",value:1},defaultColor:{type:"c",value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(0)},defaultOpacity:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","gl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var n=r(40);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}));var i=r(48);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}));var o=r(90);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}));var s=r(112);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})}));var l=r(144);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VRControls=t.TransformControls=t.TrackballControls=t.PointerLockControls=t.OrthographicTrackballControls=t.OrbitControls=t.FlyControls=t.FirstPersonControls=t.EditorControls=t.DragControls=t.DeviceOrientationControls=void 0;var a=p(r(29)),n=p(r(30)),i=p(r(31)),o=p(r(32)),s=p(r(33)),l=p(r(34)),u=p(r(35)),c=p(r(36)),f=p(r(37)),d=p(r(38)),h=p(r(39));function p(e){return e&&e.__esModule?e:{default:e}}t.DeviceOrientationControls=a.default,t.DragControls=n.default,t.EditorControls=i.default,t.FirstPersonControls=o.default,t.FlyControls=s.default,t.OrbitControls=l.default,t.OrthographicTrackballControls=u.default,t.PointerLockControls=c.default,t.TrackballControls=f.default,t.TransformControls=d.default,t.VRControls=h.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r,n,i,o,s=function(e){t.deviceOrientation=e},l=function(){t.screenOrientation=window.orientation||0},u=(r=new a.Vector3(0,0,1),n=new a.Euler,i=new a.Quaternion,o=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),function(e,t,a,s,l){n.set(a,t,-s,"YXZ"),e.setFromEuler(n),e.multiply(o),e.multiply(i.setFromAxisAngle(r,-l))});this.connect=function(){l(),window.addEventListener("orientationchange",l,!1),window.addEventListener("deviceorientation",s,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",l,!1),window.removeEventListener("deviceorientation",s,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var r=e.alpha?a.Math.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?a.Math.degToRad(e.beta):0,i=e.gamma?a.Math.degToRad(e.gamma):0,o=t.screenOrientation?a.Math.degToRad(t.screenOrientation):0;u(t.object.quaternion,r,n,i,o)}}},this.dispose=function(){t.disconnect()},this.connect()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t,r){if(e instanceof a.Camera){console.warn("THREE.DragControls: Constructor now expects ( objects, camera, domElement )");var n=e;e=t,t=n}var i=new a.Plane,o=new a.Raycaster,s=new a.Vector2,l=new a.Vector3,u=new a.Vector3,c=null,f=null,d=this;function h(){r.addEventListener("mousemove",m,!1),r.addEventListener("mousedown",v,!1),r.addEventListener("mouseup",g,!1),r.addEventListener("mouseleave",g,!1),r.addEventListener("touchmove",y,!1),r.addEventListener("touchstart",b,!1),r.addEventListener("touchend",w,!1)}function p(){r.removeEventListener("mousemove",m,!1),r.removeEventListener("mousedown",v,!1),r.removeEventListener("mouseup",g,!1),r.removeEventListener("mouseleave",g,!1),r.removeEventListener("touchmove",y,!1),r.removeEventListener("touchstart",b,!1),r.removeEventListener("touchend",w,!1)}function m(a){a.preventDefault();var n=r.getBoundingClientRect();if(s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c});o.setFromCamera(s,t);var h=o.intersectObjects(e);if(h.length>0){var p=h[0].object;i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),p.position),f!==p&&(d.dispatchEvent({type:"hoveron",object:p}),r.style.cursor="pointer",f=p)}else null!==f&&(d.dispatchEvent({type:"hoveroff",object:f}),r.style.cursor="auto",f=null)}function v(a){a.preventDefault(),o.setFromCamera(s,t);var n=o.intersectObjects(e);n.length>0&&(c=n[0].object,o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function g(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}function y(e){e.preventDefault(),e=e.changedTouches[0];var a=r.getBoundingClientRect();if(s.x=(e.clientX-a.left)/a.width*2-1,s.y=-(e.clientY-a.top)/a.height*2+1,o.setFromCamera(s,t),c&&d.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void d.dispatchEvent({type:"drag",object:c})}function b(a){a.preventDefault(),a=a.changedTouches[0];var n=r.getBoundingClientRect();s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t);var f=o.intersectObjects(e);f.length>0&&(c=f[0].object,i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),c.position),o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",d.dispatchEvent({type:"dragstart",object:c}))}function w(e){e.preventDefault(),c&&(d.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}h(),this.enabled=!0,this.activate=h,this.deactivate=p,this.dispose=function(){p()},this.setObjects=function(){console.error("THREE.DragControls: setObjects() has been removed.")},this.on=function(e,t){console.warn("THREE.DragControls: on() has been deprecated. Use addEventListener() instead."),d.addEventListener(e,t)},this.off=function(e,t){console.warn("THREE.DragControls: off() has been deprecated. Use removeEventListener() instead."),d.removeEventListener(e,t)},this.notify=function(e){console.error("THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead."),d.dispatchEvent({type:e})}};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){t=void 0!==t?t:document,this.enabled=!0,this.center=new a.Vector3,this.panSpeed=.001,this.zoomSpeed=.001,this.rotationSpeed=.005;var r=this,n=new a.Vector3,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2},o=i.NONE,s=this.center,l=new a.Matrix3,u=new a.Vector2,c=new a.Vector2,f=new a.Spherical,d={type:"change"};function h(e){!1!==r.enabled&&(0===e.button?o=i.ROTATE:1===e.button?o=i.ZOOM:2===e.button&&(o=i.PAN),c.set(e.clientX,e.clientY),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",m,!1),t.addEventListener("mouseout",m,!1),t.addEventListener("dblclick",m,!1))}function p(e){if(!1!==r.enabled){u.set(e.clientX,e.clientY);var t=u.x-c.x,n=u.y-c.y;o===i.ROTATE?r.rotate(new a.Vector3(-t*r.rotationSpeed,-n*r.rotationSpeed,0)):o===i.ZOOM?r.zoom(new a.Vector3(0,0,n)):o===i.PAN&&r.pan(new a.Vector3(-t,n,0)),c.set(e.clientX,e.clientY)}}function m(e){t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),o=i.NONE}function v(e){e.preventDefault(),r.zoom(new a.Vector3(0,0,e.deltaY))}function g(e){e.preventDefault()}this.focus=function(t){var n,i=(new a.Box3).setFromObject(t);!1===i.isEmpty()?(s.copy(i.getCenter()),n=i.getBoundingSphere().radius):(s.setFromMatrixPosition(t.matrixWorld),n=.1);var o=new a.Vector3(0,0,1);o.applyQuaternion(e.quaternion),o.multiplyScalar(4*n),e.position.copy(s).add(o),r.dispatchEvent(d)},this.pan=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.panSpeed),t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),s.add(t),r.dispatchEvent(d)},this.zoom=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.zoomSpeed),t.length()>a||(t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),r.dispatchEvent(d))},this.rotate=function(t){n.copy(e.position).sub(s),f.setFromVector3(n),f.theta+=t.x,f.phi+=t.y,f.makeSafe(),n.setFromSpherical(f),e.position.copy(s).add(n),e.lookAt(s),r.dispatchEvent(d)},this.dispose=function(){t.removeEventListener("contextmenu",g,!1),t.removeEventListener("mousedown",h,!1),t.removeEventListener("wheel",v,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),t.removeEventListener("touchstart",x,!1),t.removeEventListener("touchmove",_,!1)},t.addEventListener("contextmenu",g,!1),t.addEventListener("mousedown",h,!1),t.addEventListener("wheel",v,!1);var y=[new a.Vector3,new a.Vector3,new a.Vector3],b=[new a.Vector3,new a.Vector3,new a.Vector3],w=null;function x(e){if(!1!==r.enabled){switch(e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0);break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0),w=y[0].distanceTo(y[1])}b[0].copy(y[0]),b[1].copy(y[1])}}function _(e){if(!1!==r.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0),r.rotate(y[0].sub(o(y[0],b)).multiplyScalar(-r.rotationSpeed));break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0);var t=y[0].distanceTo(y[1]);r.zoom(new a.Vector3(0,0,w-t)),w=t;var n=y[0].clone().sub(o(y[0],b)),i=y[1].clone().sub(o(y[1],b));n.x=-n.x,i.x=-i.x,r.pan(n.add(i).multiplyScalar(.5))}b[0].copy(y[0]),b[1].copy(y[1])}function o(e,t){var r=t[0];for(var a in t)r.distanceTo(e)>t[a].distanceTo(e)&&(r=t[a]);return r}}t.addEventListener("touchstart",x,!1),t.addEventListener("touchmove",_,!1)};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e){e.preventDefault()}this.object=e,this.target=new a.Vector3(0,0,0),this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.lookSpeed=.005,this.lookVertical=!0,this.autoForward=!1,this.activeLook=!0,this.heightSpeed=!1,this.heightCoef=1,this.heightMin=0,this.heightMax=1,this.constrainVertical=!1,this.verticalMin=0,this.verticalMax=Math.PI,this.autoSpeedFactor=0,this.mouseX=0,this.mouseY=0,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.moveForward=!1,this.moveBackward=!1,this.moveLeft=!1,this.moveRight=!1,this.mouseDragOn=!1,this.viewHalfX=0,this.viewHalfY=0,this.domElement!==document&&this.domElement.setAttribute("tabindex",-1),this.handleResize=function(){this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)},this.onMouseDown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0},this.onMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1},this.onMouseMove=function(e){this.domElement===document?(this.mouseX=e.pageX-this.viewHalfX,this.mouseY=e.pageY-this.viewHalfY):(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)},this.onKeyDown=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0}},this.onKeyUp=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}},this.update=function(e){if(!1!==this.enabled){if(this.heightSpeed){var t=a.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;var r=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(r+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(r),this.moveLeft&&this.object.translateX(-r),this.moveRight&&this.object.translateX(r),this.moveUp&&this.object.translateY(r),this.moveDown&&this.object.translateY(-r);var n=e*this.lookSpeed;this.activeLook||(n=0);var i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon+=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*i),this.lat=Math.max(-85,Math.min(85,this.lat)),this.phi=a.Math.degToRad(90-this.lat),this.theta=a.Math.degToRad(this.lon),this.constrainVertical&&(this.phi=a.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax));var o=this.target,s=this.object.position;o.x=s.x+100*Math.sin(this.phi)*Math.cos(this.theta),o.y=s.y+100*Math.cos(this.phi),o.z=s.z+100*Math.sin(this.phi)*Math.sin(this.theta),this.object.lookAt(o)}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",r,!1),this.domElement.removeEventListener("mousedown",i,!1),this.domElement.removeEventListener("mousemove",n,!1),this.domElement.removeEventListener("mouseup",o,!1),window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",l,!1)};var n=u(this,this.onMouseMove),i=u(this,this.onMouseDown),o=u(this,this.onMouseUp),s=u(this,this.onKeyDown),l=u(this,this.onKeyUp);function u(e,t){return function(){t.apply(e,arguments)}}this.domElement.addEventListener("contextmenu",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mouseup",o,!1),window.addEventListener("keydown",s,!1),window.addEventListener("keyup",l,!1),this.handleResize()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e,t){return function(){t.apply(e,arguments)}}function n(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this.tmpQuaternion=new a.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new a.Vector3(0,0,0),this.rotationVector=new a.Vector3(0,0,0),this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)},this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),r=t.size[0]/2,a=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-a)/a,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){var t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order)},this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",n,!1),this.domElement.removeEventListener("mousedown",o,!1),this.domElement.removeEventListener("mousemove",i,!1),this.domElement.removeEventListener("mouseup",s,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",u,!1)};var i=r(this,this.mousemove),o=r(this,this.mousedown),s=r(this,this.mouseup),l=r(this,this.keydown),u=r(this,this.keyup);this.domElement.addEventListener("contextmenu",n,!1),this.domElement.addEventListener("mousemove",i,!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mouseup",s,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",u,!1),this.updateMovementVector(),this.updateRotationVector()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),h=d.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&h===d.NONE&&O(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),y.set(0,0,0)),g=1,!!(b||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",U,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",G,!1),l.domElement.removeEventListener("touchend",X,!1),l.domElement.removeEventListener("touchmove",H,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",z,!1)};var l=this,u={type:"change"},c={type:"start"},f={type:"end"},d={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},h=d.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,b=!1,w=new a.Vector2,x=new a.Vector2,_=new a.Vector2,A=new a.Vector2,E=new a.Vector2,S=new a.Vector2,M=new a.Vector2,T=new a.Vector2,P=new a.Vector2;function F(){return Math.pow(.95,l.zoomSpeed)}function O(e){v.theta-=e}function L(e){v.phi-=e}var C,k=(C=new a.Vector3,function(e,t){C.setFromMatrixColumn(t,0),C.multiplyScalar(-e),y.add(C)}),R=function(){var e=new a.Vector3;return function(t,r){!0===l.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),I=function(){var e=new a.Vector3;return function(t,r){var a=l.domElement===document?l.domElement.body:l.domElement;if(l.object.isPerspectiveCamera){var n=l.object.position;e.copy(n).sub(l.target);var i=e.length();i*=Math.tan(l.object.fov/2*Math.PI/180),k(2*t*i/a.clientHeight,l.object.matrix),R(2*r*i/a.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(k(t*(l.object.right-l.object.left)/l.object.zoom/a.clientWidth,l.object.matrix),R(r*(l.object.top-l.object.bottom)/l.object.zoom/a.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function N(e){l.object.isPerspectiveCamera?g/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object.isPerspectiveCamera?g*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY)}(e),h=d.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=d.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){A.set(e.clientX,e.clientY)}(e),h=d.PAN}h!==d.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",B,!1),l.dispatchEvent(c))}}function j(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case d.ROTATE:if(!1===l.enableRotate)return;!function(e){x.set(e.clientX,e.clientY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case d.DOLLY:if(!1===l.enableZoom)return;!function(e){T.set(e.clientX,e.clientY),P.subVectors(T,M),P.y>0?N(F()):P.y<0&&D(F()),M.copy(T),l.update()}(e);break;case d.PAN:if(!1===l.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E),l.update()}(e)}}function B(e){!1!==l.enabled&&(document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",B,!1),l.dispatchEvent(f),h=d.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==d.NONE&&h!==d.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(c),function(e){e.deltaY<0?D(F()):e.deltaY>0&&N(F()),l.update()}(e),l.dispatchEvent(f))}function z(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:I(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:I(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:I(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:I(-l.keyPanSpeed,0),l.update()}}(e)}function G(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=d.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);M.set(0,a)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);A.set(n,i)}}(e),h=d.TOUCH_DOLLY_PAN;break;default:h=d.NONE}h!==d.NONE&&l.dispatchEvent(c)}}function H(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==d.TOUCH_ROTATE)return;!function(e){x.set(e.touches[0].pageX,e.touches[0].pageY),_.subVectors(x,w).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;O(2*Math.PI*_.x/t.clientHeight),L(2*Math.PI*_.y/t.clientHeight),w.copy(x),l.update()}(e);break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;if(h!==d.TOUCH_DOLLY_PAN)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);T.set(0,a),P.set(0,Math.pow(T.y/M.y,l.zoomSpeed)),N(P.y),M.copy(T)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);E.set(n,i),S.subVectors(E,A).multiplyScalar(l.panSpeed),I(S.x,S.y),A.copy(E)}l.update()}(e);break;default:h=d.NONE}}function X(e){!1!==l.enabled&&(l.dispatchEvent(f),h=d.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",U,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",G,!1),l.domElement.addEventListener("touchend",X,!1),l.domElement.addEventListener("touchmove",H,!1),window.addEventListener("keydown",z,!1),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.radius=0,this.rotateSpeed=1,this.zoomSpeed=1.2,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.keys=[65,83,68],this.target=new a.Vector3;var i=!0,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector3,c=new a.Vector3,f=new a.Vector2,d=new a.Vector2,h=0,p=0,m=new a.Vector2,v=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom;var g={type:"change"},y={type:"start"},b={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}this.radius=.5*Math.min(this.screen.width,this.screen.height),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var w,x,_,A,E,S,M=(w=new a.Vector2,function(e,t){return w.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),w}),T=function(){var e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(a,i){n.set((a-.5*r.screen.width-r.screen.left)/r.radius,(.5*r.screen.height+r.screen.top-i)/r.radius,0);var o=n.length();return r.noRoll?o1?n.normalize():n.z=Math.sqrt(1-o*o),l.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(n.y),e.add(t.copy(r.object.up).cross(l).setLength(n.x)),e.add(l.setLength(n.z)),e}}();function P(e){!1!==r.enabled&&(window.removeEventListener("keydown",P),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function F(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",P,!1))}function O(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(m.copy(M(e.pageX,e.pageY)),v.copy(m)):(f.copy(M(e.pageX,e.pageY)),d.copy(f)):(u.copy(T(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",L,!1),document.addEventListener("mouseup",C,!1),r.dispatchEvent(y))}function L(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||v.copy(M(e.pageX,e.pageY)):d.copy(M(e.pageX,e.pageY)):c.copy(T(e.pageX,e.pageY)))}function C(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",C),r.dispatchEvent(b))}function k(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),f.y+=.01*e.deltaY,r.dispatchEvent(y),r.dispatchEvent(b))}function R(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,u.copy(T(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;case 2:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=h=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(M(i,s)),v.copy(m);break;default:o=n.NONE}r.dispatchEvent(y)}}function I(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(i,s));break;default:o=n.NONE}}function N(e){if(!1!==r.enabled){switch(e.touches.length){case 1:c.copy(T(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;case 2:h=p=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,a=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(M(t,a)),m.copy(v)}o=n.NONE,r.dispatchEvent(b)}}function D(e){e.preventDefault()}this.rotateCamera=(x=new a.Vector3,_=new a.Quaternion,function(){var e=Math.acos(u.dot(c)/u.length()/c.length());e&&(x.crossVectors(u,c).normalize(),e*=r.rotateSpeed,_.setFromAxisAngle(x,-e),l.applyQuaternion(_),r.object.up.applyQuaternion(_),c.applyQuaternion(_),r.staticMoving?u.copy(c):(_.setFromAxisAngle(x,e*(r.dynamicDampingFactor-1)),u.applyQuaternion(_)),i=!0)}),this.zoomCamera=function(){if(o===n.TOUCH_ZOOM_PAN){var e=p/h;h=p,r.object.zoom*=e,i=!0}else{e=1+(d.y-f.y)*r.zoomSpeed;Math.abs(e-1)>1e-6&&e>0&&(r.object.zoom/=e,r.staticMoving?f.copy(d):f.y+=(d.y-f.y)*this.dynamicDampingFactor,i=!0)}},this.panCamera=(A=new a.Vector2,E=new a.Vector3,S=new a.Vector3,function(){if(A.copy(v).sub(m),A.lengthSq()){var e=(r.object.right-r.object.left)/r.object.zoom,t=(r.object.top-r.object.bottom)/r.object.zoom;A.x*=e,A.y*=t,S.copy(l).cross(r.object.up).setLength(A.x),S.add(E.copy(r.object.up).setLength(A.y)),r.object.position.add(S),r.target.add(S),r.staticMoving?m.copy(v):m.add(A.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)),i=!0}}),this.update=function(){l.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||(r.zoomCamera(),i&&r.object.updateProjectionMatrix()),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,l),r.object.lookAt(r.target),i&&(r.dispatchEvent(g),i=!1)},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.left=r.left0,r.object.right=r.right0,r.object.top=r.top0,r.object.bottom=r.bottom0,r.object.lookAt(r.target),r.dispatchEvent(g),i=!1},this.dispose=function(){this.domElement.removeEventListener("contextmenu",D,!1),this.domElement.removeEventListener("mousedown",O,!1),this.domElement.removeEventListener("wheel",k,!1),this.domElement.removeEventListener("touchstart",R,!1),this.domElement.removeEventListener("touchend",N,!1),this.domElement.removeEventListener("touchmove",I,!1),document.removeEventListener("mousemove",L,!1),document.removeEventListener("mouseup",C,!1),window.removeEventListener("keydown",P,!1),window.removeEventListener("keyup",F,!1)},this.domElement.addEventListener("contextmenu",D,!1),this.domElement.addEventListener("mousedown",O,!1),this.domElement.addEventListener("wheel",k,!1),this.domElement.addEventListener("touchstart",R,!1),this.domElement.addEventListener("touchend",N,!1),this.domElement.addEventListener("touchmove",I,!1),window.addEventListener("keydown",P,!1),window.addEventListener("keyup",F,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;e.rotation.set(0,0,0);var r=new a.Object3D;r.add(e);var n=new a.Object3D;n.position.y=10,n.add(r);var i,o,s=Math.PI/2,l=function(e){if(!1!==t.enabled){var a=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;n.rotation.y-=.002*a,r.rotation.x-=.002*i,r.rotation.x=Math.max(-s,Math.min(s,r.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",l,!1)},document.addEventListener("mousemove",l,!1),this.enabled=!1,this.getObject=function(){return n},this.getDirection=(i=new a.Vector3(0,0,-1),o=new a.Euler(0,0,0,"YXZ"),function(e){return o.set(r.rotation.x,n.rotation.y,0),e.copy(i).applyEuler(o),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new a.Vector3;var i=new a.Vector3,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector2,c=new a.Vector2,f=new a.Vector3,d=0,h=new a.Vector2,p=new a.Vector2,m=0,v=0,g=new a.Vector2,y=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var b={type:"change"},w={type:"start"},x={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var _,A,E,S,M,T,P,F,O,L,C,k=(_=new a.Vector2,function(e,t){return _.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),_}),R=function(){var e=new a.Vector2;return function(t,a){return e.set((t-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-a))/r.screen.width),e}}();function I(e){!1!==r.enabled&&(window.removeEventListener("keydown",I),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function N(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",I,!1))}function D(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(g.copy(k(e.pageX,e.pageY)),y.copy(g)):(h.copy(k(e.pageX,e.pageY)),p.copy(h)):(c.copy(R(e.pageX,e.pageY)),u.copy(c)),document.addEventListener("mousemove",U,!1),document.addEventListener("mouseup",j,!1),r.dispatchEvent(w))}function U(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||y.copy(k(e.pageX,e.pageY)):p.copy(k(e.pageX,e.pageY)):(u.copy(c),c.copy(R(e.pageX,e.pageY))))}function j(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",j),r.dispatchEvent(x))}function B(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:h.y-=.025*e.deltaY;break;case 1:h.y-=.01*e.deltaY;break;default:h.y-=25e-5*e.deltaY}r.dispatchEvent(w),r.dispatchEvent(x)}}function V(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,c.copy(R(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;default:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=m=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;g.copy(k(i,s)),y.copy(g)}r.dispatchEvent(w)}}function z(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:u.copy(c),c.copy(R(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=Math.sqrt(t*t+a*a);var n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;y.copy(k(n,i))}}function G(e){if(!1!==r.enabled){switch(e.touches.length){case 0:o=n.NONE;break;case 1:o=n.TOUCH_ROTATE,c.copy(R(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c)}r.dispatchEvent(x)}}function H(e){!1!==r.enabled&&e.preventDefault()}this.rotateCamera=(E=new a.Vector3,S=new a.Quaternion,M=new a.Vector3,T=new a.Vector3,P=new a.Vector3,F=new a.Vector3,function(){F.set(c.x-u.x,c.y-u.y,0),(A=F.length())?(l.copy(r.object.position).sub(r.target),M.copy(l).normalize(),T.copy(r.object.up).normalize(),P.crossVectors(T,M).normalize(),T.setLength(c.y-u.y),P.setLength(c.x-u.x),F.copy(T.add(P)),E.crossVectors(F,l).normalize(),A*=r.rotateSpeed,S.setFromAxisAngle(E,A),l.applyQuaternion(S),r.object.up.applyQuaternion(S),f.copy(E),d=A):!r.staticMoving&&d&&(d*=Math.sqrt(1-r.dynamicDampingFactor),l.copy(r.object.position).sub(r.target),S.setFromAxisAngle(f,d),l.applyQuaternion(S),r.object.up.applyQuaternion(S)),u.copy(c)}),this.zoomCamera=function(){var e;o===n.TOUCH_ZOOM_PAN?(e=m/v,m=v,l.multiplyScalar(e)):(1!==(e=1+(p.y-h.y)*r.zoomSpeed)&&e>0&&l.multiplyScalar(e),r.staticMoving?h.copy(p):h.y+=(p.y-h.y)*this.dynamicDampingFactor)},this.panCamera=(O=new a.Vector2,L=new a.Vector3,C=new a.Vector3,function(){O.copy(y).sub(g),O.lengthSq()&&(O.multiplyScalar(l.length()*r.panSpeed),C.copy(l).cross(r.object.up).setLength(O.x),C.add(L.copy(r.object.up).setLength(O.y)),r.object.position.add(C),r.target.add(C),r.staticMoving?g.copy(y):g.add(O.subVectors(y,g).multiplyScalar(r.dynamicDampingFactor)))}),this.checkDistances=function(){r.noZoom&&r.noPan||(l.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,l.setLength(r.maxDistance)),h.copy(p)),l.lengthSq()1e-6&&(r.dispatchEvent(b),i.copy(r.object.position))},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(b),i.copy(r.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",H,!1),this.domElement.removeEventListener("mousedown",D,!1),this.domElement.removeEventListener("wheel",B,!1),this.domElement.removeEventListener("touchstart",V,!1),this.domElement.removeEventListener("touchend",G,!1),this.domElement.removeEventListener("touchmove",z,!1),document.removeEventListener("mousemove",U,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",I,!1),window.removeEventListener("keyup",N,!1)},this.domElement.addEventListener("contextmenu",H,!1),this.domElement.addEventListener("mousedown",D,!1),this.domElement.addEventListener("wheel",B,!1),this.domElement.addEventListener("touchstart",V,!1),this.domElement.addEventListener("touchend",G,!1),this.domElement.addEventListener("touchmove",z,!1),window.addEventListener("keydown",I,!1),window.addEventListener("keyup",N,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){var e=function(e){a.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.side=a.FrontSide,this.transparent=!0,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(e.prototype=Object.create(a.MeshBasicMaterial.prototype)).constructor=e;var t=function(e){a.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.transparent=!0,this.linewidth=1,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(t.prototype=Object.create(a.LineBasicMaterial.prototype)).constructor=t;var r=new e({visible:!1,transparent:!1}),n=function(){this.init=function(){a.Object3D.call(this),this.handles=new a.Object3D,this.pickers=new a.Object3D,this.planes=new a.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new a.PlaneBufferGeometry(50,50,2,2),t=new a.MeshBasicMaterial({visible:!1,side:a.DoubleSide}),r={XY:new a.Mesh(e,t),YZ:new a.Mesh(e,t),XZ:new a.Mesh(e,t),XYZE:new a.Mesh(e,t)};for(var n in this.activePlane=r.XYZE,r.YZ.rotation.set(0,Math.PI/2,0),r.XZ.rotation.set(-Math.PI/2,0,0),r)r[n].name=n,this.planes.add(r[n]),this.planes[n]=r[n];var i=function(e,t){for(var r in e)for(n=e[r].length;n--;){var a=e[r][n][0],i=e[r][n][1],o=e[r][n][2];a.name=r,a.renderOrder=1/0,i&&a.position.set(i[0],i[1],i[2]),o&&a.rotation.set(o[0],o[1],o[2]),t.add(a)}};i(this.handleGizmos,this.handles),i(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof a.Mesh){e.updateMatrix();var t=e.geometry.clone();t.applyMatrix(e.matrix),e.geometry=t,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))},this.highlight=function(e){this.traverse((function(t){t.material&&t.material.highlight&&(t.name===e?t.material.highlight(!0):t.material.highlight(!1))}))}};(n.prototype=Object.create(a.Object3D.prototype)).constructor=n,n.prototype.update=function(e,t){var r=new a.Vector3(0,0,0),n=new a.Vector3(0,1,0),i=new a.Matrix4;this.traverse((function(a){-1!==a.name.search("E")?a.quaternion.setFromRotationMatrix(i.lookAt(t,r,n)):-1===a.name.search("X")&&-1===a.name.search("Y")&&-1===a.name.search("Z")||a.quaternion.setFromEuler(e)}))};var i=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.CylinderGeometry(0,.05,.2,12,1,!1));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),new e({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),r)]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()};(i.prototype=Object.create(n.prototype)).constructor=i;var o=function(){n.call(this);var e=function(e,t,r){var n=new a.BufferGeometry,i=[];r=r||1;for(var o=0;o<=64*r;++o)"x"===t&&i.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&i.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&i.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return n.addAttribute("position",new a.Float32BufferAttribute(i,3)),n};this.handleGizmos={X:[[new a.Line(new e(1,"x",.5),new t({color:16711680}))]],Y:[[new a.Line(new e(1,"y",.5),new t({color:65280}))]],Z:[[new a.Line(new e(1,"z",.5),new t({color:255}))]],E:[[new a.Line(new e(1.25,"z",1),new t({color:13421568}))]],XYZE:[[new a.Line(new e(1,"z",1),new t({color:7895160}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusBufferGeometry(1.25,.12,2,24),r)]],XYZE:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,2,24),r)]]},this.pickerGizmos.XYZE[0][0].visible=!1,this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){n.prototype.update.apply(this,arguments);var r=new a.Matrix4,i=new a.Euler(0,0,1),o=new a.Quaternion,s=new a.Vector3(1,0,0),l=new a.Vector3(0,1,0),u=new a.Vector3(0,0,1),c=new a.Quaternion,f=new a.Quaternion,d=new a.Quaternion,h=t.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),r.makeRotationFromQuaternion(o).getInverse(r),h.applyMatrix4(r),this.traverse((function(e){o.setFromEuler(i),"X"===e.name&&(c.setFromAxisAngle(s,Math.atan2(-h.y,h.z)),o.multiplyQuaternions(o,c),e.quaternion.copy(o)),"Y"===e.name&&(f.setFromAxisAngle(l,Math.atan2(h.x,h.z)),o.multiplyQuaternions(o,f),e.quaternion.copy(o)),"Z"===e.name&&(d.setFromAxisAngle(u,Math.atan2(h.y,h.x)),o.multiplyQuaternions(o,d),e.quaternion.copy(o))}))},this.init()};(o.prototype=Object.create(n.prototype)).constructor=o;var s=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.BoxGeometry(.125,.125,.125));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.125,.125,.125),new e({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.4,.4,.4),r)]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()};(s.prototype=Object.create(n.prototype)).constructor=s;var l=function(e,t){a.Object3D.call(this),t=void 0!==t?t:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var r=this,n="translate",l=!1,u={translate:new i,rotate:new o,scale:new s};for(var c in u){var f=u[c];f.visible=c===n,this.add(f)}var d={type:"change"},h={type:"mouseDown"},p={type:"mouseUp",mode:n},m={type:"objectChange"},v=new a.Raycaster,g=new a.Vector2,y=new a.Vector3,b=new a.Vector3,w=new a.Vector3,x=new a.Vector3,_=1,A=new a.Matrix4,E=new a.Vector3,S=new a.Matrix4,M=new a.Vector3,T=new a.Quaternion,P=new a.Vector3(1,0,0),F=new a.Vector3(0,1,0),O=new a.Vector3(0,0,1),L=new a.Quaternion,C=new a.Quaternion,k=new a.Quaternion,R=new a.Quaternion,I=new a.Quaternion,N=new a.Vector3,D=new a.Vector3,U=new a.Matrix4,j=new a.Matrix4,B=new a.Vector3,V=new a.Vector3,z=new a.Euler,G=new a.Matrix4,H=new a.Vector3,X=new a.Euler;function Y(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,u[n].pickers.children),a=null;t&&(a=t.object.name,e.preventDefault()),r.axis!==a&&(r.axis=a,r.update(),r.dispatchEvent(d))}}function W(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=e.changedTouches?e.changedTouches[0]:e;if(0===t.button||void 0===t.button){var a=Z(t,u[n].pickers.children);if(a){e.preventDefault(),e.stopPropagation(),r.axis=a.object.name,r.dispatchEvent(h),r.update(),E.copy(H).sub(V).normalize(),u[n].setActivePlane(r.axis,E);var i=Z(t,[u[n].activePlane]);i&&(N.copy(r.object.position),D.copy(r.object.scale),U.extractRotation(r.object.matrix),G.extractRotation(r.object.matrixWorld),j.extractRotation(r.object.parent.matrixWorld),B.setFromMatrixScale(S.getInverse(r.object.parent.matrixWorld)),b.copy(i.point))}}l=!0}}function q(e){if(void 0!==r.object&&null!==r.axis&&!1!==l&&(void 0===e.button||0===e.button)){var t=Z(e.changedTouches?e.changedTouches[0]:e,[u[n].activePlane]);!1!==t&&(e.preventDefault(),e.stopPropagation(),y.copy(t.point),"translate"===n?(y.sub(b),y.multiply(B),"local"===r.space&&(y.applyMatrix4(S.getInverse(G)),-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(U),r.object.position.copy(N),r.object.position.add(y)),"world"!==r.space&&-1===r.axis.search("XYZ")||(-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(S.getInverse(j)),r.object.position.copy(N),r.object.position.add(y)),null!==r.translationSnap&&("local"===r.space&&r.object.position.applyMatrix4(S.getInverse(G)),-1!==r.axis.search("X")&&(r.object.position.x=Math.round(r.object.position.x/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Y")&&(r.object.position.y=Math.round(r.object.position.y/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Z")&&(r.object.position.z=Math.round(r.object.position.z/r.translationSnap)*r.translationSnap),"local"===r.space&&r.object.position.applyMatrix4(G))):"scale"===n?(y.sub(b),y.multiply(B),"local"===r.space&&("XYZ"===r.axis?(_=1+y.y/Math.max(D.x,D.y,D.z),r.object.scale.x=D.x*_,r.object.scale.y=D.y*_,r.object.scale.z=D.z*_):(y.applyMatrix4(S.getInverse(G)),"X"===r.axis&&(r.object.scale.x=D.x*(1+y.x/D.x)),"Y"===r.axis&&(r.object.scale.y=D.y*(1+y.y/D.y)),"Z"===r.axis&&(r.object.scale.z=D.z*(1+y.z/D.z))))):"rotate"===n&&(y.sub(V),y.multiply(B),M.copy(b).sub(V),M.multiply(B),"E"===r.axis?(y.applyMatrix4(S.getInverse(A)),M.applyMatrix4(S.getInverse(A)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),I.setFromAxisAngle(E,w.z-x.z),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,I),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"XYZE"===r.axis?(I.setFromEuler(y.clone().cross(M).normalize()),T.setFromRotationMatrix(S.getInverse(j)),C.setFromAxisAngle(I,-y.clone().angleTo(M)),L.setFromRotationMatrix(G),T.multiplyQuaternions(T,C),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T)):"local"===r.space?(y.applyMatrix4(S.getInverse(G)),M.applyMatrix4(S.getInverse(G)),w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),L.setFromRotationMatrix(U),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),k.setFromAxisAngle(F,w.y-x.y),R.setFromAxisAngle(O,w.z-x.z)),"X"===r.axis&&L.multiplyQuaternions(L,C),"Y"===r.axis&&L.multiplyQuaternions(L,k),"Z"===r.axis&&L.multiplyQuaternions(L,R),r.object.quaternion.copy(L)):"world"===r.space&&(w.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),x.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(S.getInverse(j)),null!==r.rotationSnap?(C.setFromAxisAngle(P,Math.round((w.x-x.x)/r.rotationSnap)*r.rotationSnap),k.setFromAxisAngle(F,Math.round((w.y-x.y)/r.rotationSnap)*r.rotationSnap),R.setFromAxisAngle(O,Math.round((w.z-x.z)/r.rotationSnap)*r.rotationSnap)):(C.setFromAxisAngle(P,w.x-x.x),k.setFromAxisAngle(F,w.y-x.y),R.setFromAxisAngle(O,w.z-x.z)),L.setFromRotationMatrix(G),"X"===r.axis&&T.multiplyQuaternions(T,C),"Y"===r.axis&&T.multiplyQuaternions(T,k),"Z"===r.axis&&T.multiplyQuaternions(T,R),T.multiplyQuaternions(T,L),r.object.quaternion.copy(T))),r.update(),r.dispatchEvent(d),r.dispatchEvent(m))}}function Q(e){e.preventDefault(),void 0!==e.button&&0!==e.button||(l&&null!==r.axis&&(p.mode=n,r.dispatchEvent(p)),l=!1,"TouchEvent"in window&&e instanceof TouchEvent?(r.axis=null,r.update(),r.dispatchEvent(d)):Y(e))}function Z(r,a){var n=t.getBoundingClientRect(),i=(r.clientX-n.left)/n.width,o=(r.clientY-n.top)/n.height;g.set(2*i-1,-2*o+1),v.setFromCamera(g,e);var s=v.intersectObjects(a,!0);return!!s[0]&&s[0]}t.addEventListener("mousedown",W,!1),t.addEventListener("touchstart",W,!1),t.addEventListener("mousemove",Y,!1),t.addEventListener("touchmove",Y,!1),t.addEventListener("mousemove",q,!1),t.addEventListener("touchmove",q,!1),t.addEventListener("mouseup",Q,!1),t.addEventListener("mouseout",Q,!1),t.addEventListener("touchend",Q,!1),t.addEventListener("touchcancel",Q,!1),t.addEventListener("touchleave",Q,!1),this.dispose=function(){t.removeEventListener("mousedown",W),t.removeEventListener("touchstart",W),t.removeEventListener("mousemove",Y),t.removeEventListener("touchmove",Y),t.removeEventListener("mousemove",q),t.removeEventListener("touchmove",q),t.removeEventListener("mouseup",Q),t.removeEventListener("mouseout",Q),t.removeEventListener("touchend",Q),t.removeEventListener("touchcancel",Q),t.removeEventListener("touchleave",Q)},this.attach=function(e){this.object=e,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return n},this.setMode=function(e){for(var t in"scale"===(n=e||n)&&(r.space="local"),u)u[t].visible=t===n;this.update(),r.dispatchEvent(d)},this.setTranslationSnap=function(e){r.translationSnap=e},this.setRotationSnap=function(e){r.rotationSnap=e},this.setSize=function(e){r.size=e,this.update(),r.dispatchEvent(d)},this.setSpace=function(e){r.space=e,this.update(),r.dispatchEvent(d)},this.update=function(){void 0!==r.object&&(r.object.updateMatrixWorld(),V.setFromMatrixPosition(r.object.matrixWorld),z.setFromRotationMatrix(S.extractRotation(r.object.matrixWorld)),e.updateMatrixWorld(),H.setFromMatrixPosition(e.matrixWorld),X.setFromRotationMatrix(S.extractRotation(e.matrixWorld)),_=V.distanceTo(H)/6*r.size,this.position.copy(V),this.scale.set(_,_,_),e instanceof a.PerspectiveCamera?E.copy(H).sub(V).normalize():e instanceof a.OrthographicCamera&&E.copy(H).normalize(),"local"===r.space?u[n].update(z,E):"world"===r.space&&u[n].update(new a.Euler,E),u[n].highlight(r.axis))}};return(l.prototype=Object.create(a.Object3D.prototype)).constructor=l,l}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){var r,n,i=this,o=new a.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")})).catch((function(){console.warn("THREE.VRControls: Unable to get VR Displays")})),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return o},this.update=function(){var t;r&&(r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(i.scale))},this.dispose=function(){r=null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedGeometryExporter=t.STLExporter=t.STLBinaryExporter=t.PLYExporter=t.OBJExporter=t.MMDExporter=t.GLTFExporter=void 0;var a=c(r(41)),n=c(r(42)),i=c(r(43)),o=c(r(44)),s=c(r(45)),l=c(r(46)),u=c(r(47));function c(e){return e&&e.__esModule?e:{default:e}}t.GLTFExporter=a.default,t.MMDExporter=n.default,t.OBJExporter=i.default,t.PLYExporter=o.default,t.STLBinaryExporter=s.default,t.STLExporter=l.default,t.TypedGeometryExporter=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987},i={1003:n.NEAREST,1004:n.NEAREST_MIPMAP_NEAREST,1005:n.NEAREST_MIPMAP_LINEAR,1006:n.LINEAR,1007:n.LINEAR_MIPMAP_NEAREST,1008:n.LINEAR_MIPMAP_LINEAR},o={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},s=function(){};s.prototype={constructor:s,parse:function(e,t,r){(r=Object.assign({},{trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,animations:[],forceIndices:!1,forcePowerOfTwoTextures:!1},r)).animations.length>0&&(r.trs=!0);var s,l={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},u=0,c=[],f=[],d=new Map,h=[],p={},m={attributes:new Map,materials:new Map,textures:new Map};function v(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}function g(e){return 4*Math.ceil(e/4)}function y(e,t){t=t||0;var r=g(e.byteLength);if(r!==e.byteLength){var a=new Uint8Array(r);if(a.set(new Uint8Array(e)),0!==t)for(var n=e.byteLength;n0)&&(t.alphaMode=e.opacity<1?"BLEND":"MASK",e.alphaTest>0&&.5!==e.alphaTest&&(t.alphaCutoff=e.alphaTest)),e.side===a.DoubleSide&&(t.doubleSided=!0),""!==e.name&&(t.name=e.name),l.materials.push(t);var i=l.materials.length-1;return m.materials.set(e,i),i}function S(e){var t,i=e.geometry;if(e.isLineSegments)t=n.LINES;else if(e.isLineLoop)t=n.LINE_LOOP;else if(e.isLine)t=n.LINE_STRIP;else if(e.isPoints)t=n.POINTS;else{if(!i.isBufferGeometry){var o=new a.BufferGeometry;o.fromGeometry(i),i=o}e.drawMode===a.TriangleFanDrawMode?(console.warn("GLTFExporter: TriangleFanDrawMode and wireframe incompatible."),t=n.TRIANGLE_FAN):t=e.drawMode===a.TriangleStripDrawMode?e.material.wireframe?n.LINE_STRIP:n.TRIANGLE_STRIP:e.material.wireframe?n.LINES:n.TRIANGLES}var s={},u={},c=[],f=[],d={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},h=i.getAttribute("normal");for(var p in void 0===h||function(e){if(m.attributes.has(e))return!1;for(var t=new a.Vector3,r=0,n=e.count;r5e-4)return!1;return!0}(h)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.addAttribute("normal",function(e){if(m.attributes.has(e))return m.textures.get(e);for(var t=e.clone(),r=new a.Vector3,n=0,i=t.count;n0){var b=[],x=[],_={};if(void 0!==e.morphTargetDictionary)for(var A in e.morphTargetDictionary)_[e.morphTargetDictionary[A]]=A;for(var S=0;S0&&(s.extras={},s.extras.targetNames=x)}var C=r.forceIndices,k=Array.isArray(e.material);if(k&&0===e.geometry.groups.length)return null;!C&&null===i.index&&k&&(console.warn("THREE.GLTFExporter: Creating index for non-indexed multi-material mesh."),C=!0);var R=!1;if(null===i.index&&C){for(var I=[],N=(S=0,i.attributes.position.count);S0&&(j.targets=f),null!==i.index&&(j.indices=w(i.index,i,U[S].start,U[S].count));var B=E(D[U[S].materialIndex]);null!==B&&(j.material=B),c.push(j)}return R&&i.setIndex(null),s.primitives=c,l.meshes||(l.meshes=[]),l.meshes.push(s),l.meshes.length-1}function M(e,t){l.animations||(l.animations=[]);for(var r=[],n=[],i=0;i0)try{t.extras=JSON.parse(JSON.stringify(e.userData))}catch(e){throw new Error("THREE.GLTFExporter: userData can't be serialized")}if(e.isMesh||e.isLine||e.isPoints){var s=S(e);null!==s&&(t.mesh=s)}else e.isCamera&&(t.camera=function(e){l.cameras||(l.cameras=[]);var t=e.isOrthographicCamera,r={type:t?"orthographic":"perspective"};return t?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:a.Math.degToRad(e.fov)/e.aspect,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),l.cameras.push(r),l.cameras.length-1}(e));if(e.isSkinnedMesh&&h.push(e),e.children.length>0){for(var u=[],c=0,f=e.children.length;c0&&(t.children=u)}l.nodes.push(t);var g=l.nodes.length-1;return d.set(e,g),g}function F(e){l.scenes||(l.scenes=[],l.scene=0);var t={nodes:[]};""!==e.name&&(t.name=e.name),l.scenes.push(t);for(var a=[],n=0,i=e.children.length;n0&&(t.nodes=a)}!function(e){e=e instanceof Array?e:[e];for(var t=[],n=0;n0&&function(e){var t=new a.Scene;t.name="AuxScene";for(var r=0;r0&&(l.extensionsUsed=a),l.buffers&&l.buffers.length>0){l.buffers[0].byteLength=e.size;var n=new window.FileReader;if(!0===r.binary){n.readAsArrayBuffer(e),n.onloadend=function(){var e=y(n.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,e.byteLength,!0),r.setUint32(4,5130562,!0);var a=y(function(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0,a=e.length;r255?32:n}return t.buffer}(JSON.stringify(l)),32),i=new DataView(new ArrayBuffer(8));i.setUint32(0,a.byteLength,!0),i.setUint32(4,1313821514,!0);var o=new ArrayBuffer(12),s=new DataView(o);s.setUint32(0,1179937895,!0),s.setUint32(4,2,!0);var u=12+i.byteLength+a.byteLength+r.byteLength+e.byteLength;s.setUint32(8,u,!0);var c=new Blob([o,i,a,r,e],{type:"application/octet-stream"}),f=new window.FileReader;f.readAsArrayBuffer(c),f.onloadend=function(){t(f.result)}}}else n.readAsDataURL(e),n.onloadend=function(){var e=n.result;l.buffers[0].uri=e,t(l)}}else t(l)}))}},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(0)),n=i(r(4));function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.default=function(){var e;this.parseVpd=function(t,r,i){if(!0!==t.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);var t=e.toString();-1===t.indexOf(".")&&(t+=".");var r=(t+="000000").indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function s(e){for(var t=[],r=0,a=e.length;r255?(u.push(l>>8&255),u.push(255&l)):u.push(255&l)}return new Uint8Array(u)}(x):x}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(){};n.prototype={constructor:n,parse:function(e){var t,r,n,i,o,s="",l=0,u=0,c=0,f=new a.Vector3,d=new a.Vector3,h=new a.Vector2,p=[];return e.traverse((function(e){e instanceof a.Mesh&&function(e){var n=0,m=0,v=0,g=e.geometry,y=new a.Matrix3;if(g instanceof a.Geometry&&(g=(new a.BufferGeometry).setFromObject(e)),g instanceof a.BufferGeometry){var b=g.getAttribute("position"),w=g.getAttribute("normal"),x=g.getAttribute("uv"),_=g.getIndex();if(s+="o "+e.name+"\n",e.material&&e.material.name&&(s+="usemtl "+e.material.name+"\n"),void 0!==b)for(t=0,i=b.count;t=200)return void n("THREE.AssimpJSONLoader: Unsupported assimp2json file format version.")}t(i.parse(r,o))}),r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=new Array(e.length),a=0;a0&&i.addAttribute("normal",new a.Float32BufferAttribute(l,3)),u.length>0&&i.addAttribute("uv",new a.Float32BufferAttribute(u,2)),c.length>0&&i.addAttribute("color",new a.Float32BufferAttribute(c,3)),i.computeBoundingSphere(),i})),o=r(e.materials,(function(e){var t=new a.MeshPhongMaterial;for(var r in e.properties){var i=e.properties[r],o=i.key,s=i.value;switch(o){case"$tex.file":var l=i.semantic;if(1===l||2===l||5===l||6===l){var u;switch(l){case 1:u="map";break;case 2:u="specularMap";break;case 5:u="bumpMap";break;case 6:u="normalMap"}var c=n.load(s);c.wrapS=c.wrapT=a.RepeatWrapping,t[u]=c}break;case"?mat.name":t.name=s;break;case"$clr.diffuse":t.color.fromArray(s);break;case"$clr.specular":t.specular.fromArray(s);break;case"$clr.emissive":t.emissive.fromArray(s);break;case"$mat.shininess":t.shininess=s;break;case"$mat.shadingm":t.flatShading=1===s;break;case"$mat.opacity":s<1&&(t.opacity=s,t.transparent=!0)}}return t}));return function e(t,r,n,i){var o,s,l=new a.Object3D;for(l.name=r.name||"",l.matrix=(new a.Matrix4).fromArray(r.transformation).transpose(),l.matrix.decompose(l.position,l.quaternion,l.scale),o=0;r.meshes&&o0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(var e=0;e=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;for(var r=e.hierarchy[0].keys,a=0;ae){t=this.keys[a],r=this.keys[a+1];break}if(this.keys[a].time4&&(r.length=4);var n=0;for(a=0;a<4;a++)n+=r[a].w*r[a].w;n=Math.sqrt(n);for(a=0;a<4;a++)r[a].w=r[a].w/n,e[a]=r[a].i,t[a]=r[a].w}function R(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(var r in e.children){var a=R(e.children[r],t);if(a)return a}}function I(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e,t){if(0!=this.mBones.length){for(var r=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var o=C(u=i.toTHREE(e),e);this.threeNode.add(o);for(var s=0;s0&&n.addAttribute("normal",new a.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&n.addAttribute("color",new a.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&n.addAttribute("uv",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&n.addAttribute("uv1",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&n.addAttribute("tangents",new a.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&n.addAttribute("bitangents",new a.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){for(var i=[],o=[],s=0;s0&&(r=new a.SkinnedMesh(n,t)),this.threeNode=r,r}}function N(){this.mNumIndices=0,this.mIndices=[]}function D(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new a.Vector3(this.x,this.y,this.z)}}function U(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new a.Color(this.r,this.g,this.b,1)}}function j(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new a.Quaternion(this.x,this.y,this.z,this.w)}}function B(){this.mVertexId=0,this.mWeight=0}function V(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}function z(){this.mTime=0,this.mValue=null}function G(){this.mTime=0,this.mValue=null}function H(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new a.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(var r=0;r0)var r=this.mAnimations[0].toTHREE(this);return{object:e,animation:r}}}function ie(){this.elements=[[],[],[],[]],this.toTHREE=function(){for(var e=new a.Matrix4,t=0;t<4;++t)for(var r=0;r<4;++r)e.elements[4*t+r]=this.elements[r][t];return e}}var oe=!0;function se(e){var t=e.getFloat32(e.readOffset,oe);return e.readOffset+=4,t}function le(e){var t=e.getFloat64(e.readOffset,oe);return e.readOffset+=8,t}function ue(e){var t=e.getUint16(e.readOffset,oe);return e.readOffset+=2,t}function ce(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function fe(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function de(e){var t=new D;return t.x=se(e),t.y=se(e),t.z=se(e),t}function he(e){var t=new U;return t.r=se(e),t.g=se(e),t.b=se(e),t}function pe(e){var t=new V,r=ce(e);return e.ReadBytes(t.data,1,r),t.toString()}function me(e){var t=new B;return t.mVertexId=ce(e),t.mWeight=se(e),t}function ve(e){for(var t=new ie,r=0;r<4;++r)for(var a=0;a<4;++a)t.elements[r][a]=se(e);return t}function ge(e){var t=new z;return t.mTime=le(e),t.mValue=de(e),t}function ye(e){var t=new G;return t.mTime=le(e),t.mValue=function(e){var t=new j;return t.w=se(e),t.x=se(e),t.y=se(e),t.z=se(e),t}(e),t}function be(e,t,r){for(var a=0;a0,ke=ue(r)>0,Ce)throw"Shortened binaries are not supported!";if(r.Seek(256,Re),r.Seek(128,Re),r.Seek(64,Re),!ke)return Le(r,t),t.toTHREE();var a=fe(r),n=r.FileSize()-r.Tell(),i=[];r.Read(i,1,n);var o=[];uncompress(o,a,i,n),Le(new ArrayBuffer(o),t)}(e)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){function e(){this.id=0,this.data=null}function t(){}t.prototype={set:function(e,t){this[e]=t},get:function(e,t){return this.hasOwnProperty(e)?this[e]:t}};var r=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.trunk=new a.Object3D,this.materialFactory=void 0,this._url="",this._baseDir="",this._data=void 0,this._ptr=0,this._version=[],this._streaming=!1,this._optimized_for_accuracy=!1,this._compression=0,this._bodylen=4294967295,this._blocks=[new e],this._accuracyMatrix=!1,this._accuracyGeo=!1,this._accuracyProps=!1};return r.prototype={constructor:r,load:function(e,t,r,n){var i=this;this._url=e,this._baseDir=e.substr(0,e.lastIndexOf("/")+1);var o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){var t=e.byteLength;for(this._ptr=0,this._data=new DataView(e),this._parseHeader(),0!=this._compression&&console.error("compressed AWD not supported"),this._streaming||this._bodylen==e.byteLength-this._ptr||console.error("AWDLoader: body len does not match file length",this._bodylen,t-this._ptr);this._ptr1)for(r=new a.Object3D,p=0;p191&&a<224){var n=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((31&a)<<6|63&n)}else{n=this._data.getUint8(this._ptr++,!0);var i=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((15&a)<<12|(63&n)<<6|63&i)}}return t.join("")}},r}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),r,n)},parse:function(e){function t(e){var t=new a.BufferGeometry,r=e.indices,n=e.positions,i=e.normals,o=e.uvs;t.setIndex(r);for(var s=2,l=n.length;s0&&t.push(new a.VectorKeyframeTrack(n+".position",i,o)),s.length>0&&t.push(new a.QuaternionKeyframeTrack(n+".quaternion",i,s)),l.length>0&&t.push(new a.VectorKeyframeTrack(n+".scale",i,l)),t}function A(e,t,r){var a,n,i,o=!0;for(n=0,i=e.length;n=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function S(e,t,r){for(;t0&&t0&&h.addAttribute("position",new a.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&h.addAttribute("normal",new a.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&h.addAttribute("color",new a.Float32BufferAttribute(l.array,l.stride)),s.array.length>0&&h.addAttribute("uv",new a.Float32BufferAttribute(s.array,s.stride)),u.length>0&&h.addAttribute("skinIndex",new a.Float32BufferAttribute(u,c)),f.length>0&&h.addAttribute("skinWeight",new a.Float32BufferAttribute(f,d)),n.data=h,n.type=e[0].type,n.materialKeys=p,n}function fe(e,t,r,a){var n=e.p,i=e.stride,o=e.vcount;function s(e){for(var t=n[e+r]*u,i=t+u;t4)for(var g=1,y=h-2;g<=y;g++){p=c+i*g,m=c+i*(g+1);s(c+0*i),s(p),s(m)}c+=i*h}else for(f=0,d=n.length;f=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ge(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;rn.limits.max||t>8&255,d>>16&255,d>>24&255))),r;p=!0,o=64,r.format=a.RGBAFormat}r.mipmapCount=1,131072&f[2]&&!1!==t&&(r.mipmapCount=Math.max(1,f[7]));var m=f[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=f[4],r.height=f[3];for(var v=f[1]+4,g=r.isCubemap?6:1,y=0;y>1,1),w=Math.max(w>>1,1)}return r},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="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},n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var i=function(e){this.timeLoaded=0,this.manager=e||n.DefaultLoadingManager,this.materials=null,this.verbosity=0,this.attributeOptions={},this.drawMode=n.TrianglesDrawMode,this.nativeAttributeMap={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"}};i.prototype={constructor:i,load:function(e,t,r,a){var i=this,o=new n.FileLoader(i.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.load(e,(function(e){i.decodeDracoFile(e,t)}),r,a)},setPath:function(e){this.path=e},setCrossOrigin:function(e){this.crossOrigin=e},setVerbosity:function(e){this.verbosity=e},setDrawMode:function(e){this.drawMode=e},setSkipDequantization:function(e,t){var r=!0;void 0!==t&&(r=t),this.getAttributeOptions(e).skipDequantization=r},decodeDracoFile:function(e,t,r){var a=this;i.getDecoderModule().then((function(n){a.decodeDracoFileInternal(e,n.decoder,t,r||{})}))},decodeDracoFileInternal:function(e,t,r,a){var n=new t.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength);var i=new t.Decoder,o=i.GetEncodedGeometryType(n);if(o==t.TRIANGULAR_MESH)this.verbosity>0&&console.log("Loaded a mesh.");else{if(o!=t.POINT_CLOUD){var s="THREE.DRACOLoader: Unknown geometry type.";throw console.error(s),new Error(s)}this.verbosity>0&&console.log("Loaded a point cloud.")}r(this.convertDracoGeometryTo3JS(t,i,o,n,a))},addAttributeToGeometry:function(e,t,r,a,i,o,s){if(0===i.ptr){var l="THREE.DRACOLoader: No attribute "+a;throw console.error(l),new Error(l)}var u=i.num_components(),c=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,c);var f=r.num_points()*u;s[a]=new Float32Array(f);for(var d=0;d0&&console.log("Number of faces loaded: "+c.toString())):c=0;var d=o.num_points(),h=o.num_attributes();this.verbosity>0&&(console.log("Number of points loaded: "+d.toString()),console.log("Number of attributes loaded: "+h.toString()));var p=t.GetAttributeId(o,e.POSITION);if(-1==p){u="THREE.DRACOLoader: No position attribute found.";throw console.error(u),e.destroy(t),e.destroy(o),new Error(u)}var m=t.GetAttribute(o,p),v={},g=new n.BufferGeometry;for(var y in this.nativeAttributeMap)if(void 0===i[y]){var b=t.GetAttributeId(o,e[this.nativeAttributeMap[y]]);if(-1!==b){this.verbosity>0&&console.log("Loaded "+y+" attribute.");var w=t.GetAttribute(o,b);this.addAttributeToGeometry(e,t,o,y,w,g,v)}}for(var y in i){var x=i[y];w=t.GetAttributeByUniqueId(o,x);this.addAttributeToGeometry(e,t,o,y,w,g,v)}if(r==e.TRIANGULAR_MESH)if(this.drawMode===n.TriangleStripDrawMode){var _=new e.DracoInt32Array;t.GetTriangleStripsFromMesh(o,_);v.indices=new Uint32Array(_.size());for(var A=0;A<_.size();++A)v.indices[A]=_.GetValue(A);e.destroy(_)}else{var E=3*c;v.indices=new Uint32Array(E);var S=new e.DracoInt32Array;for(A=0;A65535?n.Uint32BufferAttribute:n.Uint16BufferAttribute)(v.indices,1));var T=new e.AttributeQuantizationTransform;if(T.InitFromAttribute(m)){g.attributes.position.isQuantized=!0,g.attributes.position.maxRange=T.range(),g.attributes.position.numQuantizationBits=T.quantization_bits(),g.attributes.position.minValues=new Float32Array(3);for(A=0;A<3;++A)g.attributes.position.minValues[A]=T.min_value(A)}return e.destroy(T),e.destroy(t),e.destroy(o),this.decode_time=f-l,this.import_time=performance.now()-f,this.verbosity>0&&(console.log("Decode time: "+this.decode_time),console.log("Import time: "+this.import_time)),g},isVersionSupported:function(e,t){i.getDecoderModule().then((function(r){t(r.decoder.isVersionSupported(e))}))},getAttributeOptions:function(e){return void 0===this.attributeOptions[e]&&(this.attributeOptions[e]={}),this.attributeOptions[e]}},i.decoderPath="./",i.decoderConfig={},i.decoderModulePromise=null,i.setDecoderPath=function(e){i.decoderPath=e},i.setDecoderConfig=function(e){var t=i.decoderConfig.wasmBinary;i.decoderConfig=e||{},i.releaseDecoderModule(),t&&(i.decoderConfig.wasmBinary=t)},i.releaseDecoderModule=function(){i.decoderModulePromise=null},i.getDecoderModule=function(){var e=this,t=i.decoderPath,r=i.decoderConfig,n=i.decoderModulePromise;return n||("undefined"!=typeof DracoDecoderModule?n=Promise.resolve():"object"!==("undefined"==typeof WebAssembly?"undefined":a(WebAssembly))||"js"===r.type?n=i._loadScript(t+"draco_decoder.js"):(r.wasmBinaryFile=t+"draco_decoder.wasm",n=i._loadScript(t+"draco_wasm_wrapper.js").then((function(){return i._loadArrayBuffer(r.wasmBinaryFile)})).then((function(e){r.wasmBinary=e}))),n=n.then((function(){return new Promise((function(t){r.onModuleLoaded=function(r){e.timeLoaded=performance.now(),t({decoder:r})},DracoDecoderModule(r)}))})),i.decoderModulePromise=n,n)},i._loadScript=function(e){var t=document.getElementById("decoder_script");null!==t&&t.parentNode.removeChild(t);var r=document.getElementsByTagName("head")[0],a=document.createElement("script");return a.id="decoder_script",a.type="text/javascript",a.src=e,new Promise((function(e){a.onload=e,r.appendChild(a)}))},i._loadArrayBuffer=function(e){var t=new n.FileLoader;return t.setResponseType("arraybuffer"),new Promise((function(r,a){t.load(e,r,void 0,a)}))},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.sourceTexture=e,this.resolution=t,this.views=[{t:[1,0,0],u:[0,-1,0]},{t:[-1,0,0],u:[0,-1,0]},{t:[0,1,0],u:[0,0,1]},{t:[0,-1,0],u:[0,0,-1]},{t:[0,0,1],u:[0,-1,0]},{t:[0,0,-1],u:[0,-1,0]}],this.camera=new a.PerspectiveCamera(90,1,.1,10),this.boxMesh=new a.Mesh(new a.BoxBufferGeometry(1,1,1),this.getShader()),this.boxMesh.material.side=a.BackSide,this.scene=new a.Scene,this.scene.add(this.boxMesh);var r={format:a.RGBAFormat,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.renderTarget=new a.WebGLRenderTargetCube(this.resolution,this.resolution,r)};n.prototype={constructor:n,update:function(e){for(var t=0;t<6;t++){this.renderTarget.activeCubeFace=t;var r=this.views[t];this.camera.position.set(0,0,0),this.camera.up.set(r.u[0],r.u[1],r.u[2]),this.camera.lookAt(r.t[0],r.t[1],r.t[2]),e.render(this.scene,this.camera,this.renderTarget,!0)}return this.renderTarget.texture},getShader:function(){var e=new a.ShaderMaterial({uniforms:{equirectangularMap:{value:this.sourceTexture}},vertexShader:"varying vec3 localPosition;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tlocalPosition = position;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \n\t\t\t\tvarying vec3 localPosition;\n\t\t\t\tuniform sampler2D equirectangularMap;\n\t\t\t\t\n\t\t\t\tvec2 EquiangularSampleUV(vec3 v) {\n\t\t\t vec2 uv = vec2(atan(v.z, v.x), asin(v.y));\n\t\t\t uv *= vec2(0.1591, 0.3183); // inverse atan\n\t\t\t uv += 0.5;\n\t\t\t return uv;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = EquiangularSampleUV(normalize(localPosition));\n \t\t\tvec3 color = texture2D(equirectangularMap, uv).rgb;\n \t\t\t\n\t\t\t\t\tgl_FragColor = vec4( color, 1.0 );\n\t\t\t\t}",blending:a.CustomBlending,premultipliedAlpha:!1,blendSrc:a.OneFactor,blendDst:a.ZeroFactor,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.ZeroFactor,blendEquation:a.AddEquation});return e.type="EquiangularToCubeGenerator",e},dispose:function(){this.boxMesh.geometry.dispose(),this.boxMesh.material.dispose(),this.renderTarget.dispose()}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};(n.prototype=Object.create(a.DataTextureLoader.prototype))._parser=function(e){var t=65536,r=t>>3,n=14,i=65537,o=1<>r&(1<a)return!1;g(6,d,h,e,f);var p=v.l;if(d=v.c,h=v.lc,s[n]=p,p==u){if(f.value-r.value>a)throw"Something wrong with hufUnpackEncTable";g(8,d,h,e,f);var m=v.l+c;if(d=v.c,h=v.lc,n+m>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}else if(p>=l){if(n+(m=p-l+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}}!function(e){for(var t=0;t<=58;++t)y[t]=0;for(t=0;t0;--t){var a=r+y[t]>>1;y[t]=r,r=a}for(t=0;t0&&(e[t]=n|y[n]++<<6)}}(s)}function w(e){return 63&e}function x(e){return e>>6}var _={c:0,lc:0};function A(e,t,r,a){e=e<<8|I(r,a),t+=8,_.c=e,_.lc=t}var E={c:0,lc:0};function S(e,t,r,a,n,i,o,s,l,u){if(e==t){a<8&&(A(r,a,n,o),r=_.c,a=_.lc);var c=r>>(a-=8);if(out+c>oe)throw"Issue with getCode";for(var f=out[-1];c-- >0;)s[l.value++]=f}else{if(!(l.value32767?t-65536:t}var T={a:0,b:0};function P(e,t){var r=M(e),a=M(t),n=r+(1&a)+(a>>1),i=n,o=n-a;T.a=i,T.b=o}function F(e,t,r,a,n,i,o){for(var s,l=r>n?n:r,u=1;u<=l;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var c,f,d,h,p=0,m=p+i*(n-s),v=i*u,g=i*s,y=a*u,b=a*s;p<=m;p+=g){for(var w=p,x=p+a*(r-s);w<=x;w+=b){var _=w+y,A=(E=w+v)+y;P(t[w+e],t[E+e]),c=T.a,d=T.b,P(t[_+e],t[A+e]),f=T.a,h=T.b,P(c,f),t[w+e]=T.a,t[_+e]=T.b,P(d,h),t[E+e]=T.a,t[A+e]=T.b}if(r&u){var E=w+v;P(t[w+e],t[E+e]),c=T.a,t[E+e]=T.b,t[w+e]=c}}if(n&u)for(w=p,x=p+a*(r-s);w<=x;w+=b){_=w+y;P(t[w+e],t[_+e]),c=T.a,t[_+e]=T.b,t[w+e]=c}s=u,u>>=1}return p}function O(e,t,r,a,l,u,c){var f=r.value,d=R(t,r),h=R(t,r);r.value+=4;var p=R(t,r);if(r.value+=4,d<0||d>=i||h<0||h>=i)throw"Something wrong with HUF_ENCSIZE";var m=new Array(i),v=new Array(o);if(function(e){for(var t=0;t8*(a-(r.value-f)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var i=x(e[t]),o=w(e[t]);if(i>>o)throw"Invalid table entry";if(o>n){if((c=a[i>>o-n]).len)throw"Invalid table entry";if(c.lit++,c.p){var s=c.p;c.p=new Array(c.lit);for(var l=0;l0;l--){var c;if((c=a[(i<=n;){if((b=t[d>>h-n&s]).len)h-=b.len,S(b.lit,l,d,h,r,0,i,c,f,p),d=E.c,h=E.lc;else{if(!b.p)throw"hufDecode issues";var v;for(v=0;v=g&&x(e[b.p[v]])==(d>>h-g&(1<>=y,h-=y;h>0;){var b;if(!(b=t[d<=r)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(h<=p)for(var m=0;m>3]&1<<(7&n))&&(r[a++]=n);for(var i=a-1;a>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function j(e,t){var r=e.getUint16(t.value,!0);return t.value+=p,r}function B(e,t){return U(j(e,t))}function V(e,t,r,a,n){if("string"===a||"iccProfile"===a)return function(e,t,r){var a=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,a}(t,r,n);if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value0&&void 0!==r[l[0].ID]&&(0!==(i=r[l[0].ID]).indexOf("blob:")&&0!==i.indexOf("data:")||t.setPath(void 0));o="tga"===e.FileName.slice(-3).toLowerCase()?n.Loader.Handlers.get(".tga").load(i):t.load(i);return t.setPath(s),o}(e,t,r,a);i.ID=e.id,i.name=e.attrName;var o=e.WrapModeU,s=e.WrapModeV,l=void 0!==o?o.value:0,u=void 0!==s?s.value:0;if(i.wrapS=0===l?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===u?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){var c=e.Scaling.value;i.repeat.x=c[0],i.repeat.y=c[1]}return i}function i(e,t,r,i){var s=t.id,l=t.attrName,u=t.ShadingModel;if("object"===(void 0===u?"undefined":a(u))&&(u=u.value),!i.has(s))return null;var c,f=function(e,t,r,a,i){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value);t.Diffuse?s.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new n.Color).fromArray(t.DiffuseColor.value));t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value);t.Emissive?s.emissive=(new n.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new n.Color).fromArray(t.EmissiveColor.value));t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value));t.Opacity&&(s.opacity=parseFloat(t.Opacity.value));s.opacity<1&&(s.transparent=!0);t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value);t.Shininess&&(s.shininess=t.Shininess.value);t.Specular?s.specular=(new n.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new n.Color).fromArray(t.SpecularColor.value));return i.get(a).children.forEach((function(t){var a=t.relationship;switch(a){case"Bump":s.bumpMap=r.get(t.ID);break;case"DiffuseColor":s.map=o(e,r,t.ID,i);break;case"DisplacementColor":s.displacementMap=o(e,r,t.ID,i);break;case"EmissiveColor":s.emissiveMap=o(e,r,t.ID,i);break;case"NormalMap":s.normalMap=o(e,r,t.ID,i);break;case"ReflectionColor":s.envMap=o(e,r,t.ID,i),s.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":s.specularMap=o(e,r,t.ID,i);break;case"TransparentColor":s.alphaMap=o(e,r,t.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a)}})),s}(e,t,r,s,i);switch(u.toLowerCase()){case"phong":c=new n.MeshPhongMaterial;break;case"lambert":c=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',u),c=new n.MeshPhongMaterial({color:3342591})}return c.setValues(f),c.name=l,c}function o(e,t,r,a){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=a.get(r).children[0].ID),t.get(r)}function s(e,t){var r=[];return e.children.forEach((function(e){var a=t[e.ID];if("Cluster"===a.attrType){var i={ID:e.ID,indices:[],weights:[],transform:(new n.Matrix4).fromArray(a.Transform.a),transformLink:(new n.Matrix4).fromArray(a.TransformLink.a),linkMode:a.Mode};"Indexes"in a&&(i.indices=a.Indexes.a,i.weights=a.Weights.a),r.push(i)}})),{rawBones:r,bones:[]}}function l(e,t,r,a){for(var n=[],i=0;i0&&o.addAttribute("color",new n.Float32BufferAttribute(l.colors,3));r&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(l.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(l.vertexWeights,4)),o.FBX_Deformer=r);if(l.normal.length>0){var d=new n.Float32BufferAttribute(l.normal,3);(new n.Matrix3).getNormalMatrix(i).applyToBufferAttribute(d),o.addAttribute("normal",d)}if(l.uvs.forEach((function(e,t){var r="uv"+(t+1).toString();0===t&&(r="uv"),o.addAttribute(r,new n.Float32BufferAttribute(l.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){var h=l.materialIndex[0],p=0;if(l.materialIndex.forEach((function(e,t){e!==h&&(o.addGroup(p,t-p,h),h=e,p=t)})),o.groups.length>0){var m=o.groups[o.groups.length-1],v=m.start+m.count;v!==l.materialIndex.length&&o.addGroup(v,l.materialIndex.length-v,h)}0===o.groups.length&&o.addGroup(0,l.materialIndex.length,l.materialIndex[0])}return function(e,t,r,a,i){if(null===a)return;t.morphAttributes.position=[],t.morphAttributes.normal=[],a.rawTargets.forEach((function(a){var o=e.Objects.Geometry[a.geoID];void 0!==o&&function(e,t,r,a){var i=new n.BufferGeometry;r.attrName&&(i.name=r.attrName);for(var o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],s=void 0!==t.Vertices?t.Vertices.a.slice():[],l=void 0!==r.Vertices?r.Vertices.a:[],u=void 0!==r.Indexes?r.Indexes.a:[],f=0;f4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);var y=[0,0,0,0],b=[0,0,0,0];v.forEach((function(e,t){var r=e,a=m[t];b.forEach((function(e,t,n){if(r>e){n[t]=r,r=e;var i=y[t];y[t]=a,a=i}}))})),m=y,v=b}for(;v.length<4;)v.push(0),m.push(0);for(var w=0;w<4;++w)u.push(v[w]),c.push(m[w])}if(e.normal){g=h(d,r,f,e.normal);o.push(g[0],g[1],g[2])}if(e.material&&"AllSame"!==e.material.mappingType)var x=h(d,r,f,e.material)[0];e.uv&&e.uv.forEach((function(e,t){var a=h(d,r,f,e);void 0===l[t]&&(l[t]=[]),l[t].push(a[0]),l[t].push(a[1])})),a++,p&&(!function(e,t,r,a,n,i,o,s,l,u){for(var c=2;c=f.length&&f===C(c,0,f.length))o=(new M).parse(e);else{var d=C(e);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;for(var a=0;a0,u="string"==typeof o.Content&&""!==o.Content;if(l||u){var c=t(n[i]);a[o.RelativeFilename||o.Filename]=c}}}}for(var s in r){var f=r[s];void 0!==a[f]?r[s]=a[f]:r[s]=r[s].split("\\").pop()}return r}(o),_=function(e,t,r){var a=new Map;if("Material"in e.Objects){var n=e.Objects.Material;for(var o in n){var s=i(e,n[o],t,r);null!==s&&a.set(parseInt(o),s)}}return a}(o,function(e,t,a,n){var i=new Map;if("Texture"in e.Objects){var o=e.Objects.Texture;for(var s in o){var l=r(o[s],t,a,n);i.set(parseInt(s),l)}}return i}(o,new n.TextureLoader(this.manager).setPath(a),x,h),h),A=function(e,t){var r={},a={};if("Deformer"in e.Objects){var n=e.Objects.Deformer;for(var i in n){var o=n[i],u=t.get(parseInt(i));if("Skin"===o.attrType){var c=s(u,n);c.ID=i,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),c.geometryID=u.parents[0].ID,r[i]=c}else if("BlendShape"===o.attrType){var f={id:i};f.rawTargets=l(u,o,n,t),f.id=i,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),f.parentGeoID=u.parents[0].ID,a[i]=f}}}return{skeletons:r,morphTargets:a}}(o,h),E=function(e,t,r){var a=new Map;if("Geometry"in e.Objects){var n=e.Objects.Geometry;for(var i in n){var o=t.get(parseInt(i)),s=u(e,o,n[i],r);a.set(parseInt(i),s)}}return a}(o,h,A);return function(e,t,r,a,i){var o=new n.Group,s=function(e,t,r,a,i){var o=new Map,s=e.Objects.Model;for(var l in s){var u=parseInt(l),c=s[l],f=i.get(u),d=p(f,t,u,c.attrName);if(!d){switch(c.attrType){case"Camera":d=m(e,f);break;case"Light":d=v(e,f);break;case"Mesh":d=g(e,f,r,a);break;case"NurbsCurve":d=y(f,r);break;case"LimbNode":case"Null":default:d=new n.Group}d.name=n.PropertyBinding.sanitizeNodeName(c.attrName),d.ID=u}b(e,d,c),o.set(u,d)}return o}(e,r,a,i,t),l=e.Objects.Model;return s.forEach((function(r){var a=l[r.ID];!function(e,t,r,a,i){if("LookAtProperty"in r){a.get(t.ID).children.forEach((function(r){if("LookAtProperty"===r.relationship){var a=e.Objects.Model[r.ID];if("Lcl_Translation"in a){var o=a.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(o),i.add(t.target)):t.lookAt((new n.Vector3).fromArray(o))}}}))}}(e,r,a,t,o),t.get(r.ID).parents.forEach((function(e){var t=s.get(e.ID);void 0!==t&&t.add(r)})),null===r.parent&&o.add(r)})),function(e,t,r,a,i){var o=function(e){var t={};if("Pose"in e.Objects){var r=e.Objects.Pose;for(var a in r)if("BindPose"===r[a].attrType){var i=r[a].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new n.Matrix4).fromArray(e.Matrix.a)})):t[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return t}(e);for(var s in t){var l=t[s];i.get(parseInt(l.ID)).parents.forEach((function(e){if(r.has(e.ID)){var t=e.ID;i.get(t).parents.forEach((function(e){a.has(e.ID)&&a.get(e.ID).bind(new n.Skeleton(l.bones),o[e.ID])}))}}))}}(e,r,a,s,t),function(e,t,r){r.animations=[];var a=function(e,t){if(void 0===e.Objects.AnimationCurve)return;var r=function(e){var t=e.Objects.AnimationCurveNode,r=new Map;for(var a in t){var n=t[a];if(null!==n.attrName.match(/S|R|T/)){var i={id:n.id,attr:n.attrName,curves:{}};r.set(i.id,i)}}return r}(e);!function(e,t,r){var a=e.Objects.AnimationCurve;for(var n in a){var i={id:a[n].id,times:a[n].KeyTime.a.map(O),values:a[n].KeyValueFloat.a},o=t.get(i.id);if(void 0!==o){var s=o.parents[0].ID,l=o.parents[0].relationship;l.match(/X/)?r.get(s).curves.x=i:l.match(/Y/)?r.get(s).curves.y=i:l.match(/Z/)&&(r.get(s).curves.z=i)}}}(e,t,r);var a=function(e,t,r){var a=e.Objects.AnimationLayer,i=new Map;for(var o in a){var s=[],l=t.get(parseInt(o));if(void 0!==l)l.children.forEach((function(a,i){if(r.has(a.ID)){var o=r.get(a.ID);if(void 0!==o.curves.x||void 0!==o.curves.y||void 0!==o.curves.z){if(void 0===s[i]){var l;t.get(a.ID).parents.forEach((function(e){void 0!==e.relationship&&(l=e.ID)}));var u=e.Objects.Model[l.toString()],c={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};"Lcl_Translation"in u&&(c.initialPosition=u.Lcl_Translation.value),"Lcl_Rotation"in u&&(c.initialRotation=u.Lcl_Rotation.value),"Lcl_Scaling"in u&&(c.initialScale=u.Lcl_Scaling.value),"PreRotation"in u&&(c.preRotations=u.PreRotation.value),s[i]=c}s[i][o.attr]=o}}})),i.set(parseInt(o),s)}return i}(e,t,r);return function(e,t,r){var a=e.Objects.AnimationStack,n={};for(var i in a){var o=t.get(parseInt(i)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=r.get(o[0].ID);n[i]={name:a[i].attrName,layer:s}}return n}(e,t,a)}(e,t);if(void 0===a)return;for(var i in a){var o=w(a[i]);r.animations.push(o)}}(e,t,o),function(e,t){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var r=e.GlobalSettings.AmbientColor.value,a=r[0],i=r[1],o=r[2];if(0!==a||0!==i||0!==o){var s=new n.Color(a,i,o);t.add(new n.AmbientLight(s,1))}}}(e,o),o}(o,h,A.skeletons,E,_)}});var d=[];function h(e,t,r,a){var n;switch(a.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=r;break;case"AllSame":n=a.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+a.mappingType)}"IndexToDirect"===a.referenceType&&(n=a.indices[n]);var i=n*a.dataSize,o=i+a.dataSize;return function(e,t,r,a){for(var n=r,i=0;n1?s=l:l.length>0?s=l[0]:(s=new n.MeshPhongMaterial({color:13421772}),l.push(s)),"color"in o.attributes&&l.forEach((function(e){e.vertexColors=n.VertexColors})),o.FBX_Deformer?(l.forEach((function(e){e.skinning=!0})),i=new n.SkinnedMesh(o,s)):i=new n.Mesh(o,s),i}function y(e,t){var r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),a=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,a)}function b(e,t,r){if("RotationOrder"in r){var a=parseInt(r.RotationOrder.value,10);a>0&&a<6?console.warn("THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.",["XYZ","XZY","YZX","ZXY","YXZ","ZYX","SphericXYZ"][a]):6===a&&console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.")}if("Lcl_Translation"in r&&t.position.fromArray(r.Lcl_Translation.value),"Lcl_Rotation"in r){var i=r.Lcl_Rotation.value.map(n.Math.degToRad);i.push("ZYX"),t.quaternion.setFromEuler((new n.Euler).fromArray(i))}if("Lcl_Scaling"in r&&t.scale.fromArray(r.Lcl_Scaling.value),"PreRotation"in r){var o=r.PreRotation.value.map(n.Math.degToRad);o[3]="ZYX";var s=(new n.Euler).fromArray(o);s=(new n.Quaternion).setFromEuler(s),t.quaternion.premultiply(s)}}function w(e){var t=[];return e.layer.forEach((function(e){t=t.concat(function(e){var t=[];if(void 0!==e.T&&Object.keys(e.T.curves).length>0){var r=x(e.modelName,e.T.curves,e.initialPosition,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=function(e,t,r,a){void 0!==t.x&&(E(t.x),t.x.values=t.x.values.map(n.Math.degToRad));void 0!==t.y&&(E(t.y),t.y.values=t.y.values.map(n.Math.degToRad));void 0!==t.z&&(E(t.z),t.z.values=t.z.values.map(n.Math.degToRad));var i=A(t),o=_(i,t,r);void 0!==a&&((a=a.map(n.Math.degToRad)).push("ZYX"),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a));for(var s=new n.Quaternion,l=new n.Euler,u=[],c=0;c0){var i=x(e.modelName,e.S.curves,e.initialScale,"scale");void 0!==i&&t.push(i)}return t}(e))})),new n.AnimationClip(e.name,-1,t)}function x(e,t,r,a){var i=A(t),o=_(i,t,r);return new n.VectorKeyframeTrack(e+"."+a,i,o)}function _(e,t,r){var a=r,n=[],i=-1,o=-1,s=-1;return e.forEach((function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(s=t.z.times.indexOf(e)),-1!==i){var r=t.x.values[i];n.push(r),a[0]=r}else n.push(a[0]);if(-1!==o){var l=t.y.values[o];n.push(l),a[1]=l}else n.push(a[1]);if(-1!==s){var u=t.z.values[s];n.push(u),a[2]=u}else n.push(a[2])})),n}function A(e){var t=[];return void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})).filter((function(e,t,r){return r.indexOf(e)==t}))}function E(e){for(var t=1;t=180){for(var i=n/180,o=a/i,s=r+o,l=e.times[t-1],u=(e.times[t]-l)/i,c=l+u,f=[],d=[];c1&&(r=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:r,type:a}},parseNodeProperty:function(e,t,r){var a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===a&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());var i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===a){var o=n.split(",").slice(1),s=parseInt(o[0]),l=parseInt(o[1]),u=n.split(",").slice(3);a="connections",function(e,t){for(var r=0,a=e.length,n=t.length;r=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var r={},a=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32(),i=(t>=7500?e.getUint64():e.getUint32(),e.getUint8()),o=e.getString(i);if(0===a)return null;for(var s=[],l=0;l0?s[0]:"",c=s.length>1?s[1]:"",f=s.length>2?s[2]:"";for(r.singleProperty=1===n&&e.getOffset()===a;a>e.getOffset();){var d=this.parseNode(e,t);null!==d&&this.parseSubNode(o,r,d)}return r.propertyList=s,"number"==typeof u&&(r.id=u),""!==c&&(r.attrName=c),""!==f&&(r.attrType=f),""!==o&&(r.name=o),r},parseSubNode:function(e,t,r){if(!0===r.singleProperty){var a=r.propertyList[0];Array.isArray(a)?(t[r.name]=r,r.a=a):t[r.name]=a}else if("Connections"===e&&"C"===r.name){var n=[];r.propertyList.forEach((function(e,t){0!==t&&n.push(e)})),void 0===t.connections&&(t.connections=[]),t.connections.push(n)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){var i,o=r.propertyList[0],s=r.propertyList[1],l=r.propertyList[2],u=r.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),i="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[o]={type:s,type2:l,flag:u,value:i}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var r=e.getUint32();return e.getArrayBuffer(r);case"S":r=e.getUint32();return e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var a=e.getUint32(),n=e.getUint32(),i=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}void 0===window.Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var o=new T(new Zlib.Inflate(new Uint8Array(e.getArrayBuffer(i))).decompress().buffer);switch(t){case"b":case"c":return o.getBooleanArray(a);case"d":return o.getFloat64Array(a);case"f":return o.getFloat32Array(a);case"i":return o.getInt32Array(a);case"l":return o.getInt64Array(a)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}),Object.assign(T.prototype,{getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],r=0;r=0&&(t=t.slice(0,a)),n.LoaderUtils.decodeText(t)}}),Object.assign(P.prototype,{add:function(e,t){this[e]=t}}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.splitLayer=!1};n.prototype.load=function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},n.prototype.parse=function(e){var t={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},r=[],n=void 0,i=new a.LineBasicMaterial({color:16711680});i.name="path";var o=new a.LineBasicMaterial({color:65280});function s(e){n={vertex:[],pathVertex:[],z:e.z},r.push(n)}function l(e,r){return t.relative?r:r-e}function u(e,r){return t.relative?e+r:r}o.name="extruded";for(var c,f,d=e.replace(/;.+/g,"").split("\n"),h=0;h0&&(g.extruding=l(t.e,g.e)>0,null!=n&&g.z==n.z||s(g)),c=t,f=g,void 0===n&&s(c),g.extruding?(n.vertex.push(c.x,c.y,c.z),n.vertex.push(f.x,f.y,f.z)):(n.pathVertex.push(c.x,c.y,c.z),n.pathVertex.push(f.x,f.y,f.z)),t=g}else if("G2"===m||"G3"===m)console.warn("THREE.GCodeLoader: Arc command not supported");else if("G90"===m)t.relative=!1;else if("G91"===m)t.relative=!0;else if("G92"===m){(g=t).x=void 0!==v.x?v.x:g.x,g.y=void 0!==v.y?v.y:g.y,g.z=void 0!==v.z?v.z:g.z,g.e=void 0!==v.e?v.e:g.e,t=g}else console.warn("THREE.GCodeLoader: Command not supported:"+m)}function y(e,t){var r=new a.BufferGeometry;r.addAttribute("position",new a.Float32BufferAttribute(e,3));var n=new a.LineSegments(r,t?o:i);n.name="layer"+h,b.add(n)}var b=new a.Group;if(b.name="gcode",this.splitLayer)for(h=0;h>16&32768,i=a>>12&2047,o=a>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&a):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)}return function(e,t,a,n){var i=e[t+3],o=Math.pow(2,i-128)/255;a[n+0]=r(e[t+0]*o),a[n+1]=r(e[t+1]*o),a[n+2]=r(e[t+2]*o)}}(),l=new n.CubeTexture;l.type=e,l.encoding=e===n.UnsignedByteType?n.RGBEEncoding:n.LinearEncoding,l.format=e===n.UnsignedByteType?n.RGBAFormat:n.RGBFormat,l.minFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.magFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.generateMipmaps=l.encoding!==n.RGBEEncoding,l.anisotropy=0;var u=this.hdrLoader,c=0;function f(r,a,i,f){var d=new n.FileLoader(this.manager);d.setResponseType("arraybuffer"),d.load(t[r],(function(t){c++;var i=u._parser(t);if(i){if(e===n.FloatType){for(var f=i.data.length/4*3,d=new Float32Array(f),h=0;h>8&65280|e>>24&255},e.prototype.mipmaps=function(t){for(var r=[],a=e.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight,o=t?this.numberOfMipmapLevels:1,s=0;s0?o():t(n.mergeVmds(i))}),r,a)}()},s.prototype.loadAudio=function(e,t,r,n){var i=new a.AudioListener,o=new a.Audio(i);new a.AudioLoader(this.manager).load(e,(function(e){o.setBuffer(e),t(o,i)}),r,n)},s.prototype.loadVpd=function(e,t,r,a,n){var i=this;(n&&"unicode"===n.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this)(e,(function(e){t(i.parseVpd(e))}),r,a)},s.prototype.parseModel=function(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}},s.prototype.parsePmd=function(e){return this.parser.parsePmd(e,!0)},s.prototype.parsePmx=function(e){return this.parser.parsePmx(e,!0)},s.prototype.parseVmd=function(e){return this.parser.parseVmd(e,!0)},s.prototype.parseVpd=function(e){return this.parser.parseVpd(e,!0)},s.prototype.mergeVmds=function(e){return this.parser.mergeVmds(e)},s.prototype.pourVmdIntoModel=function(e,t,r){this.createAnimation(e,t,r)},s.prototype.pourVmdIntoCamera=function(e,t,r){var n=new s.DataCreationHelper;!function(){for(var i,o,l=n.createOrderedMotionArray(t.cameras),u=[],c=[],f=[],d=[],h=[],p=[],m=[],v=[],g=[],y=new a.Quaternion,b=new a.Euler,w=new a.Vector3,x=new a.Vector3,_=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},A=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},E=function(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();for(var o=n.length/r.length,l=3===o?12:4,u=1,c=2,f=r.length;cu){r[u]=r[c];for(d=0;d=a?r.skinIndices[a]:0);for(a=0;a<4;a++)l.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t=0&&(l.limitation=new a.Vector3(1,0,0)),s.links.push(l)}t.push(s)}else for(r=0;r=0?c:u);var p=h.load(s,(function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,n=t.height;f.width=r,f.height=n,d.clearRect(0,0,r,n),d.translate(r/2,n/2),d.rotate(.5*Math.PI),d.translate(-r/2,-n/2),d.drawImage(t,0,0),e.image=d.getImageData(0,0,r,n)}e.flipY=!1,e.wrapS=a.RepeatWrapping,e.wrapT=a.RepeatWrapping;for(var i=0;i=0?(x.push(w.slice(0,_)),x.push(w.slice(_+1))):x.push(w);for(var A=0;A=0||E.indexOf(".spa")>=0?(b.envMap=m(E,{sphericalReflectionMapping:!0}),E.indexOf(".sph")>=0?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation):b.map=m(E)}}}else{if(-1!==y.textureIndex){var E=e.textures[y.textureIndex];b.map=m(E)}if(-1!==y.envTextureIndex&&(1===y.envFlag||2==y.envFlag)){E=e.textures[y.envTextureIndex];b.envMap=m(E,{sphericalReflectionMapping:!0}),1===y.envFlag?b.envMapType=a.MultiplyOperation:b.envMapType=a.AddOperation}}var S=void 0===b.map?1:.2;b.emissive=new a.Color(y.ambient[0]*S,y.ambient[1]*S,y.ambient[2]*S),p.push(b)}for(g=0;g0,y.morphTargets=o.morphTargets.length>0,y.lights=!0,y.side="pmx"===e.metadata.format&&1==(1&T.flag)?a.DoubleSide:M.side,y.transparent=M.transparent,y.fog=!0,y.blending=a.CustomBlending,y.blendSrc=a.SrcAlphaFactor,y.blendDst=a.OneMinusSrcAlphaFactor,y.blendSrcAlpha=a.SrcAlphaFactor,y.blendDstAlpha=a.DstAlphaFactor,void 0!==M.map){y.faceOffset=M.faceOffset,y.faceNum=M.faceNum,y.map=v(M.map,l),function(e){e.map.readyCallbacks.push((function(t){function r(e,t){var r=e.width,a=e.height,n=Math.round(t.x*r)%r,i=Math.round(t.y*a)%a;n<0&&(n+=r),i<0&&(i+=a);var o=i*r+n;return e.data[4*o+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),n=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var n=e.width,i=e.height;if(e.data.length/(n*i)!=4)return!1;for(var o=0;o=this.duration;)this.currentTime-=this.duration;return!(this.currentTime=this.duration}},a.MMDGrantSolver=function(e){this.mesh=e},a.MMDGrantSolver.prototype={constructor:a.MMDGrantSolver,update:(o=new a.Quaternion,function(){for(var e=0;e0)}},setAnimations:function(){for(var e=0;e0&&0!==e.action._clip.tracks[0].name.indexOf(".bones")||(e.target._root.looped=!0)}));for(var t=!1,r=!1,n=0;n0&&0===i.tracks[0].name.indexOf(".morphTargetInfluences")?r||(o.play(),r=!0):t||(o.play(),t=!0)}t&&(e.ikSolver=new a.CCDIKSolver(e),void 0!==e.geometry.grants&&(e.grantSolver=new a.MMDGrantSolver(e)))}},setCameraAnimation:function(e){void 0!==e.animations&&(e.mixer=new a.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())},unifyAnimationDuration:function(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,n=0;n0,i=!0,s={};var l=function(e,n){null==n&&(n=1);var o=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,o=2;break;case"sshort":s=Int16Array,o=2;break;case"uint":s=Uint32Array,o=4;break;case"sint":s=Int32Array,o=4;break;case"float":s=Float32Array,o=4;break;case"complex":case"double":s=Float64Array,o=8}var l=new s(t.slice(r,r+=n*o));return a!=i&&(l=function(e,t){for(var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=0;ai;n--,i++){var o=r[i];r[i]=r[n],r[n]=o}return e}(l,o)),1==n?l[0]:l}("uchar",e.byteLength),u=l.length,c=null,f=0;for(p=1;p13)&&32!==a?n+=String.fromCharCode(a):(""!==n&&(l[u]=c(n,o),u++),n="");return""!==n&&(l[u]=c(n,o),u++),l}(t);else if("raw"===s.encoding){for(var h=new Uint8Array(t.length),p=0;p0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,n=this.object.geometry.vertices;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){var a=this.normals,n=this.object.geometry.normals;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addColor:function(e,t,r){var a=this.colors,n=this.object.geometry.colors;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addUV:function(e,t,r){var a=this.uvs,n=this.object.geometry.uvs;n.push(a[e+0],a[e+1]),n.push(a[t+0],a[t+1]),n.push(a[r+0],a[r+1])},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,a,n,i,o,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),f=this.parseVertexIndex(t,u),d=this.parseVertexIndex(r,u);if(this.addVertex(c,f,d),void 0!==a&&""!==a){var h=this.uvs.length;c=this.parseUVIndex(a,h),f=this.parseUVIndex(n,h),d=this.parseUVIndex(i,h),this.addUV(c,f,d)}if(void 0!==o&&""!==o){var p=this.normals.length;c=this.parseNormalIndex(o,p),f=o===s?c:this.parseNormalIndex(s,p),d=o===l?c:this.parseNormalIndex(l,p),this.addNormal(c,f,d)}this.colors.length>0&&this.addColor(c,f,d)},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,r=0,a=e.length;r0){var w=b.split("/");v.push(w)}}var x=v[0];for(g=1,y=v.length-1;g1){var C=c[1].trim().toLowerCase();o.object.smooth="0"!==C&&"off"!==C}else o.object.smooth=!0;(Y=o.object.currentMaterial())&&(Y.smooth=o.object.smooth)}o.finalize();var k=new a.Group;k.materialLibraries=[].concat(o.materialLibraries);for(d=0,h=o.objects.length;d0?B.addAttribute("normal",new a.Float32BufferAttribute(I.normals,3)):B.computeVertexNormals(),I.colors.length>0&&(j=!0,B.addAttribute("color",new a.Float32BufferAttribute(I.colors,3))),I.uvs.length>0&&B.addAttribute("uv",new a.Float32BufferAttribute(I.uvs,2));for(var V,z=[],G=0,H=N.length;G1){for(G=0,H=N.length;Gf){f=d;var r='Download of "'+e.url+'": '+(100*d).toFixed(2)+"%";u.onProgress("progressLoad",r,d)}}}var h=new a.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.load(e.url,c,i,o)}},r.prototype.run=function(e,r){this._applyPrepData(e);var a=e.checkResourceDescriptorFiles(e.resources,[{ext:"obj",type:"ArrayBuffer",ignore:!1},{ext:"mtl",type:"String",ignore:!1},{ext:"zip",type:"String",ignore:!0}]);t.isValid(r)&&(this.terminateWorkerOnLoad=!1,this.workerSupport=r,this.logging.enabled=this.workerSupport.logging.enabled,this.logging.debug=this.workerSupport.logging.debug);var n=this;this._loadMtl(a.mtl,(function(t){null!==t&&n.meshBuilder.setMaterials(t),n._loadObj(a.obj,n.callbacks.onLoad,null,null,n.callbacks.onMeshAlter,e.useAsync)}),e.crossOrigin,e.materialOptions)},r.prototype._applyPrepData=function(e){t.isValid(e)&&(this.setLogging(e.logging.enabled,e.logging.debug),this.setModelName(e.modelName),this.setStreamMeshesTo(e.streamMeshesTo),this.meshBuilder.setMaterials(e.materials),this.setUseIndices(e.useIndices),this.setDisregardNormals(e.disregardNormals),this.setMaterialPerSmoothingGroup(e.materialPerSmoothingGroup),this._setCallbacks(e.getCallbacks()))},r.prototype.parse=function(e){if(!t.isValid(e))return console.warn("Provided content is not a valid ArrayBuffer or String."),this.loaderRootNode;this.logging.enabled&&console.time("OBJLoader2 parse: "+this.modelName),this.meshBuilder.init();var r=new o;r.setLogging(this.logging.enabled,this.logging.debug),r.setMaterialPerSmoothingGroup(this.materialPerSmoothingGroup),r.setUseIndices(this.useIndices),r.setDisregardNormals(this.disregardNormals),r.setMaterials(this.meshBuilder.getMaterials());var a=this;r.setCallbackMeshBuilder((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}));if(r.setCallbackProgress((function(e,t){a.onProgress("progressParse",e,t)})),e instanceof ArrayBuffer||e instanceof Uint8Array)this.logging.enabled&&console.info("Parsing arrayBuffer..."),r.parse(e);else{if(!("string"==typeof e||e instanceof String))throw"Provided content was neither of type String nor Uint8Array! Aborting...";this.logging.enabled&&console.info("Parsing text..."),r.parseText(e)}return this.logging.enabled&&console.timeEnd("OBJLoader2 parse: "+this.modelName),this.loaderRootNode},r.prototype.parseAsync=function(e,r){var a=this,n=!1,i=function(){r({detail:{loaderRootNode:a.loaderRootNode,modelName:a.modelName,instanceNo:a.instanceNo}}),n&&a.logging.enabled&&console.timeEnd("OBJLoader2 parseAsync: "+a.modelName)};t.isValid(e)?n=!0:(console.warn("Provided content is not a valid ArrayBuffer."),i()),n&&this.logging.enabled&&console.time("OBJLoader2 parseAsync: "+this.modelName),this.meshBuilder.init();this.workerSupport.validate((function(e,r){var a="";return a+="/**\n",a+=" * This code was constructed by OBJLoader2 buildCode.\n",a+=" */\n\n",a+="THREE = { LoaderSupport: {} };\n\n",a+=e("LoaderSupport.Validator",t),a+=r("Parser",o)}),"Parser"),this.workerSupport.setCallbacks((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}),i),a.terminateWorkerOnLoad&&this.workerSupport.setTerminateRequested(!0);var s={},l=this.meshBuilder.getMaterials();for(var u in l)s[u]=u;this.workerSupport.run({params:{useAsync:!0,materialPerSmoothingGroup:this.materialPerSmoothingGroup,useIndices:this.useIndices,disregardNormals:this.disregardNormals},logging:{enabled:this.logging.enabled,debug:this.logging.debug},materials:{materials:s},data:{input:e,options:null}})};var o=function(){function e(){this.callbackProgress=null,this.callbackMeshBuilder=null,this.contentRef=null,this.legacyMode=!1,this.materials={},this.useAsync=!1,this.materialPerSmoothingGroup=!1,this.useIndices=!1,this.disregardNormals=!1,this.vertices=[],this.colors=[],this.normals=[],this.uvs=[],this.rawMesh={objectName:"",groupName:"",activeMtlName:"",mtllibName:"",faceType:-1,subGroups:[],subGroupInUse:null,smoothingGroup:{splitMaterials:!1,normalized:-1,real:-1},counts:{doubleIndicesCount:0,faceCount:0,mtlCount:0,smoothingGroupCount:0}},this.inputObjectCount=1,this.outputObjectCount=1,this.globalCounts={vertices:0,faces:0,doubleIndicesCount:0,lineByte:0,currentByte:0,totalBytes:0},this.logging={enabled:!0,debug:!1}}return e.prototype.resetRawMesh=function(){this.rawMesh.subGroups=[],this.rawMesh.subGroupInUse=null,this.rawMesh.smoothingGroup.normalized=-1,this.rawMesh.smoothingGroup.real=-1,this.pushSmoothingGroup(1),this.rawMesh.counts.doubleIndicesCount=0,this.rawMesh.counts.faceCount=0,this.rawMesh.counts.mtlCount=0,this.rawMesh.counts.smoothingGroupCount=0},e.prototype.setUseAsync=function(e){this.useAsync=e},e.prototype.setMaterialPerSmoothingGroup=function(e){this.materialPerSmoothingGroup=e},e.prototype.setUseIndices=function(e){this.useIndices=e},e.prototype.setDisregardNormals=function(e){this.disregardNormals=e},e.prototype.setMaterials=function(e){this.materials=n.default.Validator.verifyInput(e,this.materials),this.materials=n.default.Validator.verifyInput(this.materials,{})},e.prototype.setCallbackMeshBuilder=function(e){if(!n.default.Validator.isValid(e))throw'Unable to run as no "MeshBuilder" callback is set.';this.callbackMeshBuilder=e},e.prototype.setCallbackProgress=function(e){this.callbackProgress=e},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.configure=function(){if(this.pushSmoothingGroup(1),this.logging.enabled){var e=Object.keys(this.materials),t="OBJLoader2.Parser configuration:"+(e.length>0?"\n\tmaterialNames:\n\t\t- "+e.join("\n\t\t- "):"\n\tmaterialNames: None")+"\n\tuseAsync: "+this.useAsync+"\n\tmaterialPerSmoothingGroup: "+this.materialPerSmoothingGroup+"\n\tuseIndices: "+this.useIndices+"\n\tdisregardNormals: "+this.disregardNormals+"\n\tcallbackMeshBuilderName: "+this.callbackMeshBuilder.name+"\n\tcallbackProgressName: "+this.callbackProgress.name;console.info(t)}},e.prototype.parse=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parse"),this.configure();var t=new Uint8Array(e);this.contentRef=t;var r=t.byteLength;this.globalCounts.totalBytes=r;for(var a,n=new Array(128),i="",o=0,s=0,l=0;l0&&(n[o++]=i),i="";break;case 47:i.length>0&&(n[o++]=i),s++,i="";break;case 10:i.length>0&&(n[o++]=i),i="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=l,this.processLine(n,o,s),o=0,s=0;break;case 13:break;default:i+=String.fromCharCode(a)}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parse")},e.prototype.parseText=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parseText"),this.configure(),this.legacyMode=!0,this.contentRef=e;var t=e.length;this.globalCounts.totalBytes=t;for(var r,a=new Array(128),n="",i=0,o=0,s=0;s0&&(a[i++]=n),n="";break;case"/":n.length>0&&(a[i++]=n),o++,n="";break;case"\n":n.length>0&&(a[i++]=n),n="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=s,this.processLine(a,i,o),i=0,o=0;break;case"\r":break;default:n+=r}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parseText")},e.prototype.processLine=function(e,t,r){if(!(t<1)){var a,n,i,o,s=function(e,t,r,a){var n="";if(a>r){var i;if(t)for(i=r;i4&&(this.colors.push(parseFloat(e[4])),this.colors.push(parseFloat(e[5])),this.colors.push(parseFloat(e[6])));break;case"vt":this.uvs.push(parseFloat(e[1])),this.uvs.push(parseFloat(e[2]));break;case"vn":this.normals.push(parseFloat(e[1])),this.normals.push(parseFloat(e[2])),this.normals.push(parseFloat(e[3]));break;case"f":if(a=t-1,0===r)for(this.checkFaceType(0),i=2,n=a;i0?n-1:n+a.vertices.length/3),o=a.rawMesh.subGroupInUse.vertices;o.push(a.vertices[i++]),o.push(a.vertices[i++]),o.push(a.vertices[i]);var s=a.colors.length>0?i:null;if(null!==s){var l=a.rawMesh.subGroupInUse.colors;l.push(a.colors[s++]),l.push(a.colors[s++]),l.push(a.colors[s])}if(t){var u=parseInt(t),c=2*(u>0?u-1:u+a.uvs.length/2),f=a.rawMesh.subGroupInUse.uvs;f.push(a.uvs[c++]),f.push(a.uvs[c])}if(r){var d=parseInt(r),h=3*(d>0?d-1:d+a.normals.length/3),p=a.rawMesh.subGroupInUse.normals;p.push(a.normals[h++]),p.push(a.normals[h++]),p.push(a.normals[h])}};if(this.useIndices){var o=e+(t?"_"+t:"_n")+(r?"_"+r:"_n"),s=this.rawMesh.subGroupInUse.indexMappings[o];n.default.Validator.isValid(s)?this.rawMesh.counts.doubleIndicesCount++:(s=this.rawMesh.subGroupInUse.vertices.length/3,i(),this.rawMesh.subGroupInUse.indexMappings[o]=s,this.rawMesh.subGroupInUse.indexMappingsCount++),this.rawMesh.subGroupInUse.indices.push(s)}else i();this.rawMesh.counts.faceCount++},e.prototype.createRawMeshReport=function(e){return"Input Object number: "+e+"\n\tObject name: "+this.rawMesh.objectName+"\n\tGroup name: "+this.rawMesh.groupName+"\n\tMtllib name: "+this.rawMesh.mtllibName+"\n\tVertex count: "+this.vertices.length/3+"\n\tNormal count: "+this.normals.length/3+"\n\tUV count: "+this.uvs.length/2+"\n\tSmoothingGroup count: "+this.rawMesh.counts.smoothingGroupCount+"\n\tMaterial count: "+this.rawMesh.counts.mtlCount+"\n\tReal MeshOutputGroup count: "+this.rawMesh.subGroups.length},e.prototype.finalizeRawMesh=function(){var e,t,r=[],a=0,n=0,i=0,o=0,s=0,l=0;for(var u in this.rawMesh.subGroups)if((e=this.rawMesh.subGroups[u]).vertices.length>0){if((t=e.indices).length>0&&n>0)for(var c in t)t[c]=t[c]+n;r.push(e),a+=e.vertices.length,n+=e.indexMappingsCount,i+=e.indices.length,o+=e.colors.length,l+=e.uvs.length,s+=e.normals.length}var f=null;return r.length>0&&(f={name:""!==this.rawMesh.groupName?this.rawMesh.groupName:this.rawMesh.objectName,subGroups:r,absoluteVertexCount:a,absoluteIndexCount:i,absoluteColorCount:o,absoluteNormalCount:s,absoluteUvCount:l,faceCount:this.rawMesh.counts.faceCount,doubleIndicesCount:this.rawMesh.counts.doubleIndicesCount}),f},e.prototype.processCompletedMesh=function(){var e=this.finalizeRawMesh();if(n.default.Validator.isValid(e)){if(this.colors.length>0&&this.colors.length!==this.vertices.length)throw"Vertex Colors were detected, but vertex count and color count do not match!";this.logging.enabled&&this.logging.debug&&console.debug(this.createRawMeshReport(this.inputObjectCount)),this.inputObjectCount++,this.buildMesh(e);var t=this.globalCounts.currentByte/this.globalCounts.totalBytes;return this.callbackProgress("Completed [o: "+this.rawMesh.objectName+" g:"+this.rawMesh.groupName+"] Total progress: "+(100*t).toFixed(2)+"%",t),this.resetRawMesh(),!0}return!1},e.prototype.buildMesh=function(e){var t=e.subGroups,r=new Float32Array(e.absoluteVertexCount);this.globalCounts.vertices+=e.absoluteVertexCount/3,this.globalCounts.faces+=e.faceCount,this.globalCounts.doubleIndicesCount+=e.doubleIndicesCount;var a,i,o,s,l,u,c,f=e.absoluteIndexCount>0?new Uint32Array(e.absoluteIndexCount):null,d=e.absoluteColorCount>0?new Float32Array(e.absoluteColorCount):null,h=e.absoluteNormalCount>0?new Float32Array(e.absoluteNormalCount):null,p=e.absoluteUvCount>0?new Float32Array(e.absoluteUvCount):null,m=n.default.Validator.isValid(d),v=[],g=t.length>1,y=0,b=[],w=[],x=0,_=0,A=0,E=0,S=0,M=0,T=0;for(var P in t)if(t.hasOwnProperty(P)){if(c=(a=t[P]).materialName,u=this.rawMesh.faceType<4?c+(m?"_vertexColor":"")+(0===a.smoothingGroup?"_flat":""):6===this.rawMesh.faceType?"defaultPointMaterial":"defaultLineMaterial",s=this.materials[c],l=this.materials[u],!n.default.Validator.isValid(s)&&!n.default.Validator.isValid(l)){var F=m?"defaultVertexColorMaterial":"defaultMaterial";s=this.materials[F],this.logging.enabled&&console.warn('object_group "'+a.objectName+"_"+a.groupName+'" was defined with unresolvable material "'+c+'"! Assigning "'+F+'".'),(c=F)===u&&(l=s,u=F)}if(!n.default.Validator.isValid(l)){var O={materialNameOrg:c,materialName:u,materialProperties:{vertexColors:m?2:0,flatShading:0===a.smoothingGroup}},L={cmd:"materialData",materials:{materialCloneInstructions:O}};this.callbackMeshBuilder(L),this.useAsync&&(this.materials[u]=O)}if(g?((i=b[u])||(i=y,b[u]=y,v.push(u),y++),o={start:M,count:T=this.useIndices?a.indices.length:a.vertices.length/3,index:i},w.push(o),M+=T):v.push(u),r.set(a.vertices,x),x+=a.vertices.length,f&&(f.set(a.indices,_),_+=a.indices.length),d&&(d.set(a.colors,A),A+=a.colors.length),h&&(h.set(a.normals,E),E+=a.normals.length),p&&(p.set(a.uvs,S),S+=a.uvs.length),this.logging.enabled&&this.logging.debug){var C=n.default.Validator.isValid(i)?"\n\t\tmaterialIndex: "+i:"",k="\tOutput Object no.: "+this.outputObjectCount+"\n\t\tgroupName: "+a.groupName+"\n\t\tIndex: "+a.index+"\n\t\tfaceType: "+this.rawMesh.faceType+"\n\t\tmaterialName: "+a.materialName+"\n\t\tsmoothingGroup: "+a.smoothingGroup+C+"\n\t\tobjectName: "+a.objectName+"\n\t\t#vertices: "+a.vertices.length/3+"\n\t\t#indices: "+a.indices.length+"\n\t\t#colors: "+a.colors.length/3+"\n\t\t#uvs: "+a.uvs.length/2+"\n\t\t#normals: "+a.normals.length/3;console.debug(k)}}this.outputObjectCount++,this.callbackMeshBuilder({cmd:"meshData",progress:{numericalValue:this.globalCounts.currentByte/this.globalCounts.totalBytes},params:{meshName:e.name},materials:{multiMaterial:g,materialNames:v,materialGroups:w},buffers:{vertices:r,indices:f,colors:d,normals:h,uvs:p},geometryType:this.rawMesh.faceType<4?0:6===this.rawMesh.faceType?2:1},[r.buffer],n.default.Validator.isValid(f)?[f.buffer]:null,n.default.Validator.isValid(d)?[d.buffer]:null,n.default.Validator.isValid(h)?[h.buffer]:null,n.default.Validator.isValid(p)?[p.buffer]:null)},e.prototype.finalizeParsing=function(){if(this.logging.enabled&&console.info("Global output object count: "+this.outputObjectCount),this.processCompletedMesh()&&this.logging.enabled){var e="Overall counts: \n\tVertices: "+this.globalCounts.vertices+"\n\tFaces: "+this.globalCounts.faces+"\n\tMultiple definitions: "+this.globalCounts.doubleIndicesCount;console.info(e)}},e}();return r.prototype.loadMtl=function(e,t,r,a,i){var o=new n.default.ResourceDescriptor(e,"MTL");o.setContent(t),this._loadMtl(o,r,a,i)},r.prototype._loadMtl=function(e,r,n,o){void 0===i.default&&console.error('"THREE.MTLLoader" is not available. "THREE.OBJLoader2" requires it for loading MTL files.'),t.isValid(e)&&this.logging.enabled&&console.time("Loading MTL: "+e.name);var s=[],l=this,u=function(a){var n=[];if(t.isValid(a))for(var i in a.preload(),n=a.materials)n.hasOwnProperty(i)&&(s[i]=n[i]);t.isValid(e)&&l.logging.enabled&&console.timeEnd("Loading MTL: "+e.name),r(s,a)};if(t.isValid(e)&&(t.isValid(e.content)||t.isValid(e.url))){var c=new i.default(this.manager);if(n=t.verifyInput(n,"anonymous"),c.setCrossOrigin(n),c.setPath(e.path),t.isValid(o)&&c.setMaterialOptions(o),t.isValid(e.content))u(t.isValid(e.content)?c.parse(e.content):null);else if(t.isValid(e.url)){new a.FileLoader(this.manager).load(e.url,(function(t){e.content=t,u(c.parse(t))}),this._onProgress,this._onError)}}else u()},r}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.littleEndian=!0};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(e,(function(r){t(i.parse(r,e))}),r,n)},parse:function(e,t){var r=a.LoaderUtils.decodeText(e),n=function(e){var t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),a=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=a[1],t.headerLen=a[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(var n=0,i=t.fields.length;n0&&v.addAttribute("position",new a.Float32BufferAttribute(i,3)),o.length>0&&v.addAttribute("normal",new a.Float32BufferAttribute(o,3)),s.length>0&&v.addAttribute("color",new a.Float32BufferAttribute(s,3)),v.computeBoundingSphere();var g=new a.PointsMaterial({size:.005});s.length>0?g.vertexColors=!0:g.color.setHex(16777215*Math.random());var y=new a.Points(v,g),b=t.split("").reverse().join("");return b=(b=/([^\/]*)/.exec(b))[1].split("").reverse().join(""),y.name=b,y}console.error("THREE.PCDLoader: binary_compressed files are not supported")}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function n(e,t){var r=parseInt(m[v].substr(e,t));if(r){var a=function(e,t){return"s"+Math.min(e,t)+"e"+Math.max(e,t)}(y,r);void 0===p[a]&&(d.push([y-1,r-1,1]),p[a]=d.length-1)}}for(var i,o,s,l,u,c={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},f=[],d=[],h={},p={},m=e.split("\n"),v=0,g=m.length;v=t.elements[u].count&&(u++,c=0);var h=n(t.elements[u].properties,d);s(a,t.elements[u].name,h),c++}}return o(a)}function o(e){var t=new a.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.addAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.addAttribute("normal",new a.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.addAttribute("uv",new a.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.addAttribute("color",new a.Float32BufferAttribute(e.colors,3)),t.computeBoundingSphere(),t}function s(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){var a=r.vertex_indices||r.vertex_index;3===a.length?e.indices.push(a[0],a[1],a[2]):4===a.length&&(e.indices.push(a[0],a[1],a[3]),e.indices.push(a[1],a[2],a[3]))}}function l(e,t,r,a){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,a),2];case"uint16":case"ushort":return[e.getUint16(t,a),2];case"int32":case"int":return[e.getInt32(t,a),4];case"uint32":case"uint":return[e.getUint32(t,a),4];case"float32":case"float":return[e.getFloat32(t,a),4];case"float64":case"double":return[e.getFloat64(t,a),8]}}function u(e,t,r,a){for(var n,i={},o=0,s=0;s>7&1),s=n>>6&1,l=1==(n>>5&1),u=31&n,c=0,f=0;if(l?(c=(t[2]<<16)+(t[3]<<8)+t[4],f=(t[5]<<16)+(t[6]<<8)+t[7]):(c=t[2]+(t[3]<<8)+(t[4]<<16),f=t[5]+(t[6]<<8)+(t[7]<<16)),0===a)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==a)throw new Error("PRWM decoder: Unsupported format version: "+a);if(!o){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==f)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}var d,h,p,m,v,g,y,b,w=8,x={};for(b=0;b>7&1,m=1+(n>>4&3),w++,g=i(e,v=r[15&n],w=4*Math.ceil(w/4),m*c,l),w+=v.BYTES_PER_ELEMENT*m*c,x[d]={type:p,cardinality:m,values:g}}return w=4*Math.ceil(w/4),y=null,o&&(y=i(e,1===s?Uint32Array:Uint16Array,w,f,l)),{version:a,attributes:x,indices:y}}(e),s=Object.keys(o.attributes),l=new a.BufferGeometry;for(n=0;n0;return 25===h?(r=p?a.RGBA_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,t=4):24===h?(r=p?a.RGBA_PVRTC_2BPPV1_Format:a.RGB_PVRTC_2BPPV1_Format,t=2):console.error("THREE.PVRLoader: Unknown PVR format:",h),e.dataPtr=o,e.bpp=t,e.format=r,e.width=l,e.height=s,e.numSurfaces=d,e.numMipmaps=u+1,e.isCubemap=6===d,n._extract(e)},n._extract=function(e){var t,r={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},a=e.buffer,n=e.dataPtr,i=e.bpp,o=e.numSurfaces,s=0,l=0,u=0,c=0,f=0;2===i?(l=8,u=4):(l=4,u=4),t=l*u*i/8,r.mipmaps.length=e.numMipmaps*o;for(var d=0;d>d,p=e.height>>d;(c=h/l)<2&&(c=2),(f=p/u)<2&&(f=2),s=c*f*t;for(var m=0;m>5&31)/31,n=(_>>10&31)/31):(t=o,r=s,n=l)}for(var A=1;A<=3;A++){var E=y+12*A;m.push(c.getFloat32(E,!0)),m.push(c.getFloat32(E+4,!0)),m.push(c.getFloat32(E+8,!0)),v.push(b,w,x),d&&i.push(t,r,n)}}return p.addAttribute("position",new a.BufferAttribute(new Float32Array(m),3)),p.addAttribute("normal",new a.BufferAttribute(new Float32Array(v),3)),d&&(p.addAttribute("color",new a.BufferAttribute(new Float32Array(i),3)),p.hasColors=!0,p.alpha=u),p}(r):function(e){for(var t,r=new a.BufferGeometry,n=/facet([\s\S]*?)endfacet/g,i=0,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+o+o+o,"g"),l=new RegExp("normal"+o+o+o,"g"),u=[],c=[],f=new a.Vector3;null!==(t=n.exec(e));){for(var d=0,h=0,p=t[0];null!==(t=l.exec(p));)f.x=parseFloat(t[1]),f.y=parseFloat(t[2]),f.z=parseFloat(t[3]),h++;for(;null!==(t=s.exec(p));)u.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),c.push(f.x,f.y,f.z),d++;1!==h&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==d&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}return r.addAttribute("position",new a.Float32BufferAttribute(u,3)),r.addAttribute("normal",new a.Float32BufferAttribute(c,3)),r}("string"!=typeof(t=e)?a.LoaderUtils.decodeText(new Uint8Array(t)):t)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e,t,a,n,i,o,s,l){n=n*Math.PI/180,t=Math.abs(t),a=Math.abs(a);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,f=Math.cos(n)*u+Math.sin(n)*c,d=-Math.sin(n)*u+Math.cos(n)*c,h=t*t,p=a*a,m=f*f,v=d*d,g=m/h+v/p;if(g>1){var y=Math.sqrt(g);h=(t*=y)*t,p=(a*=y)*a}var b=h*v+p*m,w=(h*p-b)/b,x=Math.sqrt(Math.max(0,w));i===o&&(x=-x);var _=x*t*d/a,A=-x*a*f/t,E=Math.cos(n)*_-Math.sin(n)*A+(s.x+l.x)/2,S=Math.sin(n)*_+Math.cos(n)*A+(s.y+l.y)/2,M=r(1,0,(f-_)/t,(d-A)/a),T=r((f-_)/t,(d-A)/a,(-f-_)/t,(-d-A)/a)%(2*Math.PI);e.currentPath.absellipse(E,S,t,a,M,M+T,0===o,n)}function r(e,t,r,a){var n=e*r+t*a,i=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+a*a),o=Math.acos(Math.max(-1,Math.min(1,n/i)));return e*a-t*r<0&&(o=-o),o}function n(e,t){return t=Object.assign({},t),e.hasAttribute("fill")&&(t.fill=e.getAttribute("fill")),""!==e.style.fill&&(t.fill=e.style.fill),t}function i(e){return"none"!==e.fill&&"transparent"!==e.fill}function o(e,t){return 2*e-(t-e)}function s(e){for(var t=e.split(/[\s,]+|(?=\s?[+\-])/),r=0;r0){var p=[];for(u=0;u=t.end)return 0;this.position=t.cur;try{var r=this.readChunk(e);return t.cur+=r.size,r.id}catch(e){return this.debugMessage("Unable to read chunk at "+this.position),0}},resetPosition:function(){this.position-=6},readByte:function(e){var t=e.getUint8(this.position,!0);return this.position+=1,t},readFloat:function(e){try{var t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}},readInt:function(e){var t=e.getInt32(this.position,!0);return this.position+=4,t},readShort:function(e){var t=e.getInt16(this.position,!0);return this.position+=2,t},readDWord:function(e){var t=e.getUint32(this.position,!0);return this.position+=4,t},readWord:function(e){var t=e.getUint16(this.position,!0);return this.position+=2,t},readString:function(e,t){for(var r="",a=0;a256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case a:case n:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;var g=!1,y=!1,b=!1;switch(v.image_type){case i:g=!0,y=!0;break;case r:y=!0;break;case o:g=!0;break;case a:break;case s:g=!0,b=!0;break;case n:b=!0}var w=document.createElement("canvas");w.width=v.width,w.height=v.height;var x=w.getContext("2d"),_=x.createImageData(v.width,v.height),A=function(e,t,r,a,n){var i,o,s,l;if(o=r.pixel_size>>3,s=r.width*r.height*o,t&&(l=n.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,c,f;i=new Uint8Array(s);for(var d=0,h=new Uint8Array(o);d>u){default:case d:i=0,s=1,m=t,o=0,p=1,g=r;break;case c:i=0,s=1,m=t,o=r-1,p=-1,g=-1;break;case h:i=t-1,s=-1,m=-1,o=0,p=1,g=r;break;case f:i=t-1,s=-1,m=-1,o=r-1,p=-1,g=-1}if(b)switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f++)l=s[f],e[4*(u+d*c)+0]=l,e[4*(u+d*c)+1]=l,e[4*(u+d*c)+2]=l,e[4*(u+d*c)+3]=255}(e,o,p,g,i,s,m,a);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=2)e[4*(l+f*u)+0]=s[c+0],e[4*(l+f*u)+1]=s[c+0],e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+3]=s[c+1]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s,l){var u,c,f,d=l,h=0,p=v.width;for(f=t;f!==a;f+=r)for(c=n;c!==o;c+=i,h++)u=s[h],e[4*(c+p*f)+3]=255,e[4*(c+p*f)+2]=d[3*u+0],e[4*(c+p*f)+1]=d[3*u+1],e[4*(c+p*f)+0]=d[3*u+2]}(e,o,p,g,i,s,m,a,n);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c,f=0,d=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,f+=2)l=s[f+0]+(s[f+1]<<8),e[4*(u+d*c)+0]=(31744&l)>>7,e[4*(u+d*c)+1]=(992&l)>>2,e[4*(u+d*c)+2]=(31&l)>>3,e[4*(u+d*c)+3]=32768&l?0:255}(e,o,p,g,i,s,m,a);break;case 24:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=3)e[4*(l+f*u)+3]=255,e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2]}(e,o,p,g,i,s,m,a);break;case 32:!function(e,t,r,a,n,i,o,s){var l,u,c=0,f=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=4)e[4*(l+f*u)+2]=s[c+0],e[4*(l+f*u)+1]=s[c+1],e[4*(l+f*u)+0]=s[c+2],e[4*(l+f*u)+3]=s[c+3]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}}(_.data,v.width,v.height,A.pixel_data,A.palettes);return x.putImageData(_,0,0),w}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.reversed=!1};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){var t,r=[];e.forEach((function(e){"m"===e.type.toLowerCase()?(t=[e],r.push(t)):"z"!==e.type.toLowerCase()&&t.push(e)}));var a=[];return r.forEach((function(e){var t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};a.push(t);for(var r=e.length-1;r>0;r--){var n=e[r];t={type:n.type};void 0!==n.x2&&void 0!==n.y2?(t.x1=n.x2,t.y1=n.y2,t.x2=n.x1,t.y2=n.y1):void 0!==n.x1&&void 0!==n.y1&&(t.x1=n.x1,t.y1=n.y1),t.x=e[r-1].x,t.y=e[r-1].y,a.push(t)}})),a}return"undefined"==typeof opentype?(console.warn("THREE.TTFLoader: The loader requires opentype.js. Make sure it's included before using the loader."),null):function(e,r){for(var a=Math.round,n={},i=1e5/(72*(e.unitsPerEm||2048)),o=0;o-1;o--){var s=i[o];if(/{.*[{\[]/.test(s))(l=s.split("{").join("{\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);else if(/\].*}/.test(s)){var l;(l=s.split("]").join("]\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l)}if(/}.*}/.test(s))(l=s.split("}").join("}\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);/^\b[^\s]+\b$/.test(s.trim())?(i[o+1]=s+" "+i[o+1].trim(),i.splice(o,1)):s.indexOf("coord")>-1&&s.indexOf("[")<0&&s.indexOf("{")<0&&(i[o]+=" Coordinate {}")}var u=i.shift();return/V1.0/.exec(u)?console.warn("THREE.VRMLLoader: V1.0 not supported yet."):/V2.0/.exec(u)&&function(e,n){var i={},o=/(\b|\-|\+)([\d\.e]+)/,s=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g,l=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g;function u(e,t,r,n,i){for(var o=!0===i?1:-1,s=[],l={},u={},c=0;cu.y:m.y>=l.y&&m.y0)for(var d=0;d0&&this.indexes.push(c),c=[]):c.push(parseInt(i[d])));/]/.exec(t)&&(c.length>0&&this.indexes.push(c),c=[],this.isRecordingFaces=!1,e[this.recordingFieldname]=this.indexes)}else if(this.isRecordingPoints){if("Coordinate"==e.nodeType)for(;null!==(i=l.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2]),z:parseFloat(i[3])},this.points.push(n);if("TextureCoordinate"==e.nodeType)for(;null!==(i=s.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2])},this.points.push(n);/]/.exec(t)&&(this.isRecordingPoints=!1,e.points=this.points)}else if(this.isRecordingAngles){if(i.length>0)for(d=0;d-1&&"PointLight"===o.nodeType&&(o.nodeType="AmbientLight");var c=void 0===o.on||o.on,f=void 0!==o.intensity?o.intensity:1,d=new a.Color;if(o.color&&d.copy(o.color),"AmbientLight"===o.nodeType)(l=new a.AmbientLight(d,f)).visible=c,s.add(l);else if("PointLight"===o.nodeType){var h=0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),(l=new a.PointLight(d,f,h)).visible=c,s.add(l)}else if("SpotLight"===o.nodeType){f=1,h=0;var p=Math.PI/3;c=!0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),void 0!==o.cutOffAngle&&(p=o.cutOffAngle),(l=new a.SpotLight(d,f,h,p,0)).visible=c,s.add(l)}else if("Transform"===o.nodeType||"Group"===o.nodeType){if(l=new a.Object3D,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),void 0!==o.translation){var m=o.translation;l.position.set(m.x,m.y,m.z)}if(void 0!==o.rotation){var v=o.rotation;l.quaternion.setFromAxisAngle(new a.Vector3(v.x,v.y,v.z),v.w)}if(void 0!==o.scale){var g=o.scale;l.scale.set(g.x,g.y,g.z)}s.add(l)}else if("Shape"===o.nodeType)l=new a.Mesh,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),s.add(l);else if("Background"===o.nodeType){var y=2e4,b=new a.SphereBufferGeometry(y,20,20),w=new a.MeshBasicMaterial({fog:!1,side:a.BackSide});if(o.skyColor.length>1)u(b,y,o.skyAngle,o.skyColor,!0),w.vertexColors=a.VertexColors;else{var x=o.skyColor[0];w.color.setRGB(x.r,x.b,x.g)}if(n.add(new a.Mesh(b,w)),void 0!==o.groundColor){y=12e3;var _=new a.SphereBufferGeometry(y,20,20,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),A=new a.MeshBasicMaterial({fog:!1,side:a.BackSide,vertexColors:a.VertexColors});u(_,y,o.groundAngle,o.groundColor,!1),n.add(new a.Mesh(_,A))}}else{if(/geometry/.exec(o.string)){if("Box"===o.nodeType){g=o.size;s.geometry=new a.BoxBufferGeometry(g.x,g.y,g.z)}else if("Cylinder"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.radius,o.radius,o.height);else if("Cone"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.topRadius,o.bottomRadius,o.height);else if("Sphere"===o.nodeType)s.geometry=new a.SphereBufferGeometry(o.radius);else if("IndexedFaceSet"===o.nodeType){var E,S,M,T,P,F=new a.BufferGeometry,O=[],L=[];for(B=0,M=o.children.length;B-1){var C=/DEF\s+([^\s]+)/.exec(V.string)[1];i[C]=O.slice(0)}if(V.string.indexOf("USE")>-1){W=/USE\s+([^\s]+)/.exec(V.string)[1];O=i[W]}}}var k=0;if(o.coordIndex){var R=[],I=[];for(E=new a.Vector3,S=new a.Vector2,B=0,M=o.coordIndex.length;B=3&&k0&&F.addAttribute("uv",new a.Float32BufferAttribute(L,2)),F.computeVertexNormals(),F.computeBoundingSphere(),/DEF/.exec(o.string)&&(F.name=/DEF ([^\s]+)/.exec(o.string)[1],i[F.name]=F),s.geometry=F}return}if(/appearance/.exec(o.string)){for(var B=0;B>1^-(1&c),a[n]=s*(l+o),n+=i}},n.prototype.decompressIndices_=function(e,t,r,a,n){for(var i=0,o=0;o>1,p=e.charCodeAt(u+4)+1>>1,m=e.charCodeAt(u+5)+1>>1;l[s++]=n[0]*(c+h),l[s++]=n[1]*(f+p),l[s++]=n[2]*(d+m),l[s++]=n[0]*h,l[s++]=n[1]*p,l[s++]=n[2]*m}return l},n.prototype.decompressMesh=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=u,d=new Float32Array(o*c),h=0;h>1^-(1&f);l[c]+=d,s[t*u+c]=l[c],o[t*u+c]=a[c]*(l[c]+r[c])}},n.prototype.accumulateNormal=function(e,t,r,a,n){var i=a[8*e],o=a[8*e+1],s=a[8*e+2],l=a[8*t],u=a[8*t+1],c=a[8*t+2],f=a[8*r],d=a[8*r+1],h=a[8*r+2];l-=i,f-=i,i=(u-=o)*(h-=s)-(c-=s)*(d-=o),o=c*f-l*h,s=l*d-u*f,n[3*e]+=i,n[3*e+1]+=o,n[3*e+2]+=s,n[3*t]+=i,n[3*t+1]+=o,n[3*t+2]+=s,n[3*r]+=i,n[3*r+1]+=o,n[3*r+2]+=s},n.prototype.decompressMesh2=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],f=t.codeRange[0],d=3*t.codeRange[2],h=new Uint16Array(d),p=new Int32Array(3*c),m=new Uint16Array(o),v=new Uint16Array(o*c),g=new Float32Array(o*c),y=0,b=0,w=0;w>1^-(1&O))+v[o*A+F]+v[o*E+F]-v[o*S+F];m[F]=L,v[o*y+F]=L,g[o*y+F]=l[F]*(L+s[F])}y++}else this.copyAttrib(o,v,m,P);this.accumulateNormal(A,E,P,v,p)}else{var C=y-(x-_);h[b++]=C,x===_?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,C);var k=y-(x=e.charCodeAt(f++));h[b++]=k,0===x?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,k);var R=y-(x=e.charCodeAt(f++));if(h[b++]=R,0===x){for(F=0;F<5;F++)m[F]=(v[o*C+F]+v[o*k+F])/2;this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++)}else this.copyAttrib(o,v,m,R);this.accumulateNormal(C,k,R,v,p)}}for(w=0;w>1^-(1&j)),g[o*w+6]=U*N+(B>>1^-(1&B)),g[o*w+7]=U*D+(V>>1^-(1&V))}i(a,n,g,h,void 0,t)},n.prototype.downloadMesh=function(e,t,r,a,n){var i=this,s=0;o(e,(function(e){!function(e){for(;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=new s(3*f/4-(i="="===e[f-2]?2:"="===e[f-1]?1:0)),a=i>0?f-4:f;var d=0;for(t=0,r=0;t>16,o[d++]=(65280&n)>>8,o[d++]=255&n;return 2===i?(n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[d++]=255&n):1===i&&(n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[d++]=n>>8&255,o[d++]=255&n),o}function n(e,a){var n,i,s,l,u=0;if("UInt64"===o.attributes.header_type?u=8:"UInt32"===o.attributes.header_type&&(u=4),"binary"===e.attributes.format&&a){var c,f,d,h,p,m;if("Float32"===e.attributes.type)var v=new Float32Array;else if("Int64"===e.attributes.type)v=new Int32Array;f=(c=r(e["#text"]))[0];for(var g=1;g0?3-h%3:0,(p=[]).push(m),d=3*u;for(g=0;g0){r.attributes={};for(var a=0;a0&&(v[g].text=n(v[g],f)),g++;switch(d[h]){case"PointData":var b=parseInt(c.attributes.NumberOfPoints),w=m.attributes.Normals;if(b>0)for(var x=0,_=v.length;x<_;x++)if(w===v[x].attributes.Name){var A=v[x].attributes.NumberOfComponents;(l=new Float32Array(b*A)).set(v[x].text,0)}break;case"Points":if((b=parseInt(c.attributes.NumberOfPoints))>0){A=m.DataArray.attributes.NumberOfComponents;(s=new Float32Array(b*A)).set(m.DataArray.text,0)}break;case"Strips":var E=parseInt(c.attributes.NumberOfStrips);if(E>0){var S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);var T=E+S.length;u=new Uint32Array(3*T-9*E);var P=0;for(x=0,_=E;x<_;x++){for(var F=[],O=0,L=M[x],C=0;O0&&(C=M[x-1]);var k=0;for(L=M[x],C=0;k0&&(C=M[x-1])}}break;case"Polys":var R=parseInt(c.attributes.NumberOfPolys);if(R>0){S=new Int32Array(m.DataArray[0].text.length),M=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),M.set(m.DataArray[1].text,0);T=R+S.length;u=new Uint32Array(3*T-9*R);P=0;var I=0;for(x=0,_=R,C=0;x<_;){var N=[];for(O=0,L=M[x];O=3)for(var C=parseInt(L[0]),k=1,R=0;R=3){var I,N;for(R=0;R=u.byteLength)break}var A=new a.BufferGeometry;return A.setIndex(new a.BufferAttribute(h,1)),A.addAttribute("position",new a.BufferAttribute(f,3)),d.length===f.length&&A.addAttribute("normal",new a.BufferAttribute(d,3)),A}(e)}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(var r=t;r-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,a=0;a127)return!0;return!1}},{key:"ensureBinary",value:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),r=0;r0&&(this.baseDir=this.url.substr(0,this.url.lastIndexOf("/")+1));this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this.mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var a=this._data.indexOf("{",r)+1,n=this._data.indexOf("}",r),i=this._data.indexOf("{",a)+1;if(!(a>0&&n>a)){r=-1===a?this._data.length:n+1;break}var o={children:[]},s=this._readLine(this._data.substr(r,a-r-1)).trim(),l=s.split(/ /g);if(l.length>0?(o.type=l[0],l.length>=2?o.name=l[1]:o.name=l[0]+this.Hierarchies.children.length):(o.name=s,o.type=""),"Animation"===o.type){o.data=this._data.substr(i,n-i).trim();var u=this._hierarchieParse(o,n+1);r=u.end,o.children=u.parent.children}else{var c=this._data.lastIndexOf(";",i>0?Math.min(i,n):n);if(o.data=this._data.substr(a,c-a).trim(),i<=0||n0||!this._currentObject.worked?setTimeout((function(){e.mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.Geometry=new a.Geometry,this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new s,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new a.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new a.Bone;if(e.name=this._currentFrame.name,e.applyMatrix(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(var t in this.HieStack)this.HieStack[t].name===this._currentFrame.parentName&&this.HieStack[t].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,a=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,n=0,(a=this._currentObject.data.indexOf(";;",e)+1)<=0&&(a=this._currentObject.data.length)}else{var o=0;switch(t){case 0:o=this._currentObject.data.indexOf(",",e)+1;break;case 1:o=this._currentObject.data.indexOf(";,",e)+1}switch((0===o||o>a)&&(o=a,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,o-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,o-e))}break;case"MeshNormals":switch(t){case 0:this._readNormalVector1(this._currentObject.data.substr(e,o-e));break;case 1:this._readNormalFace1(this._currentObject.data.substr(e,o-e),n)}}e=o+1,n++,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.Geometry.vertices.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))),this._currentGeo.Geometry.skinIndices.push(new a.Vector4(0,0,0,0)),this._currentGeo.Geometry.skinWeights.push(new a.Vector4(1,0,0,0)),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.Geometry.faces.push(new a.Face3(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),new a.Vector3(1,1,1).normalize()))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.normalVectors.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])))}},{key:"_readNormalFace1",value:function(e,t){var r=this._readLine(e.trim()).substr(2,e.length-4).split(","),a=parseInt(r[0],10),n=this._currentGeo.normalVectors[a];a=parseInt(r[1],10);var i=this._currentGeo.normalVectors[a];a=parseInt(r[2],10);var o=this._currentGeo.normalVectors[a];this._currentGeo.Geometry.faces[t].vertexNormals=[n,i,o]}},{key:"_setMeshNormals",value:function(){for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var a=this._currentObject.data.indexOf(",",e)+1;-1===a&&(a=this._currentObject.data.indexOf(";;",e)+1,t=2,r=0);var n=this._currentObject.data.substr(e,a-e),i=this._readLine(n.trim()).split(";");this._currentGeo.normalVectors.push([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]),e=a+1}}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshTextureCoords",value:function(){this._tmpUvArray=[],this._currentGeo.Geometry.faceVertexUvs=[],this._currentGeo.Geometry.faceVertexUvs.push([]);for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),o=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),1-parseFloat(o[1]))):this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),parseFloat(o[1]))),e=n+1}}if(e>=this._currentObject.data.length)break}this._currentGeo.Geometry.faceVertexUvs[0]=[];for(var s=0;s=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new a.MeshPhongMaterial({color:16777215*Math.random()});e.side=a.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t),i=this._readLine(n.trim()).split(";");e.color.r=parseFloat(i[0]),e.color.g=parseFloat(i[1]),e.color.b=parseFloat(i[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(n)),t=r+1,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t);var o=this._readLine(n.trim()).split(";");e.specular.r=parseFloat(o[0]),e.specular.g=parseFloat(o[1]),e.specular.b=parseFloat(o[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),n=this._currentObject.data.substr(t,r-t);var s=this._readLine(n.trim()).split(";");e.emissive.r=parseFloat(s[0]),e.emissive.g=parseFloat(s[1]),e.emissive.b=parseFloat(s[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var u=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(this.baseDir+u);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(this.baseDir+u),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(this.baseDir+u),e.normalScale=new a.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(this.baseDir+u);break;case"LightMapFilename":e.lightMap=this.texloader.load(this.baseDir+u)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new o,t=0,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);t=r+1,e.boneName=n.substr(1,n.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(r=this._currentObject.data.indexOf(";",t))+1,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);for(var i=this._readLine(n.trim()).split(","),s=0;s0)for(var o=0;o0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(var r=0;r4&&console.log("warn! over 4 bone weight! :"+s)}}for(var u=0;u0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,i&&e.context.disable(e.context.STENCIL_TEST),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new a.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new a.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionX,e.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.context.enable(e.context.STENCIL_TEST),e.render(this.scene,this.camera,r,!1),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:new a.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),s.BlurDirectionX=new a.Vector2(1,0),s.BlurDirectionY=new a.Vector2(0,1),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=r(1),i=(a=n)&&a.__esModule?a:{default:a};var o=function(e,t,r,a,n){i.default.call(this),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=a,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};o.prototype=Object.assign(Object.create(i.default.prototype),{constructor:o,render:function(e,t,r,a,n){var i,o,s=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),o=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),this.clearColor&&e.setClearColor(i,o),this.scene.overrideMaterial=null,e.autoClear=s}}),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=c(r(1)),i=c(r(19)),o=c(r(20)),s=c(r(2)),l=c(r(21)),u=c(r(22));function c(e){return e&&e.__esModule?e:{default:e}}var f=function(e,t,r,u,c){(n.default.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==r&&r,this.supportsNormalTexture=void 0!==u&&u,this.oldClearColor=new a.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==c?new a.Vector2(c.x,c.y):new a.Vector2(256,256),this.saoRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.NearestFilter,magFilter:a.NearestFilter,format:a.RGBAFormat}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((r=new a.DepthTexture).type=a.UnsignedShortType,r.minFilter=a.NearestFilter,r.maxFilter=a.NearestFilter,this.beautyRenderTarget.depthTexture=r,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.normalMaterial=new a.MeshNormalMaterial,this.normalMaterial.blending=a.NoBlending,void 0===i.default&&console.error("THREE.SAOPass relies on THREE.SAOShader"),this.saoMaterial=new a.ShaderMaterial({defines:Object.assign({},i.default.defines),fragmentShader:i.default.fragmentShader,vertexShader:i.default.vertexShader,uniforms:a.UniformsUtils.clone(i.default.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=a.NoBlending,void 0===o.default&&console.error("THREE.SAOPass relies on THREE.DepthLimitedBlurShader"),this.vBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=a.NoBlending,this.hBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=a.NoBlending,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.CopyShader"),this.materialCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(s.default.uniforms),vertexShader:s.default.vertexShader,fragmentShader:s.default.fragmentShader,blending:a.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=a.CustomBlending,this.materialCopy.blendSrc=a.DstColorFactor,this.materialCopy.blendDst=a.ZeroFactor,this.materialCopy.blendEquation=a.AddEquation,this.materialCopy.blendSrcAlpha=a.DstAlphaFactor,this.materialCopy.blendDstAlpha=a.ZeroFactor,this.materialCopy.blendEquationAlpha=a.AddEquation,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.UnpackDepthRGBAShader"),this.depthCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(l.default.uniforms),vertexShader:l.default.vertexShader,fragmentShader:l.default.fragmentShader,blending:a.NoBlending}),this.quadCamera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.quadScene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quadScene.add(this.quad)};f.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},f.prototype=Object.assign(Object.create(n.default.prototype),{constructor:f,render:function(e,t,r,n,i){if(this.renderToScreen&&(this.materialCopy.blending=a.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,e.clearTarget(this.depthRenderTarget),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(u.default.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(0,1)),u.default.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.render(this.scene,this.camera,this.beautyRenderTarget,!0),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var l=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,l=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?l.blending=a.CustomBlending:l.blending=a.NoBlending,this.renderPass(e,l,this.renderToScreen?null:r),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}},renderPass:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.quad.material=t,e.render(this.quadScene,this.quadCamera,r,l),e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},renderOverride:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1,a=t.clearColor||a,n=t.clearAlpha||n;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.scene.overrideMaterial=t,e.render(this.scene,this.camera,r,l),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}}),t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){n.default.call(this),void 0===i.default&&console.error("THREE.SavePass relies on THREE.CopyShader");var t=i.default;this.textureID="tDiffuse",this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new a.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBFormat,stencilBuffer:!1}),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,e.render(this.scene,this.camera,this.renderTarget,this.clear)}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(23));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),this.edgesRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var r=new Image;r.src=this.getAreaTexture(),this.areaTexture=new a.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=a.RGBFormat,this.areaTexture.minFilter=a.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.needsUpdate=!0,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),this.searchTexture=new a.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=a.NearestFilter,this.searchTexture.minFilter=a.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.needsUpdate=!0,this.searchTexture.flipY=!1,void 0===i.default&&console.error("THREE.SMAAPass relies on THREE.SMAAShader"),this.uniformsEdges=a.UniformsUtils.clone(i.default[0].uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new a.ShaderMaterial({defines:Object.assign({},i.default[0].defines),uniforms:this.uniformsEdges,vertexShader:i.default[0].vertexShader,fragmentShader:i.default[0].fragmentShader}),this.uniformsWeights=a.UniformsUtils.clone(i.default[1].uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new a.ShaderMaterial({defines:Object.assign({},i.default[1].defines),uniforms:this.uniformsWeights,vertexShader:i.default[1].vertexShader,fragmentShader:i.default[1].fragmentShader}),this.uniformsBlend=a.UniformsUtils.clone(i.default[2].uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new a.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:i.default[2].vertexShader,fragmentShader:i.default[2].fragmentShader}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniformsEdges.tDiffuse.value=r.texture,this.quad.material=this.materialEdges,e.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,e.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=r.texture,this.quad.material=this.materialBlend,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xl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BsPT/UfzNxGYzwkP8c+Yz3C+r/i6DcyRL/rZ+utRwWH5PmfvcvYEt9jLDS/bg0/B64DWKrQM8AL8FPwS9beQCe6EMKNZYJol37jBMy35otdaz0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(3)),i=o(r(25));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){if(void 0===i.default)return console.warn("THREE.SSAOPass depends on THREE.SSAOShader"),new n.default;n.default.call(this,i.default),this.width=void 0!==r?r:512,this.height=void 0!==o?o:256,this.renderToScreen=!1,this.camera2=t,this.scene2=e,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.depthRenderTarget=new a.WebGLRenderTarget(this.width,this.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter}),this.uniforms.tDepth.value=this.depthRenderTarget.texture,this.uniforms.size.value.set(this.width,this.height),this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far,this.uniforms.radius.value=4,this.uniforms.onlyAO.value=!1,this.uniforms.aoClamp.value=.25,this.uniforms.lumInfluence.value=.7;Object.defineProperties(this,{radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},onlyAO:{get:function(){return this.uniforms.onlyAO.value},set:function(e){this.uniforms.onlyAO.value=e}},aoClamp:{get:function(){return this.uniforms.aoClamp.value},set:function(e){this.uniforms.aoClamp.value=e}},lumInfluence:{get:function(){return this.uniforms.lumInfluence.value},set:function(e){this.uniforms.lumInfluence.value=e}}})};(s.prototype=Object.create(n.default.prototype)).render=function(e,t,r,a,i){this.scene2.overrideMaterial=this.depthMaterial,e.render(this.scene2,this.camera2,this.depthRenderTarget,!0),this.scene2.overrideMaterial=null,n.default.prototype.render.call(this,e,t,r,a,i)},s.prototype.setScene=function(e){this.scene2=e},s.prototype.setCamera=function(e){this.camera2=e,this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far},s.prototype.setSize=function(e,t){this.width=e,this.height=t,this.uniforms.size.value.set(this.width,this.height),this.depthRenderTarget.setSize(this.width,this.height)},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(24),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t,r){void 0===o.default&&console.error("THREE.TAARenderPass relies on THREE.SSAARenderPass"),o.default.call(this,e,t,r),this.sampleLevel=0,this.accumulate=!1};s.JitterVectors=o.default.JitterVectors,s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a){if(!this.accumulate)return o.default.prototype.render.call(this,e,t,r,a),void(this.accumulateIndex=-1);var i=s.JitterVectors[5];this.sampleRenderTarget||(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),this.holdRenderTarget||(this.holdRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.holdRenderTarget.texture.name="TAARenderPass.hold"),this.accumulate&&-1===this.accumulateIndex&&(o.default.prototype.render.call(this,e,this.holdRenderTarget,r,a),this.accumulateIndex=0);var l=e.autoClear;e.autoClear=!1;var u=1/i.length;if(this.accumulateIndex>=0&&this.accumulateIndex=i.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}var h=this.accumulateIndex*u;h>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.render(this.scene2,this.camera2,t,!0)),h<1&&(this.copyUniforms.opacity.value=1-h,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.render(this.scene2,this.camera2,t,0===h)),e.autoClear=l}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),void 0===i.default&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=i.default;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=a.UniformsUtils.clone(r.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){var i=e.autoClear;e.autoClear=!1,this.quad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),e.autoClear=i}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=s(r(1)),i=s(r(2)),o=s(r(26));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e,t,r,s){n.default.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=s,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);var l={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var u=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new a.WebGLRenderTarget(u,c,l),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var f=0;f\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new a.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),l.BlurDirectionX=new a.Vector2(1,0),l.BlurDirectionY=new a.Vector2(0,1),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaterRefractionShader=t.VignetteShader=t.VerticalTiltShiftShader=t.VerticalBlurShader=t.UnpackDepthRGBAShader=t.TriangleBlurShader=t.ToneMapShader=t.TechnicolorShader=t.SSAOShader=t.SobelOperatorShader=t.SMAAShader=t.SepiaShader=t.SAOShader=t.RGBShiftShader=t.PixelShader=t.ParallaxShader=t.NormalMapShader=t.MirrorShader=t.LuminosityShader=t.LuminosityHighPassShader=t.KaleidoShader=t.HueSaturationShader=t.HorizontalTiltShiftShader=t.HorizontalBlurShader=t.HalftoneShader=t.GammaCorrectionShader=t.FXAAShader=t.FresnelShader=t.FreiChenShader=t.FocusShader=t.FilmShader=t.DotScreenShader=t.DOFMipMapShader=t.DigitalGlitch=t.DepthLimitedBlurShader=t.CopyShader=t.ConvolutionShader=t.ColorifyShader=t.ColorCorrectionShader=t.BrightnessContrastShader=t.BokehShader2=t.BokehShader=t.BlurShaderUtils=t.BlendShader=t.BleachBypassShader=t.BasicShader=void 0;var a=Q(r(113)),n=Q(r(114)),i=Q(r(115)),o=Q(r(22)),s=Q(r(14)),l=Q(r(116)),u=Q(r(117)),c=Q(r(118)),f=Q(r(119)),d=Q(r(13)),h=Q(r(2)),p=Q(r(20)),m=Q(r(17)),v=Q(r(120)),g=Q(r(15)),y=Q(r(16)),b=Q(r(121)),w=Q(r(122)),x=Q(r(123)),_=Q(r(124)),A=Q(r(125)),E=Q(r(18)),S=Q(r(126)),M=Q(r(127)),T=Q(r(128)),P=Q(r(129)),F=Q(r(26)),O=Q(r(11)),L=Q(r(130)),C=Q(r(131)),k=(Q(r(132)),Q(r(133))),R=Q(r(134)),I=Q(r(135)),N=Q(r(19)),D=Q(r(136)),U=Q(r(23)),j=Q(r(137)),B=Q(r(25)),V=Q(r(138)),z=Q(r(12)),G=Q(r(139)),H=Q(r(21)),X=Q(r(140)),Y=Q(r(141)),W=Q(r(142)),q=Q(r(143));function Q(e){return e&&e.__esModule?e:{default:e}}t.BasicShader=a.default,t.BleachBypassShader=n.default,t.BlendShader=i.default,t.BlurShaderUtils=o.default,t.BokehShader=s.default,t.BokehShader2=l.default,t.BrightnessContrastShader=u.default,t.ColorCorrectionShader=c.default,t.ColorifyShader=f.default,t.ConvolutionShader=d.default,t.CopyShader=h.default,t.DepthLimitedBlurShader=p.default,t.DigitalGlitch=m.default,t.DOFMipMapShader=v.default,t.DotScreenShader=g.default,t.FilmShader=y.default,t.FocusShader=b.default,t.FreiChenShader=w.default,t.FresnelShader=x.default,t.FXAAShader=_.default,t.GammaCorrectionShader=A.default,t.HalftoneShader=E.default,t.HorizontalBlurShader=S.default,t.HorizontalTiltShiftShader=M.default,t.HueSaturationShader=T.default,t.KaleidoShader=P.default,t.LuminosityHighPassShader=F.default,t.LuminosityShader=O.default,t.MirrorShader=L.default,t.NormalMapShader=C.default,t.ParallaxShader=k.default,t.PixelShader=R.default,t.RGBShiftShader=I.default,t.SAOShader=N.default,t.SepiaShader=D.default,t.SMAAShader=U.default,t.SobelOperatorShader=j.default,t.SSAOShader=B.default,t.TechnicolorShader=V.default,t.ToneMapShader=z.default,t.TriangleBlurShader=G.default,t.UnpackDepthRGBAShader=H.default,t.VerticalBlurShader=X.default,t.VerticalTiltShiftShader=Y.default,t.VignetteShader=W.default,t.WaterRefractionShader=q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","vec4 texel1 = texture2D( tDiffuse1, vUv );","vec4 texel2 = texture2D( tDiffuse2, vUv );","gl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float penta(vec2 coords) {","//pentagonal shape","float scale = float(rings) - 1.3;","vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","vec4 one = vec4( 1.0 );","vec4 P = vec4((coords),vec2(scale, scale));","vec4 dist = vec4(0.0);","float inorout = -4.0;","dist.x = dot( P, HS0 );","dist.y = dot( P, HS1 );","dist.z = dot( P, HS2 );","dist.w = dot( P, HS3 );","dist = smoothstep( -feather, feather, dist );","inorout += dot( dist, one );","dist.x = dot( P, HS4 );","dist.y = HS5.w - abs( P.z );","dist = smoothstep( -feather, feather, dist );","inorout += dist.x;","return clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","// Depth buffer blur","float d = 0.0;","float kernel[9];","vec2 offset[9];","vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","offset[0] = vec2(-wh.x,-wh.y);","offset[1] = vec2( 0.0, -wh.y);","offset[2] = vec2( wh.x -wh.y);","offset[3] = vec2(-wh.x, 0.0);","offset[4] = vec2( 0.0, 0.0);","offset[5] = vec2( wh.x, 0.0);","offset[6] = vec2(-wh.x, wh.y);","offset[7] = vec2( 0.0, wh.y);","offset[8] = vec2( wh.x, wh.y);","kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","for( int i=0; i<9; i++ ) {","float tmp = getDepth( coords + offset[ i ] );","d += tmp * kernel[i];","}","return d;","}","vec3 color(vec2 coords,float blur) {","//processing the sample","vec3 col = vec3(0.0);","vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","vec3 lumcoeff = vec3(0.299,0.587,0.114);","float lum = dot(col.rgb, lumcoeff);","float thresh = max((lum-threshold)*gain, 0.0);","return col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","float edge = 0.002*depth; //distance based edge smoothing","float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","return col;","}","float linearize(float depth) {","return -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","float dist = distance(vUv.xy, vec2(0.5,0.5));","dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","return clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","float rings2 = float(rings);","float step = PI*2.0 / float(ringsamples);","float pw = cos(j*step)*i;","float ph = sin(j*step)*i;","float p = 1.0;","if (pentagon) {","p = penta(vec2(pw,ph));","}","col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","return 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","//scene depth calculation","float depth = linearize( getDepth( vUv.xy ) );","// Blur depth?","if (depthblur) {","depth = linearize(bdepth(vUv.xy));","}","//focal plane calculation","float fDepth = focalDepth;","if (shaderFocus) {","fDepth = linearize( getDepth( focusCoords ) );","}","// dof blur factor calculation","float blur = 0.0;","if (manualdof) {","float a = depth-fDepth; // Focal plane","float b = (a-fdofstart)/fdofdist; // Far DoF","float c = (-a-ndofstart)/ndofdist; // Near Dof","blur = (a>0.0) ? b : c;","} else {","float f = focalLength; // focal length in mm","float d = fDepth*1000.0; // focal plane in mm","float o = depth*1000.0; // depth in mm","float a = (o*f)/(o-f);","float b = (d*f)/(d-f);","float c = (d-f)/(d*fstop*CoC);","blur = abs(a-b)*c;","}","blur = clamp(blur,0.0,1.0);","// calculation of pattern for dithering","vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","// getting blur x and y step factor","float w = (1.0/textureWidth)*blur*maxblur+noise.x;","float h = (1.0/textureHeight)*blur*maxblur+noise.y;","// calculation of final color","vec3 col = vec3(0.0);","if(blur < 0.05) {","//some optimization thingy","col = texture2D(tColor, vUv.xy).rgb;","} else {","col = texture2D(tColor, vUv.xy).rgb;","float s = 1.0;","int ringsamples;","for (int i = 1; i <= rings; i++) {","/*unboxstart*/","ringsamples = i * samples;","for (int j = 0 ; j < maxringsamples ; j++) {","if (j >= ringsamples) break;","s += gather(float(i), float(j), ringsamples, col, w, h, blur);","}","/*unboxend*/","}","col /= s; //divide by sample count","}","if (showFocus) {","col = debugFocus(col, blur, depth);","}","if (vignetting) {","col *= vignette();","}","gl_FragColor.rgb = col;","gl_FragColor.a = 1.0;","} "].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},powRGB:{value:new a.Vector3(2,2,2)},mulRGB:{value:new a.Vector3(1,1,1)},addRGB:{value:new a.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},color:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},aspect:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","G[0] = g0,","G[1] = g1,","G[2] = g2,","G[3] = g3,","G[4] = g4,","G[5] = g5,","G[6] = g6,","G[7] = g7,","G[8] = g8;","mat3 I;","float cnv[9];","vec3 sample;","for (float i=0.0; i<3.0; i++) {","for (float j=0.0; j<3.0; j++) {","sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","I[int(i)][int(j)] = length(sample);","}","}","for (int i=0; i<9; i++) {","float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","cnv[i] = dp3 * dp3;","}","float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","vec3 I = worldPosition.xyz - cameraPosition;","vReflect = reflect( I, worldNormal );","vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","vec4 refractedColor = vec4( 1.0 );","refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immedates."," // Immedates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","gl_FragColor = LinearToGamma( tex, float( GAMMA_FACTOR ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 p = vUv - 0.5;","float r = length(p);","float a = atan(p.y, p.x) + angle;","float tau = 2. * 3.1416 ;","a = mod(a, tau/sides);","a = abs(a - tau/sides/2.) ;","p = r * vec2(cos(a), sin(a));","vec4 color = texture2D(tDiffuse, p + 0.5);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","vec2 p = vUv;","if (side == 0){","if (p.x > 0.5) p.x = 1.0 - p.x;","}else if (side == 1){","if (p.x < 0.5) p.x = 1.0 - p.x;","}else if (side == 2){","if (p.y < 0.5) p.y = 1.0 - p.y;","}else if (side == 3){","if (p.y > 0.5) p.y = 1.0 - p.y;","} ","vec4 color = texture2D(tDiffuse, p);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{heightMap:{value:null},resolution:{value:new a.Vector2(512,512)},scale:{value:new a.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));a.ShaderLib.ocean_sim_vertex={vertexShader:["varying vec2 vUV;","void main (void) {","vUV = position.xy * 0.5 + 0.5;","gl_Position = vec4(position, 1.0 );","}"].join("\n")},a.ShaderLib.ocean_subtransform={uniforms:{u_input:{value:null},u_transformSize:{value:512},u_subtransformSize:{value:250}},fragmentShader:["precision highp float;","#include ","uniform sampler2D u_input;","uniform float u_transformSize;","uniform float u_subtransformSize;","varying vec2 vUV;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","void main (void) {","#ifdef HORIZONTAL","float index = vUV.x * u_transformSize - 0.5;","#else","float index = vUV.y * u_transformSize - 0.5;","#endif","float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);","#ifdef HORIZONTAL","vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","#else","vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;","#endif","float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);","vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));","vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);","vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);","gl_FragColor = vec4(outputA, outputB);","}"].join("\n")},a.ShaderLib.ocean_initial_spectrum={uniforms:{u_wind:{value:new a.Vector2(10,10)},u_resolution:{value:512},u_size:{value:250}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","const float CM = 0.23;","uniform vec2 u_wind;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + pow2(k / KM)));","}","float tanh (float x) {","return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 K = (2.0 * PI * vec2(n, m)) / u_size;","float k = length(K);","float l_wind = length(u_wind);","float Omega = 0.84;","float kp = G * pow2(Omega / l_wind);","float c = omega(k) / k;","float cp = omega(kp) / kp;","float Lpm = exp(-1.25 * pow2(kp / k));","float gamma = 1.7;","float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));","float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));","float Jp = pow(gamma, Gamma);","float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));","float alphap = 0.006 * sqrt(Omega);","float Bl = 0.5 * alphap * cp / c * Fp;","float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);","float uStar = 0.41 * l_wind / log(10.0 / z0);","float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));","float Fm = exp(-0.25 * pow2(k / KM - 1.0));","float Bh = 0.5 * alpham * CM / c * Fm * Lpm;","float a0 = log(2.0) / 4.0;","float am = 0.13 * uStar / CM;","float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));","float cosPhi = dot(normalize(u_wind), normalize(K));","float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));","float dk = 2.0 * PI / u_size;","float h = sqrt(S / 2.0) * dk;","if (K.x == 0.0 && K.y == 0.0) {","h = 0.0;","}","gl_FragColor = vec4(h, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_phase={uniforms:{u_phases:{value:null},u_deltaTime:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform sampler2D u_phases;","uniform float u_deltaTime;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","float deltaTime = 1.0 / 60.0;","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","float deltaPhase = omega(length(waveVector)) * u_deltaTime;","phase = mod(phase + deltaPhase, 2.0 * PI);","gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_spectrum={uniforms:{u_size:{value:null},u_resolution:{value:null},u_choppiness:{value:null},u_phases:{value:null},u_initialSpectrum:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform float u_size;","uniform float u_resolution;","uniform float u_choppiness;","uniform sampler2D u_phases;","uniform sampler2D u_initialSpectrum;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","vec2 multiplyByI (vec2 z) {","return vec2(-z[1], z[0]);","}","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","vec2 phaseVector = vec2(cos(phase), sin(phase));","vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;","vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;","h0Star.y *= -1.0;","vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));","vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;","vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;","if (waveVector.x == 0.0 && waveVector.y == 0.0) {","h = vec2(0.0);","hX = vec2(0.0);","hZ = vec2(0.0);","}","gl_FragColor = vec4(hX + multiplyByI(h), hZ);","}"].join("\n")},a.ShaderLib.ocean_normals={uniforms:{u_displacementMap:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform float u_resolution;","uniform float u_size;","void main (void) {","float texel = 1.0 / u_resolution;","float texelSize = u_size / u_resolution;","vec3 center = texture2D(u_displacementMap, vUV).rgb;","vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;","vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;","vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;","vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;","vec3 topRight = cross(right, top);","vec3 topLeft = cross(top, left);","vec3 bottomLeft = cross(left, bottom);","vec3 bottomRight = cross(bottom, right);","gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);","}"].join("\n")},a.ShaderLib.ocean_main={uniforms:{u_displacementMap:{value:null},u_normalMap:{value:null},u_geometrySize:{value:null},u_size:{value:null},u_projectionMatrix:{value:null},u_viewMatrix:{value:null},u_cameraPosition:{value:null},u_skyColor:{value:null},u_oceanColor:{value:null},u_sunDirection:{value:null},u_exposure:{value:null}},vertexShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform mat4 u_projectionMatrix;","uniform mat4 u_viewMatrix;","uniform float u_size;","uniform float u_geometrySize;","uniform sampler2D u_displacementMap;","void main (void) {","vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);","vPos = newPos;","vUV = uv;","gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);","}"].join("\n"),fragmentShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform sampler2D u_normalMap;","uniform vec3 u_cameraPosition;","uniform vec3 u_oceanColor;","uniform vec3 u_skyColor;","uniform vec3 u_sunDirection;","uniform float u_exposure;","vec3 hdr (vec3 color, float exposure) {","return 1.0 - exp(-color * exposure);","}","void main (void) {","vec3 normal = texture2D(u_normalMap, vUV).rgb;","vec3 view = normalize(u_cameraPosition - vPos);","float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);","vec3 sky = fresnel * u_skyColor;","float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);","vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;","vec3 color = sky + water;","gl_FragColor = vec4(hdr(color, u_exposure), 1.0);","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","vUv = uv;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vViewPosition = -mvPosition.xyz;","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","vec2 parallaxMap( in vec3 V ) {","float initialHeight = texture2D( bumpMap, vUv ).r;","vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","return vUv - texCoordOffset;","}","#else","vec2 parallaxMap( in vec3 V ) {","float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","float layerHeight = 1.0 / numLayers;","float currentLayerHeight = 0.0;","vec2 dtex = parallaxScale * V.xy / V.z / numLayers;","vec2 currentTextureCoords = vUv;","float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","for ( int i = 0; i < 30; i += 1 ) {","if ( heightFromTexture <= currentLayerHeight ) {","break;","}","currentLayerHeight += layerHeight;","currentTextureCoords -= dtex;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","}","#ifdef USE_STEEP_PARALLAX","return currentTextureCoords;","#elif defined( USE_RELIEF_PARALLAX )","vec2 deltaTexCoord = dtex / 2.0;","float deltaHeight = layerHeight / 2.0;","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","const int numSearches = 5;","for ( int i = 0; i < numSearches; i += 1 ) {","deltaTexCoord /= 2.0;","deltaHeight /= 2.0;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","if( heightFromTexture > currentLayerHeight ) {","currentTextureCoords -= deltaTexCoord;","currentLayerHeight += deltaHeight;","} else {","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","}","}","return currentTextureCoords;","#elif defined( USE_OCLUSION_PARALLAX )","vec2 prevTCoords = currentTextureCoords + dtex;","float nextH = heightFromTexture - currentLayerHeight;","float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","float weight = nextH / ( nextH - prevH );","return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","#else","return vUv;","#endif","}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","vec2 texDx = dFdx( vUv );","vec2 texDy = dFdy( vUv );","vec3 vSigmaX = dFdx( surfPosition );","vec3 vSigmaY = dFdy( surfPosition );","vec3 vR1 = cross( vSigmaY, surfNormal );","vec3 vR2 = cross( surfNormal, vSigmaX );","float fDet = dot( vSigmaX, vR1 );","vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","vec3 vProjVtex;","vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","vProjVtex.z = dot( surfNormal, viewPosition );","return parallaxMap( vProjVtex );","}","void main() {","vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","gl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, vUv + offset);","vec4 cga = texture2D(tDiffuse, vUv);","vec4 cb = texture2D(tDiffuse, vUv - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","gl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","gl_FragColor = newTex;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{texture:{value:null},delta:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = rand( vUv );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{color:{type:"c",value:null},time:{type:"f",value:0},tDiffuse:{type:"t",value:null},tDudv:{type:"t",value:null},textureMatrix:{type:"m4",value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Volume=void 0;var a,n=r(10),i=(a=n)&&a.__esModule?a:{default:a};t.Volume=i.default}]))},function(e,t,r){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,a,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,a)}));case 4:return t.nextTick((function(){e.call(null,r,a,n)}));default:for(i=new Array(s-1),o=0;o>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return n>0&&(e.lastNeed=n-1),n;if(--a=0)return n>0&&(e.lastNeed=n-2),n;if(--a=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var a=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,a),e.toString("utf8",t,a)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";(function(t){var a=r(117); /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */function n(e,t){if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);n=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(e[s],t[s],r,a))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function x(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,a){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(a=r,r=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),a=(r&&r.name?" ("+r.name+").":".")+(a?" "+a:"."),e&&!n&&g(n,r,"Missing expected exception"+a);var i="string"==typeof a,s=!e&&n&&!r;if((!e&&o.isError(n)&&i&&x(n,r)||s)&&g(n,r,"Got unwanted exception"+a),e&&n&&r&&!x(n,r)||!e&&n)throw n}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(v(e.actual),128)+" "+e.operator+" "+m(v(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var a=r.stack,n=p(t),i=a.indexOf("\n"+n);if(i>=0){var o=a.indexOf("\n",i+1);a=a.substring(o+1)}this.stack=a}}},o.inherits(d.AssertionError,Error),d.fail=g,d.ok=y,d.equal=function(e,t,r){e!=t&&g(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){b(e,t,!1)||g(e,t,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,r){b(e,t,!0)||g(e,t,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,r){b(e,t,!1)&&g(e,t,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,r,a){b(t,r,!0)&&g(t,r,a,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",d.notStrictEqual)},d.throws=function(e,t,r){_(!0,e,t,r)},d.doesNotThrow=function(e,t,r){_(!1,e,t,r)},d.ifError=function(e){if(e)throw e},d.strict=a((function e(t,r){t||g(t,!0,r,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var A=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.defineProperty(t,"CopyShader",{enumerable:!0,get:function(){return h(a).default}});var n=r(8);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return h(n).default}});var i=r(44);Object.defineProperty(t,"ShaderPass",{enumerable:!0,get:function(){return h(i).default}});var o=r(87);Object.defineProperty(t,"RenderingPass",{enumerable:!0,get:function(){return h(o).default}});var s=r(88);Object.defineProperty(t,"TexturePass",{enumerable:!0,get:function(){return h(s).default}});var l=r(89);Object.defineProperty(t,"RenderPass",{enumerable:!0,get:function(){return h(l).default}});var u=r(45);Object.defineProperty(t,"MaskPass",{enumerable:!0,get:function(){return h(u).default}});var c=r(46);Object.defineProperty(t,"ClearMaskPass",{enumerable:!0,get:function(){return h(c).default}});var f=r(90);Object.defineProperty(t,"ClearPass",{enumerable:!0,get:function(){return h(f).default}});var d=r(91);function h(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h(d).default}})},function(e,t,r){var a,n,i,o,s;a=r(177),n=r(75).utf8,i=r(178),o=r(75).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):n.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var r=a.bytesToWords(e),l=8*e.length,u=1732584193,c=-271733879,f=-1732584194,d=271733878,h=0;h>>24)|4278255360&(r[h]<<24|r[h]>>>8);r[l>>>5]|=128<>>9<<4)]=l;var p=s._ff,m=s._gg,v=s._hh,g=s._ii;for(h=0;h>>0,c=c+b>>>0,f=f+w>>>0,d=d+x>>>0}return a.endian([u,c,f,d])})._ff=function(e,t,r,a,n,i,o){var s=e+(t&r|~t&a)+(n>>>0)+o;return(s<>>32-i)+t},s._gg=function(e,t,r,a,n,i,o){var s=e+(t&a|r&~a)+(n>>>0)+o;return(s<>>32-i)+t},s._hh=function(e,t,r,a,n,i,o){var s=e+(t^r^a)+(n>>>0)+o;return(s<>>32-i)+t},s._ii=function(e,t,r,a,n,i,o){var s=e+(r^(t|~a))+(n>>>0)+o;return(s<>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=a.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?o.bytesToString(r):a.bytesToHex(r)}},function(e,t,r){function a(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var a=r(r.s=ENTRY_MODULE);return a.default||a}var n="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+n+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e,t,a){var s={};s[a]=[];var l=t.toString(),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return s;for(var c,f=u[1],d=new RegExp("(\\\\n|\\W)"+o(f)+i,"g");c=d.exec(l);)"dll-reference"!==c[3]&&s[a].push(c[3]);for(d=new RegExp("\\("+o(f)+'\\("(dll-reference\\s('+n+'))"\\)\\)'+i,"g");c=d.exec(l);)e[c[2]]||(s[a].push(c[1]),e[c[2]]=r(c[1]).m),s[c[2]]=s[c[2]]||[],s[c[2]].push(c[4]);for(var h,p=Object.keys(s),m=0;m0}),!1)}e.exports=function(e,t){t=t||{};var n={main:r.m},i=t.all?{main:Object.keys(n.main)}:function(e,t){for(var r={main:[t]},a={main:[]},n={main:{}};l(r);)for(var i=Object.keys(r),o=0;o-1?a:i.nextTick;y.WritableState=g;var u=r(18);u.inherits=r(6);var c={deprecate:r(56)},f=r(54),d=r(22).Buffer,h=n.Uint8Array||function(){};var p,m=r(55);function v(){}function g(e,t){s=s||r(11),e=e||{};var a=t instanceof s;this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:a&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,a=r.sync,n=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,a,n){--t.pendingcb,r?(i.nextTick(n,a),i.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",a)):(n(a),e._writableState.errorEmitted=!0,e.emit("error",a),E(e,t))}(e,r,a,t,n);else{var o=_(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),a?l(w,e,r,o,n):w(e,r,o,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(s=s||r(11),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,r,a,n,i,o){t.writelen=a,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,i,t.onwrite),t.sync=!1}function w(e,t,r,a){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,a(),E(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var a=t.bufferedRequestCount,n=new Array(a),i=t.corkedRequestsFree;i.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,b(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),E(e,t)}))}function E(e,t){var r=_(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(A,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(y,f),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var a,n=this._writableState,o=!1,s=!n.objectMode&&(a=e,d.isBuffer(a)||a instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}(this,r):(s||function(e,t,r,a){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),i.nextTick(a,o),n=!1),n}(this,n,e,r))&&(n.pendingcb++,o=function(e,t,r,a,n,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,a,n);a!==o&&(r=!0,n="buffer",a=o)}var s=t.objectMode?1:a.length;t.length+=s;var l=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var a=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||a.finished||function(e,t,r){t.ending=!0,E(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,a,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(5),r(106).setImmediate,r(4))},function(e,t,r){"use strict";var a=r(125),n=r(35),i=r(13),o=r(59),s=r(127);function l(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof o)return p(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var n,i,s,c=u.call(this,t,r);return c&&(n=c.schema,t=c.root,s=c.baseId),n instanceof o?i=n.validate||e.call(this,n.schema,t,void 0,s):void 0!==n&&(i=p(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,s)),i}function u(e,t){var r=a.parse(t),n=v(r),i=m(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==i){var s=y(n),l=this._refs[s];if("string"==typeof l)return c.call(this,e,l,r);if(l instanceof o)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[s])instanceof o))return;if(l.validate||this._compile(l),s==y(t))return{schema:l,root:e,baseId:i};e=l}if(!e.schema)return;i=m(this._getId(e.schema))}return d.call(this,r,i,e.schema,e)}function c(e,t,r){var a=u.call(this,e,t);if(a){var n=a.schema,i=a.baseId;e=a.root;var o=this._getId(n);return o&&(i=b(i,o)),d.call(this,r,i,n,e)}}e.exports=l,l.normalizeId=y,l.fullPath=m,l.url=b,l.ids=function(e){var t=y(this._getId(e)),r={"":t},o={"":m(t,!1)},l={},u=this;return s(e,{allKeys:!0},(function(e,t,s,c,f,d,h){if(""!==t){var p=u._getId(e),m=r[c],v=o[c]+"/"+f;if(void 0!==h&&(v+="/"+("number"==typeof h?h:i.escapeFragment(h))),"string"==typeof p){p=m=y(m?a.resolve(m,p):p);var g=u._refs[p];if("string"==typeof g&&(g=u._refs[g]),g&&g.schema){if(!n(e,g.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=y(v))if("#"==p[0]){if(l[p]&&!n(e,l[p]))throw new Error('id "'+p+'" resolves to more than one schema');l[p]=e}else u._refs[p]=v}r[t]=m,o[t]=v}})),l},l.inlineRef=p,l.schema=u;var f=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var n=e.fragment.split("/"),o=1;o{if(e.file){let r=new FileReader;r.onload=function(){let e=this.result,r=new Uint8Array(e);t(r)},r.readAsArrayBuffer(e.file)}else if(e.url){let r=new XMLHttpRequest;r.open("GET",e.url,!0),r.responseType="arraybuffer",r.onloadend=function(){if(200===r.status){let e=new Uint8Array(r.response||r.responseText);t(e)}},r.send()}else e.raw?e.raw instanceof Uint8Array?t(e.raw):t(new Uint8Array(e.raw)):r()})}function o(e,t){return new Promise((r,a)=>{if("compound"===e.type)if(e.value.hasOwnProperty("blocks")&&(e.value.hasOwnProperty("palette")||e.value.hasOwnProperty("palettes"))){let a;if(e.value.hasOwnProperty("palette"))a=e.value.palette.value.value;else{if(void 0===t&&(t=0),t>=e.value.palettes.value.value.length||!e.value.palettes.value.value[t])return void console.warn("Specified palette index ("+t+") is outside of available palettes ("+e.value.palettes.value.value.length+")");a=e.value.palettes.value.value[t].value}let n=[];for(let e=0;e{let n=e.value.Width.value,i=e.value.Height.value,o=e.value.Length.value,s=function(t,r,a){let i=(r*o+a)*n+t;return{id:255&(e.value.Blocks.value[i]||0),data:e.value.Data.value[i]||0}},l=function(e,r){let a=t.blocks[e+":"+r];return a||(console.warn("Missing legacy mapping for "+e+":"+r),"minecraft:air")},u=[];for(let e=0;e{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);o(r).then(e=>{t(e)})})})},n.prototype.schematicToModels=function(e,t){i(e).then(e=>{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);let a=new XMLHttpRequest;a.open("GET","https://minerender.org/res/idsToNames.json",!0),a.onloadend=function(){if(200===a.status){console.log(a.response||a.responseText);let e=JSON.parse(a.response||a.responseText);s(r,e).then(e=>t(e))}},a.send()})})},n.loadNBT=i,n.parseStructureData=o,n.parseSchematicData=s;let l={stained_glass:function(e){return e.color.value+"_stained_glass"},planks:function(e){return e.variant.value+"_planks"}};n.prototype.constructor=n,window.ModelConverter=n,t.a=n},function(e,t,r){const a=r(99),n=r(116).ProtoDef,i=r(175).compound,o=JSON.stringify(r(176)),s=o.replace(/(i[0-9]+)/g,"l$1");function l(e){const t=new n;return t.addType("compound",i),t.addTypes(JSON.parse(e?s:o)),t}const u=l(!1),c=l(!0);function f(e,t){return(t?c:u).parsePacketBuffer("nbt",e).data}const d=function(e){let t=!0;return 31!==e[0]&&(t=!1),139!==e[1]&&(t=!1),t};e.exports={writeUncompressed:function(e,t){return(t?c:u).createPacketBuffer("nbt",e)},parseUncompressed:f,simplify:function e(t){return function t(r,a){return"compound"===a?Object.keys(r).reduce((function(t,a){return t[a]=e(r[a]),t}),{}):"list"===a?r.value.map((function(e){return t(e,r.type)})):r}(t.value,t.type)},parse:function(e,t,r){let n=!1;"function"==typeof t?r=t:n=t,d(e)?a.gunzip(e,(function(t,a){t?r(t,e):r(null,f(a,n))})):r(null,f(e,n))},proto:u,protoLE:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(){function e(e,t){for(var r=0;r4?9:0)}function $(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ae(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ne(e,t){var r,a,n=e.max_chain_length,i=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-D?e.strstart-(e.w_size-D):0,u=e.window,c=e.w_mask,f=e.prev,d=e.strstart+N,h=u[i+o-1],p=u[i+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===h&&u[r]===u[i]&&u[++r]===u[i+1]){i+=2,r++;do{}while(u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&io){if(e.match_start=t,o=a,a>=s)break;h=u[i+o-1],p=u[i+o]}}}while((t=f[t&c])>l&&0!=--n);return o<=e.lookahead?o:e.lookahead}function ie(e){var t,r,a,i,l,u,c,f,d,h,p=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-D)){n.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;do{a=e.head[--t],e.head[t]=a>=p?a-p:0}while(--r);t=r=p;do{a=e.prev[--t],e.prev[t]=a>=p?a-p:0}while(--r);i+=p}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,f=e.strstart+e.lookahead,d=i,h=void 0,(h=u.avail_in)>d&&(h=d),r=0===h?0:(u.avail_in-=h,n.arraySet(c,u.input,u.next_in,h,f),1===u.state.wrap?u.adler=o(u.adler,c,h,f):2===u.state.wrap&&(u.adler=s(u.adler,c,h,f)),u.next_in+=h,u.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=I)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I)if(a=i._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-I,a=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<15&&(s=2,a-=16),i<1||i>T||r!==M||a<8||a>15||t<0||t>9||o<0||o>A)return K(e,v);8===a&&(a=9);var l=new ue;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=a,l.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ie(e),0===e.lookahead&&t===u)return Y;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+r;if((0===e.strstart||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,te(e,!1),0===e.strm.avail_out))return Y;if(e.strstart-e.block_start>=e.w_size-D&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),Y)})),new le(4,4,8,4,oe),new le(4,5,16,8,oe),new le(4,6,32,32,oe),new le(4,4,16,16,se),new le(8,16,32,32,se),new le(8,16,128,128,se),new le(8,32,128,256,se),new le(32,128,258,1024,se),new le(32,258,258,4096,se)],t.deflateInit=function(e,t){return de(e,t,M,P,F,E)},t.deflateInit2=de,t.deflateReset=fe,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?v:(e.state.gzhead=t,p):v},t.deflate=function(e,t){var r,n,o,l;if(!e||!e.state||t>h||t<0)return e?K(e,v):v;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===X&&t!==d)return K(e,0===e.avail_out?y:v);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===j)if(2===n.wrap)e.adler=0,re(n,31),re(n,139),re(n,8),n.gzhead?(re(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),re(n,255&n.gzhead.time),re(n,n.gzhead.time>>8&255),re(n,n.gzhead.time>>16&255),re(n,n.gzhead.time>>24&255),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(re(n,255&n.gzhead.extra.length),re(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=s(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=B):(re(n,0),re(n,0),re(n,0),re(n,0),re(n,0),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,Z),n.status=H);else{var g=M+(n.w_bits-8<<4)<<8;g|=(n.strategy>=x||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(g|=U),g+=31-g%31,n.status=H,ae(n,g),0!==n.strstart&&(ae(n,e.adler>>>16),ae(n,65535&e.adler)),e.adler=1}if(n.status===B)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending!==n.pending_buf_size));)re(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=V)}else n.status=V;if(n.status===V)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=z)}else n.status=z;if(n.status===z)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=G)}else n.status=G;if(n.status===G&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ee(e),n.pending+2<=n.pending_buf_size&&(re(n,255&e.adler),re(n,e.adler>>8&255),e.adler=0,n.status=H)):n.status=H),0!==n.pending){if(ee(e),0===e.avail_out)return n.last_flush=-1,p}else if(0===e.avail_in&&J(t)<=J(r)&&t!==d)return K(e,y);if(n.status===X&&0!==e.avail_in)return K(e,y);if(0!==e.avail_in||0!==n.lookahead||t!==u&&n.status!==X){var b=n.strategy===x?function(e,t){for(var r;;){if(0===e.lookahead&&(ie(e),0===e.lookahead)){if(t===u)return Y;break}if(e.match_length=0,r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):n.strategy===_?function(e,t){for(var r,a,n,o,s=e.window;;){if(e.lookahead<=N){if(ie(e),e.lookahead<=N&&t===u)return Y;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(a=s[n=e.strstart-1])===s[++n]&&a===s[++n]&&a===s[++n]){o=e.strstart+N;do{}while(a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&ne.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=i._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):a[n.level].func(n,t);if(b!==q&&b!==Q||(n.status=X),b===Y||b===q)return 0===e.avail_out&&(n.last_flush=-1),p;if(b===W&&(t===c?i._tr_align(n):t!==h&&(i._tr_stored_block(n,0,0,!1),t===f&&($(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),ee(e),0===e.avail_out))return n.last_flush=-1,p}return t!==d?p:n.wrap<=0?m:(2===n.wrap?(re(n,255&e.adler),re(n,e.adler>>8&255),re(n,e.adler>>16&255),re(n,e.adler>>24&255),re(n,255&e.total_in),re(n,e.total_in>>8&255),re(n,e.total_in>>16&255),re(n,e.total_in>>24&255)):(ae(n,e.adler>>>16),ae(n,65535&e.adler)),ee(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?p:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==j&&t!==B&&t!==V&&t!==z&&t!==G&&t!==H&&t!==X?K(e,v):(e.state=null,t===H?K(e,g):p):v},t.deflateSetDictionary=function(e,t){var r,a,i,s,l,u,c,f,d=t.length;if(!e||!e.state)return v;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==j||r.lookahead)return v;for(1===s&&(e.adler=o(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&($(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new n.Buf8(r.w_size),n.arraySet(f,t,d-r.w_size,r.w_size,0),t=f,d=r.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,ie(r);r.lookahead>=I;){a=r.strstart,i=r.lookahead-(I-1);do{r.ins_h=(r.ins_h<>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{i=i+(n=n+t[a++]|0)|0}while(--o);n%=65521,i%=65521}return n|i<<16|0}},function(e,t,r){"use strict";var a=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,n){var i=a,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}},function(e,t,r){"use strict";var a=r(9),n=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var o=new a.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&i||!e.subarray&&n))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var r="",o=0;o>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new a.Buf8(e.length),r=0,n=t.length;r4)u[a++]=65533,r+=i-1;else{for(n&=2===i?31:3===i?15:7;i>1&&r1?u[a++]=65533:n<65536?u[a++]=n:(n-=65536,u[a++]=55296|n>>10&1023,u[a++]=56320|1023&n)}return l(u,a)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+o[e[r]]>t?r:t}},function(e,t,r){"use strict";var a=r(9),n=r(48),i=r(49),o=r(96),s=r(97),l=0,u=1,c=2,f=4,d=5,h=6,p=0,m=1,v=2,g=-2,y=-3,b=-4,w=-5,x=8,_=1,A=2,E=3,S=4,M=5,T=6,P=7,F=8,O=9,L=10,C=11,R=12,k=13,I=14,N=15,D=16,U=17,j=18,B=19,V=20,z=21,G=22,H=23,X=24,Y=25,W=26,q=27,Q=28,Z=29,K=30,J=31,$=32,ee=852,te=592,re=15;function ae(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ne(){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 a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(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=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new a.Buf32(ee),t.distcode=t.distdyn=new a.Buf32(te),t.sane=1,t.back=-1,p):g}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):g}function se(e,t){var r,a;return e&&e.state?(a=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?g:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=r,a.wbits=t,oe(e))):g}function le(e,t){var r,a;return e?(a=new ne,e.state=a,a.window=null,(r=se(e,t))!==p&&(e.state=null),r):g}var ue,ce,fe=!0;function de(e){if(fe){var t;for(ue=new a.Buf32(512),ce=new a.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,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,ce,0,e.work,{bits:5}),fe=!1}e.lencode=ue,e.lenbits=9,e.distcode=ce,e.distbits=5}function he(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(a.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),a.arraySet(o.window,t,r-n,i,o.wnext),(n-=i)?(a.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=i(r.check,Te,2,0),se=0,le=0,r.mode=A;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=K;break}if((15&se)!==x){e.msg="unknown compression method",r.mode=K;break}if(le-=4,_e=8+(15&(se>>>=4)),0===r.wbits)r.wbits=_e;else if(_e>r.wbits){e.msg="invalid window size",r.mode=K;break}r.dmax=1<<_e,e.adler=r.check=1,r.mode=512&se?L:R,se=0,le=0;break;case A:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8&1),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=E;case E:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,Te[2]=se>>>16&255,Te[3]=se>>>24&255,r.check=i(r.check,Te,4,0)),se=0,le=0,r.mode=S;case S:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=M;case M:if(1024&r.flags){for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0}else r.head&&(r.head.extra=null);r.mode=T;case T:if(1024&r.flags&&((fe=r.length)>ie&&(fe=ie),fe&&(r.head&&(_e=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),a.arraySet(r.head.extra,ee,re,fe,_e)),512&r.flags&&(r.check=i(r.check,ee,fe,re)),ie-=fe,re+=fe,r.length-=fe),r.length))break e;r.length=0,r.mode=P;case P:if(2048&r.flags){if(0===ie)break e;fe=0;do{_e=ee[re+fe++],r.head&&_e&&r.length<65536&&(r.head.name+=String.fromCharCode(_e))}while(_e&&fe>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=R;break;case L:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>=7&le,le-=7&le,r.mode=q;break}for(;le<3;){if(0===ie)break e;ie--,se+=ee[re++]<>>=1)){case 0:r.mode=I;break;case 1:if(de(r),r.mode=V,t===h){se>>>=2,le-=2;break e}break;case 2:r.mode=U;break;case 3:e.msg="invalid block type",r.mode=K}se>>>=2,le-=2;break;case I:for(se>>>=7&le,le-=7≤le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=K;break}if(r.length=65535&se,se=0,le=0,r.mode=N,t===h)break e;case N:r.mode=D;case D:if(fe=r.length){if(fe>ie&&(fe=ie),fe>oe&&(fe=oe),0===fe)break e;a.arraySet(te,ee,re,fe,ne),ie-=fe,re+=fe,oe-=fe,ne+=fe,r.length-=fe;break}r.mode=R;break;case U:for(;le<14;){if(0===ie)break e;ie--,se+=ee[re++]<>>=5,le-=5,r.ndist=1+(31&se),se>>>=5,le-=5,r.ncode=4+(15&se),se>>>=4,le-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=K;break}r.have=0,r.mode=j;case j:for(;r.have>>=3,le-=3}for(;r.have<19;)r.lens[Pe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},Ae=s(l,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid code lengths set",r.mode=K;break}r.have=0,r.mode=B;case B:for(;r.have>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=ve,le-=ve,r.lens[r.have++]=ye;else{if(16===ye){for(Se=ve+2;le>>=ve,le-=ve,0===r.have){e.msg="invalid bit length repeat",r.mode=K;break}_e=r.lens[r.have-1],fe=3+(3&se),se>>>=2,le-=2}else if(17===ye){for(Se=ve+3;le>>=ve)),se>>>=3,le-=3}else{for(Se=ve+7;le>>=ve)),se>>>=7,le-=7}if(r.have+fe>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=K;break}for(;fe--;)r.lens[r.have++]=_e}}if(r.mode===K)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=K;break}if(r.lenbits=9,Ee={bits:r.lenbits},Ae=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid literal/lengths set",r.mode=K;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},Ae=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,Ae){e.msg="invalid distances set",r.mode=K;break}if(r.mode=V,t===h)break e;case V:r.mode=z;case z:if(ie>=6&&oe>=258){e.next_out=ne,e.avail_out=oe,e.next_in=re,e.avail_in=ie,r.hold=se,r.bits=le,o(e,ce),ne=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,ie=e.avail_in,se=r.hold,le=r.bits,r.mode===R&&(r.back=-1);break}for(r.back=0;ge=(Me=r.lencode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,r.length=ye,0===ge){r.mode=W;break}if(32&ge){r.back=-1,r.mode=R;break}if(64&ge){e.msg="invalid literal/length code",r.mode=K;break}r.extra=15&ge,r.mode=G;case G:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=H;case H:for(;ge=(Me=r.distcode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,64&ge){e.msg="invalid distance code",r.mode=K;break}r.offset=ye,r.extra=15&ge,r.mode=X;case X:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=K;break}r.mode=Y;case Y:if(0===oe)break e;if(fe=ce-oe,r.offset>fe){if((fe=r.offset-fe)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=K;break}fe>r.wnext?(fe-=r.wnext,pe=r.wsize-fe):pe=r.wnext-fe,fe>r.length&&(fe=r.length),me=r.window}else me=te,pe=ne-r.offset,fe=r.length;fe>oe&&(fe=oe),oe-=fe,r.length-=fe;do{te[ne++]=me[pe++]}while(--fe);0===r.length&&(r.mode=z);break;case W:if(0===oe)break e;te[ne++]=r.length,oe--,r.mode=z;break;case q:if(r.wrap){for(;le<32;){if(0===ie)break e;ie--,se|=ee[re++]<0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),a?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?x(e,o,t,!1):M(e,o)):x(e,o,t,!1))):a||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),O(e)}function M(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var a;ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++a}return t.length-=a,n}(e,t):function(e,t){var r=u.allocUnsafe(e),a=t.head,n=1;a.data.copy(r),e-=a.data.length;for(;a=a.next;){var i=a.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++n,a.next?t.head=a.next:t.head=t.tail=null):(t.head=a,a.data=i.slice(o));break}++n}return t.length-=n,r}(e,t);return a}(e,t.buffer,t.decoder),r);var r}function C(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function k(e,t){for(var r=0,a=e.length;r=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):E(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&C(this),null;var a,n=t.needReadable;return h("need readable",n),(0===t.length||t.length-e0?L(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&C(this)),null!==a&&this.emit("data",a),a},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var l=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?c:b;function u(t,a){h("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",v),e.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",b),r.removeListener("data",m),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){h("onend"),e.end()}i.endEmitted?n.nextTick(l):r.once("end",l),e.on("unpipe",u);var f=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",f);var d=!1;var p=!1;function m(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==k(i.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(t){h("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){h("onfinish"),e.removeListener("close",g),b()}function b(){h("unpipe"),r.unpipe(e)}return r.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i=i)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(e){return"[Circular]"}default:return e}})),l=a[r];r=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),p(r)?a.showHidden=r:r&&t._extend(a,r),y(a.showHidden)&&(a.showHidden=!1),y(a.depth)&&(a.depth=2),y(a.colors)&&(a.colors=!1),y(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=l),c(a,e,a.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function c(e,r,a){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(a,e);return g(n)||(n=c(e,n,a)),n}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(A(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return f(r)}var u,w="",E=!1,S=["{","}"];(h(r)&&(E=!0,S=["[","]"]),A(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),x(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+f(r)),0!==o.length||E&&0!=r.length?a<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=E?function(e,t,r,a,n){for(var i=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,w,S)):S[0]+w+S[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,a,n,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),P(a,n)||(o="["+n+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(i&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===E(e)}function _(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function A(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(y(i)&&(i=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var a=e.pid;o[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,a,e)}}else o[r]=function(){};return o[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=b,t.isObject=w,t.isDate=x,t.isError=_,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(115);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(6),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),a=r.length;a--;)e[r[a]]=t[r[a]];return e};var F="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(F&&e[F]){var t;if("function"!=typeof(t=e[F]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,F,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,a=new Promise((function(e,a){t=e,r=a})),n=[],i=0;i",y=h?">":"<",b=void 0;if(v){var w=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+i,_="exclType"+i,A="exclIsNumber"+i,E="' + "+(T="op"+i)+" + '";n+=" var schemaExcl"+i+" = "+w+"; ",n+=" var "+x+"; var "+_+" = typeof "+(w="schemaExcl"+i)+"; if ("+_+" != 'boolean' && "+_+" != 'undefined' && "+_+" != 'number') { ";var S;b=p;(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var M=n;n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+_+" == 'number' ? ( ("+x+" = "+a+" === undefined || "+w+" "+g+"= "+a+") ? "+f+" "+y+"= "+w+" : "+f+" "+y+" "+a+" ) : ( ("+x+" = "+w+" === true) ? "+f+" "+y+"= "+a+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { var op"+i+" = "+x+" ? '"+g+"' : '"+g+"='; ",void 0===s&&(b=p,u=e.errSchemaPath+"/"+p,a=w,d=v)}else{E=g;if((A="number"==typeof m)&&d){var T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" ( "+a+" === undefined || "+m+" "+g+"= "+a+" ? "+f+" "+y+"= "+m+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { "}else{A&&void 0===s?(x=!0,b=p,u=e.errSchemaPath+"/"+p,a=m,y+="="):(A&&(a=Math[h?"min":"max"](m,s)),m===(!A||a)?(x=!0,b=p,u=e.errSchemaPath+"/"+p,y+="="):(x=!1,E+="="));T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+" "+y+" "+a+" || "+f+" !== "+f+") { "}}b=b||t,(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+T+", limit: "+a+", exclusive: "+x+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+E+" ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";M=n;return n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+".length "+("maxItems"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s;var h="maxLength"==t?">":"<";n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?n+=" "+f+".length ":n+=" ucs2length("+f+") ",n+=" "+h+" "+a+") { ";var p=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" Object.keys("+f+").length "+("maxProperties"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},function(e){e.exports=JSON.parse('{"switch":{"title":"switch","type":"array","items":[{"enum":["switch"]},{"type":"object","properties":{"compareTo":{"$ref":"definitions#/definitions/contextualizedFieldName"},"compareToValue":{"type":"string"},"fields":{"type":"object","patternProperties":{"^[-a-zA-Z0-9 _:]+$":{"$ref":"dataType"}},"additionalProperties":false},"default":{"$ref":"dataType"}},"oneOf":[{"required":["compareTo","fields"]},{"required":["compareToValue","fields"]}],"additionalProperties":false}],"additionalItems":false},"option":{"title":"option","type":"array","items":[{"enum":["option"]},{"$ref":"dataType"}],"additionalItems":false}}')},function(e,t,r){"use strict";(function(t,a){var n;e.exports=S,S.ReadableState=E;r(17).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(69),s=r(7).Buffer,l=t.Uint8Array||function(){};var u,c=r(168);u=c&&c.debuglog?c.debuglog("stream"):function(){};var f,d,h,p=r(169),m=r(70),v=r(71).getHighWaterMark,g=r(14).codes,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,x=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6)(S,o);var _=m.errorOrDestroy,A=["error","close","destroy","pause","resume"];function E(e,t,a){n=n||r(15),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",a),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(23).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(15),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function M(e,t,r,a,n){u("readableAddChunk",t);var i,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}(e,o);else if(n||(i=function(e,t){var r;a=t,s.isBuffer(a)||a instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var a;return r}(o,t)),i)_(e,i);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),a)o.endEmitted?_(e,new x):T(e,o,t,!0);else if(o.ended)_(e,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):C(e,o)):T(e,o,t,!1)}else a||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,a.nextTick(L,e))}function L(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function C(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){u("readable nexttick read 0"),e.read(0)}function N(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,a.nextTick(B,t,e))}function B(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function V(e,t){for(var r=0,a=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=F(e,t))&&t.ended)return 0===t.length&&j(this),null;var a,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==a&&this.emit("data",a),a},S.prototype._read=function(e){_(this,new w("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?l:v;function s(t,a){u("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",v),r.removeListener("data",d),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){u("onend"),e.end()}n.endEmitted?a.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var f=!1;function d(t){u("ondata");var a=e.write(t);u("dest.write",a),!1===a&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!f&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){u("onerror",t),v(),e.removeListener("error",h),0===i(e,"error")&&_(e,t)}function p(){e.removeListener("finish",m),v()}function m(){u("onfinish"),e.removeListener("close",p),v()}function v(){u("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",m),e.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?O(this):n.reading||a.nextTick(I,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&a.nextTick(k,this),r},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||a.nextTick(k,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(N,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(a=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,L(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=f.destroy,S.prototype._undestroy=f.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this,r(4),r(5))},function(e,t,r){"use strict";e.exports=c;var a=r(14).codes,n=a.ERR_METHOD_NOT_IMPLEMENTED,i=a.ERR_MULTIPLE_CALLBACK,o=a.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=a.ERR_TRANSFORM_WITH_LENGTH_0,l=r(15);function u(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(null===a)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),a(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{i=!0,o.needsUpdate=!0,u&&(u.needsUpdate=!0);let c=-1;32===o.image.height?c=0:64===o.image.height?c=1:console.error("Couldn't detect texture version. Invalid dimensions: "+o.image.width+"x"+o.image.height),console.log("Skin Texture Version: "+c),o.magFilter=t.NearestFilter,o.minFilter=t.NearestFilter,o.anisotropy=0,u&&(u.magFilter=t.NearestFilter,u.minFilter=t.NearestFilter,u.anisotropy=0,u.format=t.RGBFormat),32===o.image.height&&(o.format=t.RGBFormat),n.attached||n._scene?console.log("[SkinRender] is attached - skipping scene init"):super.initScene((function(){n.element.dispatchEvent(new CustomEvent("skinRender",{detail:{playerModel:n.playerModel}}))})),console.log("Slim: "+f);let d=function(e,r,n,i,o){console.log("capeType: "+o);let u=new t.Object3D;u.name="headGroup",u.position.x=0,u.position.y=28,u.position.z=0,u.translateOnAxis(new t.Vector3(0,1,0),-4);let c=s(e,8,8,8,a.a.head[n],i,"head");if(c.translateOnAxis(new t.Vector3(0,1,0),4),u.add(c),n>=1){let r=s(e,8.504,8.504,8.504,a.a.hat,i,"hat",!0);r.translateOnAxis(new t.Vector3(0,1,0),4),u.add(r)}let f=new t.Object3D;f.name="bodyGroup",f.position.x=0,f.position.y=18,f.position.z=0;let d=s(e,8,12,4,a.a.body[n],i,"body");if(f.add(d),n>=1){let t=s(e,8.504,12.504,4.504,a.a.jacket,i,"jacket",!0);f.add(t)}let h=new t.Object3D;h.name="leftArmGroup",h.position.x=i?-5.5:-6,h.position.y=18,h.position.z=0,h.translateOnAxis(new t.Vector3(0,1,0),4);let p=s(e,i?3:4,12,4,a.a.leftArm[n],i,"leftArm");if(p.translateOnAxis(new t.Vector3(0,1,0),-4),h.add(p),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.leftSleeve,i,"leftSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),h.add(r)}let m=new t.Object3D;m.name="rightArmGroup",m.position.x=i?5.5:6,m.position.y=18,m.position.z=0,m.translateOnAxis(new t.Vector3(0,1,0),4);let v=s(e,i?3:4,12,4,a.a.rightArm[n],i,"rightArm");if(v.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(v),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.rightSleeve,i,"rightSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(r)}let g=new t.Object3D;g.name="leftLegGroup",g.position.x=-2,g.position.y=6,g.position.z=0,g.translateOnAxis(new t.Vector3(0,1,0),4);let y=s(e,4,12,4,a.a.leftLeg[n],i,"leftLeg");if(y.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(y),n>=1){let r=s(e,4.504,12.504,4.504,a.a.leftTrousers,i,"leftTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(r)}let b=new t.Object3D;b.name="rightLegGroup",b.position.x=2,b.position.y=6,b.position.z=0,b.translateOnAxis(new t.Vector3(0,1,0),4);let w=s(e,4,12,4,a.a.rightLeg[n],i,"rightLeg");if(w.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(w),n>=1){let r=s(e,4.504,12.504,4.504,a.a.rightTrousers,i,"rightTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(r)}let x=new t.Object3D;if(x.add(u),x.add(f),x.add(h),x.add(m),x.add(g),x.add(b),r){console.log(a.a);let e=a.a.capeRelative;"optifine"===o&&(e=a.a.capeOptifineRelative),"labymod"===o&&(e=a.a.capeLabymodRelative),e=JSON.parse(JSON.stringify(e)),console.log(e);for(let t in e)e[t].x*=r.image.width,e[t].w*=r.image.width,e[t].y*=r.image.height,e[t].h*=r.image.height;console.log(e);let n=new t.Object3D;n.name="capeGroup",n.position.x=0,n.position.y=16,n.position.z=-2.5,n.translateOnAxis(new t.Vector3(0,1,0),8),n.translateOnAxis(new t.Vector3(0,0,1),.5);let i=s(r,10,16,1,e,!1,"cape");i.rotation.x=l(10),i.translateOnAxis(new t.Vector3(0,1,0),-8),i.translateOnAxis(new t.Vector3(0,0,1),-.5),i.rotation.y=l(180),n.add(i),x.add(n)}return x}(o,u,c,f,e._capeType?e._capeType:e.optifine?"optifine":"minecraft");n.addToScene(d),n.playerModel=d,"function"==typeof r&&r()};n._skinImage=new Image,n._skinImage.crossOrigin="anonymous",n._capeImage=new Image,n._capeImage.crossOrigin="anonymous";let c=void 0!==e.cape||void 0!==e.capeUrl||void 0!==e.capeData||void 0!==e.mineskin,f=!1,d=!1,h=!1,p=new t.Texture,m=new t.Texture;if(p.image=n._skinImage,n._skinImage.onload=function(){if(n._skinImage){if(d=!0,console.log("Skin Image Loaded"),void 0===e.slim&&32!==n._skinImage.height){let e=document.createElement("canvas"),t=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,t.drawImage(n._skinImage,0,0),console.log("Slim Detection:");let r=t.getImageData(46,52,1,12).data,a=t.getImageData(54,20,1,12).data,i=!0;for(let e=3;e<48;e+=4){if(255===r[e]){i=!1;break}if(255===a[e]){i=!1;break}}console.log(i),i&&(f=!0)}if(n.options.makeNonTransparentOpaque&&32!==n._skinImage.height){let e=document.createElement("canvas"),a=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,a.drawImage(n._skinImage,0,0);let i=document.createElement("canvas"),o=i.getContext("2d");i.width=n._skinImage.width,i.height=n._skinImage.height;let s=a.getImageData(0,0,e.width,e.height),l=s.data;function r(e,t){return e>0&&t>0&&e<32&&t<32||(e>32&&t>16&&e<64&&t<32||e>16&&t>48&&e<48&&t<64)}for(let t=0;t178||r(n,i))&&(l[t+3]=255)}o.putImageData(s,0,0),console.log(i.toDataURL()),p=new t.CanvasTexture(i)}!d||!h&&c||i||o(p,m)}},n._skinImage.onerror=function(e){console.warn("Skin Image Error"),console.warn(e)},console.log("Has Cape: "+c),c?(m.image=n._capeImage,n._capeImage.onload=function(){n._capeImage&&(h=!0,console.log("Cape Image Loaded"),h&&d&&(i||o(p,m)))},n._capeImage.onerror=function(e){console.warn("Cape Image Error"),console.warn(e),h=!0,d&&(i||o(p))}):(m=null,n._capeImage=null),"string"==typeof e)0===e.indexOf("http")?n._skinImage.src=e:e.length<=16?u("https://minerender.org/nameToUuid.php?name="+e,(function(t,r){if(t)return console.log(t);console.log(r),n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e)})):e.length<=36?image.src="https://crafatar.com/skins/"+e+"?overlay":n._skinImage.src=e;else{if("object"!=typeof e)throw new Error("Invalid texture value");if(e.url?n._skinImage.src=e.url:e.data?n._skinImage.src=e.data:e.username?u("https://minerender.org/nameToUuid.php?name="+e.username,(function(t,r){if(t)return console.log(t);n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e.username)+"?overlay"})):e.uuid?n._skinImage.src="https://crafatar.com/skins/"+e.uuid+"?overlay":e.mineskin&&(n._skinImage.src="https://api.mineskin.org/render/texture/"+e.mineskin),e.cape)if(e.cape.length>36){u(e.cape.startsWith("http")?e.cape:"https://api.capes.dev/get/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else{let t="https://api.capes.dev/load/";e.capeUser?t+=e.capeUser:e.username?t+=e.username:e.uuid?t+=e.uuid:console.warn("Couldn't find a user to get a cape from"),u(t+="/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else e.capeUrl?n._capeImage.src=e.capeUrl:e.capeData?n._capeImage.src=e.capeData:e.mineskin&&(n._capeImage.src="https://api.mineskin.org/render/texture/"+e.mineskin+"/cape");f=e.slim}}resize(e,t){return this._resize(e,t)}reset(){this._skinImage=null,this._capeImage=null,this._animId&&cancelAnimationFrame(this._animId),this._canvas&&this._canvas.remove()}getPlayerModel(){return this.playerModel}getModelByName(e){return this._scene.getObjectByName(e,!0)}toggleSkinPart(e,t){this._scene.getObjectByName(e,!0).visible=t}}function s(e,r,a,n,i,o,s,l){let u=e.image.width,c=e.image.height,f=new t.BoxGeometry(r,a,n),d=new t.MeshBasicMaterial({map:e,transparent:l||!1,alphaTest:.1,side:l?t.DoubleSide:t.FrontSide});f.computeBoundingBox(),f.faceVertexUvs[0]=[];let h=["right","left","top","bottom","front","back"],p=[];for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{tolerance:0};if(!e)throw new Error("You should specify the element you want to test");"string"==typeof e&&(e=document.querySelector(e));var r=e.getBoundingClientRect();return(r.bottom-t.tolerance>0&&r.right-t.tolerance>0&&r.left+t.tolerance<(window.innerWidth||document.documentElement.clientWidth)&&r.top+t.tolerance<(window.innerHeight||document.documentElement.clientHeight))}function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0,container:""};if(!e)throw new Error("You should specify the element you want to test");if("string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={tolerance:0,container:document.querySelector(t)}),"string"==typeof t.container&&(t.container=document.querySelector(t.container)),t instanceof HTMLElement&&(t={tolerance:0,container:t}),!t.container)throw new Error("You should specify a container element");var r=t.container.getBoundingClientRect();return(e.offsetTop+e.clientHeight-t.tolerance>t.container.scrollTop&&e.offsetLeft+e.clientWidth-t.tolerance>t.container.scrollLeft&&e.offsetLeft+t.tolerance0&&void 0!==arguments[0]?arguments[0]:{tolerance:0,debounce:100,container:window};this.options={},this.trackedElements={},Object.defineProperties(this.options,{container:{configurable:!1,enumerable:!1,get:function(){var e=void 0;return"string"==typeof n.container?e=document.querySelector(n.container):n.container instanceof HTMLElement&&(e=n.container),e||window},set:function(e){n.container=e}},debounce:{get:function(){return parseInt(n.debounce,10)||100},set:function(e){n.debounce=e}},tolerance:{get:function(){return parseInt(n.tolerance,10)||0},set:function(e){n.tolerance=e}}}),Object.defineProperty(this,"_scroll",{enumerable:!1,configurable:!1,writable:!1,value:this._debouncedScroll.call(this)}),e=document.querySelector("body"),t=function(){Object.keys(a.trackedElements).forEach((function(e){a.on("enter",e),a.on("leave",e)}))},(r=window.MutationObserver||window.WebKitMutationObserver)?new r(t).observe(e,{childList:!0,subtree:!0}):(e.addEventListener("DOMNodeInserted",t,!1),e.addEventListener("DOMNodeRemoved",t,!1)),this.attach()}return Object.defineProperties(r.prototype,{_debouncedScroll:{configurable:!1,writable:!1,enumerable:!1,value:function(){var r=this,a=void 0;return function(){clearTimeout(a),a=setTimeout((function(){!function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0},n=Object.keys(r),i=void 0;n.length&&(i=a.container===window?e:t,n.forEach((function(e){r[e].nodes.forEach((function(t){if(i(t.node,a)?(t.wasVisible=t.isVisible,t.isVisible=!0):(t.wasVisible=t.isVisible,t.isVisible=!1),!0===t.isVisible&&!1===t.wasVisible){if(!r[e].enter)return;Object.keys(r[e].enter).forEach((function(a){"function"==typeof r[e].enter[a]&&r[e].enter[a](t.node,"enter")}))}if(!1===t.isVisible&&!0===t.wasVisible){if(!r[e].leave)return;Object.keys(r[e].leave).forEach((function(a){"function"==typeof r[e].leave[a]&&r[e].leave[a](t.node,"leave")}))}}))})))}(r.trackedElements,r.options)}),r.options.debounce)}}},attach:{configurable:!1,writable:!1,enumerable:!1,value:function(){var e=this.options.container;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.addEventListener("scroll",this._scroll,{passive:!0}),window.addEventListener("resize",this._scroll,{passive:!0}),this._scroll(),this.attached=!0}},destroy:{configurable:!1,writable:!1,enumerable:!1,value:function(){this.options.container.removeEventListener("scroll",this._scroll),window.removeEventListener("resize",this._scroll),this.attached=!1}},off:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){var a=Object.keys(this.trackedElements[t].enter||{}),n=Object.keys(this.trackedElements[t].leave||{});if({}.hasOwnProperty.call(this.trackedElements,t))if(r){if(this.trackedElements[t][e]){var i="function"==typeof r?r.name:r;delete this.trackedElements[t][e][i]}}else delete this.trackedElements[t][e];a.length||n.length||delete this.trackedElements[t]}},on:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){if(!e)throw new Error("No event given. Choose either enter or leave");if(!t)throw new Error("No selector to track");if(["enter","leave"].indexOf(e)<0)throw new Error(e+" event is not supported");({}).hasOwnProperty.call(this.trackedElements,t)||(this.trackedElements[t]={}),this.trackedElements[t].nodes=[];for(var a=0,n=document.querySelectorAll(t);a{if(e.options.useWebWorkers){let a=c()(f);a.addEventListener("message",e=>{r.push(...e.data.parsedModelList),t()}),a.postMessage({func:"parseModel",model:i,modelOptions:i,parsedModelList:r,assetRoot:e.options.assetRoot})}else Object(l.e)(i,i,r,e.options.assetRoot).then(()=>{t()})}))}return Promise.all(a)})(r,e,n).then(()=>(function(e,t){console.timeEnd("parseModels"),console.time("loadAndMergeModels");let r=[];console.log("Loading Model JSON data & merging...");let a={};for(let e=0;e{let a=n[t],i=Object(l.d)(a);if(console.debug("loadAndMerge "+i),m.hasOwnProperty(i))r();else if(e.options.useWebWorkers){let t=c()(f);t.addEventListener("message",e=>{m[i]=e.data.mergedModel,r()}),t.postMessage({func:"loadAndMergeModel",model:a,assetRoot:e.options.assetRoot})}else Object(l.b)(a,e.options.assetRoot).then(e=>{m[i]=e,r()})}));return Promise.all(r)})(r,n)).then(()=>(function(e,t){console.timeEnd("loadAndMergeModels"),console.time("loadModelTextures");let r=[];console.log("Loading Textures...");let a={};for(let e=0;e{let a=n[t],i=Object(l.d)(a);console.debug("loadTexture "+i);let o=m[i];if(v.hasOwnProperty(i))r();else{if(!o)return console.warn("Missing merged model"),console.warn(a.name),void r();if(!o.textures)return console.warn("The model doesn't have any textures!"),console.warn("Please make sure you're using the proper file."),console.warn(a.name),void r();if(e.options.useWebWorkers){let t=c()(f);t.addEventListener("message",e=>{v[i]=e.data.textures,r()}),t.postMessage({func:"loadTextures",textures:o.textures,assetRoot:e.options.assetRoot})}else Object(l.c)(o.textures,e.options.assetRoot).then(e=>{v[i]=e,r()})}}));return Promise.all(r)})(r,n)).then(()=>(function(e,t){console.timeEnd("loadModelTextures"),console.time("doModelRender"),console.log("Rendering Models...");let r=[];for(let n=0;n{let i=t[n],o=m[Object(l.d)(i)],s=v[Object(l.d)(i)],u=i.offset||[0,0,0],c=i.rotation||[0,0,0],f=i.scale||[1,1,1];if(i.options.hasOwnProperty("display")&&o.hasOwnProperty("display")&&o.display.hasOwnProperty(i.options.display)){let e=o.display[i.options.display];e.hasOwnProperty("translation")&&(u=[u[0]+e.translation[0],u[1]+e.translation[1],u[2]+e.translation[2]]),e.hasOwnProperty("rotation")&&(c=[c[0]+e.rotation[0],c[1]+e.rotation[1],c[2]+e.rotation[2]]),e.hasOwnProperty("scale")&&(f=[e.scale[0],e.scale[1],e.scale[2]])}M(e,o,s,o.textures,i.type,i.name,i.variant,u,c,f).then(t=>{if(t.firstInstance){let r=new a.Object3D;r.add(t.mesh),e.models.push(r),e.addToScene(r)}r(t)})}));return Promise.all(r)})(r,n)).then(e=>{console.timeEnd("doModelRender"),console.debug(e),"function"==typeof t&&t()})}}let M=function(e,t,r,i,o,s,u,c,f,d){return new Promise(h=>{if(t.hasOwnProperty("elements")){let p=Object(l.d)({type:o,name:s,variant:u}),m=g[p],v=function(t,r){t.userData.modelType=o,t.userData.modelName=s;let n=new a.Vector3,i=new a.Vector3,u=new a.Quaternion,m={key:p,index:r,offset:c,scale:d,rotation:f};f&&t.setQuaternionAt(r,u.setFromEuler(new a.Euler(Object(l.f)(f[0]),Object(l.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(l.f)(f[2])))),c&&(t.setPositionAt(r,n.set(c[0],c[1],c[2])),e.instancePositionMap[c[0]+"_"+c[1]+"_"+c[2]]=m),d&&t.setScaleAt(r,i.set(d[0],d[1],d[2])),t.needsUpdate(),h({mesh:t,firstInstance:0===r})},y=function(e,t){let r;if(e.translate(-8,-8,-8),_.hasOwnProperty(p))console.debug("Using cached instance ("+p+")"),r=_[p];else{console.debug("Caching new model instance "+p+" (with "+m+" instances)");let n=new a.InstancedMesh(e,t,m,!1,!1,!1);r={instance:n,index:0},_[p]=r;let i=new a.Vector3,o=new a.Vector3(1,1,1),s=new a.Quaternion;for(let e=0;e{let n=s.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_"+(o.__comment?o.__comment.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_":"");O(o.to[0]-o.from[0],o.to[1]-o.from[1],o.to[2]-o.from[2],n+Date.now(),o.faces,u,r,i,e.options.assetRoot,n).then(e=>{e.applyMatrix((new a.Matrix4).makeTranslation((o.to[0]-o.from[0])/2,(o.to[1]-o.from[1])/2,(o.to[2]-o.from[2])/2)),e.applyMatrix((new a.Matrix4).makeTranslation(o.from[0],o.from[1],o.from[2])),o.rotation&&L(e,new a.Vector3(o.rotation.origin[0],o.rotation.origin[1],o.rotation.origin[2]),new a.Vector3("x"===o.rotation.axis?1:0,"y"===o.rotation.axis?1:0,"z"===o.rotation.axis?1:0),Object(l.f)(o.rotation.angle)),t(e)})}))}Promise.all(b).then(e=>{let t=Object(n.c)(e,!0);t.sourceSize=e.length,y(t.geometry,t.materials,e.length);for(let t=0;t{c&&e.applyMatrix((new a.Matrix4).makeTranslation(c[0],c[1],c[2])),f&&e.rotation.set(Object(l.f)(f[0]),Object(l.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(l.f)(f[2])),d&&e.scale.set(d[0],d[1],d[2]),h({mesh:e,firstInstance:!0})})})};function T(e,t,r,n){let i=_[e];if(i&&i.instance){let e,o=i.instance;e=n?t||[1,1,1]:[0,0,0];let s=new a.Vector3;return o.setScaleAt(r,s.set(e[0],e[1],e[2])),o}}function P(e,t){let r={};for(let a of e){let e=this.instancePositionMap[a[0]+"_"+a[1]+"_"+a[2]];if(e){let a=T(e.key,e.scale,e.index,t);a&&(r[e.key]=a)}}for(let e of Object.values(r))e.needsUpdate()}S.prototype.setVisibilityAtMulti=P,S.prototype.setVisibilityAt=function(e,t,r,a){P([[e,t,r]],a)},S.prototype.setVisibilityOfType=function(e,t,r,a){let n=_[Object(l.d)({type:e,name:t,variant:r})];if(n&&n.instance){n.instance.visible=a}};let F=function(e,t){return new Promise(r=>{let n=function(t,n,i){let o=new a.PlaneGeometry(n,i),s=new a.Mesh(o,t);s.name=e,s.receiveShadow=!0,r(s)};if(t){let r=0,i=0,o=[];for(let e in t)t.hasOwnProperty(e)&&o.push(new Promise(a=>{let n=new Image;n.onload=function(){n.width>r&&(r=n.width),n.height>i&&(i=n.height),a(n)},n.src=t[e]}));Promise.all(o).then(t=>{let o=document.createElement("canvas");o.width=r,o.height=i;let l=o.getContext("2d");for(let e=0;e{let _,E=e+"_"+t+"_"+r;x.hasOwnProperty(E)?(console.debug("Using cached Geometry ("+E+")"),_=x[E]):(_=new a.BoxGeometry(e,t,r),console.debug("Caching Geometry "+E),x[E]=_);let S=function(e){let t=new a.Mesh(_,e);t.name=n,t.receiveShadow=!0,g(t)};if(c){let e=[];for(let t=0;t<6;t++)e.push(new Promise(e=>{let r=h[t];if(!o.hasOwnProperty(r))return void e(null);let d=o[r],g=d.texture.substr(1);if(!c.hasOwnProperty(g)||!c[g])return console.warn("Missing texture '"+g+"' for face "+r+" in model "+n),void e(null);let x=g+"_"+r+"_"+v,_=t=>{let o=function(t){let i=t.dataUrl,o=t.dataUrlHash,s=t.hasTransparency;if(w.hasOwnProperty(o))return console.debug("Using cached Material ("+o+", without meta)"),void e(w[o]);let u=f[g];u.startsWith("#")&&(u=f[n.substr(1)]),console.debug("Pre-Caching Material "+o+", without meta"),w[o]=new a.MeshBasicMaterial({map:null,transparent:s,side:s?a.DoubleSide:a.FrontSide,alphaTest:.5,name:r+"_"+g+"_"+u});let c=function(t){console.debug("Finalizing Cached Material "+o+", without meta"),w[o].map=t,w[o].needsUpdate=!0,e(w[o])};if(y.hasOwnProperty(o))return console.debug("Using cached Texture ("+o+")"),void c(y[o]);console.debug("Pre-Caching Texture "+o),y[o]=(new a.TextureLoader).load(i,(function(e){e.magFilter=a.NearestFilter,e.minFilter=a.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,d.hasOwnProperty("rotation")&&(e.center.x=.5,e.center.y=.5,e.rotation=Object(l.f)(d.rotation)),console.debug("Caching Texture "+o),y[o]=e,c(e)}))};if(t.height>t.width&&t.height%t.width==0){let r=f[g];r.startsWith("#")&&(r=f[r.substr(1)]),-1!==r.indexOf("/")&&(r=r.substr(r.indexOf("/")+1)),Object(i.e)(r,m).then(r=>{!function(t,r){let n=t.dataUrlHash,i=t.hasTransparency;if(w.hasOwnProperty(n))return console.debug("Using cached Material ("+n+", with meta)"),void e(w[n]);console.debug("Pre-Caching Material "+n+", with meta"),w[n]=new a.MeshBasicMaterial({map:null,transparent:i,side:i?a.DoubleSide:a.FrontSide,alphaTest:.5});let o=1;r.hasOwnProperty("animation")&&r.animation.hasOwnProperty("frametime")&&(o=r.animation.frametime);let l=Math.floor(t.height/t.width);console.log("Generating animated texture...");let u=[];for(let e=0;e{let n=document.createElement("canvas");n.width=t.width,n.height=t.width,n.getContext("2d").drawImage(t.canvas,0,e*t.width,t.width,t.width,0,0,t.width,t.width);let i=n.toDataURL("image/png"),o=s(i);if(y.hasOwnProperty(o))return console.debug("Using cached Texture ("+o+")"),void r(y[o]);console.debug("Pre-Caching Texture "+o),y[o]=(new a.TextureLoader).load(i,(function(e){e.magFilter=a.NearestFilter,e.minFilter=a.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,console.debug("Caching Texture "+o+", without meta"),y[o]=e,r(e)}))}));Promise.all(u).then(t=>{let r=0,a=0;A.push(()=>{r>=o&&(r=0,w[n].map=t[a],a++),a>=t.length&&(a=0),r+=.1}),console.debug("Finalizing Cached Material "+n+", with meta"),w[n].map=t[0],w[n].needsUpdate=!0,e(w[n])})}(t,r)}).catch(()=>{o(t)})}else o(t)};if(b.hasOwnProperty(x)){let e=b[x];if(e.hasOwnProperty("img")){console.debug("Waiting for canvas image that's already loading ("+x+")"),e.img.waitingForCanvas.push((function(e){_(e)}))}else console.debug("Using cached canvas ("+x+")"),_(b[x])}else{let t=new Image;t.onerror=function(t){console.warn(t),e(null)},t.waitingForCanvas=[],t.onload=function(){let e=(e=>{let t=d.uv;t||(t=u[r].uv),t=[Object(i.f)(t[0],e.width),Object(i.f)(t[1],e.height),Object(i.f)(t[2],e.width),Object(i.f)(t[3],e.height)];let a=document.createElement("canvas");a.width=Math.abs(t[2]-t[0]),a.height=Math.abs(t[3]-t[1]);let n,o=a.getContext("2d");o.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),a.width,a.height,0,0,a.width,a.height),d.hasOwnProperty("tintindex")?n=p[d.tintindex]:v.startsWith("water_")&&(n="blue"),n&&(o.fillStyle=n,o.globalCompositeOperation="multiply",o.fillRect(0,0,a.width,a.height),o.globalAlpha=1,o.globalCompositeOperation="destination-in",o.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),a.width,a.height,0,0,a.width,a.height));let l=o.getImageData(0,0,a.width,a.height).data,c=!1;for(let e=3;eS(e))}else{let e=[];for(let t=0;t<6;t++)e.push(new a.MeshBasicMaterial({color:d[t+2],wireframe:!0}));S(e)}})};function L(e,t,r,a){e.position.sub(t),e.position.applyAxisAngle(r,a),e.position.add(t),e.rotateOnAxis(r,a)}S.cache={loadedTextures:v,mergedModels:m,instanceCount:g,texture:y,canvas:b,material:w,geometry:x,instances:_,animated:A,resetInstances:function(){Object(l.a)(g),Object(l.a)(_)},clearAll:function(){Object(l.a)(v),Object(l.a)(m),Object(l.a)(g),Object(l.a)(y),Object(l.a)(b),Object(l.a)(w),Object(l.a)(x),Object(l.a)(_),A.splice(0,A.length)}},S.ModelConverter=o.a,"undefined"!=typeof window&&(window.ModelRender=S,window.ModelConverter=o.a),void 0!==e&&(e.ModelRender=S),t.default=S}.call(this,r(4))},function(e,t,r){e.exports=function(e){const t=parseInt(e.REVISION)>=96;r(79)(e);var a=new e.MeshDepthMaterial;a.depthPacking=e.RGBADepthPacking,a.clipping=!0,a.defines={INSTANCE_TRANSFORM:""};var n=e.ShaderLib.distanceRGBA,i=e.UniformsUtils.clone(n.uniforms),o=new e.ShaderMaterial({defines:{USE_SHADOWMAP:"",INSTANCE_TRANSFORM:""},uniforms:i,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,clipping:!0});return e.InstancedMesh=function(t,r,n,i,s,l){e.Mesh.call(this,(new e.InstancedBufferGeometry).copy(t)),this._dynamic=!!i,this._uniformScale=!!l,this._colors=!!s,this.numInstances=n,this._setAttributes(),this.material=r,this.frustumCulled=!1,this.customDepthMaterial=a,this.customDistanceMaterial=o},e.InstancedMesh.prototype=Object.create(e.Mesh.prototype),e.InstancedMesh.constructor=e.InstancedMesh,Object.defineProperties(e.InstancedMesh.prototype,{material:{set:function(e){let t=function(e){e.defines?(e.defines.INSTANCE_TRANSFORM="",this._uniformScale?e.defines.INSTANCE_UNIFORM="":delete e.defines.INSTANCE_UNIFORM,this._colors?e.defines.INSTANCE_COLOR="":delete e.defines.INSTANCE_COLOR):(e.defines={INSTANCE_TRANSFORM:""},this._uniformScale&&(e.defines.INSTANCE_UNIFORM=""),this._colors&&(e.defines.INSTANCE_COLOR=""))};if(Array.isArray(e)){e=e.slice(0);for(let r=0;r{const n=r[a];let i;t?i=new e.InstancedBufferAttribute(...n):(i=new e.InstancedBufferAttribute(n[0],n[1],n[3])).normalized=n[2],i.dynamic=this._dynamic,this.geometry.addAttribute(a,i)})},e.InstancedMesh}},function(e,t,r){e.exports=function(e){return/InstancedMesh/.test(e.REVISION)?e:(r(80)(e),e.REVISION+="_InstancedMesh",e)}},function(e,t,r){e.exports=function(e){e.ShaderChunk.begin_vertex=r(81),e.ShaderChunk.color_fragment=r(82),e.ShaderChunk.color_pars_fragment=r(83),e.ShaderChunk.color_vertex=r(84),e.ShaderChunk.defaultnormal_vertex=r(85),e.ShaderChunk.uv_pars_vertex=r(86)}},function(e,t){e.exports=["#ifndef INSTANCE_TRANSFORM","vec3 transformed = vec3( position );","#else","#ifndef INSTANCE_MATRIX","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","vec3 transformed = ( _instanceMatrix * vec4( position , 1. )).xyz;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","diffuseColor.rgb *= vColor;","#endif","#if defined(INSTANCE_COLOR)","diffuseColor.rgb *= vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","varying vec3 vColor;","#endif","#if defined( INSTANCE_COLOR )","varying vec3 vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","vColor.xyz = color.xyz;","#endif","#if defined( INSTANCE_COLOR ) && defined( INSTANCE_TRANSFORM )","vInstanceColor = instanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef FLIP_SIDED","objectNormal = -objectNormal;","#endif","#ifndef INSTANCE_TRANSFORM","vec3 transformedNormal = normalMatrix * objectNormal;","#else","#ifndef INSTANCE_MATRIX ","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","#ifndef INSTANCE_UNIFORM","vec3 transformedNormal = transposeMat3( inverse( mat3( modelViewMatrix * _instanceMatrix ) ) ) * objectNormal ;","#else","vec3 transformedNormal = ( modelViewMatrix * _instanceMatrix * vec4( objectNormal , 0.0 ) ).xyz;","#endif","#endif"].join("\n")},function(e,t){e.exports=["#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )","varying vec2 vUv;","uniform mat3 uvTransform;","#endif","#ifdef INSTANCE_TRANSFORM","mat3 inverse(mat3 m) {","float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];","float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];","float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];","float b01 = a22 * a11 - a12 * a21;","float b11 = -a22 * a10 + a12 * a20;","float b21 = a21 * a10 - a11 * a20;","float det = a00 * b01 + a01 * b11 + a02 * b21;","return mat3(b01, (-a22 * a01 + a02 * a21), ( a12 * a01 - a02 * a11),","b11, ( a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),","b21, (-a21 * a00 + a01 * a20), ( a11 * a00 - a01 * a10)) / det;","}","attribute vec3 instancePosition;","attribute vec4 instanceQuaternion;","attribute vec3 instanceScale;","#if defined( INSTANCE_COLOR )","attribute vec3 instanceColor;","varying vec3 vInstanceColor;","#endif","mat4 getInstanceMatrix(){","vec4 q = instanceQuaternion;","vec3 s = instanceScale;","vec3 v = instancePosition;","vec3 q2 = q.xyz + q.xyz;","vec3 a = q.xxx * q2.xyz;","vec3 b = q.yyz * q2.yzz;","vec3 c = q.www * q2.xyz;","vec3 r0 = vec3( 1.0 - (b.x + b.z) , a.y + c.z , a.z - c.y ) * s.xxx;","vec3 r1 = vec3( a.y - c.z , 1.0 - (a.x + b.z) , b.y + c.x ) * s.yyy;","vec3 r2 = vec3( a.z + c.y , b.y - c.x , 1.0 - (a.x + b.x) ) * s.zzz;","return mat4(","r0 , 0.0,","r1 , 0.0,","r2 , 0.0,","v , 1.0",");","}","#endif"].join("\n")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(8);var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),e.scene=new n.Scene,e.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),e.quad.frustumCulled=!1,e.scene.add(e.quad),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((a=i)&&a.__esModule?a:{default:a}).default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:this.clock.getDelta(),t=this.renderer.getRenderTarget(),r=!1,a=void 0,n=void 0,i=this.passes.length;for(n=0;n0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&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 r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==u)throw new Error(o[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,p))!==u)throw new Error(o[r]);this._dict_set=!0}}function p(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}h.prototype.push=function(e,t){var r,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=i.string2buf(e):"[object ArrayBuffer]"===l.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 n.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=a.deflate(s,o))&&r!==u)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(n.shrinkBuf(s.output,s.next_out))):this.onData(n.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u):2!==o||(this.onEnd(u),s.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=h,t.deflate=p,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},function(e,t,r){"use strict";var a=r(9),n=4,i=0,o=1,s=2;function l(e){for(var t=e.length;--t>=0;)e[t]=0}var u=0,c=1,f=2,d=29,h=256,p=h+1+d,m=30,v=19,g=2*p+1,y=15,b=16,w=7,x=256,_=16,A=17,E=18,S=[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],M=[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],T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(p+2));l(F);var O=new Array(2*m);l(O);var L=new Array(512);l(L);var C=new Array(256);l(C);var R=new Array(d);l(R);var k,I,N,D=new Array(m);function U(e,t,r,a,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=a,this.max_length=n,this.has_stree=e&&e.length}function j(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function B(e){return e<256?L[e]:L[256+(e>>>7)]}function V(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function z(e,t,r){e.bi_valid>b-r?(e.bi_buf|=t<>b-e.bi_valid,e.bi_valid+=r-b):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function X(e,t,r){var a,n,i=new Array(y+1),o=0;for(a=1;a<=y;a++)i[a]=o=o+r[a-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=H(i[s]++,s))}}function Y(e){var t;for(t=0;t8?V(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,a){var n=2*t,i=2*r;return e[n]>1;r>=1;r--)Q(e,i,r);n=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Q(e,i,1),a=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=a,i[2*n]=i[2*r]+i[2*a],e.depth[n]=(e.depth[r]>=e.depth[a]?e.depth[r]:e.depth[a])+1,i[2*r+1]=i[2*a+1]=n,e.heap[1]=n++,Q(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,a,n,i,o,s,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(i=0;i<=y;i++)e.bl_count[i]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(i=p,m++),l[2*a+1]=i,a>u||(e.bl_count[i]++,o=0,a>=h&&(o=d[a-h]),s=l[2*a],e.opt_len+=s*(i+o),f&&(e.static_len+=s*(c[2*a+1]+o)));if(0!==m){do{for(i=p-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(i=p;0!==i;i--)for(a=e.bl_count[i];0!==a;)(n=e.heap[--r])>u||(l[2*n+1]!==i&&(e.opt_len+=(i-l[2*n+1])*l[2*n],l[2*n+1]=i),a--)}}(e,t),X(i,u,e.bl_count)}function J(e,t,r){var a,n,i=-1,o=t[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(r+1)+1]=65535,a=0;a<=r;a++)n=o,o=t[2*(a+1)+1],++s>=7;a0?(e.strm.data_type===s&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&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 o;for(t=32;t=3&&0===e.bl_tree[2*P[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),l=e.opt_len+3+7>>>3,(u=e.static_len+3+7>>>3)<=l&&(l=u)):l=u=r+5,r+4<=l&&-1!==t?te(e,t,r,a):e.strategy===n||u===l?(z(e,(c<<1)+(a?1:0),3),Z(e,F,O)):(z(e,(f<<1)+(a?1:0),3),function(e,t,r,a){var n;for(z(e,t-257,5),z(e,r-1,5),z(e,a-4,4),n=0;n>>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&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(C[r]+h+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){z(e,c<<1,3),G(e,x,F),function(e){16===e.bi_valid?(V(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,r){"use strict";var a=r(51),n=r(9),i=r(50),o=r(31),s=r(29),l=r(30),u=r(98),c=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new u,a.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=i.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=a.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function d(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,l,u,f,d=this.strm,h=this.options.chunkSize,p=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?d.input=i.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new n.Buf8(h),d.next_out=0,d.avail_out=h),(r=a.inflate(d,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(r=a.inflateSetDictionary(this.strm,p)),r===o.Z_BUF_ERROR&&!0===m&&(r=o.Z_OK,m=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==o.Z_STREAM_END&&(0!==d.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=i.utf8border(d.output,d.next_out),u=d.next_out-l,f=i.buf2string(d.output,l),d.next_out=u,d.avail_out=h-u,u&&n.arraySet(d.output,d.output,l,u,0),this.onData(f)):this.onData(n.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),d.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=d,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.ungzip=d},function(e,t,r){"use strict";e.exports=function(e,t){var r,a,n,i,o,s,l,u,c,f,d,h,p,m,v,g,y,b,w,x,_,A,E,S,M;r=e.state,a=e.next_in,S=e.input,n=a+(e.avail_in-5),i=e.next_out,M=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,f=r.wnext,d=r.window,h=r.hold,p=r.bits,m=r.lencode,v=r.distcode,g=(1<>>=w=b>>>24,p-=w,0===(w=b>>>16&255))M[i++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(h&(1<>>=w,p-=w),p<15&&(h+=S[a++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=v[(65535&b)+(h&(1<l){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,p-=w,_>(w=i-o)){if((w=_-w)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(A=0,E=d,0===f){if(A+=u-w,w2;)M[i++]=E[A++],M[i++]=E[A++],M[i++]=E[A++],x-=3;x&&(M[i++]=E[A++],x>1&&(M[i++]=E[A++]))}else{A=i-_;do{M[i++]=M[A++],M[i++]=M[A++],M[i++]=M[A++],x-=3}while(x>2);x&&(M[i++]=M[A++],x>1&&(M[i++]=M[A++]))}break}}break}}while(a>3,h&=(1<<(p-=x<<3))-1,e.next_in=a,e.next_out=i,e.avail_in=a=1&&0===I[M];M--);if(T>M&&(T=M),0===M)return u[c++]=20971520,u[c++]=20971520,d.bits=1,0;for(S=1;S0&&(0===e||1!==M))return-1;for(N[1]=0,A=1;A<15;A++)N[A+1]=N[A]+I[A];for(E=0;E852||2===e&&L>592)return 1;for(;;){b=A-F,f[E]y?(w=D[U+f[E]],x=R[k+f[E]]):(w=96,x=0),h=1<>F)+(p-=h)]=b<<24|w<<16|x|0}while(0!==p);for(h=1<>=1;if(0!==h?(C&=h-1,C+=h):C=0,E++,0==--I[A]){if(A===M)break;A=t[r+f[E]]}if(A>T&&(C&v)!==m){for(0===F&&(F=T),g+=S,O=1<<(P=A-F);P+F852||2===e&&L>592)return 1;u[m=C&v]=T<<24|P<<16|g-c|0}}return 0!==C&&(u[g+C]=A-F<<24|64<<16|0),d.bits=T,0}},function(e,t,r){"use strict";e.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}},function(e,t,r){"use strict";(function(e){var a=r(7).Buffer,n=r(102).Transform,i=r(113),o=r(58),s=r(24).ok,l=r(7).kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";i.Z_MIN_WINDOWBITS=8,i.Z_MAX_WINDOWBITS=15,i.Z_DEFAULT_WINDOWBITS=15,i.Z_MIN_CHUNK=64,i.Z_MAX_CHUNK=1/0,i.Z_DEFAULT_CHUNK=16384,i.Z_MIN_MEMLEVEL=1,i.Z_MAX_MEMLEVEL=9,i.Z_DEFAULT_MEMLEVEL=8,i.Z_MIN_LEVEL=-1,i.Z_MAX_LEVEL=9,i.Z_DEFAULT_LEVEL=i.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(i),f=0;f=l?o=new RangeError(u):t=a.concat(n,i),n=[],e.close(),r(o,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)})),e.on("end",s),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=a.from(t)),!a.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function b(e){if(!(this instanceof b))return new b(e);T.call(this,e,i.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);T.call(this,e,i.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,i.GZIP)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,i.GUNZIP)}function A(e){if(!(this instanceof A))return new A(e);T.call(this,e,i.DEFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);T.call(this,e,i.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,i.UNZIP)}function M(e){return e===i.Z_NO_FLUSH||e===i.Z_PARTIAL_FLUSH||e===i.Z_SYNC_FLUSH||e===i.Z_FULL_FLUSH||e===i.Z_FINISH||e===i.Z_BLOCK}function T(e,r){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,n.call(this,e),e.flush&&!M(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!M(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||i.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:i.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!a.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new i.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){P(s),s._hadError=!0;var a=new Error(e);a.errno=r,a.code=t.codes[r],s.emit("error",a)};var l=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(l=e.level);var u=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,l,e.memLevel||t.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=a.allocUnsafe(this._chunkSize),this._offset=0,this._level=l,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function P(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function F(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),t.Deflate=b,t.Inflate=w,t.Gzip=x,t.Gunzip=_,t.DeflateRaw=A,t.InflateRaw=E,t.Unzip=S,t.createDeflate=function(e){return new b(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new A(e)},t.createInflateRaw=function(e){return new E(e)},t.createGzip=function(e){return new x(e)},t.createGunzip=function(e){return new _(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new b(t),e,r)},t.deflateSync=function(e,t){return y(new b(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new x(t),e,r)},t.gzipSync=function(e,t){return y(new x(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new A(t),e,r)},t.deflateRawSync=function(e,t){return y(new A(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new S(t),e,r)},t.unzipSync=function(e,t){return y(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new w(t),e,r)},t.inflateSync=function(e,t){return y(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new _(t),e,r)},t.gunzipSync=function(e,t){return y(new _(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new E(t),e,r)},t.inflateRawSync=function(e,t){return y(new E(t),e)},o.inherits(T,n),T.prototype.params=function(r,a,n){if(rt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(a!=t.Z_FILTERED&&a!=t.Z_HUFFMAN_ONLY&&a!=t.Z_RLE&&a!=t.Z_FIXED&&a!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+a);if(this._level!==r||this._strategy!==a){var o=this;this.flush(i.Z_SYNC_FLUSH,(function(){s(o._handle,"zlib binding closed"),o._handle.params(r,a),o._hadError||(o._level=r,o._strategy=a,n&&n())}))}else e.nextTick(n)},T.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},T.prototype._flush=function(e){this._transform(a.alloc(0),"",e)},T.prototype.flush=function(t,r){var n=this,o=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=i.Z_FULL_FLUSH),o.ended?r&&e.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",(function(){return n.flush(t,r)})):(this._flushFlag=t,this.write(a.alloc(0),"",r))},T.prototype.close=function(t){P(this,t),e.nextTick(F,this)},T.prototype._transform=function(e,t,r){var n,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||a.isBuffer(e)?this._handle?(s?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||i.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},T.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,c=this,f="function"==typeof r;if(!f){var d,h=[],p=0;this.on("error",(function(e){d=e})),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw d;if(p>=l)throw P(this),new RangeError(u);var v=a.concat(h,p);return P(this),v}s(this._handle,"zlib binding closed");var g=this._handle.write(t,e,o,n,this._buffer,this._offset,i);function y(l,u){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var d=i-u;if(s(d>=0,"have should not go down"),d>0){var m=c._buffer.slice(c._offset,c._offset+d);c._offset+=d,f?c.push(m):(h.push(m),p+=m.length)}if((0===u||c._offset>=c._chunkSize)&&(i=c._chunkSize,c._offset=0,c._buffer=a.allocUnsafe(c._chunkSize)),0===u){if(o+=n-l,n=l,!f)return!0;var v=c._handle.write(t,e,o,n,c._buffer,c._offset,c._chunkSize);return v.callback=y,void(v.buffer=e)}if(!f)return!1;r()}}g.buffer=e,g.callback=y},o.inherits(b,T),o.inherits(w,T),o.inherits(x,T),o.inherits(_,T),o.inherits(A,T),o.inherits(E,T),o.inherits(S,T)}).call(this,r(5))},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],a=t[1];return 3*(r+a)/4-a},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));1===n?(t=e[r-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var n,i,o=[],s=t;s>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,a,n){var i,o,s=8*n-a-1,l=(1<>1,c=-7,f=r?n-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=d,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=a;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,a),i-=u}return(h?-1:1)*o*Math.pow(2,i-a)},t.write=function(e,t,r,a,n,i){var o,s,l,u=8*i-n-1,c=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=a?0:i-1,p=a?1:-1,m=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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,n),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;e[r+h]=255&s,h+=p,s/=256,n-=8);for(o=o<0;e[r+h]=255&o,h+=p,o/=256,u-=8);e[r+h-p]|=128*m}},function(e,t,r){e.exports=n;var a=r(17).EventEmitter;function n(){a.call(this)}r(6)(n,a),n.Readable=r(32),n.Writable=r(109),n.Duplex=r(110),n.Transform=r(111),n.PassThrough=r(112),n.Stream=n,n.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===a.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var a=r(22).Buffer,n=r(105);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,t.copy(r,n),s+=o.data.length,o=o.next;return i},e}(),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var a=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(n.call(setTimeout,a,arguments),clearTimeout)},t.setInterval=function(){return new i(n.call(setInterval,a,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(a,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(107),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(4))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var a,n,i,o,s,l=1,u={},c=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?a=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},a=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(n=f.documentElement,a=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):a=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),a=function(t){e.postMessage(o+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;rt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,n(this.init_done,"close before init"),n(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,a,n,i,o){return this._write(!0,e,t,r,a,n,i,o)},c.prototype.writeSync=function(e,t,r,a,n,i,o){return this._write(!1,e,t,r,a,n,i,o)},c.prototype._write=function(r,i,o,s,l,u,c,f){if(n.equal(arguments.length,8),n(this.init_done,"write before init"),n(this.mode!==t.NONE,"already finalized"),n.equal(!1,this.write_in_progress,"write already in progress"),n.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,n.equal(!1,void 0===i,"must provide flush value"),this.write_in_progress=!0,i!==t.Z_NO_FLUSH&&i!==t.Z_PARTIAL_FLUSH&&i!==t.Z_SYNC_FLUSH&&i!==t.Z_FULL_FLUSH&&i!==t.Z_FINISH&&i!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=e.alloc(0),l=0,s=0),this.strm.avail_in=l,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=u,this.strm.next_out=c,this.flush=i,!r)return this._process(),this._checkError()?this._afterSync():void 0;var d=this;return a.nextTick((function(){d._process(),d._after()})),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,r,a,i,o){n(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),n(e>=8&&e<=15,"invalid windowBits"),n(r>=-1&&r<=9,"invalid compression level"),n(a>=1&&a<=9,"invalid memlevel"),n(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,a,i,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,r,a,n,l){switch(this.level=e,this.windowBits=r,this.memLevel=a,this.strategy=n,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new i,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=l,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=o.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=c}).call(this,r(7).Buffer,r(5))},function(e,t,r){"use strict"; + */function n(e,t){if(e===t)return 0;for(var r=e.length,a=t.length,n=0,i=Math.min(r,a);n=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(s=c[u],!b(e[s],t[s],r,a))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function x(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,r,a){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(a=r,r=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),a=(r&&r.name?" ("+r.name+").":".")+(a?" "+a:"."),e&&!n&&g(n,r,"Missing expected exception"+a);var i="string"==typeof a,s=!e&&n&&!r;if((!e&&o.isError(n)&&i&&x(n,r)||s)&&g(n,r,"Got unwanted exception"+a),e&&n&&r&&!x(n,r)||!e&&n)throw n}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(v(e.actual),128)+" "+e.operator+" "+m(v(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var a=r.stack,n=p(t),i=a.indexOf("\n"+n);if(i>=0){var o=a.indexOf("\n",i+1);a=a.substring(o+1)}this.stack=a}}},o.inherits(d.AssertionError,Error),d.fail=g,d.ok=y,d.equal=function(e,t,r){e!=t&&g(e,t,r,"==",d.equal)},d.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",d.notEqual)},d.deepEqual=function(e,t,r){b(e,t,!1)||g(e,t,r,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,r){b(e,t,!0)||g(e,t,r,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,r){b(e,t,!1)&&g(e,t,r,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,r,a){b(t,r,!0)&&g(t,r,a,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",d.strictEqual)},d.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",d.notStrictEqual)},d.throws=function(e,t,r){_(!0,e,t,r)},d.doesNotThrow=function(e,t,r){_(!1,e,t,r)},d.ifError=function(e){if(e)throw e},d.strict=a((function e(t,r){t||g(t,!0,r,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var A=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}}).call(this,r(4))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(29);Object.defineProperty(t,"CopyShader",{enumerable:!0,get:function(){return h(a).default}});var n=r(8);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return h(n).default}});var i=r(45);Object.defineProperty(t,"ShaderPass",{enumerable:!0,get:function(){return h(i).default}});var o=r(88);Object.defineProperty(t,"RenderingPass",{enumerable:!0,get:function(){return h(o).default}});var s=r(89);Object.defineProperty(t,"TexturePass",{enumerable:!0,get:function(){return h(s).default}});var l=r(90);Object.defineProperty(t,"RenderPass",{enumerable:!0,get:function(){return h(l).default}});var u=r(46);Object.defineProperty(t,"MaskPass",{enumerable:!0,get:function(){return h(u).default}});var c=r(47);Object.defineProperty(t,"ClearMaskPass",{enumerable:!0,get:function(){return h(c).default}});var f=r(91);Object.defineProperty(t,"ClearPass",{enumerable:!0,get:function(){return h(f).default}});var d=r(92);function h(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h(d).default}})},function(e,t,r){var a,n,i,o,s;a=r(180),n=r(76).utf8,i=r(181),o=r(76).bin,(s=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):n.stringToBytes(e):i(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());for(var r=a.bytesToWords(e),l=8*e.length,u=1732584193,c=-271733879,f=-1732584194,d=271733878,h=0;h>>24)|4278255360&(r[h]<<24|r[h]>>>8);r[l>>>5]|=128<>>9<<4)]=l;var p=s._ff,m=s._gg,v=s._hh,g=s._ii;for(h=0;h>>0,c=c+b>>>0,f=f+w>>>0,d=d+x>>>0}return a.endian([u,c,f,d])})._ff=function(e,t,r,a,n,i,o){var s=e+(t&r|~t&a)+(n>>>0)+o;return(s<>>32-i)+t},s._gg=function(e,t,r,a,n,i,o){var s=e+(t&a|r&~a)+(n>>>0)+o;return(s<>>32-i)+t},s._hh=function(e,t,r,a,n,i,o){var s=e+(t^r^a)+(n>>>0)+o;return(s<>>32-i)+t},s._ii=function(e,t,r,a,n,i,o){var s=e+(r^(t|~a))+(n>>>0)+o;return(s<>>32-i)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var r=a.wordsToBytes(s(e,t));return t&&t.asBytes?r:t&&t.asString?o.bytesToString(r):a.bytesToHex(r)}},function(e,t,r){function a(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.i=function(e){return e},r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/",r.oe=function(e){throw console.error(e),e};var a=r(r.s=ENTRY_MODULE);return a.default||a}var n="[\\.|\\-|\\+|\\w|/|@]+",i="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+n+").*?\\)";function o(e){return(e+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(e,t,a){var s={};s[a]=[];var l=t.toString(),u=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!u)return s;for(var c,f=u[1],d=new RegExp("(\\\\n|\\W)"+o(f)+i,"g");c=d.exec(l);)"dll-reference"!==c[3]&&s[a].push(c[3]);for(d=new RegExp("\\("+o(f)+'\\("(dll-reference\\s('+n+'))"\\)\\)'+i,"g");c=d.exec(l);)e[c[2]]||(s[a].push(c[1]),e[c[2]]=r(c[1]).m),s[c[2]]=s[c[2]]||[],s[c[2]].push(c[4]);for(var h,p=Object.keys(s),m=0;m0}),!1)}e.exports=function(e,t){t=t||{};var n={main:r.m},i=t.all?{main:Object.keys(n.main)}:function(e,t){for(var r={main:[t]},a={main:[]},n={main:{}};l(r);)for(var i=Object.keys(r),o=0;o-1?a:i.nextTick;y.WritableState=g;var u=r(19);u.inherits=r(6);var c={deprecate:r(57)},f=r(55),d=r(23).Buffer,h=n.Uint8Array||function(){};var p,m=r(56);function v(){}function g(e,t){s=s||r(12),e=e||{};var a=t instanceof s;this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:a&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,a=r.sync,n=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,a,n){--t.pendingcb,r?(i.nextTick(n,a),i.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",a)):(n(a),e._writableState.errorEmitted=!0,e.emit("error",a),E(e,t))}(e,r,a,t,n);else{var o=_(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),a?l(w,e,r,o,n):w(e,r,o,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(e){if(s=s||r(12),!(p.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,r,a,n,i,o){t.writelen=a,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,i,t.onwrite),t.sync=!1}function w(e,t,r,a){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,a(),E(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var a=t.bufferedRequestCount,n=new Array(a),i=t.corkedRequestsFree;i.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,b(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback;if(b(e,t,!1,t.objectMode?1:u.length,u,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),E(e,t)}))}function E(e,t){var r=_(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(A,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}u.inherits(y,f),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===y&&(e&&e._writableState instanceof g)}})):p=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var a,n=this._writableState,o=!1,s=!n.objectMode&&(a=e,d.isBuffer(a)||a instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}(this,r):(s||function(e,t,r,a){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),i.nextTick(a,o),n=!1),n}(this,n,e,r))&&(n.pendingcb++,o=function(e,t,r,a,n,i){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,a,n);a!==o&&(r=!0,n="buffer",a=o)}var s=t.objectMode?1:a.length;t.length+=s;var l=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var a=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),a.corked&&(a.corked=1,this.uncork()),a.ending||a.finished||function(e,t,r){t.ending=!0,E(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,a,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=m.destroy,y.prototype._undestroy=m.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(5),r(109).setImmediate,r(4))},function(e,t,r){"use strict";var a=r(128),n=r(36),i=r(14),o=r(60),s=r(130);function l(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return l.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof o)return p(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var n,i,s,c=u.call(this,t,r);return c&&(n=c.schema,t=c.root,s=c.baseId),n instanceof o?i=n.validate||e.call(this,n.schema,t,void 0,s):void 0!==n&&(i=p(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,s)),i}function u(e,t){var r=a.parse(t),n=v(r),i=m(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==i){var s=y(n),l=this._refs[s];if("string"==typeof l)return c.call(this,e,l,r);if(l instanceof o)l.validate||this._compile(l),e=l;else{if(!((l=this._schemas[s])instanceof o))return;if(l.validate||this._compile(l),s==y(t))return{schema:l,root:e,baseId:i};e=l}if(!e.schema)return;i=m(this._getId(e.schema))}return d.call(this,r,i,e.schema,e)}function c(e,t,r){var a=u.call(this,e,t);if(a){var n=a.schema,i=a.baseId;e=a.root;var o=this._getId(n);return o&&(i=b(i,o)),d.call(this,r,i,n,e)}}e.exports=l,l.normalizeId=y,l.fullPath=m,l.url=b,l.ids=function(e){var t=y(this._getId(e)),r={"":t},o={"":m(t,!1)},l={},u=this;return s(e,{allKeys:!0},(function(e,t,s,c,f,d,h){if(""!==t){var p=u._getId(e),m=r[c],v=o[c]+"/"+f;if(void 0!==h&&(v+="/"+("number"==typeof h?h:i.escapeFragment(h))),"string"==typeof p){p=m=y(m?a.resolve(m,p):p);var g=u._refs[p];if("string"==typeof g&&(g=u._refs[g]),g&&g.schema){if(!n(e,g.schema))throw new Error('id "'+p+'" resolves to more than one schema')}else if(p!=y(v))if("#"==p[0]){if(l[p]&&!n(e,l[p]))throw new Error('id "'+p+'" resolves to more than one schema');l[p]=e}else u._refs[p]=v}r[t]=m,o[t]=v}})),l},l.inlineRef=p,l.schema=u;var f=i.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(e,t,r,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var n=e.fragment.split("/"),o=1;o{if(e.file){let r=new FileReader;r.onload=function(){let e=this.result,r=new Uint8Array(e);t(r)},r.readAsArrayBuffer(e.file)}else if(e.url){let r=new XMLHttpRequest;r.open("GET",e.url,!0),r.responseType="arraybuffer",r.onloadend=function(){if(200===r.status){let e=new Uint8Array(r.response||r.responseText);t(e)}},r.send()}else e.raw?e.raw instanceof Uint8Array?t(e.raw):t(new Uint8Array(e.raw)):r()})}function o(e,t){return new Promise((r,a)=>{if("compound"===e.type)if(e.value.hasOwnProperty("blocks")&&(e.value.hasOwnProperty("palette")||e.value.hasOwnProperty("palettes"))){let a;if(e.value.hasOwnProperty("palette"))a=e.value.palette.value.value;else{if(void 0===t&&(t=0),t>=e.value.palettes.value.value.length||!e.value.palettes.value.value[t])return void console.warn("Specified palette index ("+t+") is outside of available palettes ("+e.value.palettes.value.value.length+")");a=e.value.palettes.value.value[t].value}let n=[];for(let e=0;e{let n=e.value.Width.value,i=e.value.Height.value,o=e.value.Length.value,s=function(t,r,a){let i=(r*o+a)*n+t;return{id:255&(e.value.Blocks.value[i]||0),data:e.value.Data.value[i]||0}},l=function(e,r){let a=t.blocks[e+":"+r];return a||(console.warn("Missing legacy mapping for "+e+":"+r),"minecraft:air")},u=[];for(let e=0;e{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);o(r).then(e=>{t(e)})})})},n.prototype.schematicToModels=function(e,t){i(e).then(e=>{a.parse(e,(e,r)=>{if(e)return console.warn("Error while parsing NBT data"),void console.warn(e);let a=new XMLHttpRequest;a.open("GET","https://minerender.org/res/idsToNames.json",!0),a.onloadend=function(){if(200===a.status){console.log(a.response||a.responseText);let e=JSON.parse(a.response||a.responseText);s(r,e).then(e=>t(e))}},a.send()})})},n.loadNBT=i,n.parseStructureData=o,n.parseSchematicData=s;let l={stained_glass:function(e){return e.color.value+"_stained_glass"},planks:function(e){return e.variant.value+"_planks"}};n.prototype.constructor=n,window.ModelConverter=n,t.a=n},function(e,t,r){const a=r(102),n=r(119).ProtoDef,i=r(178).compound,o=JSON.stringify(r(179)),s=o.replace(/(i[0-9]+)/g,"l$1");function l(e){const t=new n;return t.addType("compound",i),t.addTypes(JSON.parse(e?s:o)),t}const u=l(!1),c=l(!0);function f(e,t){return(t?c:u).parsePacketBuffer("nbt",e).data}const d=function(e){let t=!0;return 31!==e[0]&&(t=!1),139!==e[1]&&(t=!1),t};e.exports={writeUncompressed:function(e,t){return(t?c:u).createPacketBuffer("nbt",e)},parseUncompressed:f,simplify:function e(t){return function t(r,a){return"compound"===a?Object.keys(r).reduce((function(t,a){return t[a]=e(r[a]),t}),{}):"list"===a?r.value.map((function(e){return t(e,r.type)})):r}(t.value,t.type)},parse:function(e,t,r){let n=!1;"function"==typeof t?r=t:n=t,d(e)?a.gunzip(e,(function(t,a){t?r(t,e):r(null,f(a,n))})):r(null,f(e,n))},proto:u,protoLE:c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(){function e(e,t){for(var r=0;r4?9:0)}function $(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){i._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ae(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ne(e,t){var r,a,n=e.max_chain_length,i=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-D?e.strstart-(e.w_size-D):0,u=e.window,c=e.w_mask,f=e.prev,d=e.strstart+N,h=u[i+o-1],p=u[i+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===p&&u[r+o-1]===h&&u[r]===u[i]&&u[++r]===u[i+1]){i+=2,r++;do{}while(u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&io){if(e.match_start=t,o=a,a>=s)break;h=u[i+o-1],p=u[i+o]}}}while((t=f[t&c])>l&&0!=--n);return o<=e.lookahead?o:e.lookahead}function ie(e){var t,r,a,i,l,u,c,f,d,h,p=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-D)){n.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;do{a=e.head[--t],e.head[t]=a>=p?a-p:0}while(--r);t=r=p;do{a=e.prev[--t],e.prev[t]=a>=p?a-p:0}while(--r);i+=p}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,f=e.strstart+e.lookahead,d=i,h=void 0,(h=u.avail_in)>d&&(h=d),r=0===h?0:(u.avail_in-=h,n.arraySet(c,u.input,u.next_in,h,f),1===u.state.wrap?u.adler=o(u.adler,c,h,f):2===u.state.wrap&&(u.adler=s(u.adler,c,h,f)),u.next_in+=h,u.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=I)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I)if(a=i._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=I-1)),e.prev_length>=I&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-I,a=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<15&&(s=2,a-=16),i<1||i>T||r!==M||a<8||a>15||t<0||t>9||o<0||o>A)return K(e,v);8===a&&(a=9);var l=new ue;return e.state=l,l.strm=e,l.wrap=s,l.gzhead=null,l.w_bits=a,l.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ie(e),0===e.lookahead&&t===u)return Y;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+r;if((0===e.strstart||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,te(e,!1),0===e.strm.avail_out))return Y;if(e.strstart-e.block_start>=e.w_size-D&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),Y)})),new le(4,4,8,4,oe),new le(4,5,16,8,oe),new le(4,6,32,32,oe),new le(4,4,16,16,se),new le(8,16,32,32,se),new le(8,16,128,128,se),new le(8,32,128,256,se),new le(32,128,258,1024,se),new le(32,258,258,4096,se)],t.deflateInit=function(e,t){return de(e,t,M,P,F,E)},t.deflateInit2=de,t.deflateReset=fe,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?v:(e.state.gzhead=t,p):v},t.deflate=function(e,t){var r,n,o,l;if(!e||!e.state||t>h||t<0)return e?K(e,v):v;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===X&&t!==d)return K(e,0===e.avail_out?y:v);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===j)if(2===n.wrap)e.adler=0,re(n,31),re(n,139),re(n,8),n.gzhead?(re(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),re(n,255&n.gzhead.time),re(n,n.gzhead.time>>8&255),re(n,n.gzhead.time>>16&255),re(n,n.gzhead.time>>24&255),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(re(n,255&n.gzhead.extra.length),re(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=s(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=B):(re(n,0),re(n,0),re(n,0),re(n,0),re(n,0),re(n,9===n.level?2:n.strategy>=x||n.level<2?4:0),re(n,Z),n.status=H);else{var g=M+(n.w_bits-8<<4)<<8;g|=(n.strategy>=x||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(g|=U),g+=31-g%31,n.status=H,ae(n,g),0!==n.strstart&&(ae(n,e.adler>>>16),ae(n,65535&e.adler)),e.adler=1}if(n.status===B)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending!==n.pending_buf_size));)re(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=V)}else n.status=V;if(n.status===V)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.gzindex=0,n.status=z)}else n.status=z;if(n.status===z)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),ee(e),o=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindexo&&(e.adler=s(e.adler,n.pending_buf,n.pending-o,o)),0===l&&(n.status=G)}else n.status=G;if(n.status===G&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&ee(e),n.pending+2<=n.pending_buf_size&&(re(n,255&e.adler),re(n,e.adler>>8&255),e.adler=0,n.status=H)):n.status=H),0!==n.pending){if(ee(e),0===e.avail_out)return n.last_flush=-1,p}else if(0===e.avail_in&&J(t)<=J(r)&&t!==d)return K(e,y);if(n.status===X&&0!==e.avail_in)return K(e,y);if(0!==e.avail_in||0!==n.lookahead||t!==u&&n.status!==X){var b=n.strategy===x?function(e,t){for(var r;;){if(0===e.lookahead&&(ie(e),0===e.lookahead)){if(t===u)return Y;break}if(e.match_length=0,r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):n.strategy===_?function(e,t){for(var r,a,n,o,s=e.window;;){if(e.lookahead<=N){if(ie(e),e.lookahead<=N&&t===u)return Y;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&e.strstart>0&&(a=s[n=e.strstart-1])===s[++n]&&a===s[++n]&&a===s[++n]){o=e.strstart+N;do{}while(a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&a===s[++n]&&ne.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=i._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return Y}return e.insert=0,t===d?(te(e,!0),0===e.strm.avail_out?q:Q):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?Y:W}(n,t):a[n.level].func(n,t);if(b!==q&&b!==Q||(n.status=X),b===Y||b===q)return 0===e.avail_out&&(n.last_flush=-1),p;if(b===W&&(t===c?i._tr_align(n):t!==h&&(i._tr_stored_block(n,0,0,!1),t===f&&($(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),ee(e),0===e.avail_out))return n.last_flush=-1,p}return t!==d?p:n.wrap<=0?m:(2===n.wrap?(re(n,255&e.adler),re(n,e.adler>>8&255),re(n,e.adler>>16&255),re(n,e.adler>>24&255),re(n,255&e.total_in),re(n,e.total_in>>8&255),re(n,e.total_in>>16&255),re(n,e.total_in>>24&255)):(ae(n,e.adler>>>16),ae(n,65535&e.adler)),ee(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?p:m)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==j&&t!==B&&t!==V&&t!==z&&t!==G&&t!==H&&t!==X?K(e,v):(e.state=null,t===H?K(e,g):p):v},t.deflateSetDictionary=function(e,t){var r,a,i,s,l,u,c,f,d=t.length;if(!e||!e.state)return v;if(2===(s=(r=e.state).wrap)||1===s&&r.status!==j||r.lookahead)return v;for(1===s&&(e.adler=o(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&($(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new n.Buf8(r.w_size),n.arraySet(f,t,d-r.w_size,r.w_size,0),t=f,d=r.w_size),l=e.avail_in,u=e.next_in,c=e.input,e.avail_in=d,e.next_in=0,e.input=t,ie(r);r.lookahead>=I;){a=r.strstart,i=r.lookahead-(I-1);do{r.ins_h=(r.ins_h<>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{i=i+(n=n+t[a++]|0)|0}while(--o);n%=65521,i%=65521}return n|i<<16|0}},function(e,t,r){"use strict";var a=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var a=0;a<8;a++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t,r,n){var i=a,o=n+r;e^=-1;for(var s=n;s>>8^i[255&(e^t[s])];return-1^e}},function(e,t,r){"use strict";var a=r(9),n=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var o=new a.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function l(e,t){if(t<65534&&(e.subarray&&i||!e.subarray&&n))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var r="",o=0;o>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return l(e,e.length)},t.binstring2buf=function(e){for(var t=new a.Buf8(e.length),r=0,n=t.length;r4)u[a++]=65533,r+=i-1;else{for(n&=2===i?31:3===i?15:7;i>1&&r1?u[a++]=65533:n<65536?u[a++]=n:(n-=65536,u[a++]=55296|n>>10&1023,u[a++]=56320|1023&n)}return l(u,a)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+o[e[r]]>t?r:t}},function(e,t,r){"use strict";var a=r(9),n=r(49),i=r(50),o=r(99),s=r(100),l=0,u=1,c=2,f=4,d=5,h=6,p=0,m=1,v=2,g=-2,y=-3,b=-4,w=-5,x=8,_=1,A=2,E=3,S=4,M=5,T=6,P=7,F=8,O=9,L=10,C=11,k=12,R=13,I=14,N=15,D=16,U=17,j=18,B=19,V=20,z=21,G=22,H=23,X=24,Y=25,W=26,q=27,Q=28,Z=29,K=30,J=31,$=32,ee=852,te=592,re=15;function ae(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ne(){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 a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ie(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=_,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new a.Buf32(ee),t.distcode=t.distdyn=new a.Buf32(te),t.sane=1,t.back=-1,p):g}function oe(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,ie(e)):g}function se(e,t){var r,a;return e&&e.state?(a=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?g:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=r,a.wbits=t,oe(e))):g}function le(e,t){var r,a;return e?(a=new ne,e.state=a,a.window=null,(r=se(e,t))!==p&&(e.state=null),r):g}var ue,ce,fe=!0;function de(e){if(fe){var t;for(ue=new a.Buf32(512),ce=new a.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,ue,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(c,e.lens,0,32,ce,0,e.work,{bits:5}),fe=!1}e.lencode=ue,e.lenbits=9,e.distcode=ce,e.distbits=5}function he(e,t,r,n){var i,o=e.state;return null===o.window&&(o.wsize=1<=o.wsize?(a.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),a.arraySet(o.window,t,r-n,i,o.wnext),(n-=i)?(a.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave>>8&255,r.check=i(r.check,Te,2,0),se=0,le=0,r.mode=A;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=K;break}if((15&se)!==x){e.msg="unknown compression method",r.mode=K;break}if(le-=4,_e=8+(15&(se>>>=4)),0===r.wbits)r.wbits=_e;else if(_e>r.wbits){e.msg="invalid window size",r.mode=K;break}r.dmax=1<<_e,e.adler=r.check=1,r.mode=512&se?L:k,se=0,le=0;break;case A:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8&1),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=E;case E:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,Te[2]=se>>>16&255,Te[3]=se>>>24&255,r.check=i(r.check,Te,4,0)),se=0,le=0,r.mode=S;case S:for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>8),512&r.flags&&(Te[0]=255&se,Te[1]=se>>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0,r.mode=M;case M:if(1024&r.flags){for(;le<16;){if(0===ie)break e;ie--,se+=ee[re++]<>>8&255,r.check=i(r.check,Te,2,0)),se=0,le=0}else r.head&&(r.head.extra=null);r.mode=T;case T:if(1024&r.flags&&((fe=r.length)>ie&&(fe=ie),fe&&(r.head&&(_e=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),a.arraySet(r.head.extra,ee,re,fe,_e)),512&r.flags&&(r.check=i(r.check,ee,fe,re)),ie-=fe,re+=fe,r.length-=fe),r.length))break e;r.length=0,r.mode=P;case P:if(2048&r.flags){if(0===ie)break e;fe=0;do{_e=ee[re+fe++],r.head&&_e&&r.length<65536&&(r.head.name+=String.fromCharCode(_e))}while(_e&&fe>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=k;break;case L:for(;le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>=7&le,le-=7&le,r.mode=q;break}for(;le<3;){if(0===ie)break e;ie--,se+=ee[re++]<>>=1)){case 0:r.mode=I;break;case 1:if(de(r),r.mode=V,t===h){se>>>=2,le-=2;break e}break;case 2:r.mode=U;break;case 3:e.msg="invalid block type",r.mode=K}se>>>=2,le-=2;break;case I:for(se>>>=7&le,le-=7≤le<32;){if(0===ie)break e;ie--,se+=ee[re++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=K;break}if(r.length=65535&se,se=0,le=0,r.mode=N,t===h)break e;case N:r.mode=D;case D:if(fe=r.length){if(fe>ie&&(fe=ie),fe>oe&&(fe=oe),0===fe)break e;a.arraySet(te,ee,re,fe,ne),ie-=fe,re+=fe,oe-=fe,ne+=fe,r.length-=fe;break}r.mode=k;break;case U:for(;le<14;){if(0===ie)break e;ie--,se+=ee[re++]<>>=5,le-=5,r.ndist=1+(31&se),se>>>=5,le-=5,r.ncode=4+(15&se),se>>>=4,le-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=K;break}r.have=0,r.mode=j;case j:for(;r.have>>=3,le-=3}for(;r.have<19;)r.lens[Pe[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},Ae=s(l,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid code lengths set",r.mode=K;break}r.have=0,r.mode=B;case B:for(;r.have>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=ve,le-=ve,r.lens[r.have++]=ye;else{if(16===ye){for(Se=ve+2;le>>=ve,le-=ve,0===r.have){e.msg="invalid bit length repeat",r.mode=K;break}_e=r.lens[r.have-1],fe=3+(3&se),se>>>=2,le-=2}else if(17===ye){for(Se=ve+3;le>>=ve)),se>>>=3,le-=3}else{for(Se=ve+7;le>>=ve)),se>>>=7,le-=7}if(r.have+fe>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=K;break}for(;fe--;)r.lens[r.have++]=_e}}if(r.mode===K)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=K;break}if(r.lenbits=9,Ee={bits:r.lenbits},Ae=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Ae){e.msg="invalid literal/lengths set",r.mode=K;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},Ae=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,Ae){e.msg="invalid distances set",r.mode=K;break}if(r.mode=V,t===h)break e;case V:r.mode=z;case z:if(ie>=6&&oe>=258){e.next_out=ne,e.avail_out=oe,e.next_in=re,e.avail_in=ie,r.hold=se,r.bits=le,o(e,ce),ne=e.next_out,te=e.output,oe=e.avail_out,re=e.next_in,ee=e.input,ie=e.avail_in,se=r.hold,le=r.bits,r.mode===k&&(r.back=-1);break}for(r.back=0;ge=(Me=r.lencode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,r.length=ye,0===ge){r.mode=W;break}if(32&ge){r.back=-1,r.mode=k;break}if(64&ge){e.msg="invalid literal/length code",r.mode=K;break}r.extra=15&ge,r.mode=G;case G:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=H;case H:for(;ge=(Me=r.distcode[se&(1<>>16&255,ye=65535&Me,!((ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>be)])>>>16&255,ye=65535&Me,!(be+(ve=Me>>>24)<=le);){if(0===ie)break e;ie--,se+=ee[re++]<>>=be,le-=be,r.back+=be}if(se>>>=ve,le-=ve,r.back+=ve,64&ge){e.msg="invalid distance code",r.mode=K;break}r.offset=ye,r.extra=15&ge,r.mode=X;case X:if(r.extra){for(Se=r.extra;le>>=r.extra,le-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=K;break}r.mode=Y;case Y:if(0===oe)break e;if(fe=ce-oe,r.offset>fe){if((fe=r.offset-fe)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=K;break}fe>r.wnext?(fe-=r.wnext,pe=r.wsize-fe):pe=r.wnext-fe,fe>r.length&&(fe=r.length),me=r.window}else me=te,pe=ne-r.offset,fe=r.length;fe>oe&&(fe=oe),oe-=fe,r.length-=fe;do{te[ne++]=me[pe++]}while(--fe);0===r.length&&(r.mode=z);break;case W:if(0===oe)break e;te[ne++]=r.length,oe--,r.mode=z;break;case q:if(r.wrap){for(;le<32;){if(0===ie)break e;ie--,se|=ee[re++]<0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),a?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?x(e,o,t,!1):M(e,o)):x(e,o,t,!1))):a||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=_?e=_:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?n.nextTick(S,e):S(e))}function S(e){h("emit readable"),e.emit("readable"),O(e)}function M(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var a;ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(o));break}++a}return t.length-=a,n}(e,t):function(e,t){var r=u.allocUnsafe(e),a=t.head,n=1;a.data.copy(r),e-=a.data.length;for(;a=a.next;){var i=a.data,o=e>i.length?i.length:e;if(i.copy(r,r.length-e,0,o),0===(e-=o)){o===i.length?(++n,a.next?t.head=a.next:t.head=t.tail=null):(t.head=a,a.data=i.slice(o));break}++n}return t.length-=n,r}(e,t);return a}(e,t.buffer,t.decoder),r);var r}function C(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,n.nextTick(k,t,e))}function k(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function R(e,t){for(var r=0,a=e.length;r=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?C(this):E(this),null;if(0===(e=A(e,t))&&t.ended)return 0===t.length&&C(this),null;var a,n=t.needReadable;return h("need readable",n),(0===t.length||t.length-e0?L(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&C(this)),null!==a&&this.emit("data",a),a},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,h("pipe count=%d opts=%j",i.pipesCount,t);var l=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?c:b;function u(t,a){h("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,h("cleanup"),e.removeListener("close",g),e.removeListener("finish",y),e.removeListener("drain",f),e.removeListener("error",v),e.removeListener("unpipe",u),r.removeListener("end",c),r.removeListener("end",b),r.removeListener("data",m),d=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){h("onend"),e.end()}i.endEmitted?n.nextTick(l):r.once("end",l),e.on("unpipe",u);var f=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(r);e.on("drain",f);var d=!1;var p=!1;function m(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==R(i.pipes,e))&&!d&&(h("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function v(t){h("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function g(){e.removeListener("finish",y),b()}function y(){h("onfinish"),e.removeListener("close",g),b()}function b(){h("unpipe"),r.unpipe(e)}return r.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",v),e.once("close",g),e.once("finish",y),e.emit("pipe",r),i.flowing||(h("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i=i)return e;switch(e){case"%s":return String(a[r++]);case"%d":return Number(a[r++]);case"%j":try{return JSON.stringify(a[r++])}catch(e){return"[Circular]"}default:return e}})),l=a[r];r=3&&(a.depth=arguments[2]),arguments.length>=4&&(a.colors=arguments[3]),p(r)?a.showHidden=r:r&&t._extend(a,r),y(a.showHidden)&&(a.showHidden=!1),y(a.depth)&&(a.depth=2),y(a.colors)&&(a.colors=!1),y(a.customInspect)&&(a.customInspect=!0),a.colors&&(a.stylize=l),c(a,e,a.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function u(e,t){return e}function c(e,r,a){if(e.customInspect&&r&&A(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(a,e);return g(n)||(n=c(e,n,a)),n}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return f(r);if(0===o.length){if(A(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return f(r)}var u,w="",E=!1,S=["{","}"];(h(r)&&(E=!0,S=["[","]"]),A(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),x(r)&&(w=" "+Date.prototype.toUTCString.call(r)),_(r)&&(w=" "+f(r)),0!==o.length||E&&0!=r.length?a<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=E?function(e,t,r,a,n){for(var i=[],o=0,s=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,w,S)):S[0]+w+S[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,a,n,i){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),P(a,n)||(o="["+n+"]"),s||(e.seen.indexOf(l.value)<0?(s=m(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(i&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function x(e){return w(e)&&"[object Date]"===E(e)}function _(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function A(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(y(i)&&(i=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!o[r])if(new RegExp("\\b"+r+"\\b","i").test(i)){var a=e.pid;o[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,a,e)}}else o[r]=function(){};return o[r]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=h,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=b,t.isObject=w,t.isDate=x,t.isError=_,t.isFunction=A,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(118);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=r(6),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),a=r.length;a--;)e[r[a]]=t[r[a]];return e};var F="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(F&&e[F]){var t;if("function"!=typeof(t=e[F]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,F,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,a=new Promise((function(e,a){t=e,r=a})),n=[],i=0;i",y=h?">":"<",b=void 0;if(v){var w=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+i,_="exclType"+i,A="exclIsNumber"+i,E="' + "+(T="op"+i)+" + '";n+=" var schemaExcl"+i+" = "+w+"; ",n+=" var "+x+"; var "+_+" = typeof "+(w="schemaExcl"+i)+"; if ("+_+" != 'boolean' && "+_+" != 'undefined' && "+_+" != 'number') { ";var S;b=p;(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+p+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var M=n;n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+_+" == 'number' ? ( ("+x+" = "+a+" === undefined || "+w+" "+g+"= "+a+") ? "+f+" "+y+"= "+w+" : "+f+" "+y+" "+a+" ) : ( ("+x+" = "+w+" === true) ? "+f+" "+y+"= "+a+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { var op"+i+" = "+x+" ? '"+g+"' : '"+g+"='; ",void 0===s&&(b=p,u=e.errSchemaPath+"/"+p,a=w,d=v)}else{E=g;if((A="number"==typeof m)&&d){var T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" ( "+a+" === undefined || "+m+" "+g+"= "+a+" ? "+f+" "+y+"= "+m+" : "+f+" "+y+" "+a+" ) || "+f+" !== "+f+") { "}else{A&&void 0===s?(x=!0,b=p,u=e.errSchemaPath+"/"+p,a=m,y+="="):(A&&(a=Math[h?"min":"max"](m,s)),m===(!A||a)?(x=!0,b=p,u=e.errSchemaPath+"/"+p,y+="="):(x=!1,E+="="));T="'"+E+"'";n+=" if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+" "+y+" "+a+" || "+f+" !== "+f+") { "}}b=b||t,(S=S||[]).push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(b||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+T+", limit: "+a+", exclusive: "+x+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+E+" ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";M=n;return n=S.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+M+"]); ":n+=" validate.errors = ["+M+"]; return false; ":n+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" "+f+".length "+("maxItems"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s;var h="maxLength"==t?">":"<";n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),!1===e.opts.unicode?n+=" "+f+".length ":n+=" ucs2length("+f+") ",n+=" "+h+" "+a+") { ";var p=t,m=m||[];m.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var v=n;return n=m.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+v+"]); ":n+=" validate.errors = ["+v+"]; return false; ":n+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'number') || "),n+=" Object.keys("+f+").length "+("maxProperties"==t?">":"<")+" "+a+") { ";var h=t,p=p||[];p.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(h||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"fewer",n+=" than ",n+=d?"' + "+a+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var m=n;return n=p.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},function(e){e.exports=JSON.parse('{"switch":{"title":"switch","type":"array","items":[{"enum":["switch"]},{"type":"object","properties":{"compareTo":{"$ref":"definitions#/definitions/contextualizedFieldName"},"compareToValue":{"type":"string"},"fields":{"type":"object","patternProperties":{"^[-a-zA-Z0-9 _:]+$":{"$ref":"dataType"}},"additionalProperties":false},"default":{"$ref":"dataType"}},"oneOf":[{"required":["compareTo","fields"]},{"required":["compareToValue","fields"]}],"additionalProperties":false}],"additionalItems":false},"option":{"title":"option","type":"array","items":[{"enum":["option"]},{"$ref":"dataType"}],"additionalItems":false}}')},function(e,t,r){"use strict";(function(t,a){var n;e.exports=S,S.ReadableState=E;r(18).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(70),s=r(7).Buffer,l=t.Uint8Array||function(){};var u,c=r(171);u=c&&c.debuglog?c.debuglog("stream"):function(){};var f,d,h,p=r(172),m=r(71),v=r(72).getHighWaterMark,g=r(15).codes,y=g.ERR_INVALID_ARG_TYPE,b=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,x=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6)(S,o);var _=m.errorOrDestroy,A=["error","close","destroy","pause","resume"];function E(e,t,a){n=n||r(16),e=e||{},"boolean"!=typeof a&&(a=t instanceof n),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",a),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(24).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function S(e){if(n=n||r(16),!(this instanceof S))return new S(e);var t=this instanceof n;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function M(e,t,r,a,n){u("readableAddChunk",t);var i,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(u("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,L(e)))}(e,o);else if(n||(i=function(e,t){var r;a=t,s.isBuffer(a)||a instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t));var a;return r}(o,t)),i)_(e,i);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),a)o.endEmitted?_(e,new x):T(e,o,t,!0);else if(o.ended)_(e,new b);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):C(e,o)):T(e,o,t,!1)}else a||(o.reading=!1,C(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,a.nextTick(L,e))}function L(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function C(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(k,e,t))}function k(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function I(e){u("readable nexttick read 0"),e.read(0)}function N(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function U(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,a.nextTick(B,t,e))}function B(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function V(e,t){for(var r=0,a=e.length;r=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=F(e,t))&&t.ended)return 0===t.length&&j(this),null;var a,n=t.needReadable;return u("need readable",n),(0===t.length||t.length-e0?U(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==a&&this.emit("data",a),a},S.prototype._read=function(e){_(this,new w("_read()"))},S.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,u("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==a.stdout&&e!==a.stderr?l:v;function s(t,a){u("onunpipe"),t===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,u("cleanup"),e.removeListener("close",p),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",v),r.removeListener("data",d),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){u("onend"),e.end()}n.endEmitted?a.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var f=!1;function d(t){u("ondata");var a=e.write(t);u("dest.write",a),!1===a&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==V(n.pipes,e))&&!f&&(u("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){u("onerror",t),v(),e.removeListener("error",h),0===i(e,"error")&&_(e,t)}function p(){e.removeListener("finish",m),v()}function m(){u("onfinish"),e.removeListener("close",p),v()}function v(){u("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",m),e.emit("pipe",r),n.flowing||(u("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var a=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,u("on readable",n.length,n.reading),n.length?O(this):n.reading||a.nextTick(I,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&a.nextTick(R,this),r},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||a.nextTick(R,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,a.nextTick(N,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,a=!1;for(var n in e.on("end",(function(){if(u("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(u("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(a=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var i=0;i-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,L(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=f.destroy,S.prototype._undestroy=f.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this,r(4),r(5))},function(e,t,r){"use strict";e.exports=c;var a=r(15).codes,n=a.ERR_METHOD_NOT_IMPLEMENTED,i=a.ERR_MULTIPLE_CALLBACK,o=a.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=a.ERR_TRANSFORM_WITH_LENGTH_0,l=r(16);function u(e,t){var r=this._transformState;r.transforming=!1;var a=r.writecb;if(null===a)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),a(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length{i=!0,o.needsUpdate=!0,u&&(u.needsUpdate=!0);let c=-1;32===o.image.height?c=0:64===o.image.height?c=1:console.error("Couldn't detect texture version. Invalid dimensions: "+o.image.width+"x"+o.image.height),console.log("Skin Texture Version: "+c),o.magFilter=t.NearestFilter,o.minFilter=t.NearestFilter,o.anisotropy=0,u&&(u.magFilter=t.NearestFilter,u.minFilter=t.NearestFilter,u.anisotropy=0,u.format=t.RGBFormat),32===o.image.height&&(o.format=t.RGBFormat),n.attached||n._scene?console.log("[SkinRender] is attached - skipping scene init"):super.initScene((function(){n.element.dispatchEvent(new CustomEvent("skinRender",{detail:{playerModel:n.playerModel}}))})),console.log("Slim: "+f);let d=function(e,r,n,i,o){console.log("capeType: "+o);let u=new t.Object3D;u.name="headGroup",u.position.x=0,u.position.y=28,u.position.z=0,u.translateOnAxis(new t.Vector3(0,1,0),-4);let c=s(e,8,8,8,a.a.head[n],i,"head");if(c.translateOnAxis(new t.Vector3(0,1,0),4),u.add(c),n>=1){let r=s(e,8.504,8.504,8.504,a.a.hat,i,"hat",!0);r.translateOnAxis(new t.Vector3(0,1,0),4),u.add(r)}let f=new t.Object3D;f.name="bodyGroup",f.position.x=0,f.position.y=18,f.position.z=0;let d=s(e,8,12,4,a.a.body[n],i,"body");if(f.add(d),n>=1){let t=s(e,8.504,12.504,4.504,a.a.jacket,i,"jacket",!0);f.add(t)}let h=new t.Object3D;h.name="leftArmGroup",h.position.x=i?-5.5:-6,h.position.y=18,h.position.z=0,h.translateOnAxis(new t.Vector3(0,1,0),4);let p=s(e,i?3:4,12,4,a.a.leftArm[n],i,"leftArm");if(p.translateOnAxis(new t.Vector3(0,1,0),-4),h.add(p),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.leftSleeve,i,"leftSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),h.add(r)}let m=new t.Object3D;m.name="rightArmGroup",m.position.x=i?5.5:6,m.position.y=18,m.position.z=0,m.translateOnAxis(new t.Vector3(0,1,0),4);let v=s(e,i?3:4,12,4,a.a.rightArm[n],i,"rightArm");if(v.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(v),n>=1){let r=s(e,i?3.504:4.504,12.504,4.504,a.a.rightSleeve,i,"rightSleeve",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),m.add(r)}let g=new t.Object3D;g.name="leftLegGroup",g.position.x=-2,g.position.y=6,g.position.z=0,g.translateOnAxis(new t.Vector3(0,1,0),4);let y=s(e,4,12,4,a.a.leftLeg[n],i,"leftLeg");if(y.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(y),n>=1){let r=s(e,4.504,12.504,4.504,a.a.leftTrousers,i,"leftTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),g.add(r)}let b=new t.Object3D;b.name="rightLegGroup",b.position.x=2,b.position.y=6,b.position.z=0,b.translateOnAxis(new t.Vector3(0,1,0),4);let w=s(e,4,12,4,a.a.rightLeg[n],i,"rightLeg");if(w.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(w),n>=1){let r=s(e,4.504,12.504,4.504,a.a.rightTrousers,i,"rightTrousers",!0);r.translateOnAxis(new t.Vector3(0,1,0),-4),b.add(r)}let x=new t.Object3D;if(x.add(u),x.add(f),x.add(h),x.add(m),x.add(g),x.add(b),r){console.log(a.a);let e=a.a.capeRelative;"optifine"===o&&(e=a.a.capeOptifineRelative),"labymod"===o&&(e=a.a.capeLabymodRelative),e=JSON.parse(JSON.stringify(e)),console.log(e);for(let t in e)e[t].x*=r.image.width,e[t].w*=r.image.width,e[t].y*=r.image.height,e[t].h*=r.image.height;console.log(e);let n=new t.Object3D;n.name="capeGroup",n.position.x=0,n.position.y=16,n.position.z=-2.5,n.translateOnAxis(new t.Vector3(0,1,0),8),n.translateOnAxis(new t.Vector3(0,0,1),.5);let i=s(r,10,16,1,e,!1,"cape");i.rotation.x=l(10),i.translateOnAxis(new t.Vector3(0,1,0),-8),i.translateOnAxis(new t.Vector3(0,0,1),-.5),i.rotation.y=l(180),n.add(i),x.add(n)}return x}(o,u,c,f,e._capeType?e._capeType:e.optifine?"optifine":"minecraft");n.addToScene(d),n.playerModel=d,"function"==typeof r&&r()};n._skinImage=new Image,n._skinImage.crossOrigin="anonymous",n._capeImage=new Image,n._capeImage.crossOrigin="anonymous";let c=void 0!==e.cape||void 0!==e.capeUrl||void 0!==e.capeData||void 0!==e.mineskin,f=!1,d=!1,h=!1,p=new t.Texture,m=new t.Texture;if(p.image=n._skinImage,n._skinImage.onload=function(){if(n._skinImage){if(d=!0,console.log("Skin Image Loaded"),void 0===e.slim&&32!==n._skinImage.height){let e=document.createElement("canvas"),t=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,t.drawImage(n._skinImage,0,0),console.log("Slim Detection:");let r=t.getImageData(46,52,1,12).data,a=t.getImageData(54,20,1,12).data,i=!0;for(let e=3;e<48;e+=4){if(255===r[e]){i=!1;break}if(255===a[e]){i=!1;break}}console.log(i),i&&(f=!0)}if(n.options.makeNonTransparentOpaque&&32!==n._skinImage.height){let e=document.createElement("canvas"),a=e.getContext("2d");e.width=n._skinImage.width,e.height=n._skinImage.height,a.drawImage(n._skinImage,0,0);let i=document.createElement("canvas"),o=i.getContext("2d");i.width=n._skinImage.width,i.height=n._skinImage.height;let s=a.getImageData(0,0,e.width,e.height),l=s.data;function r(e,t){return e>0&&t>0&&e<32&&t<32||(e>32&&t>16&&e<64&&t<32||e>16&&t>48&&e<48&&t<64)}for(let t=0;t178||r(n,i))&&(l[t+3]=255)}o.putImageData(s,0,0),console.log(i.toDataURL()),p=new t.CanvasTexture(i)}!d||!h&&c||i||o(p,m)}},n._skinImage.onerror=function(e){console.warn("Skin Image Error"),console.warn(e)},console.log("Has Cape: "+c),c?(m.image=n._capeImage,n._capeImage.onload=function(){n._capeImage&&(h=!0,console.log("Cape Image Loaded"),h&&d&&(i||o(p,m)))},n._capeImage.onerror=function(e){console.warn("Cape Image Error"),console.warn(e),h=!0,d&&(i||o(p))}):(m=null,n._capeImage=null),"string"==typeof e)0===e.indexOf("http")?n._skinImage.src=e:e.length<=16?u("https://minerender.org/nameToUuid.php?name="+e,(function(t,r){if(t)return console.log(t);console.log(r),n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e)})):e.length<=36?image.src="https://crafatar.com/skins/"+e+"?overlay":n._skinImage.src=e;else{if("object"!=typeof e)throw new Error("Invalid texture value");if(e.url?n._skinImage.src=e.url:e.data?n._skinImage.src=e.data:e.username?u("https://minerender.org/nameToUuid.php?name="+e.username,(function(t,r){if(t)return console.log(t);n._skinImage.src="https://crafatar.com/skins/"+(r.id?r.id:e.username)+"?overlay"})):e.uuid?n._skinImage.src="https://crafatar.com/skins/"+e.uuid+"?overlay":e.mineskin&&(n._skinImage.src="https://api.mineskin.org/render/texture/"+e.mineskin),e.cape)if(e.cape.length>36){u(e.cape.startsWith("http")?e.cape:"https://api.capes.dev/get/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else{let t="https://api.capes.dev/load/";e.capeUser?t+=e.capeUser:e.username?t+=e.username:e.uuid?t+=e.uuid:console.warn("Couldn't find a user to get a cape from"),u(t+="/"+e.cape,(function(t,r){if(t)return console.log(t);r.exists&&(e._capeType=r.type,n._capeImage.src=r.imageUrls.base.full)}))}else e.capeUrl?n._capeImage.src=e.capeUrl:e.capeData?n._capeImage.src=e.capeData:e.mineskin&&(n._capeImage.src="https://api.mineskin.org/render/texture/"+e.mineskin+"/cape");f=e.slim}}resize(e,t){return this._resize(e,t)}reset(){this._skinImage=null,this._capeImage=null,this._animId&&cancelAnimationFrame(this._animId),this._canvas&&this._canvas.remove()}getPlayerModel(){return this.playerModel}getModelByName(e){return this._scene.getObjectByName(e,!0)}toggleSkinPart(e,t){this._scene.getObjectByName(e,!0).visible=t}}function s(e,r,a,n,i,o,s,l){let u=e.image.width,c=e.image.height,f=new t.BoxGeometry(r,a,n),d=new t.MeshBasicMaterial({map:e,transparent:l||!1,alphaTest:.1,side:l?t.DoubleSide:t.FrontSide});f.computeBoundingBox(),f.faceVertexUvs[0]=[];let h=["right","left","top","bottom","front","back"],p=[];for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{tolerance:0};if(!e)throw new Error("You should specify the element you want to test");"string"==typeof e&&(e=document.querySelector(e));var r=e.getBoundingClientRect();return(r.bottom-t.tolerance>0&&r.right-t.tolerance>0&&r.left+t.tolerance<(window.innerWidth||document.documentElement.clientWidth)&&r.top+t.tolerance<(window.innerHeight||document.documentElement.clientHeight))}function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0,container:""};if(!e)throw new Error("You should specify the element you want to test");if("string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={tolerance:0,container:document.querySelector(t)}),"string"==typeof t.container&&(t.container=document.querySelector(t.container)),t instanceof HTMLElement&&(t={tolerance:0,container:t}),!t.container)throw new Error("You should specify a container element");var r=t.container.getBoundingClientRect();return(e.offsetTop+e.clientHeight-t.tolerance>t.container.scrollTop&&e.offsetLeft+e.clientWidth-t.tolerance>t.container.scrollLeft&&e.offsetLeft+t.tolerance0&&void 0!==arguments[0]?arguments[0]:{tolerance:0,debounce:100,container:window};this.options={},this.trackedElements={},Object.defineProperties(this.options,{container:{configurable:!1,enumerable:!1,get:function(){var e=void 0;return"string"==typeof n.container?e=document.querySelector(n.container):n.container instanceof HTMLElement&&(e=n.container),e||window},set:function(e){n.container=e}},debounce:{get:function(){return parseInt(n.debounce,10)||100},set:function(e){n.debounce=e}},tolerance:{get:function(){return parseInt(n.tolerance,10)||0},set:function(e){n.tolerance=e}}}),Object.defineProperty(this,"_scroll",{enumerable:!1,configurable:!1,writable:!1,value:this._debouncedScroll.call(this)}),e=document.querySelector("body"),t=function(){Object.keys(a.trackedElements).forEach((function(e){a.on("enter",e),a.on("leave",e)}))},(r=window.MutationObserver||window.WebKitMutationObserver)?new r(t).observe(e,{childList:!0,subtree:!0}):(e.addEventListener("DOMNodeInserted",t,!1),e.addEventListener("DOMNodeRemoved",t,!1)),this.attach()}return Object.defineProperties(r.prototype,{_debouncedScroll:{configurable:!1,writable:!1,enumerable:!1,value:function(){var r=this,a=void 0;return function(){clearTimeout(a),a=setTimeout((function(){!function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0},n=Object.keys(r),i=void 0;n.length&&(i=a.container===window?e:t,n.forEach((function(e){r[e].nodes.forEach((function(t){if(i(t.node,a)?(t.wasVisible=t.isVisible,t.isVisible=!0):(t.wasVisible=t.isVisible,t.isVisible=!1),!0===t.isVisible&&!1===t.wasVisible){if(!r[e].enter)return;Object.keys(r[e].enter).forEach((function(a){"function"==typeof r[e].enter[a]&&r[e].enter[a](t.node,"enter")}))}if(!1===t.isVisible&&!0===t.wasVisible){if(!r[e].leave)return;Object.keys(r[e].leave).forEach((function(a){"function"==typeof r[e].leave[a]&&r[e].leave[a](t.node,"leave")}))}}))})))}(r.trackedElements,r.options)}),r.options.debounce)}}},attach:{configurable:!1,writable:!1,enumerable:!1,value:function(){var e=this.options.container;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.addEventListener("scroll",this._scroll,{passive:!0}),window.addEventListener("resize",this._scroll,{passive:!0}),this._scroll(),this.attached=!0}},destroy:{configurable:!1,writable:!1,enumerable:!1,value:function(){this.options.container.removeEventListener("scroll",this._scroll),window.removeEventListener("resize",this._scroll),this.attached=!1}},off:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){var a=Object.keys(this.trackedElements[t].enter||{}),n=Object.keys(this.trackedElements[t].leave||{});if({}.hasOwnProperty.call(this.trackedElements,t))if(r){if(this.trackedElements[t][e]){var i="function"==typeof r?r.name:r;delete this.trackedElements[t][e][i]}}else delete this.trackedElements[t][e];a.length||n.length||delete this.trackedElements[t]}},on:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){if(!e)throw new Error("No event given. Choose either enter or leave");if(!t)throw new Error("No selector to track");if(["enter","leave"].indexOf(e)<0)throw new Error(e+" event is not supported");({}).hasOwnProperty.call(this.trackedElements,t)||(this.trackedElements[t]={}),this.trackedElements[t].nodes=[];for(var a=0,n=document.querySelectorAll(t);a{if(e.options.useWebWorkers){let a=c()(h);a.addEventListener("message",e=>{r.push(...e.data.parsedModelList),t()}),a.postMessage({func:"parseModel",model:i,modelOptions:i,parsedModelList:r,assetRoot:e.options.assetRoot})}else Object(l.e)(i,i,r,e.options.assetRoot).then(()=>{t()})}))}return Promise.all(a)})(r,e,n).then(()=>(function(e,t){console.timeEnd("parseModels"),console.time("loadAndMergeModels");let r=[];console.log("Loading Model JSON data & merging...");let a={};for(let e=0;e{let a=n[t],i=Object(l.d)(a);if(d("loadAndMerge "+i),g.hasOwnProperty(i))r();else if(e.options.useWebWorkers){let t=c()(h);t.addEventListener("message",e=>{g[i]=e.data.mergedModel,r()}),t.postMessage({func:"loadAndMergeModel",model:a,assetRoot:e.options.assetRoot})}else Object(l.b)(a,e.options.assetRoot).then(e=>{g[i]=e,r()})}));return Promise.all(r)})(r,n)).then(()=>(function(e,t){console.timeEnd("loadAndMergeModels"),console.time("loadModelTextures");let r=[];console.log("Loading Textures...");let a={};for(let e=0;e{let a=n[t],i=Object(l.d)(a);d("loadTexture "+i);let o=g[i];if(y.hasOwnProperty(i))r();else{if(!o)return console.warn("Missing merged model"),console.warn(a.name),void r();if(!o.textures)return console.warn("The model doesn't have any textures!"),console.warn("Please make sure you're using the proper file."),console.warn(a.name),void r();if(e.options.useWebWorkers){let t=c()(h);t.addEventListener("message",e=>{y[i]=e.data.textures,r()}),t.postMessage({func:"loadTextures",textures:o.textures,assetRoot:e.options.assetRoot})}else Object(l.c)(o.textures,e.options.assetRoot).then(e=>{y[i]=e,r()})}}));return Promise.all(r)})(r,n)).then(()=>(function(e,t){console.timeEnd("loadModelTextures"),console.time("doModelRender"),console.log("Rendering Models...");let r=[];for(let n=0;n{let i=t[n],o=g[Object(l.d)(i)],s=y[Object(l.d)(i)],u=i.offset||[0,0,0],c=i.rotation||[0,0,0],f=i.scale||[1,1,1];if(i.options.hasOwnProperty("display")&&o.hasOwnProperty("display")&&o.display.hasOwnProperty(i.options.display)){let e=o.display[i.options.display];e.hasOwnProperty("translation")&&(u=[u[0]+e.translation[0],u[1]+e.translation[1],u[2]+e.translation[2]]),e.hasOwnProperty("rotation")&&(c=[c[0]+e.rotation[0],c[1]+e.rotation[1],c[2]+e.rotation[2]]),e.hasOwnProperty("scale")&&(f=[e.scale[0],e.scale[1],e.scale[2]])}P(e,o,s,o.textures,i.type,i.name,i.variant,u,c,f).then(t=>{if(t.firstInstance){let r=new a.Object3D;r.add(t.mesh),e.models.push(r),e.addToScene(r)}r(t)})}));return Promise.all(r)})(r,n)).then(e=>{console.timeEnd("doModelRender"),d(e),"function"==typeof t&&t()})}}let P=function(e,t,r,i,o,s,u,c,f,h){return new Promise(p=>{if(t.hasOwnProperty("elements")){let m=Object(l.d)({type:o,name:s,variant:u}),v=b[m],g=function(t,r){t.userData.modelType=o,t.userData.modelName=s;let n=new a.Vector3,i=new a.Vector3,u=new a.Quaternion,d={key:m,index:r,offset:c,scale:h,rotation:f};f&&t.setQuaternionAt(r,u.setFromEuler(new a.Euler(Object(l.f)(f[0]),Object(l.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(l.f)(f[2])))),c&&(t.setPositionAt(r,n.set(c[0],c[1],c[2])),e.instancePositionMap[c[0]+"_"+c[1]+"_"+c[2]]=d),h&&t.setScaleAt(r,i.set(h[0],h[1],h[2])),t.needsUpdate(),p({mesh:t,firstInstance:0===r})},y=function(e,t){let r;if(e.translate(-8,-8,-8),E.hasOwnProperty(m))d("Using cached instance ("+m+")"),r=E[m];else{d("Caching new model instance "+m+" (with "+v+" instances)");let n=new a.InstancedMesh(e,t,v,!1,!1,!1);r={instance:n,index:0},E[m]=r;let i=new a.Vector3,o=new a.Vector3(1,1,1),s=new a.Quaternion;for(let e=0;e{let n=s.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_"+(o.__comment?o.__comment.replaceAll(" ","_").replaceAll("-","_").toLowerCase()+"_":"");C(o.to[0]-o.from[0],o.to[1]-o.from[1],o.to[2]-o.from[2],n+Date.now(),o.faces,u,r,i,e.options.assetRoot,n).then(e=>{e.applyMatrix((new a.Matrix4).makeTranslation((o.to[0]-o.from[0])/2,(o.to[1]-o.from[1])/2,(o.to[2]-o.from[2])/2)),e.applyMatrix((new a.Matrix4).makeTranslation(o.from[0],o.from[1],o.from[2])),o.rotation&&k(e,new a.Vector3(o.rotation.origin[0],o.rotation.origin[1],o.rotation.origin[2]),new a.Vector3("x"===o.rotation.axis?1:0,"y"===o.rotation.axis?1:0,"z"===o.rotation.axis?1:0),Object(l.f)(o.rotation.angle)),t(e)})}))}Promise.all(w).then(e=>{let t=Object(n.c)(e,!0);t.sourceSize=e.length,y(t.geometry,t.materials,e.length);for(let t=0;t{c&&e.applyMatrix((new a.Matrix4).makeTranslation(c[0],c[1],c[2])),f&&e.rotation.set(Object(l.f)(f[0]),Object(l.f)(Math.abs(f[0])>0?f[1]:-f[1]),Object(l.f)(f[2])),h&&e.scale.set(h[0],h[1],h[2]),p({mesh:e,firstInstance:!0})})})};function F(e,t,r,n){let i=E[e];if(i&&i.instance){let e,o=i.instance;e=n?t||[1,1,1]:[0,0,0];let s=new a.Vector3;return o.setScaleAt(r,s.set(e[0],e[1],e[2])),o}}function O(e,t){let r={};for(let a of e){let e=this.instancePositionMap[a[0]+"_"+a[1]+"_"+a[2]];if(e){let a=F(e.key,e.scale,e.index,t);a&&(r[e.key]=a)}}for(let e of Object.values(r))e.needsUpdate()}T.prototype.setVisibilityAtMulti=O,T.prototype.setVisibilityAt=function(e,t,r,a){O([[e,t,r]],a)},T.prototype.setVisibilityOfType=function(e,t,r,a){let n=E[Object(l.d)({type:e,name:t,variant:r})];if(n&&n.instance){n.instance.visible=a}};let L=function(e,t){return new Promise(r=>{let n=function(t,n,i){let o=new a.PlaneGeometry(n,i),s=new a.Mesh(o,t);s.name=e,s.receiveShadow=!0,r(s)};if(t){let r=0,i=0,o=[];for(let e in t)t.hasOwnProperty(e)&&o.push(new Promise(a=>{let n=new Image;n.onload=function(){n.width>r&&(r=n.width),n.height>i&&(i=n.height),a(n)},n.src=t[e]}));Promise.all(o).then(t=>{let o=document.createElement("canvas");o.width=r,o.height=i;let l=o.getContext("2d");for(let e=0;e{let b,E=e+"_"+t+"_"+r;A.hasOwnProperty(E)?(d("Using cached Geometry ("+E+")"),b=A[E]):(b=new a.BoxGeometry(e,t,r),d("Caching Geometry "+E),A[E]=b);let M=function(e){let t=new a.Mesh(b,e);t.name=n,t.receiveShadow=!0,y(t)};if(c){let e=[];for(let t=0;t<6;t++)e.push(new Promise(e=>{let r=m[t];if(!o.hasOwnProperty(r))return void e(null);let p=o[r],y=p.texture.substr(1);if(!c.hasOwnProperty(y)||!c[y])return console.warn("Missing texture '"+y+"' for face "+r+" in model "+n),void e(null);let b=y+"_"+r+"_"+g,A=t=>{let o=function(t){let i=t.dataUrl,o=t.dataUrlHash,s=t.hasTransparency;if(_.hasOwnProperty(o))return d("Using cached Material ("+o+", without meta)"),void e(_[o]);let u=f[y];u.startsWith("#")&&(u=f[n.substr(1)]),d("Pre-Caching Material "+o+", without meta"),_[o]=new a.MeshBasicMaterial({map:null,transparent:s,side:s?a.DoubleSide:a.FrontSide,alphaTest:.5,name:r+"_"+y+"_"+u});let c=function(t){d("Finalizing Cached Material "+o+", without meta"),_[o].map=t,_[o].needsUpdate=!0,e(_[o])};if(w.hasOwnProperty(o))return d("Using cached Texture ("+o+")"),void c(w[o]);d("Pre-Caching Texture "+o),w[o]=(new a.TextureLoader).load(i,(function(e){e.magFilter=a.NearestFilter,e.minFilter=a.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,p.hasOwnProperty("rotation")&&(e.center.x=.5,e.center.y=.5,e.rotation=Object(l.f)(p.rotation)),d("Caching Texture "+o),w[o]=e,c(e)}))};if(t.height>t.width&&t.height%t.width==0){let r=f[y];r.startsWith("#")&&(r=f[r.substr(1)]),-1!==r.indexOf("/")&&(r=r.substr(r.indexOf("/")+1)),Object(i.e)(r,h).then(r=>{!function(t,r){let n=t.dataUrlHash,i=t.hasTransparency;if(_.hasOwnProperty(n))return d("Using cached Material ("+n+", with meta)"),void e(_[n]);d("Pre-Caching Material "+n+", with meta"),_[n]=new a.MeshBasicMaterial({map:null,transparent:i,side:i?a.DoubleSide:a.FrontSide,alphaTest:.5});let o=1;r.hasOwnProperty("animation")&&r.animation.hasOwnProperty("frametime")&&(o=r.animation.frametime);let l=Math.floor(t.height/t.width);console.log("Generating animated texture...");let u=[];for(let e=0;e{let n=document.createElement("canvas");n.width=t.width,n.height=t.width,n.getContext("2d").drawImage(t.canvas,0,e*t.width,t.width,t.width,0,0,t.width,t.width);let i=n.toDataURL("image/png"),o=s(i);if(w.hasOwnProperty(o))return d("Using cached Texture ("+o+")"),void r(w[o]);d("Pre-Caching Texture "+o),w[o]=(new a.TextureLoader).load(i,(function(e){e.magFilter=a.NearestFilter,e.minFilter=a.NearestFilter,e.anisotropy=0,e.needsUpdate=!0,d("Caching Texture "+o+", without meta"),w[o]=e,r(e)}))}));Promise.all(u).then(t=>{let r=0,a=0;S.push(()=>{r>=o&&(r=0,_[n].map=t[a],a++),a>=t.length&&(a=0),r+=.1}),d("Finalizing Cached Material "+n+", with meta"),_[n].map=t[0],_[n].needsUpdate=!0,e(_[n])})}(t,r)}).catch(()=>{o(t)})}else o(t)};if(x.hasOwnProperty(b)){let e=x[b];if(e.hasOwnProperty("img")){d("Waiting for canvas image that's already loading ("+b+")"),e.img.waitingForCanvas.push((function(e){A(e)}))}else d("Using cached canvas ("+b+")"),A(x[b])}else{let t=new Image;t.onerror=function(t){console.warn(t),e(null)},t.waitingForCanvas=[],t.onload=function(){let e=(e=>{let t=p.uv;t||(t=u[r].uv),t=[Object(i.f)(t[0],e.width),Object(i.f)(t[1],e.height),Object(i.f)(t[2],e.width),Object(i.f)(t[3],e.height)];let a=document.createElement("canvas");a.width=Math.abs(t[2]-t[0]),a.height=Math.abs(t[3]-t[1]);let n,o=a.getContext("2d");o.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),a.width,a.height,0,0,a.width,a.height),p.hasOwnProperty("tintindex")?n=v[p.tintindex]:g.startsWith("water_")&&(n="blue"),n&&(o.fillStyle=n,o.globalCompositeOperation="multiply",o.fillRect(0,0,a.width,a.height),o.globalAlpha=1,o.globalCompositeOperation="destination-in",o.drawImage(e,Math.min(t[0],t[2]),Math.min(t[1],t[3]),a.width,a.height,0,0,a.width,a.height));let l=o.getImageData(0,0,a.width,a.height).data,c=!1;for(let e=3;eM(e))}else{let e=[];for(let t=0;t<6;t++)e.push(new a.MeshBasicMaterial({color:p[t+2],wireframe:!0}));M(e)}})};function k(e,t,r,a){e.position.sub(t),e.position.applyAxisAngle(r,a),e.position.add(t),e.rotateOnAxis(r,a)}T.cache={loadedTextures:y,mergedModels:g,instanceCount:b,texture:w,canvas:x,material:_,geometry:A,instances:E,animated:S,resetInstances:function(){Object(l.a)(b),Object(l.a)(E)},clearAll:function(){Object(l.a)(y),Object(l.a)(g),Object(l.a)(b),Object(l.a)(w),Object(l.a)(x),Object(l.a)(_),Object(l.a)(A),Object(l.a)(E),S.splice(0,S.length)}},T.ModelConverter=o.a,"undefined"!=typeof window&&(window.ModelRender=T,window.ModelConverter=o.a),void 0!==e&&(e.ModelRender=T),t.default=T}.call(this,r(4))},function(e,t,r){e.exports=function(e){const t=parseInt(e.REVISION)>=96;r(80)(e);var a=new e.MeshDepthMaterial;a.depthPacking=e.RGBADepthPacking,a.clipping=!0,a.defines={INSTANCE_TRANSFORM:""};var n=e.ShaderLib.distanceRGBA,i=e.UniformsUtils.clone(n.uniforms),o=new e.ShaderMaterial({defines:{USE_SHADOWMAP:"",INSTANCE_TRANSFORM:""},uniforms:i,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,clipping:!0});return e.InstancedMesh=function(t,r,n,i,s,l){e.Mesh.call(this,(new e.InstancedBufferGeometry).copy(t)),this._dynamic=!!i,this._uniformScale=!!l,this._colors=!!s,this.numInstances=n,this._setAttributes(),this.material=r,this.frustumCulled=!1,this.customDepthMaterial=a,this.customDistanceMaterial=o},e.InstancedMesh.prototype=Object.create(e.Mesh.prototype),e.InstancedMesh.constructor=e.InstancedMesh,Object.defineProperties(e.InstancedMesh.prototype,{material:{set:function(e){let t=function(e){e.defines?(e.defines.INSTANCE_TRANSFORM="",this._uniformScale?e.defines.INSTANCE_UNIFORM="":delete e.defines.INSTANCE_UNIFORM,this._colors?e.defines.INSTANCE_COLOR="":delete e.defines.INSTANCE_COLOR):(e.defines={INSTANCE_TRANSFORM:""},this._uniformScale&&(e.defines.INSTANCE_UNIFORM=""),this._colors&&(e.defines.INSTANCE_COLOR=""))};if(Array.isArray(e)){e=e.slice(0);for(let r=0;r{const n=r[a];let i;t?i=new e.InstancedBufferAttribute(...n):(i=new e.InstancedBufferAttribute(n[0],n[1],n[3])).normalized=n[2],i.dynamic=this._dynamic,this.geometry.addAttribute(a,i)})},e.InstancedMesh}},function(e,t,r){e.exports=function(e){return/InstancedMesh/.test(e.REVISION)?e:(r(81)(e),e.REVISION+="_InstancedMesh",e)}},function(e,t,r){e.exports=function(e){e.ShaderChunk.begin_vertex=r(82),e.ShaderChunk.color_fragment=r(83),e.ShaderChunk.color_pars_fragment=r(84),e.ShaderChunk.color_vertex=r(85),e.ShaderChunk.defaultnormal_vertex=r(86),e.ShaderChunk.uv_pars_vertex=r(87)}},function(e,t){e.exports=["#ifndef INSTANCE_TRANSFORM","vec3 transformed = vec3( position );","#else","#ifndef INSTANCE_MATRIX","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","vec3 transformed = ( _instanceMatrix * vec4( position , 1. )).xyz;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","diffuseColor.rgb *= vColor;","#endif","#if defined(INSTANCE_COLOR)","diffuseColor.rgb *= vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","varying vec3 vColor;","#endif","#if defined( INSTANCE_COLOR )","varying vec3 vInstanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef USE_COLOR","vColor.xyz = color.xyz;","#endif","#if defined( INSTANCE_COLOR ) && defined( INSTANCE_TRANSFORM )","vInstanceColor = instanceColor;","#endif"].join("\n")},function(e,t){e.exports=["#ifdef FLIP_SIDED","objectNormal = -objectNormal;","#endif","#ifndef INSTANCE_TRANSFORM","vec3 transformedNormal = normalMatrix * objectNormal;","#else","#ifndef INSTANCE_MATRIX ","mat4 _instanceMatrix = getInstanceMatrix();","#define INSTANCE_MATRIX","#endif","#ifndef INSTANCE_UNIFORM","vec3 transformedNormal = transposeMat3( inverse( mat3( modelViewMatrix * _instanceMatrix ) ) ) * objectNormal ;","#else","vec3 transformedNormal = ( modelViewMatrix * _instanceMatrix * vec4( objectNormal , 0.0 ) ).xyz;","#endif","#endif"].join("\n")},function(e,t){e.exports=["#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )","varying vec2 vUv;","uniform mat3 uvTransform;","#endif","#ifdef INSTANCE_TRANSFORM","mat3 inverse(mat3 m) {","float a00 = m[0][0], a01 = m[0][1], a02 = m[0][2];","float a10 = m[1][0], a11 = m[1][1], a12 = m[1][2];","float a20 = m[2][0], a21 = m[2][1], a22 = m[2][2];","float b01 = a22 * a11 - a12 * a21;","float b11 = -a22 * a10 + a12 * a20;","float b21 = a21 * a10 - a11 * a20;","float det = a00 * b01 + a01 * b11 + a02 * b21;","return mat3(b01, (-a22 * a01 + a02 * a21), ( a12 * a01 - a02 * a11),","b11, ( a22 * a00 - a02 * a20), (-a12 * a00 + a02 * a10),","b21, (-a21 * a00 + a01 * a20), ( a11 * a00 - a01 * a10)) / det;","}","attribute vec3 instancePosition;","attribute vec4 instanceQuaternion;","attribute vec3 instanceScale;","#if defined( INSTANCE_COLOR )","attribute vec3 instanceColor;","varying vec3 vInstanceColor;","#endif","mat4 getInstanceMatrix(){","vec4 q = instanceQuaternion;","vec3 s = instanceScale;","vec3 v = instancePosition;","vec3 q2 = q.xyz + q.xyz;","vec3 a = q.xxx * q2.xyz;","vec3 b = q.yyz * q2.yzz;","vec3 c = q.www * q2.xyz;","vec3 r0 = vec3( 1.0 - (b.x + b.z) , a.y + c.z , a.z - c.y ) * s.xxx;","vec3 r1 = vec3( a.y - c.z , 1.0 - (a.x + b.z) , b.y + c.x ) * s.yyy;","vec3 r2 = vec3( a.z + c.y , b.y - c.x , 1.0 - (a.x + b.x) ) * s.zzz;","return mat4(","r0 , 0.0,","r1 , 0.0,","r2 , 0.0,","v , 1.0",");","}","#endif"].join("\n")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(8);var o=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var e=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return e.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),e.scene=new n.Scene,e.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),e.quad.frustumCulled=!1,e.scene.add(e.quad),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((a=i)&&a.__esModule?a:{default:a}).default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:this.clock.getDelta(),t=this.renderer.getRenderTarget(),r=!1,a=void 0,n=void 0,i=this.passes.length;for(n=0;n0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*a;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?s(l=e,i,"day")||s(l,n,"hour")||s(l,a,"minute")||s(l,r,"second")||l+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=n)return Math.round(e/n)+"h";if(e>=a)return Math.round(e/a)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},function(e,t,r){"use strict";var a={};(0,r(9).assign)(a,r(96),r(98),r(32)),e.exports=a},function(e,t,r){"use strict";var a=r(48),n=r(9),i=r(51),o=r(30),s=r(31),l=Object.prototype.toString,u=0,c=-1,f=0,d=8;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({level:c,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:f,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&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 r=a.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==u)throw new Error(o[r]);if(t.header&&a.deflateSetHeader(this.strm,t.header),t.dictionary){var p;if(p="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=a.deflateSetDictionary(this.strm,p))!==u)throw new Error(o[r]);this._dict_set=!0}}function p(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}h.prototype.push=function(e,t){var r,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=i.string2buf(e):"[object ArrayBuffer]"===l.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 n.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=a.deflate(s,o))&&r!==u)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(n.shrinkBuf(s.output,s.next_out))):this.onData(n.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u):2!==o||(this.onEnd(u),s.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=h,t.deflate=p,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,p(e,t)}},function(e,t,r){"use strict";var a=r(9),n=4,i=0,o=1,s=2;function l(e){for(var t=e.length;--t>=0;)e[t]=0}var u=0,c=1,f=2,d=29,h=256,p=h+1+d,m=30,v=19,g=2*p+1,y=15,b=16,w=7,x=256,_=16,A=17,E=18,S=[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],M=[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],T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=new Array(2*(p+2));l(F);var O=new Array(2*m);l(O);var L=new Array(512);l(L);var C=new Array(256);l(C);var k=new Array(d);l(k);var R,I,N,D=new Array(m);function U(e,t,r,a,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=a,this.max_length=n,this.has_stree=e&&e.length}function j(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function B(e){return e<256?L[e]:L[256+(e>>>7)]}function V(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function z(e,t,r){e.bi_valid>b-r?(e.bi_buf|=t<>b-e.bi_valid,e.bi_valid+=r-b):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function X(e,t,r){var a,n,i=new Array(y+1),o=0;for(a=1;a<=y;a++)i[a]=o=o+r[a-1]<<1;for(n=0;n<=t;n++){var s=e[2*n+1];0!==s&&(e[2*n]=H(i[s]++,s))}}function Y(e){var t;for(t=0;t8?V(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function q(e,t,r,a){var n=2*t,i=2*r;return e[n]>1;r>=1;r--)Q(e,i,r);n=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Q(e,i,1),a=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=a,i[2*n]=i[2*r]+i[2*a],e.depth[n]=(e.depth[r]>=e.depth[a]?e.depth[r]:e.depth[a])+1,i[2*r+1]=i[2*a+1]=n,e.heap[1]=n++,Q(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,a,n,i,o,s,l=t.dyn_tree,u=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(i=0;i<=y;i++)e.bl_count[i]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(i=p,m++),l[2*a+1]=i,a>u||(e.bl_count[i]++,o=0,a>=h&&(o=d[a-h]),s=l[2*a],e.opt_len+=s*(i+o),f&&(e.static_len+=s*(c[2*a+1]+o)));if(0!==m){do{for(i=p-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[p]--,m-=2}while(m>0);for(i=p;0!==i;i--)for(a=e.bl_count[i];0!==a;)(n=e.heap[--r])>u||(l[2*n+1]!==i&&(e.opt_len+=(i-l[2*n+1])*l[2*n],l[2*n+1]=i),a--)}}(e,t),X(i,u,e.bl_count)}function J(e,t,r){var a,n,i=-1,o=t[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(r+1)+1]=65535,a=0;a<=r;a++)n=o,o=t[2*(a+1)+1],++s>=7;a0?(e.strm.data_type===s&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&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 o;for(t=32;t=3&&0===e.bl_tree[2*P[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),l=e.opt_len+3+7>>>3,(u=e.static_len+3+7>>>3)<=l&&(l=u)):l=u=r+5,r+4<=l&&-1!==t?te(e,t,r,a):e.strategy===n||u===l?(z(e,(c<<1)+(a?1:0),3),Z(e,F,O)):(z(e,(f<<1)+(a?1:0),3),function(e,t,r,a){var n;for(z(e,t-257,5),z(e,r-1,5),z(e,a-4,4),n=0;n>>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&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(C[r]+h+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){z(e,c<<1,3),G(e,x,F),function(e){16===e.bi_valid?(V(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},function(e,t,r){"use strict";var a=r(52),n=r(9),i=r(51),o=r(32),s=r(30),l=r(31),u=r(101),c=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new u,a.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=i.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=a.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function d(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,l,u,f,d=this.strm,h=this.options.chunkSize,p=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?d.input=i.binstring2buf(e):"[object ArrayBuffer]"===c.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new n.Buf8(h),d.next_out=0,d.avail_out=h),(r=a.inflate(d,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(r=a.inflateSetDictionary(this.strm,p)),r===o.Z_BUF_ERROR&&!0===m&&(r=o.Z_OK,m=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==o.Z_STREAM_END&&(0!==d.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=i.utf8border(d.output,d.next_out),u=d.next_out-l,f=i.buf2string(d.output,l),d.next_out=u,d.avail_out=h-u,u&&n.arraySet(d.output,d.output,l,u,0),this.onData(f)):this.onData(n.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),d.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=d,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},t.ungzip=d},function(e,t,r){"use strict";e.exports=function(e,t){var r,a,n,i,o,s,l,u,c,f,d,h,p,m,v,g,y,b,w,x,_,A,E,S,M;r=e.state,a=e.next_in,S=e.input,n=a+(e.avail_in-5),i=e.next_out,M=e.output,o=i-(t-e.avail_out),s=i+(e.avail_out-257),l=r.dmax,u=r.wsize,c=r.whave,f=r.wnext,d=r.window,h=r.hold,p=r.bits,m=r.lencode,v=r.distcode,g=(1<>>=w=b>>>24,p-=w,0===(w=b>>>16&255))M[i++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=m[(65535&b)+(h&(1<>>=w,p-=w),p<15&&(h+=S[a++]<>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=v[(65535&b)+(h&(1<l){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=w,p-=w,_>(w=i-o)){if((w=_-w)>c&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(A=0,E=d,0===f){if(A+=u-w,w2;)M[i++]=E[A++],M[i++]=E[A++],M[i++]=E[A++],x-=3;x&&(M[i++]=E[A++],x>1&&(M[i++]=E[A++]))}else{A=i-_;do{M[i++]=M[A++],M[i++]=M[A++],M[i++]=M[A++],x-=3}while(x>2);x&&(M[i++]=M[A++],x>1&&(M[i++]=M[A++]))}break}}break}}while(a>3,h&=(1<<(p-=x<<3))-1,e.next_in=a,e.next_out=i,e.avail_in=a=1&&0===I[M];M--);if(T>M&&(T=M),0===M)return u[c++]=20971520,u[c++]=20971520,d.bits=1,0;for(S=1;S0&&(0===e||1!==M))return-1;for(N[1]=0,A=1;A<15;A++)N[A+1]=N[A]+I[A];for(E=0;E852||2===e&&L>592)return 1;for(;;){b=A-F,f[E]y?(w=D[U+f[E]],x=k[R+f[E]]):(w=96,x=0),h=1<>F)+(p-=h)]=b<<24|w<<16|x|0}while(0!==p);for(h=1<>=1;if(0!==h?(C&=h-1,C+=h):C=0,E++,0==--I[A]){if(A===M)break;A=t[r+f[E]]}if(A>T&&(C&v)!==m){for(0===F&&(F=T),g+=S,O=1<<(P=A-F);P+F852||2===e&&L>592)return 1;u[m=C&v]=T<<24|P<<16|g-c|0}}return 0!==C&&(u[g+C]=A-F<<24|64<<16|0),d.bits=T,0}},function(e,t,r){"use strict";e.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}},function(e,t,r){"use strict";(function(e){var a=r(7).Buffer,n=r(105).Transform,i=r(116),o=r(59),s=r(25).ok,l=r(7).kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";i.Z_MIN_WINDOWBITS=8,i.Z_MAX_WINDOWBITS=15,i.Z_DEFAULT_WINDOWBITS=15,i.Z_MIN_CHUNK=64,i.Z_MAX_CHUNK=1/0,i.Z_DEFAULT_CHUNK=16384,i.Z_MIN_MEMLEVEL=1,i.Z_MAX_MEMLEVEL=9,i.Z_DEFAULT_MEMLEVEL=8,i.Z_MIN_LEVEL=-1,i.Z_MAX_LEVEL=9,i.Z_DEFAULT_LEVEL=i.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(i),f=0;f=l?o=new RangeError(u):t=a.concat(n,i),n=[],e.close(),r(o,t)}e.on("error",(function(t){e.removeListener("end",s),e.removeListener("readable",o),r(t)})),e.on("end",s),e.end(t),o()}function y(e,t){if("string"==typeof t&&(t=a.from(t)),!a.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function b(e){if(!(this instanceof b))return new b(e);T.call(this,e,i.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);T.call(this,e,i.INFLATE)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,i.GZIP)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,i.GUNZIP)}function A(e){if(!(this instanceof A))return new A(e);T.call(this,e,i.DEFLATERAW)}function E(e){if(!(this instanceof E))return new E(e);T.call(this,e,i.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,i.UNZIP)}function M(e){return e===i.Z_NO_FLUSH||e===i.Z_PARTIAL_FLUSH||e===i.Z_SYNC_FLUSH||e===i.Z_FULL_FLUSH||e===i.Z_FINISH||e===i.Z_BLOCK}function T(e,r){var o=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,n.call(this,e),e.flush&&!M(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!M(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||i.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:i.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!a.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new i.Zlib(r);var s=this;this._hadError=!1,this._handle.onerror=function(e,r){P(s),s._hadError=!0;var a=new Error(e);a.errno=r,a.code=t.codes[r],s.emit("error",a)};var l=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(l=e.level);var u=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,l,e.memLevel||t.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=a.allocUnsafe(this._chunkSize),this._offset=0,this._level=l,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!o._handle},configurable:!0,enumerable:!0})}function P(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function F(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(h),writable:!1}),t.Deflate=b,t.Inflate=w,t.Gzip=x,t.Gunzip=_,t.DeflateRaw=A,t.InflateRaw=E,t.Unzip=S,t.createDeflate=function(e){return new b(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new A(e)},t.createInflateRaw=function(e){return new E(e)},t.createGzip=function(e){return new x(e)},t.createGunzip=function(e){return new _(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new b(t),e,r)},t.deflateSync=function(e,t){return y(new b(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new x(t),e,r)},t.gzipSync=function(e,t){return y(new x(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new A(t),e,r)},t.deflateRawSync=function(e,t){return y(new A(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new S(t),e,r)},t.unzipSync=function(e,t){return y(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new w(t),e,r)},t.inflateSync=function(e,t){return y(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new _(t),e,r)},t.gunzipSync=function(e,t){return y(new _(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),g(new E(t),e,r)},t.inflateRawSync=function(e,t){return y(new E(t),e)},o.inherits(T,n),T.prototype.params=function(r,a,n){if(rt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(a!=t.Z_FILTERED&&a!=t.Z_HUFFMAN_ONLY&&a!=t.Z_RLE&&a!=t.Z_FIXED&&a!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+a);if(this._level!==r||this._strategy!==a){var o=this;this.flush(i.Z_SYNC_FLUSH,(function(){s(o._handle,"zlib binding closed"),o._handle.params(r,a),o._hadError||(o._level=r,o._strategy=a,n&&n())}))}else e.nextTick(n)},T.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},T.prototype._flush=function(e){this._transform(a.alloc(0),"",e)},T.prototype.flush=function(t,r){var n=this,o=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=i.Z_FULL_FLUSH),o.ended?r&&e.nextTick(r):o.ending?r&&this.once("end",r):o.needDrain?r&&this.once("drain",(function(){return n.flush(t,r)})):(this._flushFlag=t,this.write(a.alloc(0),"",r))},T.prototype.close=function(t){P(this,t),e.nextTick(F,this)},T.prototype._transform=function(e,t,r){var n,o=this._writableState,s=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||a.isBuffer(e)?this._handle?(s?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||i.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},T.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,c=this,f="function"==typeof r;if(!f){var d,h=[],p=0;this.on("error",(function(e){d=e})),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&y(m[0],m[1]));if(this._hadError)throw d;if(p>=l)throw P(this),new RangeError(u);var v=a.concat(h,p);return P(this),v}s(this._handle,"zlib binding closed");var g=this._handle.write(t,e,o,n,this._buffer,this._offset,i);function y(l,u){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var d=i-u;if(s(d>=0,"have should not go down"),d>0){var m=c._buffer.slice(c._offset,c._offset+d);c._offset+=d,f?c.push(m):(h.push(m),p+=m.length)}if((0===u||c._offset>=c._chunkSize)&&(i=c._chunkSize,c._offset=0,c._buffer=a.allocUnsafe(c._chunkSize)),0===u){if(o+=n-l,n=l,!f)return!0;var v=c._handle.write(t,e,o,n,c._buffer,c._offset,c._chunkSize);return v.callback=y,void(v.buffer=e)}if(!f)return!1;r()}}g.buffer=e,g.callback=y},o.inherits(b,T),o.inherits(w,T),o.inherits(x,T),o.inherits(_,T),o.inherits(A,T),o.inherits(E,T),o.inherits(S,T)}).call(this,r(5))},function(e,t,r){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],a=t[1];return 3*(r+a)/4-a},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],o=0,s=r-n;os?s:o+16383));1===n?(t=e[r-1],i.push(a[t>>2]+a[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(a[t>>10]+a[t>>4&63]+a[t<<2&63]+"="));return i.join("")};for(var a=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var n,i,o=[],s=t;s>18&63]+a[i>>12&63]+a[i>>6&63]+a[63&i]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,a,n){var i,o,s=8*n-a-1,l=(1<>1,c=-7,f=r?n-1:0,d=r?-1:1,h=e[t+f];for(f+=d,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+e[t+f],f+=d,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=a;c>0;o=256*o+e[t+f],f+=d,c-=8);if(0===i)i=1-u;else{if(i===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,a),i-=u}return(h?-1:1)*o*Math.pow(2,i-a)},t.write=function(e,t,r,a,n,i){var o,s,l,u=8*i-n-1,c=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=a?0:i-1,p=a?1:-1,m=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*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+f>=1?d/l:d*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,n),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),o=0));n>=8;e[r+h]=255&s,h+=p,s/=256,n-=8);for(o=o<0;e[r+h]=255&o,h+=p,o/=256,u-=8);e[r+h-p]|=128*m}},function(e,t,r){e.exports=n;var a=r(18).EventEmitter;function n(){a.call(this)}r(6)(n,a),n.Readable=r(33),n.Writable=r(112),n.Duplex=r(113),n.Transform=r(114),n.PassThrough=r(115),n.Stream=n,n.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(c(),0===a.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",u),e.on("error",u),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},function(e,t){},function(e,t,r){"use strict";var a=r(23).Buffer,n=r(108);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return a.alloc(0);if(1===this.length)return this.head.data;for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,t.copy(r,n),s+=o.data.length,o=o.next;return i},e}(),n&&n.inspect&&n.inspect.custom&&(e.exports.prototype[n.inspect.custom]=function(){var e=n.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e){var a=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(n.call(setTimeout,a,arguments),clearTimeout)},t.setInterval=function(){return new i(n.call(setInterval,a,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(a,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(110),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(4))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var a,n,i,o,s,l=1,u={},c=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?a=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){p(e.data)},a=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(n=f.documentElement,a=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):a=function(e){setTimeout(p,0,e)}:(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),a=function(t){e.postMessage(o+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;rt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,n(this.init_done,"close before init"),n(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||s.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,a,n,i,o){return this._write(!0,e,t,r,a,n,i,o)},c.prototype.writeSync=function(e,t,r,a,n,i,o){return this._write(!1,e,t,r,a,n,i,o)},c.prototype._write=function(r,i,o,s,l,u,c,f){if(n.equal(arguments.length,8),n(this.init_done,"write before init"),n(this.mode!==t.NONE,"already finalized"),n.equal(!1,this.write_in_progress,"write already in progress"),n.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,n.equal(!1,void 0===i,"must provide flush value"),this.write_in_progress=!0,i!==t.Z_NO_FLUSH&&i!==t.Z_PARTIAL_FLUSH&&i!==t.Z_SYNC_FLUSH&&i!==t.Z_FULL_FLUSH&&i!==t.Z_FINISH&&i!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==o&&(o=e.alloc(0),l=0,s=0),this.strm.avail_in=l,this.strm.input=o,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=u,this.strm.next_out=c,this.flush=i,!r)return this._process(),this._checkError()?this._afterSync():void 0;var d=this;return a.nextTick((function(){d._process(),d._after()})),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,r,a,i,o){n(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),n(e>=8&&e<=15,"invalid windowBits"),n(r>=-1&&r<=9,"invalid compression level"),n(a>=1&&a<=9,"invalid memlevel"),n(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,a,i,o),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,r,a,n,l){switch(this.level=e,this.windowBits=r,this.memLevel=a,this.strategy=n,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new i,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=l,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=o.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=c}).call(this,r(7).Buffer,r(5))},function(e,t,r){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT -*/var a=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var a={};return"abcdefghijklmnopqrst".split("").forEach((function(e){a[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},a)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,s,l=o(e),u=1;u({path:r+"."+e.path,val:e.val})))),e}e.exports=class{constructor(e=!0){this.types={},this.validator=e?new s:null,this.addDefaultTypes()}addDefaultTypes(){this.addTypes(r(163)),this.addTypes(r(164)),this.addTypes(r(165)),this.addTypes(r(166))}addProtocol(e,t){const r=this;this.validator&&this.validator.validateProtocol(e),function e(t,a){void 0!==t&&(t.types&&r.addTypes(t.types),e(o(t,a.shift()),a))}(e,t)}addType(e,t,r=!0){if("native"!==t)if(l(t)){this.validator&&(r&&this.validator.validateType(t),this.validator.addType(e));let{type:n,typeArgs:o}=a(t);this.types[e]=o?function(e,t){const r=JSON.stringify(t),a=i(t,u,[]);function n(e){const t=JSON.parse(r);return a.forEach(r=>{!function(e,t,r){const a=e.split(".").reverse();for(;a.length>1;)r=r[a.pop()];r[a.pop()]=t}(r.path,e[r.val],t)}),t}return[function(t,r,a,i){return e[0].call(this,t,r,n(a),i)},function(t,r,a,i,o){return e[1].call(this,t,r,a,n(i),o)},function(t,r,a){return"function"==typeof e[2]?e[2].call(this,t,n(r),a):e[2]}]}(this.types[n],o):this.types[n]}else this.validator&&(t[3]?this.validator.addType(e,t[3]):this.validator.addType(e)),this.types[e]=t;else this.validator&&this.validator.addType(e)}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t],!1)),this.validator&&Object.keys(e).forEach(t=>{l(e[t])&&this.validator.validateType(e[t])})}read(e,t,r,n){let{type:i,typeArgs:o}=a(r);const s=this.types[i];if(!s)throw new Error("missing data type: "+i);return s[0].call(this,e,t,o,n)}write(e,t,r,n,i){let{type:o,typeArgs:s}=a(n);const l=this.types[o];if(!l)throw new Error("missing data type: "+o);return l[1].call(this,e,t,r,s,i)}sizeOf(e,t,r){let{type:n,typeArgs:i}=a(t);const o=this.types[n];if(!o)throw new Error("missing data type: "+n);return"function"==typeof o[2]?o[2].call(this,e,i,r):o[2]}createPacketBuffer(e,r){const a=n(()=>this.sizeOf(r,e,{}),e=>{throw e.message=`SizeOf error for ${e.field} : ${e.message}`,e}),i=t.allocUnsafe(a);return n(()=>this.write(r,i,0,e,{}),e=>{throw e.message=`Write error for ${e.field} : ${e.message}`,e}),i}parsePacketBuffer(e,t){const{value:r,size:a}=n(()=>this.read(t,0,e,{}),e=>{throw e.message=`Read error for ${e.field} : ${e.message}`,e});return{data:r,metadata:{size:a},buffer:t.slice(0,a)}}}}).call(this,r(7).Buffer)},function(e,t,r){(function(e,r){var a=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,l=1/0,u=9007199254740991,c="[object Arguments]",f="[object Array]",d="[object Boolean]",h="[object Date]",p="[object Error]",m="[object Function]",v="[object GeneratorFunction]",g="[object Map]",y="[object Number]",b="[object Object]",w="[object RegExp]",x="[object Set]",_="[object String]",A="[object Symbol]",E="[object ArrayBuffer]",S="[object DataView]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,P=/^\./,F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,L=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R[c]=R[f]=R[E]=R[d]=R[S]=R[h]=R[p]=R[m]=R[g]=R[y]=R[b]=R[w]=R[x]=R[_]=R["[object WeakMap]"]=!1;var k="object"==typeof e&&e&&e.Object===Object&&e,I="object"==typeof self&&self&&self.Object===Object&&self,N=k||I||Function("return this")(),D=t&&!t.nodeType&&t,U=D&&"object"==typeof r&&r&&!r.nodeType&&r,j=U&&U.exports===D&&k.process,B=function(){try{return j&&j.binding("util")}catch(e){}}(),V=B&&B.isTypedArray;function z(e,t,r,a){var n=-1,i=e?e.length:0;for(a&&i&&(r=e[++n]);++n-1},Me.prototype.set=function(e,t){var r=this.__data__,a=Le(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},Te.prototype.clear=function(){this.__data__={hash:new Se,map:new(de||Me),string:new Se}},Te.prototype.delete=function(e){return He(this,e).delete(e)},Te.prototype.get=function(e){return He(this,e).get(e)},Te.prototype.has=function(e){return He(this,e).has(e)},Te.prototype.set=function(e,t){return He(this,e).set(e,t),this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,i),this},Pe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.clear=function(){this.__data__=new Me},Fe.prototype.delete=function(e){return this.__data__.delete(e)},Fe.prototype.get=function(e){return this.__data__.get(e)},Fe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Me){var n=r.__data__;if(!de||n.lengthu))return!1;var f=i.get(e);if(f&&i.get(t))return f==t;var d=-1,h=!0,p=n&o?new Pe:void 0;for(i.set(e,t),i.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=u}function st(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function lt(e){return!!e&&"object"==typeof e}function ut(e){return"symbol"==typeof e||lt(e)&&ne.call(e)==A}var ct=V?function(e){return function(t){return e(t)}}(V):function(e){return lt(e)&&ot(e.length)&&!!R[ne.call(e)]};function ft(e){return nt(e)?Oe(e):Ve(e)}function dt(e){return e}r.exports=function(e,t,r){var a=at(e)?z:H,n=arguments.length<3;return a(e,Be(t),r,n,ke)}}).call(this,r(4),r(120)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){(function(t){var r="Expected a function",a="__lodash_hash_undefined__",n=1/0,i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,c=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p="object"==typeof t&&t&&t.Object===Object&&t,m="object"==typeof self&&self&&self.Object===Object&&self,v=p||m||Function("return this")();var g,y=Array.prototype,b=Function.prototype,w=Object.prototype,x=v["__core-js_shared__"],_=(g=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",A=b.toString,E=w.hasOwnProperty,S=w.toString,M=RegExp("^"+A.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=v.Symbol,P=y.splice,F=B(v,"Map"),O=B(Object,"create"),L=T?T.prototype:void 0,C=L?L.toString:void 0;function R(e){var t=-1,r=e?e.length:0;for(this.clear();++t-1},k.prototype.set=function(e,t){var r=this.__data__,a=N(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},I.prototype.clear=function(){this.__data__={hash:new R,map:new(F||k),string:new R}},I.prototype.delete=function(e){return j(this,e).delete(e)},I.prototype.get=function(e){return j(this,e).get(e)},I.prototype.has=function(e){return j(this,e).has(e)},I.prototype.set=function(e,t){return j(this,e).set(e,t),this};var V=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}(t);var r=[];return c.test(e)&&r.push(""),e.replace(f,(function(e,t,a,n){r.push(a?n.replace(d,"$1"):t||e)})),r}));function z(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-n?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(r);var a=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=a.cache;if(i.has(n))return i.get(n);var o=e.apply(this,r);return a.cache=i.set(n,o),o};return a.cache=new(G.Cache||I),a}G.Cache=I;var H=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==s}e.exports=function(e,t,r){var a=null==e?void 0:D(e,t);return void 0===a?r:a}}).call(this,r(4))},function(e,t,r){const a=r(123),n=r(24);class i{constructor(e){this.createAjvInstance(e),this.addDefaultTypes()}createAjvInstance(e){this.typesSchemas={},this.compiled=!1,this.ajv=new a({verbose:!0}),this.ajv.addSchema(r(157),"definitions"),this.ajv.addSchema(r(158),"protocol"),e&&Object.keys(e).forEach(t=>this.addType(t,e[t]))}addDefaultTypes(){this.addTypes(r(159)),this.addTypes(r(160)),this.addTypes(r(161)),this.addTypes(r(162))}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t]))}typeToSchemaName(e){return e.replace("|","_")}addType(e,t){const r=this.typeToSchemaName(e);null==this.typesSchemas[r]&&(t||(t={oneOf:[{enum:[e]},{type:"array",items:[{enum:[e]},{oneOf:[{type:"object"},{type:"array"}]}]}]}),this.typesSchemas[r]=t,this.compiled?this.createAjvInstance(this.typesSchemas):this.ajv.addSchema(t,r),this.ajv.removeSchema("dataType"),this.ajv.addSchema({title:"dataType",oneOf:[{enum:["native"]}].concat(Object.keys(this.typesSchemas).map(e=>({$ref:this.typeToSchemaName(e)})))},"dataType"))}validateType(e){let t=this.ajv.validate("dataType",e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}validateTypeGoingInside(e){if(Array.isArray(e)){n.ok(null!=this.typesSchemas[this.typeToSchemaName(e[0])],e+" is an undefined type");let t=this.ajv.validate(e[0],e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}else{if("native"==e)return;n.ok(null!=this.typesSchemas[this.typeToSchemaName(e)],e+" is an undefined type")}}validateProtocol(e){let t=this.ajv.validate("protocol",e);n.ok(t,JSON.stringify(this.ajv.errors,null,2)),function e(t,r,a){const n=new i(r.typesSchemas);Object.keys(t).forEach(r=>{"types"==r?(Object.keys(t[r]).forEach(e=>n.addType(e)),Object.keys(t[r]).forEach(e=>{try{n.validateType(t[r][e],a+"."+r+"."+e)}catch(t){throw new Error("Error at "+a+"."+r+"."+e)}})):e(t[r],n,a+"."+r)})}(e,this,"root")}}e.exports=i},function(e,t,r){"use strict";var a=r(124),n=r(34),i=r(128),o=r(59),s=r(60),l=r(129),u=r(130),c=r(151),f=r(13);e.exports=g,g.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var n=r(t);!0!==r.$async&&(this.errors=r.errors);return n},g.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},g.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var i=0;i=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:t,baseId:r},{index:a,compiling:!1})}function d(e,t,r){var a=h.call(this,e,t,r);a>=0&&this._compilations.splice(a,1)}function h(e,t,r){for(var a=0;a({path:r+"."+e.path,val:e.val})))),e}e.exports=class{constructor(e=!0){this.types={},this.validator=e?new s:null,this.addDefaultTypes()}addDefaultTypes(){this.addTypes(r(166)),this.addTypes(r(167)),this.addTypes(r(168)),this.addTypes(r(169))}addProtocol(e,t){const r=this;this.validator&&this.validator.validateProtocol(e),function e(t,a){void 0!==t&&(t.types&&r.addTypes(t.types),e(o(t,a.shift()),a))}(e,t)}addType(e,t,r=!0){if("native"!==t)if(l(t)){this.validator&&(r&&this.validator.validateType(t),this.validator.addType(e));let{type:n,typeArgs:o}=a(t);this.types[e]=o?function(e,t){const r=JSON.stringify(t),a=i(t,u,[]);function n(e){const t=JSON.parse(r);return a.forEach(r=>{!function(e,t,r){const a=e.split(".").reverse();for(;a.length>1;)r=r[a.pop()];r[a.pop()]=t}(r.path,e[r.val],t)}),t}return[function(t,r,a,i){return e[0].call(this,t,r,n(a),i)},function(t,r,a,i,o){return e[1].call(this,t,r,a,n(i),o)},function(t,r,a){return"function"==typeof e[2]?e[2].call(this,t,n(r),a):e[2]}]}(this.types[n],o):this.types[n]}else this.validator&&(t[3]?this.validator.addType(e,t[3]):this.validator.addType(e)),this.types[e]=t;else this.validator&&this.validator.addType(e)}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t],!1)),this.validator&&Object.keys(e).forEach(t=>{l(e[t])&&this.validator.validateType(e[t])})}read(e,t,r,n){let{type:i,typeArgs:o}=a(r);const s=this.types[i];if(!s)throw new Error("missing data type: "+i);return s[0].call(this,e,t,o,n)}write(e,t,r,n,i){let{type:o,typeArgs:s}=a(n);const l=this.types[o];if(!l)throw new Error("missing data type: "+o);return l[1].call(this,e,t,r,s,i)}sizeOf(e,t,r){let{type:n,typeArgs:i}=a(t);const o=this.types[n];if(!o)throw new Error("missing data type: "+n);return"function"==typeof o[2]?o[2].call(this,e,i,r):o[2]}createPacketBuffer(e,r){const a=n(()=>this.sizeOf(r,e,{}),e=>{throw e.message=`SizeOf error for ${e.field} : ${e.message}`,e}),i=t.allocUnsafe(a);return n(()=>this.write(r,i,0,e,{}),e=>{throw e.message=`Write error for ${e.field} : ${e.message}`,e}),i}parsePacketBuffer(e,t){const{value:r,size:a}=n(()=>this.read(t,0,e,{}),e=>{throw e.message=`Read error for ${e.field} : ${e.message}`,e});return{data:r,metadata:{size:a},buffer:t.slice(0,a)}}}}).call(this,r(7).Buffer)},function(e,t,r){(function(e,r){var a=200,n="Expected a function",i="__lodash_hash_undefined__",o=1,s=2,l=1/0,u=9007199254740991,c="[object Arguments]",f="[object Array]",d="[object Boolean]",h="[object Date]",p="[object Error]",m="[object Function]",v="[object GeneratorFunction]",g="[object Map]",y="[object Number]",b="[object Object]",w="[object RegExp]",x="[object Set]",_="[object String]",A="[object Symbol]",E="[object ArrayBuffer]",S="[object DataView]",M=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,P=/^\./,F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,L=/^\[object .+?Constructor\]$/,C=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[c]=k[f]=k[E]=k[d]=k[S]=k[h]=k[p]=k[m]=k[g]=k[y]=k[b]=k[w]=k[x]=k[_]=k["[object WeakMap]"]=!1;var R="object"==typeof e&&e&&e.Object===Object&&e,I="object"==typeof self&&self&&self.Object===Object&&self,N=R||I||Function("return this")(),D=t&&!t.nodeType&&t,U=D&&"object"==typeof r&&r&&!r.nodeType&&r,j=U&&U.exports===D&&R.process,B=function(){try{return j&&j.binding("util")}catch(e){}}(),V=B&&B.isTypedArray;function z(e,t,r,a){var n=-1,i=e?e.length:0;for(a&&i&&(r=e[++n]);++n-1},Me.prototype.set=function(e,t){var r=this.__data__,a=Le(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},Te.prototype.clear=function(){this.__data__={hash:new Se,map:new(de||Me),string:new Se}},Te.prototype.delete=function(e){return He(this,e).delete(e)},Te.prototype.get=function(e){return He(this,e).get(e)},Te.prototype.has=function(e){return He(this,e).has(e)},Te.prototype.set=function(e,t){return He(this,e).set(e,t),this},Pe.prototype.add=Pe.prototype.push=function(e){return this.__data__.set(e,i),this},Pe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.clear=function(){this.__data__=new Me},Fe.prototype.delete=function(e){return this.__data__.delete(e)},Fe.prototype.get=function(e){return this.__data__.get(e)},Fe.prototype.has=function(e){return this.__data__.has(e)},Fe.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Me){var n=r.__data__;if(!de||n.lengthu))return!1;var f=i.get(e);if(f&&i.get(t))return f==t;var d=-1,h=!0,p=n&o?new Pe:void 0;for(i.set(e,t),i.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=u}function st(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function lt(e){return!!e&&"object"==typeof e}function ut(e){return"symbol"==typeof e||lt(e)&&ne.call(e)==A}var ct=V?function(e){return function(t){return e(t)}}(V):function(e){return lt(e)&&ot(e.length)&&!!k[ne.call(e)]};function ft(e){return nt(e)?Oe(e):Ve(e)}function dt(e){return e}r.exports=function(e,t,r){var a=at(e)?z:H,n=arguments.length<3;return a(e,Be(t),r,n,Re)}}).call(this,r(4),r(123)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){(function(t){var r="Expected a function",a="__lodash_hash_undefined__",n=1/0,i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u=/^\w*$/,c=/^\./,f=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d=/\\(\\)?/g,h=/^\[object .+?Constructor\]$/,p="object"==typeof t&&t&&t.Object===Object&&t,m="object"==typeof self&&self&&self.Object===Object&&self,v=p||m||Function("return this")();var g,y=Array.prototype,b=Function.prototype,w=Object.prototype,x=v["__core-js_shared__"],_=(g=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",A=b.toString,E=w.hasOwnProperty,S=w.toString,M=RegExp("^"+A.call(E).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=v.Symbol,P=y.splice,F=B(v,"Map"),O=B(Object,"create"),L=T?T.prototype:void 0,C=L?L.toString:void 0;function k(e){var t=-1,r=e?e.length:0;for(this.clear();++t-1},R.prototype.set=function(e,t){var r=this.__data__,a=N(r,e);return a<0?r.push([e,t]):r[a][1]=t,this},I.prototype.clear=function(){this.__data__={hash:new k,map:new(F||R),string:new k}},I.prototype.delete=function(e){return j(this,e).delete(e)},I.prototype.get=function(e){return j(this,e).get(e)},I.prototype.has=function(e){return j(this,e).has(e)},I.prototype.set=function(e,t){return j(this,e).set(e,t),this};var V=G((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(Y(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}(t);var r=[];return c.test(e)&&r.push(""),e.replace(f,(function(e,t,a,n){r.push(a?n.replace(d,"$1"):t||e)})),r}));function z(e){if("string"==typeof e||Y(e))return e;var t=e+"";return"0"==t&&1/e==-n?"-0":t}function G(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError(r);var a=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=a.cache;if(i.has(n))return i.get(n);var o=e.apply(this,r);return a.cache=i.set(n,o),o};return a.cache=new(G.Cache||I),a}G.Cache=I;var H=Array.isArray;function X(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Y(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==s}e.exports=function(e,t,r){var a=null==e?void 0:D(e,t);return void 0===a?r:a}}).call(this,r(4))},function(e,t,r){const a=r(126),n=r(25);class i{constructor(e){this.createAjvInstance(e),this.addDefaultTypes()}createAjvInstance(e){this.typesSchemas={},this.compiled=!1,this.ajv=new a({verbose:!0}),this.ajv.addSchema(r(160),"definitions"),this.ajv.addSchema(r(161),"protocol"),e&&Object.keys(e).forEach(t=>this.addType(t,e[t]))}addDefaultTypes(){this.addTypes(r(162)),this.addTypes(r(163)),this.addTypes(r(164)),this.addTypes(r(165))}addTypes(e){Object.keys(e).forEach(t=>this.addType(t,e[t]))}typeToSchemaName(e){return e.replace("|","_")}addType(e,t){const r=this.typeToSchemaName(e);null==this.typesSchemas[r]&&(t||(t={oneOf:[{enum:[e]},{type:"array",items:[{enum:[e]},{oneOf:[{type:"object"},{type:"array"}]}]}]}),this.typesSchemas[r]=t,this.compiled?this.createAjvInstance(this.typesSchemas):this.ajv.addSchema(t,r),this.ajv.removeSchema("dataType"),this.ajv.addSchema({title:"dataType",oneOf:[{enum:["native"]}].concat(Object.keys(this.typesSchemas).map(e=>({$ref:this.typeToSchemaName(e)})))},"dataType"))}validateType(e){let t=this.ajv.validate("dataType",e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}validateTypeGoingInside(e){if(Array.isArray(e)){n.ok(null!=this.typesSchemas[this.typeToSchemaName(e[0])],e+" is an undefined type");let t=this.ajv.validate(e[0],e);if(this.compiled=!0,!t)throw console.log(JSON.stringify(this.ajv.errors[0],null,2)),"dataType"==this.ajv.errors[0].parentSchema.title&&this.validateTypeGoingInside(this.ajv.errors[0].data),new Error("validation error")}else{if("native"==e)return;n.ok(null!=this.typesSchemas[this.typeToSchemaName(e)],e+" is an undefined type")}}validateProtocol(e){let t=this.ajv.validate("protocol",e);n.ok(t,JSON.stringify(this.ajv.errors,null,2)),function e(t,r,a){const n=new i(r.typesSchemas);Object.keys(t).forEach(r=>{"types"==r?(Object.keys(t[r]).forEach(e=>n.addType(e)),Object.keys(t[r]).forEach(e=>{try{n.validateType(t[r][e],a+"."+r+"."+e)}catch(t){throw new Error("Error at "+a+"."+r+"."+e)}})):e(t[r],n,a+"."+r)})}(e,this,"root")}}e.exports=i},function(e,t,r){"use strict";var a=r(127),n=r(35),i=r(131),o=r(60),s=r(61),l=r(132),u=r(133),c=r(154),f=r(14);e.exports=g,g.prototype.validate=function(e,t){var r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var a=this._addSchema(e);r=a.validate||this._compile(a)}var n=r(t);!0!==r.$async&&(this.errors=r.errors);return n},g.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},g.prototype.addSchema=function(e,t,r,a){if(Array.isArray(e)){for(var i=0;i=0?{index:a,compiling:!0}:(a=this._compilations.length,this._compilations[a]={schema:e,root:t,baseId:r},{index:a,compiling:!1})}function d(e,t,r){var a=h.call(this,e,t,r);a>=0&&this._compilations.splice(a,1)}function h(e,t,r){for(var a=0;a1){t[0]=t[0].slice(0,-1);for(var a=t.length-1,n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(e){throw new RangeError(h[e])}function g(e,t){var r=e.split("@"),a="";r.length>1&&(a=r[0]+"@",e=r[1]);var n=function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(d,".")).split("."),t).join(".");return a+n}function y(e){for(var t=[],r=0,a=e.length;r=55296&&n<=56319&&r>1,e+=p(e/t);e>455;a+=36)e=p(e/35);return p(a+36*e/(e+38))},x=function(e){var t,r=[],a=e.length,n=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var l=0;l=128&&v("not-basic"),r.push(e.charCodeAt(l));for(var c=s>0?s+1:0;c=a&&v("invalid-input");var m=(t=e.charCodeAt(c++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>p((u-n)/d))&&v("overflow"),n+=m*d;var g=h<=o?1:h>=o+26?26:h-o;if(mp(u/y)&&v("overflow"),d*=y}var b=r.length+1;o=w(n-f,b,0==f),p(n/b)>u-i&&v("overflow"),i+=p(n/b),n%=b,r.splice(n++,0,i)}return String.fromCodePoint.apply(String,r)},_=function(e){var t=[],r=(e=y(e)).length,a=128,n=0,i=72,o=!0,s=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(o=(c=f.next()).done);o=!0){var d=c.value;d<128&&t.push(m(d))}}catch(e){s=!0,l=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw l}}var h=t.length,g=h;for(h&&t.push("-");g=a&&Tp((u-n)/P)&&v("overflow"),n+=(x-a)*P,a=x;var F=!0,O=!1,L=void 0;try{for(var C,R=e[Symbol.iterator]();!(F=(C=R.next()).done);F=!0){var k=C.value;if(ku&&v("overflow"),k==a){for(var I=n,N=36;;N+=36){var D=N<=i?1:N>=i+26?26:N-i;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function M(e){for(var t="",r=0,a=e.length;r=194&&n<224){if(a-r>=6){var i=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&n)<<6|63&i)}else t+=e.substr(r,6);r+=6}else if(n>=224){if(a-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function T(e,t){function r(e){var r=M(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,n)),e}function P(e){return e.replace(/^0*(.*)/,"$1")||"0"}function F(e,t){var r=e.match(t.IPV4ADDRESS)||[],a=l(r,2)[1];return a?a.split(".").map(P).join("."):e}function O(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=l(r,3),n=a[1],i=a[2];if(n){for(var o=n.toLowerCase().split("::").reverse(),s=l(o,2),u=s[0],c=s[1],f=c?c.split(":").map(P):[],d=u.split(":").map(P),h=t.IPV4ADDRESS.test(d[d.length-1]),p=h?7:8,m=d.length-p,v=Array(p),g=0;g1){var w=v.slice(0,y.index),x=v.slice(y.index+y.length);b=w.join(":")+"::"+x.join(":")}else b=v.join(":");return i&&(b+="%"+i),b}return e}var L=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,C=void 0==="".match(/(){0}/)[1];function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(L);if(n){C?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=O(F(r.host,a),a)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var i=E[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)T(r,a);else{if(r.host&&(t.domainHost||i&&i.domainHost))try{r.host=A.toASCII(r.host.replace(a.PCT_ENCODED,M).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}T(r,o)}i&&i.parse&&i.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var k=/^\.\.?\//,I=/^\/\.(\/|$)/,N=/^\/\.\.(\/|$)/,D=/^\/?(?:.|\n)*?(?=\/|$)/;function U(e){for(var t=[];e.length;)if(e.match(k))e=e.replace(k,"");else if(e.match(I))e=e.replace(I,"/");else if(e.match(N))e=e.replace(N,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(D);if(!r)throw new Error("Unexpected dot segment condition");var a=r[0];e=e.slice(a.length),t.push(a)}return t.join("")}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,a=[],n=E[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||n&&n.domainHost)try{e.host=t.iri?A.toUnicode(e.host):A.toASCII(e.host.replace(r.PCT_ENCODED,M).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}T(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var i=function(e,t){var r=!1!==t.iri?s:o,a=[];return void 0!==e.userinfo&&(a.push(e.userinfo),a.push("@")),void 0!==e.host&&a.push(O(F(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"==typeof e.port&&(a.push(":"),a.push(e.port.toString(10))),a.length?a.join(""):void 0}(e,t);if(void 0!==i&&("suffix"!==t.reference&&a.push("//"),a.push(i),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||n&&n.absolutePath||(l=U(l)),void 0===i&&(l=l.replace(/^\/\//,"/%2F")),a.push(l)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function B(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=R(j(e,r),r),t=R(j(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=U(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=U(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function V(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,M)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},G={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},H={},X="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",W=r(r("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+r("%"+Y+Y)),q=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Q=new RegExp(X,"g"),Z=new RegExp(W,"g"),K=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',q),"g"),J=new RegExp(t("[^]",X,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),$=J;function ee(e){var t=M(e);return t.match(Q)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,i={},o=r.query.split("&"),s=0,l=o.length;s=55296&&t<=56319&&n%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",a.copy(m[e])}function v(e){var t=e.match(n);if(!t)return!1;var r=+t[1],a=+t[2],o=+t[3];return a>=1&&a<=12&&o>=1&&o<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[a])}function g(e,t){var r=e.match(o);if(!r)return!1;var a=r[1],n=r[2],i=r[3],s=r[5];return(a<=23&&n<=59&&i<=59||23==a&&59==n&&60==i)&&(!t||s)}e.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:c,email: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4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p},m.full={date:v,time:g,"date-time":function(e){var t=e.split(y);return 2==t.length&&v(t[0])&&g(t[1],!0)},uri:function(e){return b.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'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(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p};var y=/t|\s/i;var b=/\/|:/;var w=/[^\\]\\Z/;function x(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},function(e,t,r){"use strict";var a=r(131),n=r(13).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=n(t),e.types=n(["number","integer","string","array","object","boolean","null"]),e.forEach((function(r){r.rules=r.rules.map((function(r){var n;if("object"==typeof r){var i=Object.keys(r)[0];n=r[i],r=i,n.forEach((function(r){t.push(r),e.all[r]=!0}))}return t.push(r),e.all[r]={keyword:r,code:a[r],implements:n}})),e.all.$comment={keyword:"$comment",code:a.$comment},r.type&&(e.types[r.type]=r)})),e.keywords=n(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},function(e,t,r){"use strict";e.exports={$ref:r(132),allOf:r(133),anyOf:r(134),$comment:r(135),const:r(136),contains:r(137),dependencies:r(138),enum:r(139),format:r(140),if:r(141),items:r(142),maximum:r(62),minimum:r(62),maxItems:r(63),minItems:r(63),maxLength:r(64),minLength:r(64),maxProperties:r(65),minProperties:r(65),multipleOf:r(143),not:r(144),oneOf:r(145),pattern:r(146),properties:r(147),propertyNames:r(148),required:r(149),uniqueItems:r(150),validate:r(61)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n,i=" ",o=e.level,s=e.dataLevel,l=e.schema[t],u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(s||""),d="valid"+o;if("#"==l||"#/"==l)e.isRoot?(a=e.async,n="validate"):(a=!0===e.root.schema.$async,n="root.refVal[0]");else{var h=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===h){var p=e.MissingRefError.message(e.baseId,l);if("fail"==e.opts.missingRefs){e.logger.error(p),(y=y||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,l,p);e.logger.warn(p),c&&(i+=" if (true) { ")}}else if(h.inline){var v=e.util.copy(e);v.level++;var g="valid"+v.level;v.schema=h.schema,v.schemaPath="",v.errSchemaPath=l,i+=" "+e.validate(v).replace(/validate\.schema/g,h.code)+" ",c&&(i+=" if ("+g+") { ")}else a=!0===h.$async||e.async&&!1!==h.$async,n=h.code}if(n){var y;(y=y||[]).push(i),i="",e.opts.passContext?i+=" "+n+".call(this, ":i+=" "+n+"( ",i+=" "+f+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var b=i+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(i=y.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(i+=" var "+d+"; "),i+=" try { await "+b+"; ",c&&(i+=" "+d+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(i+=" "+d+" = false; "),i+=" } ",c&&(i+=" if ("+d+") { ")}else i+=" if (!"+b+") { if (vErrors === null) vErrors = "+n+".errors; else vErrors = vErrors.concat("+n+".errors); errors = vErrors.length; } ",c&&(i+=" else { ")}return i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.schema[t],i=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,l=e.util.copy(e),u="";l.level++;var c="valid"+l.level,f=l.baseId,d=!0,h=n;if(h)for(var p,m=-1,v=h.length-1;m0:e.util.schemaHasRules(p,e.RULES.all))&&(d=!1,l.schema=p,l.schemaPath=i+"["+m+"]",l.errSchemaPath=o+"/"+m,a+=" "+e.validate(l)+" ",l.baseId=f,s&&(a+=" if ("+c+") { ",u+="}"));return s&&(a+=d?" if (true) { ":" "+u.slice(0,-1)+" "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level;if(o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var v=h.baseId;a+=" var "+d+" = errors; var "+f+" = false; ";var g=e.compositeRule;e.compositeRule=h.compositeRule=!0;var y=o;if(y)for(var b,w=-1,x=y.length-1;w0:e.util.schemaHasRules(o,e.RULES.all);if(a+="var "+d+" = errors;var "+f+";",b){var w=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+p+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var x=c+"["+m+"]";h.dataPathArr[v]=m;var _=e.validate(h);h.baseId=y,e.util.varOccurences(_,g)<2?a+=" "+e.util.varReplace(_,g,x)+" ":a+=" var "+g+" = "+x+"; "+_+" ",a+=" if ("+p+") break; } ",e.compositeRule=h.compositeRule=w,a+=" if (!"+p+") {"}else a+=" if ("+c+".length == 0) {";var A=A||[];A.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;return a=A.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",b&&(a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m={},v={},g=e.opts.ownProperties;for(x in o){var y=o[x],b=Array.isArray(y)?v:m;b[x]=y}a+="var "+f+" = errors;";var w=e.errorPath;for(var x in a+="var missing"+n+";",v)if((b=v[x]).length){if(a+=" if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),u){a+=" && ( ";var _=b;if(_)for(var A=-1,E=_.length-1;A0:e.util.schemaHasRules(y,e.RULES.all))&&(a+=" "+p+" = true; if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),a+=") { ",d.schema=y,d.schemaPath=s+e.util.getProperty(x),d.errSchemaPath=l+"/"+e.util.escapeFragment(x),a+=" "+e.validate(d)+" ",d.baseId=I,a+=" } ",u&&(a+=" if ("+p+") { ",h+="}"))}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d=e.opts.$data&&o&&o.$data;d&&(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var h="i"+n,p="schema"+n;d||(a+=" var "+p+" = validate.schema"+s+";"),a+="var "+f+";",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=f+" = false;for (var "+h+"=0; "+h+"<"+p+".length; "+h+"++) if (equal("+c+", "+p+"["+h+"])) { "+f+" = true; break; }",d&&(a+=" } "),a+=" if (!"+f+") { ";var m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var v=a;return a=m.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||"");if(!1===e.opts.format)return u&&(a+=" if (true) { "),a;var f,d=e.opts.$data&&o&&o.$data;d?(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",f="schema"+n):f=o;var h=e.opts.unknownFormats,p=Array.isArray(h);if(d){a+=" var "+(m="format"+n)+" = formats["+f+"]; var "+(v="isObject"+n)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(g="formatType"+n)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+n+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",d&&(a+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),a+=" (","ignore"!=h&&(a+=" ("+f+" && !"+m+" ",p&&(a+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),a+=") || "),a+=" ("+m+" && "+g+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?a+=" (async"+n+" ? await "+m+"("+c+") : "+m+"("+c+")) ":a+=" "+m+"("+c+") ",a+=" : "+m+".test("+c+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==h)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(a+=" if (true) { "),a;if(p&&h.indexOf(o)>=0)return u&&(a+=" if (true) { "),a;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,g=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var y=!0===m.async;m=m.validate}if(g!=r)return u&&(a+=" if (true) { "),a;if(y){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(b="formats"+e.util.getProperty(o)+".validate")+"("+c+"))) { "}else{a+=" if (! ";var b="formats"+e.util.getProperty(o);v&&(b+=".validate"),a+="function"==typeof m?" "+b+"("+c+") ":" "+b+".test("+c+") ",a+=") { "}}var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=d?""+f:""+e.util.toQuotedString(o),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=d?"' + "+f+" + '":""+e.util.escapeQuotes(o),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=d?"validate.schema"+s:""+e.util.toQuotedString(o),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var x=a;return a=w.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e);h.level++;var p="valid"+h.level,m=e.schema.then,v=e.schema.else,g=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),b=h.baseId;if(g||y){var w;h.createErrors=!1,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+d+" = errors; var "+f+" = true; ";var x=e.compositeRule;e.compositeRule=h.compositeRule=!0,a+=" "+e.validate(h)+" ",h.baseId=b,h.createErrors=!0,a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=x,g?(a+=" if ("+p+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'then'; ":w="'then'",a+=" } ",y&&(a+=" else { ")):a+=" if (!"+p+") { ",y&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'else'; ":w="'else'",a+=" } "),a+=" if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",u&&(a+=" else { "),a=e.util.cleanUpCode(a)}else u&&(a+=" if (true) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v="i"+n,g=h.dataLevel=e.dataLevel+1,y="data"+g,b=e.baseId;if(a+="var "+d+" = errors;var "+f+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){a+=" "+f+" = "+c+".length <= "+o.length+"; ";var x=l;l=e.errSchemaPath+"/additionalItems",a+=" if (!"+f+") { ";var _=_||[];_.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var A=a;a=_.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+A+"]); ":a+=" validate.errors = ["+A+"]; return false; ":a+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l=x,u&&(p+="}",a+=" else { ")}var E=o;if(E)for(var S,M=-1,T=E.length-1;M0:e.util.schemaHasRules(S,e.RULES.all)){a+=" "+m+" = true; if ("+c+".length > "+M+") { ";var P=c+"["+M+"]";h.schema=S,h.schemaPath=s+"["+M+"]",h.errSchemaPath=l+"/"+M,h.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,!0),h.dataPathArr[g]=M;var F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",a+=" } ",u&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){h.schema=w,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+c+".length > "+o.length+") { for (var "+v+" = "+o.length+"; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" } } ",u&&(a+=" if ("+m+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" }"}return u&&(a+=" "+p+" if ("+d+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="var division"+i+";if (",d&&(n+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),n+=" (division"+i+" = "+f+" / "+a+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+i+" !== parseInt(division"+i+") ",n+=" ) ",d&&(n+=" ) "),n+=" ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" var "+f+" = errors; ";var p,m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(p=d.opts.allErrors,d.opts.allErrors=!1),a+=" "+e.validate(d)+" ",d.createErrors=!0,p&&(d.opts.allErrors=p),e.compositeRule=d.compositeRule=m,a+=" if ("+h+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(a+=" if (false) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v=h.baseId,g="prevValid"+n,y="passingSchemas"+n;a+="var "+d+" = errors , "+g+" = false , "+f+" = false , "+y+" = null; ";var b=e.compositeRule;e.compositeRule=h.compositeRule=!0;var w=o;if(w)for(var x,_=-1,A=w.length-1;_0:e.util.schemaHasRules(x,e.RULES.all))?(h.schema=x,h.schemaPath=s+"["+_+"]",h.errSchemaPath=l+"/"+_,a+=" "+e.validate(h)+" ",h.baseId=v):a+=" var "+m+" = true; ",_&&(a+=" if ("+m+" && "+g+") { "+f+" = false; "+y+" = ["+y+", "+_+"]; } else { ",p+="}"),a+=" if ("+m+") { "+f+" = "+g+" = true; "+y+" = "+_+"; }";return e.compositeRule=h.compositeRule=b,a+=p+"if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'string') || "),n+=" !"+(d?"(new RegExp("+a+"))":e.usePattern(s))+".test("+f+") ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",n+=d?""+a:""+e.util.toQuotedString(s),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match pattern \"",n+=d?"' + "+a+" + '":""+e.util.escapeQuotes(s),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+e.util.toQuotedString(s),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m="key"+n,v="idx"+n,g=d.dataLevel=e.dataLevel+1,y="data"+g,b="dataProperties"+n,w=Object.keys(o||{}),x=e.schema.patternProperties||{},_=Object.keys(x),A=e.schema.additionalProperties,E=w.length||_.length,S=!1===A,M="object"==typeof A&&Object.keys(A).length,T=e.opts.removeAdditional,P=S||M||T,F=e.opts.ownProperties,O=e.baseId,L=e.schema.required;if(L&&(!e.opts.$data||!L.$data)&&L.length8)a+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var R=w;if(R)for(var k=-1,I=R.length-1;k0:e.util.schemaHasRules(K,e.RULES.all)){var J=e.util.getProperty(q),$=(H=c+J,Y&&void 0!==K.default);d.schema=K,d.schemaPath=s+J,d.errSchemaPath=l+"/"+e.util.escapeFragment(q),d.errorPath=e.util.getPath(e.errorPath,q,e.opts.jsonPointers),d.dataPathArr[g]=e.util.toQuotedString(q);X=e.validate(d);if(d.baseId=O,e.util.varOccurences(X,y)<2){X=e.util.varReplace(X,y,H);var ee=H}else{ee=y;a+=" var "+y+" = "+H+"; "}if($)a+=" "+X+" ";else{if(C&&C[q]){a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = false; ";j=e.errorPath,V=l;var te,re=e.util.escapeQuotes(q);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,q,e.opts.jsonPointers)),l=e.errSchemaPath+"/required",(te=te||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+re+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";z=a;a=te.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+z+"]); ":a+=" validate.errors = ["+z+"]; return false; ":a+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=V,e.errorPath=j,a+=" } else { "}else u?(a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = true; } else { "):(a+=" if ("+ee+" !== undefined ",F&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=" ) { ");a+=" "+X+" } "}}u&&(a+=" if ("+p+") { ",h+="}")}}if(_.length){var ae=_;if(ae)for(var ne,ie=-1,oe=ae.length-1;ie0:e.util.schemaHasRules(K,e.RULES.all)){d.schema=K,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ne),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ne),a+=F?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+b+".length; "+v+"++) { var "+m+" = "+b+"["+v+"]; ":" for (var "+m+" in "+c+") { ",a+=" if ("+e.usePattern(ne)+".test("+m+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);H=c+"["+m+"]";d.dataPathArr[g]=m;X=e.validate(d);d.baseId=O,e.util.varOccurences(X,y)<2?a+=" "+e.util.varReplace(X,y,H)+" ":a+=" var "+y+" = "+H+"; "+X+" ",u&&(a+=" if (!"+p+") break; "),a+=" } ",u&&(a+=" else "+p+" = true; "),a+=" } ",u&&(a+=" if ("+p+") { ",h+="}")}}}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(a+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l;var p="key"+n,m="idx"+n,v="i"+n,g="' + "+p+" + '",y="data"+(d.dataLevel=e.dataLevel+1),b="dataProperties"+n,w=e.opts.ownProperties,x=e.baseId;w&&(a+=" var "+b+" = undefined; "),a+=w?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+b+".length; "+m+"++) { var "+p+" = "+b+"["+m+"]; ":" for (var "+p+" in "+c+") { ",a+=" var startErrs"+n+" = errors; ";var _=p,A=e.compositeRule;e.compositeRule=d.compositeRule=!0;var E=e.validate(d);d.baseId=x,e.util.varOccurences(E,y)<2?a+=" "+e.util.varReplace(E,y,_)+" ":a+=" var "+y+" = "+_+"; "+E+" ",e.compositeRule=d.compositeRule=A,a+=" if (!"+h+") { for (var "+v+"=startErrs"+n+"; "+v+"0:e.util.schemaHasRules(b,e.RULES.all))||(p[p.length]=v)}}else p=o;if(d||p.length){var w=e.errorPath,x=d||p.length>=e.opts.loopRequired,_=e.opts.ownProperties;if(u)if(a+=" var missing"+n+"; ",x){d||(a+=" var "+h+" = validate.schema"+s+"; ");var A="' + "+(F="schema"+n+"["+(M="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),a+=" var "+f+" = true; ",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=" for (var "+M+" = 0; "+M+" < "+h+".length; "+M+"++) { "+f+" = "+c+"["+h+"["+M+"]] !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", "+h+"["+M+"]) "),a+="; if (!"+f+") break; } ",d&&(a+=" } "),a+=" if (!"+f+") { ",(P=P||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+A+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;a=P.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var S=p;if(S)for(var M=-1,T=S.length-1;M 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(p.indexOf("object")>=0||p.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+d+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var v="checkDataType"+(m?"s":"");n+=" if ("+e.util[v](p,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",h&&(n+=" } "),n+=" if (!"+d+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var y=n;n=g.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { ")}else c&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";var a=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,t){for(var r=0;r(e[t]=function(e,t,r,n){return[(t,n)=>{if(n+r>t.length)throw new a;return{value:t[e](n),size:r}},(e,a,n)=>(a[t](e,n),n+r),r,n]}(n[t][0],n[t][1],n[t][2],r(19)[t]),e),{});i.i64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32BE(t),e.readInt32BE(t+4)],size:8}},function(e,t,r){return t.writeInt32BE(e[0],r),t.writeInt32BE(e[1],r+4),r+8},8,r(19).i64],i.li64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32LE(t+4),e.readInt32LE(t)],size:8}},function(e,t,r){return t.writeInt32LE(e[0],r+4),t.writeInt32LE(e[1],r),r+8},8,r(19).li64],i.u64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32BE(t),e.readUInt32BE(t+4)],size:8}},function(e,t,r){return t.writeUInt32BE(e[0],r),t.writeUInt32BE(e[1],r+4),r+8},8,r(19).u64],i.lu64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32LE(t+4),e.readUInt32LE(t)],size:8}},function(e,t,r){return t.writeUInt32LE(e[0],r+4),t.writeUInt32LE(e[1],r),r+8},8,r(19).lu64],e.exports=i},function(e,t,r){(function(t){const a=r(24),{getCount:n,sendCount:i,calcCount:o,PartialReadError:s}=r(12);function l(e,t){return e===t||parseInt(e)===parseInt(t)}function u(e){return(1<e.length)throw new s;const o=e.readUInt8(i);if(r|=(127&o)<>>=7;return t.writeUInt8(e,r+a),r+a+1},function(e){let t=0;for(;-128&e;)e>>>=7,t++;return t+1},r(10).varint],bool:[function(e,t){if(t+1>e.length)throw new s;return{value:!!e.readInt8(t),size:1}},function(e,t,r){return t.writeInt8(+e,r),r+1},1,r(10).bool],pstring:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a),l=t+i,u=l+o;if(u>e.length)throw new s("Missing characters in string, found size is "+e.length+" expected size was "+u);return{value:e.toString("utf8",l,u),size:u-t}},function(e,r,a,n,o){const s=t.byteLength(e,"utf8");return a=i.call(this,s,r,a,n,o),r.write(e,a,s,"utf8"),a+s},function(e,r,a){const n=t.byteLength(e,"utf8");return o.call(this,n,r,a)+n},r(10).pstring],buffer:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a);if((t+=i)+o>e.length)throw new s;return{value:e.slice(t,t+o),size:i+o}},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.copy(t,r),r+e.length},function(e,t,r){return o.call(this,e.length,t,r)+e.length},r(10).buffer],void:[function(){return{value:void 0,size:0}},function(e,t,r){return r},0,r(10).void],bitfield:[function(e,t,r){const a=t;let n=null,i=0;const o={};return o.value=r.reduce((r,{size:a,signed:o,name:l})=>{let c=a,f=0;for(;c>0;){if(0===i){if(e.length>i-r,i-=r,c-=r}return o&&f>=1<{const l=e[s];if(!o&&l<0||o&&l<-(1<=1<=(1<= "+o?1<0;){const e=Math.min(8-i,a);n=n<>a-e&u(e),a-=e,8===(i+=e)&&(t[r++]=n,i=0,n=0)}}),0!==i&&(t[r++]=n<<8-i);return r},function(e,t){return Math.ceil(t.reduce((e,{size:t})=>e+t,0)/8)},r(10).bitfield],cstring:[function(e,t){let r=0;for(;t+rthis.read(e,t,r.type,a),n)),i.size+=u,t+=u,i.value.push(o);return i},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.reduce((e,r,i)=>s(()=>this.write(r,t,e,a.type,n),i),r)},function(e,t,r){let a=o.call(this,e.length,t,r);return a=e.reduce((e,a,n)=>s(()=>e+this.sizeOf(a,t.type,r),n),a)},r(37).array],count:[function(e,t,{type:r},a){return this.read(e,t,r,a)},function(e,t,r,{countFor:n,type:i},o){return this.write(a(n,o).length,t,r,i,o)},function(e,{countFor:t,type:r},n){return this.sizeOf(a(t,n).length,r,n)},r(37).count],container:[function(e,t,r,a){const n={value:{"..":a},size:0};return r.forEach(({type:r,name:a,anon:i})=>{s(()=>{const o=this.read(e,t,r,n.value);n.size+=o.size,t+=o.size,i?void 0!==o.value&&Object.keys(o.value).forEach(e=>{n.value[e]=o.value[e]}):n.value[a]=o.value},a||"unknown")}),delete n.value[".."],n},function(e,t,r,a,n){return e[".."]=n,r=a.reduce((r,{type:a,name:n,anon:i})=>s(()=>this.write(i?e:e[n],t,r,a,e),n||"unknown"),r),delete e[".."],r},function(e,t,r){e[".."]=r;const a=t.reduce((t,{type:r,name:a,anon:n})=>t+s(()=>this.sizeOf(n?e:e[a],r,e),a||"unknown"),0);return delete e[".."],a},r(37).container]}},function(e,t,r){const{getField:a,getFieldInfo:n,tryDoc:i,PartialReadError:o}=r(12);e.exports={switch:[function(e,t,{compareTo:r,fields:o,compareToValue:s,default:l},u){if(r=void 0!==s?s:a(r,u),void 0===o[r]&&void 0===l)throw new Error(r+" has no associated fieldInfo in switch");const c=void 0===o[r],f=c?l:o[r],d=n(f);return i(()=>this.read(e,t,d,u),c?"default":r)},function(e,t,r,{compareTo:o,fields:s,compareToValue:l,default:u},c){if(o=void 0!==l?l:a(o,c),void 0===s[o]&&void 0===u)throw new Error(o+" has no associated fieldInfo in switch");const f=void 0===s[o],d=n(f?u:s[o]);return i(()=>this.write(e,t,r,d,c),f?"default":o)},function(e,{compareTo:t,fields:r,compareToValue:o,default:s},l){if(t=void 0!==o?o:a(t,l),void 0===r[t]&&void 0===s)throw new Error(t+" has no associated fieldInfo in switch");const u=void 0===r[t],c=n(u?s:r[t]);return i(()=>this.sizeOf(e,c,l),u?"default":t)},r(67).switch],option:[function(e,t,r,a){if(e.length0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,a,n=o.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=n,a=s,o.prototype.copy.call(t,r,a),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(i===n.length?a+=n:a+=n.slice(0,e),0==(e-=i)){i===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(i));break}++r}return this.length-=r,a}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,i=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,i),0==(e-=i)){i===n.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(i));break}++a}return this.length-=a,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&d.forEach(l),i||(d.forEach(l),f(c))}))}));return t.reduce(u)}},function(e,t){e.exports={compound:[function(e,t,r,a){const n={value:{},size:0};for(;;){const r=this.read(e,t,"i8",a);if(0===r.value){t+=r.size,n.size+=r.size;break}const i=this.read(e,t,"nbt",a);t+=i.size,n.size+=i.size,n.value[i.value.name]={type:i.value.type,value:i.value.value}}return n},function(e,t,r,a,n){const i=this;return Object.keys(e).map((function(a){r=i.write({name:a,type:e[a].type,value:e[a].value},t,r,"nbt",n)})),r=this.write(0,t,r,"i8",n)},function(e,t,r){const a=this;return 1+Object.keys(e).reduce((function(t,n){return t+a.sizeOf({name:n,type:e[n].type,value:e[n].value},"nbt",r)}),0)}]}},function(e){e.exports=JSON.parse('{"container":"native","i8":"native","switch":"native","compound":"native","i16":"native","i32":"native","i64":"native","f32":"native","f64":"native","pstring":"native","shortString":["pstring",{"countType":"i16"}],"byteArray":["array",{"countType":"i32","type":"i8"}],"list":["container",[{"name":"type","type":"nbtMapper"},{"name":"value","type":["array",{"countType":"i32","type":["nbtSwitch",{"type":"type"}]}]}]],"intArray":["array",{"countType":"i32","type":"i32"}],"longArray":["array",{"countType":"i32","type":"i64"}],"nbtMapper":["mapper",{"type":"i8","mappings":{"0":"end","1":"byte","2":"short","3":"int","4":"long","5":"float","6":"double","7":"byteArray","8":"string","9":"list","10":"compound","11":"intArray","12":"longArray"}}],"nbtSwitch":["switch",{"compareTo":"$type","fields":{"end":"void","byte":"i8","short":"i16","int":"i32","long":"i64","float":"f32","double":"f64","byteArray":"byteArray","string":"shortString","list":"list","compound":"compound","intArray":"intArray","longArray":"longArray"}}],"nbt":["container",[{"name":"type","type":"nbtMapper"},{"name":"name","type":"shortString"},{"name":"value","type":["nbtSwitch",{"type":"type"}]}]]}')},function(e,t){var r,a;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&a.rotl(e,8)|4278255360&a.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,a=0;r>>5]|=e[r]<<24-a%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],a=0,n=0;a>>6-2*n);return t}},e.exports=a},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} +!function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r1){t[0]=t[0].slice(0,-1);for(var a=t.length-1,n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function v(e){throw new RangeError(h[e])}function g(e,t){var r=e.split("@"),a="";r.length>1&&(a=r[0]+"@",e=r[1]);var n=function(e,t){for(var r=[],a=e.length;a--;)r[a]=t(e[a]);return r}((e=e.replace(d,".")).split("."),t).join(".");return a+n}function y(e){for(var t=[],r=0,a=e.length;r=55296&&n<=56319&&r>1,e+=p(e/t);e>455;a+=36)e=p(e/35);return p(a+36*e/(e+38))},x=function(e){var t,r=[],a=e.length,n=0,i=128,o=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var l=0;l=128&&v("not-basic"),r.push(e.charCodeAt(l));for(var c=s>0?s+1:0;c=a&&v("invalid-input");var m=(t=e.charCodeAt(c++))-48<10?t-22:t-65<26?t-65:t-97<26?t-97:36;(m>=36||m>p((u-n)/d))&&v("overflow"),n+=m*d;var g=h<=o?1:h>=o+26?26:h-o;if(mp(u/y)&&v("overflow"),d*=y}var b=r.length+1;o=w(n-f,b,0==f),p(n/b)>u-i&&v("overflow"),i+=p(n/b),n%=b,r.splice(n++,0,i)}return String.fromCodePoint.apply(String,r)},_=function(e){var t=[],r=(e=y(e)).length,a=128,n=0,i=72,o=!0,s=!1,l=void 0;try{for(var c,f=e[Symbol.iterator]();!(o=(c=f.next()).done);o=!0){var d=c.value;d<128&&t.push(m(d))}}catch(e){s=!0,l=e}finally{try{!o&&f.return&&f.return()}finally{if(s)throw l}}var h=t.length,g=h;for(h&&t.push("-");g=a&&Tp((u-n)/P)&&v("overflow"),n+=(x-a)*P,a=x;var F=!0,O=!1,L=void 0;try{for(var C,k=e[Symbol.iterator]();!(F=(C=k.next()).done);F=!0){var R=C.value;if(Ru&&v("overflow"),R==a){for(var I=n,N=36;;N+=36){var D=N<=i?1:N>=i+26?26:N-i;if(I>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function M(e){for(var t="",r=0,a=e.length;r=194&&n<224){if(a-r>=6){var i=parseInt(e.substr(r+4,2),16);t+=String.fromCharCode((31&n)<<6|63&i)}else t+=e.substr(r,6);r+=6}else if(n>=224){if(a-r>=9){var o=parseInt(e.substr(r+4,2),16),s=parseInt(e.substr(r+7,2),16);t+=String.fromCharCode((15&n)<<12|(63&o)<<6|63&s)}else t+=e.substr(r,9);r+=9}else t+=e.substr(r,3),r+=3}return t}function T(e,t){function r(e){var r=M(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,S).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,S).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,S).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,S).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,S).replace(t.PCT_ENCODED,n)),e}function P(e){return e.replace(/^0*(.*)/,"$1")||"0"}function F(e,t){var r=e.match(t.IPV4ADDRESS)||[],a=l(r,2)[1];return a?a.split(".").map(P).join("."):e}function O(e,t){var r=e.match(t.IPV6ADDRESS)||[],a=l(r,3),n=a[1],i=a[2];if(n){for(var o=n.toLowerCase().split("::").reverse(),s=l(o,2),u=s[0],c=s[1],f=c?c.split(":").map(P):[],d=u.split(":").map(P),h=t.IPV4ADDRESS.test(d[d.length-1]),p=h?7:8,m=d.length-p,v=Array(p),g=0;g1){var w=v.slice(0,y.index),x=v.slice(y.index+y.length);b=w.join(":")+"::"+x.join(":")}else b=v.join(":");return i&&(b+="%"+i),b}return e}var L=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,C=void 0==="".match(/(){0}/)[1];function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},a=!1!==t.iri?s:o;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(L);if(n){C?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=O(F(r.host,a),a)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var i=E[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||i&&i.unicodeSupport)T(r,a);else{if(r.host&&(t.domainHost||i&&i.domainHost))try{r.host=A.toASCII(r.host.replace(a.PCT_ENCODED,M).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}T(r,o)}i&&i.parse&&i.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var R=/^\.\.?\//,I=/^\/\.(\/|$)/,N=/^\/\.\.(\/|$)/,D=/^\/?(?:.|\n)*?(?=\/|$)/;function U(e){for(var t=[];e.length;)if(e.match(R))e=e.replace(R,"");else if(e.match(I))e=e.replace(I,"/");else if(e.match(N))e=e.replace(N,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(D);if(!r)throw new Error("Unexpected dot segment condition");var a=r[0];e=e.slice(a.length),t.push(a)}return t.join("")}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?s:o,a=[],n=E[(t.scheme||e.scheme||"").toLowerCase()];if(n&&n.serialize&&n.serialize(e,t),e.host)if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||n&&n.domainHost)try{e.host=t.iri?A.toUnicode(e.host):A.toASCII(e.host.replace(r.PCT_ENCODED,M).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}T(e,r),"suffix"!==t.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var i=function(e,t){var r=!1!==t.iri?s:o,a=[];return void 0!==e.userinfo&&(a.push(e.userinfo),a.push("@")),void 0!==e.host&&a.push(O(F(String(e.host),r),r).replace(r.IPV6ADDRESS,(function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"}))),"number"==typeof e.port&&(a.push(":"),a.push(e.port.toString(10))),a.length?a.join(""):void 0}(e,t);if(void 0!==i&&("suffix"!==t.reference&&a.push("//"),a.push(i),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var l=e.path;t.absolutePath||n&&n.absolutePath||(l=U(l)),void 0===i&&(l=l.replace(/^\/\//,"/%2F")),a.push(l)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function B(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=k(j(e,r),r),t=k(j(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=U(t.path||""),a.query=t.query):(t.path?("/"===t.path.charAt(0)?a.path=U(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=U(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function V(e,t){return e&&e.toString().replace(t&&t.iri?s.PCT_ENCODED:o.PCT_ENCODED,M)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){return e.port!==("https"!==String(e.scheme).toLowerCase()?80:443)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},G={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize},H={},X="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Y="[0-9A-Fa-f]",W=r(r("%[EFef][0-9A-Fa-f]%"+Y+Y+"%"+Y+Y)+"|"+r("%[89A-Fa-f][0-9A-Fa-f]%"+Y+Y)+"|"+r("%"+Y+Y)),q=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Q=new RegExp(X,"g"),Z=new RegExp(W,"g"),K=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',q),"g"),J=new RegExp(t("[^]",X,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),$=J;function ee(e){var t=M(e);return t.match(Q)?t:e}var te={scheme:"mailto",parse:function(e,t){var r=e,a=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var n=!1,i={},o=r.query.split("&"),s=0,l=o.length;s=55296&&t<=56319&&n%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,c=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,f=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,h=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",a.copy(m[e])}function v(e){var t=e.match(n);if(!t)return!1;var r=+t[1],a=+t[2],o=+t[3];return a>=1&&a<=12&&o>=1&&o<=(2==a&&function(e){return e%4==0&&(e%100!=0||e%400==0)}(r)?29:i[a])}function g(e,t){var r=e.match(o);if(!r)return!1;var a=r[1],n=r[2],i=r[3],s=r[5];return(a<=23&&n<=59&&i<=59||23==a&&59==n&&60==i)&&(!t||s)}e.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":u,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-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er-uri-fragment":h,"relative-json-pointer":p},m.full={date:v,time:g,"date-time":function(e){var t=e.split(y);return 2==t.length&&v(t[0])&&g(t[1],!0)},uri:function(e){return b.test(e)&&l.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"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1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:x,uuid:f,"json-pointer":d,"json-pointer-uri-fragment":h,"relative-json-pointer":p};var y=/t|\s/i;var b=/\/|:/;var w=/[^\\]\\Z/;function x(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},function(e,t,r){"use strict";var a=r(134),n=r(14).toHash;e.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=n(t),e.types=n(["number","integer","string","array","object","boolean","null"]),e.forEach((function(r){r.rules=r.rules.map((function(r){var n;if("object"==typeof r){var i=Object.keys(r)[0];n=r[i],r=i,n.forEach((function(r){t.push(r),e.all[r]=!0}))}return t.push(r),e.all[r]={keyword:r,code:a[r],implements:n}})),e.all.$comment={keyword:"$comment",code:a.$comment},r.type&&(e.types[r.type]=r)})),e.keywords=n(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}},function(e,t,r){"use strict";e.exports={$ref:r(135),allOf:r(136),anyOf:r(137),$comment:r(138),const:r(139),contains:r(140),dependencies:r(141),enum:r(142),format:r(143),if:r(144),items:r(145),maximum:r(63),minimum:r(63),maxItems:r(64),minItems:r(64),maxLength:r(65),minLength:r(65),maxProperties:r(66),minProperties:r(66),multipleOf:r(146),not:r(147),oneOf:r(148),pattern:r(149),properties:r(150),propertyNames:r(151),required:r(152),uniqueItems:r(153),validate:r(62)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n,i=" ",o=e.level,s=e.dataLevel,l=e.schema[t],u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(s||""),d="valid"+o;if("#"==l||"#/"==l)e.isRoot?(a=e.async,n="validate"):(a=!0===e.root.schema.$async,n="root.refVal[0]");else{var h=e.resolveRef(e.baseId,l,e.isRoot);if(void 0===h){var p=e.MissingRefError.message(e.baseId,l);if("fail"==e.opts.missingRefs){e.logger.error(p),(y=y||[]).push(i),i="",!1!==e.createErrors?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(l)+"' } ",!1!==e.opts.messages&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(l)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(l)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var m=i;i=y.pop(),!e.compositeRule&&c?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(i+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,l,p);e.logger.warn(p),c&&(i+=" if (true) { ")}}else if(h.inline){var v=e.util.copy(e);v.level++;var g="valid"+v.level;v.schema=h.schema,v.schemaPath="",v.errSchemaPath=l,i+=" "+e.validate(v).replace(/validate\.schema/g,h.code)+" ",c&&(i+=" if ("+g+") { ")}else a=!0===h.$async||e.async&&!1!==h.$async,n=h.code}if(n){var y;(y=y||[]).push(i),i="",e.opts.passContext?i+=" "+n+".call(this, ":i+=" "+n+"( ",i+=" "+f+", (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath);var b=i+=" , "+(s?"data"+(s-1||""):"parentData")+" , "+(s?e.dataPathArr[s]:"parentDataProperty")+", rootData) ";if(i=y.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");c&&(i+=" var "+d+"; "),i+=" try { await "+b+"; ",c&&(i+=" "+d+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",c&&(i+=" "+d+" = false; "),i+=" } ",c&&(i+=" if ("+d+") { ")}else i+=" if (!"+b+") { if (vErrors === null) vErrors = "+n+".errors; else vErrors = vErrors.concat("+n+".errors); errors = vErrors.length; } ",c&&(i+=" else { ")}return i}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.schema[t],i=e.schemaPath+e.util.getProperty(t),o=e.errSchemaPath+"/"+t,s=!e.opts.allErrors,l=e.util.copy(e),u="";l.level++;var c="valid"+l.level,f=l.baseId,d=!0,h=n;if(h)for(var p,m=-1,v=h.length-1;m0:e.util.schemaHasRules(p,e.RULES.all))&&(d=!1,l.schema=p,l.schemaPath=i+"["+m+"]",l.errSchemaPath=o+"/"+m,a+=" "+e.validate(l)+" ",l.baseId=f,s&&(a+=" if ("+c+") { ",u+="}"));return s&&(a+=d?" if (true) { ":" "+u.slice(0,-1)+" "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level;if(o.every((function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0:e.util.schemaHasRules(t,e.RULES.all)}))){var v=h.baseId;a+=" var "+d+" = errors; var "+f+" = false; ";var g=e.compositeRule;e.compositeRule=h.compositeRule=!0;var y=o;if(y)for(var b,w=-1,x=y.length-1;w0:e.util.schemaHasRules(o,e.RULES.all);if(a+="var "+d+" = errors;var "+f+";",b){var w=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+p+" = false; for (var "+m+" = 0; "+m+" < "+c+".length; "+m+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var x=c+"["+m+"]";h.dataPathArr[v]=m;var _=e.validate(h);h.baseId=y,e.util.varOccurences(_,g)<2?a+=" "+e.util.varReplace(_,g,x)+" ":a+=" var "+g+" = "+x+"; "+_+" ",a+=" if ("+p+") break; } ",e.compositeRule=h.compositeRule=w,a+=" if (!"+p+") {"}else a+=" if ("+c+".length == 0) {";var A=A||[];A.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;return a=A.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { ",b&&(a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m={},v={},g=e.opts.ownProperties;for(x in o){var y=o[x],b=Array.isArray(y)?v:m;b[x]=y}a+="var "+f+" = errors;";var w=e.errorPath;for(var x in a+="var missing"+n+";",v)if((b=v[x]).length){if(a+=" if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),u){a+=" && ( ";var _=b;if(_)for(var A=-1,E=_.length-1;A0:e.util.schemaHasRules(y,e.RULES.all))&&(a+=" "+p+" = true; if ( "+c+e.util.getProperty(x)+" !== undefined ",g&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(x)+"') "),a+=") { ",d.schema=y,d.schemaPath=s+e.util.getProperty(x),d.errSchemaPath=l+"/"+e.util.escapeFragment(x),a+=" "+e.validate(d)+" ",d.baseId=I,a+=" } ",u&&(a+=" if ("+p+") { ",h+="}"))}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d=e.opts.$data&&o&&o.$data;d&&(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ");var h="i"+n,p="schema"+n;d||(a+=" var "+p+" = validate.schema"+s+";"),a+="var "+f+";",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=f+" = false;for (var "+h+"=0; "+h+"<"+p+".length; "+h+"++) if (equal("+c+", "+p+"["+h+"])) { "+f+" = true; break; }",d&&(a+=" } "),a+=" if (!"+f+") { ";var m=m||[];m.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { allowedValues: schema"+n+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var v=a;return a=m.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" }",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||"");if(!1===e.opts.format)return u&&(a+=" if (true) { "),a;var f,d=e.opts.$data&&o&&o.$data;d?(a+=" var schema"+n+" = "+e.util.getData(o.$data,i,e.dataPathArr)+"; ",f="schema"+n):f=o;var h=e.opts.unknownFormats,p=Array.isArray(h);if(d){a+=" var "+(m="format"+n)+" = formats["+f+"]; var "+(v="isObject"+n)+" = typeof "+m+" == 'object' && !("+m+" instanceof RegExp) && "+m+".validate; var "+(g="formatType"+n)+" = "+v+" && "+m+".type || 'string'; if ("+v+") { ",e.async&&(a+=" var async"+n+" = "+m+".async; "),a+=" "+m+" = "+m+".validate; } if ( ",d&&(a+=" ("+f+" !== undefined && typeof "+f+" != 'string') || "),a+=" (","ignore"!=h&&(a+=" ("+f+" && !"+m+" ",p&&(a+=" && self._opts.unknownFormats.indexOf("+f+") == -1 "),a+=") || "),a+=" ("+m+" && "+g+" == '"+r+"' && !(typeof "+m+" == 'function' ? ",e.async?a+=" (async"+n+" ? await "+m+"("+c+") : "+m+"("+c+")) ":a+=" "+m+"("+c+") ",a+=" : "+m+".test("+c+"))))) {"}else{var m;if(!(m=e.formats[o])){if("ignore"==h)return e.logger.warn('unknown format "'+o+'" ignored in schema at path "'+e.errSchemaPath+'"'),u&&(a+=" if (true) { "),a;if(p&&h.indexOf(o)>=0)return u&&(a+=" if (true) { "),a;throw new Error('unknown format "'+o+'" is used in schema at path "'+e.errSchemaPath+'"')}var v,g=(v="object"==typeof m&&!(m instanceof RegExp)&&m.validate)&&m.type||"string";if(v){var y=!0===m.async;m=m.validate}if(g!=r)return u&&(a+=" if (true) { "),a;if(y){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(b="formats"+e.util.getProperty(o)+".validate")+"("+c+"))) { "}else{a+=" if (! ";var b="formats"+e.util.getProperty(o);v&&(b+=".validate"),a+="function"==typeof m?" "+b+"("+c+") ":" "+b+".test("+c+") ",a+=") { "}}var w=w||[];w.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { format: ",a+=d?""+f:""+e.util.toQuotedString(o),a+=" } ",!1!==e.opts.messages&&(a+=" , message: 'should match format \"",a+=d?"' + "+f+" + '":""+e.util.escapeQuotes(o),a+="\"' "),e.opts.verbose&&(a+=" , schema: ",a+=d?"validate.schema"+s:""+e.util.toQuotedString(o),a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var x=a;return a=w.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+x+"]); ":a+=" validate.errors = ["+x+"]; return false; ":a+=" var err = "+x+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",u&&(a+=" else { "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e);h.level++;var p="valid"+h.level,m=e.schema.then,v=e.schema.else,g=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0:e.util.schemaHasRules(m,e.RULES.all)),y=void 0!==v&&(e.opts.strictKeywords?"object"==typeof v&&Object.keys(v).length>0:e.util.schemaHasRules(v,e.RULES.all)),b=h.baseId;if(g||y){var w;h.createErrors=!1,h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" var "+d+" = errors; var "+f+" = true; ";var x=e.compositeRule;e.compositeRule=h.compositeRule=!0,a+=" "+e.validate(h)+" ",h.baseId=b,h.createErrors=!0,a+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=h.compositeRule=x,g?(a+=" if ("+p+") { ",h.schema=e.schema.then,h.schemaPath=e.schemaPath+".then",h.errSchemaPath=e.errSchemaPath+"/then",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'then'; ":w="'then'",a+=" } ",y&&(a+=" else { ")):a+=" if (!"+p+") { ",y&&(h.schema=e.schema.else,h.schemaPath=e.schemaPath+".else",h.errSchemaPath=e.errSchemaPath+"/else",a+=" "+e.validate(h)+" ",h.baseId=b,a+=" "+f+" = "+p+"; ",g&&y?a+=" var "+(w="ifClause"+n)+" = 'else'; ":w="'else'",a+=" } "),a+=" if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+=" } ",u&&(a+=" else { "),a=e.util.cleanUpCode(a)}else u&&(a+=" if (true) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v="i"+n,g=h.dataLevel=e.dataLevel+1,y="data"+g,b=e.baseId;if(a+="var "+d+" = errors;var "+f+";",Array.isArray(o)){var w=e.schema.additionalItems;if(!1===w){a+=" "+f+" = "+c+".length <= "+o.length+"; ";var x=l;l=e.errSchemaPath+"/additionalItems",a+=" if (!"+f+") { ";var _=_||[];_.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+o.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+o.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var A=a;a=_.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+A+"]); ":a+=" validate.errors = ["+A+"]; return false; ":a+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",l=x,u&&(p+="}",a+=" else { ")}var E=o;if(E)for(var S,M=-1,T=E.length-1;M0:e.util.schemaHasRules(S,e.RULES.all)){a+=" "+m+" = true; if ("+c+".length > "+M+") { ";var P=c+"["+M+"]";h.schema=S,h.schemaPath=s+"["+M+"]",h.errSchemaPath=l+"/"+M,h.errorPath=e.util.getPathExpr(e.errorPath,M,e.opts.jsonPointers,!0),h.dataPathArr[g]=M;var F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",a+=" } ",u&&(a+=" if ("+m+") { ",p+="}")}if("object"==typeof w&&(e.opts.strictKeywords?"object"==typeof w&&Object.keys(w).length>0:e.util.schemaHasRules(w,e.RULES.all))){h.schema=w,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+m+" = true; if ("+c+".length > "+o.length+") { for (var "+v+" = "+o.length+"; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" } } ",u&&(a+=" if ("+m+") { ",p+="}")}}else if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=l,a+=" for (var "+v+" = 0; "+v+" < "+c+".length; "+v+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);P=c+"["+v+"]";h.dataPathArr[g]=v;F=e.validate(h);h.baseId=b,e.util.varOccurences(F,y)<2?a+=" "+e.util.varReplace(F,y,P)+" ":a+=" var "+y+" = "+P+"; "+F+" ",u&&(a+=" if (!"+m+") break; "),a+=" }"}return u&&(a+=" "+p+" if ("+d+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="var division"+i+";if (",d&&(n+=" "+a+" !== undefined && ( typeof "+a+" != 'number' || "),n+=" (division"+i+" = "+f+" / "+a+", ",e.opts.multipleOfPrecision?n+=" Math.abs(Math.round(division"+i+") - division"+i+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+i+" !== parseInt(division"+i+") ",n+=" ) ",d&&(n+=" ) "),n+=" ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+a+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be multiple of ",n+=d?"' + "+a:a+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l,a+=" var "+f+" = errors; ";var p,m=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.opts.allErrors&&(p=d.opts.allErrors,d.opts.allErrors=!1),a+=" "+e.validate(d)+" ",d.createErrors=!0,p&&(d.opts.allErrors=p),e.compositeRule=d.compositeRule=m,a+=" if ("+h+") { ";var v=v||[];v.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var g=a;a=v.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+g+"]); ":a+=" validate.errors = ["+g+"]; return false; ":a+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { errors = "+f+"; if (vErrors !== null) { if ("+f+") vErrors.length = "+f+"; else vErrors = null; } ",e.opts.allErrors&&(a+=" } ")}else a+=" var err = ",!1!==e.createErrors?(a+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should NOT be valid' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(a+=" if (false) { ");return a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="valid"+n,d="errs__"+n,h=e.util.copy(e),p="";h.level++;var m="valid"+h.level,v=h.baseId,g="prevValid"+n,y="passingSchemas"+n;a+="var "+d+" = errors , "+g+" = false , "+f+" = false , "+y+" = null; ";var b=e.compositeRule;e.compositeRule=h.compositeRule=!0;var w=o;if(w)for(var x,_=-1,A=w.length-1;_0:e.util.schemaHasRules(x,e.RULES.all))?(h.schema=x,h.schemaPath=s+"["+_+"]",h.errSchemaPath=l+"/"+_,a+=" "+e.validate(h)+" ",h.baseId=v):a+=" var "+m+" = true; ",_&&(a+=" if ("+m+" && "+g+") { "+f+" = false; "+y+" = ["+y+", "+_+"]; } else { ",p+="}"),a+=" if ("+m+") { "+f+" = "+g+" = true; "+y+" = "+_+"; }";return e.compositeRule=h.compositeRule=b,a+=p+"if (!"+f+") { var err = ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+y+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&u&&(e.async?a+=" throw new ValidationError(vErrors); ":a+=" validate.errors = vErrors; return false; "),a+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a,n=" ",i=e.level,o=e.dataLevel,s=e.schema[t],l=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,f="data"+(o||""),d=e.opts.$data&&s&&s.$data;d?(n+=" var schema"+i+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",a="schema"+i):a=s,n+="if ( ",d&&(n+=" ("+a+" !== undefined && typeof "+a+" != 'string') || "),n+=" !"+(d?"(new RegExp("+a+"))":e.usePattern(s))+".test("+f+") ) { ";var h=h||[];h.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",n+=d?""+a:""+e.util.toQuotedString(s),n+=" } ",!1!==e.opts.messages&&(n+=" , message: 'should match pattern \"",n+=d?"' + "+a+" + '":""+e.util.escapeQuotes(s),n+="\"' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+l:""+e.util.toQuotedString(s),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var p=n;return n=h.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+p+"]); ":n+=" validate.errors = ["+p+"]; return false; ":n+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e),h="";d.level++;var p="valid"+d.level,m="key"+n,v="idx"+n,g=d.dataLevel=e.dataLevel+1,y="data"+g,b="dataProperties"+n,w=Object.keys(o||{}),x=e.schema.patternProperties||{},_=Object.keys(x),A=e.schema.additionalProperties,E=w.length||_.length,S=!1===A,M="object"==typeof A&&Object.keys(A).length,T=e.opts.removeAdditional,P=S||M||T,F=e.opts.ownProperties,O=e.baseId,L=e.schema.required;if(L&&(!e.opts.$data||!L.$data)&&L.length8)a+=" || validate.schema"+s+".hasOwnProperty("+m+") ";else{var k=w;if(k)for(var R=-1,I=k.length-1;R0:e.util.schemaHasRules(K,e.RULES.all)){var J=e.util.getProperty(q),$=(H=c+J,Y&&void 0!==K.default);d.schema=K,d.schemaPath=s+J,d.errSchemaPath=l+"/"+e.util.escapeFragment(q),d.errorPath=e.util.getPath(e.errorPath,q,e.opts.jsonPointers),d.dataPathArr[g]=e.util.toQuotedString(q);X=e.validate(d);if(d.baseId=O,e.util.varOccurences(X,y)<2){X=e.util.varReplace(X,y,H);var ee=H}else{ee=y;a+=" var "+y+" = "+H+"; "}if($)a+=" "+X+" ";else{if(C&&C[q]){a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = false; ";j=e.errorPath,V=l;var te,re=e.util.escapeQuotes(q);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(j,q,e.opts.jsonPointers)),l=e.errSchemaPath+"/required",(te=te||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+re+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+re+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";z=a;a=te.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+z+"]); ":a+=" validate.errors = ["+z+"]; return false; ":a+=" var err = "+z+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l=V,e.errorPath=j,a+=" } else { "}else u?(a+=" if ( "+ee+" === undefined ",F&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=") { "+p+" = true; } else { "):(a+=" if ("+ee+" !== undefined ",F&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(q)+"') "),a+=" ) { ");a+=" "+X+" } "}}u&&(a+=" if ("+p+") { ",h+="}")}}if(_.length){var ae=_;if(ae)for(var ne,ie=-1,oe=ae.length-1;ie0:e.util.schemaHasRules(K,e.RULES.all)){d.schema=K,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(ne),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(ne),a+=F?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+v+"=0; "+v+"<"+b+".length; "+v+"++) { var "+m+" = "+b+"["+v+"]; ":" for (var "+m+" in "+c+") { ",a+=" if ("+e.usePattern(ne)+".test("+m+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);H=c+"["+m+"]";d.dataPathArr[g]=m;X=e.validate(d);d.baseId=O,e.util.varOccurences(X,y)<2?a+=" "+e.util.varReplace(X,y,H)+" ":a+=" var "+y+" = "+H+"; "+X+" ",u&&(a+=" if (!"+p+") break; "),a+=" } ",u&&(a+=" else "+p+" = true; "),a+=" } ",u&&(a+=" if ("+p+") { ",h+="}")}}}return u&&(a+=" "+h+" if ("+f+" == errors) {"),a=e.util.cleanUpCode(a)}},function(e,t,r){"use strict";e.exports=function(e,t,r){var a=" ",n=e.level,i=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),l=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,c="data"+(i||""),f="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(a+="var "+f+" = errors;",e.opts.strictKeywords?"object"==typeof o&&Object.keys(o).length>0:e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=l;var p="key"+n,m="idx"+n,v="i"+n,g="' + "+p+" + '",y="data"+(d.dataLevel=e.dataLevel+1),b="dataProperties"+n,w=e.opts.ownProperties,x=e.baseId;w&&(a+=" var "+b+" = undefined; "),a+=w?" "+b+" = "+b+" || Object.keys("+c+"); for (var "+m+"=0; "+m+"<"+b+".length; "+m+"++) { var "+p+" = "+b+"["+m+"]; ":" for (var "+p+" in "+c+") { ",a+=" var startErrs"+n+" = errors; ";var _=p,A=e.compositeRule;e.compositeRule=d.compositeRule=!0;var E=e.validate(d);d.baseId=x,e.util.varOccurences(E,y)<2?a+=" "+e.util.varReplace(E,y,_)+" ":a+=" var "+y+" = "+_+"; "+E+" ",e.compositeRule=d.compositeRule=A,a+=" if (!"+h+") { for (var "+v+"=startErrs"+n+"; "+v+"0:e.util.schemaHasRules(b,e.RULES.all))||(p[p.length]=v)}}else p=o;if(d||p.length){var w=e.errorPath,x=d||p.length>=e.opts.loopRequired,_=e.opts.ownProperties;if(u)if(a+=" var missing"+n+"; ",x){d||(a+=" var "+h+" = validate.schema"+s+"; ");var A="' + "+(F="schema"+n+"["+(M="i"+n)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,F,e.opts.jsonPointers)),a+=" var "+f+" = true; ",d&&(a+=" if (schema"+n+" === undefined) "+f+" = true; else if (!Array.isArray(schema"+n+")) "+f+" = false; else {"),a+=" for (var "+M+" = 0; "+M+" < "+h+".length; "+M+"++) { "+f+" = "+c+"["+h+"["+M+"]] !== undefined ",_&&(a+=" && Object.prototype.hasOwnProperty.call("+c+", "+h+"["+M+"]) "),a+="; if (!"+f+") break; } ",d&&(a+=" } "),a+=" if (!"+f+") { ",(P=P||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+A+"' } ",!1!==e.opts.messages&&(a+=" , message: '",e.opts._errorDataPathProperty?a+="is a required property":a+="should have required property \\'"+A+"\\'",a+="' "),e.opts.verbose&&(a+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var E=a;a=P.pop(),!e.compositeRule&&u?e.async?a+=" throw new ValidationError(["+E+"]); ":a+=" validate.errors = ["+E+"]; return false; ":a+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else { "}else{a+=" if ( ";var S=p;if(S)for(var M=-1,T=S.length-1;M 1) { ";var p=e.schema.items&&e.schema.items.type,m=Array.isArray(p);if(!p||"object"==p||"array"==p||m&&(p.indexOf("object")>=0||p.indexOf("array")>=0))n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+d+" = false; break outer; } } } ";else{n+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var v="checkDataType"+(m?"s":"");n+=" if ("+e.util[v](p,"item",!0)+") continue; ",m&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+d+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}n+=" } ",h&&(n+=" } "),n+=" if (!"+d+") { ";var g=g||[];g.push(n),n="",!1!==e.createErrors?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+l:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),n+=" } "):n+=" {} ";var y=n;n=g.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+y+"]); ":n+=" validate.errors = ["+y+"]; return false; ":n+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { ")}else c&&(n+=" if (true) { ");return n}},function(e,t,r){"use strict";var a=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];e.exports=function(e,t){for(var r=0;r(e[t]=function(e,t,r,n){return[(t,n)=>{if(n+r>t.length)throw new a;return{value:t[e](n),size:r}},(e,a,n)=>(a[t](e,n),n+r),r,n]}(n[t][0],n[t][1],n[t][2],r(20)[t]),e),{});i.i64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32BE(t),e.readInt32BE(t+4)],size:8}},function(e,t,r){return t.writeInt32BE(e[0],r),t.writeInt32BE(e[1],r+4),r+8},8,r(20).i64],i.li64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readInt32LE(t+4),e.readInt32LE(t)],size:8}},function(e,t,r){return t.writeInt32LE(e[0],r+4),t.writeInt32LE(e[1],r),r+8},8,r(20).li64],i.u64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32BE(t),e.readUInt32BE(t+4)],size:8}},function(e,t,r){return t.writeUInt32BE(e[0],r),t.writeUInt32BE(e[1],r+4),r+8},8,r(20).u64],i.lu64=[function(e,t){if(t+8>e.length)throw new a;return{value:[e.readUInt32LE(t+4),e.readUInt32LE(t)],size:8}},function(e,t,r){return t.writeUInt32LE(e[0],r+4),t.writeUInt32LE(e[1],r),r+8},8,r(20).lu64],e.exports=i},function(e,t,r){(function(t){const a=r(25),{getCount:n,sendCount:i,calcCount:o,PartialReadError:s}=r(13);function l(e,t){return e===t||parseInt(e)===parseInt(t)}function u(e){return(1<e.length)throw new s;const o=e.readUInt8(i);if(r|=(127&o)<>>=7;return t.writeUInt8(e,r+a),r+a+1},function(e){let t=0;for(;-128&e;)e>>>=7,t++;return t+1},r(10).varint],bool:[function(e,t){if(t+1>e.length)throw new s;return{value:!!e.readInt8(t),size:1}},function(e,t,r){return t.writeInt8(+e,r),r+1},1,r(10).bool],pstring:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a),l=t+i,u=l+o;if(u>e.length)throw new s("Missing characters in string, found size is "+e.length+" expected size was "+u);return{value:e.toString("utf8",l,u),size:u-t}},function(e,r,a,n,o){const s=t.byteLength(e,"utf8");return a=i.call(this,s,r,a,n,o),r.write(e,a,s,"utf8"),a+s},function(e,r,a){const n=t.byteLength(e,"utf8");return o.call(this,n,r,a)+n},r(10).pstring],buffer:[function(e,t,r,a){const{size:i,count:o}=n.call(this,e,t,r,a);if((t+=i)+o>e.length)throw new s;return{value:e.slice(t,t+o),size:i+o}},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.copy(t,r),r+e.length},function(e,t,r){return o.call(this,e.length,t,r)+e.length},r(10).buffer],void:[function(){return{value:void 0,size:0}},function(e,t,r){return r},0,r(10).void],bitfield:[function(e,t,r){const a=t;let n=null,i=0;const o={};return o.value=r.reduce((r,{size:a,signed:o,name:l})=>{let c=a,f=0;for(;c>0;){if(0===i){if(e.length>i-r,i-=r,c-=r}return o&&f>=1<{const l=e[s];if(!o&&l<0||o&&l<-(1<=1<=(1<= "+o?1<0;){const e=Math.min(8-i,a);n=n<>a-e&u(e),a-=e,8===(i+=e)&&(t[r++]=n,i=0,n=0)}}),0!==i&&(t[r++]=n<<8-i);return r},function(e,t){return Math.ceil(t.reduce((e,{size:t})=>e+t,0)/8)},r(10).bitfield],cstring:[function(e,t){let r=0;for(;t+rthis.read(e,t,r.type,a),n)),i.size+=u,t+=u,i.value.push(o);return i},function(e,t,r,a,n){return r=i.call(this,e.length,t,r,a,n),e.reduce((e,r,i)=>s(()=>this.write(r,t,e,a.type,n),i),r)},function(e,t,r){let a=o.call(this,e.length,t,r);return a=e.reduce((e,a,n)=>s(()=>e+this.sizeOf(a,t.type,r),n),a)},r(38).array],count:[function(e,t,{type:r},a){return this.read(e,t,r,a)},function(e,t,r,{countFor:n,type:i},o){return this.write(a(n,o).length,t,r,i,o)},function(e,{countFor:t,type:r},n){return this.sizeOf(a(t,n).length,r,n)},r(38).count],container:[function(e,t,r,a){const n={value:{"..":a},size:0};return r.forEach(({type:r,name:a,anon:i})=>{s(()=>{const o=this.read(e,t,r,n.value);n.size+=o.size,t+=o.size,i?void 0!==o.value&&Object.keys(o.value).forEach(e=>{n.value[e]=o.value[e]}):n.value[a]=o.value},a||"unknown")}),delete n.value[".."],n},function(e,t,r,a,n){return e[".."]=n,r=a.reduce((r,{type:a,name:n,anon:i})=>s(()=>this.write(i?e:e[n],t,r,a,e),n||"unknown"),r),delete e[".."],r},function(e,t,r){e[".."]=r;const a=t.reduce((t,{type:r,name:a,anon:n})=>t+s(()=>this.sizeOf(n?e:e[a],r,e),a||"unknown"),0);return delete e[".."],a},r(38).container]}},function(e,t,r){const{getField:a,getFieldInfo:n,tryDoc:i,PartialReadError:o}=r(13);e.exports={switch:[function(e,t,{compareTo:r,fields:o,compareToValue:s,default:l},u){if(r=void 0!==s?s:a(r,u),void 0===o[r]&&void 0===l)throw new Error(r+" has no associated fieldInfo in switch");const c=void 0===o[r],f=c?l:o[r],d=n(f);return i(()=>this.read(e,t,d,u),c?"default":r)},function(e,t,r,{compareTo:o,fields:s,compareToValue:l,default:u},c){if(o=void 0!==l?l:a(o,c),void 0===s[o]&&void 0===u)throw new Error(o+" has no associated fieldInfo in switch");const f=void 0===s[o],d=n(f?u:s[o]);return i(()=>this.write(e,t,r,d,c),f?"default":o)},function(e,{compareTo:t,fields:r,compareToValue:o,default:s},l){if(t=void 0!==o?o:a(t,l),void 0===r[t]&&void 0===s)throw new Error(t+" has no associated fieldInfo in switch");const u=void 0===r[t],c=n(u?s:r[t]);return i(()=>this.sizeOf(e,c,l),u?"default":t)},r(68).switch],option:[function(e,t,r,a){if(e.length0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,a,n=o.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=n,a=s,o.prototype.copy.call(t,r,a),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return en.length?n.length:e;if(i===n.length?a+=n:a+=n.slice(0,e),0==(e-=i)){i===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(i));break}++r}return this.length-=r,a}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,a=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,i=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,i),0==(e-=i)){i===n.length?(++a,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(i));break}++a}return this.length-=a,t}},{key:l,value:function(e,t){return s(this,function(e){for(var t=1;t0,(function(e){c||(c=e),e&&d.forEach(l),i||(d.forEach(l),f(c))}))}));return t.reduce(u)}},function(e,t){e.exports={compound:[function(e,t,r,a){const n={value:{},size:0};for(;;){const r=this.read(e,t,"i8",a);if(0===r.value){t+=r.size,n.size+=r.size;break}const i=this.read(e,t,"nbt",a);t+=i.size,n.size+=i.size,n.value[i.value.name]={type:i.value.type,value:i.value.value}}return n},function(e,t,r,a,n){const i=this;return Object.keys(e).map((function(a){r=i.write({name:a,type:e[a].type,value:e[a].value},t,r,"nbt",n)})),r=this.write(0,t,r,"i8",n)},function(e,t,r){const a=this;return 1+Object.keys(e).reduce((function(t,n){return t+a.sizeOf({name:n,type:e[n].type,value:e[n].value},"nbt",r)}),0)}]}},function(e){e.exports=JSON.parse('{"container":"native","i8":"native","switch":"native","compound":"native","i16":"native","i32":"native","i64":"native","f32":"native","f64":"native","pstring":"native","shortString":["pstring",{"countType":"i16"}],"byteArray":["array",{"countType":"i32","type":"i8"}],"list":["container",[{"name":"type","type":"nbtMapper"},{"name":"value","type":["array",{"countType":"i32","type":["nbtSwitch",{"type":"type"}]}]}]],"intArray":["array",{"countType":"i32","type":"i32"}],"longArray":["array",{"countType":"i32","type":"i64"}],"nbtMapper":["mapper",{"type":"i8","mappings":{"0":"end","1":"byte","2":"short","3":"int","4":"long","5":"float","6":"double","7":"byteArray","8":"string","9":"list","10":"compound","11":"intArray","12":"longArray"}}],"nbtSwitch":["switch",{"compareTo":"$type","fields":{"end":"void","byte":"i8","short":"i16","int":"i32","long":"i64","float":"f32","double":"f64","byteArray":"byteArray","string":"shortString","list":"list","compound":"compound","intArray":"intArray","longArray":"longArray"}}],"nbt":["container",[{"name":"type","type":"nbtMapper"},{"name":"name","type":"shortString"},{"name":"value","type":["nbtSwitch",{"type":"type"}]}]]}')},function(e,t){var r,a;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a={rotl:function(e,t){return e<>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&a.rotl(e,8)|4278255360&a.rotl(e,24);for(var t=0;t0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,a=0;r>>5]|=e[r]<<24-a%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],a=0,n=0;a>>6-2*n);return t}},e.exports=a},function(e,t){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ -e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict"},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return n}));var a=r(1);function n(e){console.debug("New Worker!"),e.addEventListener("message",t=>{let r=t.data;"parseModel"===r.func?Object(a.e)(r.model,r.modelOptions,[],r.assetRoot).then(t=>{e.postMessage({msg:"done",parsedModelList:t}),close()}):"loadAndMergeModel"===r.func?Object(a.b)(r.model,r.assetRoot).then(t=>{e.postMessage({msg:"done",mergedModel:t}),close()}):"loadTextures"===r.func?Object(a.c)(r.textures,r.assetRoot).then(t=>{e.postMessage({msg:"done",textures:t}),close()}):(console.warn("Unknown function '"+r.func+"' for ModelWorker"),console.warn(r),close())})}}]); \ No newline at end of file +e.exports=function(e){return null!=e&&(r(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}(e)||!!e._isBuffer)}},function(e,t,r){"use strict"},function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return o}));var a=r(1),n=r(11);const i=n("minerender");function o(e){i("New Worker!"),e.addEventListener("message",t=>{let r=t.data;"parseModel"===r.func?Object(a.e)(r.model,r.modelOptions,[],r.assetRoot).then(t=>{e.postMessage({msg:"done",parsedModelList:t}),close()}):"loadAndMergeModel"===r.func?Object(a.b)(r.model,r.assetRoot).then(t=>{e.postMessage({msg:"done",mergedModel:t}),close()}):"loadTextures"===r.func?Object(a.c)(r.textures,r.assetRoot).then(t=>{e.postMessage({msg:"done",textures:t}),close()}):(console.warn("Unknown function '"+r.func+"' for ModelWorker"),console.warn(r),close())})}}]); \ No newline at end of file diff --git a/dist/skin.js b/dist/skin.js index 540efa83..ea628924 100644 --- a/dist/skin.js +++ b/dist/skin.js @@ -1,8 +1,8 @@ /*! - * MineRender 1.4.6 + * MineRender 1.4.7 * (c) 2018, Haylee Schäfer (inventivetalent) / MIT License * https://minerender.org - * Build #1612195849082 / Mon Feb 01 2021 17:10:49 GMT+0100 (GMT+01:00) + * Build #1612197069607 / Mon Feb 01 2021 17:31:09 GMT+0100 (GMT+01:00) */ /******/ (function(modules) { // webpackBootstrap /******/ // The module cache @@ -224,6 +224,50 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n /***/ }), +/***/ "./node_modules/debug/src/browser.js": +/*!*******************************************!*\ + !*** ./node_modules/debug/src/browser.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(/*! ./debug */ \"./node_modules/debug/src/debug.js\");\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // NB: In an Electron preload script, document will be defined but not fully\n // initialized. Since we know we're in Chrome, we'll just detect this case\n // explicitly\n if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n return true;\n }\n\n // is webkit? http://stackoverflow.com/a/16459606/376773\n // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n // double check webkit in userAgent just in case we are in a worker\n (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n try {\n return JSON.stringify(v);\n } catch (err) {\n return '[UnexpectedJSONParseError]: ' + err.message;\n }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ')\n + '+' + exports.humanize(this.diff);\n\n if (!useColors) return;\n\n var c = 'color: ' + this.color;\n args.splice(1, 0, c, 'color: inherit')\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-zA-Z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n\n // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n if (!r && typeof process !== 'undefined' && 'env' in process) {\n r = process.env.DEBUG;\n }\n\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n try {\n return window.localStorage;\n } catch (e) {}\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/node_modules/process/browser.js */ \"./node_modules/node-libs-browser/node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///./node_modules/debug/src/browser.js?"); + +/***/ }), + +/***/ "./node_modules/debug/src/debug.js": +/*!*****************************************!*\ + !*** ./node_modules/debug/src/debug.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = __webpack_require__(/*! ms */ \"./node_modules/ms/index.js\");\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n var hash = 0, i;\n\n for (i in namespace) {\n hash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n\n return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n function debug() {\n // disabled?\n if (!debug.enabled) return;\n\n var self = debug;\n\n // set `diff` timestamp\n var curr = +new Date();\n var ms = curr - (prevTime || curr);\n self.diff = ms;\n self.prev = prevTime;\n self.curr = curr;\n prevTime = curr;\n\n // turn the `arguments` into a proper Array\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %O\n args.unshift('%O');\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n // apply env-specific formatting (colors, etc.)\n exports.formatArgs.call(self, args);\n\n var logFn = debug.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n\n debug.namespace = namespace;\n debug.enabled = exports.enabled(namespace);\n debug.useColors = exports.useColors();\n debug.color = selectColor(namespace);\n\n // env-specific initialization logic for debug instances\n if ('function' === typeof exports.init) {\n exports.init(debug);\n }\n\n return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n exports.names = [];\n exports.skips = [];\n\n var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n\n\n//# sourceURL=webpack:///./node_modules/debug/src/debug.js?"); + +/***/ }), + +/***/ "./node_modules/ms/index.js": +/*!**********************************!*\ + !*** ./node_modules/ms/index.js ***! + \**********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isNaN(val) === false) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n if (ms >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (ms >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (ms >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (ms >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n return plural(ms, d, 'day') ||\n plural(ms, h, 'hour') ||\n plural(ms, m, 'minute') ||\n plural(ms, s, 'second') ||\n ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n if (ms < n) {\n return;\n }\n if (ms < n * 1.5) {\n return Math.floor(ms / n) + ' ' + name;\n }\n return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n\n//# sourceURL=webpack:///./node_modules/ms/index.js?"); + +/***/ }), + +/***/ "./node_modules/node-libs-browser/node_modules/process/browser.js": +/*!************************************************************************!*\ + !*** ./node_modules/node-libs-browser/node_modules/process/browser.js ***! + \************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack:///./node_modules/node-libs-browser/node_modules/process/browser.js?"); + +/***/ }), + /***/ "./node_modules/onscreen/dist/on-screen.umd.js": /*!*****************************************************!*\ !*** ./node_modules/onscreen/dist/on-screen.umd.js ***! @@ -265,7 +309,7 @@ eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn th /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_ROOT\", function() { return DEFAULT_ROOT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureAsBase64\", function() { return loadTextureAsBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadBlockState\", function() { return loadBlockState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureMeta\", function() { return loadTextureMeta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath\", function() { return loadJsonFromPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath_\", function() { return loadJsonFromPath_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleUv\", function() { return scaleUv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trimCanvas\", function() { return trimCanvas; });\n/**\r\n * Default asset root\r\n * @type {string}\r\n */\r\nconst DEFAULT_ROOT = \"https://assets.mcasset.cloud/1.13\";\r\n/**\r\n * Texture cache\r\n * @type {Object.}\r\n */\r\nconst textureCache = {};\r\n/**\r\n * Texture callbacks\r\n * @type {Object.}\r\n */\r\nconst textureCallbacks = {};\r\n\r\n/**\r\n * Model cache\r\n * @type {Object.}\r\n */\r\nconst modelCache = {};\r\n/**\r\n * Model callbacks\r\n * @type {Object.}\r\n */\r\nconst modelCallbacks = {};\r\n\r\n\r\n/**\r\n * Loads a Mincraft texture an returns it as Base64\r\n *\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} namespace Namespace, usually 'minecraft'\r\n * @param {string} dir Directory of the texture\r\n * @param {string} name Name of the texture\r\n * @returns {Promise}\r\n */\r\nfunction loadTextureAsBase64(root, namespace, dir, name) {\r\n return new Promise((resolve, reject) => {\r\n loadTexture(root, namespace, dir, name, resolve, reject);\r\n })\r\n};\r\n\r\n/**\r\n * Load a texture as base64 - shouldn't be used directly\r\n * @see loadTextureAsBase64\r\n * @ignore\r\n */\r\nfunction loadTexture(root, namespace, dir, name, resolve, reject, forceLoad) {\r\n let path = \"/assets/\" + namespace + \"/textures\" + dir + name + \".png\";\r\n\r\n if (textureCache.hasOwnProperty(path)) {\r\n if (textureCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(textureCache[path]);\r\n return;\r\n }\r\n\r\n if (!textureCallbacks.hasOwnProperty(path) || textureCallbacks[path].length === 0 || forceLoad) {\r\n // https://gist.github.com/oliyh/db3d1a582aefe6d8fee9 / https://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', root + path, true);\r\n xhr.responseType = 'arraybuffer';\r\n xhr.onloadend = function () {\r\n if (xhr.status === 200) {\r\n let arr = new Uint8Array(xhr.response || xhr.responseText);\r\n let raw = String.fromCharCode.apply(null, arr);\r\n let b64 = btoa(raw);\r\n let dataURL = \"data:image/png;base64,\" + b64;\r\n\r\n textureCache[path] = dataURL;\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[0](dataURL);\r\n }\r\n }\r\n } else {\r\n if (DEFAULT_ROOT === root) {\r\n textureCache[path] = \"__invalid\";\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n loadTexture(DEFAULT_ROOT, namespace, dir, name, resolve, reject, true)\r\n }\r\n }\r\n };\r\n xhr.send();\r\n\r\n // init array\r\n if (!textureCallbacks.hasOwnProperty(path))\r\n textureCallbacks[path] = [];\r\n }\r\n\r\n // add the promise callback\r\n textureCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n\r\n/**\r\n * Loads a blockstate file and returns the contained JSON\r\n * @param {string} state Name of the blockstate\r\n * @param {string} assetRoot Asset root, see {@link DEFAULT_ROOT}\r\n * @returns {Promise}\r\n */\r\nfunction loadBlockState(state, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/blockstates/\" + state + \".json\")\r\n};\r\n\r\nfunction loadTextureMeta(texture, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/textures/block/\" + texture + \".png.mcmeta\")\r\n}\r\n\r\n/**\r\n * Loads a model file and returns the contained JSON\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} path Path to the model file\r\n * @returns {Promise}\r\n */\r\nfunction loadJsonFromPath(root, path) {\r\n return new Promise((resolve, reject) => {\r\n loadJsonFromPath_(root, path, resolve, reject);\r\n })\r\n}\r\n\r\n/**\r\n * Load a model - shouldn't used directly\r\n * @see loadJsonFromPath\r\n * @ignore\r\n */\r\nfunction loadJsonFromPath_(root, path, resolve, reject, forceLoad) {\r\n if (modelCache.hasOwnProperty(path)) {\r\n if (modelCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(Object.assign({}, modelCache[path]));\r\n return;\r\n }\r\n\r\n if (!modelCallbacks.hasOwnProperty(path) || modelCallbacks[path].length === 0 || forceLoad) {\r\n console.log(root + path)\r\n fetch(root + path, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n console.log(\"json data:\", data);\r\n modelCache[path] = data;\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let dataCopy = Object.assign({}, data);\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[0](dataCopy);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n console.warn(err);\r\n if (DEFAULT_ROOT === root) {\r\n modelCache[path] = \"__invalid\";\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n // Try again with default root\r\n loadJsonFromPath_(DEFAULT_ROOT, path, resolve, reject, true);\r\n }\r\n });\r\n\r\n if (!modelCallbacks.hasOwnProperty(path))\r\n modelCallbacks[path] = [];\r\n }\r\n\r\n modelCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n/**\r\n * Scales UV values\r\n * @param {number} uv UV value\r\n * @param {number} size\r\n * @param {number} [scale=16]\r\n * @returns {number}\r\n */\r\nfunction scaleUv(uv, size, scale) {\r\n if (uv === 0) return 0;\r\n return size / (scale || 16) * uv;\r\n}\r\n\r\n\r\n// https://gist.github.com/remy/784508\r\nfunction trimCanvas(c) {\r\n let ctx = c.getContext('2d'),\r\n copy = document.createElement('canvas').getContext('2d'),\r\n pixels = ctx.getImageData(0, 0, c.width, c.height),\r\n l = pixels.data.length,\r\n i,\r\n bound = {\r\n top: null,\r\n left: null,\r\n right: null,\r\n bottom: null\r\n },\r\n x, y;\r\n\r\n for (i = 0; i < l; i += 4) {\r\n if (pixels.data[i + 3] !== 0) {\r\n x = (i / 4) % c.width;\r\n y = ~~((i / 4) / c.width);\r\n\r\n if (bound.top === null) {\r\n bound.top = y;\r\n }\r\n\r\n if (bound.left === null) {\r\n bound.left = x;\r\n } else if (x < bound.left) {\r\n bound.left = x;\r\n }\r\n\r\n if (bound.right === null) {\r\n bound.right = x;\r\n } else if (bound.right < x) {\r\n bound.right = x;\r\n }\r\n\r\n if (bound.bottom === null) {\r\n bound.bottom = y;\r\n } else if (bound.bottom < y) {\r\n bound.bottom = y;\r\n }\r\n }\r\n }\r\n\r\n let trimHeight = bound.bottom - bound.top,\r\n trimWidth = bound.right - bound.left,\r\n trimmed = ctx.getImageData(bound.left, bound.top, trimWidth, trimHeight);\r\n\r\n copy.canvas.width = trimWidth;\r\n copy.canvas.height = trimHeight;\r\n copy.putImageData(trimmed, 0, 0);\r\n\r\n // open new window with trimmed image:\r\n return copy.canvas;\r\n}\n\n//# sourceURL=webpack:///./src/functions.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_ROOT\", function() { return DEFAULT_ROOT; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureAsBase64\", function() { return loadTextureAsBase64; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadBlockState\", function() { return loadBlockState; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadTextureMeta\", function() { return loadTextureMeta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath\", function() { return loadJsonFromPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadJsonFromPath_\", function() { return loadJsonFromPath_; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleUv\", function() { return scaleUv; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"trimCanvas\", function() { return trimCanvas; });\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! debug */ \"./node_modules/debug/src/browser.js\");\n/* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(debug__WEBPACK_IMPORTED_MODULE_0__);\n\r\nconst debug = debug__WEBPACK_IMPORTED_MODULE_0__(\"minerender\");\r\n\r\n/**\r\n * Default asset root\r\n * @type {string}\r\n */\r\nconst DEFAULT_ROOT = \"https://assets.mcasset.cloud/1.13\";\r\n/**\r\n * Texture cache\r\n * @type {Object.}\r\n */\r\nconst textureCache = {};\r\n/**\r\n * Texture callbacks\r\n * @type {Object.}\r\n */\r\nconst textureCallbacks = {};\r\n\r\n/**\r\n * Model cache\r\n * @type {Object.}\r\n */\r\nconst modelCache = {};\r\n/**\r\n * Model callbacks\r\n * @type {Object.}\r\n */\r\nconst modelCallbacks = {};\r\n\r\n\r\n/**\r\n * Loads a Mincraft texture an returns it as Base64\r\n *\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} namespace Namespace, usually 'minecraft'\r\n * @param {string} dir Directory of the texture\r\n * @param {string} name Name of the texture\r\n * @returns {Promise}\r\n */\r\nfunction loadTextureAsBase64(root, namespace, dir, name) {\r\n return new Promise((resolve, reject) => {\r\n loadTexture(root, namespace, dir, name, resolve, reject);\r\n })\r\n};\r\n\r\n/**\r\n * Load a texture as base64 - shouldn't be used directly\r\n * @see loadTextureAsBase64\r\n * @ignore\r\n */\r\nfunction loadTexture(root, namespace, dir, name, resolve, reject, forceLoad) {\r\n let path = \"/assets/\" + namespace + \"/textures\" + dir + name + \".png\";\r\n\r\n if (textureCache.hasOwnProperty(path)) {\r\n if (textureCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(textureCache[path]);\r\n return;\r\n }\r\n\r\n if (!textureCallbacks.hasOwnProperty(path) || textureCallbacks[path].length === 0 || forceLoad) {\r\n // https://gist.github.com/oliyh/db3d1a582aefe6d8fee9 / https://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', root + path, true);\r\n xhr.responseType = 'arraybuffer';\r\n xhr.onloadend = function () {\r\n if (xhr.status === 200) {\r\n let arr = new Uint8Array(xhr.response || xhr.responseText);\r\n let raw = String.fromCharCode.apply(null, arr);\r\n let b64 = btoa(raw);\r\n let dataURL = \"data:image/png;base64,\" + b64;\r\n\r\n textureCache[path] = dataURL;\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[0](dataURL);\r\n }\r\n }\r\n } else {\r\n if (DEFAULT_ROOT === root) {\r\n textureCache[path] = \"__invalid\";\r\n\r\n if (textureCallbacks.hasOwnProperty(path)) {\r\n while (textureCallbacks[path].length > 0) {\r\n let cb = textureCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n loadTexture(DEFAULT_ROOT, namespace, dir, name, resolve, reject, true)\r\n }\r\n }\r\n };\r\n xhr.send();\r\n\r\n // init array\r\n if (!textureCallbacks.hasOwnProperty(path))\r\n textureCallbacks[path] = [];\r\n }\r\n\r\n // add the promise callback\r\n textureCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n\r\n/**\r\n * Loads a blockstate file and returns the contained JSON\r\n * @param {string} state Name of the blockstate\r\n * @param {string} assetRoot Asset root, see {@link DEFAULT_ROOT}\r\n * @returns {Promise}\r\n */\r\nfunction loadBlockState(state, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/blockstates/\" + state + \".json\")\r\n};\r\n\r\nfunction loadTextureMeta(texture, assetRoot) {\r\n return loadJsonFromPath(assetRoot, \"/assets/minecraft/textures/block/\" + texture + \".png.mcmeta\")\r\n}\r\n\r\n/**\r\n * Loads a model file and returns the contained JSON\r\n * @param {string} root Asset root, see {@link DEFAULT_ROOT}\r\n * @param {string} path Path to the model file\r\n * @returns {Promise}\r\n */\r\nfunction loadJsonFromPath(root, path) {\r\n return new Promise((resolve, reject) => {\r\n loadJsonFromPath_(root, path, resolve, reject);\r\n })\r\n}\r\n\r\n/**\r\n * Load a model - shouldn't used directly\r\n * @see loadJsonFromPath\r\n * @ignore\r\n */\r\nfunction loadJsonFromPath_(root, path, resolve, reject, forceLoad) {\r\n if (modelCache.hasOwnProperty(path)) {\r\n if (modelCache[path] === \"__invalid\") {\r\n reject();\r\n return;\r\n }\r\n resolve(Object.assign({}, modelCache[path]));\r\n return;\r\n }\r\n\r\n if (!modelCallbacks.hasOwnProperty(path) || modelCallbacks[path].length === 0 || forceLoad) {\r\n debug(root + path)\r\n fetch(root + path, {\r\n mode: \"cors\",\r\n redirect: \"follow\"\r\n })\r\n .then(response => response.json())\r\n .then(data => {\r\n debug(\"json data:\", data);\r\n modelCache[path] = data;\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let dataCopy = Object.assign({}, data);\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[0](dataCopy);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n console.warn(err);\r\n if (DEFAULT_ROOT === root) {\r\n modelCache[path] = \"__invalid\";\r\n\r\n if (modelCallbacks.hasOwnProperty(path)) {\r\n while (modelCallbacks[path].length > 0) {\r\n let cb = modelCallbacks[path].shift(0);\r\n cb[1]();\r\n }\r\n }\r\n } else {\r\n // Try again with default root\r\n loadJsonFromPath_(DEFAULT_ROOT, path, resolve, reject, true);\r\n }\r\n });\r\n\r\n if (!modelCallbacks.hasOwnProperty(path))\r\n modelCallbacks[path] = [];\r\n }\r\n\r\n modelCallbacks[path].push([resolve, reject]);\r\n}\r\n\r\n/**\r\n * Scales UV values\r\n * @param {number} uv UV value\r\n * @param {number} size\r\n * @param {number} [scale=16]\r\n * @returns {number}\r\n */\r\nfunction scaleUv(uv, size, scale) {\r\n if (uv === 0) return 0;\r\n return size / (scale || 16) * uv;\r\n}\r\n\r\n\r\n// https://gist.github.com/remy/784508\r\nfunction trimCanvas(c) {\r\n let ctx = c.getContext('2d'),\r\n copy = document.createElement('canvas').getContext('2d'),\r\n pixels = ctx.getImageData(0, 0, c.width, c.height),\r\n l = pixels.data.length,\r\n i,\r\n bound = {\r\n top: null,\r\n left: null,\r\n right: null,\r\n bottom: null\r\n },\r\n x, y;\r\n\r\n for (i = 0; i < l; i += 4) {\r\n if (pixels.data[i + 3] !== 0) {\r\n x = (i / 4) % c.width;\r\n y = ~~((i / 4) / c.width);\r\n\r\n if (bound.top === null) {\r\n bound.top = y;\r\n }\r\n\r\n if (bound.left === null) {\r\n bound.left = x;\r\n } else if (x < bound.left) {\r\n bound.left = x;\r\n }\r\n\r\n if (bound.right === null) {\r\n bound.right = x;\r\n } else if (bound.right < x) {\r\n bound.right = x;\r\n }\r\n\r\n if (bound.bottom === null) {\r\n bound.bottom = y;\r\n } else if (bound.bottom < y) {\r\n bound.bottom = y;\r\n }\r\n }\r\n }\r\n\r\n let trimHeight = bound.bottom - bound.top,\r\n trimWidth = bound.right - bound.left,\r\n trimmed = ctx.getImageData(bound.left, bound.top, trimWidth, trimHeight);\r\n\r\n copy.canvas.width = trimWidth;\r\n copy.canvas.height = trimHeight;\r\n copy.putImageData(trimmed, 0, 0);\r\n\r\n // open new window with trimmed image:\r\n return copy.canvas;\r\n}\r\n\n\n//# sourceURL=webpack:///./src/functions.js?"); /***/ }), @@ -289,7 +333,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultOptions\", function() { return defaultOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepDisposeMesh\", function() { return deepDisposeMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeMeshes__\", function() { return mergeMeshes__; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeCubeMeshes\", function() { return mergeCubeMeshes; });\n/* harmony import */ var _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/OrbitControls */ \"./src/lib/OrbitControls.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! threejs-ext */ \"./node_modules/threejs-ext/dist/index.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(threejs_ext__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @johh/three-effectcomposer */ \"./node_modules/@johh/three-effectcomposer/dist/index.js\");\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! onscreen */ \"./node_modules/onscreen/dist/on-screen.umd.js\");\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(onscreen__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions */ \"./src/functions.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @property {boolean} showAxes Debugging - Show the scene's axes\r\n * @property {boolean} showOutlines Debugging - Show bounding boxes\r\n * @property {boolean} showGrid Debugging - Show coordinate grid\r\n *\r\n * @property {object} controls Controls settings\r\n * @property {boolean} [controls.enabled=true] Toggle controls\r\n * @property {boolean} [controls.zoom=true] Toggle zoom\r\n * @property {boolean} [controls.rotate=true] Toggle rotation\r\n * @property {boolean} [controls.pan=true] Toggle panning\r\n *\r\n * @property {object} camera Camera settings\r\n * @property {string} [camera.type=perspective] Camera type\r\n * @property {number} camera.x Camera X-position\r\n * @property {number} camera.y Camera Y-Position\r\n * @property {number} camera.z Camera Z-Position\r\n * @property {number[]} camera.target [x,y,z] array where the camera should look\r\n */\r\nconst defaultOptions = {\r\n showAxes: false,\r\n showGrid: false,\r\n autoResize: false,\r\n controls: {\r\n enabled: true,\r\n zoom: true,\r\n rotate: true,\r\n pan: true,\r\n keys: true\r\n },\r\n camera: {\r\n type: \"perspective\",\r\n x: 20,\r\n y: 35,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n canvas: {\r\n width: undefined,\r\n height: undefined\r\n },\r\n pauseHidden: true,\r\n forceContext: false,\r\n sendStats: true\r\n};\r\n\r\n/**\r\n * Base class for all Renders\r\n */\r\nclass Render {\r\n\r\n /**\r\n * @param {object} options The options for this renderer, see {@link defaultOptions}\r\n * @param {object} defOptions Additional default options, provided by the individual renders\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, defOptions, element) {\r\n /**\r\n * DOM Element to attach the renderer to\r\n * @type {HTMLElement}\r\n */\r\n this.element = element || document.body;\r\n /**\r\n * Combined options\r\n * @type {{} & defaultOptions & defOptions & options}\r\n */\r\n this.options = Object.assign({}, defaultOptions, defOptions, options);\r\n\r\n this.renderType = \"_Base_\";\r\n }\r\n\r\n /**\r\n * @param {boolean} [trim=false] whether to trim transparent pixels\r\n * @param {string} [mime=image/png] mime type of the image\r\n * @returns {string} The content of the renderer's canvas as a Base64 encoded image\r\n */\r\n toImage(trim, mime) {\r\n if (!mime) mime = \"image/png\";\r\n if (this._renderer) {\r\n if (!trim) {\r\n return this._renderer.domElement.toDataURL(mime);\r\n } else {\r\n // Clone the canvas onto a 2d context, so we can trim it properly\r\n let newCanvas = document.createElement('canvas');\r\n let context = newCanvas.getContext('2d');\r\n\r\n newCanvas.width = this._renderer.domElement.width;\r\n newCanvas.height = this._renderer.domElement.height;\r\n\r\n context.drawImage(this._renderer.domElement, 0, 0);\r\n\r\n let trimmed = Object(_functions__WEBPACK_IMPORTED_MODULE_6__[\"trimCanvas\"])(newCanvas);\r\n return trimmed.toDataURL(mime);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Export the current scene content in the .obj format (only geometries, no textures)\r\n * @returns {string} the .obj file content\r\n */\r\n toObj() {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"OBJExporter\"]();\r\n return exporter.parse(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Export the current scene content in the .gltf format (geometries + textures)\r\n * @returns {Promise} a promise which resolves with the .gltf file content\r\n */\r\n toGLTF(exportOptions) {\r\n return new Promise((resolve, reject) => {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"GLTFExporter\"]();\r\n exporter.parse(this._scene, (gltf) => {\r\n resolve(gltf);\r\n }, exportOptions)\r\n } else {\r\n reject();\r\n }\r\n })\r\n }\r\n\r\n toPLY(exportOptions) {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"PLYExporter\"]();\r\n return exporter.parse(this._scene, exportOptions);\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the scene\r\n * @param renderCb\r\n * @param doNotAnimate\r\n * @protected\r\n */\r\n initScene(renderCb, doNotAnimate) {\r\n let renderObj = this;\r\n\r\n console.log(\" \");\r\n console.log('%c ', 'font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;');\r\n console.log(\"MineRender/\" + (renderObj.renderType || renderObj.constructor.name) + \"/\" + \"1.4.6\");\r\n console.log(( false ? undefined : \"DEVELOPMENT\") + \" build\");\r\n console.log(\"Built @ \" + \"2021-02-01T16:10:49.094Z\");\r\n console.log(\" \");\r\n\r\n if (renderObj.options.sendStats) {\r\n // Send stats\r\n\r\n let iframe = false;\r\n try {\r\n iframe = window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n let hostname;\r\n try{\r\n hostname = new URL(iframe ? document.referrer : window.location).hostname;\r\n }catch (e) {\r\n console.warn(\"Failed to get hostname\");\r\n }\r\n\r\n jquery__WEBPACK_IMPORTED_MODULE_5__[\"post\"]({\r\n url: \"https://minerender.org/stats.php\",\r\n data: {\r\n action: \"init\",\r\n type: renderObj.renderType,\r\n host: hostname,\r\n source: (iframe ? \"iframe\" : \"javascript\")\r\n }\r\n });\r\n }\r\n\r\n // Scene INIT\r\n let scene = new three__WEBPACK_IMPORTED_MODULE_3__[\"Scene\"]();\r\n renderObj._scene = scene;\r\n let camera;\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"OrthographicCamera\"]((renderObj.options.canvas.width || window.innerWidth) / -2, (renderObj.options.canvas.width || window.innerWidth) / 2, (renderObj.options.canvas.height || window.innerHeight) / 2, (renderObj.options.canvas.height || window.innerHeight) / -2, 1, 1000);\r\n } else {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"PerspectiveCamera\"](75, (renderObj.options.canvas.width || window.innerWidth) / (renderObj.options.canvas.height || window.innerHeight), 5, 1000);\r\n }\r\n renderObj._camera = camera;\r\n\r\n if (renderObj.options.camera.zoom) {\r\n camera.zoom = renderObj.options.camera.zoom;\r\n }\r\n\r\n let renderer = new three__WEBPACK_IMPORTED_MODULE_3__[\"WebGLRenderer\"]({alpha: true, antialias: true, preserveDrawingBuffer: true});\r\n renderObj._renderer = renderer;\r\n renderer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderer.setClearColor(0x000000, 0);\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.shadowMap.enabled = true;\r\n renderer.shadowMap.type = three__WEBPACK_IMPORTED_MODULE_3__[\"PCFSoftShadowMap\"];\r\n renderObj.element.appendChild(renderObj._canvas = renderer.domElement);\r\n\r\n let composer = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default.a(renderer);\r\n composer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderObj._composer = composer;\r\n let ssaaRenderPass = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"SSAARenderPass\"](scene, camera);\r\n ssaaRenderPass.unbiased = true;\r\n composer.addPass(ssaaRenderPass);\r\n // let renderPass = new RenderPass(scene, camera);\r\n // renderPass.enabled = false;\r\n // composer.addPass(renderPass);\r\n let copyPass = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"ShaderPass\"](_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"CopyShader\"]);\r\n copyPass.renderToScreen = true;\r\n composer.addPass(copyPass);\r\n\r\n if (renderObj.options.autoResize) {\r\n renderObj._resizeListener = function () {\r\n let width = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetWidth : window.innerWidth;\r\n let height = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetHeight : window.innerHeight;\r\n\r\n renderObj._resize(width, height);\r\n };\r\n window.addEventListener(\"resize\", renderObj._resizeListener);\r\n }\r\n renderObj._resize = function (width, height) {\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera.left = width / -2;\r\n camera.right = width / 2;\r\n camera.top = height / 2;\r\n camera.bottom = height / -2;\r\n } else {\r\n camera.aspect = width / height;\r\n }\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(width, height);\r\n composer.setSize(width, height);\r\n };\r\n\r\n // Helpers\r\n if (renderObj.options.showAxes) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"AxesHelper\"](50));\r\n }\r\n if (renderObj.options.showGrid) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"GridHelper\"](100, 100));\r\n }\r\n\r\n let light = new three__WEBPACK_IMPORTED_MODULE_3__[\"AmbientLight\"](0xFFFFFF); // soft white light\r\n scene.add(light);\r\n\r\n // Init controls\r\n let controls = new _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__[\"default\"](camera, renderer.domElement);\r\n renderObj._controls = controls;\r\n controls.enableZoom = renderObj.options.controls.zoom;\r\n controls.enableRotate = renderObj.options.controls.rotate;\r\n controls.enablePan = renderObj.options.controls.pan;\r\n controls.enableKeys = renderObj.options.controls.keys;\r\n controls.target.set(renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]);\r\n\r\n // Set camera location & target\r\n camera.position.x = renderObj.options.camera.x;\r\n camera.position.y = renderObj.options.camera.y;\r\n camera.position.z = renderObj.options.camera.z;\r\n camera.lookAt(new three__WEBPACK_IMPORTED_MODULE_3__[\"Vector3\"](renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]));\r\n\r\n // Do the render!\r\n let animate = function () {\r\n renderObj._animId = requestAnimationFrame(animate);\r\n\r\n if (renderObj.onScreen) {\r\n if (typeof renderCb === \"function\") renderCb();\r\n\r\n composer.render();\r\n }\r\n };\r\n renderObj._animate = animate;\r\n\r\n if (!doNotAnimate) {\r\n animate();\r\n }\r\n\r\n renderObj.onScreen = true;// default to true, in case the checking is disabled\r\n let id = \"minerender-canvas-\" + renderObj._scene.uuid + \"-\" + Date.now();\r\n renderObj._canvas.id = id;\r\n if (renderObj.options.pauseHidden) {\r\n renderObj.onScreen = false;// set to false if the check is enabled\r\n let os = new onscreen__WEBPACK_IMPORTED_MODULE_4___default.a();\r\n renderObj._onScreenObserver = os;\r\n\r\n os.on(\"enter\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = true;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextRestore();\r\n }\r\n })\r\n os.on(\"leave\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = false;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextLoss();\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Adds an object to the scene & sets userData.renderType to this renderer's type\r\n * @param toAdd object to add\r\n */\r\n addToScene(toAdd) {\r\n let renderObj = this;\r\n if (renderObj._scene && toAdd) {\r\n toAdd.userData.renderType = renderObj.renderType;\r\n renderObj._scene.add(toAdd);\r\n }\r\n }\r\n\r\n /**\r\n * Clears the scene\r\n * @param onlySelfType whether to remove only objects whose type is equal to this renderer's type (useful for combined render)\r\n * @param filterFn Filter function to check which children of the scene to remove\r\n */\r\n clearScene(onlySelfType, filterFn) {\r\n if (onlySelfType || filterFn) {\r\n for (let i = this._scene.children.length - 1; i >= 0; i--) {\r\n let child = this._scene.children[i];\r\n if (filterFn) {\r\n let shouldKeep = filterFn(child);\r\n if (shouldKeep) {\r\n continue;\r\n }\r\n }\r\n if (onlySelfType) {\r\n if (child.userData.renderType !== this.renderType) {\r\n continue;\r\n }\r\n }\r\n deepDisposeMesh(child, true);\r\n this._scene.remove(child);\r\n }\r\n } else {\r\n while (this._scene.children.length > 0) {\r\n this._scene.remove(this._scene.children[0]);\r\n }\r\n }\r\n };\r\n\r\n dispose() {\r\n cancelAnimationFrame(this._animId);\r\n if (this._onScreenObserver) {\r\n this._onScreenObserver.destroy();\r\n }\r\n\r\n this.clearScene();\r\n\r\n this._canvas.remove();\r\n let el = this.element;\r\n while (el.firstChild) {\r\n el.removeChild(el.firstChild);\r\n }\r\n\r\n if (this.options.autoResize) {\r\n window.removeEventListener(\"resize\", this._resizeListener);\r\n }\r\n };\r\n\r\n}\r\n\r\n// https://stackoverflow.com/questions/27217388/use-multiple-materials-for-merged-geometries-in-three-js/44485364#44485364\r\nfunction deepDisposeMesh(obj, removeChildren) {\r\n if (!obj) return;\r\n if (obj.geometry && obj.geometry.dispose) obj.geometry.dispose();\r\n if (obj.material && obj.material.dispose) obj.material.dispose();\r\n if (obj.texture && obj.texture.dispose) obj.texture.dispose();\r\n if (obj.children) {\r\n let children = obj.children;\r\n for (let i = 0; i < children.length; i++) {\r\n deepDisposeMesh(children[i], removeChildren);\r\n }\r\n\r\n if (removeChildren) {\r\n for (let i = obj.children.length - 1; i >= 0; i--) {\r\n obj.remove(children[i]);\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction mergeMeshes__(meshes, toBufferGeometry) {\r\n let finalGeometry,\r\n materials = [],\r\n mergedGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"](),\r\n mergedMesh;\r\n\r\n meshes.forEach(function (mesh, index) {\r\n mesh.updateMatrix();\r\n mesh.geometry.faces.forEach(function (face) {\r\n face.materialIndex = 0;\r\n });\r\n mergedGeometry.merge(mesh.geometry, mesh.matrix, index);\r\n materials.push(mesh.material);\r\n });\r\n\r\n mergedGeometry.groupsNeedUpdate = true;\r\n\r\n if (toBufferGeometry) {\r\n finalGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedGeometry);\r\n } else {\r\n finalGeometry = mergedGeometry;\r\n }\r\n\r\n mergedMesh = new three__WEBPACK_IMPORTED_MODULE_3__[\"Mesh\"](finalGeometry, materials);\r\n mergedMesh.geometry.computeFaceNormals();\r\n mergedMesh.geometry.computeVertexNormals();\r\n\r\n return mergedMesh;\r\n\r\n}\r\n\r\nfunction mergeCubeMeshes(cubes, toBuffer) {\r\n cubes = cubes.filter(c => !!c);\r\n\r\n let mergedCubes = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"]();\r\n let mergedMaterials = [];\r\n for (let i = 0; i < cubes.length; i++) {\r\n let offset = i * Math.max(cubes[i].material.length, 1);\r\n mergedCubes.merge(cubes[i].geometry, cubes[i].matrix, offset);\r\n for (let j = 0; j < cubes[i].material.length; j++) {\r\n mergedMaterials.push(cubes[i].material[j]);\r\n }\r\n // for (let j = 0; j < cubes[i].geometry.faces.length; j++) {\r\n // cubes[i].geometry.faces[j].materialIndex=offset-1+j;\r\n // }\r\n\r\n deepDisposeMesh(cubes[i], true);\r\n }\r\n mergedCubes.mergeVertices();\r\n return {\r\n geometry: toBuffer ? new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedCubes) : mergedCubes,\r\n materials: mergedMaterials\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./src/renderBase.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultOptions\", function() { return defaultOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepDisposeMesh\", function() { return deepDisposeMesh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeMeshes__\", function() { return mergeMeshes__; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeCubeMeshes\", function() { return mergeCubeMeshes; });\n/* harmony import */ var _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/OrbitControls */ \"./src/lib/OrbitControls.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! threejs-ext */ \"./node_modules/threejs-ext/dist/index.js\");\n/* harmony import */ var threejs_ext__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(threejs_ext__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @johh/three-effectcomposer */ \"./node_modules/@johh/three-effectcomposer/dist/index.js\");\n/* harmony import */ var _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"three\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(three__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! onscreen */ \"./node_modules/onscreen/dist/on-screen.umd.js\");\n/* harmony import */ var onscreen__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(onscreen__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./functions */ \"./src/functions.js\");\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * @property {boolean} showAxes Debugging - Show the scene's axes\r\n * @property {boolean} showOutlines Debugging - Show bounding boxes\r\n * @property {boolean} showGrid Debugging - Show coordinate grid\r\n *\r\n * @property {object} controls Controls settings\r\n * @property {boolean} [controls.enabled=true] Toggle controls\r\n * @property {boolean} [controls.zoom=true] Toggle zoom\r\n * @property {boolean} [controls.rotate=true] Toggle rotation\r\n * @property {boolean} [controls.pan=true] Toggle panning\r\n *\r\n * @property {object} camera Camera settings\r\n * @property {string} [camera.type=perspective] Camera type\r\n * @property {number} camera.x Camera X-position\r\n * @property {number} camera.y Camera Y-Position\r\n * @property {number} camera.z Camera Z-Position\r\n * @property {number[]} camera.target [x,y,z] array where the camera should look\r\n */\r\nconst defaultOptions = {\r\n showAxes: false,\r\n showGrid: false,\r\n autoResize: false,\r\n controls: {\r\n enabled: true,\r\n zoom: true,\r\n rotate: true,\r\n pan: true,\r\n keys: true\r\n },\r\n camera: {\r\n type: \"perspective\",\r\n x: 20,\r\n y: 35,\r\n z: 20,\r\n target: [0, 0, 0]\r\n },\r\n canvas: {\r\n width: undefined,\r\n height: undefined\r\n },\r\n pauseHidden: true,\r\n forceContext: false,\r\n sendStats: true\r\n};\r\n\r\n/**\r\n * Base class for all Renders\r\n */\r\nclass Render {\r\n\r\n /**\r\n * @param {object} options The options for this renderer, see {@link defaultOptions}\r\n * @param {object} defOptions Additional default options, provided by the individual renders\r\n * @param {HTMLElement} [element=document.body] DOM Element to attach the renderer to - defaults to document.body\r\n * @constructor\r\n */\r\n constructor(options, defOptions, element) {\r\n /**\r\n * DOM Element to attach the renderer to\r\n * @type {HTMLElement}\r\n */\r\n this.element = element || document.body;\r\n /**\r\n * Combined options\r\n * @type {{} & defaultOptions & defOptions & options}\r\n */\r\n this.options = Object.assign({}, defaultOptions, defOptions, options);\r\n\r\n this.renderType = \"_Base_\";\r\n }\r\n\r\n /**\r\n * @param {boolean} [trim=false] whether to trim transparent pixels\r\n * @param {string} [mime=image/png] mime type of the image\r\n * @returns {string} The content of the renderer's canvas as a Base64 encoded image\r\n */\r\n toImage(trim, mime) {\r\n if (!mime) mime = \"image/png\";\r\n if (this._renderer) {\r\n if (!trim) {\r\n return this._renderer.domElement.toDataURL(mime);\r\n } else {\r\n // Clone the canvas onto a 2d context, so we can trim it properly\r\n let newCanvas = document.createElement('canvas');\r\n let context = newCanvas.getContext('2d');\r\n\r\n newCanvas.width = this._renderer.domElement.width;\r\n newCanvas.height = this._renderer.domElement.height;\r\n\r\n context.drawImage(this._renderer.domElement, 0, 0);\r\n\r\n let trimmed = Object(_functions__WEBPACK_IMPORTED_MODULE_6__[\"trimCanvas\"])(newCanvas);\r\n return trimmed.toDataURL(mime);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Export the current scene content in the .obj format (only geometries, no textures)\r\n * @returns {string} the .obj file content\r\n */\r\n toObj() {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"OBJExporter\"]();\r\n return exporter.parse(this._scene);\r\n }\r\n }\r\n\r\n /**\r\n * Export the current scene content in the .gltf format (geometries + textures)\r\n * @returns {Promise} a promise which resolves with the .gltf file content\r\n */\r\n toGLTF(exportOptions) {\r\n return new Promise((resolve, reject) => {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"GLTFExporter\"]();\r\n exporter.parse(this._scene, (gltf) => {\r\n resolve(gltf);\r\n }, exportOptions)\r\n } else {\r\n reject();\r\n }\r\n })\r\n }\r\n\r\n toPLY(exportOptions) {\r\n if (this._scene) {\r\n let exporter = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"PLYExporter\"]();\r\n return exporter.parse(this._scene, exportOptions);\r\n }\r\n }\r\n\r\n /**\r\n * Initializes the scene\r\n * @param renderCb\r\n * @param doNotAnimate\r\n * @protected\r\n */\r\n initScene(renderCb, doNotAnimate) {\r\n let renderObj = this;\r\n\r\n console.log(\" \");\r\n console.log('%c ', 'font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;');\r\n console.log(\"MineRender/\" + (renderObj.renderType || renderObj.constructor.name) + \"/\" + \"1.4.7\");\r\n console.log(( false ? undefined : \"DEVELOPMENT\") + \" build\");\r\n console.log(\"Built @ \" + \"2021-02-01T16:31:09.608Z\");\r\n console.log(\" \");\r\n\r\n if (renderObj.options.sendStats) {\r\n // Send stats\r\n\r\n let iframe = false;\r\n try {\r\n iframe = window.self !== window.top;\r\n } catch (e) {\r\n return true;\r\n }\r\n let hostname;\r\n try{\r\n hostname = new URL(iframe ? document.referrer : window.location).hostname;\r\n }catch (e) {\r\n console.warn(\"Failed to get hostname\");\r\n }\r\n\r\n jquery__WEBPACK_IMPORTED_MODULE_5__[\"post\"]({\r\n url: \"https://minerender.org/stats.php\",\r\n data: {\r\n action: \"init\",\r\n type: renderObj.renderType,\r\n host: hostname,\r\n source: (iframe ? \"iframe\" : \"javascript\")\r\n }\r\n });\r\n }\r\n\r\n // Scene INIT\r\n let scene = new three__WEBPACK_IMPORTED_MODULE_3__[\"Scene\"]();\r\n renderObj._scene = scene;\r\n let camera;\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"OrthographicCamera\"]((renderObj.options.canvas.width || window.innerWidth) / -2, (renderObj.options.canvas.width || window.innerWidth) / 2, (renderObj.options.canvas.height || window.innerHeight) / 2, (renderObj.options.canvas.height || window.innerHeight) / -2, 1, 1000);\r\n } else {\r\n camera = new three__WEBPACK_IMPORTED_MODULE_3__[\"PerspectiveCamera\"](75, (renderObj.options.canvas.width || window.innerWidth) / (renderObj.options.canvas.height || window.innerHeight), 5, 1000);\r\n }\r\n renderObj._camera = camera;\r\n\r\n if (renderObj.options.camera.zoom) {\r\n camera.zoom = renderObj.options.camera.zoom;\r\n }\r\n\r\n let renderer = new three__WEBPACK_IMPORTED_MODULE_3__[\"WebGLRenderer\"]({alpha: true, antialias: true, preserveDrawingBuffer: true});\r\n renderObj._renderer = renderer;\r\n renderer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderer.setClearColor(0x000000, 0);\r\n renderer.setPixelRatio(window.devicePixelRatio);\r\n renderer.shadowMap.enabled = true;\r\n renderer.shadowMap.type = three__WEBPACK_IMPORTED_MODULE_3__[\"PCFSoftShadowMap\"];\r\n renderObj.element.appendChild(renderObj._canvas = renderer.domElement);\r\n\r\n let composer = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2___default.a(renderer);\r\n composer.setSize((renderObj.options.canvas.width || window.innerWidth), (renderObj.options.canvas.height || window.innerHeight));\r\n renderObj._composer = composer;\r\n let ssaaRenderPass = new threejs_ext__WEBPACK_IMPORTED_MODULE_1__[\"SSAARenderPass\"](scene, camera);\r\n ssaaRenderPass.unbiased = true;\r\n composer.addPass(ssaaRenderPass);\r\n // let renderPass = new RenderPass(scene, camera);\r\n // renderPass.enabled = false;\r\n // composer.addPass(renderPass);\r\n let copyPass = new _johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"ShaderPass\"](_johh_three_effectcomposer__WEBPACK_IMPORTED_MODULE_2__[\"CopyShader\"]);\r\n copyPass.renderToScreen = true;\r\n composer.addPass(copyPass);\r\n\r\n if (renderObj.options.autoResize) {\r\n renderObj._resizeListener = function () {\r\n let width = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetWidth : window.innerWidth;\r\n let height = (renderObj.element && renderObj.element !== document.body) ? renderObj.element.offsetHeight : window.innerHeight;\r\n\r\n renderObj._resize(width, height);\r\n };\r\n window.addEventListener(\"resize\", renderObj._resizeListener);\r\n }\r\n renderObj._resize = function (width, height) {\r\n if (renderObj.options.camera.type === \"orthographic\") {\r\n camera.left = width / -2;\r\n camera.right = width / 2;\r\n camera.top = height / 2;\r\n camera.bottom = height / -2;\r\n } else {\r\n camera.aspect = width / height;\r\n }\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize(width, height);\r\n composer.setSize(width, height);\r\n };\r\n\r\n // Helpers\r\n if (renderObj.options.showAxes) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"AxesHelper\"](50));\r\n }\r\n if (renderObj.options.showGrid) {\r\n scene.add(new three__WEBPACK_IMPORTED_MODULE_3__[\"GridHelper\"](100, 100));\r\n }\r\n\r\n let light = new three__WEBPACK_IMPORTED_MODULE_3__[\"AmbientLight\"](0xFFFFFF); // soft white light\r\n scene.add(light);\r\n\r\n // Init controls\r\n let controls = new _lib_OrbitControls__WEBPACK_IMPORTED_MODULE_0__[\"default\"](camera, renderer.domElement);\r\n renderObj._controls = controls;\r\n controls.enableZoom = renderObj.options.controls.zoom;\r\n controls.enableRotate = renderObj.options.controls.rotate;\r\n controls.enablePan = renderObj.options.controls.pan;\r\n controls.enableKeys = renderObj.options.controls.keys;\r\n controls.target.set(renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]);\r\n\r\n // Set camera location & target\r\n camera.position.x = renderObj.options.camera.x;\r\n camera.position.y = renderObj.options.camera.y;\r\n camera.position.z = renderObj.options.camera.z;\r\n camera.lookAt(new three__WEBPACK_IMPORTED_MODULE_3__[\"Vector3\"](renderObj.options.camera.target[0], renderObj.options.camera.target[1], renderObj.options.camera.target[2]));\r\n\r\n // Do the render!\r\n let animate = function () {\r\n renderObj._animId = requestAnimationFrame(animate);\r\n\r\n if (renderObj.onScreen) {\r\n if (typeof renderCb === \"function\") renderCb();\r\n\r\n composer.render();\r\n }\r\n };\r\n renderObj._animate = animate;\r\n\r\n if (!doNotAnimate) {\r\n animate();\r\n }\r\n\r\n renderObj.onScreen = true;// default to true, in case the checking is disabled\r\n let id = \"minerender-canvas-\" + renderObj._scene.uuid + \"-\" + Date.now();\r\n renderObj._canvas.id = id;\r\n if (renderObj.options.pauseHidden) {\r\n renderObj.onScreen = false;// set to false if the check is enabled\r\n let os = new onscreen__WEBPACK_IMPORTED_MODULE_4___default.a();\r\n renderObj._onScreenObserver = os;\r\n\r\n os.on(\"enter\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = true;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextRestore();\r\n }\r\n })\r\n os.on(\"leave\", \"#\" + id, (element, event) => {\r\n renderObj.onScreen = false;\r\n if (renderObj.options.forceContext) {\r\n renderObj._renderer.forceContextLoss();\r\n }\r\n });\r\n }\r\n };\r\n\r\n /**\r\n * Adds an object to the scene & sets userData.renderType to this renderer's type\r\n * @param toAdd object to add\r\n */\r\n addToScene(toAdd) {\r\n let renderObj = this;\r\n if (renderObj._scene && toAdd) {\r\n toAdd.userData.renderType = renderObj.renderType;\r\n renderObj._scene.add(toAdd);\r\n }\r\n }\r\n\r\n /**\r\n * Clears the scene\r\n * @param onlySelfType whether to remove only objects whose type is equal to this renderer's type (useful for combined render)\r\n * @param filterFn Filter function to check which children of the scene to remove\r\n */\r\n clearScene(onlySelfType, filterFn) {\r\n if (onlySelfType || filterFn) {\r\n for (let i = this._scene.children.length - 1; i >= 0; i--) {\r\n let child = this._scene.children[i];\r\n if (filterFn) {\r\n let shouldKeep = filterFn(child);\r\n if (shouldKeep) {\r\n continue;\r\n }\r\n }\r\n if (onlySelfType) {\r\n if (child.userData.renderType !== this.renderType) {\r\n continue;\r\n }\r\n }\r\n deepDisposeMesh(child, true);\r\n this._scene.remove(child);\r\n }\r\n } else {\r\n while (this._scene.children.length > 0) {\r\n this._scene.remove(this._scene.children[0]);\r\n }\r\n }\r\n };\r\n\r\n dispose() {\r\n cancelAnimationFrame(this._animId);\r\n if (this._onScreenObserver) {\r\n this._onScreenObserver.destroy();\r\n }\r\n\r\n this.clearScene();\r\n\r\n this._canvas.remove();\r\n let el = this.element;\r\n while (el.firstChild) {\r\n el.removeChild(el.firstChild);\r\n }\r\n\r\n if (this.options.autoResize) {\r\n window.removeEventListener(\"resize\", this._resizeListener);\r\n }\r\n };\r\n\r\n}\r\n\r\n// https://stackoverflow.com/questions/27217388/use-multiple-materials-for-merged-geometries-in-three-js/44485364#44485364\r\nfunction deepDisposeMesh(obj, removeChildren) {\r\n if (!obj) return;\r\n if (obj.geometry && obj.geometry.dispose) obj.geometry.dispose();\r\n if (obj.material && obj.material.dispose) obj.material.dispose();\r\n if (obj.texture && obj.texture.dispose) obj.texture.dispose();\r\n if (obj.children) {\r\n let children = obj.children;\r\n for (let i = 0; i < children.length; i++) {\r\n deepDisposeMesh(children[i], removeChildren);\r\n }\r\n\r\n if (removeChildren) {\r\n for (let i = obj.children.length - 1; i >= 0; i--) {\r\n obj.remove(children[i]);\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction mergeMeshes__(meshes, toBufferGeometry) {\r\n let finalGeometry,\r\n materials = [],\r\n mergedGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"](),\r\n mergedMesh;\r\n\r\n meshes.forEach(function (mesh, index) {\r\n mesh.updateMatrix();\r\n mesh.geometry.faces.forEach(function (face) {\r\n face.materialIndex = 0;\r\n });\r\n mergedGeometry.merge(mesh.geometry, mesh.matrix, index);\r\n materials.push(mesh.material);\r\n });\r\n\r\n mergedGeometry.groupsNeedUpdate = true;\r\n\r\n if (toBufferGeometry) {\r\n finalGeometry = new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedGeometry);\r\n } else {\r\n finalGeometry = mergedGeometry;\r\n }\r\n\r\n mergedMesh = new three__WEBPACK_IMPORTED_MODULE_3__[\"Mesh\"](finalGeometry, materials);\r\n mergedMesh.geometry.computeFaceNormals();\r\n mergedMesh.geometry.computeVertexNormals();\r\n\r\n return mergedMesh;\r\n\r\n}\r\n\r\nfunction mergeCubeMeshes(cubes, toBuffer) {\r\n cubes = cubes.filter(c => !!c);\r\n\r\n let mergedCubes = new three__WEBPACK_IMPORTED_MODULE_3__[\"Geometry\"]();\r\n let mergedMaterials = [];\r\n for (let i = 0; i < cubes.length; i++) {\r\n let offset = i * Math.max(cubes[i].material.length, 1);\r\n mergedCubes.merge(cubes[i].geometry, cubes[i].matrix, offset);\r\n for (let j = 0; j < cubes[i].material.length; j++) {\r\n mergedMaterials.push(cubes[i].material[j]);\r\n }\r\n // for (let j = 0; j < cubes[i].geometry.faces.length; j++) {\r\n // cubes[i].geometry.faces[j].materialIndex=offset-1+j;\r\n // }\r\n\r\n deepDisposeMesh(cubes[i], true);\r\n }\r\n mergedCubes.mergeVertices();\r\n return {\r\n geometry: toBuffer ? new three__WEBPACK_IMPORTED_MODULE_3__[\"BufferGeometry\"]().fromGeometry(mergedCubes) : mergedCubes,\r\n materials: mergedMaterials\r\n };\r\n}\r\n\n\n//# sourceURL=webpack:///./src/renderBase.js?"); /***/ }), diff --git a/dist/skin.min.js b/dist/skin.min.js index 0373f2b4..ce1eeeb7 100644 --- a/dist/skin.min.js +++ b/dist/skin.min.js @@ -1,9 +1,9 @@ /*! - * MineRender 1.4.6 + * MineRender 1.4.7 * (c) 2018, Haylee Schäfer (inventivetalent) / MIT License * https://minerender.org - * Build #1612195849082 / Mon Feb 01 2021 17:10:49 GMT+0100 (GMT+01:00) - */!function(e){var t={};function r(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,a){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(a,n,function(t){return e[t]}.bind(null,n));return a},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=12)}([function(e,t){e.exports=THREE},function(e,t,r){"use strict";t.a={head:[{left:{x:0,y:16,w:8,h:8,flipX:!1},front:{x:8,y:16,w:8,h:8},right:{x:16,y:16,w:8,h:8,flipX:!1},back:{x:24,y:16,w:8,h:8},top:{x:8,y:24,w:8,h:8},bottom:{x:16,y:24,w:8,h:8,flipX:!0,flipY:!0}},{left:{x:0,y:48,w:8,h:8,flipX:!1},front:{x:8,y:48,w:8,h:8},right:{x:16,y:48,w:8,h:8,flipX:!1},back:{x:24,y:48,w:8,h:8},top:{x:8,y:56,w:8,h:8},bottom:{x:16,y:56,w:8,h:8,flipX:!0,flipY:!0}}],body:[{left:{x:16,y:0,w:4,h:12,flipX:!0},front:{x:20,y:0,w:8,h:12},right:{x:28,y:0,w:4,h:12,flipX:!0},back:{x:32,y:0,w:8,h:12},top:{x:20,y:12,w:8,h:4},bottom:{x:28,y:12,w:8,h:4,flipY:!0,flipX:!0}},{left:{x:16,y:32,w:4,h:12,flipX:!1},front:{x:20,y:32,w:8,h:12},right:{x:28,y:32,w:4,h:12,flipX:!1},back:{x:32,y:32,w:8,h:12},top:{x:20,y:44,w:8,h:4},bottom:{x:28,y:44,w:8,h:4,flipY:!0,flipX:!0}}],rightArm:[{left:{x:40,y:0,w:4,h:12,flipX:!1},front:{x:44,y:0,w:4,h:12,flipX:!1},right:{x:48,y:0,w:4,h:12,flipX:!1},back:{x:52,y:0,w:4,h:12,flipX:!1},top:{x:44,y:12,w:4,h:4,flipX:!1},bottom:{x:48,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:32,y:0,w:4,h:12,flipX:!1},front:{x:36,y:0,w:4,h:12,sw:3,flipX:!1},right:{x:40,y:0,w:4,h:12,sx:39,flipX:!1},back:{x:44,y:0,w:4,h:12,sx:43,sw:3,flipX:!1},top:{x:36,y:12,w:4,h:4,sw:3,flipX:!1},bottom:{x:40,y:12,w:4,h:4,sx:39,sw:3,flipY:!0,flipX:!0}}],leftArm:[{left:{x:40,y:0,w:4,h:12,flipX:!1},front:{x:44,y:0,w:4,h:12,flipX:!1},right:{x:48,y:0,w:4,h:12,flipX:!1},back:{x:52,y:0,w:4,h:12,flipX:!1},top:{x:44,y:12,w:4,h:4,flipX:!1},bottom:{x:48,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:40,y:32,w:4,h:12,flipX:!1},front:{x:44,y:32,w:4,h:12,sw:3,flipX:!1},right:{x:48,y:32,w:4,h:12,sx:47,flipX:!1},back:{x:52,y:32,w:4,h:12,sx:51,sw:3,flipX:!1},top:{x:44,y:44,w:4,h:4,sw:3,flipX:!1},bottom:{x:48,y:44,w:4,h:4,sx:47,sw:3,flipY:!0,flipX:!0}}],rightLeg:[{left:{x:0,y:0,w:4,h:12,flipX:!1},front:{x:4,y:0,w:4,h:12,flipX:!1},right:{x:8,y:0,w:4,h:12,flipX:!1},back:{x:12,y:0,w:4,h:12},top:{x:4,y:12,w:4,h:4,flipX:!1},bottom:{x:8,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:16,y:0,w:4,h:12,flipX:!1},front:{x:20,y:0,w:4,h:12,flipX:!1},right:{x:24,y:0,w:4,h:12,flipX:!1},back:{x:28,y:0,w:4,h:12,flipX:!1},top:{x:20,y:12,w:4,h:4,flipX:!1},bottom:{x:24,y:12,w:4,h:4,flipY:!0,flipX:!0}}],leftLeg:[{left:{x:0,y:0,w:4,h:12,flipX:!1},front:{x:4,y:0,w:4,h:12,flipX:!1},right:{x:8,y:0,w:4,h:12,flipX:!1},back:{x:12,y:0,w:4,h:12,flipX:!0},top:{x:4,y:12,w:4,h:4,flipX:!1},bottom:{x:8,y:12,w:4,h:4,flipX:!0,flipY:!0}},{left:{x:0,y:32,w:4,h:12,flipX:!1},front:{x:4,y:32,w:4,h:12,flipX:!1},right:{x:8,y:32,w:4,h:12,flipX:!1},back:{x:12,y:32,w:4,h:12,flipX:!1},top:{x:4,y:44,w:4,h:4,flipX:!1},bottom:{x:8,y:44,w:4,h:4,flipY:!0,flipX:!0}}],hat:{left:{x:32,y:48,w:8,h:8},front:{x:40,y:48,w:8,h:8},right:{x:48,y:48,w:8,h:8},back:{x:56,y:48,w:8,h:8},top:{x:40,y:56,w:8,h:8,flipX:!1},bottom:{x:48,y:56,w:8,h:8,flipY:!0,flipX:!0}},jacket:{left:{x:16,y:16,w:4,h:12},front:{x:20,y:16,w:8,h:12},right:{x:28,y:16,w:4,h:12},back:{x:32,y:16,w:8,h:12},top:{x:20,y:28,w:8,h:4},bottom:{x:28,y:28,w:8,h:4,flipY:!0,flipX:!0}},rightSleeve:{left:{x:48,y:0,w:4,h:12},front:{x:52,y:0,w:4,h:12,sw:3},right:{x:56,y:0,w:4,h:12,sx:55},back:{x:60,y:0,w:4,h:12,sx:59,sw:3},top:{x:52,y:12,w:4,h:4,sw:3},bottom:{x:56,y:12,w:4,h:4,sx:55,sw:3,flipY:!0,flipX:!0}},leftSleeve:{left:{x:40,y:16,w:4,h:12},front:{x:44,y:16,w:4,h:12,sw:3},right:{x:48,y:16,w:4,h:12,sx:47},back:{x:52,y:16,w:4,h:12,sx:51,sw:3},top:{x:44,y:28,w:4,h:4,sw:3},bottom:{x:48,y:28,w:4,h:4,sx:47,sw:3,flipY:!0,flipX:!0}},rightTrousers:{left:{x:0,y:0,w:4,h:12},front:{x:4,y:0,w:4,h:12},right:{x:8,y:0,w:4,h:12},back:{x:12,y:0,w:4,h:12},top:{x:4,y:12,w:4,h:4},bottom:{x:8,y:12,w:4,h:4,flipY:!0,flipX:!0}},leftTrousers:{left:{x:0,y:16,w:4,h:12},front:{x:4,y:16,w:4,h:12},right:{x:8,y:16,w:4,h:12},back:{x:12,y:16,w:4,h:12},top:{x:4,y:28,w:4,h:4},bottom:{x:8,y:28,w:4,h:4,flipY:!0,flipX:!0}},cape:{right:{x:0,y:5,w:1,h:16},front:{x:1,y:5,w:10,h:16},left:{x:11,y:5,w:1,h:16},back:{x:12,y:5,w:10,h:16},top:{x:1,y:21,w:10,h:1},bottom:{x:11,y:21,w:10,h:1}},capeRelative:{right:{x:0,y:15/32,w:1/64,h:.5},front:{x:1/64,y:15/32,w:10/64,h:.5},left:{x:11/64,y:15/32,w:1/64,h:.5},back:{x:.1875,y:15/32,w:10/64,h:.5},top:{x:1/64,y:31/32,w:10/64,h:1/32},bottom:{x:11/64,y:31/32,w:10/64,h:1/32}},capeOptifineRelative:{right:{x:0,y:10/44,w:2/92,h:32/44},front:{x:2/92,y:10/44,w:20/92,h:32/44},left:{x:22/92,y:10/44,w:2/92,h:32/44},back:{x:24/92,y:10/44,w:20/92,h:32/44},top:{x:2/92,y:42/44,w:20/92,h:2/44},bottom:{x:22/92,y:42/44,w:20/92,h:2/44}},capeOptifine:{right:{x:0,y:10,w:2,h:32},front:{x:2,y:10,w:20,h:32},left:{x:22,y:10,w:2,h:32},back:{x:24,y:10,w:20,h:32},top:{x:2,y:42,w:20,h:2},bottom:{x:22,y:42,w:20,h:2}},capeLabymodRelative:{right:{x:0,y:0,w:1/22,h:16/17},front:{x:1/22,y:0,w:10/22,h:16/17},left:{x:.5,y:0,w:1/22,h:16/17},back:{x:12/22,y:0,w:10/22,h:16/17},top:{x:1/22,y:16/17,w:10/22,h:1/17},bottom:{x:.5,y:16/17,w:10/22,h:1/17}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r=0&&n<=126||n>=161&&n<=223)&&a0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},a.prototype={constructor:a,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],a=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=a}},n.prototype.parsePmd=function(e,t){var a,n={},i=new r(e);return n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left",function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),function(){var e,t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r0&&(a.englishModelName=i.getSjisStringsAsUnicode(20),a.englishComment=i.getSjisStringsAsUnicode(256)),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneNames=[];for(var t=0;t=2.0 are supported. Use LegacyGLTFLoader instead.")):(m.extensionsUsed&&(m.extensionsUsed.indexOf(r.KHR_LIGHTS)>=0&&(p[r.KHR_LIGHTS]=new i(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_UNLIT)>=0&&(p[r.KHR_MATERIALS_UNLIT]=new o(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(p[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new f),m.extensionsUsed.indexOf(r.KHR_DRACO_MESH_COMPRESSION)>=0&&(p[r.KHR_DRACO_MESH_COMPRESSION]=new d(this.dracoLoader)),m.extensionsUsed.indexOf(r.MSFT_TEXTURE_DDS)>=0&&(p[r.MSFT_TEXTURE_DDS]=new n)),new k(m,p,{path:t||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse((function(e,t,r,a,n){l({scene:e,scenes:t,cameras:r,animations:a,asset:n})}),u))}};var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(){if(!a.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=new a.DDSLoader}function i(e){this.name=r.KHR_LIGHTS,this.lights={};var t=(e.extensions&&e.extensions[r.KHR_LIGHTS]||{}).lights||{};for(var n in t){var i,o=t[n],s=(new a.Color).fromArray(o.color);switch(o.type){case"directional":(i=new a.DirectionalLight(s)).target.position.set(0,0,1),i.add(i.target);break;case"point":i=new a.PointLight(s);break;case"spot":i=new a.SpotLight(s),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;case"ambient":i=new a.AmbientLight(s)}i&&(i.decay=2,void 0!==o.intensity&&(i.intensity=o.intensity),i.name=o.name||"light_"+n,this.lights[n]=i)}}function o(e){this.name=r.KHR_MATERIALS_UNLIT}o.prototype.getMaterialType=function(e){return a.MeshBasicMaterial},o.prototype.extendParams=function(e,t,r){var n=[];e.color=new a.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var o=i.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture.index))}return Promise.all(n)};var s="glTF",l=12,u={JSON:1313821514,BIN:5130562};function c(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,l);if(this.header={magic:a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,l),i=0;i",s).replace("#include ",l).replace("#include ",u).replace("#include ",c).replace("#include ",d);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new a.Color).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=f,e.uniforms=o,e.defines={STANDARD:""},e.color=new a.Color(1,1,1),e.opacity=1;var h=[];if(Array.isArray(n.diffuseFactor)){var p=n.diffuseFactor;e.color.fromArray(p),e.opacity=p[3]}if(void 0!==n.diffuseTexture&&h.push(r.assignTexture(e,"map",n.diffuseTexture.index)),e.emissive=new a.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new a.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var m=n.specularGlossinessTexture.index;h.push(r.assignTexture(e,"glossinessMap",m)),h.push(r.assignTexture(e,"specularMap",m))}return Promise.all(h)},createMaterial:function(e){var t=new a.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var r=this.specularGlossinessParams,a=0,n=r.length;a=2&&(n[i+1]=e.getY(i)),r>=3&&(n[i+2]=e.getZ(i)),r>=4&&(n[i+3]=e.getW(i));return new a.BufferAttribute(n,r,e.normalized)}return e.clone()}function k(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new t,this.primitiveCache=[],this.textureLoader=new a.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function B(e,t,r){var a=t.attributes;for(var n in a){var i=_[n],o=r[a[n]];i&&(i in e.attributes||e.addAttribute(i,o))}void 0===t.indices||e.index||e.setIndex(r[t.indices])}return k.prototype.parse=function(e,t){var r=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then((function(t){var a=t.scenes||[],n=a[r.scene||0],i=t.animations||[],o=r.asset,s=t.cameras||[];e(n,a,s,i,o)})).catch(t)},k.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},i=0,o=t.length;i=2&&o.setY(_,M[T*l+1]),l>=3&&o.setZ(_,M[T*l+2]),l>=4&&o.setW(_,M[T*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},k.prototype.loadTexture=function(e){var t,n=this,i=this.json,o=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=i.textures[e],c=u.extensions||{},d=(t=c[r.MSFT_TEXTURE_DDS]?i.images[c[r.MSFT_TEXTURE_DDS].source]:i.images[u.source]).uri,f=!1;return void 0!==t.bufferView&&(d=n.getDependency("bufferView",t.bufferView).then((function(e){f=!0;var r=new Blob([e],{type:t.mimeType});return d=l.createObjectURL(r)}))),Promise.resolve(d).then((function(e){var t=a.Loader.Handlers.get(e);return t||(t=c[r.MSFT_TEXTURE_DDS]?n.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(r,a){t.load(N(e,o.path),r,void 0,a)}))})).then((function(e){!0===f&&l.revokeObjectURL(d),e.flipY=!1,void 0!==u.name&&(e.name=u.name),c[r.MSFT_TEXTURE_DDS]||(e.format=void 0!==u.format?T[u.format]:a.RGBAFormat),void 0!==u.internalFormat&&e.format!==T[u.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==u.type?S[u.type]:a.UnsignedByteType;var t=(i.samplers||{})[u.sampler]||{};return e.magFilter=A[t.magFilter]||a.LinearFilter,e.minFilter=A[t.minFilter]||a.LinearMipMapLinearFilter,e.wrapS=M[t.wrapS]||a.RepeatWrapping,e.wrapT=M[t.wrapT]||a.RepeatWrapping,e}))},k.prototype.assignTexture=function(e,t,r){return this.getDependency("texture",r).then((function(r){e[t]=r}))},k.prototype.loadMaterial=function(e){this.json;var t,n=this.extensions,i=this.json.materials[e],o={},s=i.extensions||{},l=[];if(s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(i),l.push(u.extendParams(o,i,this))}else if(s[r.KHR_MATERIALS_UNLIT]){var c=n[r.KHR_MATERIALS_UNLIT];t=c.getMaterialType(i),l.push(c.extendParams(o,i,this))}else{t=a.MeshStandardMaterial;var d=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(d.baseColorFactor)){var f=d.baseColorFactor;o.color.fromArray(f),o.opacity=f[3]}if(void 0!==d.baseColorTexture&&l.push(this.assignTexture(o,"map",d.baseColorTexture.index)),o.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,o.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture){var h=d.metallicRoughnessTexture.index;l.push(this.assignTexture(o,"metalnessMap",h)),l.push(this.assignTexture(o,"roughnessMap",h))}}!0===i.doubleSided&&(o.side=a.DoubleSide);var p=i.alphaMode||L;return p===O?o.transparent=!0:(o.transparent=!1,p===C&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"normalMap",i.normalTexture.index)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale&&o.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"aoMap",i.occlusionTexture.index)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==a.MeshBasicMaterial&&l.push(this.assignTexture(o,"emissiveMap",i.emissiveTexture.index)),Promise.all(l).then((function(){var e;return e=t===a.ShaderMaterial?n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==i.name&&(e.name=i.name),e.normalScale&&(e.normalScale.y=-e.normalScale.y),e.map&&(e.map.encoding=a.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=a.sRGBEncoding),i.extras&&(e.userData=i.extras),e}))},k.prototype.loadGeometries=function(e){var t=this,n=this.extensions,i=this.primitiveCache;return this.getDependencies("accessor").then((function(o){for(var s=[],l=0,u=e.length;l1))return A;A.name+="_"+c,s.add(A)}return s}))}))},k.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new a.PerspectiveCamera(a.Math.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new a.OrthographicCamera(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar)),void 0!==r.name&&(t.name=r.name),r.extras&&(t.userData=r.extras),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},k.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},k.prototype.loadAnimation=function(e){this.json;var t=this.json.animations[e];return this.getMultiDependencies(["accessor","node"]).then((function(r){for(var n=[],i=0,o=t.channels.length;i1&&(s.name+="_instance_"+i[o.mesh]++)}else if(void 0!==o.camera)s=e.cameras[o.camera];else if(o.extensions&&o.extensions[r.KHR_LIGHTS]&&void 0!==o.extensions[r.KHR_LIGHTS].light){s=t[r.KHR_LIGHTS].lights[o.extensions[r.KHR_LIGHTS].light]}else s=new a.Object3D;if(void 0!==o.name&&(s.name=a.PropertyBinding.sanitizeNodeName(o.name)),o.extras&&(s.userData=o.extras),void 0!==o.matrix){var f=new a.Matrix4;f.fromArray(o.matrix),s.applyMatrix(f)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return s}))},k.prototype.loadScene=function(){function e(t,r,n,i,o){var s=i[t],l=n.nodes[t];if(void 0!==l.skin)for(var u=!0===s.isGroup?s.children:[s],c=0,d=u.length;c(n=s.indexOf("\n"))&&i=e.byteLength||!(a=r(e)))return t(1,"no header found");if(!(n=a.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(u.valid|=1,u.programtype=n[1],u.string+=a+"\n";!1!==(a=r(e));)if(u.string+=a+"\n","#"!==a.charAt(0)){if((n=a.match(i))&&(u.gamma=parseFloat(n[1],10)),(n=a.match(o))&&(u.exposure=parseFloat(n[1],10)),(n=a.match(s))&&(u.valid|=2,u.format=n[1]),(n=a.match(l))&&(u.valid|=4,u.height=parseInt(n[1],10),u.width=parseInt(n[2],10)),2&u.valid&&4&u.valid)break}else u.comments+=a+"\n";return 2&u.valid?4&u.valid?u:t(3,"missing image size specifier"):t(3,"missing format specifier")}(n);if(-1!==i){var o=i.width,s=i.height,l=function(e,r,a){var n,i,o,s,l,u,c,d,f,h,p,m,v,g=r,y=a;if(g<8||g>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(g!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(n=new Uint8Array(4*r*a))||!n.length)return t(4,"unable to allocate buffer space");for(i=0,o=0,d=4*g,v=new Uint8Array(4),u=new Uint8Array(d);y>0&&oe.byteLength)return t(1);if(v[0]=e[o++],v[1]=e[o++],v[2]=e[o++],v[3]=e[o++],2!=v[0]||2!=v[1]||(v[2]<<8|v[3])!=g)return t(3,"bad rgbe scanline format");for(c=0;c128)&&(s-=128),0===s||c+s>d)return t(3,"bad scanline data");if(m)for(l=e[o++],f=0;f0){var w=[];for(var b in v)h=v[b],w[b]=h.name;m="Adding mesh(es) ("+w.length+": "+w+") from input mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)"}else m="Not adding mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)";var A=this.callbacks.onProgress;t.isValid(A)&&A(new CustomEvent("MeshBuilderEvent",{detail:{type:"progress",modelName:e.params.meshName,text:m,numericalValue:e.progress.numericalValue}}));return v},r.prototype.updateMaterials=function(e){var r,a,i=e.materials.materialCloneInstructions;if(t.isValid(i)){var o=i.materialNameOrg,s=this.materials[o];if(t.isValid(o)){r=s.clone(),a=i.materialName,r.name=a;var l=i.materialProperties;for(var u in l)r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&(r[u]=l[u]);this.materials[a]=r}else console.warn('Requested material "'+o+'" is not available!')}var c=e.materials.serializedMaterials;if(t.isValid(c)&&Object.keys(c).length>0){var d,f=new n.MaterialLoader;for(a in c)d=c[a],t.isValid(d)&&(r=f.parse(d),this.logging.enabled&&console.info('De-serialized material with name "'+a+'" will be added.'),this.materials[a]=r)}if(c=e.materials.runtimeMaterials,t.isValid(c)&&Object.keys(c).length>0)for(a in c)r=c[a],this.logging.enabled&&console.info('Material with name "'+a+'" will be added.'),this.materials[a]=r},r.prototype.getMaterialsJSON=function(){var e,t={};for(var r in this.materials)e=this.materials[r],t[r]=e.toJSON();return t},r.prototype.getMaterials=function(){return this.materials},r}(),s.WorkerRunnerRefImpl=function(){function e(){var e=this;self.addEventListener("message",(function(t){e.processMessage(t.data)}),!1)}return e.prototype.applyProperties=function(e,t){var r,a,n;for(r in t)a="set"+r.substring(0,1).toLocaleUpperCase()+r.substring(1),n=t[r],"function"==typeof e[a]?e[a](n):e.hasOwnProperty(r)&&(e[r]=n)},e.prototype.processMessage=function(e){if("run"===e.cmd){var t={callbackMeshBuilder:function(e){self.postMessage(e)},callbackProgress:function(t){e.logging.enabled&&e.logging.debug&&console.debug("WorkerRunner: progress: "+t)}},r=new Parser;"function"==typeof r.setLogging&&r.setLogging(e.logging.enabled,e.logging.debug),this.applyProperties(r,e.params),this.applyProperties(r,e.materials),this.applyProperties(r,t),r.workerScope=self,r.parse(e.data.input,e.data.options),e.logging.enabled&&console.log("WorkerRunner: Run complete!"),t.callbackMeshBuilder({cmd:"complete",msg:"WorkerRunner completed run."})}else console.error("WorkerRunner: Received unknown command: "+e.cmd)},e}(),s.WorkerSupport=function(){var e="2.2.0",t=s.Validator,r=function(){function e(){this._reset()}return e.prototype._reset=function(){this.logging={enabled:!0,debug:!1},this.worker=null,this.runnerImplName=null,this.callbacks={meshBuilder:null,onLoad:null},this.terminateRequested=!1,this.queuedMessage=null,this.started=!1,this.forceCopy=!1},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.setForceCopy=function(e){this.forceCopy=!0===e},e.prototype.initWorker=function(e,t){this.runnerImplName=t;var r=new Blob([e],{type:"application/javascript"});this.worker=new Worker(o.URL.createObjectURL(r)),this.worker.onmessage=this._receiveWorkerMessage,this.worker.runtimeRef=this,this._postMessage()},e.prototype._receiveWorkerMessage=function(e){var t=e.data;switch(t.cmd){case"meshData":case"materialData":case"imageData":this.runtimeRef.callbacks.meshBuilder(t);break;case"complete":this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run is complete. Terminating application on request!"),this.runtimeRef._terminate());break;case"error":console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Reported error: "+t.msg),this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run reported error. Terminating application on request!"),this.runtimeRef._terminate());break;default:console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Received unknown command: "+t.cmd)}},e.prototype.setCallbacks=function(e,r){this.callbacks.meshBuilder=t.verifyInput(e,this.callbacks.meshBuilder),this.callbacks.onLoad=t.verifyInput(r,this.callbacks.onLoad)},e.prototype.run=function(e){if(t.isValid(this.queuedMessage))console.warn("Already processing message. Rejecting new run instruction");else{if(this.queuedMessage=e,this.started=!0,!t.isValid(this.callbacks.meshBuilder))throw'Unable to run as no "MeshBuilder" callback is set.';if(!t.isValid(this.callbacks.onLoad))throw'Unable to run as no "onLoad" callback is set.';"run"!==e.cmd&&(e.cmd="run"),t.isValid(e.logging)?(e.logging.enabled=!0===e.logging.enabled,e.logging.debug=!0===e.logging.debug):e.logging={enabled:!0,debug:!1},this._postMessage()}},e.prototype._postMessage=function(){var e;t.isValid(this.queuedMessage)&&t.isValid(this.worker)&&(this.queuedMessage.data.input instanceof ArrayBuffer?(e=this.forceCopy?this.queuedMessage.data.input.slice(0):this.queuedMessage.data.input,this.worker.postMessage(this.queuedMessage,[e])):this.worker.postMessage(this.queuedMessage))},e.prototype.setTerminateRequested=function(e){this.terminateRequested=!0===e,this.terminateRequested&&t.isValid(this.worker)&&!t.isValid(this.queuedMessage)&&this.started&&(this.logging.enabled&&console.info("Worker is terminated immediately as it is not running!"),this._terminate())},e.prototype._terminate=function(){this.worker.terminate(),this._reset()},e}();function a(){if(console.info("Using THREE.LoaderSupport.WorkerSupport version: "+e),this.logging={enabled:!0,debug:!1},void 0===o.Worker)throw"This browser does not support web workers!";if(void 0===o.Blob)throw"This browser does not support Blob!";if("function"!=typeof o.URL.createObjectURL)throw"This browser does not support Object creation from URL!";this.loaderWorker=new r}a.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t,this.loaderWorker.setLogging(this.logging.enabled,this.logging.debug)},a.prototype.setForceWorkerDataCopy=function(e){this.loaderWorker.setForceCopy(e)},a.prototype.validate=function(e,r,a,o,u){if(!t.isValid(this.loaderWorker.worker)){this.logging.enabled&&(console.info("WorkerSupport: Building worker code..."),console.time("buildWebWorkerCode")),t.isValid(u)?this.logging.enabled&&console.info('WorkerSupport: Using "'+u.name+'" as Runner class for worker.'):(u=s.WorkerRunnerRefImpl,this.logging.enabled&&console.info('WorkerSupport: Using DEFAULT "THREE.LoaderSupport.WorkerRunnerRefImpl" as Runner class for worker.'));var c=e(i,l);c+="var Parser = "+r+";\n\n",c+=l(u.name,u),c+="new "+u.name+"();\n\n";var d=this;if(t.isValid(a)&&a.length>0){var f="";!function e(t,r){if(0===r.length)d.loaderWorker.initWorker(f+c,u.name),d.logging.enabled&&console.timeEnd("buildWebWorkerCode");else{var a=new n.FileLoader;a.setPath(t),a.setResponseType("text"),a.load(r[0],(function(a){f+=a,e(t,r)})),r.shift()}}(o,a)}else this.loaderWorker.initWorker(c,u.name),this.logging.enabled&&console.timeEnd("buildWebWorkerCode")}},a.prototype.setCallbacks=function(e,t){this.loaderWorker.setCallbacks(e,t)},a.prototype.run=function(e){this.loaderWorker.run(e)},a.prototype.setTerminateRequested=function(e){this.loaderWorker.setTerminateRequested(e)};var i=function(e,t){var r,a=e+" = {\n";for(var n in t)"string"==typeof(r=t[n])||r instanceof String?a+="\t"+n+': "'+(r=(r=r.replace("\n","\\n")).replace("\r","\\r"))+'",\n':r instanceof Array?a+="\t"+n+": ["+r+"],\n":Number.isInteger(r)?a+="\t"+n+": "+r+",\n":"function"==typeof r&&(a+="\t"+n+": "+r+",\n");return a+="}\n\n"},l=function(e,r,a,n,i){var o,s,l="",u=t.isValid(a)?a:r.name;for(var c in i=t.verifyInput(i,[]),r.prototype)o=r.prototype[c],"constructor"===c?s="\tfunction "+u+o.toString().replace("function","")+";\n\n":"function"==typeof o&&i.indexOf(c)<0&&(l+="\t"+u+".prototype."+c+" = "+o.toString()+";\n\n");l+="\treturn "+u+";\n",l+="})();\n\n";var d="";return t.isValid(n)&&(d+="\n",d+=u+".prototype = Object.create( "+n+".prototype );\n",d+=u+".constructor = "+u+";\n",d+="\n"),t.isValid(s)?l=e+" = (function () {\n\n"+d+s+l:(s=e+" = (function () {\n\n",l=(s+=d+"\t"+r.prototype.constructor.toString()+"\n\n")+l),l};return a}(),s.WorkerDirector=function(){var e="2.2.0",t=s.Validator,r=16,a=8192;function i(n){if(console.info("Using THREE.LoaderSupport.WorkerDirector version: "+e),this.logging={enabled:!0,debug:!1},this.maxQueueSize=a,this.maxWebWorkers=r,this.crossOrigin=null,!t.isValid(n))throw"Provided invalid classDef: "+n;this.workerDescription={classDef:n,globalCallbacks:{},workerSupports:{},forceWorkerDataCopy:!0},this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0,this.callbackOnFinishedProcessing=null}return i.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},i.prototype.getMaxQueueSize=function(){return this.maxQueueSize},i.prototype.getMaxWebWorkers=function(){return this.maxWebWorkers},i.prototype.setCrossOrigin=function(e){this.crossOrigin=e},i.prototype.setForceWorkerDataCopy=function(e){this.workerDescription.forceWorkerDataCopy=!0===e},i.prototype.prepareWorkers=function(e,i,o){t.isValid(e)&&(this.workerDescription.globalCallbacks=e),this.maxQueueSize=Math.min(i,a),this.maxWebWorkers=Math.min(o,r),this.maxWebWorkers=Math.min(this.maxWebWorkers,this.maxQueueSize),this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0;for(var s=0;s0&&this.instructionQueuePointer0},i.prototype.processQueue=function(){var e,t;for(var r in this.workerDescription.workerSupports)(t=this.workerDescription.workerSupports[r]).inUse||(this.instructionQueuePointer=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},i[c]=r;else if(r)if("ka"===u||"kd"===u||"ks"===u){var d=c.split(a,3);r[u]=[parseFloat(d[0]),parseFloat(d[1]),parseFloat(d[2])]}else r[u]=c}}var f=new n.MaterialCreator(this.texturePath||this.path,this.materialOptions);return f.setCrossOrigin(this.crossOrigin),f.setManager(this.manager),f.setMaterials(i),f}},(n.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:a.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:a.RepeatWrapping}).prototype={constructor:n.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var r in e){var a=e[r],n={};for(var i in t[r]=n,a){var o=!0,s=a[i],l=i.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(n[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,r=this.materialsInfo[e],n={name:e,side:this.side};function i(e,r){if(!n[e]){var a,i,o=t.getTextureParams(r,n),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(i=o.url)||""===i?"":/^https?:\/\//i.test(i)?i:a+i));s.repeat.copy(o.scale),s.offset.copy(o.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,n[e]=s}}for(var o in r){var s,l=r[o];if(""!==l)switch(o.toLowerCase()){case"kd":n.color=(new a.Color).fromArray(l);break;case"ks":n.specular=(new a.Color).fromArray(l);break;case"map_kd":i("map",l);break;case"map_ks":i("specularMap",l);break;case"norm":i("normalMap",l);break;case"map_bump":case"bump":i("bumpMap",l);break;case"ns":n.shininess=parseFloat(l);break;case"d":(s=parseFloat(l))<1&&(n.opacity=s,n.transparent=!0);break;case"tr":s=parseFloat(l),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var r,n={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},i=e.split(/\s+/);return(r=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),(r=i.indexOf("-s"))>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),(r=i.indexOf("-o"))>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n},loadTexture:function(e,t,r,n,i){var o,s=a.Loader.Handlers.get(e),l=void 0!==this.manager?this.manager:a.DefaultLoadingManager;return null===s&&(s=new a.TextureLoader(l)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,r,n,i),void 0!==t&&(o.mapping=t),o}},t.default=n},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _three=__webpack_require__(0),THREE=_interopRequireWildcard(_three);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var Volume=function(e,t,r,a,n){if(arguments.length>0){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,a){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(n);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(n);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(n);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(n);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(n);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(n);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw"Error in THREE.Volume constructor : this type is not supported in JavaScript";case"Float32":case"float32":case"float":this.data=new Float32Array(n);break;case"Float64":case"float64":case"double":this.data=new Float64Array(n);break;default:this.data=new Uint8Array(n)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw"Error in THREE.Volume constructor, lengths are not matching arrayBuffer size"}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new THREE.Matrix3,this.matrix.identity();var i=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return i},set:function(e){i=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});var o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[]};Volume.prototype={constructor:Volume,getData:function(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]},access:function(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e},reverseAccess:function(e){var t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]},map:function(e,t){var r=this.data.length;t=t||this;for(var a=0;a.9})),jDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[1]))>.9})),kDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[2]))>.9})),argumentsWithInversion=["volume.xLength-1-","volume.yLength-1-","volume.zLength-1-"],argArray=[iDirection,jDirection,kDirection].map((function(e,t){return(e.dot(base[t])>0?"":argumentsWithInversion[t])+(e===axisInIJK?"IJKIndex":e.argVar)})),argString=argArray.join(",");return sliceAccess=eval("(function sliceAccess (i,j) {return volume.access( "+argString+");})"),{iLength:iLength,jLength:jLength,sliceAccess:sliceAccess,matrix:planeMatrix,planeWidth:planeWidth,planeHeight:planeHeight}},extractSlice:function(e,t){var r=new THREE.VolumeSlice(this,t,e);return this.sliceList.push(r),r},repaintAllSlices:function(){return this.sliceList.forEach((function(e){e.repaint()})),this},computeMinMax:function(){var e=1/0,t=-1/0,r=this.data.length,a=0;for(a=0;a","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","float l = linearToRelativeLuminance( texel.rgb );","gl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","uniform sampler2D luminanceMap;","#else","uniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","#ifdef ADAPTED_LUMINANCE","float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","#else","float fLumAvg = averageLuminance;","#endif","float fLumPixel = linearToRelativeLuminance( vColor );","float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","return fLumCompressed * vColor;","}","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-e*e/(2*t*t))}var r,a,n,i,o=2*Math.ceil(3*e)+1;for(o>25&&(o=25),i=.5*(o-1),a=new Array(o),n=0,r=0;r","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","vec2 aspectcorrect = vec2( 1.0, aspect );","float viewZ = getViewZ( getDepth( vUv ) );","float factor = ( focus + viewZ );","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},tSize:{value:new a.Vector2(256,256)},center:{value:new a.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float dx = rand( vUv + time );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","if(byp<1) {","vec2 p = vUv;","float xs = floor(gl_FragCoord.x / 0.5);","float ys = floor(gl_FragCoord.y / 0.5);","vec4 normal = texture2D (tDisp, p*seed*seed);","if(p.ydistortion_x-col_s*seed) {","if(seed_x>0.){","p.y = 1. - (p.y + distortion_y);","}","else {","p.y = distortion_y;","}","}","if(p.xdistortion_y-col_s*seed) {","if(seed_y>0.){","p.x=distortion_x;","}","else {","p.x = 1. - (p.x + distortion_x);","}","}","p.x+=normal.x*seed_x*(seed/5.);","p.y+=normal.y*seed_y*(seed/5.);","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, p + offset);","vec4 cga = texture2D(tDiffuse, p);","vec4 cb = texture2D(tDiffuse, p - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","gl_FragColor = gl_FragColor+ snow;","}","else {","gl_FragColor=texture2D (tDiffuse, vUv);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","vUV = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","return a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","return sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","float dist = hypot( coord.x - p.x, coord.y - p.y );","float rad = channel;","if ( shape == SHAPE_DOT ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","} else if ( shape == SHAPE_ELLIPSE ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","if ( dist != 0.0 ) {","float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","}","} else if ( shape == SHAPE_LINE ) {","rad = pow( abs( rad ), 1.5) * rad_max;","float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","dist = hypot( normal.x * dot_p, normal.y * dot_p );","} else if ( shape == SHAPE_SQUARE ) {","float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","float sin_t = abs( sin( theta ) );","float cos_t = abs( cos( theta ) );","rad = pow( abs( rad ), 1.4 );","rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","}","return rad - dist;","}","struct Cell {","vec2 normal;","vec2 p1;","vec2 p2;","vec2 p3;","vec2 p4;","float samp2;","float samp1;","float samp3;","float samp4;","};","vec4 getSample( vec2 point ) {","vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","float step = PI2 / float( samples );","float dist = radius * 0.66;","for ( int i = 0; i < samples; ++i ) {","float r = base + step * float( i );","vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","}","tex /= float( samples ) + 1.0;","return tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","if ( channel == 0 ) {","c.samp1 = getSample( c.p1 ).r;","c.samp2 = getSample( c.p2 ).r;","c.samp3 = getSample( c.p3 ).r;","c.samp4 = getSample( c.p4 ).r;","} else if (channel == 1) {","c.samp1 = getSample( c.p1 ).g;","c.samp2 = getSample( c.p2 ).g;","c.samp3 = getSample( c.p3 ).g;","c.samp4 = getSample( c.p4 ).g;","} else {","c.samp1 = getSample( c.p1 ).b;","c.samp3 = getSample( c.p3 ).b;","c.samp2 = getSample( c.p2 ).b;","c.samp4 = getSample( c.p4 ).b;","}","dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","res = clamp( res, 0.0, 1.0 );","return res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","Cell c;","vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","float threshold = step * 0.5;","float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","float offset_normal = mod( hypot( offset.x, offset.y ), step );","float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","c.normal = n;","c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","if ( scatter != 0.0 ) {","float off_mag = scatter * threshold * 0.5;","float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","c.p1.x += cos( off_angle ) * off_mag;","c.p1.y += sin( off_angle ) * off_mag;","}","float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","c.p2.x = c.p1.x - n.x * normal_step;","c.p2.y = c.p1.y - n.y * normal_step;","c.p3.x = c.p1.x + n.y * line_step;","c.p3.y = c.p1.y - n.x * line_step;","c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","return c;","}","float blendColour( float a, float b, float t ) {","if ( blendingMode == BLENDING_LINEAR ) {","return blend( a, b, 1.0 - t );","} else if ( blendingMode == BLENDING_ADD ) {","return blend( a, min( 1.0, a + b ), t );","} else if ( blendingMode == BLENDING_MULTIPLY ) {","return blend( a, max( 0.0, a * b ), t );","} else if ( blendingMode == BLENDING_LIGHTER ) {","return blend( a, max( a, b ), t );","} else if ( blendingMode == BLENDING_DARKER ) {","return blend( a, min( a, b ), t );","} else {","return blend( a, b, 1.0 - t );","}","}","void main() {","if ( ! disable ) {","vec2 p = vec2( vUV.x * width, vUV.y * height );","vec2 origin = vec2( 0, 0 );","float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","Cell cell_r = getReferenceCell( p, origin, rotateR, radius );","Cell cell_g = getReferenceCell( p, origin, rotateG, radius );","Cell cell_b = getReferenceCell( p, origin, rotateB, radius );","float r = getDotColour( cell_r, p, 0, rotateR, aa );","float g = getDotColour( cell_g, p, 1, rotateG, aa );","float b = getDotColour( cell_b, p, 2, rotateB, aa );","vec4 colour = texture2D( tDiffuse, vUV );","r = blendColour( r, colour.r, blending );","g = blendColour( g, colour.g, blending );","b = blendColour( b, colour.b, blending );","if ( greyscale ) {","r = g = b = (r + b + g) / 3.0;","}","gl_FragColor = vec4( r, g, b, 1.0 );","} else {","gl_FragColor = texture2D( tDiffuse, vUV );","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{type:"t",value:null},tDiffuse:{type:"t",value:null},tNormal:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},cameraProjectionMatrix:{type:"m4",value:new a.Matrix4},cameraInverseProjectionMatrix:{type:"m4",value:new a.Matrix4},scale:{type:"f",value:1},intensity:{type:"f",value:.1},bias:{type:"f",value:.5},minResolution:{type:"f",value:0},kernelRadius:{type:"f",value:100},randomSeed:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},sampleUvOffsets:{type:"v2v",value:[new a.Vector2(0,0)]},sampleWeights:{type:"1fv",value:[1]},tDepth:{type:"t",value:null},cameraNear:{type:"f",value:10},cameraFar:{type:"f",value:1e3},depthCutoff:{type:"f",value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","float depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={createSampleWeights:function(e,t){for(var r=function(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)},a=[],n=0;n<=e;n++)a.push(r(n,t));return a},createSampleOffsets:function(e,t){for(var r=[],a=0;a<=e;a++)r.push(t.clone().multiplyScalar(a));return r},configure:function(e,t,r,n){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=a.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=a.createSampleWeights(t,r),e.needsUpdate=!0}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","t = abs( C - Ctop );","delta.y = max( max( t.r, t.g ), t.b );","vec2 edges = step( threshold, delta.xy );","if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){n.default.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==o?o:0,void 0===i.default&&console.error("THREE.SSAARenderPass relies on THREE.CopyShader");var s=i.default;this.copyUniforms=a.UniformsUtils.clone(s.uniforms),this.copyMaterial=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.camera2=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene2=new a.Scene,this.quad2=new a.Mesh(new a.PlaneBufferGeometry(2,2),this.copyMaterial),this.quad2.frustumCulled=!1,this.scene2.add(this.quad2)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var n=s.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1;var o=e.getClearColor().getHex(),l=e.getClearAlpha(),u=1/n.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;for(var c=r.width,d=r.height,f=0;f","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );","float gg = fract( coord.t * ( size.y / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float readDepth( const in vec2 coord ) {","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","#ifdef USE_LOGDEPTHBUF","float logz = unpackRGBAToDepth( texture2D( tDepth, coord ) );","float w = pow(2.0, (logz / logDepthBufFC)) - 1.0;","float z = (logz / w) + 1.0;","#else","float z = unpackRGBAToDepth( texture2D( tDepth, coord ) );","#endif","return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 8.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + radius * vv;","vec2 coord2 = vUv - radius * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float ao = 0.0;","float dz = 1.0 / float( samples );","float l = 0.0;","float z = 1.0 - dz / 2.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","float pw = cos( l ) * r;","float ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{type:"t",value:null},luminosityThreshold:{type:"f",value:1},smoothWidth:{type:"f",value:1},defaultColor:{type:"c",value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(0)},defaultOpacity:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","gl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var n=r(40);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}));var i=r(48);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}));var o=r(90);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}));var s=r(112);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})}));var l=r(144);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VRControls=t.TransformControls=t.TrackballControls=t.PointerLockControls=t.OrthographicTrackballControls=t.OrbitControls=t.FlyControls=t.FirstPersonControls=t.EditorControls=t.DragControls=t.DeviceOrientationControls=void 0;var a=p(r(29)),n=p(r(30)),i=p(r(31)),o=p(r(32)),s=p(r(33)),l=p(r(34)),u=p(r(35)),c=p(r(36)),d=p(r(37)),f=p(r(38)),h=p(r(39));function p(e){return e&&e.__esModule?e:{default:e}}t.DeviceOrientationControls=a.default,t.DragControls=n.default,t.EditorControls=i.default,t.FirstPersonControls=o.default,t.FlyControls=s.default,t.OrbitControls=l.default,t.OrthographicTrackballControls=u.default,t.PointerLockControls=c.default,t.TrackballControls=d.default,t.TransformControls=f.default,t.VRControls=h.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r,n,i,o,s=function(e){t.deviceOrientation=e},l=function(){t.screenOrientation=window.orientation||0},u=(r=new a.Vector3(0,0,1),n=new a.Euler,i=new a.Quaternion,o=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),function(e,t,a,s,l){n.set(a,t,-s,"YXZ"),e.setFromEuler(n),e.multiply(o),e.multiply(i.setFromAxisAngle(r,-l))});this.connect=function(){l(),window.addEventListener("orientationchange",l,!1),window.addEventListener("deviceorientation",s,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",l,!1),window.removeEventListener("deviceorientation",s,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var r=e.alpha?a.Math.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?a.Math.degToRad(e.beta):0,i=e.gamma?a.Math.degToRad(e.gamma):0,o=t.screenOrientation?a.Math.degToRad(t.screenOrientation):0;u(t.object.quaternion,r,n,i,o)}}},this.dispose=function(){t.disconnect()},this.connect()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t,r){if(e instanceof a.Camera){console.warn("THREE.DragControls: Constructor now expects ( objects, camera, domElement )");var n=e;e=t,t=n}var i=new a.Plane,o=new a.Raycaster,s=new a.Vector2,l=new a.Vector3,u=new a.Vector3,c=null,d=null,f=this;function h(){r.addEventListener("mousemove",m,!1),r.addEventListener("mousedown",v,!1),r.addEventListener("mouseup",g,!1),r.addEventListener("mouseleave",g,!1),r.addEventListener("touchmove",y,!1),r.addEventListener("touchstart",x,!1),r.addEventListener("touchend",b,!1)}function p(){r.removeEventListener("mousemove",m,!1),r.removeEventListener("mousedown",v,!1),r.removeEventListener("mouseup",g,!1),r.removeEventListener("mouseleave",g,!1),r.removeEventListener("touchmove",y,!1),r.removeEventListener("touchstart",x,!1),r.removeEventListener("touchend",b,!1)}function m(a){a.preventDefault();var n=r.getBoundingClientRect();if(s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t),c&&f.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void f.dispatchEvent({type:"drag",object:c});o.setFromCamera(s,t);var h=o.intersectObjects(e);if(h.length>0){var p=h[0].object;i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),p.position),d!==p&&(f.dispatchEvent({type:"hoveron",object:p}),r.style.cursor="pointer",d=p)}else null!==d&&(f.dispatchEvent({type:"hoveroff",object:d}),r.style.cursor="auto",d=null)}function v(a){a.preventDefault(),o.setFromCamera(s,t);var n=o.intersectObjects(e);n.length>0&&(c=n[0].object,o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",f.dispatchEvent({type:"dragstart",object:c}))}function g(e){e.preventDefault(),c&&(f.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}function y(e){e.preventDefault(),e=e.changedTouches[0];var a=r.getBoundingClientRect();if(s.x=(e.clientX-a.left)/a.width*2-1,s.y=-(e.clientY-a.top)/a.height*2+1,o.setFromCamera(s,t),c&&f.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void f.dispatchEvent({type:"drag",object:c})}function x(a){a.preventDefault(),a=a.changedTouches[0];var n=r.getBoundingClientRect();s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t);var d=o.intersectObjects(e);d.length>0&&(c=d[0].object,i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),c.position),o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",f.dispatchEvent({type:"dragstart",object:c}))}function b(e){e.preventDefault(),c&&(f.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}h(),this.enabled=!0,this.activate=h,this.deactivate=p,this.dispose=function(){p()},this.setObjects=function(){console.error("THREE.DragControls: setObjects() has been removed.")},this.on=function(e,t){console.warn("THREE.DragControls: on() has been deprecated. Use addEventListener() instead."),f.addEventListener(e,t)},this.off=function(e,t){console.warn("THREE.DragControls: off() has been deprecated. Use removeEventListener() instead."),f.removeEventListener(e,t)},this.notify=function(e){console.error("THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead."),f.dispatchEvent({type:e})}};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){t=void 0!==t?t:document,this.enabled=!0,this.center=new a.Vector3,this.panSpeed=.001,this.zoomSpeed=.001,this.rotationSpeed=.005;var r=this,n=new a.Vector3,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2},o=i.NONE,s=this.center,l=new a.Matrix3,u=new a.Vector2,c=new a.Vector2,d=new a.Spherical,f={type:"change"};function h(e){!1!==r.enabled&&(0===e.button?o=i.ROTATE:1===e.button?o=i.ZOOM:2===e.button&&(o=i.PAN),c.set(e.clientX,e.clientY),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",m,!1),t.addEventListener("mouseout",m,!1),t.addEventListener("dblclick",m,!1))}function p(e){if(!1!==r.enabled){u.set(e.clientX,e.clientY);var t=u.x-c.x,n=u.y-c.y;o===i.ROTATE?r.rotate(new a.Vector3(-t*r.rotationSpeed,-n*r.rotationSpeed,0)):o===i.ZOOM?r.zoom(new a.Vector3(0,0,n)):o===i.PAN&&r.pan(new a.Vector3(-t,n,0)),c.set(e.clientX,e.clientY)}}function m(e){t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),o=i.NONE}function v(e){e.preventDefault(),r.zoom(new a.Vector3(0,0,e.deltaY))}function g(e){e.preventDefault()}this.focus=function(t){var n,i=(new a.Box3).setFromObject(t);!1===i.isEmpty()?(s.copy(i.getCenter()),n=i.getBoundingSphere().radius):(s.setFromMatrixPosition(t.matrixWorld),n=.1);var o=new a.Vector3(0,0,1);o.applyQuaternion(e.quaternion),o.multiplyScalar(4*n),e.position.copy(s).add(o),r.dispatchEvent(f)},this.pan=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.panSpeed),t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),s.add(t),r.dispatchEvent(f)},this.zoom=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.zoomSpeed),t.length()>a||(t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),r.dispatchEvent(f))},this.rotate=function(t){n.copy(e.position).sub(s),d.setFromVector3(n),d.theta+=t.x,d.phi+=t.y,d.makeSafe(),n.setFromSpherical(d),e.position.copy(s).add(n),e.lookAt(s),r.dispatchEvent(f)},this.dispose=function(){t.removeEventListener("contextmenu",g,!1),t.removeEventListener("mousedown",h,!1),t.removeEventListener("wheel",v,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),t.removeEventListener("touchstart",w,!1),t.removeEventListener("touchmove",A,!1)},t.addEventListener("contextmenu",g,!1),t.addEventListener("mousedown",h,!1),t.addEventListener("wheel",v,!1);var y=[new a.Vector3,new a.Vector3,new a.Vector3],x=[new a.Vector3,new a.Vector3,new a.Vector3],b=null;function w(e){if(!1!==r.enabled){switch(e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0);break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0),b=y[0].distanceTo(y[1])}x[0].copy(y[0]),x[1].copy(y[1])}}function A(e){if(!1!==r.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0),r.rotate(y[0].sub(o(y[0],x)).multiplyScalar(-r.rotationSpeed));break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0);var t=y[0].distanceTo(y[1]);r.zoom(new a.Vector3(0,0,b-t)),b=t;var n=y[0].clone().sub(o(y[0],x)),i=y[1].clone().sub(o(y[1],x));n.x=-n.x,i.x=-i.x,r.pan(n.add(i).multiplyScalar(.5))}x[0].copy(y[0]),x[1].copy(y[1])}function o(e,t){var r=t[0];for(var a in t)r.distanceTo(e)>t[a].distanceTo(e)&&(r=t[a]);return r}}t.addEventListener("touchstart",w,!1),t.addEventListener("touchmove",A,!1)};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e){e.preventDefault()}this.object=e,this.target=new a.Vector3(0,0,0),this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.lookSpeed=.005,this.lookVertical=!0,this.autoForward=!1,this.activeLook=!0,this.heightSpeed=!1,this.heightCoef=1,this.heightMin=0,this.heightMax=1,this.constrainVertical=!1,this.verticalMin=0,this.verticalMax=Math.PI,this.autoSpeedFactor=0,this.mouseX=0,this.mouseY=0,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.moveForward=!1,this.moveBackward=!1,this.moveLeft=!1,this.moveRight=!1,this.mouseDragOn=!1,this.viewHalfX=0,this.viewHalfY=0,this.domElement!==document&&this.domElement.setAttribute("tabindex",-1),this.handleResize=function(){this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)},this.onMouseDown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0},this.onMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1},this.onMouseMove=function(e){this.domElement===document?(this.mouseX=e.pageX-this.viewHalfX,this.mouseY=e.pageY-this.viewHalfY):(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)},this.onKeyDown=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0}},this.onKeyUp=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}},this.update=function(e){if(!1!==this.enabled){if(this.heightSpeed){var t=a.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;var r=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(r+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(r),this.moveLeft&&this.object.translateX(-r),this.moveRight&&this.object.translateX(r),this.moveUp&&this.object.translateY(r),this.moveDown&&this.object.translateY(-r);var n=e*this.lookSpeed;this.activeLook||(n=0);var i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon+=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*i),this.lat=Math.max(-85,Math.min(85,this.lat)),this.phi=a.Math.degToRad(90-this.lat),this.theta=a.Math.degToRad(this.lon),this.constrainVertical&&(this.phi=a.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax));var o=this.target,s=this.object.position;o.x=s.x+100*Math.sin(this.phi)*Math.cos(this.theta),o.y=s.y+100*Math.cos(this.phi),o.z=s.z+100*Math.sin(this.phi)*Math.sin(this.theta),this.object.lookAt(o)}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",r,!1),this.domElement.removeEventListener("mousedown",i,!1),this.domElement.removeEventListener("mousemove",n,!1),this.domElement.removeEventListener("mouseup",o,!1),window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",l,!1)};var n=u(this,this.onMouseMove),i=u(this,this.onMouseDown),o=u(this,this.onMouseUp),s=u(this,this.onKeyDown),l=u(this,this.onKeyUp);function u(e,t){return function(){t.apply(e,arguments)}}this.domElement.addEventListener("contextmenu",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mouseup",o,!1),window.addEventListener("keydown",s,!1),window.addEventListener("keyup",l,!1),this.handleResize()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e,t){return function(){t.apply(e,arguments)}}function n(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this.tmpQuaternion=new a.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new a.Vector3(0,0,0),this.rotationVector=new a.Vector3(0,0,0),this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)},this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),r=t.size[0]/2,a=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-a)/a,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){var t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order)},this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",n,!1),this.domElement.removeEventListener("mousedown",o,!1),this.domElement.removeEventListener("mousemove",i,!1),this.domElement.removeEventListener("mouseup",s,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",u,!1)};var i=r(this,this.mousemove),o=r(this,this.mousedown),s=r(this,this.mouseup),l=r(this,this.keydown),u=r(this,this.keyup);this.domElement.addEventListener("contextmenu",n,!1),this.domElement.addEventListener("mousemove",i,!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mouseup",s,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",u,!1),this.updateMovementVector(),this.updateRotationVector()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),h=f.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&h===f.NONE&&L(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),y.set(0,0,0)),g=1,!!(x||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),x=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",k,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",z,!1),l.domElement.removeEventListener("touchend",H,!1),l.domElement.removeEventListener("touchmove",X,!1),document.removeEventListener("mousemove",B,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",G,!1)};var l=this,u={type:"change"},c={type:"start"},d={type:"end"},f={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},h=f.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,x=!1,b=new a.Vector2,w=new a.Vector2,A=new a.Vector2,M=new a.Vector2,T=new a.Vector2,S=new a.Vector2,E=new a.Vector2,_=new a.Vector2,F=new a.Vector2;function P(){return Math.pow(.95,l.zoomSpeed)}function L(e){v.theta-=e}function C(e){v.phi-=e}var O,N=(O=new a.Vector3,function(e,t){O.setFromMatrixColumn(t,0),O.multiplyScalar(-e),y.add(O)}),I=function(){var e=new a.Vector3;return function(t,r){!0===l.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),R=function(){var e=new a.Vector3;return function(t,r){var a=l.domElement===document?l.domElement.body:l.domElement;if(l.object.isPerspectiveCamera){var n=l.object.position;e.copy(n).sub(l.target);var i=e.length();i*=Math.tan(l.object.fov/2*Math.PI/180),N(2*t*i/a.clientHeight,l.object.matrix),I(2*r*i/a.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(N(t*(l.object.right-l.object.left)/l.object.zoom/a.clientWidth,l.object.matrix),I(r*(l.object.top-l.object.bottom)/l.object.zoom/a.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function U(e){l.object.isPerspectiveCamera?g/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object.isPerspectiveCamera?g*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function k(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){b.set(e.clientX,e.clientY)}(e),h=f.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){E.set(e.clientX,e.clientY)}(e),h=f.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=f.PAN}h!==f.NONE&&(document.addEventListener("mousemove",B,!1),document.addEventListener("mouseup",j,!1),l.dispatchEvent(c))}}function B(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case f.ROTATE:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY),A.subVectors(w,b).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;L(2*Math.PI*A.x/t.clientHeight),C(2*Math.PI*A.y/t.clientHeight),b.copy(w),l.update()}(e);break;case f.DOLLY:if(!1===l.enableZoom)return;!function(e){_.set(e.clientX,e.clientY),F.subVectors(_,E),F.y>0?U(P()):F.y<0&&D(P()),E.copy(_),l.update()}(e);break;case f.PAN:if(!1===l.enablePan)return;!function(e){T.set(e.clientX,e.clientY),S.subVectors(T,M).multiplyScalar(l.panSpeed),R(S.x,S.y),M.copy(T),l.update()}(e)}}function j(e){!1!==l.enabled&&(document.removeEventListener("mousemove",B,!1),document.removeEventListener("mouseup",j,!1),l.dispatchEvent(d),h=f.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==f.NONE&&h!==f.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(c),function(e){e.deltaY<0?D(P()):e.deltaY>0&&U(P()),l.update()}(e),l.dispatchEvent(d))}function G(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:R(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:R(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:R(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:R(-l.keyPanSpeed,0),l.update()}}(e)}function z(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){b.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=f.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);E.set(0,a)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);M.set(n,i)}}(e),h=f.TOUCH_DOLLY_PAN;break;default:h=f.NONE}h!==f.NONE&&l.dispatchEvent(c)}}function X(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==f.TOUCH_ROTATE)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY),A.subVectors(w,b).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;L(2*Math.PI*A.x/t.clientHeight),C(2*Math.PI*A.y/t.clientHeight),b.copy(w),l.update()}(e);break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;if(h!==f.TOUCH_DOLLY_PAN)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);_.set(0,a),F.set(0,Math.pow(_.y/E.y,l.zoomSpeed)),U(F.y),E.copy(_)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);T.set(n,i),S.subVectors(T,M).multiplyScalar(l.panSpeed),R(S.x,S.y),M.copy(T)}l.update()}(e);break;default:h=f.NONE}}function H(e){!1!==l.enabled&&(l.dispatchEvent(d),h=f.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",k,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",z,!1),l.domElement.addEventListener("touchend",H,!1),l.domElement.addEventListener("touchmove",X,!1),window.addEventListener("keydown",G,!1),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.radius=0,this.rotateSpeed=1,this.zoomSpeed=1.2,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.keys=[65,83,68],this.target=new a.Vector3;var i=!0,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector3,c=new a.Vector3,d=new a.Vector2,f=new a.Vector2,h=0,p=0,m=new a.Vector2,v=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom;var g={type:"change"},y={type:"start"},x={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}this.radius=.5*Math.min(this.screen.width,this.screen.height),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var b,w,A,M,T,S,E=(b=new a.Vector2,function(e,t){return b.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),b}),_=function(){var e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(a,i){n.set((a-.5*r.screen.width-r.screen.left)/r.radius,(.5*r.screen.height+r.screen.top-i)/r.radius,0);var o=n.length();return r.noRoll?o1?n.normalize():n.z=Math.sqrt(1-o*o),l.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(n.y),e.add(t.copy(r.object.up).cross(l).setLength(n.x)),e.add(l.setLength(n.z)),e}}();function F(e){!1!==r.enabled&&(window.removeEventListener("keydown",F),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function P(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",F,!1))}function L(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(m.copy(E(e.pageX,e.pageY)),v.copy(m)):(d.copy(E(e.pageX,e.pageY)),f.copy(d)):(u.copy(_(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",C,!1),document.addEventListener("mouseup",O,!1),r.dispatchEvent(y))}function C(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||v.copy(E(e.pageX,e.pageY)):f.copy(E(e.pageX,e.pageY)):c.copy(_(e.pageX,e.pageY)))}function O(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",O),r.dispatchEvent(x))}function N(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),d.y+=.01*e.deltaY,r.dispatchEvent(y),r.dispatchEvent(x))}function I(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,u.copy(_(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;case 2:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=h=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(E(i,s)),v.copy(m);break;default:o=n.NONE}r.dispatchEvent(y)}}function R(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(_(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(E(i,s));break;default:o=n.NONE}}function U(e){if(!1!==r.enabled){switch(e.touches.length){case 1:c.copy(_(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;case 2:h=p=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,a=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(E(t,a)),m.copy(v)}o=n.NONE,r.dispatchEvent(x)}}function D(e){e.preventDefault()}this.rotateCamera=(w=new a.Vector3,A=new a.Quaternion,function(){var e=Math.acos(u.dot(c)/u.length()/c.length());e&&(w.crossVectors(u,c).normalize(),e*=r.rotateSpeed,A.setFromAxisAngle(w,-e),l.applyQuaternion(A),r.object.up.applyQuaternion(A),c.applyQuaternion(A),r.staticMoving?u.copy(c):(A.setFromAxisAngle(w,e*(r.dynamicDampingFactor-1)),u.applyQuaternion(A)),i=!0)}),this.zoomCamera=function(){if(o===n.TOUCH_ZOOM_PAN){var e=p/h;h=p,r.object.zoom*=e,i=!0}else{e=1+(f.y-d.y)*r.zoomSpeed;Math.abs(e-1)>1e-6&&e>0&&(r.object.zoom/=e,r.staticMoving?d.copy(f):d.y+=(f.y-d.y)*this.dynamicDampingFactor,i=!0)}},this.panCamera=(M=new a.Vector2,T=new a.Vector3,S=new a.Vector3,function(){if(M.copy(v).sub(m),M.lengthSq()){var e=(r.object.right-r.object.left)/r.object.zoom,t=(r.object.top-r.object.bottom)/r.object.zoom;M.x*=e,M.y*=t,S.copy(l).cross(r.object.up).setLength(M.x),S.add(T.copy(r.object.up).setLength(M.y)),r.object.position.add(S),r.target.add(S),r.staticMoving?m.copy(v):m.add(M.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)),i=!0}}),this.update=function(){l.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||(r.zoomCamera(),i&&r.object.updateProjectionMatrix()),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,l),r.object.lookAt(r.target),i&&(r.dispatchEvent(g),i=!1)},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.left=r.left0,r.object.right=r.right0,r.object.top=r.top0,r.object.bottom=r.bottom0,r.object.lookAt(r.target),r.dispatchEvent(g),i=!1},this.dispose=function(){this.domElement.removeEventListener("contextmenu",D,!1),this.domElement.removeEventListener("mousedown",L,!1),this.domElement.removeEventListener("wheel",N,!1),this.domElement.removeEventListener("touchstart",I,!1),this.domElement.removeEventListener("touchend",U,!1),this.domElement.removeEventListener("touchmove",R,!1),document.removeEventListener("mousemove",C,!1),document.removeEventListener("mouseup",O,!1),window.removeEventListener("keydown",F,!1),window.removeEventListener("keyup",P,!1)},this.domElement.addEventListener("contextmenu",D,!1),this.domElement.addEventListener("mousedown",L,!1),this.domElement.addEventListener("wheel",N,!1),this.domElement.addEventListener("touchstart",I,!1),this.domElement.addEventListener("touchend",U,!1),this.domElement.addEventListener("touchmove",R,!1),window.addEventListener("keydown",F,!1),window.addEventListener("keyup",P,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;e.rotation.set(0,0,0);var r=new a.Object3D;r.add(e);var n=new a.Object3D;n.position.y=10,n.add(r);var i,o,s=Math.PI/2,l=function(e){if(!1!==t.enabled){var a=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;n.rotation.y-=.002*a,r.rotation.x-=.002*i,r.rotation.x=Math.max(-s,Math.min(s,r.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",l,!1)},document.addEventListener("mousemove",l,!1),this.enabled=!1,this.getObject=function(){return n},this.getDirection=(i=new a.Vector3(0,0,-1),o=new a.Euler(0,0,0,"YXZ"),function(e){return o.set(r.rotation.x,n.rotation.y,0),e.copy(i).applyEuler(o),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new a.Vector3;var i=new a.Vector3,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector2,c=new a.Vector2,d=new a.Vector3,f=0,h=new a.Vector2,p=new a.Vector2,m=0,v=0,g=new a.Vector2,y=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var x={type:"change"},b={type:"start"},w={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var A,M,T,S,E,_,F,P,L,C,O,N=(A=new a.Vector2,function(e,t){return A.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),A}),I=function(){var e=new a.Vector2;return function(t,a){return e.set((t-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-a))/r.screen.width),e}}();function R(e){!1!==r.enabled&&(window.removeEventListener("keydown",R),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function U(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",R,!1))}function D(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(g.copy(N(e.pageX,e.pageY)),y.copy(g)):(h.copy(N(e.pageX,e.pageY)),p.copy(h)):(c.copy(I(e.pageX,e.pageY)),u.copy(c)),document.addEventListener("mousemove",k,!1),document.addEventListener("mouseup",B,!1),r.dispatchEvent(b))}function k(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||y.copy(N(e.pageX,e.pageY)):p.copy(N(e.pageX,e.pageY)):(u.copy(c),c.copy(I(e.pageX,e.pageY))))}function B(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",B),r.dispatchEvent(w))}function j(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:h.y-=.025*e.deltaY;break;case 1:h.y-=.01*e.deltaY;break;default:h.y-=25e-5*e.deltaY}r.dispatchEvent(b),r.dispatchEvent(w)}}function V(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,c.copy(I(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;default:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=m=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;g.copy(N(i,s)),y.copy(g)}r.dispatchEvent(b)}}function G(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:u.copy(c),c.copy(I(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=Math.sqrt(t*t+a*a);var n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;y.copy(N(n,i))}}function z(e){if(!1!==r.enabled){switch(e.touches.length){case 0:o=n.NONE;break;case 1:o=n.TOUCH_ROTATE,c.copy(I(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c)}r.dispatchEvent(w)}}function X(e){!1!==r.enabled&&e.preventDefault()}this.rotateCamera=(T=new a.Vector3,S=new a.Quaternion,E=new a.Vector3,_=new a.Vector3,F=new a.Vector3,P=new a.Vector3,function(){P.set(c.x-u.x,c.y-u.y,0),(M=P.length())?(l.copy(r.object.position).sub(r.target),E.copy(l).normalize(),_.copy(r.object.up).normalize(),F.crossVectors(_,E).normalize(),_.setLength(c.y-u.y),F.setLength(c.x-u.x),P.copy(_.add(F)),T.crossVectors(P,l).normalize(),M*=r.rotateSpeed,S.setFromAxisAngle(T,M),l.applyQuaternion(S),r.object.up.applyQuaternion(S),d.copy(T),f=M):!r.staticMoving&&f&&(f*=Math.sqrt(1-r.dynamicDampingFactor),l.copy(r.object.position).sub(r.target),S.setFromAxisAngle(d,f),l.applyQuaternion(S),r.object.up.applyQuaternion(S)),u.copy(c)}),this.zoomCamera=function(){var e;o===n.TOUCH_ZOOM_PAN?(e=m/v,m=v,l.multiplyScalar(e)):(1!==(e=1+(p.y-h.y)*r.zoomSpeed)&&e>0&&l.multiplyScalar(e),r.staticMoving?h.copy(p):h.y+=(p.y-h.y)*this.dynamicDampingFactor)},this.panCamera=(L=new a.Vector2,C=new a.Vector3,O=new a.Vector3,function(){L.copy(y).sub(g),L.lengthSq()&&(L.multiplyScalar(l.length()*r.panSpeed),O.copy(l).cross(r.object.up).setLength(L.x),O.add(C.copy(r.object.up).setLength(L.y)),r.object.position.add(O),r.target.add(O),r.staticMoving?g.copy(y):g.add(L.subVectors(y,g).multiplyScalar(r.dynamicDampingFactor)))}),this.checkDistances=function(){r.noZoom&&r.noPan||(l.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,l.setLength(r.maxDistance)),h.copy(p)),l.lengthSq()1e-6&&(r.dispatchEvent(x),i.copy(r.object.position))},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(x),i.copy(r.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",X,!1),this.domElement.removeEventListener("mousedown",D,!1),this.domElement.removeEventListener("wheel",j,!1),this.domElement.removeEventListener("touchstart",V,!1),this.domElement.removeEventListener("touchend",z,!1),this.domElement.removeEventListener("touchmove",G,!1),document.removeEventListener("mousemove",k,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",R,!1),window.removeEventListener("keyup",U,!1)},this.domElement.addEventListener("contextmenu",X,!1),this.domElement.addEventListener("mousedown",D,!1),this.domElement.addEventListener("wheel",j,!1),this.domElement.addEventListener("touchstart",V,!1),this.domElement.addEventListener("touchend",z,!1),this.domElement.addEventListener("touchmove",G,!1),window.addEventListener("keydown",R,!1),window.addEventListener("keyup",U,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){var e=function(e){a.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.side=a.FrontSide,this.transparent=!0,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(e.prototype=Object.create(a.MeshBasicMaterial.prototype)).constructor=e;var t=function(e){a.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.transparent=!0,this.linewidth=1,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(t.prototype=Object.create(a.LineBasicMaterial.prototype)).constructor=t;var r=new e({visible:!1,transparent:!1}),n=function(){this.init=function(){a.Object3D.call(this),this.handles=new a.Object3D,this.pickers=new a.Object3D,this.planes=new a.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new a.PlaneBufferGeometry(50,50,2,2),t=new a.MeshBasicMaterial({visible:!1,side:a.DoubleSide}),r={XY:new a.Mesh(e,t),YZ:new a.Mesh(e,t),XZ:new a.Mesh(e,t),XYZE:new a.Mesh(e,t)};for(var n in this.activePlane=r.XYZE,r.YZ.rotation.set(0,Math.PI/2,0),r.XZ.rotation.set(-Math.PI/2,0,0),r)r[n].name=n,this.planes.add(r[n]),this.planes[n]=r[n];var i=function(e,t){for(var r in e)for(n=e[r].length;n--;){var a=e[r][n][0],i=e[r][n][1],o=e[r][n][2];a.name=r,a.renderOrder=1/0,i&&a.position.set(i[0],i[1],i[2]),o&&a.rotation.set(o[0],o[1],o[2]),t.add(a)}};i(this.handleGizmos,this.handles),i(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof a.Mesh){e.updateMatrix();var t=e.geometry.clone();t.applyMatrix(e.matrix),e.geometry=t,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))},this.highlight=function(e){this.traverse((function(t){t.material&&t.material.highlight&&(t.name===e?t.material.highlight(!0):t.material.highlight(!1))}))}};(n.prototype=Object.create(a.Object3D.prototype)).constructor=n,n.prototype.update=function(e,t){var r=new a.Vector3(0,0,0),n=new a.Vector3(0,1,0),i=new a.Matrix4;this.traverse((function(a){-1!==a.name.search("E")?a.quaternion.setFromRotationMatrix(i.lookAt(t,r,n)):-1===a.name.search("X")&&-1===a.name.search("Y")&&-1===a.name.search("Z")||a.quaternion.setFromEuler(e)}))};var i=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.CylinderGeometry(0,.05,.2,12,1,!1));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),new e({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),r)]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()};(i.prototype=Object.create(n.prototype)).constructor=i;var o=function(){n.call(this);var e=function(e,t,r){var n=new a.BufferGeometry,i=[];r=r||1;for(var o=0;o<=64*r;++o)"x"===t&&i.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&i.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&i.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return n.addAttribute("position",new a.Float32BufferAttribute(i,3)),n};this.handleGizmos={X:[[new a.Line(new e(1,"x",.5),new t({color:16711680}))]],Y:[[new a.Line(new e(1,"y",.5),new t({color:65280}))]],Z:[[new a.Line(new e(1,"z",.5),new t({color:255}))]],E:[[new a.Line(new e(1.25,"z",1),new t({color:13421568}))]],XYZE:[[new a.Line(new e(1,"z",1),new t({color:7895160}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusBufferGeometry(1.25,.12,2,24),r)]],XYZE:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,2,24),r)]]},this.pickerGizmos.XYZE[0][0].visible=!1,this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){n.prototype.update.apply(this,arguments);var r=new a.Matrix4,i=new a.Euler(0,0,1),o=new a.Quaternion,s=new a.Vector3(1,0,0),l=new a.Vector3(0,1,0),u=new a.Vector3(0,0,1),c=new a.Quaternion,d=new a.Quaternion,f=new a.Quaternion,h=t.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),r.makeRotationFromQuaternion(o).getInverse(r),h.applyMatrix4(r),this.traverse((function(e){o.setFromEuler(i),"X"===e.name&&(c.setFromAxisAngle(s,Math.atan2(-h.y,h.z)),o.multiplyQuaternions(o,c),e.quaternion.copy(o)),"Y"===e.name&&(d.setFromAxisAngle(l,Math.atan2(h.x,h.z)),o.multiplyQuaternions(o,d),e.quaternion.copy(o)),"Z"===e.name&&(f.setFromAxisAngle(u,Math.atan2(h.y,h.x)),o.multiplyQuaternions(o,f),e.quaternion.copy(o))}))},this.init()};(o.prototype=Object.create(n.prototype)).constructor=o;var s=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.BoxGeometry(.125,.125,.125));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.125,.125,.125),new e({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.4,.4,.4),r)]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()};(s.prototype=Object.create(n.prototype)).constructor=s;var l=function(e,t){a.Object3D.call(this),t=void 0!==t?t:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var r=this,n="translate",l=!1,u={translate:new i,rotate:new o,scale:new s};for(var c in u){var d=u[c];d.visible=c===n,this.add(d)}var f={type:"change"},h={type:"mouseDown"},p={type:"mouseUp",mode:n},m={type:"objectChange"},v=new a.Raycaster,g=new a.Vector2,y=new a.Vector3,x=new a.Vector3,b=new a.Vector3,w=new a.Vector3,A=1,M=new a.Matrix4,T=new a.Vector3,S=new a.Matrix4,E=new a.Vector3,_=new a.Quaternion,F=new a.Vector3(1,0,0),P=new a.Vector3(0,1,0),L=new a.Vector3(0,0,1),C=new a.Quaternion,O=new a.Quaternion,N=new a.Quaternion,I=new a.Quaternion,R=new a.Quaternion,U=new a.Vector3,D=new a.Vector3,k=new a.Matrix4,B=new a.Matrix4,j=new a.Vector3,V=new a.Vector3,G=new a.Euler,z=new a.Matrix4,X=new a.Vector3,H=new a.Euler;function Y(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=K(e.changedTouches?e.changedTouches[0]:e,u[n].pickers.children),a=null;t&&(a=t.object.name,e.preventDefault()),r.axis!==a&&(r.axis=a,r.update(),r.dispatchEvent(f))}}function W(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=e.changedTouches?e.changedTouches[0]:e;if(0===t.button||void 0===t.button){var a=K(t,u[n].pickers.children);if(a){e.preventDefault(),e.stopPropagation(),r.axis=a.object.name,r.dispatchEvent(h),r.update(),T.copy(X).sub(V).normalize(),u[n].setActivePlane(r.axis,T);var i=K(t,[u[n].activePlane]);i&&(U.copy(r.object.position),D.copy(r.object.scale),k.extractRotation(r.object.matrix),z.extractRotation(r.object.matrixWorld),B.extractRotation(r.object.parent.matrixWorld),j.setFromMatrixScale(S.getInverse(r.object.parent.matrixWorld)),x.copy(i.point))}}l=!0}}function Q(e){if(void 0!==r.object&&null!==r.axis&&!1!==l&&(void 0===e.button||0===e.button)){var t=K(e.changedTouches?e.changedTouches[0]:e,[u[n].activePlane]);!1!==t&&(e.preventDefault(),e.stopPropagation(),y.copy(t.point),"translate"===n?(y.sub(x),y.multiply(j),"local"===r.space&&(y.applyMatrix4(S.getInverse(z)),-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(k),r.object.position.copy(U),r.object.position.add(y)),"world"!==r.space&&-1===r.axis.search("XYZ")||(-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(S.getInverse(B)),r.object.position.copy(U),r.object.position.add(y)),null!==r.translationSnap&&("local"===r.space&&r.object.position.applyMatrix4(S.getInverse(z)),-1!==r.axis.search("X")&&(r.object.position.x=Math.round(r.object.position.x/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Y")&&(r.object.position.y=Math.round(r.object.position.y/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Z")&&(r.object.position.z=Math.round(r.object.position.z/r.translationSnap)*r.translationSnap),"local"===r.space&&r.object.position.applyMatrix4(z))):"scale"===n?(y.sub(x),y.multiply(j),"local"===r.space&&("XYZ"===r.axis?(A=1+y.y/Math.max(D.x,D.y,D.z),r.object.scale.x=D.x*A,r.object.scale.y=D.y*A,r.object.scale.z=D.z*A):(y.applyMatrix4(S.getInverse(z)),"X"===r.axis&&(r.object.scale.x=D.x*(1+y.x/D.x)),"Y"===r.axis&&(r.object.scale.y=D.y*(1+y.y/D.y)),"Z"===r.axis&&(r.object.scale.z=D.z*(1+y.z/D.z))))):"rotate"===n&&(y.sub(V),y.multiply(j),E.copy(x).sub(V),E.multiply(j),"E"===r.axis?(y.applyMatrix4(S.getInverse(M)),E.applyMatrix4(S.getInverse(M)),b.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),w.set(Math.atan2(E.z,E.y),Math.atan2(E.x,E.z),Math.atan2(E.y,E.x)),_.setFromRotationMatrix(S.getInverse(B)),R.setFromAxisAngle(T,b.z-w.z),C.setFromRotationMatrix(z),_.multiplyQuaternions(_,R),_.multiplyQuaternions(_,C),r.object.quaternion.copy(_)):"XYZE"===r.axis?(R.setFromEuler(y.clone().cross(E).normalize()),_.setFromRotationMatrix(S.getInverse(B)),O.setFromAxisAngle(R,-y.clone().angleTo(E)),C.setFromRotationMatrix(z),_.multiplyQuaternions(_,O),_.multiplyQuaternions(_,C),r.object.quaternion.copy(_)):"local"===r.space?(y.applyMatrix4(S.getInverse(z)),E.applyMatrix4(S.getInverse(z)),b.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),w.set(Math.atan2(E.z,E.y),Math.atan2(E.x,E.z),Math.atan2(E.y,E.x)),C.setFromRotationMatrix(k),null!==r.rotationSnap?(O.setFromAxisAngle(F,Math.round((b.x-w.x)/r.rotationSnap)*r.rotationSnap),N.setFromAxisAngle(P,Math.round((b.y-w.y)/r.rotationSnap)*r.rotationSnap),I.setFromAxisAngle(L,Math.round((b.z-w.z)/r.rotationSnap)*r.rotationSnap)):(O.setFromAxisAngle(F,b.x-w.x),N.setFromAxisAngle(P,b.y-w.y),I.setFromAxisAngle(L,b.z-w.z)),"X"===r.axis&&C.multiplyQuaternions(C,O),"Y"===r.axis&&C.multiplyQuaternions(C,N),"Z"===r.axis&&C.multiplyQuaternions(C,I),r.object.quaternion.copy(C)):"world"===r.space&&(b.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),w.set(Math.atan2(E.z,E.y),Math.atan2(E.x,E.z),Math.atan2(E.y,E.x)),_.setFromRotationMatrix(S.getInverse(B)),null!==r.rotationSnap?(O.setFromAxisAngle(F,Math.round((b.x-w.x)/r.rotationSnap)*r.rotationSnap),N.setFromAxisAngle(P,Math.round((b.y-w.y)/r.rotationSnap)*r.rotationSnap),I.setFromAxisAngle(L,Math.round((b.z-w.z)/r.rotationSnap)*r.rotationSnap)):(O.setFromAxisAngle(F,b.x-w.x),N.setFromAxisAngle(P,b.y-w.y),I.setFromAxisAngle(L,b.z-w.z)),C.setFromRotationMatrix(z),"X"===r.axis&&_.multiplyQuaternions(_,O),"Y"===r.axis&&_.multiplyQuaternions(_,N),"Z"===r.axis&&_.multiplyQuaternions(_,I),_.multiplyQuaternions(_,C),r.object.quaternion.copy(_))),r.update(),r.dispatchEvent(f),r.dispatchEvent(m))}}function q(e){e.preventDefault(),void 0!==e.button&&0!==e.button||(l&&null!==r.axis&&(p.mode=n,r.dispatchEvent(p)),l=!1,"TouchEvent"in window&&e instanceof TouchEvent?(r.axis=null,r.update(),r.dispatchEvent(f)):Y(e))}function K(r,a){var n=t.getBoundingClientRect(),i=(r.clientX-n.left)/n.width,o=(r.clientY-n.top)/n.height;g.set(2*i-1,-2*o+1),v.setFromCamera(g,e);var s=v.intersectObjects(a,!0);return!!s[0]&&s[0]}t.addEventListener("mousedown",W,!1),t.addEventListener("touchstart",W,!1),t.addEventListener("mousemove",Y,!1),t.addEventListener("touchmove",Y,!1),t.addEventListener("mousemove",Q,!1),t.addEventListener("touchmove",Q,!1),t.addEventListener("mouseup",q,!1),t.addEventListener("mouseout",q,!1),t.addEventListener("touchend",q,!1),t.addEventListener("touchcancel",q,!1),t.addEventListener("touchleave",q,!1),this.dispose=function(){t.removeEventListener("mousedown",W),t.removeEventListener("touchstart",W),t.removeEventListener("mousemove",Y),t.removeEventListener("touchmove",Y),t.removeEventListener("mousemove",Q),t.removeEventListener("touchmove",Q),t.removeEventListener("mouseup",q),t.removeEventListener("mouseout",q),t.removeEventListener("touchend",q),t.removeEventListener("touchcancel",q),t.removeEventListener("touchleave",q)},this.attach=function(e){this.object=e,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return n},this.setMode=function(e){for(var t in"scale"===(n=e||n)&&(r.space="local"),u)u[t].visible=t===n;this.update(),r.dispatchEvent(f)},this.setTranslationSnap=function(e){r.translationSnap=e},this.setRotationSnap=function(e){r.rotationSnap=e},this.setSize=function(e){r.size=e,this.update(),r.dispatchEvent(f)},this.setSpace=function(e){r.space=e,this.update(),r.dispatchEvent(f)},this.update=function(){void 0!==r.object&&(r.object.updateMatrixWorld(),V.setFromMatrixPosition(r.object.matrixWorld),G.setFromRotationMatrix(S.extractRotation(r.object.matrixWorld)),e.updateMatrixWorld(),X.setFromMatrixPosition(e.matrixWorld),H.setFromRotationMatrix(S.extractRotation(e.matrixWorld)),A=V.distanceTo(X)/6*r.size,this.position.copy(V),this.scale.set(A,A,A),e instanceof a.PerspectiveCamera?T.copy(X).sub(V).normalize():e instanceof a.OrthographicCamera&&T.copy(X).normalize(),"local"===r.space?u[n].update(G,T):"world"===r.space&&u[n].update(new a.Euler,T),u[n].highlight(r.axis))}};return(l.prototype=Object.create(a.Object3D.prototype)).constructor=l,l}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){var r,n,i=this,o=new a.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")})).catch((function(){console.warn("THREE.VRControls: Unable to get VR Displays")})),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return o},this.update=function(){var t;r&&(r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(i.scale))},this.dispose=function(){r=null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedGeometryExporter=t.STLExporter=t.STLBinaryExporter=t.PLYExporter=t.OBJExporter=t.MMDExporter=t.GLTFExporter=void 0;var a=c(r(41)),n=c(r(42)),i=c(r(43)),o=c(r(44)),s=c(r(45)),l=c(r(46)),u=c(r(47));function c(e){return e&&e.__esModule?e:{default:e}}t.GLTFExporter=a.default,t.MMDExporter=n.default,t.OBJExporter=i.default,t.PLYExporter=o.default,t.STLBinaryExporter=s.default,t.STLExporter=l.default,t.TypedGeometryExporter=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987},i={1003:n.NEAREST,1004:n.NEAREST_MIPMAP_NEAREST,1005:n.NEAREST_MIPMAP_LINEAR,1006:n.LINEAR,1007:n.LINEAR_MIPMAP_NEAREST,1008:n.LINEAR_MIPMAP_LINEAR},o={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},s=function(){};s.prototype={constructor:s,parse:function(e,t,r){(r=Object.assign({},{trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,animations:[],forceIndices:!1,forcePowerOfTwoTextures:!1},r)).animations.length>0&&(r.trs=!0);var s,l={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},u=0,c=[],d=[],f=new Map,h=[],p={},m={attributes:new Map,materials:new Map,textures:new Map};function v(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}function g(e){return 4*Math.ceil(e/4)}function y(e,t){t=t||0;var r=g(e.byteLength);if(r!==e.byteLength){var a=new Uint8Array(r);if(a.set(new Uint8Array(e)),0!==t)for(var n=e.byteLength;n0)&&(t.alphaMode=e.opacity<1?"BLEND":"MASK",e.alphaTest>0&&.5!==e.alphaTest&&(t.alphaCutoff=e.alphaTest)),e.side===a.DoubleSide&&(t.doubleSided=!0),""!==e.name&&(t.name=e.name),l.materials.push(t);var i=l.materials.length-1;return m.materials.set(e,i),i}function S(e){var t,i=e.geometry;if(e.isLineSegments)t=n.LINES;else if(e.isLineLoop)t=n.LINE_LOOP;else if(e.isLine)t=n.LINE_STRIP;else if(e.isPoints)t=n.POINTS;else{if(!i.isBufferGeometry){var o=new a.BufferGeometry;o.fromGeometry(i),i=o}e.drawMode===a.TriangleFanDrawMode?(console.warn("GLTFExporter: TriangleFanDrawMode and wireframe incompatible."),t=n.TRIANGLE_FAN):t=e.drawMode===a.TriangleStripDrawMode?e.material.wireframe?n.LINE_STRIP:n.TRIANGLE_STRIP:e.material.wireframe?n.LINES:n.TRIANGLES}var s={},u={},c=[],d=[],f={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},h=i.getAttribute("normal");for(var p in void 0===h||function(e){if(m.attributes.has(e))return!1;for(var t=new a.Vector3,r=0,n=e.count;r5e-4)return!1;return!0}(h)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.addAttribute("normal",function(e){if(m.attributes.has(e))return m.textures.get(e);for(var t=e.clone(),r=new a.Vector3,n=0,i=t.count;n0){var x=[],w=[],A={};if(void 0!==e.morphTargetDictionary)for(var M in e.morphTargetDictionary)A[e.morphTargetDictionary[M]]=M;for(var S=0;S0&&(s.extras={},s.extras.targetNames=w)}var O=r.forceIndices,N=Array.isArray(e.material);if(N&&0===e.geometry.groups.length)return null;!O&&null===i.index&&N&&(console.warn("THREE.GLTFExporter: Creating index for non-indexed multi-material mesh."),O=!0);var I=!1;if(null===i.index&&O){for(var R=[],U=(S=0,i.attributes.position.count);S0&&(B.targets=d),null!==i.index&&(B.indices=b(i.index,i,k[S].start,k[S].count));var j=T(D[k[S].materialIndex]);null!==j&&(B.material=j),c.push(B)}return I&&i.setIndex(null),s.primitives=c,l.meshes||(l.meshes=[]),l.meshes.push(s),l.meshes.length-1}function E(e,t){l.animations||(l.animations=[]);for(var r=[],n=[],i=0;i0)try{t.extras=JSON.parse(JSON.stringify(e.userData))}catch(e){throw new Error("THREE.GLTFExporter: userData can't be serialized")}if(e.isMesh||e.isLine||e.isPoints){var s=S(e);null!==s&&(t.mesh=s)}else e.isCamera&&(t.camera=function(e){l.cameras||(l.cameras=[]);var t=e.isOrthographicCamera,r={type:t?"orthographic":"perspective"};return t?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:a.Math.degToRad(e.fov)/e.aspect,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),l.cameras.push(r),l.cameras.length-1}(e));if(e.isSkinnedMesh&&h.push(e),e.children.length>0){for(var u=[],c=0,d=e.children.length;c0&&(t.children=u)}l.nodes.push(t);var g=l.nodes.length-1;return f.set(e,g),g}function P(e){l.scenes||(l.scenes=[],l.scene=0);var t={nodes:[]};""!==e.name&&(t.name=e.name),l.scenes.push(t);for(var a=[],n=0,i=e.children.length;n0&&(t.nodes=a)}!function(e){e=e instanceof Array?e:[e];for(var t=[],n=0;n0&&function(e){var t=new a.Scene;t.name="AuxScene";for(var r=0;r0&&(l.extensionsUsed=a),l.buffers&&l.buffers.length>0){l.buffers[0].byteLength=e.size;var n=new window.FileReader;if(!0===r.binary){n.readAsArrayBuffer(e),n.onloadend=function(){var e=y(n.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,e.byteLength,!0),r.setUint32(4,5130562,!0);var a=y(function(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0,a=e.length;r255?32:n}return t.buffer}(JSON.stringify(l)),32),i=new DataView(new ArrayBuffer(8));i.setUint32(0,a.byteLength,!0),i.setUint32(4,1313821514,!0);var o=new ArrayBuffer(12),s=new DataView(o);s.setUint32(0,1179937895,!0),s.setUint32(4,2,!0);var u=12+i.byteLength+a.byteLength+r.byteLength+e.byteLength;s.setUint32(8,u,!0);var c=new Blob([o,i,a,r,e],{type:"application/octet-stream"}),d=new window.FileReader;d.readAsArrayBuffer(c),d.onloadend=function(){t(d.result)}}}else n.readAsDataURL(e),n.onloadend=function(){var e=n.result;l.buffers[0].uri=e,t(l)}}else t(l)}))}},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(0)),n=i(r(4));function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.default=function(){var e;this.parseVpd=function(t,r,i){if(!0!==t.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);var t=e.toString();-1===t.indexOf(".")&&(t+=".");var r=(t+="000000").indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function s(e){for(var t=[],r=0,a=e.length;r255?(u.push(l>>8&255),u.push(255&l)):u.push(255&l)}return new Uint8Array(u)}(w):w}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(){};n.prototype={constructor:n,parse:function(e){var t,r,n,i,o,s="",l=0,u=0,c=0,d=new a.Vector3,f=new a.Vector3,h=new a.Vector2,p=[];return e.traverse((function(e){e instanceof a.Mesh&&function(e){var n=0,m=0,v=0,g=e.geometry,y=new a.Matrix3;if(g instanceof a.Geometry&&(g=(new a.BufferGeometry).setFromObject(e)),g instanceof a.BufferGeometry){var x=g.getAttribute("position"),b=g.getAttribute("normal"),w=g.getAttribute("uv"),A=g.getIndex();if(s+="o "+e.name+"\n",e.material&&e.material.name&&(s+="usemtl "+e.material.name+"\n"),void 0!==x)for(t=0,i=x.count;t=200)return void n("THREE.AssimpJSONLoader: Unsupported assimp2json file format version.")}t(i.parse(r,o))}),r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=new Array(e.length),a=0;a0&&i.addAttribute("normal",new a.Float32BufferAttribute(l,3)),u.length>0&&i.addAttribute("uv",new a.Float32BufferAttribute(u,2)),c.length>0&&i.addAttribute("color",new a.Float32BufferAttribute(c,3)),i.computeBoundingSphere(),i})),o=r(e.materials,(function(e){var t=new a.MeshPhongMaterial;for(var r in e.properties){var i=e.properties[r],o=i.key,s=i.value;switch(o){case"$tex.file":var l=i.semantic;if(1===l||2===l||5===l||6===l){var u;switch(l){case 1:u="map";break;case 2:u="specularMap";break;case 5:u="bumpMap";break;case 6:u="normalMap"}var c=n.load(s);c.wrapS=c.wrapT=a.RepeatWrapping,t[u]=c}break;case"?mat.name":t.name=s;break;case"$clr.diffuse":t.color.fromArray(s);break;case"$clr.specular":t.specular.fromArray(s);break;case"$clr.emissive":t.emissive.fromArray(s);break;case"$mat.shininess":t.shininess=s;break;case"$mat.shadingm":t.flatShading=1===s;break;case"$mat.opacity":s<1&&(t.opacity=s,t.transparent=!0)}}return t}));return function e(t,r,n,i){var o,s,l=new a.Object3D;for(l.name=r.name||"",l.matrix=(new a.Matrix4).fromArray(r.transformation).transpose(),l.matrix.decompose(l.position,l.quaternion,l.scale),o=0;r.meshes&&o0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(var e=0;e=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;for(var r=e.hierarchy[0].keys,a=0;ae){t=this.keys[a],r=this.keys[a+1];break}if(this.keys[a].time4&&(r.length=4);var n=0;for(a=0;a<4;a++)n+=r[a].w*r[a].w;n=Math.sqrt(n);for(a=0;a<4;a++)r[a].w=r[a].w/n,e[a]=r[a].i,t[a]=r[a].w}function I(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(var r in e.children){var a=I(e.children[r],t);if(a)return a}}function R(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e,t){if(0!=this.mBones.length){for(var r=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var o=O(u=i.toTHREE(e),e);this.threeNode.add(o);for(var s=0;s0&&n.addAttribute("normal",new a.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&n.addAttribute("color",new a.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&n.addAttribute("uv",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&n.addAttribute("uv1",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&n.addAttribute("tangents",new a.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&n.addAttribute("bitangents",new a.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){for(var i=[],o=[],s=0;s0&&(r=new a.SkinnedMesh(n,t)),this.threeNode=r,r}}function U(){this.mNumIndices=0,this.mIndices=[]}function D(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new a.Vector3(this.x,this.y,this.z)}}function k(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new a.Color(this.r,this.g,this.b,1)}}function B(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new a.Quaternion(this.x,this.y,this.z,this.w)}}function j(){this.mVertexId=0,this.mWeight=0}function V(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}function G(){this.mTime=0,this.mValue=null}function z(){this.mTime=0,this.mValue=null}function X(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new a.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(var r=0;r0)var r=this.mAnimations[0].toTHREE(this);return{object:e,animation:r}}}function ie(){this.elements=[[],[],[],[]],this.toTHREE=function(){for(var e=new a.Matrix4,t=0;t<4;++t)for(var r=0;r<4;++r)e.elements[4*t+r]=this.elements[r][t];return e}}var oe=!0;function se(e){var t=e.getFloat32(e.readOffset,oe);return e.readOffset+=4,t}function le(e){var t=e.getFloat64(e.readOffset,oe);return e.readOffset+=8,t}function ue(e){var t=e.getUint16(e.readOffset,oe);return e.readOffset+=2,t}function ce(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function de(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function fe(e){var t=new D;return t.x=se(e),t.y=se(e),t.z=se(e),t}function he(e){var t=new k;return t.r=se(e),t.g=se(e),t.b=se(e),t}function pe(e){var t=new V,r=ce(e);return e.ReadBytes(t.data,1,r),t.toString()}function me(e){var t=new j;return t.mVertexId=ce(e),t.mWeight=se(e),t}function ve(e){for(var t=new ie,r=0;r<4;++r)for(var a=0;a<4;++a)t.elements[r][a]=se(e);return t}function ge(e){var t=new G;return t.mTime=le(e),t.mValue=fe(e),t}function ye(e){var t=new z;return t.mTime=le(e),t.mValue=function(e){var t=new B;return t.w=se(e),t.x=se(e),t.y=se(e),t.z=se(e),t}(e),t}function xe(e,t,r){for(var a=0;a0,Ne=ue(r)>0,Oe)throw"Shortened binaries are not supported!";if(r.Seek(256,Ie),r.Seek(128,Ie),r.Seek(64,Ie),!Ne)return Ce(r,t),t.toTHREE();var a=de(r),n=r.FileSize()-r.Tell(),i=[];r.Read(i,1,n);var o=[];uncompress(o,a,i,n),Ce(new ArrayBuffer(o),t)}(e)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){function e(){this.id=0,this.data=null}function t(){}t.prototype={set:function(e,t){this[e]=t},get:function(e,t){return this.hasOwnProperty(e)?this[e]:t}};var r=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.trunk=new a.Object3D,this.materialFactory=void 0,this._url="",this._baseDir="",this._data=void 0,this._ptr=0,this._version=[],this._streaming=!1,this._optimized_for_accuracy=!1,this._compression=0,this._bodylen=4294967295,this._blocks=[new e],this._accuracyMatrix=!1,this._accuracyGeo=!1,this._accuracyProps=!1};return r.prototype={constructor:r,load:function(e,t,r,n){var i=this;this._url=e,this._baseDir=e.substr(0,e.lastIndexOf("/")+1);var o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){var t=e.byteLength;for(this._ptr=0,this._data=new DataView(e),this._parseHeader(),0!=this._compression&&console.error("compressed AWD not supported"),this._streaming||this._bodylen==e.byteLength-this._ptr||console.error("AWDLoader: body len does not match file length",this._bodylen,t-this._ptr);this._ptr1)for(r=new a.Object3D,p=0;p191&&a<224){var n=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((31&a)<<6|63&n)}else{n=this._data.getUint8(this._ptr++,!0);var i=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((15&a)<<12|(63&n)<<6|63&i)}}return t.join("")}},r}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),r,n)},parse:function(e){function t(e){var t=new a.BufferGeometry,r=e.indices,n=e.positions,i=e.normals,o=e.uvs;t.setIndex(r);for(var s=2,l=n.length;s0&&t.push(new a.VectorKeyframeTrack(n+".position",i,o)),s.length>0&&t.push(new a.QuaternionKeyframeTrack(n+".quaternion",i,s)),l.length>0&&t.push(new a.VectorKeyframeTrack(n+".scale",i,l)),t}function M(e,t,r){var a,n,i,o=!0;for(n=0,i=e.length;n=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function S(e,t,r){for(;t0&&t0&&h.addAttribute("position",new a.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&h.addAttribute("normal",new a.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&h.addAttribute("color",new a.Float32BufferAttribute(l.array,l.stride)),s.array.length>0&&h.addAttribute("uv",new a.Float32BufferAttribute(s.array,s.stride)),u.length>0&&h.addAttribute("skinIndex",new a.Float32BufferAttribute(u,c)),d.length>0&&h.addAttribute("skinWeight",new a.Float32BufferAttribute(d,f)),n.data=h,n.type=e[0].type,n.materialKeys=p,n}function de(e,t,r,a){var n=e.p,i=e.stride,o=e.vcount;function s(e){for(var t=n[e+r]*u,i=t+u;t4)for(var g=1,y=h-2;g<=y;g++){p=c+i*g,m=c+i*(g+1);s(c+0*i),s(p),s(m)}c+=i*h}else for(d=0,f=n.length;d=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ge(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;rn.limits.max||t>8&255,f>>16&255,f>>24&255))),r;p=!0,o=64,r.format=a.RGBAFormat}r.mipmapCount=1,131072&d[2]&&!1!==t&&(r.mipmapCount=Math.max(1,d[7]));var m=d[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=d[4],r.height=d[3];for(var v=d[1]+4,g=r.isCubemap?6:1,y=0;y>1,1),b=Math.max(b>>1,1)}return r},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="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},n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var i=function(e){this.timeLoaded=0,this.manager=e||n.DefaultLoadingManager,this.materials=null,this.verbosity=0,this.attributeOptions={},this.drawMode=n.TrianglesDrawMode,this.nativeAttributeMap={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"}};i.prototype={constructor:i,load:function(e,t,r,a){var i=this,o=new n.FileLoader(i.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.load(e,(function(e){i.decodeDracoFile(e,t)}),r,a)},setPath:function(e){this.path=e},setCrossOrigin:function(e){this.crossOrigin=e},setVerbosity:function(e){this.verbosity=e},setDrawMode:function(e){this.drawMode=e},setSkipDequantization:function(e,t){var r=!0;void 0!==t&&(r=t),this.getAttributeOptions(e).skipDequantization=r},decodeDracoFile:function(e,t,r){var a=this;i.getDecoderModule().then((function(n){a.decodeDracoFileInternal(e,n.decoder,t,r||{})}))},decodeDracoFileInternal:function(e,t,r,a){var n=new t.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength);var i=new t.Decoder,o=i.GetEncodedGeometryType(n);if(o==t.TRIANGULAR_MESH)this.verbosity>0&&console.log("Loaded a mesh.");else{if(o!=t.POINT_CLOUD){var s="THREE.DRACOLoader: Unknown geometry type.";throw console.error(s),new Error(s)}this.verbosity>0&&console.log("Loaded a point cloud.")}r(this.convertDracoGeometryTo3JS(t,i,o,n,a))},addAttributeToGeometry:function(e,t,r,a,i,o,s){if(0===i.ptr){var l="THREE.DRACOLoader: No attribute "+a;throw console.error(l),new Error(l)}var u=i.num_components(),c=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,c);var d=r.num_points()*u;s[a]=new Float32Array(d);for(var f=0;f0&&console.log("Number of faces loaded: "+c.toString())):c=0;var f=o.num_points(),h=o.num_attributes();this.verbosity>0&&(console.log("Number of points loaded: "+f.toString()),console.log("Number of attributes loaded: "+h.toString()));var p=t.GetAttributeId(o,e.POSITION);if(-1==p){u="THREE.DRACOLoader: No position attribute found.";throw console.error(u),e.destroy(t),e.destroy(o),new Error(u)}var m=t.GetAttribute(o,p),v={},g=new n.BufferGeometry;for(var y in this.nativeAttributeMap)if(void 0===i[y]){var x=t.GetAttributeId(o,e[this.nativeAttributeMap[y]]);if(-1!==x){this.verbosity>0&&console.log("Loaded "+y+" attribute.");var b=t.GetAttribute(o,x);this.addAttributeToGeometry(e,t,o,y,b,g,v)}}for(var y in i){var w=i[y];b=t.GetAttributeByUniqueId(o,w);this.addAttributeToGeometry(e,t,o,y,b,g,v)}if(r==e.TRIANGULAR_MESH)if(this.drawMode===n.TriangleStripDrawMode){var A=new e.DracoInt32Array;t.GetTriangleStripsFromMesh(o,A);v.indices=new Uint32Array(A.size());for(var M=0;M65535?n.Uint32BufferAttribute:n.Uint16BufferAttribute)(v.indices,1));var _=new e.AttributeQuantizationTransform;if(_.InitFromAttribute(m)){g.attributes.position.isQuantized=!0,g.attributes.position.maxRange=_.range(),g.attributes.position.numQuantizationBits=_.quantization_bits(),g.attributes.position.minValues=new Float32Array(3);for(M=0;M<3;++M)g.attributes.position.minValues[M]=_.min_value(M)}return e.destroy(_),e.destroy(t),e.destroy(o),this.decode_time=d-l,this.import_time=performance.now()-d,this.verbosity>0&&(console.log("Decode time: "+this.decode_time),console.log("Import time: "+this.import_time)),g},isVersionSupported:function(e,t){i.getDecoderModule().then((function(r){t(r.decoder.isVersionSupported(e))}))},getAttributeOptions:function(e){return void 0===this.attributeOptions[e]&&(this.attributeOptions[e]={}),this.attributeOptions[e]}},i.decoderPath="./",i.decoderConfig={},i.decoderModulePromise=null,i.setDecoderPath=function(e){i.decoderPath=e},i.setDecoderConfig=function(e){var t=i.decoderConfig.wasmBinary;i.decoderConfig=e||{},i.releaseDecoderModule(),t&&(i.decoderConfig.wasmBinary=t)},i.releaseDecoderModule=function(){i.decoderModulePromise=null},i.getDecoderModule=function(){var e=this,t=i.decoderPath,r=i.decoderConfig,n=i.decoderModulePromise;return n||("undefined"!=typeof DracoDecoderModule?n=Promise.resolve():"object"!==("undefined"==typeof WebAssembly?"undefined":a(WebAssembly))||"js"===r.type?n=i._loadScript(t+"draco_decoder.js"):(r.wasmBinaryFile=t+"draco_decoder.wasm",n=i._loadScript(t+"draco_wasm_wrapper.js").then((function(){return i._loadArrayBuffer(r.wasmBinaryFile)})).then((function(e){r.wasmBinary=e}))),n=n.then((function(){return new Promise((function(t){r.onModuleLoaded=function(r){e.timeLoaded=performance.now(),t({decoder:r})},DracoDecoderModule(r)}))})),i.decoderModulePromise=n,n)},i._loadScript=function(e){var t=document.getElementById("decoder_script");null!==t&&t.parentNode.removeChild(t);var r=document.getElementsByTagName("head")[0],a=document.createElement("script");return a.id="decoder_script",a.type="text/javascript",a.src=e,new Promise((function(e){a.onload=e,r.appendChild(a)}))},i._loadArrayBuffer=function(e){var t=new n.FileLoader;return t.setResponseType("arraybuffer"),new Promise((function(r,a){t.load(e,r,void 0,a)}))},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.sourceTexture=e,this.resolution=t,this.views=[{t:[1,0,0],u:[0,-1,0]},{t:[-1,0,0],u:[0,-1,0]},{t:[0,1,0],u:[0,0,1]},{t:[0,-1,0],u:[0,0,-1]},{t:[0,0,1],u:[0,-1,0]},{t:[0,0,-1],u:[0,-1,0]}],this.camera=new a.PerspectiveCamera(90,1,.1,10),this.boxMesh=new a.Mesh(new a.BoxBufferGeometry(1,1,1),this.getShader()),this.boxMesh.material.side=a.BackSide,this.scene=new a.Scene,this.scene.add(this.boxMesh);var r={format:a.RGBAFormat,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.renderTarget=new a.WebGLRenderTargetCube(this.resolution,this.resolution,r)};n.prototype={constructor:n,update:function(e){for(var t=0;t<6;t++){this.renderTarget.activeCubeFace=t;var r=this.views[t];this.camera.position.set(0,0,0),this.camera.up.set(r.u[0],r.u[1],r.u[2]),this.camera.lookAt(r.t[0],r.t[1],r.t[2]),e.render(this.scene,this.camera,this.renderTarget,!0)}return this.renderTarget.texture},getShader:function(){var e=new a.ShaderMaterial({uniforms:{equirectangularMap:{value:this.sourceTexture}},vertexShader:"varying vec3 localPosition;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tlocalPosition = position;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \n\t\t\t\tvarying vec3 localPosition;\n\t\t\t\tuniform sampler2D equirectangularMap;\n\t\t\t\t\n\t\t\t\tvec2 EquiangularSampleUV(vec3 v) {\n\t\t\t vec2 uv = vec2(atan(v.z, v.x), asin(v.y));\n\t\t\t uv *= vec2(0.1591, 0.3183); // inverse atan\n\t\t\t uv += 0.5;\n\t\t\t return uv;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = EquiangularSampleUV(normalize(localPosition));\n \t\t\tvec3 color = texture2D(equirectangularMap, uv).rgb;\n \t\t\t\n\t\t\t\t\tgl_FragColor = vec4( color, 1.0 );\n\t\t\t\t}",blending:a.CustomBlending,premultipliedAlpha:!1,blendSrc:a.OneFactor,blendDst:a.ZeroFactor,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.ZeroFactor,blendEquation:a.AddEquation});return e.type="EquiangularToCubeGenerator",e},dispose:function(){this.boxMesh.geometry.dispose(),this.boxMesh.material.dispose(),this.renderTarget.dispose()}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};(n.prototype=Object.create(a.DataTextureLoader.prototype))._parser=function(e){var t=65536,r=t>>3,n=14,i=65537,o=1<>r&(1<a)return!1;g(6,f,h,e,d);var p=v.l;if(f=v.c,h=v.lc,s[n]=p,p==u){if(d.value-r.value>a)throw"Something wrong with hufUnpackEncTable";g(8,f,h,e,d);var m=v.l+c;if(f=v.c,h=v.lc,n+m>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}else if(p>=l){if(n+(m=p-l+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}}!function(e){for(var t=0;t<=58;++t)y[t]=0;for(t=0;t0;--t){var a=r+y[t]>>1;y[t]=r,r=a}for(t=0;t0&&(e[t]=n|y[n]++<<6)}}(s)}function b(e){return 63&e}function w(e){return e>>6}var A={c:0,lc:0};function M(e,t,r,a){e=e<<8|R(r,a),t+=8,A.c=e,A.lc=t}var T={c:0,lc:0};function S(e,t,r,a,n,i,o,s,l,u){if(e==t){a<8&&(M(r,a,n,o),r=A.c,a=A.lc);var c=r>>(a-=8);if(out+c>oe)throw"Issue with getCode";for(var d=out[-1];c-- >0;)s[l.value++]=d}else{if(!(l.value32767?t-65536:t}var _={a:0,b:0};function F(e,t){var r=E(e),a=E(t),n=r+(1&a)+(a>>1),i=n,o=n-a;_.a=i,_.b=o}function P(e,t,r,a,n,i,o){for(var s,l=r>n?n:r,u=1;u<=l;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var c,d,f,h,p=0,m=p+i*(n-s),v=i*u,g=i*s,y=a*u,x=a*s;p<=m;p+=g){for(var b=p,w=p+a*(r-s);b<=w;b+=x){var A=b+y,M=(T=b+v)+y;F(t[b+e],t[T+e]),c=_.a,f=_.b,F(t[A+e],t[M+e]),d=_.a,h=_.b,F(c,d),t[b+e]=_.a,t[A+e]=_.b,F(f,h),t[T+e]=_.a,t[M+e]=_.b}if(r&u){var T=b+v;F(t[b+e],t[T+e]),c=_.a,t[T+e]=_.b,t[b+e]=c}}if(n&u)for(b=p,w=p+a*(r-s);b<=w;b+=x){A=b+y;F(t[b+e],t[A+e]),c=_.a,t[A+e]=_.b,t[b+e]=c}s=u,u>>=1}return p}function L(e,t,r,a,l,u,c){var d=r.value,f=I(t,r),h=I(t,r);r.value+=4;var p=I(t,r);if(r.value+=4,f<0||f>=i||h<0||h>=i)throw"Something wrong with HUF_ENCSIZE";var m=new Array(i),v=new Array(o);if(function(e){for(var t=0;t8*(a-(r.value-d)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var i=w(e[t]),o=b(e[t]);if(i>>o)throw"Invalid table entry";if(o>n){if((c=a[i>>o-n]).len)throw"Invalid table entry";if(c.lit++,c.p){var s=c.p;c.p=new Array(c.lit);for(var l=0;l0;l--){var c;if((c=a[(i<=n;){if((x=t[f>>h-n&s]).len)h-=x.len,S(x.lit,l,f,h,r,0,i,c,d,p),f=T.c,h=T.lc;else{if(!x.p)throw"hufDecode issues";var v;for(v=0;v=g&&w(e[x.p[v]])==(f>>h-g&(1<>=y,h-=y;h>0;){var x;if(!(x=t[f<=r)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(h<=p)for(var m=0;m>3]&1<<(7&n))&&(r[a++]=n);for(var i=a-1;a>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function B(e,t){var r=e.getUint16(t.value,!0);return t.value+=p,r}function j(e,t){return k(B(e,t))}function V(e,t,r,a,n){if("string"===a||"iccProfile"===a)return function(e,t,r){var a=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,a}(t,r,n);if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value0&&void 0!==r[l[0].ID]&&(0!==(i=r[l[0].ID]).indexOf("blob:")&&0!==i.indexOf("data:")||t.setPath(void 0));o="tga"===e.FileName.slice(-3).toLowerCase()?n.Loader.Handlers.get(".tga").load(i):t.load(i);return t.setPath(s),o}(e,t,r,a);i.ID=e.id,i.name=e.attrName;var o=e.WrapModeU,s=e.WrapModeV,l=void 0!==o?o.value:0,u=void 0!==s?s.value:0;if(i.wrapS=0===l?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===u?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){var c=e.Scaling.value;i.repeat.x=c[0],i.repeat.y=c[1]}return i}function i(e,t,r,i){var s=t.id,l=t.attrName,u=t.ShadingModel;if("object"===(void 0===u?"undefined":a(u))&&(u=u.value),!i.has(s))return null;var c,d=function(e,t,r,a,i){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value);t.Diffuse?s.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new n.Color).fromArray(t.DiffuseColor.value));t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value);t.Emissive?s.emissive=(new n.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new n.Color).fromArray(t.EmissiveColor.value));t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value));t.Opacity&&(s.opacity=parseFloat(t.Opacity.value));s.opacity<1&&(s.transparent=!0);t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value);t.Shininess&&(s.shininess=t.Shininess.value);t.Specular?s.specular=(new n.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new n.Color).fromArray(t.SpecularColor.value));return i.get(a).children.forEach((function(t){var a=t.relationship;switch(a){case"Bump":s.bumpMap=r.get(t.ID);break;case"DiffuseColor":s.map=o(e,r,t.ID,i);break;case"DisplacementColor":s.displacementMap=o(e,r,t.ID,i);break;case"EmissiveColor":s.emissiveMap=o(e,r,t.ID,i);break;case"NormalMap":s.normalMap=o(e,r,t.ID,i);break;case"ReflectionColor":s.envMap=o(e,r,t.ID,i),s.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":s.specularMap=o(e,r,t.ID,i);break;case"TransparentColor":s.alphaMap=o(e,r,t.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a)}})),s}(e,t,r,s,i);switch(u.toLowerCase()){case"phong":c=new n.MeshPhongMaterial;break;case"lambert":c=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',u),c=new n.MeshPhongMaterial({color:3342591})}return c.setValues(d),c.name=l,c}function o(e,t,r,a){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=a.get(r).children[0].ID),t.get(r)}function s(e,t){var r=[];return e.children.forEach((function(e){var a=t[e.ID];if("Cluster"===a.attrType){var i={ID:e.ID,indices:[],weights:[],transform:(new n.Matrix4).fromArray(a.Transform.a),transformLink:(new n.Matrix4).fromArray(a.TransformLink.a),linkMode:a.Mode};"Indexes"in a&&(i.indices=a.Indexes.a,i.weights=a.Weights.a),r.push(i)}})),{rawBones:r,bones:[]}}function l(e,t,r,a){for(var n=[],i=0;i0&&o.addAttribute("color",new n.Float32BufferAttribute(l.colors,3));r&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(l.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(l.vertexWeights,4)),o.FBX_Deformer=r);if(l.normal.length>0){var f=new n.Float32BufferAttribute(l.normal,3);(new n.Matrix3).getNormalMatrix(i).applyToBufferAttribute(f),o.addAttribute("normal",f)}if(l.uvs.forEach((function(e,t){var r="uv"+(t+1).toString();0===t&&(r="uv"),o.addAttribute(r,new n.Float32BufferAttribute(l.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){var h=l.materialIndex[0],p=0;if(l.materialIndex.forEach((function(e,t){e!==h&&(o.addGroup(p,t-p,h),h=e,p=t)})),o.groups.length>0){var m=o.groups[o.groups.length-1],v=m.start+m.count;v!==l.materialIndex.length&&o.addGroup(v,l.materialIndex.length-v,h)}0===o.groups.length&&o.addGroup(0,l.materialIndex.length,l.materialIndex[0])}return function(e,t,r,a,i){if(null===a)return;t.morphAttributes.position=[],t.morphAttributes.normal=[],a.rawTargets.forEach((function(a){var o=e.Objects.Geometry[a.geoID];void 0!==o&&function(e,t,r,a){var i=new n.BufferGeometry;r.attrName&&(i.name=r.attrName);for(var o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],s=void 0!==t.Vertices?t.Vertices.a.slice():[],l=void 0!==r.Vertices?r.Vertices.a:[],u=void 0!==r.Indexes?r.Indexes.a:[],d=0;d4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);var y=[0,0,0,0],x=[0,0,0,0];v.forEach((function(e,t){var r=e,a=m[t];x.forEach((function(e,t,n){if(r>e){n[t]=r,r=e;var i=y[t];y[t]=a,a=i}}))})),m=y,v=x}for(;v.length<4;)v.push(0),m.push(0);for(var b=0;b<4;++b)u.push(v[b]),c.push(m[b])}if(e.normal){g=h(f,r,d,e.normal);o.push(g[0],g[1],g[2])}if(e.material&&"AllSame"!==e.material.mappingType)var w=h(f,r,d,e.material)[0];e.uv&&e.uv.forEach((function(e,t){var a=h(f,r,d,e);void 0===l[t]&&(l[t]=[]),l[t].push(a[0]),l[t].push(a[1])})),a++,p&&(!function(e,t,r,a,n,i,o,s,l,u){for(var c=2;c=d.length&&d===O(c,0,d.length))o=(new E).parse(e);else{var f=O(e);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;for(var a=0;a0,u="string"==typeof o.Content&&""!==o.Content;if(l||u){var c=t(n[i]);a[o.RelativeFilename||o.Filename]=c}}}}for(var s in r){var d=r[s];void 0!==a[d]?r[s]=a[d]:r[s]=r[s].split("\\").pop()}return r}(o),A=function(e,t,r){var a=new Map;if("Material"in e.Objects){var n=e.Objects.Material;for(var o in n){var s=i(e,n[o],t,r);null!==s&&a.set(parseInt(o),s)}}return a}(o,function(e,t,a,n){var i=new Map;if("Texture"in e.Objects){var o=e.Objects.Texture;for(var s in o){var l=r(o[s],t,a,n);i.set(parseInt(s),l)}}return i}(o,new n.TextureLoader(this.manager).setPath(a),w,h),h),M=function(e,t){var r={},a={};if("Deformer"in e.Objects){var n=e.Objects.Deformer;for(var i in n){var o=n[i],u=t.get(parseInt(i));if("Skin"===o.attrType){var c=s(u,n);c.ID=i,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),c.geometryID=u.parents[0].ID,r[i]=c}else if("BlendShape"===o.attrType){var d={id:i};d.rawTargets=l(u,o,n,t),d.id=i,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),d.parentGeoID=u.parents[0].ID,a[i]=d}}}return{skeletons:r,morphTargets:a}}(o,h),T=function(e,t,r){var a=new Map;if("Geometry"in e.Objects){var n=e.Objects.Geometry;for(var i in n){var o=t.get(parseInt(i)),s=u(e,o,n[i],r);a.set(parseInt(i),s)}}return a}(o,h,M);return function(e,t,r,a,i){var o=new n.Group,s=function(e,t,r,a,i){var o=new Map,s=e.Objects.Model;for(var l in s){var u=parseInt(l),c=s[l],d=i.get(u),f=p(d,t,u,c.attrName);if(!f){switch(c.attrType){case"Camera":f=m(e,d);break;case"Light":f=v(e,d);break;case"Mesh":f=g(e,d,r,a);break;case"NurbsCurve":f=y(d,r);break;case"LimbNode":case"Null":default:f=new n.Group}f.name=n.PropertyBinding.sanitizeNodeName(c.attrName),f.ID=u}x(e,f,c),o.set(u,f)}return o}(e,r,a,i,t),l=e.Objects.Model;return s.forEach((function(r){var a=l[r.ID];!function(e,t,r,a,i){if("LookAtProperty"in r){a.get(t.ID).children.forEach((function(r){if("LookAtProperty"===r.relationship){var a=e.Objects.Model[r.ID];if("Lcl_Translation"in a){var o=a.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(o),i.add(t.target)):t.lookAt((new n.Vector3).fromArray(o))}}}))}}(e,r,a,t,o),t.get(r.ID).parents.forEach((function(e){var t=s.get(e.ID);void 0!==t&&t.add(r)})),null===r.parent&&o.add(r)})),function(e,t,r,a,i){var o=function(e){var t={};if("Pose"in e.Objects){var r=e.Objects.Pose;for(var a in r)if("BindPose"===r[a].attrType){var i=r[a].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new n.Matrix4).fromArray(e.Matrix.a)})):t[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return t}(e);for(var s in t){var l=t[s];i.get(parseInt(l.ID)).parents.forEach((function(e){if(r.has(e.ID)){var t=e.ID;i.get(t).parents.forEach((function(e){a.has(e.ID)&&a.get(e.ID).bind(new n.Skeleton(l.bones),o[e.ID])}))}}))}}(e,r,a,s,t),function(e,t,r){r.animations=[];var a=function(e,t){if(void 0===e.Objects.AnimationCurve)return;var r=function(e){var t=e.Objects.AnimationCurveNode,r=new Map;for(var a in t){var n=t[a];if(null!==n.attrName.match(/S|R|T/)){var i={id:n.id,attr:n.attrName,curves:{}};r.set(i.id,i)}}return r}(e);!function(e,t,r){var a=e.Objects.AnimationCurve;for(var n in a){var i={id:a[n].id,times:a[n].KeyTime.a.map(L),values:a[n].KeyValueFloat.a},o=t.get(i.id);if(void 0!==o){var s=o.parents[0].ID,l=o.parents[0].relationship;l.match(/X/)?r.get(s).curves.x=i:l.match(/Y/)?r.get(s).curves.y=i:l.match(/Z/)&&(r.get(s).curves.z=i)}}}(e,t,r);var a=function(e,t,r){var a=e.Objects.AnimationLayer,i=new Map;for(var o in a){var s=[],l=t.get(parseInt(o));if(void 0!==l)l.children.forEach((function(a,i){if(r.has(a.ID)){var o=r.get(a.ID);if(void 0!==o.curves.x||void 0!==o.curves.y||void 0!==o.curves.z){if(void 0===s[i]){var l;t.get(a.ID).parents.forEach((function(e){void 0!==e.relationship&&(l=e.ID)}));var u=e.Objects.Model[l.toString()],c={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};"Lcl_Translation"in u&&(c.initialPosition=u.Lcl_Translation.value),"Lcl_Rotation"in u&&(c.initialRotation=u.Lcl_Rotation.value),"Lcl_Scaling"in u&&(c.initialScale=u.Lcl_Scaling.value),"PreRotation"in u&&(c.preRotations=u.PreRotation.value),s[i]=c}s[i][o.attr]=o}}})),i.set(parseInt(o),s)}return i}(e,t,r);return function(e,t,r){var a=e.Objects.AnimationStack,n={};for(var i in a){var o=t.get(parseInt(i)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=r.get(o[0].ID);n[i]={name:a[i].attrName,layer:s}}return n}(e,t,a)}(e,t);if(void 0===a)return;for(var i in a){var o=b(a[i]);r.animations.push(o)}}(e,t,o),function(e,t){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var r=e.GlobalSettings.AmbientColor.value,a=r[0],i=r[1],o=r[2];if(0!==a||0!==i||0!==o){var s=new n.Color(a,i,o);t.add(new n.AmbientLight(s,1))}}}(e,o),o}(o,h,M.skeletons,T,A)}});var f=[];function h(e,t,r,a){var n;switch(a.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=r;break;case"AllSame":n=a.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+a.mappingType)}"IndexToDirect"===a.referenceType&&(n=a.indices[n]);var i=n*a.dataSize,o=i+a.dataSize;return function(e,t,r,a){for(var n=r,i=0;n1?s=l:l.length>0?s=l[0]:(s=new n.MeshPhongMaterial({color:13421772}),l.push(s)),"color"in o.attributes&&l.forEach((function(e){e.vertexColors=n.VertexColors})),o.FBX_Deformer?(l.forEach((function(e){e.skinning=!0})),i=new n.SkinnedMesh(o,s)):i=new n.Mesh(o,s),i}function y(e,t){var r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),a=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,a)}function x(e,t,r){if("RotationOrder"in r){var a=parseInt(r.RotationOrder.value,10);a>0&&a<6?console.warn("THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.",["XYZ","XZY","YZX","ZXY","YXZ","ZYX","SphericXYZ"][a]):6===a&&console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.")}if("Lcl_Translation"in r&&t.position.fromArray(r.Lcl_Translation.value),"Lcl_Rotation"in r){var i=r.Lcl_Rotation.value.map(n.Math.degToRad);i.push("ZYX"),t.quaternion.setFromEuler((new n.Euler).fromArray(i))}if("Lcl_Scaling"in r&&t.scale.fromArray(r.Lcl_Scaling.value),"PreRotation"in r){var o=r.PreRotation.value.map(n.Math.degToRad);o[3]="ZYX";var s=(new n.Euler).fromArray(o);s=(new n.Quaternion).setFromEuler(s),t.quaternion.premultiply(s)}}function b(e){var t=[];return e.layer.forEach((function(e){t=t.concat(function(e){var t=[];if(void 0!==e.T&&Object.keys(e.T.curves).length>0){var r=w(e.modelName,e.T.curves,e.initialPosition,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=function(e,t,r,a){void 0!==t.x&&(T(t.x),t.x.values=t.x.values.map(n.Math.degToRad));void 0!==t.y&&(T(t.y),t.y.values=t.y.values.map(n.Math.degToRad));void 0!==t.z&&(T(t.z),t.z.values=t.z.values.map(n.Math.degToRad));var i=M(t),o=A(i,t,r);void 0!==a&&((a=a.map(n.Math.degToRad)).push("ZYX"),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a));for(var s=new n.Quaternion,l=new n.Euler,u=[],c=0;c0){var i=w(e.modelName,e.S.curves,e.initialScale,"scale");void 0!==i&&t.push(i)}return t}(e))})),new n.AnimationClip(e.name,-1,t)}function w(e,t,r,a){var i=M(t),o=A(i,t,r);return new n.VectorKeyframeTrack(e+"."+a,i,o)}function A(e,t,r){var a=r,n=[],i=-1,o=-1,s=-1;return e.forEach((function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(s=t.z.times.indexOf(e)),-1!==i){var r=t.x.values[i];n.push(r),a[0]=r}else n.push(a[0]);if(-1!==o){var l=t.y.values[o];n.push(l),a[1]=l}else n.push(a[1]);if(-1!==s){var u=t.z.values[s];n.push(u),a[2]=u}else n.push(a[2])})),n}function M(e){var t=[];return void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})).filter((function(e,t,r){return r.indexOf(e)==t}))}function T(e){for(var t=1;t=180){for(var i=n/180,o=a/i,s=r+o,l=e.times[t-1],u=(e.times[t]-l)/i,c=l+u,d=[],f=[];c1&&(r=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:r,type:a}},parseNodeProperty:function(e,t,r){var a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===a&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());var i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===a){var o=n.split(",").slice(1),s=parseInt(o[0]),l=parseInt(o[1]),u=n.split(",").slice(3);a="connections",function(e,t){for(var r=0,a=e.length,n=t.length;r=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var r={},a=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32(),i=(t>=7500?e.getUint64():e.getUint32(),e.getUint8()),o=e.getString(i);if(0===a)return null;for(var s=[],l=0;l0?s[0]:"",c=s.length>1?s[1]:"",d=s.length>2?s[2]:"";for(r.singleProperty=1===n&&e.getOffset()===a;a>e.getOffset();){var f=this.parseNode(e,t);null!==f&&this.parseSubNode(o,r,f)}return r.propertyList=s,"number"==typeof u&&(r.id=u),""!==c&&(r.attrName=c),""!==d&&(r.attrType=d),""!==o&&(r.name=o),r},parseSubNode:function(e,t,r){if(!0===r.singleProperty){var a=r.propertyList[0];Array.isArray(a)?(t[r.name]=r,r.a=a):t[r.name]=a}else if("Connections"===e&&"C"===r.name){var n=[];r.propertyList.forEach((function(e,t){0!==t&&n.push(e)})),void 0===t.connections&&(t.connections=[]),t.connections.push(n)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){var i,o=r.propertyList[0],s=r.propertyList[1],l=r.propertyList[2],u=r.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),i="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[o]={type:s,type2:l,flag:u,value:i}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var r=e.getUint32();return e.getArrayBuffer(r);case"S":r=e.getUint32();return e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var a=e.getUint32(),n=e.getUint32(),i=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}void 0===window.Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var o=new _(new Zlib.Inflate(new Uint8Array(e.getArrayBuffer(i))).decompress().buffer);switch(t){case"b":case"c":return o.getBooleanArray(a);case"d":return o.getFloat64Array(a);case"f":return o.getFloat32Array(a);case"i":return o.getInt32Array(a);case"l":return o.getInt64Array(a)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}),Object.assign(_.prototype,{getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],r=0;r=0&&(t=t.slice(0,a)),n.LoaderUtils.decodeText(t)}}),Object.assign(F.prototype,{add:function(e,t){this[e]=t}}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.splitLayer=!1};n.prototype.load=function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},n.prototype.parse=function(e){var t={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},r=[],n=void 0,i=new a.LineBasicMaterial({color:16711680});i.name="path";var o=new a.LineBasicMaterial({color:65280});function s(e){n={vertex:[],pathVertex:[],z:e.z},r.push(n)}function l(e,r){return t.relative?r:r-e}function u(e,r){return t.relative?e+r:r}o.name="extruded";for(var c,d,f=e.replace(/;.+/g,"").split("\n"),h=0;h0&&(g.extruding=l(t.e,g.e)>0,null!=n&&g.z==n.z||s(g)),c=t,d=g,void 0===n&&s(c),g.extruding?(n.vertex.push(c.x,c.y,c.z),n.vertex.push(d.x,d.y,d.z)):(n.pathVertex.push(c.x,c.y,c.z),n.pathVertex.push(d.x,d.y,d.z)),t=g}else if("G2"===m||"G3"===m)console.warn("THREE.GCodeLoader: Arc command not supported");else if("G90"===m)t.relative=!1;else if("G91"===m)t.relative=!0;else if("G92"===m){(g=t).x=void 0!==v.x?v.x:g.x,g.y=void 0!==v.y?v.y:g.y,g.z=void 0!==v.z?v.z:g.z,g.e=void 0!==v.e?v.e:g.e,t=g}else console.warn("THREE.GCodeLoader: Command not supported:"+m)}function y(e,t){var r=new a.BufferGeometry;r.addAttribute("position",new a.Float32BufferAttribute(e,3));var n=new a.LineSegments(r,t?o:i);n.name="layer"+h,x.add(n)}var x=new a.Group;if(x.name="gcode",this.splitLayer)for(h=0;h>16&32768,i=a>>12&2047,o=a>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&a):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)}return function(e,t,a,n){var i=e[t+3],o=Math.pow(2,i-128)/255;a[n+0]=r(e[t+0]*o),a[n+1]=r(e[t+1]*o),a[n+2]=r(e[t+2]*o)}}(),l=new n.CubeTexture;l.type=e,l.encoding=e===n.UnsignedByteType?n.RGBEEncoding:n.LinearEncoding,l.format=e===n.UnsignedByteType?n.RGBAFormat:n.RGBFormat,l.minFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.magFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.generateMipmaps=l.encoding!==n.RGBEEncoding,l.anisotropy=0;var u=this.hdrLoader,c=0;function d(r,a,i,d){var f=new n.FileLoader(this.manager);f.setResponseType("arraybuffer"),f.load(t[r],(function(t){c++;var i=u._parser(t);if(i){if(e===n.FloatType){for(var d=i.data.length/4*3,f=new Float32Array(d),h=0;h>8&65280|e>>24&255},e.prototype.mipmaps=function(t){for(var r=[],a=e.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight,o=t?this.numberOfMipmapLevels:1,s=0;s0?o():t(n.mergeVmds(i))}),r,a)}()},s.prototype.loadAudio=function(e,t,r,n){var i=new a.AudioListener,o=new a.Audio(i);new a.AudioLoader(this.manager).load(e,(function(e){o.setBuffer(e),t(o,i)}),r,n)},s.prototype.loadVpd=function(e,t,r,a,n){var i=this;(n&&"unicode"===n.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this)(e,(function(e){t(i.parseVpd(e))}),r,a)},s.prototype.parseModel=function(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}},s.prototype.parsePmd=function(e){return this.parser.parsePmd(e,!0)},s.prototype.parsePmx=function(e){return this.parser.parsePmx(e,!0)},s.prototype.parseVmd=function(e){return this.parser.parseVmd(e,!0)},s.prototype.parseVpd=function(e){return this.parser.parseVpd(e,!0)},s.prototype.mergeVmds=function(e){return this.parser.mergeVmds(e)},s.prototype.pourVmdIntoModel=function(e,t,r){this.createAnimation(e,t,r)},s.prototype.pourVmdIntoCamera=function(e,t,r){var n=new s.DataCreationHelper;!function(){for(var i,o,l=n.createOrderedMotionArray(t.cameras),u=[],c=[],d=[],f=[],h=[],p=[],m=[],v=[],g=[],y=new a.Quaternion,x=new a.Euler,b=new a.Vector3,w=new a.Vector3,A=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},M=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},T=function(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();for(var o=n.length/r.length,l=3===o?12:4,u=1,c=2,d=r.length;cu){r[u]=r[c];for(f=0;f=a?r.skinIndices[a]:0);for(a=0;a<4;a++)l.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t=0&&(l.limitation=new a.Vector3(1,0,0)),s.links.push(l)}t.push(s)}else for(r=0;r=0?c:u);var p=h.load(s,(function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,n=t.height;d.width=r,d.height=n,f.clearRect(0,0,r,n),f.translate(r/2,n/2),f.rotate(.5*Math.PI),f.translate(-r/2,-n/2),f.drawImage(t,0,0),e.image=f.getImageData(0,0,r,n)}e.flipY=!1,e.wrapS=a.RepeatWrapping,e.wrapT=a.RepeatWrapping;for(var i=0;i=0?(w.push(b.slice(0,A)),w.push(b.slice(A+1))):w.push(b);for(var M=0;M=0||T.indexOf(".spa")>=0?(x.envMap=m(T,{sphericalReflectionMapping:!0}),T.indexOf(".sph")>=0?x.envMapType=a.MultiplyOperation:x.envMapType=a.AddOperation):x.map=m(T)}}}else{if(-1!==y.textureIndex){var T=e.textures[y.textureIndex];x.map=m(T)}if(-1!==y.envTextureIndex&&(1===y.envFlag||2==y.envFlag)){T=e.textures[y.envTextureIndex];x.envMap=m(T,{sphericalReflectionMapping:!0}),1===y.envFlag?x.envMapType=a.MultiplyOperation:x.envMapType=a.AddOperation}}var S=void 0===x.map?1:.2;x.emissive=new a.Color(y.ambient[0]*S,y.ambient[1]*S,y.ambient[2]*S),p.push(x)}for(g=0;g0,y.morphTargets=o.morphTargets.length>0,y.lights=!0,y.side="pmx"===e.metadata.format&&1==(1&_.flag)?a.DoubleSide:E.side,y.transparent=E.transparent,y.fog=!0,y.blending=a.CustomBlending,y.blendSrc=a.SrcAlphaFactor,y.blendDst=a.OneMinusSrcAlphaFactor,y.blendSrcAlpha=a.SrcAlphaFactor,y.blendDstAlpha=a.DstAlphaFactor,void 0!==E.map){y.faceOffset=E.faceOffset,y.faceNum=E.faceNum,y.map=v(E.map,l),function(e){e.map.readyCallbacks.push((function(t){function r(e,t){var r=e.width,a=e.height,n=Math.round(t.x*r)%r,i=Math.round(t.y*a)%a;n<0&&(n+=r),i<0&&(i+=a);var o=i*r+n;return e.data[4*o+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),n=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var n=e.width,i=e.height;if(e.data.length/(n*i)!=4)return!1;for(var o=0;o=this.duration;)this.currentTime-=this.duration;return!(this.currentTime=this.duration}},a.MMDGrantSolver=function(e){this.mesh=e},a.MMDGrantSolver.prototype={constructor:a.MMDGrantSolver,update:(o=new a.Quaternion,function(){for(var e=0;e0)}},setAnimations:function(){for(var e=0;e0&&0!==e.action._clip.tracks[0].name.indexOf(".bones")||(e.target._root.looped=!0)}));for(var t=!1,r=!1,n=0;n0&&0===i.tracks[0].name.indexOf(".morphTargetInfluences")?r||(o.play(),r=!0):t||(o.play(),t=!0)}t&&(e.ikSolver=new a.CCDIKSolver(e),void 0!==e.geometry.grants&&(e.grantSolver=new a.MMDGrantSolver(e)))}},setCameraAnimation:function(e){void 0!==e.animations&&(e.mixer=new a.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())},unifyAnimationDuration:function(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,n=0;n0,i=!0,s={};var l=function(e,n){null==n&&(n=1);var o=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,o=2;break;case"sshort":s=Int16Array,o=2;break;case"uint":s=Uint32Array,o=4;break;case"sint":s=Int32Array,o=4;break;case"float":s=Float32Array,o=4;break;case"complex":case"double":s=Float64Array,o=8}var l=new s(t.slice(r,r+=n*o));return a!=i&&(l=function(e,t){for(var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=0;ai;n--,i++){var o=r[i];r[i]=r[n],r[n]=o}return e}(l,o)),1==n?l[0]:l}("uchar",e.byteLength),u=l.length,c=null,d=0;for(p=1;p13)&&32!==a?n+=String.fromCharCode(a):(""!==n&&(l[u]=c(n,o),u++),n="");return""!==n&&(l[u]=c(n,o),u++),l}(t);else if("raw"===s.encoding){for(var h=new Uint8Array(t.length),p=0;p0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,n=this.object.geometry.vertices;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){var a=this.normals,n=this.object.geometry.normals;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addColor:function(e,t,r){var a=this.colors,n=this.object.geometry.colors;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addUV:function(e,t,r){var a=this.uvs,n=this.object.geometry.uvs;n.push(a[e+0],a[e+1]),n.push(a[t+0],a[t+1]),n.push(a[r+0],a[r+1])},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,a,n,i,o,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),d=this.parseVertexIndex(t,u),f=this.parseVertexIndex(r,u);if(this.addVertex(c,d,f),void 0!==a&&""!==a){var h=this.uvs.length;c=this.parseUVIndex(a,h),d=this.parseUVIndex(n,h),f=this.parseUVIndex(i,h),this.addUV(c,d,f)}if(void 0!==o&&""!==o){var p=this.normals.length;c=this.parseNormalIndex(o,p),d=o===s?c:this.parseNormalIndex(s,p),f=o===l?c:this.parseNormalIndex(l,p),this.addNormal(c,d,f)}this.colors.length>0&&this.addColor(c,d,f)},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,r=0,a=e.length;r0){var b=x.split("/");v.push(b)}}var w=v[0];for(g=1,y=v.length-1;g1){var O=c[1].trim().toLowerCase();o.object.smooth="0"!==O&&"off"!==O}else o.object.smooth=!0;(Y=o.object.currentMaterial())&&(Y.smooth=o.object.smooth)}o.finalize();var N=new a.Group;N.materialLibraries=[].concat(o.materialLibraries);for(f=0,h=o.objects.length;f0?j.addAttribute("normal",new a.Float32BufferAttribute(R.normals,3)):j.computeVertexNormals(),R.colors.length>0&&(B=!0,j.addAttribute("color",new a.Float32BufferAttribute(R.colors,3))),R.uvs.length>0&&j.addAttribute("uv",new a.Float32BufferAttribute(R.uvs,2));for(var V,G=[],z=0,X=U.length;z1){for(z=0,X=U.length;zd){d=f;var r='Download of "'+e.url+'": '+(100*f).toFixed(2)+"%";u.onProgress("progressLoad",r,f)}}}var h=new a.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.load(e.url,c,i,o)}},r.prototype.run=function(e,r){this._applyPrepData(e);var a=e.checkResourceDescriptorFiles(e.resources,[{ext:"obj",type:"ArrayBuffer",ignore:!1},{ext:"mtl",type:"String",ignore:!1},{ext:"zip",type:"String",ignore:!0}]);t.isValid(r)&&(this.terminateWorkerOnLoad=!1,this.workerSupport=r,this.logging.enabled=this.workerSupport.logging.enabled,this.logging.debug=this.workerSupport.logging.debug);var n=this;this._loadMtl(a.mtl,(function(t){null!==t&&n.meshBuilder.setMaterials(t),n._loadObj(a.obj,n.callbacks.onLoad,null,null,n.callbacks.onMeshAlter,e.useAsync)}),e.crossOrigin,e.materialOptions)},r.prototype._applyPrepData=function(e){t.isValid(e)&&(this.setLogging(e.logging.enabled,e.logging.debug),this.setModelName(e.modelName),this.setStreamMeshesTo(e.streamMeshesTo),this.meshBuilder.setMaterials(e.materials),this.setUseIndices(e.useIndices),this.setDisregardNormals(e.disregardNormals),this.setMaterialPerSmoothingGroup(e.materialPerSmoothingGroup),this._setCallbacks(e.getCallbacks()))},r.prototype.parse=function(e){if(!t.isValid(e))return console.warn("Provided content is not a valid ArrayBuffer or String."),this.loaderRootNode;this.logging.enabled&&console.time("OBJLoader2 parse: "+this.modelName),this.meshBuilder.init();var r=new o;r.setLogging(this.logging.enabled,this.logging.debug),r.setMaterialPerSmoothingGroup(this.materialPerSmoothingGroup),r.setUseIndices(this.useIndices),r.setDisregardNormals(this.disregardNormals),r.setMaterials(this.meshBuilder.getMaterials());var a=this;r.setCallbackMeshBuilder((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}));if(r.setCallbackProgress((function(e,t){a.onProgress("progressParse",e,t)})),e instanceof ArrayBuffer||e instanceof Uint8Array)this.logging.enabled&&console.info("Parsing arrayBuffer..."),r.parse(e);else{if(!("string"==typeof e||e instanceof String))throw"Provided content was neither of type String nor Uint8Array! Aborting...";this.logging.enabled&&console.info("Parsing text..."),r.parseText(e)}return this.logging.enabled&&console.timeEnd("OBJLoader2 parse: "+this.modelName),this.loaderRootNode},r.prototype.parseAsync=function(e,r){var a=this,n=!1,i=function(){r({detail:{loaderRootNode:a.loaderRootNode,modelName:a.modelName,instanceNo:a.instanceNo}}),n&&a.logging.enabled&&console.timeEnd("OBJLoader2 parseAsync: "+a.modelName)};t.isValid(e)?n=!0:(console.warn("Provided content is not a valid ArrayBuffer."),i()),n&&this.logging.enabled&&console.time("OBJLoader2 parseAsync: "+this.modelName),this.meshBuilder.init();this.workerSupport.validate((function(e,r){var a="";return a+="/**\n",a+=" * This code was constructed by OBJLoader2 buildCode.\n",a+=" */\n\n",a+="THREE = { LoaderSupport: {} };\n\n",a+=e("LoaderSupport.Validator",t),a+=r("Parser",o)}),"Parser"),this.workerSupport.setCallbacks((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}),i),a.terminateWorkerOnLoad&&this.workerSupport.setTerminateRequested(!0);var s={},l=this.meshBuilder.getMaterials();for(var u in l)s[u]=u;this.workerSupport.run({params:{useAsync:!0,materialPerSmoothingGroup:this.materialPerSmoothingGroup,useIndices:this.useIndices,disregardNormals:this.disregardNormals},logging:{enabled:this.logging.enabled,debug:this.logging.debug},materials:{materials:s},data:{input:e,options:null}})};var o=function(){function e(){this.callbackProgress=null,this.callbackMeshBuilder=null,this.contentRef=null,this.legacyMode=!1,this.materials={},this.useAsync=!1,this.materialPerSmoothingGroup=!1,this.useIndices=!1,this.disregardNormals=!1,this.vertices=[],this.colors=[],this.normals=[],this.uvs=[],this.rawMesh={objectName:"",groupName:"",activeMtlName:"",mtllibName:"",faceType:-1,subGroups:[],subGroupInUse:null,smoothingGroup:{splitMaterials:!1,normalized:-1,real:-1},counts:{doubleIndicesCount:0,faceCount:0,mtlCount:0,smoothingGroupCount:0}},this.inputObjectCount=1,this.outputObjectCount=1,this.globalCounts={vertices:0,faces:0,doubleIndicesCount:0,lineByte:0,currentByte:0,totalBytes:0},this.logging={enabled:!0,debug:!1}}return e.prototype.resetRawMesh=function(){this.rawMesh.subGroups=[],this.rawMesh.subGroupInUse=null,this.rawMesh.smoothingGroup.normalized=-1,this.rawMesh.smoothingGroup.real=-1,this.pushSmoothingGroup(1),this.rawMesh.counts.doubleIndicesCount=0,this.rawMesh.counts.faceCount=0,this.rawMesh.counts.mtlCount=0,this.rawMesh.counts.smoothingGroupCount=0},e.prototype.setUseAsync=function(e){this.useAsync=e},e.prototype.setMaterialPerSmoothingGroup=function(e){this.materialPerSmoothingGroup=e},e.prototype.setUseIndices=function(e){this.useIndices=e},e.prototype.setDisregardNormals=function(e){this.disregardNormals=e},e.prototype.setMaterials=function(e){this.materials=n.default.Validator.verifyInput(e,this.materials),this.materials=n.default.Validator.verifyInput(this.materials,{})},e.prototype.setCallbackMeshBuilder=function(e){if(!n.default.Validator.isValid(e))throw'Unable to run as no "MeshBuilder" callback is set.';this.callbackMeshBuilder=e},e.prototype.setCallbackProgress=function(e){this.callbackProgress=e},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.configure=function(){if(this.pushSmoothingGroup(1),this.logging.enabled){var e=Object.keys(this.materials),t="OBJLoader2.Parser configuration:"+(e.length>0?"\n\tmaterialNames:\n\t\t- "+e.join("\n\t\t- "):"\n\tmaterialNames: None")+"\n\tuseAsync: "+this.useAsync+"\n\tmaterialPerSmoothingGroup: "+this.materialPerSmoothingGroup+"\n\tuseIndices: "+this.useIndices+"\n\tdisregardNormals: "+this.disregardNormals+"\n\tcallbackMeshBuilderName: "+this.callbackMeshBuilder.name+"\n\tcallbackProgressName: "+this.callbackProgress.name;console.info(t)}},e.prototype.parse=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parse"),this.configure();var t=new Uint8Array(e);this.contentRef=t;var r=t.byteLength;this.globalCounts.totalBytes=r;for(var a,n=new Array(128),i="",o=0,s=0,l=0;l0&&(n[o++]=i),i="";break;case 47:i.length>0&&(n[o++]=i),s++,i="";break;case 10:i.length>0&&(n[o++]=i),i="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=l,this.processLine(n,o,s),o=0,s=0;break;case 13:break;default:i+=String.fromCharCode(a)}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parse")},e.prototype.parseText=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parseText"),this.configure(),this.legacyMode=!0,this.contentRef=e;var t=e.length;this.globalCounts.totalBytes=t;for(var r,a=new Array(128),n="",i=0,o=0,s=0;s0&&(a[i++]=n),n="";break;case"/":n.length>0&&(a[i++]=n),o++,n="";break;case"\n":n.length>0&&(a[i++]=n),n="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=s,this.processLine(a,i,o),i=0,o=0;break;case"\r":break;default:n+=r}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parseText")},e.prototype.processLine=function(e,t,r){if(!(t<1)){var a,n,i,o,s=function(e,t,r,a){var n="";if(a>r){var i;if(t)for(i=r;i4&&(this.colors.push(parseFloat(e[4])),this.colors.push(parseFloat(e[5])),this.colors.push(parseFloat(e[6])));break;case"vt":this.uvs.push(parseFloat(e[1])),this.uvs.push(parseFloat(e[2]));break;case"vn":this.normals.push(parseFloat(e[1])),this.normals.push(parseFloat(e[2])),this.normals.push(parseFloat(e[3]));break;case"f":if(a=t-1,0===r)for(this.checkFaceType(0),i=2,n=a;i0?n-1:n+a.vertices.length/3),o=a.rawMesh.subGroupInUse.vertices;o.push(a.vertices[i++]),o.push(a.vertices[i++]),o.push(a.vertices[i]);var s=a.colors.length>0?i:null;if(null!==s){var l=a.rawMesh.subGroupInUse.colors;l.push(a.colors[s++]),l.push(a.colors[s++]),l.push(a.colors[s])}if(t){var u=parseInt(t),c=2*(u>0?u-1:u+a.uvs.length/2),d=a.rawMesh.subGroupInUse.uvs;d.push(a.uvs[c++]),d.push(a.uvs[c])}if(r){var f=parseInt(r),h=3*(f>0?f-1:f+a.normals.length/3),p=a.rawMesh.subGroupInUse.normals;p.push(a.normals[h++]),p.push(a.normals[h++]),p.push(a.normals[h])}};if(this.useIndices){var o=e+(t?"_"+t:"_n")+(r?"_"+r:"_n"),s=this.rawMesh.subGroupInUse.indexMappings[o];n.default.Validator.isValid(s)?this.rawMesh.counts.doubleIndicesCount++:(s=this.rawMesh.subGroupInUse.vertices.length/3,i(),this.rawMesh.subGroupInUse.indexMappings[o]=s,this.rawMesh.subGroupInUse.indexMappingsCount++),this.rawMesh.subGroupInUse.indices.push(s)}else i();this.rawMesh.counts.faceCount++},e.prototype.createRawMeshReport=function(e){return"Input Object number: "+e+"\n\tObject name: "+this.rawMesh.objectName+"\n\tGroup name: "+this.rawMesh.groupName+"\n\tMtllib name: "+this.rawMesh.mtllibName+"\n\tVertex count: "+this.vertices.length/3+"\n\tNormal count: "+this.normals.length/3+"\n\tUV count: "+this.uvs.length/2+"\n\tSmoothingGroup count: "+this.rawMesh.counts.smoothingGroupCount+"\n\tMaterial count: "+this.rawMesh.counts.mtlCount+"\n\tReal MeshOutputGroup count: "+this.rawMesh.subGroups.length},e.prototype.finalizeRawMesh=function(){var e,t,r=[],a=0,n=0,i=0,o=0,s=0,l=0;for(var u in this.rawMesh.subGroups)if((e=this.rawMesh.subGroups[u]).vertices.length>0){if((t=e.indices).length>0&&n>0)for(var c in t)t[c]=t[c]+n;r.push(e),a+=e.vertices.length,n+=e.indexMappingsCount,i+=e.indices.length,o+=e.colors.length,l+=e.uvs.length,s+=e.normals.length}var d=null;return r.length>0&&(d={name:""!==this.rawMesh.groupName?this.rawMesh.groupName:this.rawMesh.objectName,subGroups:r,absoluteVertexCount:a,absoluteIndexCount:i,absoluteColorCount:o,absoluteNormalCount:s,absoluteUvCount:l,faceCount:this.rawMesh.counts.faceCount,doubleIndicesCount:this.rawMesh.counts.doubleIndicesCount}),d},e.prototype.processCompletedMesh=function(){var e=this.finalizeRawMesh();if(n.default.Validator.isValid(e)){if(this.colors.length>0&&this.colors.length!==this.vertices.length)throw"Vertex Colors were detected, but vertex count and color count do not match!";this.logging.enabled&&this.logging.debug&&console.debug(this.createRawMeshReport(this.inputObjectCount)),this.inputObjectCount++,this.buildMesh(e);var t=this.globalCounts.currentByte/this.globalCounts.totalBytes;return this.callbackProgress("Completed [o: "+this.rawMesh.objectName+" g:"+this.rawMesh.groupName+"] Total progress: "+(100*t).toFixed(2)+"%",t),this.resetRawMesh(),!0}return!1},e.prototype.buildMesh=function(e){var t=e.subGroups,r=new Float32Array(e.absoluteVertexCount);this.globalCounts.vertices+=e.absoluteVertexCount/3,this.globalCounts.faces+=e.faceCount,this.globalCounts.doubleIndicesCount+=e.doubleIndicesCount;var a,i,o,s,l,u,c,d=e.absoluteIndexCount>0?new Uint32Array(e.absoluteIndexCount):null,f=e.absoluteColorCount>0?new Float32Array(e.absoluteColorCount):null,h=e.absoluteNormalCount>0?new Float32Array(e.absoluteNormalCount):null,p=e.absoluteUvCount>0?new Float32Array(e.absoluteUvCount):null,m=n.default.Validator.isValid(f),v=[],g=t.length>1,y=0,x=[],b=[],w=0,A=0,M=0,T=0,S=0,E=0,_=0;for(var F in t)if(t.hasOwnProperty(F)){if(c=(a=t[F]).materialName,u=this.rawMesh.faceType<4?c+(m?"_vertexColor":"")+(0===a.smoothingGroup?"_flat":""):6===this.rawMesh.faceType?"defaultPointMaterial":"defaultLineMaterial",s=this.materials[c],l=this.materials[u],!n.default.Validator.isValid(s)&&!n.default.Validator.isValid(l)){var P=m?"defaultVertexColorMaterial":"defaultMaterial";s=this.materials[P],this.logging.enabled&&console.warn('object_group "'+a.objectName+"_"+a.groupName+'" was defined with unresolvable material "'+c+'"! Assigning "'+P+'".'),(c=P)===u&&(l=s,u=P)}if(!n.default.Validator.isValid(l)){var L={materialNameOrg:c,materialName:u,materialProperties:{vertexColors:m?2:0,flatShading:0===a.smoothingGroup}},C={cmd:"materialData",materials:{materialCloneInstructions:L}};this.callbackMeshBuilder(C),this.useAsync&&(this.materials[u]=L)}if(g?((i=x[u])||(i=y,x[u]=y,v.push(u),y++),o={start:E,count:_=this.useIndices?a.indices.length:a.vertices.length/3,index:i},b.push(o),E+=_):v.push(u),r.set(a.vertices,w),w+=a.vertices.length,d&&(d.set(a.indices,A),A+=a.indices.length),f&&(f.set(a.colors,M),M+=a.colors.length),h&&(h.set(a.normals,T),T+=a.normals.length),p&&(p.set(a.uvs,S),S+=a.uvs.length),this.logging.enabled&&this.logging.debug){var O=n.default.Validator.isValid(i)?"\n\t\tmaterialIndex: "+i:"",N="\tOutput Object no.: "+this.outputObjectCount+"\n\t\tgroupName: "+a.groupName+"\n\t\tIndex: "+a.index+"\n\t\tfaceType: "+this.rawMesh.faceType+"\n\t\tmaterialName: "+a.materialName+"\n\t\tsmoothingGroup: "+a.smoothingGroup+O+"\n\t\tobjectName: "+a.objectName+"\n\t\t#vertices: "+a.vertices.length/3+"\n\t\t#indices: "+a.indices.length+"\n\t\t#colors: "+a.colors.length/3+"\n\t\t#uvs: "+a.uvs.length/2+"\n\t\t#normals: "+a.normals.length/3;console.debug(N)}}this.outputObjectCount++,this.callbackMeshBuilder({cmd:"meshData",progress:{numericalValue:this.globalCounts.currentByte/this.globalCounts.totalBytes},params:{meshName:e.name},materials:{multiMaterial:g,materialNames:v,materialGroups:b},buffers:{vertices:r,indices:d,colors:f,normals:h,uvs:p},geometryType:this.rawMesh.faceType<4?0:6===this.rawMesh.faceType?2:1},[r.buffer],n.default.Validator.isValid(d)?[d.buffer]:null,n.default.Validator.isValid(f)?[f.buffer]:null,n.default.Validator.isValid(h)?[h.buffer]:null,n.default.Validator.isValid(p)?[p.buffer]:null)},e.prototype.finalizeParsing=function(){if(this.logging.enabled&&console.info("Global output object count: "+this.outputObjectCount),this.processCompletedMesh()&&this.logging.enabled){var e="Overall counts: \n\tVertices: "+this.globalCounts.vertices+"\n\tFaces: "+this.globalCounts.faces+"\n\tMultiple definitions: "+this.globalCounts.doubleIndicesCount;console.info(e)}},e}();return r.prototype.loadMtl=function(e,t,r,a,i){var o=new n.default.ResourceDescriptor(e,"MTL");o.setContent(t),this._loadMtl(o,r,a,i)},r.prototype._loadMtl=function(e,r,n,o){void 0===i.default&&console.error('"THREE.MTLLoader" is not available. "THREE.OBJLoader2" requires it for loading MTL files.'),t.isValid(e)&&this.logging.enabled&&console.time("Loading MTL: "+e.name);var s=[],l=this,u=function(a){var n=[];if(t.isValid(a))for(var i in a.preload(),n=a.materials)n.hasOwnProperty(i)&&(s[i]=n[i]);t.isValid(e)&&l.logging.enabled&&console.timeEnd("Loading MTL: "+e.name),r(s,a)};if(t.isValid(e)&&(t.isValid(e.content)||t.isValid(e.url))){var c=new i.default(this.manager);if(n=t.verifyInput(n,"anonymous"),c.setCrossOrigin(n),c.setPath(e.path),t.isValid(o)&&c.setMaterialOptions(o),t.isValid(e.content))u(t.isValid(e.content)?c.parse(e.content):null);else if(t.isValid(e.url)){new a.FileLoader(this.manager).load(e.url,(function(t){e.content=t,u(c.parse(t))}),this._onProgress,this._onError)}}else u()},r}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.littleEndian=!0};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(e,(function(r){t(i.parse(r,e))}),r,n)},parse:function(e,t){var r=a.LoaderUtils.decodeText(e),n=function(e){var t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),a=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=a[1],t.headerLen=a[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(var n=0,i=t.fields.length;n0&&v.addAttribute("position",new a.Float32BufferAttribute(i,3)),o.length>0&&v.addAttribute("normal",new a.Float32BufferAttribute(o,3)),s.length>0&&v.addAttribute("color",new a.Float32BufferAttribute(s,3)),v.computeBoundingSphere();var g=new a.PointsMaterial({size:.005});s.length>0?g.vertexColors=!0:g.color.setHex(16777215*Math.random());var y=new a.Points(v,g),x=t.split("").reverse().join("");return x=(x=/([^\/]*)/.exec(x))[1].split("").reverse().join(""),y.name=x,y}console.error("THREE.PCDLoader: binary_compressed files are not supported")}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function n(e,t){var r=parseInt(m[v].substr(e,t));if(r){var a=function(e,t){return"s"+Math.min(e,t)+"e"+Math.max(e,t)}(y,r);void 0===p[a]&&(f.push([y-1,r-1,1]),p[a]=f.length-1)}}for(var i,o,s,l,u,c={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},d=[],f=[],h={},p={},m=e.split("\n"),v=0,g=m.length;v=t.elements[u].count&&(u++,c=0);var h=n(t.elements[u].properties,f);s(a,t.elements[u].name,h),c++}}return o(a)}function o(e){var t=new a.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.addAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.addAttribute("normal",new a.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.addAttribute("uv",new a.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.addAttribute("color",new a.Float32BufferAttribute(e.colors,3)),t.computeBoundingSphere(),t}function s(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){var a=r.vertex_indices||r.vertex_index;3===a.length?e.indices.push(a[0],a[1],a[2]):4===a.length&&(e.indices.push(a[0],a[1],a[3]),e.indices.push(a[1],a[2],a[3]))}}function l(e,t,r,a){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,a),2];case"uint16":case"ushort":return[e.getUint16(t,a),2];case"int32":case"int":return[e.getInt32(t,a),4];case"uint32":case"uint":return[e.getUint32(t,a),4];case"float32":case"float":return[e.getFloat32(t,a),4];case"float64":case"double":return[e.getFloat64(t,a),8]}}function u(e,t,r,a){for(var n,i={},o=0,s=0;s>7&1),s=n>>6&1,l=1==(n>>5&1),u=31&n,c=0,d=0;if(l?(c=(t[2]<<16)+(t[3]<<8)+t[4],d=(t[5]<<16)+(t[6]<<8)+t[7]):(c=t[2]+(t[3]<<8)+(t[4]<<16),d=t[5]+(t[6]<<8)+(t[7]<<16)),0===a)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==a)throw new Error("PRWM decoder: Unsupported format version: "+a);if(!o){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==d)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}var f,h,p,m,v,g,y,x,b=8,w={};for(x=0;x>7&1,m=1+(n>>4&3),b++,g=i(e,v=r[15&n],b=4*Math.ceil(b/4),m*c,l),b+=v.BYTES_PER_ELEMENT*m*c,w[f]={type:p,cardinality:m,values:g}}return b=4*Math.ceil(b/4),y=null,o&&(y=i(e,1===s?Uint32Array:Uint16Array,b,d,l)),{version:a,attributes:w,indices:y}}(e),s=Object.keys(o.attributes),l=new a.BufferGeometry;for(n=0;n0;return 25===h?(r=p?a.RGBA_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,t=4):24===h?(r=p?a.RGBA_PVRTC_2BPPV1_Format:a.RGB_PVRTC_2BPPV1_Format,t=2):console.error("THREE.PVRLoader: Unknown PVR format:",h),e.dataPtr=o,e.bpp=t,e.format=r,e.width=l,e.height=s,e.numSurfaces=f,e.numMipmaps=u+1,e.isCubemap=6===f,n._extract(e)},n._extract=function(e){var t,r={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},a=e.buffer,n=e.dataPtr,i=e.bpp,o=e.numSurfaces,s=0,l=0,u=0,c=0,d=0;2===i?(l=8,u=4):(l=4,u=4),t=l*u*i/8,r.mipmaps.length=e.numMipmaps*o;for(var f=0;f>f,p=e.height>>f;(c=h/l)<2&&(c=2),(d=p/u)<2&&(d=2),s=c*d*t;for(var m=0;m>5&31)/31,n=(A>>10&31)/31):(t=o,r=s,n=l)}for(var M=1;M<=3;M++){var T=y+12*M;m.push(c.getFloat32(T,!0)),m.push(c.getFloat32(T+4,!0)),m.push(c.getFloat32(T+8,!0)),v.push(x,b,w),f&&i.push(t,r,n)}}return p.addAttribute("position",new a.BufferAttribute(new Float32Array(m),3)),p.addAttribute("normal",new a.BufferAttribute(new Float32Array(v),3)),f&&(p.addAttribute("color",new a.BufferAttribute(new Float32Array(i),3)),p.hasColors=!0,p.alpha=u),p}(r):function(e){for(var t,r=new a.BufferGeometry,n=/facet([\s\S]*?)endfacet/g,i=0,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+o+o+o,"g"),l=new RegExp("normal"+o+o+o,"g"),u=[],c=[],d=new a.Vector3;null!==(t=n.exec(e));){for(var f=0,h=0,p=t[0];null!==(t=l.exec(p));)d.x=parseFloat(t[1]),d.y=parseFloat(t[2]),d.z=parseFloat(t[3]),h++;for(;null!==(t=s.exec(p));)u.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),c.push(d.x,d.y,d.z),f++;1!==h&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==f&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}return r.addAttribute("position",new a.Float32BufferAttribute(u,3)),r.addAttribute("normal",new a.Float32BufferAttribute(c,3)),r}("string"!=typeof(t=e)?a.LoaderUtils.decodeText(new Uint8Array(t)):t)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e,t,a,n,i,o,s,l){n=n*Math.PI/180,t=Math.abs(t),a=Math.abs(a);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,d=Math.cos(n)*u+Math.sin(n)*c,f=-Math.sin(n)*u+Math.cos(n)*c,h=t*t,p=a*a,m=d*d,v=f*f,g=m/h+v/p;if(g>1){var y=Math.sqrt(g);h=(t*=y)*t,p=(a*=y)*a}var x=h*v+p*m,b=(h*p-x)/x,w=Math.sqrt(Math.max(0,b));i===o&&(w=-w);var A=w*t*f/a,M=-w*a*d/t,T=Math.cos(n)*A-Math.sin(n)*M+(s.x+l.x)/2,S=Math.sin(n)*A+Math.cos(n)*M+(s.y+l.y)/2,E=r(1,0,(d-A)/t,(f-M)/a),_=r((d-A)/t,(f-M)/a,(-d-A)/t,(-f-M)/a)%(2*Math.PI);e.currentPath.absellipse(T,S,t,a,E,E+_,0===o,n)}function r(e,t,r,a){var n=e*r+t*a,i=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+a*a),o=Math.acos(Math.max(-1,Math.min(1,n/i)));return e*a-t*r<0&&(o=-o),o}function n(e,t){return t=Object.assign({},t),e.hasAttribute("fill")&&(t.fill=e.getAttribute("fill")),""!==e.style.fill&&(t.fill=e.style.fill),t}function i(e){return"none"!==e.fill&&"transparent"!==e.fill}function o(e,t){return 2*e-(t-e)}function s(e){for(var t=e.split(/[\s,]+|(?=\s?[+\-])/),r=0;r0){var p=[];for(u=0;u=t.end)return 0;this.position=t.cur;try{var r=this.readChunk(e);return t.cur+=r.size,r.id}catch(e){return this.debugMessage("Unable to read chunk at "+this.position),0}},resetPosition:function(){this.position-=6},readByte:function(e){var t=e.getUint8(this.position,!0);return this.position+=1,t},readFloat:function(e){try{var t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}},readInt:function(e){var t=e.getInt32(this.position,!0);return this.position+=4,t},readShort:function(e){var t=e.getInt16(this.position,!0);return this.position+=2,t},readDWord:function(e){var t=e.getUint32(this.position,!0);return this.position+=4,t},readWord:function(e){var t=e.getUint16(this.position,!0);return this.position+=2,t},readString:function(e,t){for(var r="",a=0;a256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case a:case n:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;var g=!1,y=!1,x=!1;switch(v.image_type){case i:g=!0,y=!0;break;case r:y=!0;break;case o:g=!0;break;case a:break;case s:g=!0,x=!0;break;case n:x=!0}var b=document.createElement("canvas");b.width=v.width,b.height=v.height;var w=b.getContext("2d"),A=w.createImageData(v.width,v.height),M=function(e,t,r,a,n){var i,o,s,l;if(o=r.pixel_size>>3,s=r.width*r.height*o,t&&(l=n.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,c,d;i=new Uint8Array(s);for(var f=0,h=new Uint8Array(o);f>u){default:case f:i=0,s=1,m=t,o=0,p=1,g=r;break;case c:i=0,s=1,m=t,o=r-1,p=-1,g=-1;break;case h:i=t-1,s=-1,m=-1,o=0,p=1,g=r;break;case d:i=t-1,s=-1,m=-1,o=r-1,p=-1,g=-1}if(x)switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s){var l,u,c,d=0,f=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,d++)l=s[d],e[4*(u+f*c)+0]=l,e[4*(u+f*c)+1]=l,e[4*(u+f*c)+2]=l,e[4*(u+f*c)+3]=255}(e,o,p,g,i,s,m,a);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c=0,d=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=2)e[4*(l+d*u)+0]=s[c+0],e[4*(l+d*u)+1]=s[c+0],e[4*(l+d*u)+2]=s[c+0],e[4*(l+d*u)+3]=s[c+1]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s,l){var u,c,d,f=l,h=0,p=v.width;for(d=t;d!==a;d+=r)for(c=n;c!==o;c+=i,h++)u=s[h],e[4*(c+p*d)+3]=255,e[4*(c+p*d)+2]=f[3*u+0],e[4*(c+p*d)+1]=f[3*u+1],e[4*(c+p*d)+0]=f[3*u+2]}(e,o,p,g,i,s,m,a,n);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c,d=0,f=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,d+=2)l=s[d+0]+(s[d+1]<<8),e[4*(u+f*c)+0]=(31744&l)>>7,e[4*(u+f*c)+1]=(992&l)>>2,e[4*(u+f*c)+2]=(31&l)>>3,e[4*(u+f*c)+3]=32768&l?0:255}(e,o,p,g,i,s,m,a);break;case 24:!function(e,t,r,a,n,i,o,s){var l,u,c=0,d=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=3)e[4*(l+d*u)+3]=255,e[4*(l+d*u)+2]=s[c+0],e[4*(l+d*u)+1]=s[c+1],e[4*(l+d*u)+0]=s[c+2]}(e,o,p,g,i,s,m,a);break;case 32:!function(e,t,r,a,n,i,o,s){var l,u,c=0,d=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=4)e[4*(l+d*u)+2]=s[c+0],e[4*(l+d*u)+1]=s[c+1],e[4*(l+d*u)+0]=s[c+2],e[4*(l+d*u)+3]=s[c+3]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}}(A.data,v.width,v.height,M.pixel_data,M.palettes);return w.putImageData(A,0,0),b}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.reversed=!1};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){var t,r=[];e.forEach((function(e){"m"===e.type.toLowerCase()?(t=[e],r.push(t)):"z"!==e.type.toLowerCase()&&t.push(e)}));var a=[];return r.forEach((function(e){var t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};a.push(t);for(var r=e.length-1;r>0;r--){var n=e[r];t={type:n.type};void 0!==n.x2&&void 0!==n.y2?(t.x1=n.x2,t.y1=n.y2,t.x2=n.x1,t.y2=n.y1):void 0!==n.x1&&void 0!==n.y1&&(t.x1=n.x1,t.y1=n.y1),t.x=e[r-1].x,t.y=e[r-1].y,a.push(t)}})),a}return"undefined"==typeof opentype?(console.warn("THREE.TTFLoader: The loader requires opentype.js. Make sure it's included before using the loader."),null):function(e,r){for(var a=Math.round,n={},i=1e5/(72*(e.unitsPerEm||2048)),o=0;o-1;o--){var s=i[o];if(/{.*[{\[]/.test(s))(l=s.split("{").join("{\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);else if(/\].*}/.test(s)){var l;(l=s.split("]").join("]\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l)}if(/}.*}/.test(s))(l=s.split("}").join("}\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);/^\b[^\s]+\b$/.test(s.trim())?(i[o+1]=s+" "+i[o+1].trim(),i.splice(o,1)):s.indexOf("coord")>-1&&s.indexOf("[")<0&&s.indexOf("{")<0&&(i[o]+=" Coordinate {}")}var u=i.shift();return/V1.0/.exec(u)?console.warn("THREE.VRMLLoader: V1.0 not supported yet."):/V2.0/.exec(u)&&function(e,n){var i={},o=/(\b|\-|\+)([\d\.e]+)/,s=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g,l=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g;function u(e,t,r,n,i){for(var o=!0===i?1:-1,s=[],l={},u={},c=0;cu.y:m.y>=l.y&&m.y0)for(var f=0;f0&&this.indexes.push(c),c=[]):c.push(parseInt(i[f])));/]/.exec(t)&&(c.length>0&&this.indexes.push(c),c=[],this.isRecordingFaces=!1,e[this.recordingFieldname]=this.indexes)}else if(this.isRecordingPoints){if("Coordinate"==e.nodeType)for(;null!==(i=l.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2]),z:parseFloat(i[3])},this.points.push(n);if("TextureCoordinate"==e.nodeType)for(;null!==(i=s.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2])},this.points.push(n);/]/.exec(t)&&(this.isRecordingPoints=!1,e.points=this.points)}else if(this.isRecordingAngles){if(i.length>0)for(f=0;f-1&&"PointLight"===o.nodeType&&(o.nodeType="AmbientLight");var c=void 0===o.on||o.on,d=void 0!==o.intensity?o.intensity:1,f=new a.Color;if(o.color&&f.copy(o.color),"AmbientLight"===o.nodeType)(l=new a.AmbientLight(f,d)).visible=c,s.add(l);else if("PointLight"===o.nodeType){var h=0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),(l=new a.PointLight(f,d,h)).visible=c,s.add(l)}else if("SpotLight"===o.nodeType){d=1,h=0;var p=Math.PI/3;c=!0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),void 0!==o.cutOffAngle&&(p=o.cutOffAngle),(l=new a.SpotLight(f,d,h,p,0)).visible=c,s.add(l)}else if("Transform"===o.nodeType||"Group"===o.nodeType){if(l=new a.Object3D,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),void 0!==o.translation){var m=o.translation;l.position.set(m.x,m.y,m.z)}if(void 0!==o.rotation){var v=o.rotation;l.quaternion.setFromAxisAngle(new a.Vector3(v.x,v.y,v.z),v.w)}if(void 0!==o.scale){var g=o.scale;l.scale.set(g.x,g.y,g.z)}s.add(l)}else if("Shape"===o.nodeType)l=new a.Mesh,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),s.add(l);else if("Background"===o.nodeType){var y=2e4,x=new a.SphereBufferGeometry(y,20,20),b=new a.MeshBasicMaterial({fog:!1,side:a.BackSide});if(o.skyColor.length>1)u(x,y,o.skyAngle,o.skyColor,!0),b.vertexColors=a.VertexColors;else{var w=o.skyColor[0];b.color.setRGB(w.r,w.b,w.g)}if(n.add(new a.Mesh(x,b)),void 0!==o.groundColor){y=12e3;var A=new a.SphereBufferGeometry(y,20,20,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),M=new a.MeshBasicMaterial({fog:!1,side:a.BackSide,vertexColors:a.VertexColors});u(A,y,o.groundAngle,o.groundColor,!1),n.add(new a.Mesh(A,M))}}else{if(/geometry/.exec(o.string)){if("Box"===o.nodeType){g=o.size;s.geometry=new a.BoxBufferGeometry(g.x,g.y,g.z)}else if("Cylinder"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.radius,o.radius,o.height);else if("Cone"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.topRadius,o.bottomRadius,o.height);else if("Sphere"===o.nodeType)s.geometry=new a.SphereBufferGeometry(o.radius);else if("IndexedFaceSet"===o.nodeType){var T,S,E,_,F,P=new a.BufferGeometry,L=[],C=[];for(j=0,E=o.children.length;j-1){var O=/DEF\s+([^\s]+)/.exec(V.string)[1];i[O]=L.slice(0)}if(V.string.indexOf("USE")>-1){W=/USE\s+([^\s]+)/.exec(V.string)[1];L=i[W]}}}var N=0;if(o.coordIndex){var I=[],R=[];for(T=new a.Vector3,S=new a.Vector2,j=0,E=o.coordIndex.length;j=3&&N0&&P.addAttribute("uv",new a.Float32BufferAttribute(C,2)),P.computeVertexNormals(),P.computeBoundingSphere(),/DEF/.exec(o.string)&&(P.name=/DEF ([^\s]+)/.exec(o.string)[1],i[P.name]=P),s.geometry=P}return}if(/appearance/.exec(o.string)){for(var j=0;j>1^-(1&c),a[n]=s*(l+o),n+=i}},n.prototype.decompressIndices_=function(e,t,r,a,n){for(var i=0,o=0;o>1,p=e.charCodeAt(u+4)+1>>1,m=e.charCodeAt(u+5)+1>>1;l[s++]=n[0]*(c+h),l[s++]=n[1]*(d+p),l[s++]=n[2]*(f+m),l[s++]=n[0]*h,l[s++]=n[1]*p,l[s++]=n[2]*m}return l},n.prototype.decompressMesh=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],d=u,f=new Float32Array(o*c),h=0;h>1^-(1&d);l[c]+=f,s[t*u+c]=l[c],o[t*u+c]=a[c]*(l[c]+r[c])}},n.prototype.accumulateNormal=function(e,t,r,a,n){var i=a[8*e],o=a[8*e+1],s=a[8*e+2],l=a[8*t],u=a[8*t+1],c=a[8*t+2],d=a[8*r],f=a[8*r+1],h=a[8*r+2];l-=i,d-=i,i=(u-=o)*(h-=s)-(c-=s)*(f-=o),o=c*d-l*h,s=l*f-u*d,n[3*e]+=i,n[3*e+1]+=o,n[3*e+2]+=s,n[3*t]+=i,n[3*t+1]+=o,n[3*t+2]+=s,n[3*r]+=i,n[3*r+1]+=o,n[3*r+2]+=s},n.prototype.decompressMesh2=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],d=t.codeRange[0],f=3*t.codeRange[2],h=new Uint16Array(f),p=new Int32Array(3*c),m=new Uint16Array(o),v=new Uint16Array(o*c),g=new Float32Array(o*c),y=0,x=0,b=0;b>1^-(1&L))+v[o*M+P]+v[o*T+P]-v[o*S+P];m[P]=C,v[o*y+P]=C,g[o*y+P]=l[P]*(C+s[P])}y++}else this.copyAttrib(o,v,m,F);this.accumulateNormal(M,T,F,v,p)}else{var O=y-(w-A);h[x++]=O,w===A?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,O);var N=y-(w=e.charCodeAt(d++));h[x++]=N,0===w?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,N);var I=y-(w=e.charCodeAt(d++));if(h[x++]=I,0===w){for(P=0;P<5;P++)m[P]=(v[o*O+P]+v[o*N+P])/2;this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++)}else this.copyAttrib(o,v,m,I);this.accumulateNormal(O,N,I,v,p)}}for(b=0;b>1^-(1&B)),g[o*b+6]=k*U+(j>>1^-(1&j)),g[o*b+7]=k*D+(V>>1^-(1&V))}i(a,n,g,h,void 0,t)},n.prototype.downloadMesh=function(e,t,r,a,n){var i=this,s=0;o(e,(function(e){!function(e){for(;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=new s(3*d/4-(i="="===e[d-2]?2:"="===e[d-1]?1:0)),a=i>0?d-4:d;var f=0;for(t=0,r=0;t>16,o[f++]=(65280&n)>>8,o[f++]=255&n;return 2===i?(n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[f++]=255&n):1===i&&(n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[f++]=n>>8&255,o[f++]=255&n),o}function n(e,a){var n,i,s,l,u=0;if("UInt64"===o.attributes.header_type?u=8:"UInt32"===o.attributes.header_type&&(u=4),"binary"===e.attributes.format&&a){var c,d,f,h,p,m;if("Float32"===e.attributes.type)var v=new Float32Array;else if("Int64"===e.attributes.type)v=new Int32Array;d=(c=r(e["#text"]))[0];for(var g=1;g0?3-h%3:0,(p=[]).push(m),f=3*u;for(g=0;g0){r.attributes={};for(var a=0;a0&&(v[g].text=n(v[g],d)),g++;switch(f[h]){case"PointData":var x=parseInt(c.attributes.NumberOfPoints),b=m.attributes.Normals;if(x>0)for(var w=0,A=v.length;w0){M=m.DataArray.attributes.NumberOfComponents;(s=new Float32Array(x*M)).set(m.DataArray.text,0)}break;case"Strips":var T=parseInt(c.attributes.NumberOfStrips);if(T>0){var S=new Int32Array(m.DataArray[0].text.length),E=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),E.set(m.DataArray[1].text,0);var _=T+S.length;u=new Uint32Array(3*_-9*T);var F=0;for(w=0,A=T;w0&&(O=E[w-1]);var N=0;for(C=E[w],O=0;N0&&(O=E[w-1])}}break;case"Polys":var I=parseInt(c.attributes.NumberOfPolys);if(I>0){S=new Int32Array(m.DataArray[0].text.length),E=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),E.set(m.DataArray[1].text,0);_=I+S.length;u=new Uint32Array(3*_-9*I);F=0;var R=0;for(w=0,A=I,O=0;w=3)for(var O=parseInt(C[0]),N=1,I=0;I=3){var R,U;for(I=0;I=u.byteLength)break}var M=new a.BufferGeometry;return M.setIndex(new a.BufferAttribute(h,1)),M.addAttribute("position",new a.BufferAttribute(d,3)),f.length===d.length&&M.addAttribute("normal",new a.BufferAttribute(f,3)),M}(e)}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(var r=t;r-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,a=0;a127)return!0;return!1}},{key:"ensureBinary",value:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),r=0;r0&&(this.baseDir=this.url.substr(0,this.url.lastIndexOf("/")+1));this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this.mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var a=this._data.indexOf("{",r)+1,n=this._data.indexOf("}",r),i=this._data.indexOf("{",a)+1;if(!(a>0&&n>a)){r=-1===a?this._data.length:n+1;break}var o={children:[]},s=this._readLine(this._data.substr(r,a-r-1)).trim(),l=s.split(/ /g);if(l.length>0?(o.type=l[0],l.length>=2?o.name=l[1]:o.name=l[0]+this.Hierarchies.children.length):(o.name=s,o.type=""),"Animation"===o.type){o.data=this._data.substr(i,n-i).trim();var u=this._hierarchieParse(o,n+1);r=u.end,o.children=u.parent.children}else{var c=this._data.lastIndexOf(";",i>0?Math.min(i,n):n);if(o.data=this._data.substr(a,c-a).trim(),i<=0||n0||!this._currentObject.worked?setTimeout((function(){e.mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.Geometry=new a.Geometry,this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new s,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new a.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new a.Bone;if(e.name=this._currentFrame.name,e.applyMatrix(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(var t in this.HieStack)this.HieStack[t].name===this._currentFrame.parentName&&this.HieStack[t].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,a=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,n=0,(a=this._currentObject.data.indexOf(";;",e)+1)<=0&&(a=this._currentObject.data.length)}else{var o=0;switch(t){case 0:o=this._currentObject.data.indexOf(",",e)+1;break;case 1:o=this._currentObject.data.indexOf(";,",e)+1}switch((0===o||o>a)&&(o=a,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,o-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,o-e))}break;case"MeshNormals":switch(t){case 0:this._readNormalVector1(this._currentObject.data.substr(e,o-e));break;case 1:this._readNormalFace1(this._currentObject.data.substr(e,o-e),n)}}e=o+1,n++,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.Geometry.vertices.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))),this._currentGeo.Geometry.skinIndices.push(new a.Vector4(0,0,0,0)),this._currentGeo.Geometry.skinWeights.push(new a.Vector4(1,0,0,0)),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.Geometry.faces.push(new a.Face3(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),new a.Vector3(1,1,1).normalize()))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.normalVectors.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])))}},{key:"_readNormalFace1",value:function(e,t){var r=this._readLine(e.trim()).substr(2,e.length-4).split(","),a=parseInt(r[0],10),n=this._currentGeo.normalVectors[a];a=parseInt(r[1],10);var i=this._currentGeo.normalVectors[a];a=parseInt(r[2],10);var o=this._currentGeo.normalVectors[a];this._currentGeo.Geometry.faces[t].vertexNormals=[n,i,o]}},{key:"_setMeshNormals",value:function(){for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var a=this._currentObject.data.indexOf(",",e)+1;-1===a&&(a=this._currentObject.data.indexOf(";;",e)+1,t=2,r=0);var n=this._currentObject.data.substr(e,a-e),i=this._readLine(n.trim()).split(";");this._currentGeo.normalVectors.push([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]),e=a+1}}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshTextureCoords",value:function(){this._tmpUvArray=[],this._currentGeo.Geometry.faceVertexUvs=[],this._currentGeo.Geometry.faceVertexUvs.push([]);for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),o=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),1-parseFloat(o[1]))):this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),parseFloat(o[1]))),e=n+1}}if(e>=this._currentObject.data.length)break}this._currentGeo.Geometry.faceVertexUvs[0]=[];for(var s=0;s=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new a.MeshPhongMaterial({color:16777215*Math.random()});e.side=a.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t),i=this._readLine(n.trim()).split(";");e.color.r=parseFloat(i[0]),e.color.g=parseFloat(i[1]),e.color.b=parseFloat(i[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(n)),t=r+1,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t);var o=this._readLine(n.trim()).split(";");e.specular.r=parseFloat(o[0]),e.specular.g=parseFloat(o[1]),e.specular.b=parseFloat(o[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),n=this._currentObject.data.substr(t,r-t);var s=this._readLine(n.trim()).split(";");e.emissive.r=parseFloat(s[0]),e.emissive.g=parseFloat(s[1]),e.emissive.b=parseFloat(s[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var u=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(this.baseDir+u);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(this.baseDir+u),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(this.baseDir+u),e.normalScale=new a.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(this.baseDir+u);break;case"LightMapFilename":e.lightMap=this.texloader.load(this.baseDir+u)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new o,t=0,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);t=r+1,e.boneName=n.substr(1,n.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(r=this._currentObject.data.indexOf(";",t))+1,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);for(var i=this._readLine(n.trim()).split(","),s=0;s0)for(var o=0;o0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(var r=0;r4&&console.log("warn! over 4 bone weight! :"+s)}}for(var u=0;u0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,i&&e.context.disable(e.context.STENCIL_TEST),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new a.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new a.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionX,e.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.context.enable(e.context.STENCIL_TEST),e.render(this.scene,this.camera,r,!1),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:new a.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),s.BlurDirectionX=new a.Vector2(1,0),s.BlurDirectionY=new a.Vector2(0,1),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=r(1),i=(a=n)&&a.__esModule?a:{default:a};var o=function(e,t,r,a,n){i.default.call(this),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=a,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};o.prototype=Object.assign(Object.create(i.default.prototype),{constructor:o,render:function(e,t,r,a,n){var i,o,s=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),o=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),this.clearColor&&e.setClearColor(i,o),this.scene.overrideMaterial=null,e.autoClear=s}}),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=c(r(1)),i=c(r(19)),o=c(r(20)),s=c(r(2)),l=c(r(21)),u=c(r(22));function c(e){return e&&e.__esModule?e:{default:e}}var d=function(e,t,r,u,c){(n.default.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==r&&r,this.supportsNormalTexture=void 0!==u&&u,this.oldClearColor=new a.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==c?new a.Vector2(c.x,c.y):new a.Vector2(256,256),this.saoRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.NearestFilter,magFilter:a.NearestFilter,format:a.RGBAFormat}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((r=new a.DepthTexture).type=a.UnsignedShortType,r.minFilter=a.NearestFilter,r.maxFilter=a.NearestFilter,this.beautyRenderTarget.depthTexture=r,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.normalMaterial=new a.MeshNormalMaterial,this.normalMaterial.blending=a.NoBlending,void 0===i.default&&console.error("THREE.SAOPass relies on THREE.SAOShader"),this.saoMaterial=new a.ShaderMaterial({defines:Object.assign({},i.default.defines),fragmentShader:i.default.fragmentShader,vertexShader:i.default.vertexShader,uniforms:a.UniformsUtils.clone(i.default.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=a.NoBlending,void 0===o.default&&console.error("THREE.SAOPass relies on THREE.DepthLimitedBlurShader"),this.vBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=a.NoBlending,this.hBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=a.NoBlending,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.CopyShader"),this.materialCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(s.default.uniforms),vertexShader:s.default.vertexShader,fragmentShader:s.default.fragmentShader,blending:a.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=a.CustomBlending,this.materialCopy.blendSrc=a.DstColorFactor,this.materialCopy.blendDst=a.ZeroFactor,this.materialCopy.blendEquation=a.AddEquation,this.materialCopy.blendSrcAlpha=a.DstAlphaFactor,this.materialCopy.blendDstAlpha=a.ZeroFactor,this.materialCopy.blendEquationAlpha=a.AddEquation,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.UnpackDepthRGBAShader"),this.depthCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(l.default.uniforms),vertexShader:l.default.vertexShader,fragmentShader:l.default.fragmentShader,blending:a.NoBlending}),this.quadCamera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.quadScene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quadScene.add(this.quad)};d.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},d.prototype=Object.assign(Object.create(n.default.prototype),{constructor:d,render:function(e,t,r,n,i){if(this.renderToScreen&&(this.materialCopy.blending=a.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,e.clearTarget(this.depthRenderTarget),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(u.default.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(0,1)),u.default.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.render(this.scene,this.camera,this.beautyRenderTarget,!0),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var l=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,l=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?l.blending=a.CustomBlending:l.blending=a.NoBlending,this.renderPass(e,l,this.renderToScreen?null:r),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}},renderPass:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.quad.material=t,e.render(this.quadScene,this.quadCamera,r,l),e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},renderOverride:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1,a=t.clearColor||a,n=t.clearAlpha||n;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.scene.overrideMaterial=t,e.render(this.scene,this.camera,r,l),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}}),t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){n.default.call(this),void 0===i.default&&console.error("THREE.SavePass relies on THREE.CopyShader");var t=i.default;this.textureID="tDiffuse",this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new a.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBFormat,stencilBuffer:!1}),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,e.render(this.scene,this.camera,this.renderTarget,this.clear)}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(23));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),this.edgesRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var r=new Image;r.src=this.getAreaTexture(),this.areaTexture=new a.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=a.RGBFormat,this.areaTexture.minFilter=a.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.needsUpdate=!0,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),this.searchTexture=new a.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=a.NearestFilter,this.searchTexture.minFilter=a.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.needsUpdate=!0,this.searchTexture.flipY=!1,void 0===i.default&&console.error("THREE.SMAAPass relies on THREE.SMAAShader"),this.uniformsEdges=a.UniformsUtils.clone(i.default[0].uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new a.ShaderMaterial({defines:Object.assign({},i.default[0].defines),uniforms:this.uniformsEdges,vertexShader:i.default[0].vertexShader,fragmentShader:i.default[0].fragmentShader}),this.uniformsWeights=a.UniformsUtils.clone(i.default[1].uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new a.ShaderMaterial({defines:Object.assign({},i.default[1].defines),uniforms:this.uniformsWeights,vertexShader:i.default[1].vertexShader,fragmentShader:i.default[1].fragmentShader}),this.uniformsBlend=a.UniformsUtils.clone(i.default[2].uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new a.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:i.default[2].vertexShader,fragmentShader:i.default[2].fragmentShader}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniformsEdges.tDiffuse.value=r.texture,this.quad.material=this.materialEdges,e.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,e.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=r.texture,this.quad.material=this.materialBlend,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAAC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nD7D3uNHu54WUuOsBTbQuvBsPT/UfzNxGYzwkP8c+Yz3C+r/i6DcyRL/rZ+utRwWH5PmfvcvYEt9jLDS/bg0/B64DWKrQM8AL8FPwS9beQCe6EMKNZYJol37jBMy35otdaz0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(3)),i=o(r(25));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){if(void 0===i.default)return console.warn("THREE.SSAOPass depends on THREE.SSAOShader"),new n.default;n.default.call(this,i.default),this.width=void 0!==r?r:512,this.height=void 0!==o?o:256,this.renderToScreen=!1,this.camera2=t,this.scene2=e,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.depthRenderTarget=new a.WebGLRenderTarget(this.width,this.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter}),this.uniforms.tDepth.value=this.depthRenderTarget.texture,this.uniforms.size.value.set(this.width,this.height),this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far,this.uniforms.radius.value=4,this.uniforms.onlyAO.value=!1,this.uniforms.aoClamp.value=.25,this.uniforms.lumInfluence.value=.7;Object.defineProperties(this,{radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},onlyAO:{get:function(){return this.uniforms.onlyAO.value},set:function(e){this.uniforms.onlyAO.value=e}},aoClamp:{get:function(){return this.uniforms.aoClamp.value},set:function(e){this.uniforms.aoClamp.value=e}},lumInfluence:{get:function(){return this.uniforms.lumInfluence.value},set:function(e){this.uniforms.lumInfluence.value=e}}})};(s.prototype=Object.create(n.default.prototype)).render=function(e,t,r,a,i){this.scene2.overrideMaterial=this.depthMaterial,e.render(this.scene2,this.camera2,this.depthRenderTarget,!0),this.scene2.overrideMaterial=null,n.default.prototype.render.call(this,e,t,r,a,i)},s.prototype.setScene=function(e){this.scene2=e},s.prototype.setCamera=function(e){this.camera2=e,this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far},s.prototype.setSize=function(e,t){this.width=e,this.height=t,this.uniforms.size.value.set(this.width,this.height),this.depthRenderTarget.setSize(this.width,this.height)},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(24),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t,r){void 0===o.default&&console.error("THREE.TAARenderPass relies on THREE.SSAARenderPass"),o.default.call(this,e,t,r),this.sampleLevel=0,this.accumulate=!1};s.JitterVectors=o.default.JitterVectors,s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a){if(!this.accumulate)return o.default.prototype.render.call(this,e,t,r,a),void(this.accumulateIndex=-1);var i=s.JitterVectors[5];this.sampleRenderTarget||(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),this.holdRenderTarget||(this.holdRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.holdRenderTarget.texture.name="TAARenderPass.hold"),this.accumulate&&-1===this.accumulateIndex&&(o.default.prototype.render.call(this,e,this.holdRenderTarget,r,a),this.accumulateIndex=0);var l=e.autoClear;e.autoClear=!1;var u=1/i.length;if(this.accumulateIndex>=0&&this.accumulateIndex=i.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}var h=this.accumulateIndex*u;h>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.render(this.scene2,this.camera2,t,!0)),h<1&&(this.copyUniforms.opacity.value=1-h,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.render(this.scene2,this.camera2,t,0===h)),e.autoClear=l}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),void 0===i.default&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=i.default;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=a.UniformsUtils.clone(r.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){var i=e.autoClear;e.autoClear=!1,this.quad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),e.autoClear=i}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=s(r(1)),i=s(r(2)),o=s(r(26));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e,t,r,s){n.default.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=s,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);var l={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var u=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new a.WebGLRenderTarget(u,c,l),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var d=0;d\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new a.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),l.BlurDirectionX=new a.Vector2(1,0),l.BlurDirectionY=new a.Vector2(0,1),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaterRefractionShader=t.VignetteShader=t.VerticalTiltShiftShader=t.VerticalBlurShader=t.UnpackDepthRGBAShader=t.TriangleBlurShader=t.ToneMapShader=t.TechnicolorShader=t.SSAOShader=t.SobelOperatorShader=t.SMAAShader=t.SepiaShader=t.SAOShader=t.RGBShiftShader=t.PixelShader=t.ParallaxShader=t.NormalMapShader=t.MirrorShader=t.LuminosityShader=t.LuminosityHighPassShader=t.KaleidoShader=t.HueSaturationShader=t.HorizontalTiltShiftShader=t.HorizontalBlurShader=t.HalftoneShader=t.GammaCorrectionShader=t.FXAAShader=t.FresnelShader=t.FreiChenShader=t.FocusShader=t.FilmShader=t.DotScreenShader=t.DOFMipMapShader=t.DigitalGlitch=t.DepthLimitedBlurShader=t.CopyShader=t.ConvolutionShader=t.ColorifyShader=t.ColorCorrectionShader=t.BrightnessContrastShader=t.BokehShader2=t.BokehShader=t.BlurShaderUtils=t.BlendShader=t.BleachBypassShader=t.BasicShader=void 0;var a=q(r(113)),n=q(r(114)),i=q(r(115)),o=q(r(22)),s=q(r(14)),l=q(r(116)),u=q(r(117)),c=q(r(118)),d=q(r(119)),f=q(r(13)),h=q(r(2)),p=q(r(20)),m=q(r(17)),v=q(r(120)),g=q(r(15)),y=q(r(16)),x=q(r(121)),b=q(r(122)),w=q(r(123)),A=q(r(124)),M=q(r(125)),T=q(r(18)),S=q(r(126)),E=q(r(127)),_=q(r(128)),F=q(r(129)),P=q(r(26)),L=q(r(11)),C=q(r(130)),O=q(r(131)),N=(q(r(132)),q(r(133))),I=q(r(134)),R=q(r(135)),U=q(r(19)),D=q(r(136)),k=q(r(23)),B=q(r(137)),j=q(r(25)),V=q(r(138)),G=q(r(12)),z=q(r(139)),X=q(r(21)),H=q(r(140)),Y=q(r(141)),W=q(r(142)),Q=q(r(143));function q(e){return e&&e.__esModule?e:{default:e}}t.BasicShader=a.default,t.BleachBypassShader=n.default,t.BlendShader=i.default,t.BlurShaderUtils=o.default,t.BokehShader=s.default,t.BokehShader2=l.default,t.BrightnessContrastShader=u.default,t.ColorCorrectionShader=c.default,t.ColorifyShader=d.default,t.ConvolutionShader=f.default,t.CopyShader=h.default,t.DepthLimitedBlurShader=p.default,t.DigitalGlitch=m.default,t.DOFMipMapShader=v.default,t.DotScreenShader=g.default,t.FilmShader=y.default,t.FocusShader=x.default,t.FreiChenShader=b.default,t.FresnelShader=w.default,t.FXAAShader=A.default,t.GammaCorrectionShader=M.default,t.HalftoneShader=T.default,t.HorizontalBlurShader=S.default,t.HorizontalTiltShiftShader=E.default,t.HueSaturationShader=_.default,t.KaleidoShader=F.default,t.LuminosityHighPassShader=P.default,t.LuminosityShader=L.default,t.MirrorShader=C.default,t.NormalMapShader=O.default,t.ParallaxShader=N.default,t.PixelShader=I.default,t.RGBShiftShader=R.default,t.SAOShader=U.default,t.SepiaShader=D.default,t.SMAAShader=k.default,t.SobelOperatorShader=B.default,t.SSAOShader=j.default,t.TechnicolorShader=V.default,t.ToneMapShader=G.default,t.TriangleBlurShader=z.default,t.UnpackDepthRGBAShader=X.default,t.VerticalBlurShader=H.default,t.VerticalTiltShiftShader=Y.default,t.VignetteShader=W.default,t.WaterRefractionShader=Q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","vec4 texel1 = texture2D( tDiffuse1, vUv );","vec4 texel2 = texture2D( tDiffuse2, vUv );","gl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float penta(vec2 coords) {","//pentagonal shape","float scale = float(rings) - 1.3;","vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","vec4 one = vec4( 1.0 );","vec4 P = vec4((coords),vec2(scale, scale));","vec4 dist = vec4(0.0);","float inorout = -4.0;","dist.x = dot( P, HS0 );","dist.y = dot( P, HS1 );","dist.z = dot( P, HS2 );","dist.w = dot( P, HS3 );","dist = smoothstep( -feather, feather, dist );","inorout += dot( dist, one );","dist.x = dot( P, HS4 );","dist.y = HS5.w - abs( P.z );","dist = smoothstep( -feather, feather, dist );","inorout += dist.x;","return clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","// Depth buffer blur","float d = 0.0;","float kernel[9];","vec2 offset[9];","vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","offset[0] = vec2(-wh.x,-wh.y);","offset[1] = vec2( 0.0, -wh.y);","offset[2] = vec2( wh.x -wh.y);","offset[3] = vec2(-wh.x, 0.0);","offset[4] = vec2( 0.0, 0.0);","offset[5] = vec2( wh.x, 0.0);","offset[6] = vec2(-wh.x, wh.y);","offset[7] = vec2( 0.0, wh.y);","offset[8] = vec2( wh.x, wh.y);","kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","for( int i=0; i<9; i++ ) {","float tmp = getDepth( coords + offset[ i ] );","d += tmp * kernel[i];","}","return d;","}","vec3 color(vec2 coords,float blur) {","//processing the sample","vec3 col = vec3(0.0);","vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","vec3 lumcoeff = vec3(0.299,0.587,0.114);","float lum = dot(col.rgb, lumcoeff);","float thresh = max((lum-threshold)*gain, 0.0);","return col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","float edge = 0.002*depth; //distance based edge smoothing","float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","return col;","}","float linearize(float depth) {","return -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","float dist = distance(vUv.xy, vec2(0.5,0.5));","dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","return clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","float rings2 = float(rings);","float step = PI*2.0 / float(ringsamples);","float pw = cos(j*step)*i;","float ph = sin(j*step)*i;","float p = 1.0;","if (pentagon) {","p = penta(vec2(pw,ph));","}","col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","return 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","//scene depth calculation","float depth = linearize( getDepth( vUv.xy ) );","// Blur depth?","if (depthblur) {","depth = linearize(bdepth(vUv.xy));","}","//focal plane calculation","float fDepth = focalDepth;","if (shaderFocus) {","fDepth = linearize( getDepth( focusCoords ) );","}","// dof blur factor calculation","float blur = 0.0;","if (manualdof) {","float a = depth-fDepth; // Focal plane","float b = (a-fdofstart)/fdofdist; // Far DoF","float c = (-a-ndofstart)/ndofdist; // Near Dof","blur = (a>0.0) ? b : c;","} else {","float f = focalLength; // focal length in mm","float d = fDepth*1000.0; // focal plane in mm","float o = depth*1000.0; // depth in mm","float a = (o*f)/(o-f);","float b = (d*f)/(d-f);","float c = (d-f)/(d*fstop*CoC);","blur = abs(a-b)*c;","}","blur = clamp(blur,0.0,1.0);","// calculation of pattern for dithering","vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","// getting blur x and y step factor","float w = (1.0/textureWidth)*blur*maxblur+noise.x;","float h = (1.0/textureHeight)*blur*maxblur+noise.y;","// calculation of final color","vec3 col = vec3(0.0);","if(blur < 0.05) {","//some optimization thingy","col = texture2D(tColor, vUv.xy).rgb;","} else {","col = texture2D(tColor, vUv.xy).rgb;","float s = 1.0;","int ringsamples;","for (int i = 1; i <= rings; i++) {","/*unboxstart*/","ringsamples = i * samples;","for (int j = 0 ; j < maxringsamples ; j++) {","if (j >= ringsamples) break;","s += gather(float(i), float(j), ringsamples, col, w, h, blur);","}","/*unboxend*/","}","col /= s; //divide by sample count","}","if (showFocus) {","col = debugFocus(col, blur, depth);","}","if (vignetting) {","col *= vignette();","}","gl_FragColor.rgb = col;","gl_FragColor.a = 1.0;","} "].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},powRGB:{value:new a.Vector3(2,2,2)},mulRGB:{value:new a.Vector3(1,1,1)},addRGB:{value:new a.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},color:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},aspect:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","G[0] = g0,","G[1] = g1,","G[2] = g2,","G[3] = g3,","G[4] = g4,","G[5] = g5,","G[6] = g6,","G[7] = g7,","G[8] = g8;","mat3 I;","float cnv[9];","vec3 sample;","for (float i=0.0; i<3.0; i++) {","for (float j=0.0; j<3.0; j++) {","sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","I[int(i)][int(j)] = length(sample);","}","}","for (int i=0; i<9; i++) {","float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","cnv[i] = dp3 * dp3;","}","float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","vec3 I = worldPosition.xyz - cameraPosition;","vReflect = reflect( I, worldNormal );","vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","vec4 refractedColor = vec4( 1.0 );","refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immedates."," // Immedates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","gl_FragColor = LinearToGamma( tex, float( GAMMA_FACTOR ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 p = vUv - 0.5;","float r = length(p);","float a = atan(p.y, p.x) + angle;","float tau = 2. * 3.1416 ;","a = mod(a, tau/sides);","a = abs(a - tau/sides/2.) ;","p = r * vec2(cos(a), sin(a));","vec4 color = texture2D(tDiffuse, p + 0.5);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","vec2 p = vUv;","if (side == 0){","if (p.x > 0.5) p.x = 1.0 - p.x;","}else if (side == 1){","if (p.x < 0.5) p.x = 1.0 - p.x;","}else if (side == 2){","if (p.y < 0.5) p.y = 1.0 - p.y;","}else if (side == 3){","if (p.y > 0.5) p.y = 1.0 - p.y;","} ","vec4 color = texture2D(tDiffuse, p);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{heightMap:{value:null},resolution:{value:new a.Vector2(512,512)},scale:{value:new a.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));a.ShaderLib.ocean_sim_vertex={vertexShader:["varying vec2 vUV;","void main (void) {","vUV = position.xy * 0.5 + 0.5;","gl_Position = vec4(position, 1.0 );","}"].join("\n")},a.ShaderLib.ocean_subtransform={uniforms:{u_input:{value:null},u_transformSize:{value:512},u_subtransformSize:{value:250}},fragmentShader:["precision highp float;","#include ","uniform sampler2D u_input;","uniform float u_transformSize;","uniform float u_subtransformSize;","varying vec2 vUV;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","void main (void) {","#ifdef HORIZONTAL","float index = vUV.x * u_transformSize - 0.5;","#else","float index = vUV.y * u_transformSize - 0.5;","#endif","float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);","#ifdef HORIZONTAL","vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","#else","vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;","#endif","float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);","vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));","vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);","vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);","gl_FragColor = vec4(outputA, outputB);","}"].join("\n")},a.ShaderLib.ocean_initial_spectrum={uniforms:{u_wind:{value:new a.Vector2(10,10)},u_resolution:{value:512},u_size:{value:250}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","const float CM = 0.23;","uniform vec2 u_wind;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + pow2(k / KM)));","}","float tanh (float x) {","return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 K = (2.0 * PI * vec2(n, m)) / u_size;","float k = length(K);","float l_wind = length(u_wind);","float Omega = 0.84;","float kp = G * pow2(Omega / l_wind);","float c = omega(k) / k;","float cp = omega(kp) / kp;","float Lpm = exp(-1.25 * pow2(kp / k));","float gamma = 1.7;","float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));","float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));","float Jp = pow(gamma, Gamma);","float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));","float alphap = 0.006 * sqrt(Omega);","float Bl = 0.5 * alphap * cp / c * Fp;","float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);","float uStar = 0.41 * l_wind / log(10.0 / z0);","float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));","float Fm = exp(-0.25 * pow2(k / KM - 1.0));","float Bh = 0.5 * alpham * CM / c * Fm * Lpm;","float a0 = log(2.0) / 4.0;","float am = 0.13 * uStar / CM;","float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));","float cosPhi = dot(normalize(u_wind), normalize(K));","float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));","float dk = 2.0 * PI / u_size;","float h = sqrt(S / 2.0) * dk;","if (K.x == 0.0 && K.y == 0.0) {","h = 0.0;","}","gl_FragColor = vec4(h, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_phase={uniforms:{u_phases:{value:null},u_deltaTime:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform sampler2D u_phases;","uniform float u_deltaTime;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","float deltaTime = 1.0 / 60.0;","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","float deltaPhase = omega(length(waveVector)) * u_deltaTime;","phase = mod(phase + deltaPhase, 2.0 * PI);","gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_spectrum={uniforms:{u_size:{value:null},u_resolution:{value:null},u_choppiness:{value:null},u_phases:{value:null},u_initialSpectrum:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform float u_size;","uniform float u_resolution;","uniform float u_choppiness;","uniform sampler2D u_phases;","uniform sampler2D u_initialSpectrum;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","vec2 multiplyByI (vec2 z) {","return vec2(-z[1], z[0]);","}","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","vec2 phaseVector = vec2(cos(phase), sin(phase));","vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;","vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;","h0Star.y *= -1.0;","vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));","vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;","vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;","if (waveVector.x == 0.0 && waveVector.y == 0.0) {","h = vec2(0.0);","hX = vec2(0.0);","hZ = vec2(0.0);","}","gl_FragColor = vec4(hX + multiplyByI(h), hZ);","}"].join("\n")},a.ShaderLib.ocean_normals={uniforms:{u_displacementMap:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform float u_resolution;","uniform float u_size;","void main (void) {","float texel = 1.0 / u_resolution;","float texelSize = u_size / u_resolution;","vec3 center = texture2D(u_displacementMap, vUV).rgb;","vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;","vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;","vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;","vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;","vec3 topRight = cross(right, top);","vec3 topLeft = cross(top, left);","vec3 bottomLeft = cross(left, bottom);","vec3 bottomRight = cross(bottom, right);","gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);","}"].join("\n")},a.ShaderLib.ocean_main={uniforms:{u_displacementMap:{value:null},u_normalMap:{value:null},u_geometrySize:{value:null},u_size:{value:null},u_projectionMatrix:{value:null},u_viewMatrix:{value:null},u_cameraPosition:{value:null},u_skyColor:{value:null},u_oceanColor:{value:null},u_sunDirection:{value:null},u_exposure:{value:null}},vertexShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform mat4 u_projectionMatrix;","uniform mat4 u_viewMatrix;","uniform float u_size;","uniform float u_geometrySize;","uniform sampler2D u_displacementMap;","void main (void) {","vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);","vPos = newPos;","vUV = uv;","gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);","}"].join("\n"),fragmentShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform sampler2D u_normalMap;","uniform vec3 u_cameraPosition;","uniform vec3 u_oceanColor;","uniform vec3 u_skyColor;","uniform vec3 u_sunDirection;","uniform float u_exposure;","vec3 hdr (vec3 color, float exposure) {","return 1.0 - exp(-color * exposure);","}","void main (void) {","vec3 normal = texture2D(u_normalMap, vUV).rgb;","vec3 view = normalize(u_cameraPosition - vPos);","float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);","vec3 sky = fresnel * u_skyColor;","float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);","vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;","vec3 color = sky + water;","gl_FragColor = vec4(hdr(color, u_exposure), 1.0);","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","vUv = uv;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vViewPosition = -mvPosition.xyz;","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","vec2 parallaxMap( in vec3 V ) {","float initialHeight = texture2D( bumpMap, vUv ).r;","vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","return vUv - texCoordOffset;","}","#else","vec2 parallaxMap( in vec3 V ) {","float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","float layerHeight = 1.0 / numLayers;","float currentLayerHeight = 0.0;","vec2 dtex = parallaxScale * V.xy / V.z / numLayers;","vec2 currentTextureCoords = vUv;","float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","for ( int i = 0; i < 30; i += 1 ) {","if ( heightFromTexture <= currentLayerHeight ) {","break;","}","currentLayerHeight += layerHeight;","currentTextureCoords -= dtex;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","}","#ifdef USE_STEEP_PARALLAX","return currentTextureCoords;","#elif defined( USE_RELIEF_PARALLAX )","vec2 deltaTexCoord = dtex / 2.0;","float deltaHeight = layerHeight / 2.0;","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","const int numSearches = 5;","for ( int i = 0; i < numSearches; i += 1 ) {","deltaTexCoord /= 2.0;","deltaHeight /= 2.0;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","if( heightFromTexture > currentLayerHeight ) {","currentTextureCoords -= deltaTexCoord;","currentLayerHeight += deltaHeight;","} else {","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","}","}","return currentTextureCoords;","#elif defined( USE_OCLUSION_PARALLAX )","vec2 prevTCoords = currentTextureCoords + dtex;","float nextH = heightFromTexture - currentLayerHeight;","float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","float weight = nextH / ( nextH - prevH );","return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","#else","return vUv;","#endif","}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","vec2 texDx = dFdx( vUv );","vec2 texDy = dFdy( vUv );","vec3 vSigmaX = dFdx( surfPosition );","vec3 vSigmaY = dFdy( surfPosition );","vec3 vR1 = cross( vSigmaY, surfNormal );","vec3 vR2 = cross( surfNormal, vSigmaX );","float fDet = dot( vSigmaX, vR1 );","vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","vec3 vProjVtex;","vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","vProjVtex.z = dot( surfNormal, viewPosition );","return parallaxMap( vProjVtex );","}","void main() {","vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","gl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, vUv + offset);","vec4 cga = texture2D(tDiffuse, vUv);","vec4 cb = texture2D(tDiffuse, vUv - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","gl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","gl_FragColor = newTex;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{texture:{value:null},delta:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = rand( vUv );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{color:{type:"c",value:null},time:{type:"f",value:0},tDiffuse:{type:"t",value:null},tDudv:{type:"t",value:null},textureMatrix:{type:"m4",value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Volume=void 0;var a,n=r(10),i=(a=n)&&a.__esModule?a:{default:a};t.Volume=i.default}]))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(5);Object.defineProperty(t,"CopyShader",{enumerable:!0,get:function(){return h(a).default}});var n=r(2);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return h(n).default}});var i=r(6);Object.defineProperty(t,"ShaderPass",{enumerable:!0,get:function(){return h(i).default}});var o=r(14);Object.defineProperty(t,"RenderingPass",{enumerable:!0,get:function(){return h(o).default}});var s=r(15);Object.defineProperty(t,"TexturePass",{enumerable:!0,get:function(){return h(s).default}});var l=r(16);Object.defineProperty(t,"RenderPass",{enumerable:!0,get:function(){return h(l).default}});var u=r(7);Object.defineProperty(t,"MaskPass",{enumerable:!0,get:function(){return h(u).default}});var c=r(8);Object.defineProperty(t,"ClearMaskPass",{enumerable:!0,get:function(){return h(c).default}});var d=r(17);Object.defineProperty(t,"ClearPass",{enumerable:!0,get:function(){return h(d).default}});var f=r(18);function h(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h(f).default}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{tolerance:0};if(!e)throw new Error("You should specify the element you want to test");"string"==typeof e&&(e=document.querySelector(e));var r=e.getBoundingClientRect();return(r.bottom-t.tolerance>0&&r.right-t.tolerance>0&&r.left+t.tolerance<(window.innerWidth||document.documentElement.clientWidth)&&r.top+t.tolerance<(window.innerHeight||document.documentElement.clientHeight))}function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0,container:""};if(!e)throw new Error("You should specify the element you want to test");if("string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={tolerance:0,container:document.querySelector(t)}),"string"==typeof t.container&&(t.container=document.querySelector(t.container)),t instanceof HTMLElement&&(t={tolerance:0,container:t}),!t.container)throw new Error("You should specify a container element");var r=t.container.getBoundingClientRect();return(e.offsetTop+e.clientHeight-t.tolerance>t.container.scrollTop&&e.offsetLeft+e.clientWidth-t.tolerance>t.container.scrollLeft&&e.offsetLeft+t.tolerance0&&void 0!==arguments[0]?arguments[0]:{tolerance:0,debounce:100,container:window};this.options={},this.trackedElements={},Object.defineProperties(this.options,{container:{configurable:!1,enumerable:!1,get:function(){var e=void 0;return"string"==typeof n.container?e=document.querySelector(n.container):n.container instanceof HTMLElement&&(e=n.container),e||window},set:function(e){n.container=e}},debounce:{get:function(){return parseInt(n.debounce,10)||100},set:function(e){n.debounce=e}},tolerance:{get:function(){return parseInt(n.tolerance,10)||0},set:function(e){n.tolerance=e}}}),Object.defineProperty(this,"_scroll",{enumerable:!1,configurable:!1,writable:!1,value:this._debouncedScroll.call(this)}),e=document.querySelector("body"),t=function(){Object.keys(a.trackedElements).forEach((function(e){a.on("enter",e),a.on("leave",e)}))},(r=window.MutationObserver||window.WebKitMutationObserver)?new r(t).observe(e,{childList:!0,subtree:!0}):(e.addEventListener("DOMNodeInserted",t,!1),e.addEventListener("DOMNodeRemoved",t,!1)),this.attach()}return Object.defineProperties(r.prototype,{_debouncedScroll:{configurable:!1,writable:!1,enumerable:!1,value:function(){var r=this,a=void 0;return function(){clearTimeout(a),a=setTimeout((function(){!function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0},n=Object.keys(r),i=void 0;n.length&&(i=a.container===window?e:t,n.forEach((function(e){r[e].nodes.forEach((function(t){if(i(t.node,a)?(t.wasVisible=t.isVisible,t.isVisible=!0):(t.wasVisible=t.isVisible,t.isVisible=!1),!0===t.isVisible&&!1===t.wasVisible){if(!r[e].enter)return;Object.keys(r[e].enter).forEach((function(a){"function"==typeof r[e].enter[a]&&r[e].enter[a](t.node,"enter")}))}if(!1===t.isVisible&&!0===t.wasVisible){if(!r[e].leave)return;Object.keys(r[e].leave).forEach((function(a){"function"==typeof r[e].leave[a]&&r[e].leave[a](t.node,"leave")}))}}))})))}(r.trackedElements,r.options)}),r.options.debounce)}}},attach:{configurable:!1,writable:!1,enumerable:!1,value:function(){var e=this.options.container;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.addEventListener("scroll",this._scroll,{passive:!0}),window.addEventListener("resize",this._scroll,{passive:!0}),this._scroll(),this.attached=!0}},destroy:{configurable:!1,writable:!1,enumerable:!1,value:function(){this.options.container.removeEventListener("scroll",this._scroll),window.removeEventListener("resize",this._scroll),this.attached=!1}},off:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){var a=Object.keys(this.trackedElements[t].enter||{}),n=Object.keys(this.trackedElements[t].leave||{});if({}.hasOwnProperty.call(this.trackedElements,t))if(r){if(this.trackedElements[t][e]){var i="function"==typeof r?r.name:r;delete this.trackedElements[t][e][i]}}else delete this.trackedElements[t][e];a.length||n.length||delete this.trackedElements[t]}},on:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){if(!e)throw new Error("No event given. Choose either enter or leave");if(!t)throw new Error("No selector to track");if(["enter","leave"].indexOf(e)<0)throw new Error(e+" event is not supported");({}).hasOwnProperty.call(this.trackedElements,t)||(this.trackedElements[t]={}),this.trackedElements[t].nodes=[];for(var a=0,n=document.querySelectorAll(t);ap||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),x=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",k,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",z,!1),l.domElement.removeEventListener("touchend",H,!1),l.domElement.removeEventListener("touchmove",X,!1),document.removeEventListener("mousemove",B,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",G,!1)};var l=this,u={type:"change"},c={type:"start"},d={type:"end"},f={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},h=f.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,x=!1,b=new a.Vector2,w=new a.Vector2,A=new a.Vector2,M=new a.Vector2,T=new a.Vector2,S=new a.Vector2,E=new a.Vector2,_=new a.Vector2,F=new a.Vector2;function P(){return Math.pow(.95,l.zoomSpeed)}function L(e){v.theta-=e}function C(e){v.phi-=e}var O,N=(O=new a.Vector3,function(e,t){O.setFromMatrixColumn(t,0),O.multiplyScalar(-e),y.add(O)}),I=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,1),e.multiplyScalar(t),y.add(e)}}(),R=function(){var e=new a.Vector3;return function(t,r){var n=l.domElement===document?l.domElement.body:l.domElement;if(l.object instanceof a.PerspectiveCamera){var i=l.object.position;e.copy(i).sub(l.target);var o=e.length();o*=Math.tan(l.object.fov/2*Math.PI/180),N(2*t*o/n.clientHeight,l.object.matrix),I(2*r*o/n.clientHeight,l.object.matrix)}else l.object instanceof a.OrthographicCamera?(N(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),I(r*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function U(e){l.object instanceof a.PerspectiveCamera?g/=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object instanceof a.PerspectiveCamera?g*=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function k(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){b.set(e.clientX,e.clientY)}(e),h=f.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){E.set(e.clientX,e.clientY)}(e),h=f.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=f.PAN}h!==f.NONE&&(document.addEventListener("mousemove",B,!1),document.addEventListener("mouseup",j,!1),l.dispatchEvent(c))}}function B(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case f.ROTATE:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY),A.subVectors(w,b);var t=l.domElement===document?l.domElement.body:l.domElement;L(2*Math.PI*A.x/t.clientWidth*l.rotateSpeed),C(2*Math.PI*A.y/t.clientHeight*l.rotateSpeed),b.copy(w),l.update()}(e);break;case f.DOLLY:if(!1===l.enableZoom)return;!function(e){_.set(e.clientX,e.clientY),F.subVectors(_,E),F.y>0?U(P()):F.y<0&&D(P()),E.copy(_),l.update()}(e);break;case f.PAN:if(!1===l.enablePan)return;!function(e){T.set(e.clientX,e.clientY),S.subVectors(T,M),R(S.x,S.y),M.copy(T),l.update()}(e)}}function j(e){!1!==l.enabled&&(document.removeEventListener("mousemove",B,!1),document.removeEventListener("mouseup",j,!1),l.dispatchEvent(d),h=f.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==f.NONE&&h!==f.ROTATE||(e.preventDefault(),e.stopPropagation(),function(e){e.deltaY<0?D(P()):e.deltaY>0&&U(P()),l.update()}(e),l.dispatchEvent(c),l.dispatchEvent(d))}function G(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:R(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:R(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:R(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:R(-l.keyPanSpeed,0),l.update()}}(e)}function z(e){if(!1!==l.enabled){switch(e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){b.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=f.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);E.set(0,a)}(e),h=f.TOUCH_DOLLY;break;case 3:if(!1===l.enablePan)return;!function(e){M.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=f.TOUCH_PAN;break;default:h=f.NONE}h!==f.NONE&&l.dispatchEvent(c)}}function X(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==f.TOUCH_ROTATE)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY),A.subVectors(w,b);var t=l.domElement===document?l.domElement.body:l.domElement;L(2*Math.PI*A.x/t.clientWidth*l.rotateSpeed),C(2*Math.PI*A.y/t.clientHeight*l.rotateSpeed),b.copy(w),l.update()}(e);break;case 2:if(!1===l.enableZoom)return;if(h!==f.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);_.set(0,a),F.subVectors(_,E),F.y>0?D(P()):F.y<0&&U(P()),E.copy(_),l.update()}(e);break;case 3:if(!1===l.enablePan)return;if(h!==f.TOUCH_PAN)return;!function(e){T.set(e.touches[0].pageX,e.touches[0].pageY),S.subVectors(T,M),R(S.x,S.y),M.copy(T),l.update()}(e);break;default:h=f.NONE}}function H(e){!1!==l.enabled&&(l.dispatchEvent(d),h=f.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",k,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",z,!1),l.domElement.addEventListener("touchend",H,!1),l.domElement.addEventListener("touchmove",X,!1),window.addEventListener("keydown",G,!1),this.update()}n.prototype=Object.create(a.EventDispatcher.prototype),n.prototype.constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var i=r(3),o=r(4),s=r.n(o),l=r(9),u=r.n(l),c=r(10);r.d(t,"a",(function(){return f}));const d={showAxes:!1,showGrid:!1,autoResize:!1,controls:{enabled:!0,zoom:!0,rotate:!0,pan:!0,keys:!0},camera:{type:"perspective",x:20,y:35,z:20,target:[0,0,0]},canvas:{width:void 0,height:void 0},pauseHidden:!0,forceContext:!1,sendStats:!0};class f{constructor(e,t,r){this.element=r||document.body,this.options=Object.assign({},d,t,e),this.renderType="_Base_"}toImage(e,t){if(t||(t="image/png"),this._renderer){if(e){let e=document.createElement("canvas"),r=e.getContext("2d");return e.width=this._renderer.domElement.width,e.height=this._renderer.domElement.height,r.drawImage(this._renderer.domElement,0,0),function(e){let t,r,a,n=e.getContext("2d"),i=document.createElement("canvas").getContext("2d"),o=n.getImageData(0,0,e.width,e.height),s=o.data.length,l={top:null,left:null,right:null,bottom:null};for(t=0;t{if(this._scene){(new i.GLTFExporter).parse(this._scene,e=>{t(e)},e)}else r()})}toPLY(e){if(this._scene){return(new i.PLYExporter).parse(this._scene,e)}}initScene(e,t){let r=this;if(console.log(" "),console.log("%c ","font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;"),console.log("MineRender/"+(r.renderType||r.constructor.name)+"/1.4.6"),console.log("PRODUCTION build"),console.log("Built @ 2021-02-01T16:10:49.105Z"),console.log(" "),r.options.sendStats){let e,t=!1;try{t=window.self!==window.top}catch(e){return!0}try{e=new URL(t?document.referrer:window.location).hostname}catch(e){console.warn("Failed to get hostname")}c.post({url:"https://minerender.org/stats.php",data:{action:"init",type:r.renderType,host:e,source:t?"iframe":"javascript"}})}let l,d=new a.Scene;r._scene=d,l="orthographic"===r.options.camera.type?new a.OrthographicCamera((r.options.canvas.width||window.innerWidth)/-2,(r.options.canvas.width||window.innerWidth)/2,(r.options.canvas.height||window.innerHeight)/2,(r.options.canvas.height||window.innerHeight)/-2,1,1e3):new a.PerspectiveCamera(75,(r.options.canvas.width||window.innerWidth)/(r.options.canvas.height||window.innerHeight),5,1e3),r._camera=l,r.options.camera.zoom&&(l.zoom=r.options.camera.zoom);let f=new a.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});r._renderer=f,f.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),f.setClearColor(0,0),f.setPixelRatio(window.devicePixelRatio),f.shadowMap.enabled=!0,f.shadowMap.type=a.PCFSoftShadowMap,r.element.appendChild(r._canvas=f.domElement);let h=new s.a(f);h.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),r._composer=h;let p=new i.SSAARenderPass(d,l);p.unbiased=!0,h.addPass(p);let m=new o.ShaderPass(o.CopyShader);m.renderToScreen=!0,h.addPass(m),r.options.autoResize&&(r._resizeListener=function(){let e=r.element&&r.element!==document.body?r.element.offsetWidth:window.innerWidth,t=r.element&&r.element!==document.body?r.element.offsetHeight:window.innerHeight;r._resize(e,t)},window.addEventListener("resize",r._resizeListener)),r._resize=function(e,t){"orthographic"===r.options.camera.type?(l.left=e/-2,l.right=e/2,l.top=t/2,l.bottom=t/-2):l.aspect=e/t,l.updateProjectionMatrix(),f.setSize(e,t),h.setSize(e,t)},r.options.showAxes&&d.add(new a.AxesHelper(50)),r.options.showGrid&&d.add(new a.GridHelper(100,100));let v=new a.AmbientLight(16777215);d.add(v);let g=new n(l,f.domElement);r._controls=g,g.enableZoom=r.options.controls.zoom,g.enableRotate=r.options.controls.rotate,g.enablePan=r.options.controls.pan,g.enableKeys=r.options.controls.keys,g.target.set(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]),l.position.x=r.options.camera.x,l.position.y=r.options.camera.y,l.position.z=r.options.camera.z,l.lookAt(new a.Vector3(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]));let y=function(){r._animId=requestAnimationFrame(y),r.onScreen&&("function"==typeof e&&e(),h.render())};r._animate=y,t||y(),r.onScreen=!0;let x="minerender-canvas-"+r._scene.uuid+"-"+Date.now();if(r._canvas.id=x,r.options.pauseHidden){r.onScreen=!1;let e=new u.a;r._onScreenObserver=e,e.on("enter","#"+x,(e,t)=>{r.onScreen=!0,r.options.forceContext&&r._renderer.forceContextRestore()}),e.on("leave","#"+x,(e,t)=>{r.onScreen=!1,r.options.forceContext&&r._renderer.forceContextLoss()})}}addToScene(e){let t=this;t._scene&&e&&(e.userData.renderType=t.renderType,t._scene.add(e))}clearScene(e,t){if(e||t)for(let r=this._scene.children.length-1;r>=0;r--){let a=this._scene.children[r];if(t){if(t(a))continue}e&&a.userData.renderType!==this.renderType||(h(a,!0),this._scene.remove(a))}else for(;this._scene.children.length>0;)this._scene.remove(this._scene.children[0])}dispose(){cancelAnimationFrame(this._animId),this._onScreenObserver&&this._onScreenObserver.destroy(),this.clearScene(),this._canvas.remove();let e=this.element;for(;e.firstChild;)e.removeChild(e.firstChild);this.options.autoResize&&window.removeEventListener("resize",this._resizeListener)}}function h(e,t){if(e&&(e.geometry&&e.geometry.dispose&&e.geometry.dispose(),e.material&&e.material.dispose&&e.material.dispose(),e.texture&&e.texture.dispose&&e.texture.dispose(),e.children)){let r=e.children;for(let e=0;e=0;t--)e.remove(r[t])}}},function(e,t,r){"use strict";r.r(t),function(e){var a=r(0),n=r(1),i=r(11);let o={camera:{type:"perspective",x:20,y:35,z:20,target:[0,18,0]},makeNonTransparentOpaque:!0};class s extends i.a{constructor(e,t){super(e,o,t),this.renderType="SkinRender",this._animId=-1,this.element.skinRender=this,this.attached=!1}render(e,t){let r=this,i=!1,o=(o,s)=>{i=!0,o.needsUpdate=!0,s&&(s.needsUpdate=!0);let c=-1;32===o.image.height?c=0:64===o.image.height?c=1:console.error("Couldn't detect texture version. Invalid dimensions: "+o.image.width+"x"+o.image.height),console.log("Skin Texture Version: "+c),o.magFilter=a.NearestFilter,o.minFilter=a.NearestFilter,o.anisotropy=0,s&&(s.magFilter=a.NearestFilter,s.minFilter=a.NearestFilter,s.anisotropy=0,s.format=a.RGBFormat),32===o.image.height&&(o.format=a.RGBFormat),r.attached||r._scene?console.log("[SkinRender] is attached - skipping scene init"):super.initScene((function(){r.element.dispatchEvent(new CustomEvent("skinRender",{detail:{playerModel:r.playerModel}}))})),console.log("Slim: "+d);let f=function(e,t,r,i,o){console.log("capeType: "+o);let s=new a.Object3D;s.name="headGroup",s.position.x=0,s.position.y=28,s.position.z=0,s.translateOnAxis(new a.Vector3(0,1,0),-4);let c=l(e,8,8,8,n.a.head[r],i,"head");if(c.translateOnAxis(new a.Vector3(0,1,0),4),s.add(c),r>=1){let t=l(e,8.504,8.504,8.504,n.a.hat,i,"hat",!0);t.translateOnAxis(new a.Vector3(0,1,0),4),s.add(t)}let d=new a.Object3D;d.name="bodyGroup",d.position.x=0,d.position.y=18,d.position.z=0;let f=l(e,8,12,4,n.a.body[r],i,"body");if(d.add(f),r>=1){let t=l(e,8.504,12.504,4.504,n.a.jacket,i,"jacket",!0);d.add(t)}let h=new a.Object3D;h.name="leftArmGroup",h.position.x=i?-5.5:-6,h.position.y=18,h.position.z=0,h.translateOnAxis(new a.Vector3(0,1,0),4);let p=l(e,i?3:4,12,4,n.a.leftArm[r],i,"leftArm");if(p.translateOnAxis(new a.Vector3(0,1,0),-4),h.add(p),r>=1){let t=l(e,i?3.504:4.504,12.504,4.504,n.a.leftSleeve,i,"leftSleeve",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),h.add(t)}let m=new a.Object3D;m.name="rightArmGroup",m.position.x=i?5.5:6,m.position.y=18,m.position.z=0,m.translateOnAxis(new a.Vector3(0,1,0),4);let v=l(e,i?3:4,12,4,n.a.rightArm[r],i,"rightArm");if(v.translateOnAxis(new a.Vector3(0,1,0),-4),m.add(v),r>=1){let t=l(e,i?3.504:4.504,12.504,4.504,n.a.rightSleeve,i,"rightSleeve",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),m.add(t)}let g=new a.Object3D;g.name="leftLegGroup",g.position.x=-2,g.position.y=6,g.position.z=0,g.translateOnAxis(new a.Vector3(0,1,0),4);let y=l(e,4,12,4,n.a.leftLeg[r],i,"leftLeg");if(y.translateOnAxis(new a.Vector3(0,1,0),-4),g.add(y),r>=1){let t=l(e,4.504,12.504,4.504,n.a.leftTrousers,i,"leftTrousers",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),g.add(t)}let x=new a.Object3D;x.name="rightLegGroup",x.position.x=2,x.position.y=6,x.position.z=0,x.translateOnAxis(new a.Vector3(0,1,0),4);let b=l(e,4,12,4,n.a.rightLeg[r],i,"rightLeg");if(b.translateOnAxis(new a.Vector3(0,1,0),-4),x.add(b),r>=1){let t=l(e,4.504,12.504,4.504,n.a.rightTrousers,i,"rightTrousers",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),x.add(t)}let w=new a.Object3D;if(w.add(s),w.add(d),w.add(h),w.add(m),w.add(g),w.add(x),t){console.log(n.a);let e=n.a.capeRelative;"optifine"===o&&(e=n.a.capeOptifineRelative),"labymod"===o&&(e=n.a.capeLabymodRelative),e=JSON.parse(JSON.stringify(e)),console.log(e);for(let r in e)e[r].x*=t.image.width,e[r].w*=t.image.width,e[r].y*=t.image.height,e[r].h*=t.image.height;console.log(e);let r=new a.Object3D;r.name="capeGroup",r.position.x=0,r.position.y=16,r.position.z=-2.5,r.translateOnAxis(new a.Vector3(0,1,0),8),r.translateOnAxis(new a.Vector3(0,0,1),.5);let i=l(t,10,16,1,e,!1,"cape");i.rotation.x=u(10),i.translateOnAxis(new a.Vector3(0,1,0),-8),i.translateOnAxis(new a.Vector3(0,0,1),-.5),i.rotation.y=u(180),r.add(i),w.add(r)}return w}(o,s,c,d,e._capeType?e._capeType:e.optifine?"optifine":"minecraft");r.addToScene(f),r.playerModel=f,"function"==typeof t&&t()};r._skinImage=new Image,r._skinImage.crossOrigin="anonymous",r._capeImage=new Image,r._capeImage.crossOrigin="anonymous";let s=void 0!==e.cape||void 0!==e.capeUrl||void 0!==e.capeData||void 0!==e.mineskin,d=!1,f=!1,h=!1,p=new a.Texture,m=new a.Texture;if(p.image=r._skinImage,r._skinImage.onload=function(){if(r._skinImage){if(f=!0,console.log("Skin Image Loaded"),void 0===e.slim&&32!==r._skinImage.height){let e=document.createElement("canvas"),t=e.getContext("2d");e.width=r._skinImage.width,e.height=r._skinImage.height,t.drawImage(r._skinImage,0,0),console.log("Slim Detection:");let a=t.getImageData(46,52,1,12).data,n=t.getImageData(54,20,1,12).data,i=!0;for(let e=3;e<48;e+=4){if(255===a[e]){i=!1;break}if(255===n[e]){i=!1;break}}console.log(i),i&&(d=!0)}if(r.options.makeNonTransparentOpaque&&32!==r._skinImage.height){let e=document.createElement("canvas"),n=e.getContext("2d");e.width=r._skinImage.width,e.height=r._skinImage.height,n.drawImage(r._skinImage,0,0);let i=document.createElement("canvas"),o=i.getContext("2d");i.width=r._skinImage.width,i.height=r._skinImage.height;let s=n.getImageData(0,0,e.width,e.height),l=s.data;function t(e,t){return e>0&&t>0&&e<32&&t<32||(e>32&&t>16&&e<64&&t<32||e>16&&t>48&&e<48&&t<64)}for(let r=0;r178||t(n,i))&&(l[r+3]=255)}o.putImageData(s,0,0),console.log(i.toDataURL()),p=new a.CanvasTexture(i)}!f||!h&&s||i||o(p,m)}},r._skinImage.onerror=function(e){console.warn("Skin Image Error"),console.warn(e)},console.log("Has Cape: "+s),s?(m.image=r._capeImage,r._capeImage.onload=function(){r._capeImage&&(h=!0,console.log("Cape Image Loaded"),h&&f&&(i||o(p,m)))},r._capeImage.onerror=function(e){console.warn("Cape Image Error"),console.warn(e),h=!0,f&&(i||o(p))}):(m=null,r._capeImage=null),"string"==typeof e)0===e.indexOf("http")?r._skinImage.src=e:e.length<=16?c("https://minerender.org/nameToUuid.php?name="+e,(function(t,a){if(t)return console.log(t);console.log(a),r._skinImage.src="https://crafatar.com/skins/"+(a.id?a.id:e)})):e.length<=36?image.src="https://crafatar.com/skins/"+e+"?overlay":r._skinImage.src=e;else{if("object"!=typeof e)throw new Error("Invalid texture value");if(e.url?r._skinImage.src=e.url:e.data?r._skinImage.src=e.data:e.username?c("https://minerender.org/nameToUuid.php?name="+e.username,(function(t,a){if(t)return console.log(t);r._skinImage.src="https://crafatar.com/skins/"+(a.id?a.id:e.username)+"?overlay"})):e.uuid?r._skinImage.src="https://crafatar.com/skins/"+e.uuid+"?overlay":e.mineskin&&(r._skinImage.src="https://api.mineskin.org/render/texture/"+e.mineskin),e.cape)if(e.cape.length>36){c(e.cape.startsWith("http")?e.cape:"https://api.capes.dev/get/"+e.cape,(function(t,a){if(t)return console.log(t);a.exists&&(e._capeType=a.type,r._capeImage.src=a.imageUrls.base.full)}))}else{let t="https://api.capes.dev/load/";e.capeUser?t+=e.capeUser:e.username?t+=e.username:e.uuid?t+=e.uuid:console.warn("Couldn't find a user to get a cape from"),c(t+="/"+e.cape,(function(t,a){if(t)return console.log(t);a.exists&&(e._capeType=a.type,r._capeImage.src=a.imageUrls.base.full)}))}else e.capeUrl?r._capeImage.src=e.capeUrl:e.capeData?r._capeImage.src=e.capeData:e.mineskin&&(r._capeImage.src="https://api.mineskin.org/render/texture/"+e.mineskin+"/cape");d=e.slim}}resize(e,t){return this._resize(e,t)}reset(){this._skinImage=null,this._capeImage=null,this._animId&&cancelAnimationFrame(this._animId),this._canvas&&this._canvas.remove()}getPlayerModel(){return this.playerModel}getModelByName(e){return this._scene.getObjectByName(e,!0)}toggleSkinPart(e,t){this._scene.getObjectByName(e,!0).visible=t}}function l(e,t,r,n,i,o,s,l){let u=e.image.width,c=e.image.height,d=new a.BoxGeometry(t,r,n),f=new a.MeshBasicMaterial({map:e,transparent:l||!1,alphaTest:.1,side:l?a.DoubleSide:a.FrontSide});d.computeBoundingBox(),d.faceVertexUvs[0]=[];let h=["right","left","top","bottom","front","back"],p=[];for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:this.clock.getDelta(),t=this.renderer.getRenderTarget(),r=!1,a=void 0,n=void 0,i=this.passes.length;for(n=0;n=0&&n<=126||n>=161&&n<=223)&&a0;){var r=this.getUint8();if(e--,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getSjisStringsAsUnicode:function(e){for(var t=[];e>0;){var r=this.getUint8();if(e--,0===r)break;t.push(r)}for(;e>0;)this.getUint8(),e--;return this.encoder.s2u(new Uint8Array(t))},getUnicodeStrings:function(e){for(var t="";e>0;){var r=this.getUint16();if(e-=2,0===r)break;t+=String.fromCharCode(r)}for(;e>0;)this.getUint8(),e--;return t},getTextBuffer:function(){var e=this.getUint32();return this.getUnicodeStrings(e)}},a.prototype={constructor:a,leftToRightVector3:function(e){e[2]=-e[2]},leftToRightQuaternion:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightEuler:function(e){e[0]=-e[0],e[1]=-e[1]},leftToRightIndexOrder:function(e){var t=e[2];e[2]=e[0],e[0]=t},leftToRightVector3Range:function(e,t){var r=-t[2];t[2]=-e[2],e[2]=r},leftToRightEulerRange:function(e,t){var r=-t[0],a=-t[1];t[0]=-e[0],t[1]=-e[1],e[0]=r,e[1]=a}},n.prototype.parsePmd=function(e,t){var a,n={},i=new r(e);return n.metadata={},n.metadata.format="pmd",n.metadata.coordinateSystem="left",function(){var e=n.metadata;if(e.magic=i.getChars(3),"Pmd"!==e.magic)throw"PMD file magic is not Pmd, but "+e.magic;e.version=i.getFloat32(),e.modelName=i.getSjisStringsAsUnicode(20),e.comment=i.getSjisStringsAsUnicode(256)}(),function(){var e,t=n.metadata;t.vertexCount=i.getUint32(),n.vertices=[];for(var r=0;r0&&(a.englishModelName=i.getSjisStringsAsUnicode(20),a.englishComment=i.getSjisStringsAsUnicode(256)),function(){var e=n.metadata;if(0!==e.englishCompatibility){n.englishBoneNames=[];for(var t=0;t=2.0 are supported. Use LegacyGLTFLoader instead.")):(m.extensionsUsed&&(m.extensionsUsed.indexOf(r.KHR_LIGHTS)>=0&&(p[r.KHR_LIGHTS]=new i(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_UNLIT)>=0&&(p[r.KHR_MATERIALS_UNLIT]=new o(m)),m.extensionsUsed.indexOf(r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS)>=0&&(p[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]=new f),m.extensionsUsed.indexOf(r.KHR_DRACO_MESH_COMPRESSION)>=0&&(p[r.KHR_DRACO_MESH_COMPRESSION]=new d(this.dracoLoader)),m.extensionsUsed.indexOf(r.MSFT_TEXTURE_DDS)>=0&&(p[r.MSFT_TEXTURE_DDS]=new n)),new k(m,p,{path:t||this.path||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse((function(e,t,r,a,n){l({scene:e,scenes:t,cameras:r,animations:a,asset:n})}),u))}};var r={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS:"KHR_lights",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function n(){if(!a.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=r.MSFT_TEXTURE_DDS,this.ddsLoader=new a.DDSLoader}function i(e){this.name=r.KHR_LIGHTS,this.lights={};var t=(e.extensions&&e.extensions[r.KHR_LIGHTS]||{}).lights||{};for(var n in t){var i,o=t[n],s=(new a.Color).fromArray(o.color);switch(o.type){case"directional":(i=new a.DirectionalLight(s)).target.position.set(0,0,1),i.add(i.target);break;case"point":i=new a.PointLight(s);break;case"spot":i=new a.SpotLight(s),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;case"ambient":i=new a.AmbientLight(s)}i&&(i.decay=2,void 0!==o.intensity&&(i.intensity=o.intensity),i.name=o.name||"light_"+n,this.lights[n]=i)}}function o(e){this.name=r.KHR_MATERIALS_UNLIT}o.prototype.getMaterialType=function(e){return a.MeshBasicMaterial},o.prototype.extendParams=function(e,t,r){var n=[];e.color=new a.Color(1,1,1),e.opacity=1;var i=t.pbrMetallicRoughness;if(i){if(Array.isArray(i.baseColorFactor)){var o=i.baseColorFactor;e.color.fromArray(o),e.opacity=o[3]}void 0!==i.baseColorTexture&&n.push(r.assignTexture(e,"map",i.baseColorTexture.index))}return Promise.all(n)};var s="glTF",l=12,u={JSON:1313821514,BIN:5130562};function c(e){this.name=r.KHR_BINARY_GLTF,this.content=null,this.body=null;var t=new DataView(e,0,l);if(this.header={magic:a.LoaderUtils.decodeText(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var n=new DataView(e,l),i=0;i",s).replace("#include ",l).replace("#include ",u).replace("#include ",c).replace("#include ",d);delete o.roughness,delete o.metalness,delete o.roughnessMap,delete o.metalnessMap,o.specular={value:(new a.Color).setHex(1118481)},o.glossiness={value:.5},o.specularMap={value:null},o.glossinessMap={value:null},e.vertexShader=i.vertexShader,e.fragmentShader=f,e.uniforms=o,e.defines={STANDARD:""},e.color=new a.Color(1,1,1),e.opacity=1;var h=[];if(Array.isArray(n.diffuseFactor)){var p=n.diffuseFactor;e.color.fromArray(p),e.opacity=p[3]}if(void 0!==n.diffuseTexture&&h.push(r.assignTexture(e,"map",n.diffuseTexture.index)),e.emissive=new a.Color(0,0,0),e.glossiness=void 0!==n.glossinessFactor?n.glossinessFactor:1,e.specular=new a.Color(1,1,1),Array.isArray(n.specularFactor)&&e.specular.fromArray(n.specularFactor),void 0!==n.specularGlossinessTexture){var m=n.specularGlossinessTexture.index;h.push(r.assignTexture(e,"glossinessMap",m)),h.push(r.assignTexture(e,"specularMap",m))}return Promise.all(h)},createMaterial:function(e){var t=new a.ShaderMaterial({defines:e.defines,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,fog:!0,lights:!0,opacity:e.opacity,transparent:e.transparent});return t.isGLTFSpecularGlossinessMaterial=!0,t.color=e.color,t.map=void 0===e.map?null:e.map,t.lightMap=null,t.lightMapIntensity=1,t.aoMap=void 0===e.aoMap?null:e.aoMap,t.aoMapIntensity=1,t.emissive=e.emissive,t.emissiveIntensity=1,t.emissiveMap=void 0===e.emissiveMap?null:e.emissiveMap,t.bumpMap=void 0===e.bumpMap?null:e.bumpMap,t.bumpScale=1,t.normalMap=void 0===e.normalMap?null:e.normalMap,e.normalScale&&(t.normalScale=e.normalScale),t.displacementMap=null,t.displacementScale=1,t.displacementBias=0,t.specularMap=void 0===e.specularMap?null:e.specularMap,t.specular=e.specular,t.glossinessMap=void 0===e.glossinessMap?null:e.glossinessMap,t.glossiness=e.glossiness,t.alphaMap=null,t.envMap=void 0===e.envMap?null:e.envMap,t.envMapIntensity=1,t.refractionRatio=.98,t.extensions.derivatives=!0,t},cloneMaterial:function(e){var t=e.clone();t.isGLTFSpecularGlossinessMaterial=!0;for(var r=this.specularGlossinessParams,a=0,n=r.length;a=2&&(n[i+1]=e.getY(i)),r>=3&&(n[i+2]=e.getZ(i)),r>=4&&(n[i+3]=e.getW(i));return new a.BufferAttribute(n,r,e.normalized)}return e.clone()}function k(e,r,n){this.json=e||{},this.extensions=r||{},this.options=n||{},this.cache=new t,this.primitiveCache=[],this.textureLoader=new a.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new a.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function B(e,t,r){var a=t.attributes;for(var n in a){var i=_[n],o=r[a[n]];i&&(i in e.attributes||e.addAttribute(i,o))}void 0===t.indices||e.index||e.setIndex(r[t.indices])}return k.prototype.parse=function(e,t){var r=this.json;this.cache.removeAll(),this.markDefs(),this.getMultiDependencies(["scene","animation","camera"]).then((function(t){var a=t.scenes||[],n=a[r.scene||0],i=t.animations||[],o=r.asset,s=t.cameras||[];e(n,a,s,i,o)})).catch(t)},k.prototype.markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],a={},n={},i=0,o=t.length;i=2&&o.setY(_,M[T*l+1]),l>=3&&o.setZ(_,M[T*l+2]),l>=4&&o.setW(_,M[T*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},k.prototype.loadTexture=function(e){var t,n=this,i=this.json,o=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=i.textures[e],c=u.extensions||{},d=(t=c[r.MSFT_TEXTURE_DDS]?i.images[c[r.MSFT_TEXTURE_DDS].source]:i.images[u.source]).uri,f=!1;return void 0!==t.bufferView&&(d=n.getDependency("bufferView",t.bufferView).then((function(e){f=!0;var r=new Blob([e],{type:t.mimeType});return d=l.createObjectURL(r)}))),Promise.resolve(d).then((function(e){var t=a.Loader.Handlers.get(e);return t||(t=c[r.MSFT_TEXTURE_DDS]?n.extensions[r.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(r,a){t.load(N(e,o.path),r,void 0,a)}))})).then((function(e){!0===f&&l.revokeObjectURL(d),e.flipY=!1,void 0!==u.name&&(e.name=u.name),c[r.MSFT_TEXTURE_DDS]||(e.format=void 0!==u.format?T[u.format]:a.RGBAFormat),void 0!==u.internalFormat&&e.format!==T[u.internalFormat]&&console.warn("THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. internalFormat will be forced to be the same value as format."),e.type=void 0!==u.type?S[u.type]:a.UnsignedByteType;var t=(i.samplers||{})[u.sampler]||{};return e.magFilter=A[t.magFilter]||a.LinearFilter,e.minFilter=A[t.minFilter]||a.LinearMipMapLinearFilter,e.wrapS=M[t.wrapS]||a.RepeatWrapping,e.wrapT=M[t.wrapT]||a.RepeatWrapping,e}))},k.prototype.assignTexture=function(e,t,r){return this.getDependency("texture",r).then((function(r){e[t]=r}))},k.prototype.loadMaterial=function(e){this.json;var t,n=this.extensions,i=this.json.materials[e],o={},s=i.extensions||{},l=[];if(s[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];t=u.getMaterialType(i),l.push(u.extendParams(o,i,this))}else if(s[r.KHR_MATERIALS_UNLIT]){var c=n[r.KHR_MATERIALS_UNLIT];t=c.getMaterialType(i),l.push(c.extendParams(o,i,this))}else{t=a.MeshStandardMaterial;var d=i.pbrMetallicRoughness||{};if(o.color=new a.Color(1,1,1),o.opacity=1,Array.isArray(d.baseColorFactor)){var f=d.baseColorFactor;o.color.fromArray(f),o.opacity=f[3]}if(void 0!==d.baseColorTexture&&l.push(this.assignTexture(o,"map",d.baseColorTexture.index)),o.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,o.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture){var h=d.metallicRoughnessTexture.index;l.push(this.assignTexture(o,"metalnessMap",h)),l.push(this.assignTexture(o,"roughnessMap",h))}}!0===i.doubleSided&&(o.side=a.DoubleSide);var p=i.alphaMode||L;return p===O?o.transparent=!0:(o.transparent=!1,p===C&&(o.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"normalMap",i.normalTexture.index)),o.normalScale=new a.Vector2(1,1),void 0!==i.normalTexture.scale&&o.normalScale.set(i.normalTexture.scale,i.normalTexture.scale)),void 0!==i.occlusionTexture&&t!==a.MeshBasicMaterial&&(l.push(this.assignTexture(o,"aoMap",i.occlusionTexture.index)),void 0!==i.occlusionTexture.strength&&(o.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==a.MeshBasicMaterial&&(o.emissive=(new a.Color).fromArray(i.emissiveFactor)),void 0!==i.emissiveTexture&&t!==a.MeshBasicMaterial&&l.push(this.assignTexture(o,"emissiveMap",i.emissiveTexture.index)),Promise.all(l).then((function(){var e;return e=t===a.ShaderMaterial?n[r.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(o):new t(o),void 0!==i.name&&(e.name=i.name),e.normalScale&&(e.normalScale.y=-e.normalScale.y),e.map&&(e.map.encoding=a.sRGBEncoding),e.emissiveMap&&(e.emissiveMap.encoding=a.sRGBEncoding),i.extras&&(e.userData=i.extras),e}))},k.prototype.loadGeometries=function(e){var t=this,n=this.extensions,i=this.primitiveCache;return this.getDependencies("accessor").then((function(o){for(var s=[],l=0,u=e.length;l1))return A;A.name+="_"+c,s.add(A)}return s}))}))},k.prototype.loadCamera=function(e){var t,r=this.json.cameras[e],n=r[r.type];if(n)return"perspective"===r.type?t=new a.PerspectiveCamera(a.Math.radToDeg(n.yfov),n.aspectRatio||1,n.znear||1,n.zfar||2e6):"orthographic"===r.type&&(t=new a.OrthographicCamera(n.xmag/-2,n.xmag/2,n.ymag/2,n.ymag/-2,n.znear,n.zfar)),void 0!==r.name&&(t.name=r.name),r.extras&&(t.userData=r.extras),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")},k.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then((function(e){return r.inverseBindMatrices=e,r}))},k.prototype.loadAnimation=function(e){this.json;var t=this.json.animations[e];return this.getMultiDependencies(["accessor","node"]).then((function(r){for(var n=[],i=0,o=t.channels.length;i1&&(s.name+="_instance_"+i[o.mesh]++)}else if(void 0!==o.camera)s=e.cameras[o.camera];else if(o.extensions&&o.extensions[r.KHR_LIGHTS]&&void 0!==o.extensions[r.KHR_LIGHTS].light){s=t[r.KHR_LIGHTS].lights[o.extensions[r.KHR_LIGHTS].light]}else s=new a.Object3D;if(void 0!==o.name&&(s.name=a.PropertyBinding.sanitizeNodeName(o.name)),o.extras&&(s.userData=o.extras),void 0!==o.matrix){var f=new a.Matrix4;f.fromArray(o.matrix),s.applyMatrix(f)}else void 0!==o.translation&&s.position.fromArray(o.translation),void 0!==o.rotation&&s.quaternion.fromArray(o.rotation),void 0!==o.scale&&s.scale.fromArray(o.scale);return s}))},k.prototype.loadScene=function(){function e(t,r,n,i,o){var s=i[t],l=n.nodes[t];if(void 0!==l.skin)for(var u=!0===s.isGroup?s.children:[s],c=0,d=u.length;c(n=s.indexOf("\n"))&&i=e.byteLength||!(a=r(e)))return t(1,"no header found");if(!(n=a.match(/^#\?(\S+)$/)))return t(3,"bad initial token");for(u.valid|=1,u.programtype=n[1],u.string+=a+"\n";!1!==(a=r(e));)if(u.string+=a+"\n","#"!==a.charAt(0)){if((n=a.match(i))&&(u.gamma=parseFloat(n[1],10)),(n=a.match(o))&&(u.exposure=parseFloat(n[1],10)),(n=a.match(s))&&(u.valid|=2,u.format=n[1]),(n=a.match(l))&&(u.valid|=4,u.height=parseInt(n[1],10),u.width=parseInt(n[2],10)),2&u.valid&&4&u.valid)break}else u.comments+=a+"\n";return 2&u.valid?4&u.valid?u:t(3,"missing image size specifier"):t(3,"missing format specifier")}(n);if(-1!==i){var o=i.width,s=i.height,l=function(e,r,a){var n,i,o,s,l,u,c,d,f,h,p,m,v,g=r,y=a;if(g<8||g>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(g!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");if(!(n=new Uint8Array(4*r*a))||!n.length)return t(4,"unable to allocate buffer space");for(i=0,o=0,d=4*g,v=new Uint8Array(4),u=new Uint8Array(d);y>0&&oe.byteLength)return t(1);if(v[0]=e[o++],v[1]=e[o++],v[2]=e[o++],v[3]=e[o++],2!=v[0]||2!=v[1]||(v[2]<<8|v[3])!=g)return t(3,"bad rgbe scanline format");for(c=0;c128)&&(s-=128),0===s||c+s>d)return t(3,"bad scanline data");if(m)for(l=e[o++],f=0;f0){var w=[];for(var b in v)h=v[b],w[b]=h.name;m="Adding mesh(es) ("+w.length+": "+w+") from input mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)"}else m="Not adding mesh: "+o,m+=" ("+(100*e.progress.numericalValue).toFixed(2)+"%)";var A=this.callbacks.onProgress;t.isValid(A)&&A(new CustomEvent("MeshBuilderEvent",{detail:{type:"progress",modelName:e.params.meshName,text:m,numericalValue:e.progress.numericalValue}}));return v},r.prototype.updateMaterials=function(e){var r,a,i=e.materials.materialCloneInstructions;if(t.isValid(i)){var o=i.materialNameOrg,s=this.materials[o];if(t.isValid(o)){r=s.clone(),a=i.materialName,r.name=a;var l=i.materialProperties;for(var u in l)r.hasOwnProperty(u)&&l.hasOwnProperty(u)&&(r[u]=l[u]);this.materials[a]=r}else console.warn('Requested material "'+o+'" is not available!')}var c=e.materials.serializedMaterials;if(t.isValid(c)&&Object.keys(c).length>0){var d,f=new n.MaterialLoader;for(a in c)d=c[a],t.isValid(d)&&(r=f.parse(d),this.logging.enabled&&console.info('De-serialized material with name "'+a+'" will be added.'),this.materials[a]=r)}if(c=e.materials.runtimeMaterials,t.isValid(c)&&Object.keys(c).length>0)for(a in c)r=c[a],this.logging.enabled&&console.info('Material with name "'+a+'" will be added.'),this.materials[a]=r},r.prototype.getMaterialsJSON=function(){var e,t={};for(var r in this.materials)e=this.materials[r],t[r]=e.toJSON();return t},r.prototype.getMaterials=function(){return this.materials},r}(),s.WorkerRunnerRefImpl=function(){function e(){var e=this;self.addEventListener("message",(function(t){e.processMessage(t.data)}),!1)}return e.prototype.applyProperties=function(e,t){var r,a,n;for(r in t)a="set"+r.substring(0,1).toLocaleUpperCase()+r.substring(1),n=t[r],"function"==typeof e[a]?e[a](n):e.hasOwnProperty(r)&&(e[r]=n)},e.prototype.processMessage=function(e){if("run"===e.cmd){var t={callbackMeshBuilder:function(e){self.postMessage(e)},callbackProgress:function(t){e.logging.enabled&&e.logging.debug&&console.debug("WorkerRunner: progress: "+t)}},r=new Parser;"function"==typeof r.setLogging&&r.setLogging(e.logging.enabled,e.logging.debug),this.applyProperties(r,e.params),this.applyProperties(r,e.materials),this.applyProperties(r,t),r.workerScope=self,r.parse(e.data.input,e.data.options),e.logging.enabled&&console.log("WorkerRunner: Run complete!"),t.callbackMeshBuilder({cmd:"complete",msg:"WorkerRunner completed run."})}else console.error("WorkerRunner: Received unknown command: "+e.cmd)},e}(),s.WorkerSupport=function(){var e="2.2.0",t=s.Validator,r=function(){function e(){this._reset()}return e.prototype._reset=function(){this.logging={enabled:!0,debug:!1},this.worker=null,this.runnerImplName=null,this.callbacks={meshBuilder:null,onLoad:null},this.terminateRequested=!1,this.queuedMessage=null,this.started=!1,this.forceCopy=!1},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.setForceCopy=function(e){this.forceCopy=!0===e},e.prototype.initWorker=function(e,t){this.runnerImplName=t;var r=new Blob([e],{type:"application/javascript"});this.worker=new Worker(o.URL.createObjectURL(r)),this.worker.onmessage=this._receiveWorkerMessage,this.worker.runtimeRef=this,this._postMessage()},e.prototype._receiveWorkerMessage=function(e){var t=e.data;switch(t.cmd){case"meshData":case"materialData":case"imageData":this.runtimeRef.callbacks.meshBuilder(t);break;case"complete":this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run is complete. Terminating application on request!"),this.runtimeRef._terminate());break;case"error":console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Reported error: "+t.msg),this.runtimeRef.queuedMessage=null,this.started=!1,this.runtimeRef.callbacks.onLoad(t.msg),this.runtimeRef.terminateRequested&&(this.runtimeRef.logging.enabled&&console.info("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Run reported error. Terminating application on request!"),this.runtimeRef._terminate());break;default:console.error("WorkerSupport ["+this.runtimeRef.runnerImplName+"]: Received unknown command: "+t.cmd)}},e.prototype.setCallbacks=function(e,r){this.callbacks.meshBuilder=t.verifyInput(e,this.callbacks.meshBuilder),this.callbacks.onLoad=t.verifyInput(r,this.callbacks.onLoad)},e.prototype.run=function(e){if(t.isValid(this.queuedMessage))console.warn("Already processing message. Rejecting new run instruction");else{if(this.queuedMessage=e,this.started=!0,!t.isValid(this.callbacks.meshBuilder))throw'Unable to run as no "MeshBuilder" callback is set.';if(!t.isValid(this.callbacks.onLoad))throw'Unable to run as no "onLoad" callback is set.';"run"!==e.cmd&&(e.cmd="run"),t.isValid(e.logging)?(e.logging.enabled=!0===e.logging.enabled,e.logging.debug=!0===e.logging.debug):e.logging={enabled:!0,debug:!1},this._postMessage()}},e.prototype._postMessage=function(){var e;t.isValid(this.queuedMessage)&&t.isValid(this.worker)&&(this.queuedMessage.data.input instanceof ArrayBuffer?(e=this.forceCopy?this.queuedMessage.data.input.slice(0):this.queuedMessage.data.input,this.worker.postMessage(this.queuedMessage,[e])):this.worker.postMessage(this.queuedMessage))},e.prototype.setTerminateRequested=function(e){this.terminateRequested=!0===e,this.terminateRequested&&t.isValid(this.worker)&&!t.isValid(this.queuedMessage)&&this.started&&(this.logging.enabled&&console.info("Worker is terminated immediately as it is not running!"),this._terminate())},e.prototype._terminate=function(){this.worker.terminate(),this._reset()},e}();function a(){if(console.info("Using THREE.LoaderSupport.WorkerSupport version: "+e),this.logging={enabled:!0,debug:!1},void 0===o.Worker)throw"This browser does not support web workers!";if(void 0===o.Blob)throw"This browser does not support Blob!";if("function"!=typeof o.URL.createObjectURL)throw"This browser does not support Object creation from URL!";this.loaderWorker=new r}a.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t,this.loaderWorker.setLogging(this.logging.enabled,this.logging.debug)},a.prototype.setForceWorkerDataCopy=function(e){this.loaderWorker.setForceCopy(e)},a.prototype.validate=function(e,r,a,o,u){if(!t.isValid(this.loaderWorker.worker)){this.logging.enabled&&(console.info("WorkerSupport: Building worker code..."),console.time("buildWebWorkerCode")),t.isValid(u)?this.logging.enabled&&console.info('WorkerSupport: Using "'+u.name+'" as Runner class for worker.'):(u=s.WorkerRunnerRefImpl,this.logging.enabled&&console.info('WorkerSupport: Using DEFAULT "THREE.LoaderSupport.WorkerRunnerRefImpl" as Runner class for worker.'));var c=e(i,l);c+="var Parser = "+r+";\n\n",c+=l(u.name,u),c+="new "+u.name+"();\n\n";var d=this;if(t.isValid(a)&&a.length>0){var f="";!function e(t,r){if(0===r.length)d.loaderWorker.initWorker(f+c,u.name),d.logging.enabled&&console.timeEnd("buildWebWorkerCode");else{var a=new n.FileLoader;a.setPath(t),a.setResponseType("text"),a.load(r[0],(function(a){f+=a,e(t,r)})),r.shift()}}(o,a)}else this.loaderWorker.initWorker(c,u.name),this.logging.enabled&&console.timeEnd("buildWebWorkerCode")}},a.prototype.setCallbacks=function(e,t){this.loaderWorker.setCallbacks(e,t)},a.prototype.run=function(e){this.loaderWorker.run(e)},a.prototype.setTerminateRequested=function(e){this.loaderWorker.setTerminateRequested(e)};var i=function(e,t){var r,a=e+" = {\n";for(var n in t)"string"==typeof(r=t[n])||r instanceof String?a+="\t"+n+': "'+(r=(r=r.replace("\n","\\n")).replace("\r","\\r"))+'",\n':r instanceof Array?a+="\t"+n+": ["+r+"],\n":Number.isInteger(r)?a+="\t"+n+": "+r+",\n":"function"==typeof r&&(a+="\t"+n+": "+r+",\n");return a+="}\n\n"},l=function(e,r,a,n,i){var o,s,l="",u=t.isValid(a)?a:r.name;for(var c in i=t.verifyInput(i,[]),r.prototype)o=r.prototype[c],"constructor"===c?s="\tfunction "+u+o.toString().replace("function","")+";\n\n":"function"==typeof o&&i.indexOf(c)<0&&(l+="\t"+u+".prototype."+c+" = "+o.toString()+";\n\n");l+="\treturn "+u+";\n",l+="})();\n\n";var d="";return t.isValid(n)&&(d+="\n",d+=u+".prototype = Object.create( "+n+".prototype );\n",d+=u+".constructor = "+u+";\n",d+="\n"),t.isValid(s)?l=e+" = (function () {\n\n"+d+s+l:(s=e+" = (function () {\n\n",l=(s+=d+"\t"+r.prototype.constructor.toString()+"\n\n")+l),l};return a}(),s.WorkerDirector=function(){var e="2.2.0",t=s.Validator,r=16,a=8192;function i(n){if(console.info("Using THREE.LoaderSupport.WorkerDirector version: "+e),this.logging={enabled:!0,debug:!1},this.maxQueueSize=a,this.maxWebWorkers=r,this.crossOrigin=null,!t.isValid(n))throw"Provided invalid classDef: "+n;this.workerDescription={classDef:n,globalCallbacks:{},workerSupports:{},forceWorkerDataCopy:!0},this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0,this.callbackOnFinishedProcessing=null}return i.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},i.prototype.getMaxQueueSize=function(){return this.maxQueueSize},i.prototype.getMaxWebWorkers=function(){return this.maxWebWorkers},i.prototype.setCrossOrigin=function(e){this.crossOrigin=e},i.prototype.setForceWorkerDataCopy=function(e){this.workerDescription.forceWorkerDataCopy=!0===e},i.prototype.prepareWorkers=function(e,i,o){t.isValid(e)&&(this.workerDescription.globalCallbacks=e),this.maxQueueSize=Math.min(i,a),this.maxWebWorkers=Math.min(o,r),this.maxWebWorkers=Math.min(this.maxWebWorkers,this.maxQueueSize),this.objectsCompleted=0,this.instructionQueue=[],this.instructionQueuePointer=0;for(var s=0;s0&&this.instructionQueuePointer0},i.prototype.processQueue=function(){var e,t;for(var r in this.workerDescription.workerSupports)(t=this.workerDescription.workerSupports[r]).inUse||(this.instructionQueuePointer=0?s.substring(0,l):s;u=u.toLowerCase();var c=l>=0?s.substring(l+1):"";if(c=c.trim(),"newmtl"===u)r={name:c},i[c]=r;else if(r)if("ka"===u||"kd"===u||"ks"===u){var d=c.split(a,3);r[u]=[parseFloat(d[0]),parseFloat(d[1]),parseFloat(d[2])]}else r[u]=c}}var f=new n.MaterialCreator(this.texturePath||this.path,this.materialOptions);return f.setCrossOrigin(this.crossOrigin),f.setManager(this.manager),f.setMaterials(i),f}},(n.MaterialCreator=function(e,t){this.baseUrl=e||"",this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.side=this.options&&this.options.side?this.options.side:a.FrontSide,this.wrap=this.options&&this.options.wrap?this.options.wrap:a.RepeatWrapping}).prototype={constructor:n.MaterialCreator,crossOrigin:"Anonymous",setCrossOrigin:function(e){this.crossOrigin=e},setManager:function(e){this.manager=e},setMaterials:function(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}},convert:function(e){if(!this.options)return e;var t={};for(var r in e){var a=e[r],n={};for(var i in t[r]=n,a){var o=!0,s=a[i],l=i.toLowerCase();switch(l){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(s=[s[0]/255,s[1]/255,s[2]/255]),this.options&&this.options.ignoreZeroRGBs&&0===s[0]&&0===s[1]&&0===s[2]&&(o=!1)}o&&(n[l]=s)}}return t},preload:function(){for(var e in this.materialsInfo)this.create(e)},getIndex:function(e){return this.nameLookup[e]},getAsArray:function(){var e=0;for(var t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray},create:function(e){return void 0===this.materials[e]&&this.createMaterial_(e),this.materials[e]},createMaterial_:function(e){var t=this,r=this.materialsInfo[e],n={name:e,side:this.side};function i(e,r){if(!n[e]){var a,i,o=t.getTextureParams(r,n),s=t.loadTexture((a=t.baseUrl,"string"!=typeof(i=o.url)||""===i?"":/^https?:\/\//i.test(i)?i:a+i));s.repeat.copy(o.scale),s.offset.copy(o.offset),s.wrapS=t.wrap,s.wrapT=t.wrap,n[e]=s}}for(var o in r){var s,l=r[o];if(""!==l)switch(o.toLowerCase()){case"kd":n.color=(new a.Color).fromArray(l);break;case"ks":n.specular=(new a.Color).fromArray(l);break;case"map_kd":i("map",l);break;case"map_ks":i("specularMap",l);break;case"norm":i("normalMap",l);break;case"map_bump":case"bump":i("bumpMap",l);break;case"ns":n.shininess=parseFloat(l);break;case"d":(s=parseFloat(l))<1&&(n.opacity=s,n.transparent=!0);break;case"tr":s=parseFloat(l),this.options&&this.options.invertTrProperty&&(s=1-s),s>0&&(n.opacity=1-s,n.transparent=!0)}}return this.materials[e]=new a.MeshPhongMaterial(n),this.materials[e]},getTextureParams:function(e,t){var r,n={scale:new a.Vector2(1,1),offset:new a.Vector2(0,0)},i=e.split(/\s+/);return(r=i.indexOf("-bm"))>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),(r=i.indexOf("-s"))>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),(r=i.indexOf("-o"))>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n},loadTexture:function(e,t,r,n,i){var o,s=a.Loader.Handlers.get(e),l=void 0!==this.manager?this.manager:a.DefaultLoadingManager;return null===s&&(s=new a.TextureLoader(l)),s.setCrossOrigin&&s.setCrossOrigin(this.crossOrigin),o=s.load(e,r,n,i),void 0!==t&&(o.mapping=t),o}},t.default=n},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _three=__webpack_require__(0),THREE=_interopRequireWildcard(_three);function _interopRequireWildcard(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var Volume=function(e,t,r,a,n){if(arguments.length>0){switch(this.xLength=Number(e)||1,this.yLength=Number(t)||1,this.zLength=Number(r)||1,a){case"Uint8":case"uint8":case"uchar":case"unsigned char":case"uint8_t":this.data=new Uint8Array(n);break;case"Int8":case"int8":case"signed char":case"int8_t":this.data=new Int8Array(n);break;case"Int16":case"int16":case"short":case"short int":case"signed short":case"signed short int":case"int16_t":this.data=new Int16Array(n);break;case"Uint16":case"uint16":case"ushort":case"unsigned short":case"unsigned short int":case"uint16_t":this.data=new Uint16Array(n);break;case"Int32":case"int32":case"int":case"signed int":case"int32_t":this.data=new Int32Array(n);break;case"Uint32":case"uint32":case"uint":case"unsigned int":case"uint32_t":this.data=new Uint32Array(n);break;case"longlong":case"long long":case"long long int":case"signed long long":case"signed long long int":case"int64":case"int64_t":case"ulonglong":case"unsigned long long":case"unsigned long long int":case"uint64":case"uint64_t":throw"Error in THREE.Volume constructor : this type is not supported in JavaScript";case"Float32":case"float32":case"float":this.data=new Float32Array(n);break;case"Float64":case"float64":case"double":this.data=new Float64Array(n);break;default:this.data=new Uint8Array(n)}if(this.data.length!==this.xLength*this.yLength*this.zLength)throw"Error in THREE.Volume constructor, lengths are not matching arrayBuffer size"}this.spacing=[1,1,1],this.offset=[0,0,0],this.matrix=new THREE.Matrix3,this.matrix.identity();var i=-1/0;Object.defineProperty(this,"lowerThreshold",{get:function(){return i},set:function(e){i=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}});var o=1/0;Object.defineProperty(this,"upperThreshold",{get:function(){return o},set:function(e){o=e,this.sliceList.forEach((function(e){e.geometryNeedsUpdate=!0}))}}),this.sliceList=[]};Volume.prototype={constructor:Volume,getData:function(e,t,r){return this.data[r*this.xLength*this.yLength+t*this.xLength+e]},access:function(e,t,r){return r*this.xLength*this.yLength+t*this.xLength+e},reverseAccess:function(e){var t=Math.floor(e/(this.yLength*this.xLength)),r=Math.floor((e-t*this.yLength*this.xLength)/this.xLength);return[e-t*this.yLength*this.xLength-r*this.xLength,r,t]},map:function(e,t){var r=this.data.length;t=t||this;for(var a=0;a.9})),jDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[1]))>.9})),kDirection=[firstDirection,secondDirection,axisInIJK].find((function(e){return Math.abs(e.dot(base[2]))>.9})),argumentsWithInversion=["volume.xLength-1-","volume.yLength-1-","volume.zLength-1-"],argArray=[iDirection,jDirection,kDirection].map((function(e,t){return(e.dot(base[t])>0?"":argumentsWithInversion[t])+(e===axisInIJK?"IJKIndex":e.argVar)})),argString=argArray.join(",");return sliceAccess=eval("(function sliceAccess (i,j) {return volume.access( "+argString+");})"),{iLength:iLength,jLength:jLength,sliceAccess:sliceAccess,matrix:planeMatrix,planeWidth:planeWidth,planeHeight:planeHeight}},extractSlice:function(e,t){var r=new THREE.VolumeSlice(this,t,e);return this.sliceList.push(r),r},repaintAllSlices:function(){return this.sliceList.forEach((function(e){e.repaint()})),this},computeMinMax:function(){var e=1/0,t=-1/0,r=this.data.length,a=0;for(a=0;a","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","float l = linearToRelativeLuminance( texel.rgb );","gl_FragColor = vec4( l, l, l, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},averageLuminance:{value:1},luminanceMap:{value:null},maxLuminance:{value:16},minLuminance:{value:.01},middleGrey:{value:.6}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform float middleGrey;","uniform float minLuminance;","uniform float maxLuminance;","#ifdef ADAPTED_LUMINANCE","uniform sampler2D luminanceMap;","#else","uniform float averageLuminance;","#endif","vec3 ToneMap( vec3 vColor ) {","#ifdef ADAPTED_LUMINANCE","float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;","#else","float fLumAvg = averageLuminance;","#endif","float fLumPixel = linearToRelativeLuminance( vColor );","float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );","float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);","return fLumCompressed * vColor;","}","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={defines:{KERNEL_SIZE_FLOAT:"25.0",KERNEL_SIZE_INT:"25"},uniforms:{tDiffuse:{value:null},uImageIncrement:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(.001953125,0)},cKernel:{value:[]}},vertexShader:["uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vUv = uv - ( ( KERNEL_SIZE_FLOAT - 1.0 ) / 2.0 ) * uImageIncrement;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float cKernel[ KERNEL_SIZE_INT ];","uniform sampler2D tDiffuse;","uniform vec2 uImageIncrement;","varying vec2 vUv;","void main() {","vec2 imageCoord = vUv;","vec4 sum = vec4( 0.0, 0.0, 0.0, 0.0 );","for( int i = 0; i < KERNEL_SIZE_INT; i ++ ) {","sum += texture2D( tDiffuse, imageCoord ) * cKernel[ i ];","imageCoord += uImageIncrement;","}","gl_FragColor = sum;","}"].join("\n"),buildKernel:function(e){function t(e,t){return Math.exp(-e*e/(2*t*t))}var r,a,n,i,o=2*Math.ceil(3*e)+1;for(o>25&&(o=25),i=.5*(o-1),a=new Array(o),n=0,r=0;r","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float maxblur;","uniform float aperture;","uniform float nearClip;","uniform float farClip;","uniform float focus;","uniform float aspect;","#include ","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, nearClip, farClip );","\t#else","\treturn orthographicDepthToViewZ( depth, nearClip, farClip );","\t#endif","}","void main() {","vec2 aspectcorrect = vec2( 1.0, aspect );","float viewZ = getViewZ( getDepth( vUv ) );","float factor = ( focus + viewZ );","vec2 dofblur = vec2 ( clamp( factor * aperture, -maxblur, maxblur ) );","vec2 dofblur9 = dofblur * 0.9;","vec2 dofblur7 = dofblur * 0.7;","vec2 dofblur4 = dofblur * 0.4;","vec4 col = vec4( 0.0 );","col += texture2D( tColor, vUv.xy );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.15, 0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.37, 0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.37, -0.15 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.15, -0.37 ) * aspectcorrect ) * dofblur9 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.40, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur7 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, -0.4 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, 0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.4, 0.0 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( -0.29, -0.29 ) * aspectcorrect ) * dofblur4 );","col += texture2D( tColor, vUv.xy + ( vec2( 0.0, 0.4 ) * aspectcorrect ) * dofblur4 );","gl_FragColor = col / 41.0;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},tSize:{value:new a.Vector2(256,256)},center:{value:new a.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","float s = sin( angle ), c = cos( angle );","vec2 tex = vUv * tSize - center;","vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","return ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","vec4 color = texture2D( tDiffuse, vUv );","float average = ( color.r + color.g + color.b ) / 3.0;","gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 cTextureScreen = texture2D( tDiffuse, vUv );","float dx = rand( vUv + time );","vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );","vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );","cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;","cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );","if( grayscale ) {","cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );","}","gl_FragColor = vec4( cResult, cTextureScreen.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform int byp;","uniform sampler2D tDiffuse;","uniform sampler2D tDisp;","uniform float amount;","uniform float angle;","uniform float seed;","uniform float seed_x;","uniform float seed_y;","uniform float distortion_x;","uniform float distortion_y;","uniform float col_s;","varying vec2 vUv;","float rand(vec2 co){","return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);","}","void main() {","if(byp<1) {","vec2 p = vUv;","float xs = floor(gl_FragCoord.x / 0.5);","float ys = floor(gl_FragCoord.y / 0.5);","vec4 normal = texture2D (tDisp, p*seed*seed);","if(p.ydistortion_x-col_s*seed) {","if(seed_x>0.){","p.y = 1. - (p.y + distortion_y);","}","else {","p.y = distortion_y;","}","}","if(p.xdistortion_y-col_s*seed) {","if(seed_y>0.){","p.x=distortion_x;","}","else {","p.x = 1. - (p.x + distortion_x);","}","}","p.x+=normal.x*seed_x*(seed/5.);","p.y+=normal.y*seed_y*(seed/5.);","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, p + offset);","vec4 cga = texture2D(tDiffuse, p);","vec4 cb = texture2D(tDiffuse, p - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","vec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","gl_FragColor = gl_FragColor+ snow;","}","else {","gl_FragColor=texture2D (tDiffuse, vUv);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},shape:{value:1},radius:{value:4},rotateR:{value:Math.PI/12*1},rotateG:{value:Math.PI/12*2},rotateB:{value:Math.PI/12*3},scatter:{value:0},width:{value:1},height:{value:1},blending:{value:1},blendingMode:{value:1},greyscale:{value:!1},disable:{value:!1}},vertexShader:["varying vec2 vUV;","void main() {","vUV = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#define SQRT2_MINUS_ONE 0.41421356","#define SQRT2_HALF_MINUS_ONE 0.20710678","#define PI2 6.28318531","#define SHAPE_DOT 1","#define SHAPE_ELLIPSE 2","#define SHAPE_LINE 3","#define SHAPE_SQUARE 4","#define BLENDING_LINEAR 1","#define BLENDING_MULTIPLY 2","#define BLENDING_ADD 3","#define BLENDING_LIGHTER 4","#define BLENDING_DARKER 5","uniform sampler2D tDiffuse;","uniform float radius;","uniform float rotateR;","uniform float rotateG;","uniform float rotateB;","uniform float scatter;","uniform float width;","uniform float height;","uniform int shape;","uniform bool disable;","uniform float blending;","uniform int blendingMode;","varying vec2 vUV;","uniform bool greyscale;","const int samples = 8;","float blend( float a, float b, float t ) {","return a * ( 1.0 - t ) + b * t;","}","float hypot( float x, float y ) {","return sqrt( x * x + y * y );","}","float rand( vec2 seed ){","return fract( sin( dot( seed.xy, vec2( 12.9898, 78.233 ) ) ) * 43758.5453 );","}","float distanceToDotRadius( float channel, vec2 coord, vec2 normal, vec2 p, float angle, float rad_max ) {","float dist = hypot( coord.x - p.x, coord.y - p.y );","float rad = channel;","if ( shape == SHAPE_DOT ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","} else if ( shape == SHAPE_ELLIPSE ) {","rad = pow( abs( rad ), 1.125 ) * rad_max;","if ( dist != 0.0 ) {","float dot_p = abs( ( p.x - coord.x ) / dist * normal.x + ( p.y - coord.y ) / dist * normal.y );","dist = ( dist * ( 1.0 - SQRT2_HALF_MINUS_ONE ) ) + dot_p * dist * SQRT2_MINUS_ONE;","}","} else if ( shape == SHAPE_LINE ) {","rad = pow( abs( rad ), 1.5) * rad_max;","float dot_p = ( p.x - coord.x ) * normal.x + ( p.y - coord.y ) * normal.y;","dist = hypot( normal.x * dot_p, normal.y * dot_p );","} else if ( shape == SHAPE_SQUARE ) {","float theta = atan( p.y - coord.y, p.x - coord.x ) - angle;","float sin_t = abs( sin( theta ) );","float cos_t = abs( cos( theta ) );","rad = pow( abs( rad ), 1.4 );","rad = rad_max * ( rad + ( ( sin_t > cos_t ) ? rad - sin_t * rad : rad - cos_t * rad ) );","}","return rad - dist;","}","struct Cell {","vec2 normal;","vec2 p1;","vec2 p2;","vec2 p3;","vec2 p4;","float samp2;","float samp1;","float samp3;","float samp4;","};","vec4 getSample( vec2 point ) {","vec4 tex = texture2D( tDiffuse, vec2( point.x / width, point.y / height ) );","float base = rand( vec2( floor( point.x ), floor( point.y ) ) ) * PI2;","float step = PI2 / float( samples );","float dist = radius * 0.66;","for ( int i = 0; i < samples; ++i ) {","float r = base + step * float( i );","vec2 coord = point + vec2( cos( r ) * dist, sin( r ) * dist );","tex += texture2D( tDiffuse, vec2( coord.x / width, coord.y / height ) );","}","tex /= float( samples ) + 1.0;","return tex;","}","float getDotColour( Cell c, vec2 p, int channel, float angle, float aa ) {","float dist_c_1, dist_c_2, dist_c_3, dist_c_4, res;","if ( channel == 0 ) {","c.samp1 = getSample( c.p1 ).r;","c.samp2 = getSample( c.p2 ).r;","c.samp3 = getSample( c.p3 ).r;","c.samp4 = getSample( c.p4 ).r;","} else if (channel == 1) {","c.samp1 = getSample( c.p1 ).g;","c.samp2 = getSample( c.p2 ).g;","c.samp3 = getSample( c.p3 ).g;","c.samp4 = getSample( c.p4 ).g;","} else {","c.samp1 = getSample( c.p1 ).b;","c.samp3 = getSample( c.p3 ).b;","c.samp2 = getSample( c.p2 ).b;","c.samp4 = getSample( c.p4 ).b;","}","dist_c_1 = distanceToDotRadius( c.samp1, c.p1, c.normal, p, angle, radius );","dist_c_2 = distanceToDotRadius( c.samp2, c.p2, c.normal, p, angle, radius );","dist_c_3 = distanceToDotRadius( c.samp3, c.p3, c.normal, p, angle, radius );","dist_c_4 = distanceToDotRadius( c.samp4, c.p4, c.normal, p, angle, radius );","res = ( dist_c_1 > 0.0 ) ? clamp( dist_c_1 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_2 > 0.0 ) ? clamp( dist_c_2 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_3 > 0.0 ) ? clamp( dist_c_3 / aa, 0.0, 1.0 ) : 0.0;","res += ( dist_c_4 > 0.0 ) ? clamp( dist_c_4 / aa, 0.0, 1.0 ) : 0.0;","res = clamp( res, 0.0, 1.0 );","return res;","}","Cell getReferenceCell( vec2 p, vec2 origin, float grid_angle, float step ) {","Cell c;","vec2 n = vec2( cos( grid_angle ), sin( grid_angle ) );","float threshold = step * 0.5;","float dot_normal = n.x * ( p.x - origin.x ) + n.y * ( p.y - origin.y );","float dot_line = -n.y * ( p.x - origin.x ) + n.x * ( p.y - origin.y );","vec2 offset = vec2( n.x * dot_normal, n.y * dot_normal );","float offset_normal = mod( hypot( offset.x, offset.y ), step );","float normal_dir = ( dot_normal < 0.0 ) ? 1.0 : -1.0;","float normal_scale = ( ( offset_normal < threshold ) ? -offset_normal : step - offset_normal ) * normal_dir;","float offset_line = mod( hypot( ( p.x - offset.x ) - origin.x, ( p.y - offset.y ) - origin.y ), step );","float line_dir = ( dot_line < 0.0 ) ? 1.0 : -1.0;","float line_scale = ( ( offset_line < threshold ) ? -offset_line : step - offset_line ) * line_dir;","c.normal = n;","c.p1.x = p.x - n.x * normal_scale + n.y * line_scale;","c.p1.y = p.y - n.y * normal_scale - n.x * line_scale;","if ( scatter != 0.0 ) {","float off_mag = scatter * threshold * 0.5;","float off_angle = rand( vec2( floor( c.p1.x ), floor( c.p1.y ) ) ) * PI2;","c.p1.x += cos( off_angle ) * off_mag;","c.p1.y += sin( off_angle ) * off_mag;","}","float normal_step = normal_dir * ( ( offset_normal < threshold ) ? step : -step );","float line_step = line_dir * ( ( offset_line < threshold ) ? step : -step );","c.p2.x = c.p1.x - n.x * normal_step;","c.p2.y = c.p1.y - n.y * normal_step;","c.p3.x = c.p1.x + n.y * line_step;","c.p3.y = c.p1.y - n.x * line_step;","c.p4.x = c.p1.x - n.x * normal_step + n.y * line_step;","c.p4.y = c.p1.y - n.y * normal_step - n.x * line_step;","return c;","}","float blendColour( float a, float b, float t ) {","if ( blendingMode == BLENDING_LINEAR ) {","return blend( a, b, 1.0 - t );","} else if ( blendingMode == BLENDING_ADD ) {","return blend( a, min( 1.0, a + b ), t );","} else if ( blendingMode == BLENDING_MULTIPLY ) {","return blend( a, max( 0.0, a * b ), t );","} else if ( blendingMode == BLENDING_LIGHTER ) {","return blend( a, max( a, b ), t );","} else if ( blendingMode == BLENDING_DARKER ) {","return blend( a, min( a, b ), t );","} else {","return blend( a, b, 1.0 - t );","}","}","void main() {","if ( ! disable ) {","vec2 p = vec2( vUV.x * width, vUV.y * height );","vec2 origin = vec2( 0, 0 );","float aa = ( radius < 2.5 ) ? radius * 0.5 : 1.25;","Cell cell_r = getReferenceCell( p, origin, rotateR, radius );","Cell cell_g = getReferenceCell( p, origin, rotateG, radius );","Cell cell_b = getReferenceCell( p, origin, rotateB, radius );","float r = getDotColour( cell_r, p, 0, rotateR, aa );","float g = getDotColour( cell_g, p, 1, rotateG, aa );","float b = getDotColour( cell_b, p, 2, rotateB, aa );","vec4 colour = texture2D( tDiffuse, vUV );","r = blendColour( r, colour.r, blending );","g = blendColour( g, colour.g, blending );","b = blendColour( b, colour.b, blending );","if ( greyscale ) {","r = g = b = (r + b + g) / 3.0;","}","gl_FragColor = vec4( r, g, b, 1.0 );","} else {","gl_FragColor = texture2D( tDiffuse, vUV );","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{NUM_SAMPLES:7,NUM_RINGS:4,NORMAL_TEXTURE:0,DIFFUSE_TEXTURE:0,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDepth:{type:"t",value:null},tDiffuse:{type:"t",value:null},tNormal:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},cameraNear:{type:"f",value:1},cameraFar:{type:"f",value:100},cameraProjectionMatrix:{type:"m4",value:new a.Matrix4},cameraInverseProjectionMatrix:{type:"m4",value:new a.Matrix4},scale:{type:"f",value:1},intensity:{type:"f",value:.1},bias:{type:"f",value:.5},minResolution:{type:"f",value:0},kernelRadius:{type:"f",value:100},randomSeed:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec2 vUv;","#if DIFFUSE_TEXTURE == 1","uniform sampler2D tDiffuse;","#endif","uniform sampler2D tDepth;","#if NORMAL_TEXTURE == 1","uniform sampler2D tNormal;","#endif","uniform float cameraNear;","uniform float cameraFar;","uniform mat4 cameraProjectionMatrix;","uniform mat4 cameraInverseProjectionMatrix;","uniform float scale;","uniform float intensity;","uniform float bias;","uniform float kernelRadius;","uniform float minResolution;","uniform vec2 size;","uniform float randomSeed;","// RGBA depth","#include ","vec4 getDefaultColor( const in vec2 screenPosition ) {","\t#if DIFFUSE_TEXTURE == 1","\treturn texture2D( tDiffuse, vUv );","\t#else","\treturn vec4( 1.0 );","\t#endif","}","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","vec3 getViewPosition( const in vec2 screenPosition, const in float depth, const in float viewZ ) {","\tfloat clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];","\tvec4 clipPosition = vec4( ( vec3( screenPosition, depth ) - 0.5 ) * 2.0, 1.0 );","\tclipPosition *= clipW; // unprojection.","\treturn ( cameraInverseProjectionMatrix * clipPosition ).xyz;","}","vec3 getViewNormal( const in vec3 viewPosition, const in vec2 screenPosition ) {","\t#if NORMAL_TEXTURE == 1","\treturn unpackRGBToNormal( texture2D( tNormal, screenPosition ).xyz );","\t#else","\treturn normalize( cross( dFdx( viewPosition ), dFdy( viewPosition ) ) );","\t#endif","}","float scaleDividedByCameraFar;","float minResolutionMultipliedByCameraFar;","float getOcclusion( const in vec3 centerViewPosition, const in vec3 centerViewNormal, const in vec3 sampleViewPosition ) {","\tvec3 viewDelta = sampleViewPosition - centerViewPosition;","\tfloat viewDistance = length( viewDelta );","\tfloat scaledScreenDistance = scaleDividedByCameraFar * viewDistance;","\treturn max(0.0, (dot(centerViewNormal, viewDelta) - minResolutionMultipliedByCameraFar) / scaledScreenDistance - bias) / (1.0 + pow2( scaledScreenDistance ) );","}","// moving costly divides into consts","const float ANGLE_STEP = PI2 * float( NUM_RINGS ) / float( NUM_SAMPLES );","const float INV_NUM_SAMPLES = 1.0 / float( NUM_SAMPLES );","float getAmbientOcclusion( const in vec3 centerViewPosition ) {","\t// precompute some variables require in getOcclusion.","\tscaleDividedByCameraFar = scale / cameraFar;","\tminResolutionMultipliedByCameraFar = minResolution * cameraFar;","\tvec3 centerViewNormal = getViewNormal( centerViewPosition, vUv );","\t// jsfiddle that shows sample pattern: https://jsfiddle.net/a16ff1p7/","\tfloat angle = rand( vUv + randomSeed ) * PI2;","\tvec2 radius = vec2( kernelRadius * INV_NUM_SAMPLES ) / size;","\tvec2 radiusStep = radius;","\tfloat occlusionSum = 0.0;","\tfloat weightSum = 0.0;","\tfor( int i = 0; i < NUM_SAMPLES; i ++ ) {","\t\tvec2 sampleUv = vUv + vec2( cos( angle ), sin( angle ) ) * radius;","\t\tradius += radiusStep;","\t\tangle += ANGLE_STEP;","\t\tfloat sampleDepth = getDepth( sampleUv );","\t\tif( sampleDepth >= ( 1.0 - EPSILON ) ) {","\t\t\tcontinue;","\t\t}","\t\tfloat sampleViewZ = getViewZ( sampleDepth );","\t\tvec3 sampleViewPosition = getViewPosition( sampleUv, sampleDepth, sampleViewZ );","\t\tocclusionSum += getOcclusion( centerViewPosition, centerViewNormal, sampleViewPosition );","\t\tweightSum += 1.0;","\t}","\tif( weightSum == 0.0 ) discard;","\treturn occlusionSum * ( intensity / weightSum );","}","void main() {","\tfloat centerDepth = getDepth( vUv );","\tif( centerDepth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = getViewZ( centerDepth );","\tvec3 viewPosition = getViewPosition( vUv, centerDepth, centerViewZ );","\tfloat ambientOcclusion = getAmbientOcclusion( viewPosition );","\tgl_FragColor = getDefaultColor( vUv );","\tgl_FragColor.xyz *= 1.0 - ambientOcclusion;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={defines:{KERNEL_RADIUS:4,DEPTH_PACKING:1,PERSPECTIVE_CAMERA:1},uniforms:{tDiffuse:{type:"t",value:null},size:{type:"v2",value:new a.Vector2(512,512)},sampleUvOffsets:{type:"v2v",value:[new a.Vector2(0,0)]},sampleWeights:{type:"1fv",value:[1]},tDepth:{type:"t",value:null},cameraNear:{type:"f",value:10},cameraFar:{type:"f",value:1e3},depthCutoff:{type:"f",value:10}},vertexShader:["#include ","uniform vec2 size;","varying vec2 vUv;","varying vec2 vInvSize;","void main() {","\tvUv = uv;","\tvInvSize = 1.0 / size;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","uniform sampler2D tDiffuse;","uniform sampler2D tDepth;","uniform float cameraNear;","uniform float cameraFar;","uniform float depthCutoff;","uniform vec2 sampleUvOffsets[ KERNEL_RADIUS + 1 ];","uniform float sampleWeights[ KERNEL_RADIUS + 1 ];","varying vec2 vUv;","varying vec2 vInvSize;","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float getViewZ( const in float depth ) {","\t#if PERSPECTIVE_CAMERA == 1","\treturn perspectiveDepthToViewZ( depth, cameraNear, cameraFar );","\t#else","\treturn orthographicDepthToViewZ( depth, cameraNear, cameraFar );","\t#endif","}","void main() {","\tfloat depth = getDepth( vUv );","\tif( depth >= ( 1.0 - EPSILON ) ) {","\t\tdiscard;","\t}","\tfloat centerViewZ = -getViewZ( depth );","\tbool rBreak = false, lBreak = false;","\tfloat weightSum = sampleWeights[0];","\tvec4 diffuseSum = texture2D( tDiffuse, vUv ) * weightSum;","\tfor( int i = 1; i <= KERNEL_RADIUS; i ++ ) {","\t\tfloat sampleWeight = sampleWeights[i];","\t\tvec2 sampleUvOffset = sampleUvOffsets[i] * vInvSize;","\t\tvec2 sampleUv = vUv + sampleUvOffset;","\t\tfloat viewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) rBreak = true;","\t\tif( ! rBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t\tsampleUv = vUv - sampleUvOffset;","\t\tviewZ = -getViewZ( getDepth( sampleUv ) );","\t\tif( abs( viewZ - centerViewZ ) > depthCutoff ) lBreak = true;","\t\tif( ! lBreak ) {","\t\t\tdiffuseSum += texture2D( tDiffuse, sampleUv ) * sampleWeight;","\t\t\tweightSum += sampleWeight;","\t\t}","\t}","\tgl_FragColor = diffuseSum / weightSum;","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","#include ","void main() {","float depth = 1.0 - unpackRGBAToDepth( texture2D( tDiffuse, vUv ) );","gl_FragColor = vec4( vec3( depth ), opacity );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={createSampleWeights:function(e,t){for(var r=function(e,t){return Math.exp(-e*e/(t*t*2))/(Math.sqrt(2*Math.PI)*t)},a=[],n=0;n<=e;n++)a.push(r(n,t));return a},createSampleOffsets:function(e,t){for(var r=[],a=0;a<=e;a++)r.push(t.clone().multiplyScalar(a));return r},configure:function(e,t,r,n){e.defines.KERNEL_RADIUS=t,e.uniforms.sampleUvOffsets.value=a.createSampleOffsets(t,n),e.uniforms.sampleWeights.value=a.createSampleWeights(t,r),e.needsUpdate=!0}};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;","t = abs( C - Ctop );","delta.y = max( max( t.r, t.g ), t.b );","vec2 edges = step( threshold, delta.xy );","if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );","vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new a.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}];t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){n.default.call(this),this.scene=e,this.camera=t,this.sampleLevel=4,this.unbiased=!0,this.clearColor=void 0!==r?r:0,this.clearAlpha=void 0!==o?o:0,void 0===i.default&&console.error("THREE.SSAARenderPass relies on THREE.CopyShader");var s=i.default;this.copyUniforms=a.UniformsUtils.clone(s.uniforms),this.copyMaterial=new a.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader,premultipliedAlpha:!0,transparent:!0,blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1}),this.camera2=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene2=new a.Scene,this.quad2=new a.Mesh(new a.PlaneBufferGeometry(2,2),this.copyMaterial),this.quad2.frustumCulled=!1,this.scene2.add(this.quad2)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,dispose:function(){this.sampleRenderTarget&&(this.sampleRenderTarget.dispose(),this.sampleRenderTarget=null)},setSize:function(e,t){this.sampleRenderTarget&&this.sampleRenderTarget.setSize(e,t)},render:function(e,t,r){this.sampleRenderTarget||(this.sampleRenderTarget=new a.WebGLRenderTarget(r.width,r.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.sampleRenderTarget.texture.name="SSAARenderPass.sample");var n=s.JitterVectors[Math.max(0,Math.min(this.sampleLevel,5))],i=e.autoClear;e.autoClear=!1;var o=e.getClearColor().getHex(),l=e.getClearAlpha(),u=1/n.length;this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture;for(var c=r.width,d=r.height,f=0;f","vec2 rand( const vec2 coord ) {","vec2 noise;","if ( useNoise ) {","float nx = dot ( coord, vec2( 12.9898, 78.233 ) );","float ny = dot ( coord, vec2( 12.9898, 78.233 ) * 2.0 );","noise = clamp( fract ( 43758.5453 * sin( vec2( nx, ny ) ) ), 0.0, 1.0 );","} else {","float ff = fract( 1.0 - coord.s * ( size.x / 2.0 ) );","float gg = fract( coord.t * ( size.y / 2.0 ) );","noise = vec2( 0.25, 0.75 ) * vec2( ff ) + vec2( 0.75, 0.25 ) * gg;","}","return ( noise * 2.0 - 1.0 ) * noiseAmount;","}","float readDepth( const in vec2 coord ) {","float cameraFarPlusNear = cameraFar + cameraNear;","float cameraFarMinusNear = cameraFar - cameraNear;","float cameraCoef = 2.0 * cameraNear;","#ifdef USE_LOGDEPTHBUF","float logz = unpackRGBAToDepth( texture2D( tDepth, coord ) );","float w = pow(2.0, (logz / logDepthBufFC)) - 1.0;","float z = (logz / w) + 1.0;","#else","float z = unpackRGBAToDepth( texture2D( tDepth, coord ) );","#endif","return cameraCoef / ( cameraFarPlusNear - z * cameraFarMinusNear );","}","float compareDepths( const in float depth1, const in float depth2, inout int far ) {","float garea = 8.0;","float diff = ( depth1 - depth2 ) * 100.0;","if ( diff < gDisplace ) {","garea = diffArea;","} else {","far = 1;","}","float dd = diff - gDisplace;","float gauss = pow( EULER, -2.0 * ( dd * dd ) / ( garea * garea ) );","return gauss;","}","float calcAO( float depth, float dw, float dh ) {","vec2 vv = vec2( dw, dh );","vec2 coord1 = vUv + radius * vv;","vec2 coord2 = vUv - radius * vv;","float temp1 = 0.0;","float temp2 = 0.0;","int far = 0;","temp1 = compareDepths( depth, readDepth( coord1 ), far );","if ( far > 0 ) {","temp2 = compareDepths( readDepth( coord2 ), depth, far );","temp1 += ( 1.0 - temp1 ) * temp2;","}","return temp1;","}","void main() {","vec2 noise = rand( vUv );","float depth = readDepth( vUv );","float tt = clamp( depth, aoClamp, 1.0 );","float w = ( 1.0 / size.x ) / tt + ( noise.x * ( 1.0 - noise.x ) );","float h = ( 1.0 / size.y ) / tt + ( noise.y * ( 1.0 - noise.y ) );","float ao = 0.0;","float dz = 1.0 / float( samples );","float l = 0.0;","float z = 1.0 - dz / 2.0;","for ( int i = 0; i <= samples; i ++ ) {","float r = sqrt( 1.0 - z );","float pw = cos( l ) * r;","float ph = sin( l ) * r;","ao += calcAO( depth, pw * w, ph * h );","z = z - dz;","l = l + DL;","}","ao /= float( samples );","ao = 1.0 - ao;","vec3 color = texture2D( tDiffuse, vUv ).rgb;","vec3 lumcoeff = vec3( 0.299, 0.587, 0.114 );","float lum = dot( color.rgb, lumcoeff );","vec3 luminance = vec3( lum );","vec3 final = vec3( color * mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","if ( onlyAO ) {","final = vec3( mix( vec3( ao ), vec3( 1.0 ), luminance * lumInfluence ) );","}","gl_FragColor = vec4( final, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={shaderID:"luminosityHighPass",uniforms:{tDiffuse:{type:"t",value:null},luminosityThreshold:{type:"f",value:1},smoothWidth:{type:"f",value:1},defaultColor:{type:"c",value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(0)},defaultOpacity:{type:"f",value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 defaultColor;","uniform float defaultOpacity;","uniform float luminosityThreshold;","uniform float smoothWidth;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","vec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );","float alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );","gl_FragColor = mix( outputColor, texel, alpha );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(28);Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})}));var n=r(40);Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return n[e]}})}));var i=r(48);Object.keys(i).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})}));var o=r(90);Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})}));var s=r(112);Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})}));var l=r(144);Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VRControls=t.TransformControls=t.TrackballControls=t.PointerLockControls=t.OrthographicTrackballControls=t.OrbitControls=t.FlyControls=t.FirstPersonControls=t.EditorControls=t.DragControls=t.DeviceOrientationControls=void 0;var a=p(r(29)),n=p(r(30)),i=p(r(31)),o=p(r(32)),s=p(r(33)),l=p(r(34)),u=p(r(35)),c=p(r(36)),d=p(r(37)),f=p(r(38)),h=p(r(39));function p(e){return e&&e.__esModule?e:{default:e}}t.DeviceOrientationControls=a.default,t.DragControls=n.default,t.EditorControls=i.default,t.FirstPersonControls=o.default,t.FlyControls=s.default,t.OrbitControls=l.default,t.OrthographicTrackballControls=u.default,t.PointerLockControls=c.default,t.TrackballControls=d.default,t.TransformControls=f.default,t.VRControls=h.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;this.object=e,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alphaOffset=0;var r,n,i,o,s=function(e){t.deviceOrientation=e},l=function(){t.screenOrientation=window.orientation||0},u=(r=new a.Vector3(0,0,1),n=new a.Euler,i=new a.Quaternion,o=new a.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),function(e,t,a,s,l){n.set(a,t,-s,"YXZ"),e.setFromEuler(n),e.multiply(o),e.multiply(i.setFromAxisAngle(r,-l))});this.connect=function(){l(),window.addEventListener("orientationchange",l,!1),window.addEventListener("deviceorientation",s,!1),t.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",l,!1),window.removeEventListener("deviceorientation",s,!1),t.enabled=!1},this.update=function(){if(!1!==t.enabled){var e=t.deviceOrientation;if(e){var r=e.alpha?a.Math.degToRad(e.alpha)+t.alphaOffset:0,n=e.beta?a.Math.degToRad(e.beta):0,i=e.gamma?a.Math.degToRad(e.gamma):0,o=t.screenOrientation?a.Math.degToRad(t.screenOrientation):0;u(t.object.quaternion,r,n,i,o)}}},this.dispose=function(){t.disconnect()},this.connect()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t,r){if(e instanceof a.Camera){console.warn("THREE.DragControls: Constructor now expects ( objects, camera, domElement )");var n=e;e=t,t=n}var i=new a.Plane,o=new a.Raycaster,s=new a.Vector2,l=new a.Vector3,u=new a.Vector3,c=null,d=null,f=this;function h(){r.addEventListener("mousemove",m,!1),r.addEventListener("mousedown",v,!1),r.addEventListener("mouseup",g,!1),r.addEventListener("mouseleave",g,!1),r.addEventListener("touchmove",y,!1),r.addEventListener("touchstart",x,!1),r.addEventListener("touchend",b,!1)}function p(){r.removeEventListener("mousemove",m,!1),r.removeEventListener("mousedown",v,!1),r.removeEventListener("mouseup",g,!1),r.removeEventListener("mouseleave",g,!1),r.removeEventListener("touchmove",y,!1),r.removeEventListener("touchstart",x,!1),r.removeEventListener("touchend",b,!1)}function m(a){a.preventDefault();var n=r.getBoundingClientRect();if(s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t),c&&f.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void f.dispatchEvent({type:"drag",object:c});o.setFromCamera(s,t);var h=o.intersectObjects(e);if(h.length>0){var p=h[0].object;i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),p.position),d!==p&&(f.dispatchEvent({type:"hoveron",object:p}),r.style.cursor="pointer",d=p)}else null!==d&&(f.dispatchEvent({type:"hoveroff",object:d}),r.style.cursor="auto",d=null)}function v(a){a.preventDefault(),o.setFromCamera(s,t);var n=o.intersectObjects(e);n.length>0&&(c=n[0].object,o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",f.dispatchEvent({type:"dragstart",object:c}))}function g(e){e.preventDefault(),c&&(f.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}function y(e){e.preventDefault(),e=e.changedTouches[0];var a=r.getBoundingClientRect();if(s.x=(e.clientX-a.left)/a.width*2-1,s.y=-(e.clientY-a.top)/a.height*2+1,o.setFromCamera(s,t),c&&f.enabled)return o.ray.intersectPlane(i,u)&&c.position.copy(u.sub(l)),void f.dispatchEvent({type:"drag",object:c})}function x(a){a.preventDefault(),a=a.changedTouches[0];var n=r.getBoundingClientRect();s.x=(a.clientX-n.left)/n.width*2-1,s.y=-(a.clientY-n.top)/n.height*2+1,o.setFromCamera(s,t);var d=o.intersectObjects(e);d.length>0&&(c=d[0].object,i.setFromNormalAndCoplanarPoint(t.getWorldDirection(i.normal),c.position),o.ray.intersectPlane(i,u)&&l.copy(u).sub(c.position),r.style.cursor="move",f.dispatchEvent({type:"dragstart",object:c}))}function b(e){e.preventDefault(),c&&(f.dispatchEvent({type:"dragend",object:c}),c=null),r.style.cursor="auto"}h(),this.enabled=!0,this.activate=h,this.deactivate=p,this.dispose=function(){p()},this.setObjects=function(){console.error("THREE.DragControls: setObjects() has been removed.")},this.on=function(e,t){console.warn("THREE.DragControls: on() has been deprecated. Use addEventListener() instead."),f.addEventListener(e,t)},this.off=function(e,t){console.warn("THREE.DragControls: off() has been deprecated. Use removeEventListener() instead."),f.removeEventListener(e,t)},this.notify=function(e){console.error("THREE.DragControls: notify() has been deprecated. Use dispatchEvent() instead."),f.dispatchEvent({type:e})}};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){t=void 0!==t?t:document,this.enabled=!0,this.center=new a.Vector3,this.panSpeed=.001,this.zoomSpeed=.001,this.rotationSpeed=.005;var r=this,n=new a.Vector3,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2},o=i.NONE,s=this.center,l=new a.Matrix3,u=new a.Vector2,c=new a.Vector2,d=new a.Spherical,f={type:"change"};function h(e){!1!==r.enabled&&(0===e.button?o=i.ROTATE:1===e.button?o=i.ZOOM:2===e.button&&(o=i.PAN),c.set(e.clientX,e.clientY),t.addEventListener("mousemove",p,!1),t.addEventListener("mouseup",m,!1),t.addEventListener("mouseout",m,!1),t.addEventListener("dblclick",m,!1))}function p(e){if(!1!==r.enabled){u.set(e.clientX,e.clientY);var t=u.x-c.x,n=u.y-c.y;o===i.ROTATE?r.rotate(new a.Vector3(-t*r.rotationSpeed,-n*r.rotationSpeed,0)):o===i.ZOOM?r.zoom(new a.Vector3(0,0,n)):o===i.PAN&&r.pan(new a.Vector3(-t,n,0)),c.set(e.clientX,e.clientY)}}function m(e){t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),o=i.NONE}function v(e){e.preventDefault(),r.zoom(new a.Vector3(0,0,e.deltaY))}function g(e){e.preventDefault()}this.focus=function(t){var n,i=(new a.Box3).setFromObject(t);!1===i.isEmpty()?(s.copy(i.getCenter()),n=i.getBoundingSphere().radius):(s.setFromMatrixPosition(t.matrixWorld),n=.1);var o=new a.Vector3(0,0,1);o.applyQuaternion(e.quaternion),o.multiplyScalar(4*n),e.position.copy(s).add(o),r.dispatchEvent(f)},this.pan=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.panSpeed),t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),s.add(t),r.dispatchEvent(f)},this.zoom=function(t){var a=e.position.distanceTo(s);t.multiplyScalar(a*r.zoomSpeed),t.length()>a||(t.applyMatrix3(l.getNormalMatrix(e.matrix)),e.position.add(t),r.dispatchEvent(f))},this.rotate=function(t){n.copy(e.position).sub(s),d.setFromVector3(n),d.theta+=t.x,d.phi+=t.y,d.makeSafe(),n.setFromSpherical(d),e.position.copy(s).add(n),e.lookAt(s),r.dispatchEvent(f)},this.dispose=function(){t.removeEventListener("contextmenu",g,!1),t.removeEventListener("mousedown",h,!1),t.removeEventListener("wheel",v,!1),t.removeEventListener("mousemove",p,!1),t.removeEventListener("mouseup",m,!1),t.removeEventListener("mouseout",m,!1),t.removeEventListener("dblclick",m,!1),t.removeEventListener("touchstart",w,!1),t.removeEventListener("touchmove",A,!1)},t.addEventListener("contextmenu",g,!1),t.addEventListener("mousedown",h,!1),t.addEventListener("wheel",v,!1);var y=[new a.Vector3,new a.Vector3,new a.Vector3],x=[new a.Vector3,new a.Vector3,new a.Vector3],b=null;function w(e){if(!1!==r.enabled){switch(e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0);break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0),b=y[0].distanceTo(y[1])}x[0].copy(y[0]),x[1].copy(y[1])}}function A(e){if(!1!==r.enabled){switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[0].pageX,e.touches[0].pageY,0),r.rotate(y[0].sub(o(y[0],x)).multiplyScalar(-r.rotationSpeed));break;case 2:y[0].set(e.touches[0].pageX,e.touches[0].pageY,0),y[1].set(e.touches[1].pageX,e.touches[1].pageY,0);var t=y[0].distanceTo(y[1]);r.zoom(new a.Vector3(0,0,b-t)),b=t;var n=y[0].clone().sub(o(y[0],x)),i=y[1].clone().sub(o(y[1],x));n.x=-n.x,i.x=-i.x,r.pan(n.add(i).multiplyScalar(.5))}x[0].copy(y[0]),x[1].copy(y[1])}function o(e,t){var r=t[0];for(var a in t)r.distanceTo(e)>t[a].distanceTo(e)&&(r=t[a]);return r}}t.addEventListener("touchstart",w,!1),t.addEventListener("touchmove",A,!1)};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e){e.preventDefault()}this.object=e,this.target=new a.Vector3(0,0,0),this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.lookSpeed=.005,this.lookVertical=!0,this.autoForward=!1,this.activeLook=!0,this.heightSpeed=!1,this.heightCoef=1,this.heightMin=0,this.heightMax=1,this.constrainVertical=!1,this.verticalMin=0,this.verticalMax=Math.PI,this.autoSpeedFactor=0,this.mouseX=0,this.mouseY=0,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.moveForward=!1,this.moveBackward=!1,this.moveLeft=!1,this.moveRight=!1,this.mouseDragOn=!1,this.viewHalfX=0,this.viewHalfY=0,this.domElement!==document&&this.domElement.setAttribute("tabindex",-1),this.handleResize=function(){this.domElement===document?(this.viewHalfX=window.innerWidth/2,this.viewHalfY=window.innerHeight/2):(this.viewHalfX=this.domElement.offsetWidth/2,this.viewHalfY=this.domElement.offsetHeight/2)},this.onMouseDown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!0;break;case 2:this.moveBackward=!0}this.mouseDragOn=!0},this.onMouseUp=function(e){if(e.preventDefault(),e.stopPropagation(),this.activeLook)switch(e.button){case 0:this.moveForward=!1;break;case 2:this.moveBackward=!1}this.mouseDragOn=!1},this.onMouseMove=function(e){this.domElement===document?(this.mouseX=e.pageX-this.viewHalfX,this.mouseY=e.pageY-this.viewHalfY):(this.mouseX=e.pageX-this.domElement.offsetLeft-this.viewHalfX,this.mouseY=e.pageY-this.domElement.offsetTop-this.viewHalfY)},this.onKeyDown=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!0;break;case 37:case 65:this.moveLeft=!0;break;case 40:case 83:this.moveBackward=!0;break;case 39:case 68:this.moveRight=!0;break;case 82:this.moveUp=!0;break;case 70:this.moveDown=!0}},this.onKeyUp=function(e){switch(e.keyCode){case 38:case 87:this.moveForward=!1;break;case 37:case 65:this.moveLeft=!1;break;case 40:case 83:this.moveBackward=!1;break;case 39:case 68:this.moveRight=!1;break;case 82:this.moveUp=!1;break;case 70:this.moveDown=!1}},this.update=function(e){if(!1!==this.enabled){if(this.heightSpeed){var t=a.Math.clamp(this.object.position.y,this.heightMin,this.heightMax)-this.heightMin;this.autoSpeedFactor=e*(t*this.heightCoef)}else this.autoSpeedFactor=0;var r=e*this.movementSpeed;(this.moveForward||this.autoForward&&!this.moveBackward)&&this.object.translateZ(-(r+this.autoSpeedFactor)),this.moveBackward&&this.object.translateZ(r),this.moveLeft&&this.object.translateX(-r),this.moveRight&&this.object.translateX(r),this.moveUp&&this.object.translateY(r),this.moveDown&&this.object.translateY(-r);var n=e*this.lookSpeed;this.activeLook||(n=0);var i=1;this.constrainVertical&&(i=Math.PI/(this.verticalMax-this.verticalMin)),this.lon+=this.mouseX*n,this.lookVertical&&(this.lat-=this.mouseY*n*i),this.lat=Math.max(-85,Math.min(85,this.lat)),this.phi=a.Math.degToRad(90-this.lat),this.theta=a.Math.degToRad(this.lon),this.constrainVertical&&(this.phi=a.Math.mapLinear(this.phi,0,Math.PI,this.verticalMin,this.verticalMax));var o=this.target,s=this.object.position;o.x=s.x+100*Math.sin(this.phi)*Math.cos(this.theta),o.y=s.y+100*Math.cos(this.phi),o.z=s.z+100*Math.sin(this.phi)*Math.sin(this.theta),this.object.lookAt(o)}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",r,!1),this.domElement.removeEventListener("mousedown",i,!1),this.domElement.removeEventListener("mousemove",n,!1),this.domElement.removeEventListener("mouseup",o,!1),window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",l,!1)};var n=u(this,this.onMouseMove),i=u(this,this.onMouseDown),o=u(this,this.onMouseUp),s=u(this,this.onKeyDown),l=u(this,this.onKeyUp);function u(e,t){return function(){t.apply(e,arguments)}}this.domElement.addEventListener("contextmenu",r,!1),this.domElement.addEventListener("mousemove",n,!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mouseup",o,!1),window.addEventListener("keydown",s,!1),window.addEventListener("keyup",l,!1),this.handleResize()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){function r(e,t){return function(){t.apply(e,arguments)}}function n(e){e.preventDefault()}this.object=e,this.domElement=void 0!==t?t:document,t&&this.domElement.setAttribute("tabindex",-1),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this.tmpQuaternion=new a.Quaternion,this.mouseStatus=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new a.Vector3(0,0,0),this.rotationVector=new a.Vector3(0,0,0),this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)},this.keydown=function(e){if(!e.altKey){switch(e.keyCode){case 16:this.movementSpeedMultiplier=.1;break;case 87:this.moveState.forward=1;break;case 83:this.moveState.back=1;break;case 65:this.moveState.left=1;break;case 68:this.moveState.right=1;break;case 82:this.moveState.up=1;break;case 70:this.moveState.down=1;break;case 38:this.moveState.pitchUp=1;break;case 40:this.moveState.pitchDown=1;break;case 37:this.moveState.yawLeft=1;break;case 39:this.moveState.yawRight=1;break;case 81:this.moveState.rollLeft=1;break;case 69:this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){switch(e.keyCode){case 16:this.movementSpeedMultiplier=1;break;case 87:this.moveState.forward=0;break;case 83:this.moveState.back=0;break;case 65:this.moveState.left=0;break;case 68:this.moveState.right=0;break;case 82:this.moveState.up=0;break;case 70:this.moveState.down=0;break;case 38:this.moveState.pitchUp=0;break;case 40:this.moveState.pitchDown=0;break;case 37:this.moveState.yawLeft=0;break;case 39:this.moveState.yawRight=0;break;case 81:this.moveState.rollLeft=0;break;case 69:this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()},this.mousedown=function(e){if(this.domElement!==document&&this.domElement.focus(),e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.mousemove=function(e){if(!this.dragToLook||this.mouseStatus>0){var t=this.getContainerDimensions(),r=t.size[0]/2,a=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-r)/r,this.moveState.pitchDown=(e.pageY-t.offset[1]-a)/a,this.updateRotationVector()}},this.mouseup=function(e){if(e.preventDefault(),e.stopPropagation(),this.dragToLook)this.mouseStatus--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()},this.update=function(e){var t=e*this.movementSpeed,r=e*this.rollSpeed;this.object.translateX(this.moveVector.x*t),this.object.translateY(this.moveVector.y*t),this.object.translateZ(this.moveVector.z*t),this.tmpQuaternion.set(this.rotationVector.x*r,this.rotationVector.y*r,this.rotationVector.z*r,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order)},this.updateMovementVector=function(){var e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",n,!1),this.domElement.removeEventListener("mousedown",o,!1),this.domElement.removeEventListener("mousemove",i,!1),this.domElement.removeEventListener("mouseup",s,!1),window.removeEventListener("keydown",l,!1),window.removeEventListener("keyup",u,!1)};var i=r(this,this.mousemove),o=r(this,this.mousedown),s=r(this,this.mouseup),l=r(this,this.keydown),u=r(this,this.keyup);this.domElement.addEventListener("contextmenu",n,!1),this.domElement.addEventListener("mousemove",i,!1),this.domElement.addEventListener("mousedown",o,!1),this.domElement.addEventListener("mouseup",s,!1),window.addEventListener("keydown",l,!1),window.addEventListener("keyup",u,!1),this.updateMovementVector(),this.updateRotationVector()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),h=f.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&h===f.NONE&&L(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,y.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),y.set(0,0,0)),g=1,!!(x||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),x=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",k,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",z,!1),l.domElement.removeEventListener("touchend",H,!1),l.domElement.removeEventListener("touchmove",X,!1),document.removeEventListener("mousemove",B,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",G,!1)};var l=this,u={type:"change"},c={type:"start"},d={type:"end"},f={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},h=f.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,x=!1,b=new a.Vector2,w=new a.Vector2,A=new a.Vector2,M=new a.Vector2,T=new a.Vector2,S=new a.Vector2,E=new a.Vector2,_=new a.Vector2,F=new a.Vector2;function P(){return Math.pow(.95,l.zoomSpeed)}function L(e){v.theta-=e}function C(e){v.phi-=e}var O,N=(O=new a.Vector3,function(e,t){O.setFromMatrixColumn(t,0),O.multiplyScalar(-e),y.add(O)}),I=function(){var e=new a.Vector3;return function(t,r){!0===l.screenSpacePanning?e.setFromMatrixColumn(r,1):(e.setFromMatrixColumn(r,0),e.crossVectors(l.object.up,e)),e.multiplyScalar(t),y.add(e)}}(),R=function(){var e=new a.Vector3;return function(t,r){var a=l.domElement===document?l.domElement.body:l.domElement;if(l.object.isPerspectiveCamera){var n=l.object.position;e.copy(n).sub(l.target);var i=e.length();i*=Math.tan(l.object.fov/2*Math.PI/180),N(2*t*i/a.clientHeight,l.object.matrix),I(2*r*i/a.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(N(t*(l.object.right-l.object.left)/l.object.zoom/a.clientWidth,l.object.matrix),I(r*(l.object.top-l.object.bottom)/l.object.zoom/a.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function U(e){l.object.isPerspectiveCamera?g/=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object.isPerspectiveCamera?g*=e:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function k(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){b.set(e.clientX,e.clientY)}(e),h=f.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){E.set(e.clientX,e.clientY)}(e),h=f.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=f.PAN}h!==f.NONE&&(document.addEventListener("mousemove",B,!1),document.addEventListener("mouseup",j,!1),l.dispatchEvent(c))}}function B(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case f.ROTATE:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY),A.subVectors(w,b).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;L(2*Math.PI*A.x/t.clientHeight),C(2*Math.PI*A.y/t.clientHeight),b.copy(w),l.update()}(e);break;case f.DOLLY:if(!1===l.enableZoom)return;!function(e){_.set(e.clientX,e.clientY),F.subVectors(_,E),F.y>0?U(P()):F.y<0&&D(P()),E.copy(_),l.update()}(e);break;case f.PAN:if(!1===l.enablePan)return;!function(e){T.set(e.clientX,e.clientY),S.subVectors(T,M).multiplyScalar(l.panSpeed),R(S.x,S.y),M.copy(T),l.update()}(e)}}function j(e){!1!==l.enabled&&(document.removeEventListener("mousemove",B,!1),document.removeEventListener("mouseup",j,!1),l.dispatchEvent(d),h=f.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==f.NONE&&h!==f.ROTATE||(e.preventDefault(),e.stopPropagation(),l.dispatchEvent(c),function(e){e.deltaY<0?D(P()):e.deltaY>0&&U(P()),l.update()}(e),l.dispatchEvent(d))}function G(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:R(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:R(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:R(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:R(-l.keyPanSpeed,0),l.update()}}(e)}function z(e){if(!1!==l.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){b.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=f.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);E.set(0,a)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);M.set(n,i)}}(e),h=f.TOUCH_DOLLY_PAN;break;default:h=f.NONE}h!==f.NONE&&l.dispatchEvent(c)}}function X(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==f.TOUCH_ROTATE)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY),A.subVectors(w,b).multiplyScalar(l.rotateSpeed);var t=l.domElement===document?l.domElement.body:l.domElement;L(2*Math.PI*A.x/t.clientHeight),C(2*Math.PI*A.y/t.clientHeight),b.copy(w),l.update()}(e);break;case 2:if(!1===l.enableZoom&&!1===l.enablePan)return;if(h!==f.TOUCH_DOLLY_PAN)return;!function(e){if(l.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);_.set(0,a),F.set(0,Math.pow(_.y/E.y,l.zoomSpeed)),U(F.y),E.copy(_)}if(l.enablePan){var n=.5*(e.touches[0].pageX+e.touches[1].pageX),i=.5*(e.touches[0].pageY+e.touches[1].pageY);T.set(n,i),S.subVectors(T,M).multiplyScalar(l.panSpeed),R(S.x,S.y),M.copy(T)}l.update()}(e);break;default:h=f.NONE}}function H(e){!1!==l.enabled&&(l.dispatchEvent(d),h=f.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",k,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",z,!1),l.domElement.addEventListener("touchend",H,!1),l.domElement.addEventListener("touchmove",X,!1),window.addEventListener("keydown",G,!1),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.radius=0,this.rotateSpeed=1,this.zoomSpeed=1.2,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.keys=[65,83,68],this.target=new a.Vector3;var i=!0,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector3,c=new a.Vector3,d=new a.Vector2,f=new a.Vector2,h=0,p=0,m=new a.Vector2,v=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom;var g={type:"change"},y={type:"start"},x={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}this.radius=.5*Math.min(this.screen.width,this.screen.height),this.left0=this.object.left,this.right0=this.object.right,this.top0=this.object.top,this.bottom0=this.object.bottom},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var b,w,A,M,T,S,E=(b=new a.Vector2,function(e,t){return b.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),b}),_=function(){var e=new a.Vector3,t=new a.Vector3,n=new a.Vector3;return function(a,i){n.set((a-.5*r.screen.width-r.screen.left)/r.radius,(.5*r.screen.height+r.screen.top-i)/r.radius,0);var o=n.length();return r.noRoll?o1?n.normalize():n.z=Math.sqrt(1-o*o),l.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(n.y),e.add(t.copy(r.object.up).cross(l).setLength(n.x)),e.add(l.setLength(n.z)),e}}();function F(e){!1!==r.enabled&&(window.removeEventListener("keydown",F),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function P(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",F,!1))}function L(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(m.copy(E(e.pageX,e.pageY)),v.copy(m)):(d.copy(E(e.pageX,e.pageY)),f.copy(d)):(u.copy(_(e.pageX,e.pageY)),c.copy(u)),document.addEventListener("mousemove",C,!1),document.addEventListener("mouseup",O,!1),r.dispatchEvent(y))}function C(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||v.copy(E(e.pageX,e.pageY)):f.copy(E(e.pageX,e.pageY)):c.copy(_(e.pageX,e.pageY)))}function O(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",O),r.dispatchEvent(x))}function N(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),d.y+=.01*e.deltaY,r.dispatchEvent(y),r.dispatchEvent(x))}function I(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,u.copy(_(e.touches[0].pageX,e.touches[0].pageY)),c.copy(u);break;case 2:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=h=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(E(i,s)),v.copy(m);break;default:o=n.NONE}r.dispatchEvent(y)}}function R(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:c.copy(_(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;p=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(E(i,s));break;default:o=n.NONE}}function U(e){if(!1!==r.enabled){switch(e.touches.length){case 1:c.copy(_(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;case 2:h=p=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,a=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(E(t,a)),m.copy(v)}o=n.NONE,r.dispatchEvent(x)}}function D(e){e.preventDefault()}this.rotateCamera=(w=new a.Vector3,A=new a.Quaternion,function(){var e=Math.acos(u.dot(c)/u.length()/c.length());e&&(w.crossVectors(u,c).normalize(),e*=r.rotateSpeed,A.setFromAxisAngle(w,-e),l.applyQuaternion(A),r.object.up.applyQuaternion(A),c.applyQuaternion(A),r.staticMoving?u.copy(c):(A.setFromAxisAngle(w,e*(r.dynamicDampingFactor-1)),u.applyQuaternion(A)),i=!0)}),this.zoomCamera=function(){if(o===n.TOUCH_ZOOM_PAN){var e=p/h;h=p,r.object.zoom*=e,i=!0}else{e=1+(f.y-d.y)*r.zoomSpeed;Math.abs(e-1)>1e-6&&e>0&&(r.object.zoom/=e,r.staticMoving?d.copy(f):d.y+=(f.y-d.y)*this.dynamicDampingFactor,i=!0)}},this.panCamera=(M=new a.Vector2,T=new a.Vector3,S=new a.Vector3,function(){if(M.copy(v).sub(m),M.lengthSq()){var e=(r.object.right-r.object.left)/r.object.zoom,t=(r.object.top-r.object.bottom)/r.object.zoom;M.x*=e,M.y*=t,S.copy(l).cross(r.object.up).setLength(M.x),S.add(T.copy(r.object.up).setLength(M.y)),r.object.position.add(S),r.target.add(S),r.staticMoving?m.copy(v):m.add(M.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)),i=!0}}),this.update=function(){l.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||(r.zoomCamera(),i&&r.object.updateProjectionMatrix()),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,l),r.object.lookAt(r.target),i&&(r.dispatchEvent(g),i=!1)},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.left=r.left0,r.object.right=r.right0,r.object.top=r.top0,r.object.bottom=r.bottom0,r.object.lookAt(r.target),r.dispatchEvent(g),i=!1},this.dispose=function(){this.domElement.removeEventListener("contextmenu",D,!1),this.domElement.removeEventListener("mousedown",L,!1),this.domElement.removeEventListener("wheel",N,!1),this.domElement.removeEventListener("touchstart",I,!1),this.domElement.removeEventListener("touchend",U,!1),this.domElement.removeEventListener("touchmove",R,!1),document.removeEventListener("mousemove",C,!1),document.removeEventListener("mouseup",O,!1),window.removeEventListener("keydown",F,!1),window.removeEventListener("keyup",P,!1)},this.domElement.addEventListener("contextmenu",D,!1),this.domElement.addEventListener("mousedown",L,!1),this.domElement.addEventListener("wheel",N,!1),this.domElement.addEventListener("touchstart",I,!1),this.domElement.addEventListener("touchend",U,!1),this.domElement.addEventListener("touchmove",R,!1),window.addEventListener("keydown",F,!1),window.addEventListener("keyup",P,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e){var t=this;e.rotation.set(0,0,0);var r=new a.Object3D;r.add(e);var n=new a.Object3D;n.position.y=10,n.add(r);var i,o,s=Math.PI/2,l=function(e){if(!1!==t.enabled){var a=e.movementX||e.mozMovementX||e.webkitMovementX||0,i=e.movementY||e.mozMovementY||e.webkitMovementY||0;n.rotation.y-=.002*a,r.rotation.x-=.002*i,r.rotation.x=Math.max(-s,Math.min(s,r.rotation.x))}};this.dispose=function(){document.removeEventListener("mousemove",l,!1)},document.addEventListener("mousemove",l,!1),this.enabled=!1,this.getObject=function(){return n},this.getDirection=(i=new a.Vector3(0,0,-1),o=new a.Euler(0,0,0,"YXZ"),function(e){return o.set(r.rotation.x,n.rotation.y,0),e.copy(i).applyEuler(o),e})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){var r=this,n={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new a.Vector3;var i=new a.Vector3,o=n.NONE,s=n.NONE,l=new a.Vector3,u=new a.Vector2,c=new a.Vector2,d=new a.Vector3,f=0,h=new a.Vector2,p=new a.Vector2,m=0,v=0,g=new a.Vector2,y=new a.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var x={type:"change"},b={type:"start"},w={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}},this.handleEvent=function(e){"function"==typeof this[e.type]&&this[e.type](e)};var A,M,T,S,E,_,F,P,L,C,O,N=(A=new a.Vector2,function(e,t){return A.set((e-r.screen.left)/r.screen.width,(t-r.screen.top)/r.screen.height),A}),I=function(){var e=new a.Vector2;return function(t,a){return e.set((t-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-a))/r.screen.width),e}}();function R(e){!1!==r.enabled&&(window.removeEventListener("keydown",R),s=o,o===n.NONE&&(e.keyCode!==r.keys[n.ROTATE]||r.noRotate?e.keyCode!==r.keys[n.ZOOM]||r.noZoom?e.keyCode!==r.keys[n.PAN]||r.noPan||(o=n.PAN):o=n.ZOOM:o=n.ROTATE))}function U(e){!1!==r.enabled&&(o=s,window.addEventListener("keydown",R,!1))}function D(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o===n.NONE&&(o=e.button),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||(g.copy(N(e.pageX,e.pageY)),y.copy(g)):(h.copy(N(e.pageX,e.pageY)),p.copy(h)):(c.copy(I(e.pageX,e.pageY)),u.copy(c)),document.addEventListener("mousemove",k,!1),document.addEventListener("mouseup",B,!1),r.dispatchEvent(b))}function k(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o!==n.ROTATE||r.noRotate?o!==n.ZOOM||r.noZoom?o!==n.PAN||r.noPan||y.copy(N(e.pageX,e.pageY)):p.copy(N(e.pageX,e.pageY)):(u.copy(c),c.copy(I(e.pageX,e.pageY))))}function B(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),o=n.NONE,document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",B),r.dispatchEvent(w))}function j(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.stopPropagation(),e.deltaMode){case 2:h.y-=.025*e.deltaY;break;case 1:h.y-=.01*e.deltaY;break;default:h.y-=25e-5*e.deltaY}r.dispatchEvent(b),r.dispatchEvent(w)}}function V(e){if(!1!==r.enabled){switch(e.touches.length){case 1:o=n.TOUCH_ROTATE,c.copy(I(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c);break;default:o=n.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=m=Math.sqrt(t*t+a*a);var i=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;g.copy(N(i,s)),y.copy(g)}r.dispatchEvent(b)}}function G(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:u.copy(c),c.copy(I(e.touches[0].pageX,e.touches[0].pageY));break;default:var t=e.touches[0].pageX-e.touches[1].pageX,a=e.touches[0].pageY-e.touches[1].pageY;v=Math.sqrt(t*t+a*a);var n=(e.touches[0].pageX+e.touches[1].pageX)/2,i=(e.touches[0].pageY+e.touches[1].pageY)/2;y.copy(N(n,i))}}function z(e){if(!1!==r.enabled){switch(e.touches.length){case 0:o=n.NONE;break;case 1:o=n.TOUCH_ROTATE,c.copy(I(e.touches[0].pageX,e.touches[0].pageY)),u.copy(c)}r.dispatchEvent(w)}}function X(e){!1!==r.enabled&&e.preventDefault()}this.rotateCamera=(T=new a.Vector3,S=new a.Quaternion,E=new a.Vector3,_=new a.Vector3,F=new a.Vector3,P=new a.Vector3,function(){P.set(c.x-u.x,c.y-u.y,0),(M=P.length())?(l.copy(r.object.position).sub(r.target),E.copy(l).normalize(),_.copy(r.object.up).normalize(),F.crossVectors(_,E).normalize(),_.setLength(c.y-u.y),F.setLength(c.x-u.x),P.copy(_.add(F)),T.crossVectors(P,l).normalize(),M*=r.rotateSpeed,S.setFromAxisAngle(T,M),l.applyQuaternion(S),r.object.up.applyQuaternion(S),d.copy(T),f=M):!r.staticMoving&&f&&(f*=Math.sqrt(1-r.dynamicDampingFactor),l.copy(r.object.position).sub(r.target),S.setFromAxisAngle(d,f),l.applyQuaternion(S),r.object.up.applyQuaternion(S)),u.copy(c)}),this.zoomCamera=function(){var e;o===n.TOUCH_ZOOM_PAN?(e=m/v,m=v,l.multiplyScalar(e)):(1!==(e=1+(p.y-h.y)*r.zoomSpeed)&&e>0&&l.multiplyScalar(e),r.staticMoving?h.copy(p):h.y+=(p.y-h.y)*this.dynamicDampingFactor)},this.panCamera=(L=new a.Vector2,C=new a.Vector3,O=new a.Vector3,function(){L.copy(y).sub(g),L.lengthSq()&&(L.multiplyScalar(l.length()*r.panSpeed),O.copy(l).cross(r.object.up).setLength(L.x),O.add(C.copy(r.object.up).setLength(L.y)),r.object.position.add(O),r.target.add(O),r.staticMoving?g.copy(y):g.add(L.subVectors(y,g).multiplyScalar(r.dynamicDampingFactor)))}),this.checkDistances=function(){r.noZoom&&r.noPan||(l.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,l.setLength(r.maxDistance)),h.copy(p)),l.lengthSq()1e-6&&(r.dispatchEvent(x),i.copy(r.object.position))},this.reset=function(){o=n.NONE,s=n.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),l.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(x),i.copy(r.object.position)},this.dispose=function(){this.domElement.removeEventListener("contextmenu",X,!1),this.domElement.removeEventListener("mousedown",D,!1),this.domElement.removeEventListener("wheel",j,!1),this.domElement.removeEventListener("touchstart",V,!1),this.domElement.removeEventListener("touchend",z,!1),this.domElement.removeEventListener("touchmove",G,!1),document.removeEventListener("mousemove",k,!1),document.removeEventListener("mouseup",B,!1),window.removeEventListener("keydown",R,!1),window.removeEventListener("keyup",U,!1)},this.domElement.addEventListener("contextmenu",X,!1),this.domElement.addEventListener("mousedown",D,!1),this.domElement.addEventListener("wheel",j,!1),this.domElement.addEventListener("touchstart",V,!1),this.domElement.addEventListener("touchend",z,!1),this.domElement.addEventListener("touchmove",G,!1),window.addEventListener("keydown",R,!1),window.addEventListener("keyup",U,!1),this.handleResize(),this.update()};(n.prototype=Object.create(a.EventDispatcher.prototype)).constructor=n,t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){var e=function(e){a.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.side=a.FrontSide,this.transparent=!0,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(e.prototype=Object.create(a.MeshBasicMaterial.prototype)).constructor=e;var t=function(e){a.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.fog=!1,this.transparent=!0,this.linewidth=1,this.setValues(e),this.oldColor=this.color.clone(),this.oldOpacity=this.opacity,this.highlight=function(e){e?(this.color.setRGB(1,1,0),this.opacity=1):(this.color.copy(this.oldColor),this.opacity=this.oldOpacity)}};(t.prototype=Object.create(a.LineBasicMaterial.prototype)).constructor=t;var r=new e({visible:!1,transparent:!1}),n=function(){this.init=function(){a.Object3D.call(this),this.handles=new a.Object3D,this.pickers=new a.Object3D,this.planes=new a.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new a.PlaneBufferGeometry(50,50,2,2),t=new a.MeshBasicMaterial({visible:!1,side:a.DoubleSide}),r={XY:new a.Mesh(e,t),YZ:new a.Mesh(e,t),XZ:new a.Mesh(e,t),XYZE:new a.Mesh(e,t)};for(var n in this.activePlane=r.XYZE,r.YZ.rotation.set(0,Math.PI/2,0),r.XZ.rotation.set(-Math.PI/2,0,0),r)r[n].name=n,this.planes.add(r[n]),this.planes[n]=r[n];var i=function(e,t){for(var r in e)for(n=e[r].length;n--;){var a=e[r][n][0],i=e[r][n][1],o=e[r][n][2];a.name=r,a.renderOrder=1/0,i&&a.position.set(i[0],i[1],i[2]),o&&a.rotation.set(o[0],o[1],o[2]),t.add(a)}};i(this.handleGizmos,this.handles),i(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof a.Mesh){e.updateMatrix();var t=e.geometry.clone();t.applyMatrix(e.matrix),e.geometry=t,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))},this.highlight=function(e){this.traverse((function(t){t.material&&t.material.highlight&&(t.name===e?t.material.highlight(!0):t.material.highlight(!1))}))}};(n.prototype=Object.create(a.Object3D.prototype)).constructor=n,n.prototype.update=function(e,t){var r=new a.Vector3(0,0,0),n=new a.Vector3(0,1,0),i=new a.Matrix4;this.traverse((function(a){-1!==a.name.search("E")?a.quaternion.setFromRotationMatrix(i.lookAt(t,r,n)):-1===a.name.search("X")&&-1===a.name.search("Y")&&-1===a.name.search("Z")||a.quaternion.setFromEuler(e)}))};var i=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.CylinderGeometry(0,.05,.2,12,1,!1));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.1,0),new e({color:16777215,opacity:.25})),[0,0,0],[0,0,0]]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16776960,opacity:.25})),[.15,.15,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:65535,opacity:.25})),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.29,.29),new e({color:16711935,opacity:.25})),[.15,0,.15],[-Math.PI/2,0,0]]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.OctahedronGeometry(.2,0),r)]],XY:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,.2,0]]],YZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new a.Mesh(new a.PlaneBufferGeometry(.4,.4),r),[.2,0,.2],[-Math.PI/2,0,0]]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)},this.init()};(i.prototype=Object.create(n.prototype)).constructor=i;var o=function(){n.call(this);var e=function(e,t,r){var n=new a.BufferGeometry,i=[];r=r||1;for(var o=0;o<=64*r;++o)"x"===t&&i.push(0,Math.cos(o/32*Math.PI)*e,Math.sin(o/32*Math.PI)*e),"y"===t&&i.push(Math.cos(o/32*Math.PI)*e,0,Math.sin(o/32*Math.PI)*e),"z"===t&&i.push(Math.sin(o/32*Math.PI)*e,Math.cos(o/32*Math.PI)*e,0);return n.addAttribute("position",new a.Float32BufferAttribute(i,3)),n};this.handleGizmos={X:[[new a.Line(new e(1,"x",.5),new t({color:16711680}))]],Y:[[new a.Line(new e(1,"y",.5),new t({color:65280}))]],Z:[[new a.Line(new e(1,"z",.5),new t({color:255}))]],E:[[new a.Line(new e(1.25,"z",1),new t({color:13421568}))]],XYZE:[[new a.Line(new e(1,"z",1),new t({color:7895160}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[Math.PI/2,0,0]]],Z:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,4,12,Math.PI),r),[0,0,0],[0,0,-Math.PI/2]]],E:[[new a.Mesh(new a.TorusBufferGeometry(1.25,.12,2,24),r)]],XYZE:[[new a.Mesh(new a.TorusBufferGeometry(1,.12,2,24),r)]]},this.pickerGizmos.XYZE[0][0].visible=!1,this.setActivePlane=function(e){"E"===e&&(this.activePlane=this.planes.XYZE),"X"===e&&(this.activePlane=this.planes.YZ),"Y"===e&&(this.activePlane=this.planes.XZ),"Z"===e&&(this.activePlane=this.planes.XY)},this.update=function(e,t){n.prototype.update.apply(this,arguments);var r=new a.Matrix4,i=new a.Euler(0,0,1),o=new a.Quaternion,s=new a.Vector3(1,0,0),l=new a.Vector3(0,1,0),u=new a.Vector3(0,0,1),c=new a.Quaternion,d=new a.Quaternion,f=new a.Quaternion,h=t.clone();i.copy(this.planes.XY.rotation),o.setFromEuler(i),r.makeRotationFromQuaternion(o).getInverse(r),h.applyMatrix4(r),this.traverse((function(e){o.setFromEuler(i),"X"===e.name&&(c.setFromAxisAngle(s,Math.atan2(-h.y,h.z)),o.multiplyQuaternions(o,c),e.quaternion.copy(o)),"Y"===e.name&&(d.setFromAxisAngle(l,Math.atan2(h.x,h.z)),o.multiplyQuaternions(o,d),e.quaternion.copy(o)),"Z"===e.name&&(f.setFromAxisAngle(u,Math.atan2(h.y,h.x)),o.multiplyQuaternions(o,f),e.quaternion.copy(o))}))},this.init()};(o.prototype=Object.create(n.prototype)).constructor=o;var s=function(){n.call(this);var i=new a.Geometry,o=new a.Mesh(new a.BoxGeometry(.125,.125,.125));o.position.y=.5,o.updateMatrix(),i.merge(o.geometry,o.matrix);var s=new a.BufferGeometry;s.addAttribute("position",new a.Float32BufferAttribute([0,0,0,1,0,0],3));var l=new a.BufferGeometry;l.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,1,0],3));var u=new a.BufferGeometry;u.addAttribute("position",new a.Float32BufferAttribute([0,0,0,0,0,1],3)),this.handleGizmos={X:[[new a.Mesh(i,new e({color:16711680})),[.5,0,0],[0,0,-Math.PI/2]],[new a.Line(s,new t({color:16711680}))]],Y:[[new a.Mesh(i,new e({color:65280})),[0,.5,0]],[new a.Line(l,new t({color:65280}))]],Z:[[new a.Mesh(i,new e({color:255})),[0,0,.5],[Math.PI/2,0,0]],[new a.Line(u,new t({color:255}))]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.125,.125,.125),new e({color:16777215,opacity:.25}))]]},this.pickerGizmos={X:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,.6,0]]],Z:[[new a.Mesh(new a.CylinderBufferGeometry(.2,0,1,4,1,!1),r),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new a.Mesh(new a.BoxBufferGeometry(.4,.4,.4),r)]]},this.setActivePlane=function(e,t){var r=new a.Matrix4;t.applyMatrix4(r.getInverse(r.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(t.y)>Math.abs(t.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(t.x)>Math.abs(t.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(t.x)>Math.abs(t.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE)},this.init()};(s.prototype=Object.create(n.prototype)).constructor=s;var l=function(e,t){a.Object3D.call(this),t=void 0!==t?t:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var r=this,n="translate",l=!1,u={translate:new i,rotate:new o,scale:new s};for(var c in u){var d=u[c];d.visible=c===n,this.add(d)}var f={type:"change"},h={type:"mouseDown"},p={type:"mouseUp",mode:n},m={type:"objectChange"},v=new a.Raycaster,g=new a.Vector2,y=new a.Vector3,x=new a.Vector3,b=new a.Vector3,w=new a.Vector3,A=1,M=new a.Matrix4,T=new a.Vector3,S=new a.Matrix4,E=new a.Vector3,_=new a.Quaternion,F=new a.Vector3(1,0,0),P=new a.Vector3(0,1,0),L=new a.Vector3(0,0,1),C=new a.Quaternion,O=new a.Quaternion,N=new a.Quaternion,I=new a.Quaternion,R=new a.Quaternion,U=new a.Vector3,D=new a.Vector3,k=new a.Matrix4,B=new a.Matrix4,j=new a.Vector3,V=new a.Vector3,G=new a.Euler,z=new a.Matrix4,X=new a.Vector3,H=new a.Euler;function Y(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=K(e.changedTouches?e.changedTouches[0]:e,u[n].pickers.children),a=null;t&&(a=t.object.name,e.preventDefault()),r.axis!==a&&(r.axis=a,r.update(),r.dispatchEvent(f))}}function W(e){if(void 0!==r.object&&!0!==l&&(void 0===e.button||0===e.button)){var t=e.changedTouches?e.changedTouches[0]:e;if(0===t.button||void 0===t.button){var a=K(t,u[n].pickers.children);if(a){e.preventDefault(),e.stopPropagation(),r.axis=a.object.name,r.dispatchEvent(h),r.update(),T.copy(X).sub(V).normalize(),u[n].setActivePlane(r.axis,T);var i=K(t,[u[n].activePlane]);i&&(U.copy(r.object.position),D.copy(r.object.scale),k.extractRotation(r.object.matrix),z.extractRotation(r.object.matrixWorld),B.extractRotation(r.object.parent.matrixWorld),j.setFromMatrixScale(S.getInverse(r.object.parent.matrixWorld)),x.copy(i.point))}}l=!0}}function Q(e){if(void 0!==r.object&&null!==r.axis&&!1!==l&&(void 0===e.button||0===e.button)){var t=K(e.changedTouches?e.changedTouches[0]:e,[u[n].activePlane]);!1!==t&&(e.preventDefault(),e.stopPropagation(),y.copy(t.point),"translate"===n?(y.sub(x),y.multiply(j),"local"===r.space&&(y.applyMatrix4(S.getInverse(z)),-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(k),r.object.position.copy(U),r.object.position.add(y)),"world"!==r.space&&-1===r.axis.search("XYZ")||(-1===r.axis.search("X")&&(y.x=0),-1===r.axis.search("Y")&&(y.y=0),-1===r.axis.search("Z")&&(y.z=0),y.applyMatrix4(S.getInverse(B)),r.object.position.copy(U),r.object.position.add(y)),null!==r.translationSnap&&("local"===r.space&&r.object.position.applyMatrix4(S.getInverse(z)),-1!==r.axis.search("X")&&(r.object.position.x=Math.round(r.object.position.x/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Y")&&(r.object.position.y=Math.round(r.object.position.y/r.translationSnap)*r.translationSnap),-1!==r.axis.search("Z")&&(r.object.position.z=Math.round(r.object.position.z/r.translationSnap)*r.translationSnap),"local"===r.space&&r.object.position.applyMatrix4(z))):"scale"===n?(y.sub(x),y.multiply(j),"local"===r.space&&("XYZ"===r.axis?(A=1+y.y/Math.max(D.x,D.y,D.z),r.object.scale.x=D.x*A,r.object.scale.y=D.y*A,r.object.scale.z=D.z*A):(y.applyMatrix4(S.getInverse(z)),"X"===r.axis&&(r.object.scale.x=D.x*(1+y.x/D.x)),"Y"===r.axis&&(r.object.scale.y=D.y*(1+y.y/D.y)),"Z"===r.axis&&(r.object.scale.z=D.z*(1+y.z/D.z))))):"rotate"===n&&(y.sub(V),y.multiply(j),E.copy(x).sub(V),E.multiply(j),"E"===r.axis?(y.applyMatrix4(S.getInverse(M)),E.applyMatrix4(S.getInverse(M)),b.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),w.set(Math.atan2(E.z,E.y),Math.atan2(E.x,E.z),Math.atan2(E.y,E.x)),_.setFromRotationMatrix(S.getInverse(B)),R.setFromAxisAngle(T,b.z-w.z),C.setFromRotationMatrix(z),_.multiplyQuaternions(_,R),_.multiplyQuaternions(_,C),r.object.quaternion.copy(_)):"XYZE"===r.axis?(R.setFromEuler(y.clone().cross(E).normalize()),_.setFromRotationMatrix(S.getInverse(B)),O.setFromAxisAngle(R,-y.clone().angleTo(E)),C.setFromRotationMatrix(z),_.multiplyQuaternions(_,O),_.multiplyQuaternions(_,C),r.object.quaternion.copy(_)):"local"===r.space?(y.applyMatrix4(S.getInverse(z)),E.applyMatrix4(S.getInverse(z)),b.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),w.set(Math.atan2(E.z,E.y),Math.atan2(E.x,E.z),Math.atan2(E.y,E.x)),C.setFromRotationMatrix(k),null!==r.rotationSnap?(O.setFromAxisAngle(F,Math.round((b.x-w.x)/r.rotationSnap)*r.rotationSnap),N.setFromAxisAngle(P,Math.round((b.y-w.y)/r.rotationSnap)*r.rotationSnap),I.setFromAxisAngle(L,Math.round((b.z-w.z)/r.rotationSnap)*r.rotationSnap)):(O.setFromAxisAngle(F,b.x-w.x),N.setFromAxisAngle(P,b.y-w.y),I.setFromAxisAngle(L,b.z-w.z)),"X"===r.axis&&C.multiplyQuaternions(C,O),"Y"===r.axis&&C.multiplyQuaternions(C,N),"Z"===r.axis&&C.multiplyQuaternions(C,I),r.object.quaternion.copy(C)):"world"===r.space&&(b.set(Math.atan2(y.z,y.y),Math.atan2(y.x,y.z),Math.atan2(y.y,y.x)),w.set(Math.atan2(E.z,E.y),Math.atan2(E.x,E.z),Math.atan2(E.y,E.x)),_.setFromRotationMatrix(S.getInverse(B)),null!==r.rotationSnap?(O.setFromAxisAngle(F,Math.round((b.x-w.x)/r.rotationSnap)*r.rotationSnap),N.setFromAxisAngle(P,Math.round((b.y-w.y)/r.rotationSnap)*r.rotationSnap),I.setFromAxisAngle(L,Math.round((b.z-w.z)/r.rotationSnap)*r.rotationSnap)):(O.setFromAxisAngle(F,b.x-w.x),N.setFromAxisAngle(P,b.y-w.y),I.setFromAxisAngle(L,b.z-w.z)),C.setFromRotationMatrix(z),"X"===r.axis&&_.multiplyQuaternions(_,O),"Y"===r.axis&&_.multiplyQuaternions(_,N),"Z"===r.axis&&_.multiplyQuaternions(_,I),_.multiplyQuaternions(_,C),r.object.quaternion.copy(_))),r.update(),r.dispatchEvent(f),r.dispatchEvent(m))}}function q(e){e.preventDefault(),void 0!==e.button&&0!==e.button||(l&&null!==r.axis&&(p.mode=n,r.dispatchEvent(p)),l=!1,"TouchEvent"in window&&e instanceof TouchEvent?(r.axis=null,r.update(),r.dispatchEvent(f)):Y(e))}function K(r,a){var n=t.getBoundingClientRect(),i=(r.clientX-n.left)/n.width,o=(r.clientY-n.top)/n.height;g.set(2*i-1,-2*o+1),v.setFromCamera(g,e);var s=v.intersectObjects(a,!0);return!!s[0]&&s[0]}t.addEventListener("mousedown",W,!1),t.addEventListener("touchstart",W,!1),t.addEventListener("mousemove",Y,!1),t.addEventListener("touchmove",Y,!1),t.addEventListener("mousemove",Q,!1),t.addEventListener("touchmove",Q,!1),t.addEventListener("mouseup",q,!1),t.addEventListener("mouseout",q,!1),t.addEventListener("touchend",q,!1),t.addEventListener("touchcancel",q,!1),t.addEventListener("touchleave",q,!1),this.dispose=function(){t.removeEventListener("mousedown",W),t.removeEventListener("touchstart",W),t.removeEventListener("mousemove",Y),t.removeEventListener("touchmove",Y),t.removeEventListener("mousemove",Q),t.removeEventListener("touchmove",Q),t.removeEventListener("mouseup",q),t.removeEventListener("mouseout",q),t.removeEventListener("touchend",q),t.removeEventListener("touchcancel",q),t.removeEventListener("touchleave",q)},this.attach=function(e){this.object=e,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return n},this.setMode=function(e){for(var t in"scale"===(n=e||n)&&(r.space="local"),u)u[t].visible=t===n;this.update(),r.dispatchEvent(f)},this.setTranslationSnap=function(e){r.translationSnap=e},this.setRotationSnap=function(e){r.rotationSnap=e},this.setSize=function(e){r.size=e,this.update(),r.dispatchEvent(f)},this.setSpace=function(e){r.space=e,this.update(),r.dispatchEvent(f)},this.update=function(){void 0!==r.object&&(r.object.updateMatrixWorld(),V.setFromMatrixPosition(r.object.matrixWorld),G.setFromRotationMatrix(S.extractRotation(r.object.matrixWorld)),e.updateMatrixWorld(),X.setFromMatrixPosition(e.matrixWorld),H.setFromRotationMatrix(S.extractRotation(e.matrixWorld)),A=V.distanceTo(X)/6*r.size,this.position.copy(V),this.scale.set(A,A,A),e instanceof a.PerspectiveCamera?T.copy(X).sub(V).normalize():e instanceof a.OrthographicCamera&&T.copy(X).normalize(),"local"===r.space?u[n].update(G,T):"world"===r.space&&u[n].update(new a.Euler,T),u[n].highlight(r.axis))}};return(l.prototype=Object.create(a.Object3D.prototype)).constructor=l,l}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(e,t){var r,n,i=this,o=new a.Matrix4,s=null;"VRFrameData"in window&&(s=new VRFrameData),navigator.getVRDisplays&&navigator.getVRDisplays().then((function(e){n=e,e.length>0?r=e[0]:t&&t("VR input not available.")})).catch((function(){console.warn("THREE.VRControls: Unable to get VR Displays")})),this.scale=1,this.standing=!1,this.userHeight=1.6,this.getVRDisplay=function(){return r},this.setVRDisplay=function(e){r=e},this.getVRDisplays=function(){return console.warn("THREE.VRControls: getVRDisplays() is being deprecated."),n},this.getStandingMatrix=function(){return o},this.update=function(){var t;r&&(r.getFrameData?(r.getFrameData(s),t=s.pose):r.getPose&&(t=r.getPose()),null!==t.orientation&&e.quaternion.fromArray(t.orientation),null!==t.position?e.position.fromArray(t.position):e.position.set(0,0,0),this.standing&&(r.stageParameters?(e.updateMatrix(),o.fromArray(r.stageParameters.sittingToStandingTransform),e.applyMatrix(o)):e.position.setY(e.position.y+this.userHeight)),e.position.multiplyScalar(i.scale))},this.dispose=function(){r=null}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypedGeometryExporter=t.STLExporter=t.STLBinaryExporter=t.PLYExporter=t.OBJExporter=t.MMDExporter=t.GLTFExporter=void 0;var a=c(r(41)),n=c(r(42)),i=c(r(43)),o=c(r(44)),s=c(r(45)),l=c(r(46)),u=c(r(47));function c(e){return e&&e.__esModule?e:{default:e}}t.GLTFExporter=a.default,t.MMDExporter=n.default,t.OBJExporter=i.default,t.PLYExporter=o.default,t.STLBinaryExporter=s.default,t.STLExporter=l.default,t.TypedGeometryExporter=u.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,FLOAT:5126,UNSIGNED_INT:5125,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987},i={1003:n.NEAREST,1004:n.NEAREST_MIPMAP_NEAREST,1005:n.NEAREST_MIPMAP_LINEAR,1006:n.LINEAR,1007:n.LINEAR_MIPMAP_NEAREST,1008:n.LINEAR_MIPMAP_LINEAR},o={scale:"scale",position:"translation",quaternion:"rotation",morphTargetInfluences:"weights"},s=function(){};s.prototype={constructor:s,parse:function(e,t,r){(r=Object.assign({},{trs:!1,onlyVisible:!0,truncateDrawRange:!0,embedImages:!0,animations:[],forceIndices:!1,forcePowerOfTwoTextures:!1},r)).animations.length>0&&(r.trs=!0);var s,l={asset:{version:"2.0",generator:"THREE.GLTFExporter"}},u=0,c=[],d=[],f=new Map,h=[],p={},m={attributes:new Map,materials:new Map,textures:new Map};function v(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))}function g(e){return 4*Math.ceil(e/4)}function y(e,t){t=t||0;var r=g(e.byteLength);if(r!==e.byteLength){var a=new Uint8Array(r);if(a.set(new Uint8Array(e)),0!==t)for(var n=e.byteLength;n0)&&(t.alphaMode=e.opacity<1?"BLEND":"MASK",e.alphaTest>0&&.5!==e.alphaTest&&(t.alphaCutoff=e.alphaTest)),e.side===a.DoubleSide&&(t.doubleSided=!0),""!==e.name&&(t.name=e.name),l.materials.push(t);var i=l.materials.length-1;return m.materials.set(e,i),i}function S(e){var t,i=e.geometry;if(e.isLineSegments)t=n.LINES;else if(e.isLineLoop)t=n.LINE_LOOP;else if(e.isLine)t=n.LINE_STRIP;else if(e.isPoints)t=n.POINTS;else{if(!i.isBufferGeometry){var o=new a.BufferGeometry;o.fromGeometry(i),i=o}e.drawMode===a.TriangleFanDrawMode?(console.warn("GLTFExporter: TriangleFanDrawMode and wireframe incompatible."),t=n.TRIANGLE_FAN):t=e.drawMode===a.TriangleStripDrawMode?e.material.wireframe?n.LINE_STRIP:n.TRIANGLE_STRIP:e.material.wireframe?n.LINES:n.TRIANGLES}var s={},u={},c=[],d=[],f={uv:"TEXCOORD_0",uv2:"TEXCOORD_1",color:"COLOR_0",skinWeight:"WEIGHTS_0",skinIndex:"JOINTS_0"},h=i.getAttribute("normal");for(var p in void 0===h||function(e){if(m.attributes.has(e))return!1;for(var t=new a.Vector3,r=0,n=e.count;r5e-4)return!1;return!0}(h)||(console.warn("THREE.GLTFExporter: Creating normalized normal attribute from the non-normalized one."),i.addAttribute("normal",function(e){if(m.attributes.has(e))return m.textures.get(e);for(var t=e.clone(),r=new a.Vector3,n=0,i=t.count;n0){var x=[],w=[],A={};if(void 0!==e.morphTargetDictionary)for(var M in e.morphTargetDictionary)A[e.morphTargetDictionary[M]]=M;for(var S=0;S0&&(s.extras={},s.extras.targetNames=w)}var O=r.forceIndices,N=Array.isArray(e.material);if(N&&0===e.geometry.groups.length)return null;!O&&null===i.index&&N&&(console.warn("THREE.GLTFExporter: Creating index for non-indexed multi-material mesh."),O=!0);var I=!1;if(null===i.index&&O){for(var R=[],U=(S=0,i.attributes.position.count);S0&&(B.targets=d),null!==i.index&&(B.indices=b(i.index,i,k[S].start,k[S].count));var j=T(D[k[S].materialIndex]);null!==j&&(B.material=j),c.push(B)}return I&&i.setIndex(null),s.primitives=c,l.meshes||(l.meshes=[]),l.meshes.push(s),l.meshes.length-1}function E(e,t){l.animations||(l.animations=[]);for(var r=[],n=[],i=0;i0)try{t.extras=JSON.parse(JSON.stringify(e.userData))}catch(e){throw new Error("THREE.GLTFExporter: userData can't be serialized")}if(e.isMesh||e.isLine||e.isPoints){var s=S(e);null!==s&&(t.mesh=s)}else e.isCamera&&(t.camera=function(e){l.cameras||(l.cameras=[]);var t=e.isOrthographicCamera,r={type:t?"orthographic":"perspective"};return t?r.orthographic={xmag:2*e.right,ymag:2*e.top,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near}:r.perspective={aspectRatio:e.aspect,yfov:a.Math.degToRad(e.fov)/e.aspect,zfar:e.far<=0?.001:e.far,znear:e.near<0?0:e.near},""!==e.name&&(r.name=e.type),l.cameras.push(r),l.cameras.length-1}(e));if(e.isSkinnedMesh&&h.push(e),e.children.length>0){for(var u=[],c=0,d=e.children.length;c0&&(t.children=u)}l.nodes.push(t);var g=l.nodes.length-1;return f.set(e,g),g}function P(e){l.scenes||(l.scenes=[],l.scene=0);var t={nodes:[]};""!==e.name&&(t.name=e.name),l.scenes.push(t);for(var a=[],n=0,i=e.children.length;n0&&(t.nodes=a)}!function(e){e=e instanceof Array?e:[e];for(var t=[],n=0;n0&&function(e){var t=new a.Scene;t.name="AuxScene";for(var r=0;r0&&(l.extensionsUsed=a),l.buffers&&l.buffers.length>0){l.buffers[0].byteLength=e.size;var n=new window.FileReader;if(!0===r.binary){n.readAsArrayBuffer(e),n.onloadend=function(){var e=y(n.result),r=new DataView(new ArrayBuffer(8));r.setUint32(0,e.byteLength,!0),r.setUint32(4,5130562,!0);var a=y(function(e){if(void 0!==window.TextEncoder)return(new TextEncoder).encode(e).buffer;for(var t=new Uint8Array(new ArrayBuffer(e.length)),r=0,a=e.length;r255?32:n}return t.buffer}(JSON.stringify(l)),32),i=new DataView(new ArrayBuffer(8));i.setUint32(0,a.byteLength,!0),i.setUint32(4,1313821514,!0);var o=new ArrayBuffer(12),s=new DataView(o);s.setUint32(0,1179937895,!0),s.setUint32(4,2,!0);var u=12+i.byteLength+a.byteLength+r.byteLength+e.byteLength;s.setUint32(8,u,!0);var c=new Blob([o,i,a,r,e],{type:"application/octet-stream"}),d=new window.FileReader;d.readAsArrayBuffer(c),d.onloadend=function(){t(d.result)}}}else n.readAsDataURL(e),n.onloadend=function(){var e=n.result;l.buffers[0].uri=e,t(l)}}else t(l)}))}},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(r(0)),n=i(r(4));function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}t.default=function(){var e;this.parseVpd=function(t,r,i){if(!0!==t.isSkinnedMesh)return console.warn("THREE.MMDExporter: parseVpd() requires SkinnedMesh instance."),null;function o(e){Math.abs(e)<1e-6&&(e=0);var t=e.toString();-1===t.indexOf(".")&&(t+=".");var r=(t+="000000").indexOf(".");return t.slice(0,r)+"."+t.slice(r+1,r+7)}function s(e){for(var t=[],r=0,a=e.length;r255?(u.push(l>>8&255),u.push(255&l)):u.push(255&l)}return new Uint8Array(u)}(w):w}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(){};n.prototype={constructor:n,parse:function(e){var t,r,n,i,o,s="",l=0,u=0,c=0,d=new a.Vector3,f=new a.Vector3,h=new a.Vector2,p=[];return e.traverse((function(e){e instanceof a.Mesh&&function(e){var n=0,m=0,v=0,g=e.geometry,y=new a.Matrix3;if(g instanceof a.Geometry&&(g=(new a.BufferGeometry).setFromObject(e)),g instanceof a.BufferGeometry){var x=g.getAttribute("position"),b=g.getAttribute("normal"),w=g.getAttribute("uv"),A=g.getIndex();if(s+="o "+e.name+"\n",e.material&&e.material.name&&(s+="usemtl "+e.material.name+"\n"),void 0!==x)for(t=0,i=x.count;t=200)return void n("THREE.AssimpJSONLoader: Unsupported assimp2json file format version.")}t(i.parse(r,o))}),r,n)},setCrossOrigin:function(e){this.crossOrigin=e},parse:function(e,t){function r(e,t){for(var r=new Array(e.length),a=0;a0&&i.addAttribute("normal",new a.Float32BufferAttribute(l,3)),u.length>0&&i.addAttribute("uv",new a.Float32BufferAttribute(u,2)),c.length>0&&i.addAttribute("color",new a.Float32BufferAttribute(c,3)),i.computeBoundingSphere(),i})),o=r(e.materials,(function(e){var t=new a.MeshPhongMaterial;for(var r in e.properties){var i=e.properties[r],o=i.key,s=i.value;switch(o){case"$tex.file":var l=i.semantic;if(1===l||2===l||5===l||6===l){var u;switch(l){case 1:u="map";break;case 2:u="specularMap";break;case 5:u="bumpMap";break;case 6:u="normalMap"}var c=n.load(s);c.wrapS=c.wrapT=a.RepeatWrapping,t[u]=c}break;case"?mat.name":t.name=s;break;case"$clr.diffuse":t.color.fromArray(s);break;case"$clr.specular":t.specular.fromArray(s);break;case"$clr.emissive":t.emissive.fromArray(s);break;case"$mat.shininess":t.shininess=s;break;case"$mat.shadingm":t.flatShading=1===s;break;case"$mat.opacity":s<1&&(t.opacity=s,t.transparent=!0)}}return t}));return function e(t,r,n,i){var o,s,l=new a.Object3D;for(l.name=r.name||"",l.matrix=(new a.Matrix4).fromArray(r.transformation).transpose(),l.matrix.decompose(l.position,l.quaternion,l.scale),o=0;r.meshes&&o0?this.length=this.keys[this.keys.length-1].time:this.length=0,this.fps)for(var e=0;e=e/this.fps){this._accelTable[e]=t;break}}},this.parseFromThree=function(e){var t=e.fps;this.target=e.node;for(var r=e.hierarchy[0].keys,a=0;ae){t=this.keys[a],r=this.keys[a+1];break}if(this.keys[a].time4&&(r.length=4);var n=0;for(a=0;a<4;a++)n+=r[a].w*r[a].w;n=Math.sqrt(n);for(a=0;a<4;a++)r[a].w=r[a].w/n,e[a]=r[a].i,t[a]=r[a].w}function I(e,t){if(0==e.name.indexOf("bone_"+t))return e;for(var r in e.children){var a=I(e.children[r],t);if(a)return a}}function R(){this.mPrimitiveTypes=0,this.mNumVertices=0,this.mNumFaces=0,this.mNumBones=0,this.mMaterialIndex=0,this.mVertices=[],this.mNormals=[],this.mTangents=[],this.mBitangents=[],this.mColors=[[]],this.mTextureCoords=[[]],this.mFaces=[],this.mBones=[],this.hookupSkeletons=function(e,t){if(0!=this.mBones.length){for(var r=[],n=[],i=e.findNode(this.mBones[0].mName);i.mParent&&i.mParent.isBone;)i=i.mParent;var o=O(u=i.toTHREE(e),e);this.threeNode.add(o);for(var s=0;s0&&n.addAttribute("normal",new a.BufferAttribute(this.mNormalBuffer,3)),this.mColorBuffer&&this.mColorBuffer.length>0&&n.addAttribute("color",new a.BufferAttribute(this.mColorBuffer,4)),this.mTexCoordsBuffers[0]&&this.mTexCoordsBuffers[0].length>0&&n.addAttribute("uv",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[0]),2)),this.mTexCoordsBuffers[1]&&this.mTexCoordsBuffers[1].length>0&&n.addAttribute("uv1",new a.BufferAttribute(new Float32Array(this.mTexCoordsBuffers[1]),2)),this.mTangentBuffer&&this.mTangentBuffer.length>0&&n.addAttribute("tangents",new a.BufferAttribute(this.mTangentBuffer,3)),this.mBitangentBuffer&&this.mBitangentBuffer.length>0&&n.addAttribute("bitangents",new a.BufferAttribute(this.mBitangentBuffer,3)),this.mBones.length>0){for(var i=[],o=[],s=0;s0&&(r=new a.SkinnedMesh(n,t)),this.threeNode=r,r}}function U(){this.mNumIndices=0,this.mIndices=[]}function D(){this.x=0,this.y=0,this.z=0,this.toTHREE=function(){return new a.Vector3(this.x,this.y,this.z)}}function k(){this.r=0,this.g=0,this.b=0,this.a=0,this.toTHREE=function(){return new a.Color(this.r,this.g,this.b,1)}}function B(){this.x=0,this.y=0,this.z=0,this.w=0,this.toTHREE=function(){return new a.Quaternion(this.x,this.y,this.z,this.w)}}function j(){this.mVertexId=0,this.mWeight=0}function V(){this.data=[],this.toString=function(){var e="";return this.data.forEach((function(t){e+=String.fromCharCode(t)})),e.replace(/[^\x20-\x7E]+/g,"")}}function G(){this.mTime=0,this.mValue=null}function z(){this.mTime=0,this.mValue=null}function X(){this.mName="",this.mTransformation=[],this.mNumChildren=0,this.mNumMeshes=0,this.mMeshes=[],this.mChildren=[],this.toTHREE=function(e){if(this.threeNode)return this.threeNode;var t=new a.Object3D;t.name=this.mName,t.matrix=this.mTransformation.toTHREE();for(var r=0;r0)var r=this.mAnimations[0].toTHREE(this);return{object:e,animation:r}}}function ie(){this.elements=[[],[],[],[]],this.toTHREE=function(){for(var e=new a.Matrix4,t=0;t<4;++t)for(var r=0;r<4;++r)e.elements[4*t+r]=this.elements[r][t];return e}}var oe=!0;function se(e){var t=e.getFloat32(e.readOffset,oe);return e.readOffset+=4,t}function le(e){var t=e.getFloat64(e.readOffset,oe);return e.readOffset+=8,t}function ue(e){var t=e.getUint16(e.readOffset,oe);return e.readOffset+=2,t}function ce(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function de(e){var t=e.getUint32(e.readOffset,oe);return e.readOffset+=4,t}function fe(e){var t=new D;return t.x=se(e),t.y=se(e),t.z=se(e),t}function he(e){var t=new k;return t.r=se(e),t.g=se(e),t.b=se(e),t}function pe(e){var t=new V,r=ce(e);return e.ReadBytes(t.data,1,r),t.toString()}function me(e){var t=new j;return t.mVertexId=ce(e),t.mWeight=se(e),t}function ve(e){for(var t=new ie,r=0;r<4;++r)for(var a=0;a<4;++a)t.elements[r][a]=se(e);return t}function ge(e){var t=new G;return t.mTime=le(e),t.mValue=fe(e),t}function ye(e){var t=new z;return t.mTime=le(e),t.mValue=function(e){var t=new B;return t.w=se(e),t.x=se(e),t.y=se(e),t.z=se(e),t}(e),t}function xe(e,t,r){for(var a=0;a0,Ne=ue(r)>0,Oe)throw"Shortened binaries are not supported!";if(r.Seek(256,Ie),r.Seek(128,Ie),r.Seek(64,Ie),!Ne)return Ce(r,t),t.toTHREE();var a=de(r),n=r.FileSize()-r.Tell(),i=[];r.Read(i,1,n);var o=[];uncompress(o,a,i,n),Ce(new ArrayBuffer(o),t)}(e)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));t.default=function(){function e(){this.id=0,this.data=null}function t(){}t.prototype={set:function(e,t){this[e]=t},get:function(e,t){return this.hasOwnProperty(e)?this[e]:t}};var r=function(t){this.manager=void 0!==t?t:a.DefaultLoadingManager,this.trunk=new a.Object3D,this.materialFactory=void 0,this._url="",this._baseDir="",this._data=void 0,this._ptr=0,this._version=[],this._streaming=!1,this._optimized_for_accuracy=!1,this._compression=0,this._bodylen=4294967295,this._blocks=[new e],this._accuracyMatrix=!1,this._accuracyGeo=!1,this._accuracyProps=!1};return r.prototype={constructor:r,load:function(e,t,r,n){var i=this;this._url=e,this._baseDir=e.substr(0,e.lastIndexOf("/")+1);var o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){var t=e.byteLength;for(this._ptr=0,this._data=new DataView(e),this._parseHeader(),0!=this._compression&&console.error("compressed AWD not supported"),this._streaming||this._bodylen==e.byteLength-this._ptr||console.error("AWDLoader: body len does not match file length",this._bodylen,t-this._ptr);this._ptr1)for(r=new a.Object3D,p=0;p191&&a<224){var n=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((31&a)<<6|63&n)}else{n=this._data.getUint8(this._ptr++,!0);var i=this._data.getUint8(this._ptr++,!0);t[r++]=String.fromCharCode((15&a)<<12|(63&n)<<6|63&i)}}return t.join("")}},r}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(JSON.parse(e)))}),r,n)},parse:function(e){function t(e){var t=new a.BufferGeometry,r=e.indices,n=e.positions,i=e.normals,o=e.uvs;t.setIndex(r);for(var s=2,l=n.length;s0&&t.push(new a.VectorKeyframeTrack(n+".position",i,o)),s.length>0&&t.push(new a.QuaternionKeyframeTrack(n+".quaternion",i,s)),l.length>0&&t.push(new a.VectorKeyframeTrack(n+".scale",i,l)),t}function M(e,t,r){var a,n,i,o=!0;for(n=0,i=e.length;n=0;){var a=e[t];if(null!==a.value[r])return a;t--}return null}function S(e,t,r){for(;t0&&t0&&h.addAttribute("position",new a.Float32BufferAttribute(i.array,i.stride)),o.array.length>0&&h.addAttribute("normal",new a.Float32BufferAttribute(o.array,o.stride)),l.array.length>0&&h.addAttribute("color",new a.Float32BufferAttribute(l.array,l.stride)),s.array.length>0&&h.addAttribute("uv",new a.Float32BufferAttribute(s.array,s.stride)),u.length>0&&h.addAttribute("skinIndex",new a.Float32BufferAttribute(u,c)),d.length>0&&h.addAttribute("skinWeight",new a.Float32BufferAttribute(d,f)),n.data=h,n.type=e[0].type,n.materialKeys=p,n}function de(e,t,r,a){var n=e.p,i=e.stride,o=e.vcount;function s(e){for(var t=n[e+r]*u,i=t+u;t4)for(var g=1,y=h-2;g<=y;g++){p=c+i*g,m=c+i*(g+1);s(c+0*i),s(p),s(m)}c+=i*h}else for(d=0,f=n.length;d=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function ge(e){for(var t={sid:e.getAttribute("sid"),name:e.getAttribute("name")||"",attachments:[],transforms:[]},r=0;rn.limits.max||t>8&255,f>>16&255,f>>24&255))),r;p=!0,o=64,r.format=a.RGBAFormat}r.mipmapCount=1,131072&d[2]&&!1!==t&&(r.mipmapCount=Math.max(1,d[7]));var m=d[28];if(r.isCubemap=!!(512&m),r.isCubemap&&(!(1024&m)||!(2048&m)||!(4096&m)||!(8192&m)||!(16384&m)||!(32768&m)))return console.error("THREE.DDSLoader.parse: Incomplete cubemap faces"),r;r.width=d[4],r.height=d[3];for(var v=d[1]+4,g=r.isCubemap?6:1,y=0;y>1,1),b=Math.max(b>>1,1)}return r},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="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},n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var i=function(e){this.timeLoaded=0,this.manager=e||n.DefaultLoadingManager,this.materials=null,this.verbosity=0,this.attributeOptions={},this.drawMode=n.TrianglesDrawMode,this.nativeAttributeMap={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"}};i.prototype={constructor:i,load:function(e,t,r,a){var i=this,o=new n.FileLoader(i.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),o.load(e,(function(e){i.decodeDracoFile(e,t)}),r,a)},setPath:function(e){this.path=e},setCrossOrigin:function(e){this.crossOrigin=e},setVerbosity:function(e){this.verbosity=e},setDrawMode:function(e){this.drawMode=e},setSkipDequantization:function(e,t){var r=!0;void 0!==t&&(r=t),this.getAttributeOptions(e).skipDequantization=r},decodeDracoFile:function(e,t,r){var a=this;i.getDecoderModule().then((function(n){a.decodeDracoFileInternal(e,n.decoder,t,r||{})}))},decodeDracoFileInternal:function(e,t,r,a){var n=new t.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength);var i=new t.Decoder,o=i.GetEncodedGeometryType(n);if(o==t.TRIANGULAR_MESH)this.verbosity>0&&console.log("Loaded a mesh.");else{if(o!=t.POINT_CLOUD){var s="THREE.DRACOLoader: Unknown geometry type.";throw console.error(s),new Error(s)}this.verbosity>0&&console.log("Loaded a point cloud.")}r(this.convertDracoGeometryTo3JS(t,i,o,n,a))},addAttributeToGeometry:function(e,t,r,a,i,o,s){if(0===i.ptr){var l="THREE.DRACOLoader: No attribute "+a;throw console.error(l),new Error(l)}var u=i.num_components(),c=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,c);var d=r.num_points()*u;s[a]=new Float32Array(d);for(var f=0;f0&&console.log("Number of faces loaded: "+c.toString())):c=0;var f=o.num_points(),h=o.num_attributes();this.verbosity>0&&(console.log("Number of points loaded: "+f.toString()),console.log("Number of attributes loaded: "+h.toString()));var p=t.GetAttributeId(o,e.POSITION);if(-1==p){u="THREE.DRACOLoader: No position attribute found.";throw console.error(u),e.destroy(t),e.destroy(o),new Error(u)}var m=t.GetAttribute(o,p),v={},g=new n.BufferGeometry;for(var y in this.nativeAttributeMap)if(void 0===i[y]){var x=t.GetAttributeId(o,e[this.nativeAttributeMap[y]]);if(-1!==x){this.verbosity>0&&console.log("Loaded "+y+" attribute.");var b=t.GetAttribute(o,x);this.addAttributeToGeometry(e,t,o,y,b,g,v)}}for(var y in i){var w=i[y];b=t.GetAttributeByUniqueId(o,w);this.addAttributeToGeometry(e,t,o,y,b,g,v)}if(r==e.TRIANGULAR_MESH)if(this.drawMode===n.TriangleStripDrawMode){var A=new e.DracoInt32Array;t.GetTriangleStripsFromMesh(o,A);v.indices=new Uint32Array(A.size());for(var M=0;M65535?n.Uint32BufferAttribute:n.Uint16BufferAttribute)(v.indices,1));var _=new e.AttributeQuantizationTransform;if(_.InitFromAttribute(m)){g.attributes.position.isQuantized=!0,g.attributes.position.maxRange=_.range(),g.attributes.position.numQuantizationBits=_.quantization_bits(),g.attributes.position.minValues=new Float32Array(3);for(M=0;M<3;++M)g.attributes.position.minValues[M]=_.min_value(M)}return e.destroy(_),e.destroy(t),e.destroy(o),this.decode_time=d-l,this.import_time=performance.now()-d,this.verbosity>0&&(console.log("Decode time: "+this.decode_time),console.log("Import time: "+this.import_time)),g},isVersionSupported:function(e,t){i.getDecoderModule().then((function(r){t(r.decoder.isVersionSupported(e))}))},getAttributeOptions:function(e){return void 0===this.attributeOptions[e]&&(this.attributeOptions[e]={}),this.attributeOptions[e]}},i.decoderPath="./",i.decoderConfig={},i.decoderModulePromise=null,i.setDecoderPath=function(e){i.decoderPath=e},i.setDecoderConfig=function(e){var t=i.decoderConfig.wasmBinary;i.decoderConfig=e||{},i.releaseDecoderModule(),t&&(i.decoderConfig.wasmBinary=t)},i.releaseDecoderModule=function(){i.decoderModulePromise=null},i.getDecoderModule=function(){var e=this,t=i.decoderPath,r=i.decoderConfig,n=i.decoderModulePromise;return n||("undefined"!=typeof DracoDecoderModule?n=Promise.resolve():"object"!==("undefined"==typeof WebAssembly?"undefined":a(WebAssembly))||"js"===r.type?n=i._loadScript(t+"draco_decoder.js"):(r.wasmBinaryFile=t+"draco_decoder.wasm",n=i._loadScript(t+"draco_wasm_wrapper.js").then((function(){return i._loadArrayBuffer(r.wasmBinaryFile)})).then((function(e){r.wasmBinary=e}))),n=n.then((function(){return new Promise((function(t){r.onModuleLoaded=function(r){e.timeLoaded=performance.now(),t({decoder:r})},DracoDecoderModule(r)}))})),i.decoderModulePromise=n,n)},i._loadScript=function(e){var t=document.getElementById("decoder_script");null!==t&&t.parentNode.removeChild(t);var r=document.getElementsByTagName("head")[0],a=document.createElement("script");return a.id="decoder_script",a.type="text/javascript",a.src=e,new Promise((function(e){a.onload=e,r.appendChild(a)}))},i._loadArrayBuffer=function(e){var t=new n.FileLoader;return t.setResponseType("arraybuffer"),new Promise((function(r,a){t.load(e,r,void 0,a)}))},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){this.sourceTexture=e,this.resolution=t,this.views=[{t:[1,0,0],u:[0,-1,0]},{t:[-1,0,0],u:[0,-1,0]},{t:[0,1,0],u:[0,0,1]},{t:[0,-1,0],u:[0,0,-1]},{t:[0,0,1],u:[0,-1,0]},{t:[0,0,-1],u:[0,-1,0]}],this.camera=new a.PerspectiveCamera(90,1,.1,10),this.boxMesh=new a.Mesh(new a.BoxBufferGeometry(1,1,1),this.getShader()),this.boxMesh.material.side=a.BackSide,this.scene=new a.Scene,this.scene.add(this.boxMesh);var r={format:a.RGBAFormat,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.renderTarget=new a.WebGLRenderTargetCube(this.resolution,this.resolution,r)};n.prototype={constructor:n,update:function(e){for(var t=0;t<6;t++){this.renderTarget.activeCubeFace=t;var r=this.views[t];this.camera.position.set(0,0,0),this.camera.up.set(r.u[0],r.u[1],r.u[2]),this.camera.lookAt(r.t[0],r.t[1],r.t[2]),e.render(this.scene,this.camera,this.renderTarget,!0)}return this.renderTarget.texture},getShader:function(){var e=new a.ShaderMaterial({uniforms:{equirectangularMap:{value:this.sourceTexture}},vertexShader:"varying vec3 localPosition;\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tlocalPosition = position;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \n\t\t\t\tvarying vec3 localPosition;\n\t\t\t\tuniform sampler2D equirectangularMap;\n\t\t\t\t\n\t\t\t\tvec2 EquiangularSampleUV(vec3 v) {\n\t\t\t vec2 uv = vec2(atan(v.z, v.x), asin(v.y));\n\t\t\t uv *= vec2(0.1591, 0.3183); // inverse atan\n\t\t\t uv += 0.5;\n\t\t\t return uv;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 uv = EquiangularSampleUV(normalize(localPosition));\n \t\t\tvec3 color = texture2D(equirectangularMap, uv).rgb;\n \t\t\t\n\t\t\t\t\tgl_FragColor = vec4( color, 1.0 );\n\t\t\t\t}",blending:a.CustomBlending,premultipliedAlpha:!1,blendSrc:a.OneFactor,blendDst:a.ZeroFactor,blendSrcAlpha:a.OneFactor,blendDstAlpha:a.ZeroFactor,blendEquation:a.AddEquation});return e.type="EquiangularToCubeGenerator",e},dispose:function(){this.boxMesh.geometry.dispose(),this.boxMesh.material.dispose(),this.renderTarget.dispose()}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};(n.prototype=Object.create(a.DataTextureLoader.prototype))._parser=function(e){var t=65536,r=t>>3,n=14,i=65537,o=1<>r&(1<a)return!1;g(6,f,h,e,d);var p=v.l;if(f=v.c,h=v.lc,s[n]=p,p==u){if(d.value-r.value>a)throw"Something wrong with hufUnpackEncTable";g(8,f,h,e,d);var m=v.l+c;if(f=v.c,h=v.lc,n+m>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}else if(p>=l){if(n+(m=p-l+2)>o+1)throw"Something wrong with hufUnpackEncTable";for(;m--;)s[n++]=0;n--}}!function(e){for(var t=0;t<=58;++t)y[t]=0;for(t=0;t0;--t){var a=r+y[t]>>1;y[t]=r,r=a}for(t=0;t0&&(e[t]=n|y[n]++<<6)}}(s)}function b(e){return 63&e}function w(e){return e>>6}var A={c:0,lc:0};function M(e,t,r,a){e=e<<8|R(r,a),t+=8,A.c=e,A.lc=t}var T={c:0,lc:0};function S(e,t,r,a,n,i,o,s,l,u){if(e==t){a<8&&(M(r,a,n,o),r=A.c,a=A.lc);var c=r>>(a-=8);if(out+c>oe)throw"Issue with getCode";for(var d=out[-1];c-- >0;)s[l.value++]=d}else{if(!(l.value32767?t-65536:t}var _={a:0,b:0};function F(e,t){var r=E(e),a=E(t),n=r+(1&a)+(a>>1),i=n,o=n-a;_.a=i,_.b=o}function P(e,t,r,a,n,i,o){for(var s,l=r>n?n:r,u=1;u<=l;)u<<=1;for(s=u>>=1,u>>=1;u>=1;){for(var c,d,f,h,p=0,m=p+i*(n-s),v=i*u,g=i*s,y=a*u,x=a*s;p<=m;p+=g){for(var b=p,w=p+a*(r-s);b<=w;b+=x){var A=b+y,M=(T=b+v)+y;F(t[b+e],t[T+e]),c=_.a,f=_.b,F(t[A+e],t[M+e]),d=_.a,h=_.b,F(c,d),t[b+e]=_.a,t[A+e]=_.b,F(f,h),t[T+e]=_.a,t[M+e]=_.b}if(r&u){var T=b+v;F(t[b+e],t[T+e]),c=_.a,t[T+e]=_.b,t[b+e]=c}}if(n&u)for(b=p,w=p+a*(r-s);b<=w;b+=x){A=b+y;F(t[b+e],t[A+e]),c=_.a,t[A+e]=_.b,t[b+e]=c}s=u,u>>=1}return p}function L(e,t,r,a,l,u,c){var d=r.value,f=I(t,r),h=I(t,r);r.value+=4;var p=I(t,r);if(r.value+=4,f<0||f>=i||h<0||h>=i)throw"Something wrong with HUF_ENCSIZE";var m=new Array(i),v=new Array(o);if(function(e){for(var t=0;t8*(a-(r.value-d)))throw"Something wrong with hufUncompress";!function(e,t,r,a){for(;t<=r;t++){var i=w(e[t]),o=b(e[t]);if(i>>o)throw"Invalid table entry";if(o>n){if((c=a[i>>o-n]).len)throw"Invalid table entry";if(c.lit++,c.p){var s=c.p;c.p=new Array(c.lit);for(var l=0;l0;l--){var c;if((c=a[(i<=n;){if((x=t[f>>h-n&s]).len)h-=x.len,S(x.lit,l,f,h,r,0,i,c,d,p),f=T.c,h=T.lc;else{if(!x.p)throw"hufDecode issues";var v;for(v=0;v=g&&w(e[x.p[v]])==(f>>h-g&(1<>=y,h-=y;h>0;){var x;if(!(x=t[f<=r)throw"Something is wrong with PIZ_COMPRESSION BITMAP_SIZE";if(h<=p)for(var m=0;m>3]&1<<(7&n))&&(r[a++]=n);for(var i=a-1;a>10,r=1023&e;return(e>>15?-1:1)*(t?31===t?r?NaN:1/0:Math.pow(2,t-15)*(1+r/1024):r/1024*6103515625e-14)}function B(e,t){var r=e.getUint16(t.value,!0);return t.value+=p,r}function j(e,t){return k(B(e,t))}function V(e,t,r,a,n){if("string"===a||"iccProfile"===a)return function(e,t,r){var a=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+r));return t.value=t.value+r,a}(t,r,n);if("chlist"===a)return function(e,t,r,a){for(var n=r.value,i=[];r.value0&&void 0!==r[l[0].ID]&&(0!==(i=r[l[0].ID]).indexOf("blob:")&&0!==i.indexOf("data:")||t.setPath(void 0));o="tga"===e.FileName.slice(-3).toLowerCase()?n.Loader.Handlers.get(".tga").load(i):t.load(i);return t.setPath(s),o}(e,t,r,a);i.ID=e.id,i.name=e.attrName;var o=e.WrapModeU,s=e.WrapModeV,l=void 0!==o?o.value:0,u=void 0!==s?s.value:0;if(i.wrapS=0===l?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===u?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in e){var c=e.Scaling.value;i.repeat.x=c[0],i.repeat.y=c[1]}return i}function i(e,t,r,i){var s=t.id,l=t.attrName,u=t.ShadingModel;if("object"===(void 0===u?"undefined":a(u))&&(u=u.value),!i.has(s))return null;var c,d=function(e,t,r,a,i){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value);t.Diffuse?s.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(s.color=(new n.Color).fromArray(t.DiffuseColor.value));t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value);t.Emissive?s.emissive=(new n.Color).fromArray(t.Emissive.value):t.EmissiveColor&&"Color"===t.EmissiveColor.type&&(s.emissive=(new n.Color).fromArray(t.EmissiveColor.value));t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value));t.Opacity&&(s.opacity=parseFloat(t.Opacity.value));s.opacity<1&&(s.transparent=!0);t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value);t.Shininess&&(s.shininess=t.Shininess.value);t.Specular?s.specular=(new n.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new n.Color).fromArray(t.SpecularColor.value));return i.get(a).children.forEach((function(t){var a=t.relationship;switch(a){case"Bump":s.bumpMap=r.get(t.ID);break;case"DiffuseColor":s.map=o(e,r,t.ID,i);break;case"DisplacementColor":s.displacementMap=o(e,r,t.ID,i);break;case"EmissiveColor":s.emissiveMap=o(e,r,t.ID,i);break;case"NormalMap":s.normalMap=o(e,r,t.ID,i);break;case"ReflectionColor":s.envMap=o(e,r,t.ID,i),s.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":s.specularMap=o(e,r,t.ID,i);break;case"TransparentColor":s.alphaMap=o(e,r,t.ID,i),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",a)}})),s}(e,t,r,s,i);switch(u.toLowerCase()){case"phong":c=new n.MeshPhongMaterial;break;case"lambert":c=new n.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',u),c=new n.MeshPhongMaterial({color:3342591})}return c.setValues(d),c.name=l,c}function o(e,t,r,a){return"LayeredTexture"in e.Objects&&r in e.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),r=a.get(r).children[0].ID),t.get(r)}function s(e,t){var r=[];return e.children.forEach((function(e){var a=t[e.ID];if("Cluster"===a.attrType){var i={ID:e.ID,indices:[],weights:[],transform:(new n.Matrix4).fromArray(a.Transform.a),transformLink:(new n.Matrix4).fromArray(a.TransformLink.a),linkMode:a.Mode};"Indexes"in a&&(i.indices=a.Indexes.a,i.weights=a.Weights.a),r.push(i)}})),{rawBones:r,bones:[]}}function l(e,t,r,a){for(var n=[],i=0;i0&&o.addAttribute("color",new n.Float32BufferAttribute(l.colors,3));r&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(l.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(l.vertexWeights,4)),o.FBX_Deformer=r);if(l.normal.length>0){var f=new n.Float32BufferAttribute(l.normal,3);(new n.Matrix3).getNormalMatrix(i).applyToBufferAttribute(f),o.addAttribute("normal",f)}if(l.uvs.forEach((function(e,t){var r="uv"+(t+1).toString();0===t&&(r="uv"),o.addAttribute(r,new n.Float32BufferAttribute(l.uvs[t],2))})),s.material&&"AllSame"!==s.material.mappingType){var h=l.materialIndex[0],p=0;if(l.materialIndex.forEach((function(e,t){e!==h&&(o.addGroup(p,t-p,h),h=e,p=t)})),o.groups.length>0){var m=o.groups[o.groups.length-1],v=m.start+m.count;v!==l.materialIndex.length&&o.addGroup(v,l.materialIndex.length-v,h)}0===o.groups.length&&o.addGroup(0,l.materialIndex.length,l.materialIndex[0])}return function(e,t,r,a,i){if(null===a)return;t.morphAttributes.position=[],t.morphAttributes.normal=[],a.rawTargets.forEach((function(a){var o=e.Objects.Geometry[a.geoID];void 0!==o&&function(e,t,r,a){var i=new n.BufferGeometry;r.attrName&&(i.name=r.attrName);for(var o=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],s=void 0!==t.Vertices?t.Vertices.a.slice():[],l=void 0!==r.Vertices?r.Vertices.a:[],u=void 0!==r.Indexes?r.Indexes.a:[],d=0;d4){n||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),n=!0);var y=[0,0,0,0],x=[0,0,0,0];v.forEach((function(e,t){var r=e,a=m[t];x.forEach((function(e,t,n){if(r>e){n[t]=r,r=e;var i=y[t];y[t]=a,a=i}}))})),m=y,v=x}for(;v.length<4;)v.push(0),m.push(0);for(var b=0;b<4;++b)u.push(v[b]),c.push(m[b])}if(e.normal){g=h(f,r,d,e.normal);o.push(g[0],g[1],g[2])}if(e.material&&"AllSame"!==e.material.mappingType)var w=h(f,r,d,e.material)[0];e.uv&&e.uv.forEach((function(e,t){var a=h(f,r,d,e);void 0===l[t]&&(l[t]=[]),l[t].push(a[0]),l[t].push(a[1])})),a++,p&&(!function(e,t,r,a,n,i,o,s,l,u){for(var c=2;c=d.length&&d===O(c,0,d.length))o=(new E).parse(e);else{var f=O(e);if(!function(e){var t=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],r=0;for(var a=0;a0,u="string"==typeof o.Content&&""!==o.Content;if(l||u){var c=t(n[i]);a[o.RelativeFilename||o.Filename]=c}}}}for(var s in r){var d=r[s];void 0!==a[d]?r[s]=a[d]:r[s]=r[s].split("\\").pop()}return r}(o),A=function(e,t,r){var a=new Map;if("Material"in e.Objects){var n=e.Objects.Material;for(var o in n){var s=i(e,n[o],t,r);null!==s&&a.set(parseInt(o),s)}}return a}(o,function(e,t,a,n){var i=new Map;if("Texture"in e.Objects){var o=e.Objects.Texture;for(var s in o){var l=r(o[s],t,a,n);i.set(parseInt(s),l)}}return i}(o,new n.TextureLoader(this.manager).setPath(a),w,h),h),M=function(e,t){var r={},a={};if("Deformer"in e.Objects){var n=e.Objects.Deformer;for(var i in n){var o=n[i],u=t.get(parseInt(i));if("Skin"===o.attrType){var c=s(u,n);c.ID=i,u.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),c.geometryID=u.parents[0].ID,r[i]=c}else if("BlendShape"===o.attrType){var d={id:i};d.rawTargets=l(u,o,n,t),d.id=i,u.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),d.parentGeoID=u.parents[0].ID,a[i]=d}}}return{skeletons:r,morphTargets:a}}(o,h),T=function(e,t,r){var a=new Map;if("Geometry"in e.Objects){var n=e.Objects.Geometry;for(var i in n){var o=t.get(parseInt(i)),s=u(e,o,n[i],r);a.set(parseInt(i),s)}}return a}(o,h,M);return function(e,t,r,a,i){var o=new n.Group,s=function(e,t,r,a,i){var o=new Map,s=e.Objects.Model;for(var l in s){var u=parseInt(l),c=s[l],d=i.get(u),f=p(d,t,u,c.attrName);if(!f){switch(c.attrType){case"Camera":f=m(e,d);break;case"Light":f=v(e,d);break;case"Mesh":f=g(e,d,r,a);break;case"NurbsCurve":f=y(d,r);break;case"LimbNode":case"Null":default:f=new n.Group}f.name=n.PropertyBinding.sanitizeNodeName(c.attrName),f.ID=u}x(e,f,c),o.set(u,f)}return o}(e,r,a,i,t),l=e.Objects.Model;return s.forEach((function(r){var a=l[r.ID];!function(e,t,r,a,i){if("LookAtProperty"in r){a.get(t.ID).children.forEach((function(r){if("LookAtProperty"===r.relationship){var a=e.Objects.Model[r.ID];if("Lcl_Translation"in a){var o=a.Lcl_Translation.value;void 0!==t.target?(t.target.position.fromArray(o),i.add(t.target)):t.lookAt((new n.Vector3).fromArray(o))}}}))}}(e,r,a,t,o),t.get(r.ID).parents.forEach((function(e){var t=s.get(e.ID);void 0!==t&&t.add(r)})),null===r.parent&&o.add(r)})),function(e,t,r,a,i){var o=function(e){var t={};if("Pose"in e.Objects){var r=e.Objects.Pose;for(var a in r)if("BindPose"===r[a].attrType){var i=r[a].PoseNode;Array.isArray(i)?i.forEach((function(e){t[e.Node]=(new n.Matrix4).fromArray(e.Matrix.a)})):t[i.Node]=(new n.Matrix4).fromArray(i.Matrix.a)}}return t}(e);for(var s in t){var l=t[s];i.get(parseInt(l.ID)).parents.forEach((function(e){if(r.has(e.ID)){var t=e.ID;i.get(t).parents.forEach((function(e){a.has(e.ID)&&a.get(e.ID).bind(new n.Skeleton(l.bones),o[e.ID])}))}}))}}(e,r,a,s,t),function(e,t,r){r.animations=[];var a=function(e,t){if(void 0===e.Objects.AnimationCurve)return;var r=function(e){var t=e.Objects.AnimationCurveNode,r=new Map;for(var a in t){var n=t[a];if(null!==n.attrName.match(/S|R|T/)){var i={id:n.id,attr:n.attrName,curves:{}};r.set(i.id,i)}}return r}(e);!function(e,t,r){var a=e.Objects.AnimationCurve;for(var n in a){var i={id:a[n].id,times:a[n].KeyTime.a.map(L),values:a[n].KeyValueFloat.a},o=t.get(i.id);if(void 0!==o){var s=o.parents[0].ID,l=o.parents[0].relationship;l.match(/X/)?r.get(s).curves.x=i:l.match(/Y/)?r.get(s).curves.y=i:l.match(/Z/)&&(r.get(s).curves.z=i)}}}(e,t,r);var a=function(e,t,r){var a=e.Objects.AnimationLayer,i=new Map;for(var o in a){var s=[],l=t.get(parseInt(o));if(void 0!==l)l.children.forEach((function(a,i){if(r.has(a.ID)){var o=r.get(a.ID);if(void 0!==o.curves.x||void 0!==o.curves.y||void 0!==o.curves.z){if(void 0===s[i]){var l;t.get(a.ID).parents.forEach((function(e){void 0!==e.relationship&&(l=e.ID)}));var u=e.Objects.Model[l.toString()],c={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};"Lcl_Translation"in u&&(c.initialPosition=u.Lcl_Translation.value),"Lcl_Rotation"in u&&(c.initialRotation=u.Lcl_Rotation.value),"Lcl_Scaling"in u&&(c.initialScale=u.Lcl_Scaling.value),"PreRotation"in u&&(c.preRotations=u.PreRotation.value),s[i]=c}s[i][o.attr]=o}}})),i.set(parseInt(o),s)}return i}(e,t,r);return function(e,t,r){var a=e.Objects.AnimationStack,n={};for(var i in a){var o=t.get(parseInt(i)).children;o.length>1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var s=r.get(o[0].ID);n[i]={name:a[i].attrName,layer:s}}return n}(e,t,a)}(e,t);if(void 0===a)return;for(var i in a){var o=b(a[i]);r.animations.push(o)}}(e,t,o),function(e,t){if("GlobalSettings"in e&&"AmbientColor"in e.GlobalSettings){var r=e.GlobalSettings.AmbientColor.value,a=r[0],i=r[1],o=r[2];if(0!==a||0!==i||0!==o){var s=new n.Color(a,i,o);t.add(new n.AmbientLight(s,1))}}}(e,o),o}(o,h,M.skeletons,T,A)}});var f=[];function h(e,t,r,a){var n;switch(a.mappingType){case"ByPolygonVertex":n=e;break;case"ByPolygon":n=t;break;case"ByVertice":n=r;break;case"AllSame":n=a.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+a.mappingType)}"IndexToDirect"===a.referenceType&&(n=a.indices[n]);var i=n*a.dataSize,o=i+a.dataSize;return function(e,t,r,a){for(var n=r,i=0;n1?s=l:l.length>0?s=l[0]:(s=new n.MeshPhongMaterial({color:13421772}),l.push(s)),"color"in o.attributes&&l.forEach((function(e){e.vertexColors=n.VertexColors})),o.FBX_Deformer?(l.forEach((function(e){e.skinning=!0})),i=new n.SkinnedMesh(o,s)):i=new n.Mesh(o,s),i}function y(e,t){var r=e.children.reduce((function(e,r){return t.has(r.ID)&&(e=t.get(r.ID)),e}),null),a=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(r,a)}function x(e,t,r){if("RotationOrder"in r){var a=parseInt(r.RotationOrder.value,10);a>0&&a<6?console.warn("THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.",["XYZ","XZY","YZX","ZXY","YXZ","ZYX","SphericXYZ"][a]):6===a&&console.warn("THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.")}if("Lcl_Translation"in r&&t.position.fromArray(r.Lcl_Translation.value),"Lcl_Rotation"in r){var i=r.Lcl_Rotation.value.map(n.Math.degToRad);i.push("ZYX"),t.quaternion.setFromEuler((new n.Euler).fromArray(i))}if("Lcl_Scaling"in r&&t.scale.fromArray(r.Lcl_Scaling.value),"PreRotation"in r){var o=r.PreRotation.value.map(n.Math.degToRad);o[3]="ZYX";var s=(new n.Euler).fromArray(o);s=(new n.Quaternion).setFromEuler(s),t.quaternion.premultiply(s)}}function b(e){var t=[];return e.layer.forEach((function(e){t=t.concat(function(e){var t=[];if(void 0!==e.T&&Object.keys(e.T.curves).length>0){var r=w(e.modelName,e.T.curves,e.initialPosition,"position");void 0!==r&&t.push(r)}if(void 0!==e.R&&Object.keys(e.R.curves).length>0){var a=function(e,t,r,a){void 0!==t.x&&(T(t.x),t.x.values=t.x.values.map(n.Math.degToRad));void 0!==t.y&&(T(t.y),t.y.values=t.y.values.map(n.Math.degToRad));void 0!==t.z&&(T(t.z),t.z.values=t.z.values.map(n.Math.degToRad));var i=M(t),o=A(i,t,r);void 0!==a&&((a=a.map(n.Math.degToRad)).push("ZYX"),a=(new n.Euler).fromArray(a),a=(new n.Quaternion).setFromEuler(a));for(var s=new n.Quaternion,l=new n.Euler,u=[],c=0;c0){var i=w(e.modelName,e.S.curves,e.initialScale,"scale");void 0!==i&&t.push(i)}return t}(e))})),new n.AnimationClip(e.name,-1,t)}function w(e,t,r,a){var i=M(t),o=A(i,t,r);return new n.VectorKeyframeTrack(e+"."+a,i,o)}function A(e,t,r){var a=r,n=[],i=-1,o=-1,s=-1;return e.forEach((function(e){if(t.x&&(i=t.x.times.indexOf(e)),t.y&&(o=t.y.times.indexOf(e)),t.z&&(s=t.z.times.indexOf(e)),-1!==i){var r=t.x.values[i];n.push(r),a[0]=r}else n.push(a[0]);if(-1!==o){var l=t.y.values[o];n.push(l),a[1]=l}else n.push(a[1]);if(-1!==s){var u=t.z.values[s];n.push(u),a[2]=u}else n.push(a[2])})),n}function M(e){var t=[];return void 0!==e.x&&(t=t.concat(e.x.times)),void 0!==e.y&&(t=t.concat(e.y.times)),void 0!==e.z&&(t=t.concat(e.z.times)),t=t.sort((function(e,t){return e-t})).filter((function(e,t,r){return r.indexOf(e)==t}))}function T(e){for(var t=1;t=180){for(var i=n/180,o=a/i,s=r+o,l=e.times[t-1],u=(e.times[t]-l)/i,c=l+u,d=[],f=[];c1&&(r=e[1].replace(/^(\w+)::/,""),a=e[2]),{id:t,name:r,type:a}},parseNodeProperty:function(e,t,r){var a=t[1].replace(/^"/,"").replace(/"$/,"").trim(),n=t[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===a&&","===n&&(n=r.replace(/"/g,"").replace(/,$/,"").trim());var i=this.getCurrentNode();if("Properties70"!==i.name){if("C"===a){var o=n.split(",").slice(1),s=parseInt(o[0]),l=parseInt(o[1]),u=n.split(",").slice(3);a="connections",function(e,t){for(var r=0,a=e.length,n=t.length;r=e.size():e.getOffset()+160+16>=e.size()},parseNode:function(e,t){var r={},a=t>=7500?e.getUint64():e.getUint32(),n=t>=7500?e.getUint64():e.getUint32(),i=(t>=7500?e.getUint64():e.getUint32(),e.getUint8()),o=e.getString(i);if(0===a)return null;for(var s=[],l=0;l0?s[0]:"",c=s.length>1?s[1]:"",d=s.length>2?s[2]:"";for(r.singleProperty=1===n&&e.getOffset()===a;a>e.getOffset();){var f=this.parseNode(e,t);null!==f&&this.parseSubNode(o,r,f)}return r.propertyList=s,"number"==typeof u&&(r.id=u),""!==c&&(r.attrName=c),""!==d&&(r.attrType=d),""!==o&&(r.name=o),r},parseSubNode:function(e,t,r){if(!0===r.singleProperty){var a=r.propertyList[0];Array.isArray(a)?(t[r.name]=r,r.a=a):t[r.name]=a}else if("Connections"===e&&"C"===r.name){var n=[];r.propertyList.forEach((function(e,t){0!==t&&n.push(e)})),void 0===t.connections&&(t.connections=[]),t.connections.push(n)}else if("Properties70"===r.name){Object.keys(r).forEach((function(e){t[e]=r[e]}))}else if("Properties70"===e&&"P"===r.name){var i,o=r.propertyList[0],s=r.propertyList[1],l=r.propertyList[2],u=r.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),i="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[r.propertyList[4],r.propertyList[5],r.propertyList[6]]:r.propertyList[4],t[o]={type:s,type2:l,flag:u,value:i}}else void 0===t[r.name]?"number"==typeof r.id?(t[r.name]={},t[r.name][r.id]=r):t[r.name]=r:"PoseNode"===r.name?(Array.isArray(t[r.name])||(t[r.name]=[t[r.name]]),t[r.name].push(r)):void 0===t[r.name][r.id]&&(t[r.name][r.id]=r)},parseProperty:function(e){var t=e.getString(1);switch(t){case"C":return e.getBoolean();case"D":return e.getFloat64();case"F":return e.getFloat32();case"I":return e.getInt32();case"L":return e.getInt64();case"R":var r=e.getUint32();return e.getArrayBuffer(r);case"S":r=e.getUint32();return e.getString(r);case"Y":return e.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var a=e.getUint32(),n=e.getUint32(),i=e.getUint32();if(0===n)switch(t){case"b":case"c":return e.getBooleanArray(a);case"d":return e.getFloat64Array(a);case"f":return e.getFloat32Array(a);case"i":return e.getInt32Array(a);case"l":return e.getInt64Array(a)}void 0===window.Zlib&&console.error("THREE.FBXLoader: External library Inflate.min.js required, obtain or import from https://github.com/imaya/zlib.js");var o=new _(new Zlib.Inflate(new Uint8Array(e.getArrayBuffer(i))).decompress().buffer);switch(t){case"b":case"c":return o.getBooleanArray(a);case"d":return o.getFloat64Array(a);case"f":return o.getFloat32Array(a);case"i":return o.getInt32Array(a);case"l":return o.getInt64Array(a)}default:throw new Error("THREE.FBXLoader: Unknown property type "+t)}}}),Object.assign(_.prototype,{getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(e){this.offset+=e},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(e){for(var t=[],r=0;r=0&&(t=t.slice(0,a)),n.LoaderUtils.decodeText(t)}}),Object.assign(F.prototype,{add:function(e,t){this[e]=t}}),e}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.splitLayer=!1};n.prototype.load=function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},n.prototype.parse=function(e){var t={x:0,y:0,z:0,e:0,f:0,extruding:!1,relative:!1},r=[],n=void 0,i=new a.LineBasicMaterial({color:16711680});i.name="path";var o=new a.LineBasicMaterial({color:65280});function s(e){n={vertex:[],pathVertex:[],z:e.z},r.push(n)}function l(e,r){return t.relative?r:r-e}function u(e,r){return t.relative?e+r:r}o.name="extruded";for(var c,d,f=e.replace(/;.+/g,"").split("\n"),h=0;h0&&(g.extruding=l(t.e,g.e)>0,null!=n&&g.z==n.z||s(g)),c=t,d=g,void 0===n&&s(c),g.extruding?(n.vertex.push(c.x,c.y,c.z),n.vertex.push(d.x,d.y,d.z)):(n.pathVertex.push(c.x,c.y,c.z),n.pathVertex.push(d.x,d.y,d.z)),t=g}else if("G2"===m||"G3"===m)console.warn("THREE.GCodeLoader: Arc command not supported");else if("G90"===m)t.relative=!1;else if("G91"===m)t.relative=!0;else if("G92"===m){(g=t).x=void 0!==v.x?v.x:g.x,g.y=void 0!==v.y?v.y:g.y,g.z=void 0!==v.z?v.z:g.z,g.e=void 0!==v.e?v.e:g.e,t=g}else console.warn("THREE.GCodeLoader: Command not supported:"+m)}function y(e,t){var r=new a.BufferGeometry;r.addAttribute("position",new a.Float32BufferAttribute(e,3));var n=new a.LineSegments(r,t?o:i);n.name="layer"+h,x.add(n)}var x=new a.Group;if(x.name="gcode",this.splitLayer)for(h=0;h>16&32768,i=a>>12&2047,o=a>>23&255;return o<103?n:o>142?(n|=31744,n|=(255==o?0:1)&&8388607&a):o<113?n|=((i|=2048)>>114-o)+(i>>113-o&1):(n|=o-112<<10|i>>1,n+=1&i)}return function(e,t,a,n){var i=e[t+3],o=Math.pow(2,i-128)/255;a[n+0]=r(e[t+0]*o),a[n+1]=r(e[t+1]*o),a[n+2]=r(e[t+2]*o)}}(),l=new n.CubeTexture;l.type=e,l.encoding=e===n.UnsignedByteType?n.RGBEEncoding:n.LinearEncoding,l.format=e===n.UnsignedByteType?n.RGBAFormat:n.RGBFormat,l.minFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.magFilter=l.encoding===n.RGBEEncoding?n.NearestFilter:n.LinearFilter,l.generateMipmaps=l.encoding!==n.RGBEEncoding,l.anisotropy=0;var u=this.hdrLoader,c=0;function d(r,a,i,d){var f=new n.FileLoader(this.manager);f.setResponseType("arraybuffer"),f.load(t[r],(function(t){c++;var i=u._parser(t);if(i){if(e===n.FloatType){for(var d=i.data.length/4*3,f=new Float32Array(d),h=0;h>8&65280|e>>24&255},e.prototype.mipmaps=function(t){for(var r=[],a=e.HEADER_LEN+this.bytesOfKeyValueData,n=this.pixelWidth,i=this.pixelHeight,o=t?this.numberOfMipmapLevels:1,s=0;s0?o():t(n.mergeVmds(i))}),r,a)}()},s.prototype.loadAudio=function(e,t,r,n){var i=new a.AudioListener,o=new a.Audio(i);new a.AudioLoader(this.manager).load(e,(function(e){o.setBuffer(e),t(o,i)}),r,n)},s.prototype.loadVpd=function(e,t,r,a,n){var i=this;(n&&"unicode"===n.charcode?this.loadFileAsText:this.loadFileAsShiftJISText).bind(this)(e,(function(e){t(i.parseVpd(e))}),r,a)},s.prototype.parseModel=function(e,t){switch(t.toLowerCase()){case"pmd":return this.parsePmd(e);case"pmx":return this.parsePmx(e);default:throw"extension "+t+" is not supported."}},s.prototype.parsePmd=function(e){return this.parser.parsePmd(e,!0)},s.prototype.parsePmx=function(e){return this.parser.parsePmx(e,!0)},s.prototype.parseVmd=function(e){return this.parser.parseVmd(e,!0)},s.prototype.parseVpd=function(e){return this.parser.parseVpd(e,!0)},s.prototype.mergeVmds=function(e){return this.parser.mergeVmds(e)},s.prototype.pourVmdIntoModel=function(e,t,r){this.createAnimation(e,t,r)},s.prototype.pourVmdIntoCamera=function(e,t,r){var n=new s.DataCreationHelper;!function(){for(var i,o,l=n.createOrderedMotionArray(t.cameras),u=[],c=[],d=[],f=[],h=[],p=[],m=[],v=[],g=[],y=new a.Quaternion,x=new a.Euler,b=new a.Vector3,w=new a.Vector3,A=function(e,t){e.push(t.x),e.push(t.y),e.push(t.z)},M=function(e,t,r){e.push(t[4*r+0]/127),e.push(t[4*r+1]/127),e.push(t[4*r+2]/127),e.push(t[4*r+3]/127)},T=function(e,t,r,n,i){if(r.length>2){r=r.slice(),n=n.slice(),i=i.slice();for(var o=n.length/r.length,l=3===o?12:4,u=1,c=2,d=r.length;cu){r[u]=r[c];for(f=0;f=a?r.skinIndices[a]:0);for(a=0;a<4;a++)l.skinWeights.push(r.skinWeights.length-1>=a?r.skinWeights[a]:0)}}(),function(){for(var t=0;t=0&&(l.limitation=new a.Vector3(1,0,0)),s.links.push(l)}t.push(s)}else for(r=0;r=0?c:u);var p=h.load(s,(function(e){if(!0===o.isToonTexture){var t=e.image,r=t.width,n=t.height;d.width=r,d.height=n,f.clearRect(0,0,r,n),f.translate(r/2,n/2),f.rotate(.5*Math.PI),f.translate(-r/2,-n/2),f.drawImage(t,0,0),e.image=f.getImageData(0,0,r,n)}e.flipY=!1,e.wrapS=a.RepeatWrapping,e.wrapT=a.RepeatWrapping;for(var i=0;i=0?(w.push(b.slice(0,A)),w.push(b.slice(A+1))):w.push(b);for(var M=0;M=0||T.indexOf(".spa")>=0?(x.envMap=m(T,{sphericalReflectionMapping:!0}),T.indexOf(".sph")>=0?x.envMapType=a.MultiplyOperation:x.envMapType=a.AddOperation):x.map=m(T)}}}else{if(-1!==y.textureIndex){var T=e.textures[y.textureIndex];x.map=m(T)}if(-1!==y.envTextureIndex&&(1===y.envFlag||2==y.envFlag)){T=e.textures[y.envTextureIndex];x.envMap=m(T,{sphericalReflectionMapping:!0}),1===y.envFlag?x.envMapType=a.MultiplyOperation:x.envMapType=a.AddOperation}}var S=void 0===x.map?1:.2;x.emissive=new a.Color(y.ambient[0]*S,y.ambient[1]*S,y.ambient[2]*S),p.push(x)}for(g=0;g0,y.morphTargets=o.morphTargets.length>0,y.lights=!0,y.side="pmx"===e.metadata.format&&1==(1&_.flag)?a.DoubleSide:E.side,y.transparent=E.transparent,y.fog=!0,y.blending=a.CustomBlending,y.blendSrc=a.SrcAlphaFactor,y.blendDst=a.OneMinusSrcAlphaFactor,y.blendSrcAlpha=a.SrcAlphaFactor,y.blendDstAlpha=a.DstAlphaFactor,void 0!==E.map){y.faceOffset=E.faceOffset,y.faceNum=E.faceNum,y.map=v(E.map,l),function(e){e.map.readyCallbacks.push((function(t){function r(e,t){var r=e.width,a=e.height,n=Math.round(t.x*r)%r,i=Math.round(t.y*a)%a;n<0&&(n+=r),i<0&&(i+=a);var o=i*r+n;return e.data[4*o+3]}var a=void 0!==t.image.data?t.image:function(e){var t=document.createElement("canvas");t.width=e.width,t.height=e.height;var r=t.getContext("2d");return r.drawImage(e,0,0),r.getImageData(0,0,t.width,t.height)}(t.image),n=o.index.array.slice(3*e.faceOffset,3*e.faceOffset+3*e.faceNum);(function(e,t,a){var n=e.width,i=e.height;if(e.data.length/(n*i)!=4)return!1;for(var o=0;o=this.duration;)this.currentTime-=this.duration;return!(this.currentTime=this.duration}},a.MMDGrantSolver=function(e){this.mesh=e},a.MMDGrantSolver.prototype={constructor:a.MMDGrantSolver,update:(o=new a.Quaternion,function(){for(var e=0;e0)}},setAnimations:function(){for(var e=0;e0&&0!==e.action._clip.tracks[0].name.indexOf(".bones")||(e.target._root.looped=!0)}));for(var t=!1,r=!1,n=0;n0&&0===i.tracks[0].name.indexOf(".morphTargetInfluences")?r||(o.play(),r=!0):t||(o.play(),t=!0)}t&&(e.ikSolver=new a.CCDIKSolver(e),void 0!==e.geometry.grants&&(e.grantSolver=new a.MMDGrantSolver(e)))}},setCameraAnimation:function(e){void 0!==e.animations&&(e.mixer=new a.AnimationMixer(e),e.mixer.clipAction(e.animations[0]).play())},unifyAnimationDuration:function(e){e=void 0===e?{}:e;for(var t=0,r=this.camera,a=this.audioManager,n=0;n0,i=!0,s={};var l=function(e,n){null==n&&(n=1);var o=1,s=Uint8Array;switch(e){case"uchar":break;case"schar":s=Int8Array;break;case"ushort":s=Uint16Array,o=2;break;case"sshort":s=Int16Array,o=2;break;case"uint":s=Uint32Array,o=4;break;case"sint":s=Int32Array,o=4;break;case"float":s=Float32Array,o=4;break;case"complex":case"double":s=Float64Array,o=8}var l=new s(t.slice(r,r+=n*o));return a!=i&&(l=function(e,t){for(var r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),a=0;ai;n--,i++){var o=r[i];r[i]=r[n],r[n]=o}return e}(l,o)),1==n?l[0]:l}("uchar",e.byteLength),u=l.length,c=null,d=0;for(p=1;p13)&&32!==a?n+=String.fromCharCode(a):(""!==n&&(l[u]=c(n,o),u++),n="");return""!==n&&(l[u]=c(n,o),u++),l}(t);else if("raw"===s.encoding){for(var h=new Uint8Array(t.length),p=0;p0?t[t.length-1]:"",smooth:void 0!==r?r.smooth:this.smooth,groupStart:void 0!==r?r.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(e){var t={index:"number"==typeof e?e:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return t.clone=this.clone.bind(t),t}};return this.materials.push(a),a},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(e){var t=this.currentMaterial();if(t&&-1===t.groupEnd&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(var r=this.materials.length-1;r>=0;r--)this.materials[r].groupCount<=0&&this.materials.splice(r,1);return e&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),t}},r&&r.name&&"function"==typeof r.clone){var a=r.clone(0);a.inherited=!0,this.object.materials.push(a)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseNormalIndex:function(e,t){var r=parseInt(e,10);return 3*(r>=0?r-1:r+t/3)},parseUVIndex:function(e,t){var r=parseInt(e,10);return 2*(r>=0?r-1:r+t/2)},addVertex:function(e,t,r){var a=this.vertices,n=this.object.geometry.vertices;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addVertexPoint:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){var t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,r){var a=this.normals,n=this.object.geometry.normals;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addColor:function(e,t,r){var a=this.colors,n=this.object.geometry.colors;n.push(a[e+0],a[e+1],a[e+2]),n.push(a[t+0],a[t+1],a[t+2]),n.push(a[r+0],a[r+1],a[r+2])},addUV:function(e,t,r){var a=this.uvs,n=this.object.geometry.uvs;n.push(a[e+0],a[e+1]),n.push(a[t+0],a[t+1]),n.push(a[r+0],a[r+1])},addUVLine:function(e){var t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,r,a,n,i,o,s,l){var u=this.vertices.length,c=this.parseVertexIndex(e,u),d=this.parseVertexIndex(t,u),f=this.parseVertexIndex(r,u);if(this.addVertex(c,d,f),void 0!==a&&""!==a){var h=this.uvs.length;c=this.parseUVIndex(a,h),d=this.parseUVIndex(n,h),f=this.parseUVIndex(i,h),this.addUV(c,d,f)}if(void 0!==o&&""!==o){var p=this.normals.length;c=this.parseNormalIndex(o,p),d=o===s?c:this.parseNormalIndex(s,p),f=o===l?c:this.parseNormalIndex(l,p),this.addNormal(c,d,f)}this.colors.length>0&&this.addColor(c,d,f)},addPointGeometry:function(e){this.object.geometry.type="Points";for(var t=this.vertices.length,r=0,a=e.length;r0){var b=x.split("/");v.push(b)}}var w=v[0];for(g=1,y=v.length-1;g1){var O=c[1].trim().toLowerCase();o.object.smooth="0"!==O&&"off"!==O}else o.object.smooth=!0;(Y=o.object.currentMaterial())&&(Y.smooth=o.object.smooth)}o.finalize();var N=new a.Group;N.materialLibraries=[].concat(o.materialLibraries);for(f=0,h=o.objects.length;f0?j.addAttribute("normal",new a.Float32BufferAttribute(R.normals,3)):j.computeVertexNormals(),R.colors.length>0&&(B=!0,j.addAttribute("color",new a.Float32BufferAttribute(R.colors,3))),R.uvs.length>0&&j.addAttribute("uv",new a.Float32BufferAttribute(R.uvs,2));for(var V,G=[],z=0,X=U.length;z1){for(z=0,X=U.length;zd){d=f;var r='Download of "'+e.url+'": '+(100*f).toFixed(2)+"%";u.onProgress("progressLoad",r,f)}}}var h=new a.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.load(e.url,c,i,o)}},r.prototype.run=function(e,r){this._applyPrepData(e);var a=e.checkResourceDescriptorFiles(e.resources,[{ext:"obj",type:"ArrayBuffer",ignore:!1},{ext:"mtl",type:"String",ignore:!1},{ext:"zip",type:"String",ignore:!0}]);t.isValid(r)&&(this.terminateWorkerOnLoad=!1,this.workerSupport=r,this.logging.enabled=this.workerSupport.logging.enabled,this.logging.debug=this.workerSupport.logging.debug);var n=this;this._loadMtl(a.mtl,(function(t){null!==t&&n.meshBuilder.setMaterials(t),n._loadObj(a.obj,n.callbacks.onLoad,null,null,n.callbacks.onMeshAlter,e.useAsync)}),e.crossOrigin,e.materialOptions)},r.prototype._applyPrepData=function(e){t.isValid(e)&&(this.setLogging(e.logging.enabled,e.logging.debug),this.setModelName(e.modelName),this.setStreamMeshesTo(e.streamMeshesTo),this.meshBuilder.setMaterials(e.materials),this.setUseIndices(e.useIndices),this.setDisregardNormals(e.disregardNormals),this.setMaterialPerSmoothingGroup(e.materialPerSmoothingGroup),this._setCallbacks(e.getCallbacks()))},r.prototype.parse=function(e){if(!t.isValid(e))return console.warn("Provided content is not a valid ArrayBuffer or String."),this.loaderRootNode;this.logging.enabled&&console.time("OBJLoader2 parse: "+this.modelName),this.meshBuilder.init();var r=new o;r.setLogging(this.logging.enabled,this.logging.debug),r.setMaterialPerSmoothingGroup(this.materialPerSmoothingGroup),r.setUseIndices(this.useIndices),r.setDisregardNormals(this.disregardNormals),r.setMaterials(this.meshBuilder.getMaterials());var a=this;r.setCallbackMeshBuilder((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}));if(r.setCallbackProgress((function(e,t){a.onProgress("progressParse",e,t)})),e instanceof ArrayBuffer||e instanceof Uint8Array)this.logging.enabled&&console.info("Parsing arrayBuffer..."),r.parse(e);else{if(!("string"==typeof e||e instanceof String))throw"Provided content was neither of type String nor Uint8Array! Aborting...";this.logging.enabled&&console.info("Parsing text..."),r.parseText(e)}return this.logging.enabled&&console.timeEnd("OBJLoader2 parse: "+this.modelName),this.loaderRootNode},r.prototype.parseAsync=function(e,r){var a=this,n=!1,i=function(){r({detail:{loaderRootNode:a.loaderRootNode,modelName:a.modelName,instanceNo:a.instanceNo}}),n&&a.logging.enabled&&console.timeEnd("OBJLoader2 parseAsync: "+a.modelName)};t.isValid(e)?n=!0:(console.warn("Provided content is not a valid ArrayBuffer."),i()),n&&this.logging.enabled&&console.time("OBJLoader2 parseAsync: "+this.modelName),this.meshBuilder.init();this.workerSupport.validate((function(e,r){var a="";return a+="/**\n",a+=" * This code was constructed by OBJLoader2 buildCode.\n",a+=" */\n\n",a+="THREE = { LoaderSupport: {} };\n\n",a+=e("LoaderSupport.Validator",t),a+=r("Parser",o)}),"Parser"),this.workerSupport.setCallbacks((function(e){var t,r=a.meshBuilder.processPayload(e);for(var n in r)t=r[n],a.loaderRootNode.add(t)}),i),a.terminateWorkerOnLoad&&this.workerSupport.setTerminateRequested(!0);var s={},l=this.meshBuilder.getMaterials();for(var u in l)s[u]=u;this.workerSupport.run({params:{useAsync:!0,materialPerSmoothingGroup:this.materialPerSmoothingGroup,useIndices:this.useIndices,disregardNormals:this.disregardNormals},logging:{enabled:this.logging.enabled,debug:this.logging.debug},materials:{materials:s},data:{input:e,options:null}})};var o=function(){function e(){this.callbackProgress=null,this.callbackMeshBuilder=null,this.contentRef=null,this.legacyMode=!1,this.materials={},this.useAsync=!1,this.materialPerSmoothingGroup=!1,this.useIndices=!1,this.disregardNormals=!1,this.vertices=[],this.colors=[],this.normals=[],this.uvs=[],this.rawMesh={objectName:"",groupName:"",activeMtlName:"",mtllibName:"",faceType:-1,subGroups:[],subGroupInUse:null,smoothingGroup:{splitMaterials:!1,normalized:-1,real:-1},counts:{doubleIndicesCount:0,faceCount:0,mtlCount:0,smoothingGroupCount:0}},this.inputObjectCount=1,this.outputObjectCount=1,this.globalCounts={vertices:0,faces:0,doubleIndicesCount:0,lineByte:0,currentByte:0,totalBytes:0},this.logging={enabled:!0,debug:!1}}return e.prototype.resetRawMesh=function(){this.rawMesh.subGroups=[],this.rawMesh.subGroupInUse=null,this.rawMesh.smoothingGroup.normalized=-1,this.rawMesh.smoothingGroup.real=-1,this.pushSmoothingGroup(1),this.rawMesh.counts.doubleIndicesCount=0,this.rawMesh.counts.faceCount=0,this.rawMesh.counts.mtlCount=0,this.rawMesh.counts.smoothingGroupCount=0},e.prototype.setUseAsync=function(e){this.useAsync=e},e.prototype.setMaterialPerSmoothingGroup=function(e){this.materialPerSmoothingGroup=e},e.prototype.setUseIndices=function(e){this.useIndices=e},e.prototype.setDisregardNormals=function(e){this.disregardNormals=e},e.prototype.setMaterials=function(e){this.materials=n.default.Validator.verifyInput(e,this.materials),this.materials=n.default.Validator.verifyInput(this.materials,{})},e.prototype.setCallbackMeshBuilder=function(e){if(!n.default.Validator.isValid(e))throw'Unable to run as no "MeshBuilder" callback is set.';this.callbackMeshBuilder=e},e.prototype.setCallbackProgress=function(e){this.callbackProgress=e},e.prototype.setLogging=function(e,t){this.logging.enabled=!0===e,this.logging.debug=!0===t},e.prototype.configure=function(){if(this.pushSmoothingGroup(1),this.logging.enabled){var e=Object.keys(this.materials),t="OBJLoader2.Parser configuration:"+(e.length>0?"\n\tmaterialNames:\n\t\t- "+e.join("\n\t\t- "):"\n\tmaterialNames: None")+"\n\tuseAsync: "+this.useAsync+"\n\tmaterialPerSmoothingGroup: "+this.materialPerSmoothingGroup+"\n\tuseIndices: "+this.useIndices+"\n\tdisregardNormals: "+this.disregardNormals+"\n\tcallbackMeshBuilderName: "+this.callbackMeshBuilder.name+"\n\tcallbackProgressName: "+this.callbackProgress.name;console.info(t)}},e.prototype.parse=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parse"),this.configure();var t=new Uint8Array(e);this.contentRef=t;var r=t.byteLength;this.globalCounts.totalBytes=r;for(var a,n=new Array(128),i="",o=0,s=0,l=0;l0&&(n[o++]=i),i="";break;case 47:i.length>0&&(n[o++]=i),s++,i="";break;case 10:i.length>0&&(n[o++]=i),i="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=l,this.processLine(n,o,s),o=0,s=0;break;case 13:break;default:i+=String.fromCharCode(a)}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parse")},e.prototype.parseText=function(e){this.logging.enabled&&console.time("OBJLoader2.Parser.parseText"),this.configure(),this.legacyMode=!0,this.contentRef=e;var t=e.length;this.globalCounts.totalBytes=t;for(var r,a=new Array(128),n="",i=0,o=0,s=0;s0&&(a[i++]=n),n="";break;case"/":n.length>0&&(a[i++]=n),o++,n="";break;case"\n":n.length>0&&(a[i++]=n),n="",this.globalCounts.lineByte=this.globalCounts.currentByte,this.globalCounts.currentByte=s,this.processLine(a,i,o),i=0,o=0;break;case"\r":break;default:n+=r}this.finalizeParsing(),this.logging.enabled&&console.timeEnd("OBJLoader2.Parser.parseText")},e.prototype.processLine=function(e,t,r){if(!(t<1)){var a,n,i,o,s=function(e,t,r,a){var n="";if(a>r){var i;if(t)for(i=r;i4&&(this.colors.push(parseFloat(e[4])),this.colors.push(parseFloat(e[5])),this.colors.push(parseFloat(e[6])));break;case"vt":this.uvs.push(parseFloat(e[1])),this.uvs.push(parseFloat(e[2]));break;case"vn":this.normals.push(parseFloat(e[1])),this.normals.push(parseFloat(e[2])),this.normals.push(parseFloat(e[3]));break;case"f":if(a=t-1,0===r)for(this.checkFaceType(0),i=2,n=a;i0?n-1:n+a.vertices.length/3),o=a.rawMesh.subGroupInUse.vertices;o.push(a.vertices[i++]),o.push(a.vertices[i++]),o.push(a.vertices[i]);var s=a.colors.length>0?i:null;if(null!==s){var l=a.rawMesh.subGroupInUse.colors;l.push(a.colors[s++]),l.push(a.colors[s++]),l.push(a.colors[s])}if(t){var u=parseInt(t),c=2*(u>0?u-1:u+a.uvs.length/2),d=a.rawMesh.subGroupInUse.uvs;d.push(a.uvs[c++]),d.push(a.uvs[c])}if(r){var f=parseInt(r),h=3*(f>0?f-1:f+a.normals.length/3),p=a.rawMesh.subGroupInUse.normals;p.push(a.normals[h++]),p.push(a.normals[h++]),p.push(a.normals[h])}};if(this.useIndices){var o=e+(t?"_"+t:"_n")+(r?"_"+r:"_n"),s=this.rawMesh.subGroupInUse.indexMappings[o];n.default.Validator.isValid(s)?this.rawMesh.counts.doubleIndicesCount++:(s=this.rawMesh.subGroupInUse.vertices.length/3,i(),this.rawMesh.subGroupInUse.indexMappings[o]=s,this.rawMesh.subGroupInUse.indexMappingsCount++),this.rawMesh.subGroupInUse.indices.push(s)}else i();this.rawMesh.counts.faceCount++},e.prototype.createRawMeshReport=function(e){return"Input Object number: "+e+"\n\tObject name: "+this.rawMesh.objectName+"\n\tGroup name: "+this.rawMesh.groupName+"\n\tMtllib name: "+this.rawMesh.mtllibName+"\n\tVertex count: "+this.vertices.length/3+"\n\tNormal count: "+this.normals.length/3+"\n\tUV count: "+this.uvs.length/2+"\n\tSmoothingGroup count: "+this.rawMesh.counts.smoothingGroupCount+"\n\tMaterial count: "+this.rawMesh.counts.mtlCount+"\n\tReal MeshOutputGroup count: "+this.rawMesh.subGroups.length},e.prototype.finalizeRawMesh=function(){var e,t,r=[],a=0,n=0,i=0,o=0,s=0,l=0;for(var u in this.rawMesh.subGroups)if((e=this.rawMesh.subGroups[u]).vertices.length>0){if((t=e.indices).length>0&&n>0)for(var c in t)t[c]=t[c]+n;r.push(e),a+=e.vertices.length,n+=e.indexMappingsCount,i+=e.indices.length,o+=e.colors.length,l+=e.uvs.length,s+=e.normals.length}var d=null;return r.length>0&&(d={name:""!==this.rawMesh.groupName?this.rawMesh.groupName:this.rawMesh.objectName,subGroups:r,absoluteVertexCount:a,absoluteIndexCount:i,absoluteColorCount:o,absoluteNormalCount:s,absoluteUvCount:l,faceCount:this.rawMesh.counts.faceCount,doubleIndicesCount:this.rawMesh.counts.doubleIndicesCount}),d},e.prototype.processCompletedMesh=function(){var e=this.finalizeRawMesh();if(n.default.Validator.isValid(e)){if(this.colors.length>0&&this.colors.length!==this.vertices.length)throw"Vertex Colors were detected, but vertex count and color count do not match!";this.logging.enabled&&this.logging.debug&&console.debug(this.createRawMeshReport(this.inputObjectCount)),this.inputObjectCount++,this.buildMesh(e);var t=this.globalCounts.currentByte/this.globalCounts.totalBytes;return this.callbackProgress("Completed [o: "+this.rawMesh.objectName+" g:"+this.rawMesh.groupName+"] Total progress: "+(100*t).toFixed(2)+"%",t),this.resetRawMesh(),!0}return!1},e.prototype.buildMesh=function(e){var t=e.subGroups,r=new Float32Array(e.absoluteVertexCount);this.globalCounts.vertices+=e.absoluteVertexCount/3,this.globalCounts.faces+=e.faceCount,this.globalCounts.doubleIndicesCount+=e.doubleIndicesCount;var a,i,o,s,l,u,c,d=e.absoluteIndexCount>0?new Uint32Array(e.absoluteIndexCount):null,f=e.absoluteColorCount>0?new Float32Array(e.absoluteColorCount):null,h=e.absoluteNormalCount>0?new Float32Array(e.absoluteNormalCount):null,p=e.absoluteUvCount>0?new Float32Array(e.absoluteUvCount):null,m=n.default.Validator.isValid(f),v=[],g=t.length>1,y=0,x=[],b=[],w=0,A=0,M=0,T=0,S=0,E=0,_=0;for(var F in t)if(t.hasOwnProperty(F)){if(c=(a=t[F]).materialName,u=this.rawMesh.faceType<4?c+(m?"_vertexColor":"")+(0===a.smoothingGroup?"_flat":""):6===this.rawMesh.faceType?"defaultPointMaterial":"defaultLineMaterial",s=this.materials[c],l=this.materials[u],!n.default.Validator.isValid(s)&&!n.default.Validator.isValid(l)){var P=m?"defaultVertexColorMaterial":"defaultMaterial";s=this.materials[P],this.logging.enabled&&console.warn('object_group "'+a.objectName+"_"+a.groupName+'" was defined with unresolvable material "'+c+'"! Assigning "'+P+'".'),(c=P)===u&&(l=s,u=P)}if(!n.default.Validator.isValid(l)){var L={materialNameOrg:c,materialName:u,materialProperties:{vertexColors:m?2:0,flatShading:0===a.smoothingGroup}},C={cmd:"materialData",materials:{materialCloneInstructions:L}};this.callbackMeshBuilder(C),this.useAsync&&(this.materials[u]=L)}if(g?((i=x[u])||(i=y,x[u]=y,v.push(u),y++),o={start:E,count:_=this.useIndices?a.indices.length:a.vertices.length/3,index:i},b.push(o),E+=_):v.push(u),r.set(a.vertices,w),w+=a.vertices.length,d&&(d.set(a.indices,A),A+=a.indices.length),f&&(f.set(a.colors,M),M+=a.colors.length),h&&(h.set(a.normals,T),T+=a.normals.length),p&&(p.set(a.uvs,S),S+=a.uvs.length),this.logging.enabled&&this.logging.debug){var O=n.default.Validator.isValid(i)?"\n\t\tmaterialIndex: "+i:"",N="\tOutput Object no.: "+this.outputObjectCount+"\n\t\tgroupName: "+a.groupName+"\n\t\tIndex: "+a.index+"\n\t\tfaceType: "+this.rawMesh.faceType+"\n\t\tmaterialName: "+a.materialName+"\n\t\tsmoothingGroup: "+a.smoothingGroup+O+"\n\t\tobjectName: "+a.objectName+"\n\t\t#vertices: "+a.vertices.length/3+"\n\t\t#indices: "+a.indices.length+"\n\t\t#colors: "+a.colors.length/3+"\n\t\t#uvs: "+a.uvs.length/2+"\n\t\t#normals: "+a.normals.length/3;console.debug(N)}}this.outputObjectCount++,this.callbackMeshBuilder({cmd:"meshData",progress:{numericalValue:this.globalCounts.currentByte/this.globalCounts.totalBytes},params:{meshName:e.name},materials:{multiMaterial:g,materialNames:v,materialGroups:b},buffers:{vertices:r,indices:d,colors:f,normals:h,uvs:p},geometryType:this.rawMesh.faceType<4?0:6===this.rawMesh.faceType?2:1},[r.buffer],n.default.Validator.isValid(d)?[d.buffer]:null,n.default.Validator.isValid(f)?[f.buffer]:null,n.default.Validator.isValid(h)?[h.buffer]:null,n.default.Validator.isValid(p)?[p.buffer]:null)},e.prototype.finalizeParsing=function(){if(this.logging.enabled&&console.info("Global output object count: "+this.outputObjectCount),this.processCompletedMesh()&&this.logging.enabled){var e="Overall counts: \n\tVertices: "+this.globalCounts.vertices+"\n\tFaces: "+this.globalCounts.faces+"\n\tMultiple definitions: "+this.globalCounts.doubleIndicesCount;console.info(e)}},e}();return r.prototype.loadMtl=function(e,t,r,a,i){var o=new n.default.ResourceDescriptor(e,"MTL");o.setContent(t),this._loadMtl(o,r,a,i)},r.prototype._loadMtl=function(e,r,n,o){void 0===i.default&&console.error('"THREE.MTLLoader" is not available. "THREE.OBJLoader2" requires it for loading MTL files.'),t.isValid(e)&&this.logging.enabled&&console.time("Loading MTL: "+e.name);var s=[],l=this,u=function(a){var n=[];if(t.isValid(a))for(var i in a.preload(),n=a.materials)n.hasOwnProperty(i)&&(s[i]=n[i]);t.isValid(e)&&l.logging.enabled&&console.timeEnd("Loading MTL: "+e.name),r(s,a)};if(t.isValid(e)&&(t.isValid(e.content)||t.isValid(e.url))){var c=new i.default(this.manager);if(n=t.verifyInput(n,"anonymous"),c.setCrossOrigin(n),c.setPath(e.path),t.isValid(o)&&c.setMaterialOptions(o),t.isValid(e.content))u(t.isValid(e.content)?c.parse(e.content):null);else if(t.isValid(e.url)){new a.FileLoader(this.manager).load(e.url,(function(t){e.content=t,u(c.parse(t))}),this._onProgress,this._onError)}}else u()},r}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.littleEndian=!0};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(i.manager);o.setResponseType("arraybuffer"),o.load(e,(function(r){t(i.parse(r,e))}),r,n)},parse:function(e,t){var r=a.LoaderUtils.decodeText(e),n=function(e){var t={},r=e.search(/[\r\n]DATA\s(\S*)\s/i),a=/[\r\n]DATA\s(\S*)\s/i.exec(e.substr(r-1));if(t.data=a[1],t.headerLen=a[0].length+r,t.str=e.substr(0,t.headerLen),t.str=t.str.replace(/\#.*/gi,""),t.version=/VERSION (.*)/i.exec(t.str),t.fields=/FIELDS (.*)/i.exec(t.str),t.size=/SIZE (.*)/i.exec(t.str),t.type=/TYPE (.*)/i.exec(t.str),t.count=/COUNT (.*)/i.exec(t.str),t.width=/WIDTH (.*)/i.exec(t.str),t.height=/HEIGHT (.*)/i.exec(t.str),t.viewpoint=/VIEWPOINT (.*)/i.exec(t.str),t.points=/POINTS (.*)/i.exec(t.str),null!==t.version&&(t.version=parseFloat(t.version[1])),null!==t.fields&&(t.fields=t.fields[1].split(" ")),null!==t.type&&(t.type=t.type[1].split(" ")),null!==t.width&&(t.width=parseInt(t.width[1])),null!==t.height&&(t.height=parseInt(t.height[1])),null!==t.viewpoint&&(t.viewpoint=t.viewpoint[1]),null!==t.points&&(t.points=parseInt(t.points[1],10)),null===t.points&&(t.points=t.width*t.height),null!==t.size&&(t.size=t.size[1].split(" ").map((function(e){return parseInt(e,10)}))),null!==t.count)t.count=t.count[1].split(" ").map((function(e){return parseInt(e,10)}));else{t.count=[];for(var n=0,i=t.fields.length;n0&&v.addAttribute("position",new a.Float32BufferAttribute(i,3)),o.length>0&&v.addAttribute("normal",new a.Float32BufferAttribute(o,3)),s.length>0&&v.addAttribute("color",new a.Float32BufferAttribute(s,3)),v.computeBoundingSphere();var g=new a.PointsMaterial({size:.005});s.length>0?g.vertexColors=!0:g.color.setHex(16777215*Math.random());var y=new a.Points(v,g),x=t.split("").reverse().join("");return x=(x=/([^\/]*)/.exec(x))[1].split("").reverse().join(""),y.name=x,y}console.error("THREE.PCDLoader: binary_compressed files are not supported")}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function r(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}function n(e,t){var r=parseInt(m[v].substr(e,t));if(r){var a=function(e,t){return"s"+Math.min(e,t)+"e"+Math.max(e,t)}(y,r);void 0===p[a]&&(f.push([y-1,r-1,1]),p[a]=f.length-1)}}for(var i,o,s,l,u,c={h:[255,255,255],he:[217,255,255],li:[204,128,255],be:[194,255,0],b:[255,181,181],c:[144,144,144],n:[48,80,248],o:[255,13,13],f:[144,224,80],ne:[179,227,245],na:[171,92,242],mg:[138,255,0],al:[191,166,166],si:[240,200,160],p:[255,128,0],s:[255,255,48],cl:[31,240,31],ar:[128,209,227],k:[143,64,212],ca:[61,255,0],sc:[230,230,230],ti:[191,194,199],v:[166,166,171],cr:[138,153,199],mn:[156,122,199],fe:[224,102,51],co:[240,144,160],ni:[80,208,80],cu:[200,128,51],zn:[125,128,176],ga:[194,143,143],ge:[102,143,143],as:[189,128,227],se:[255,161,0],br:[166,41,41],kr:[92,184,209],rb:[112,46,176],sr:[0,255,0],y:[148,255,255],zr:[148,224,224],nb:[115,194,201],mo:[84,181,181],tc:[59,158,158],ru:[36,143,143],rh:[10,125,140],pd:[0,105,133],ag:[192,192,192],cd:[255,217,143],in:[166,117,115],sn:[102,128,128],sb:[158,99,181],te:[212,122,0],i:[148,0,148],xe:[66,158,176],cs:[87,23,143],ba:[0,201,0],la:[112,212,255],ce:[255,255,199],pr:[217,255,199],nd:[199,255,199],pm:[163,255,199],sm:[143,255,199],eu:[97,255,199],gd:[69,255,199],tb:[48,255,199],dy:[31,255,199],ho:[0,255,156],er:[0,230,117],tm:[0,212,82],yb:[0,191,56],lu:[0,171,36],hf:[77,194,255],ta:[77,166,255],w:[33,148,214],re:[38,125,171],os:[38,102,150],ir:[23,84,135],pt:[208,208,224],au:[255,209,35],hg:[184,184,208],tl:[166,84,77],pb:[87,89,97],bi:[158,79,181],po:[171,92,0],at:[117,79,69],rn:[66,130,150],fr:[66,0,102],ra:[0,125,0],ac:[112,171,250],th:[0,186,255],pa:[0,161,255],u:[0,143,255],np:[0,128,255],pu:[0,107,255],am:[84,92,242],cm:[120,92,227],bk:[138,79,227],cf:[161,54,212],es:[179,31,212],fm:[179,31,186],md:[179,13,166],no:[189,13,135],lr:[199,0,102],rf:[204,0,89],db:[209,0,79],sg:[217,0,69],bh:[224,0,56],hs:[230,0,46],mt:[235,0,38],ds:[235,0,38],rg:[235,0,38],cn:[235,0,38],uut:[235,0,38],uuq:[235,0,38],uup:[235,0,38],uuh:[235,0,38],uus:[235,0,38],uuo:[235,0,38]},d=[],f=[],h={},p={},m=e.split("\n"),v=0,g=m.length;v=t.elements[u].count&&(u++,c=0);var h=n(t.elements[u].properties,f);s(a,t.elements[u].name,h),c++}}return o(a)}function o(e){var t=new a.BufferGeometry;return e.indices.length>0&&t.setIndex(e.indices),t.addAttribute("position",new a.Float32BufferAttribute(e.vertices,3)),e.normals.length>0&&t.addAttribute("normal",new a.Float32BufferAttribute(e.normals,3)),e.uvs.length>0&&t.addAttribute("uv",new a.Float32BufferAttribute(e.uvs,2)),e.colors.length>0&&t.addAttribute("color",new a.Float32BufferAttribute(e.colors,3)),t.computeBoundingSphere(),t}function s(e,t,r){if("vertex"===t)e.vertices.push(r.x,r.y,r.z),"nx"in r&&"ny"in r&&"nz"in r&&e.normals.push(r.nx,r.ny,r.nz),"s"in r&&"t"in r&&e.uvs.push(r.s,r.t),"red"in r&&"green"in r&&"blue"in r&&e.colors.push(r.red/255,r.green/255,r.blue/255);else if("face"===t){var a=r.vertex_indices||r.vertex_index;3===a.length?e.indices.push(a[0],a[1],a[2]):4===a.length&&(e.indices.push(a[0],a[1],a[3]),e.indices.push(a[1],a[2],a[3]))}}function l(e,t,r,a){switch(r){case"int8":case"char":return[e.getInt8(t),1];case"uint8":case"uchar":return[e.getUint8(t),1];case"int16":case"short":return[e.getInt16(t,a),2];case"uint16":case"ushort":return[e.getUint16(t,a),2];case"int32":case"int":return[e.getInt32(t,a),4];case"uint32":case"uint":return[e.getUint32(t,a),4];case"float32":case"float":return[e.getFloat32(t,a),4];case"float64":case"double":return[e.getFloat64(t,a),8]}}function u(e,t,r,a){for(var n,i={},o=0,s=0;s>7&1),s=n>>6&1,l=1==(n>>5&1),u=31&n,c=0,d=0;if(l?(c=(t[2]<<16)+(t[3]<<8)+t[4],d=(t[5]<<16)+(t[6]<<8)+t[7]):(c=t[2]+(t[3]<<8)+(t[4]<<16),d=t[5]+(t[6]<<8)+(t[7]<<16)),0===a)throw new Error("PRWM decoder: Invalid format version: 0");if(1!==a)throw new Error("PRWM decoder: Unsupported format version: "+a);if(!o){if(0!==s)throw new Error("PRWM decoder: Indices type must be set to 0 for non-indexed geometries");if(0!==d)throw new Error("PRWM decoder: Number of indices must be set to 0 for non-indexed geometries")}var f,h,p,m,v,g,y,x,b=8,w={};for(x=0;x>7&1,m=1+(n>>4&3),b++,g=i(e,v=r[15&n],b=4*Math.ceil(b/4),m*c,l),b+=v.BYTES_PER_ELEMENT*m*c,w[f]={type:p,cardinality:m,values:g}}return b=4*Math.ceil(b/4),y=null,o&&(y=i(e,1===s?Uint32Array:Uint16Array,b,d,l)),{version:a,attributes:w,indices:y}}(e),s=Object.keys(o.attributes),l=new a.BufferGeometry;for(n=0;n0;return 25===h?(r=p?a.RGBA_PVRTC_4BPPV1_Format:a.RGB_PVRTC_4BPPV1_Format,t=4):24===h?(r=p?a.RGBA_PVRTC_2BPPV1_Format:a.RGB_PVRTC_2BPPV1_Format,t=2):console.error("THREE.PVRLoader: Unknown PVR format:",h),e.dataPtr=o,e.bpp=t,e.format=r,e.width=l,e.height=s,e.numSurfaces=f,e.numMipmaps=u+1,e.isCubemap=6===f,n._extract(e)},n._extract=function(e){var t,r={mipmaps:[],width:e.width,height:e.height,format:e.format,mipmapCount:e.numMipmaps,isCubemap:e.isCubemap},a=e.buffer,n=e.dataPtr,i=e.bpp,o=e.numSurfaces,s=0,l=0,u=0,c=0,d=0;2===i?(l=8,u=4):(l=4,u=4),t=l*u*i/8,r.mipmaps.length=e.numMipmaps*o;for(var f=0;f>f,p=e.height>>f;(c=h/l)<2&&(c=2),(d=p/u)<2&&(d=2),s=c*d*t;for(var m=0;m>5&31)/31,n=(A>>10&31)/31):(t=o,r=s,n=l)}for(var M=1;M<=3;M++){var T=y+12*M;m.push(c.getFloat32(T,!0)),m.push(c.getFloat32(T+4,!0)),m.push(c.getFloat32(T+8,!0)),v.push(x,b,w),f&&i.push(t,r,n)}}return p.addAttribute("position",new a.BufferAttribute(new Float32Array(m),3)),p.addAttribute("normal",new a.BufferAttribute(new Float32Array(v),3)),f&&(p.addAttribute("color",new a.BufferAttribute(new Float32Array(i),3)),p.hasColors=!0,p.alpha=u),p}(r):function(e){for(var t,r=new a.BufferGeometry,n=/facet([\s\S]*?)endfacet/g,i=0,o=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,s=new RegExp("vertex"+o+o+o,"g"),l=new RegExp("normal"+o+o+o,"g"),u=[],c=[],d=new a.Vector3;null!==(t=n.exec(e));){for(var f=0,h=0,p=t[0];null!==(t=l.exec(p));)d.x=parseFloat(t[1]),d.y=parseFloat(t[2]),d.z=parseFloat(t[3]),h++;for(;null!==(t=s.exec(p));)u.push(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])),c.push(d.x,d.y,d.z),f++;1!==h&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+i),3!==f&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+i),i++}return r.addAttribute("position",new a.Float32BufferAttribute(u,3)),r.addAttribute("normal",new a.Float32BufferAttribute(c,3)),r}("string"!=typeof(t=e)?a.LoaderUtils.decodeText(new Uint8Array(t)):t)}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager};n.prototype={constructor:n,load:function(e,t,r,n){var i=this;new a.FileLoader(i.manager).load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e,t,a,n,i,o,s,l){n=n*Math.PI/180,t=Math.abs(t),a=Math.abs(a);var u=(s.x-l.x)/2,c=(s.y-l.y)/2,d=Math.cos(n)*u+Math.sin(n)*c,f=-Math.sin(n)*u+Math.cos(n)*c,h=t*t,p=a*a,m=d*d,v=f*f,g=m/h+v/p;if(g>1){var y=Math.sqrt(g);h=(t*=y)*t,p=(a*=y)*a}var x=h*v+p*m,b=(h*p-x)/x,w=Math.sqrt(Math.max(0,b));i===o&&(w=-w);var A=w*t*f/a,M=-w*a*d/t,T=Math.cos(n)*A-Math.sin(n)*M+(s.x+l.x)/2,S=Math.sin(n)*A+Math.cos(n)*M+(s.y+l.y)/2,E=r(1,0,(d-A)/t,(f-M)/a),_=r((d-A)/t,(f-M)/a,(-d-A)/t,(-f-M)/a)%(2*Math.PI);e.currentPath.absellipse(T,S,t,a,E,E+_,0===o,n)}function r(e,t,r,a){var n=e*r+t*a,i=Math.sqrt(e*e+t*t)*Math.sqrt(r*r+a*a),o=Math.acos(Math.max(-1,Math.min(1,n/i)));return e*a-t*r<0&&(o=-o),o}function n(e,t){return t=Object.assign({},t),e.hasAttribute("fill")&&(t.fill=e.getAttribute("fill")),""!==e.style.fill&&(t.fill=e.style.fill),t}function i(e){return"none"!==e.fill&&"transparent"!==e.fill}function o(e,t){return 2*e-(t-e)}function s(e){for(var t=e.split(/[\s,]+|(?=\s?[+\-])/),r=0;r0){var p=[];for(u=0;u=t.end)return 0;this.position=t.cur;try{var r=this.readChunk(e);return t.cur+=r.size,r.id}catch(e){return this.debugMessage("Unable to read chunk at "+this.position),0}},resetPosition:function(){this.position-=6},readByte:function(e){var t=e.getUint8(this.position,!0);return this.position+=1,t},readFloat:function(e){try{var t=e.getFloat32(this.position,!0);return this.position+=4,t}catch(t){this.debugMessage(t+" "+this.position+" "+e.byteLength)}},readInt:function(e){var t=e.getInt32(this.position,!0);return this.position+=4,t},readShort:function(e){var t=e.getInt16(this.position,!0);return this.position+=2,t},readDWord:function(e){var t=e.getUint32(this.position,!0);return this.position+=4,t},readWord:function(e){var t=e.getUint16(this.position,!0);return this.position+=2,t},readString:function(e,t){for(var r="",a=0;a256||24!==e.colormap_size||1!==e.colormap_type)&&console.error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case a:case n:case o:case s:e.colormap_type&&console.error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case t:console.error("THREE.TGALoader: No data.");default:console.error('THREE.TGALoader: Invalid type "%s".',e.image_type)}(e.width<=0||e.height<=0)&&console.error("THREE.TGALoader: Invalid image size."),8!==e.pixel_size&&16!==e.pixel_size&&24!==e.pixel_size&&32!==e.pixel_size&&console.error('THREE.TGALoader: Invalid pixel size "%s".',e.pixel_size)}(v),v.id_length+m>e.length&&console.error("THREE.TGALoader: No data."),m+=v.id_length;var g=!1,y=!1,x=!1;switch(v.image_type){case i:g=!0,y=!0;break;case r:y=!0;break;case o:g=!0;break;case a:break;case s:g=!0,x=!0;break;case n:x=!0}var b=document.createElement("canvas");b.width=v.width,b.height=v.height;var w=b.getContext("2d"),A=w.createImageData(v.width,v.height),M=function(e,t,r,a,n){var i,o,s,l;if(o=r.pixel_size>>3,s=r.width*r.height*o,t&&(l=n.subarray(a,a+=r.colormap_length*(r.colormap_size>>3))),e){var u,c,d;i=new Uint8Array(s);for(var f=0,h=new Uint8Array(o);f>u){default:case f:i=0,s=1,m=t,o=0,p=1,g=r;break;case c:i=0,s=1,m=t,o=r-1,p=-1,g=-1;break;case h:i=t-1,s=-1,m=-1,o=0,p=1,g=r;break;case d:i=t-1,s=-1,m=-1,o=r-1,p=-1,g=-1}if(x)switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s){var l,u,c,d=0,f=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,d++)l=s[d],e[4*(u+f*c)+0]=l,e[4*(u+f*c)+1]=l,e[4*(u+f*c)+2]=l,e[4*(u+f*c)+3]=255}(e,o,p,g,i,s,m,a);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c=0,d=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=2)e[4*(l+d*u)+0]=s[c+0],e[4*(l+d*u)+1]=s[c+0],e[4*(l+d*u)+2]=s[c+0],e[4*(l+d*u)+3]=s[c+1]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}else switch(v.pixel_size){case 8:!function(e,t,r,a,n,i,o,s,l){var u,c,d,f=l,h=0,p=v.width;for(d=t;d!==a;d+=r)for(c=n;c!==o;c+=i,h++)u=s[h],e[4*(c+p*d)+3]=255,e[4*(c+p*d)+2]=f[3*u+0],e[4*(c+p*d)+1]=f[3*u+1],e[4*(c+p*d)+0]=f[3*u+2]}(e,o,p,g,i,s,m,a,n);break;case 16:!function(e,t,r,a,n,i,o,s){var l,u,c,d=0,f=v.width;for(c=t;c!==a;c+=r)for(u=n;u!==o;u+=i,d+=2)l=s[d+0]+(s[d+1]<<8),e[4*(u+f*c)+0]=(31744&l)>>7,e[4*(u+f*c)+1]=(992&l)>>2,e[4*(u+f*c)+2]=(31&l)>>3,e[4*(u+f*c)+3]=32768&l?0:255}(e,o,p,g,i,s,m,a);break;case 24:!function(e,t,r,a,n,i,o,s){var l,u,c=0,d=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=3)e[4*(l+d*u)+3]=255,e[4*(l+d*u)+2]=s[c+0],e[4*(l+d*u)+1]=s[c+1],e[4*(l+d*u)+0]=s[c+2]}(e,o,p,g,i,s,m,a);break;case 32:!function(e,t,r,a,n,i,o,s){var l,u,c=0,d=v.width;for(u=t;u!==a;u+=r)for(l=n;l!==o;l+=i,c+=4)e[4*(l+d*u)+2]=s[c+0],e[4*(l+d*u)+1]=s[c+1],e[4*(l+d*u)+0]=s[c+2],e[4*(l+d*u)+3]=s[c+3]}(e,o,p,g,i,s,m,a);break;default:console.error("THREE.TGALoader: Format not supported.")}}(A.data,v.width,v.height,M.pixel_data,M.palettes);return w.putImageData(A,0,0),b}},t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e){this.manager=void 0!==e?e:a.DefaultLoadingManager,this.reversed=!1};n.prototype={constructor:n,load:function(e,t,r,n){var i=this,o=new a.FileLoader(this.manager);o.setResponseType("arraybuffer"),o.load(e,(function(e){t(i.parse(e))}),r,n)},parse:function(e){function t(e){var t,r=[];e.forEach((function(e){"m"===e.type.toLowerCase()?(t=[e],r.push(t)):"z"!==e.type.toLowerCase()&&t.push(e)}));var a=[];return r.forEach((function(e){var t={type:"m",x:e[e.length-1].x,y:e[e.length-1].y};a.push(t);for(var r=e.length-1;r>0;r--){var n=e[r];t={type:n.type};void 0!==n.x2&&void 0!==n.y2?(t.x1=n.x2,t.y1=n.y2,t.x2=n.x1,t.y2=n.y1):void 0!==n.x1&&void 0!==n.y1&&(t.x1=n.x1,t.y1=n.y1),t.x=e[r-1].x,t.y=e[r-1].y,a.push(t)}})),a}return"undefined"==typeof opentype?(console.warn("THREE.TTFLoader: The loader requires opentype.js. Make sure it's included before using the loader."),null):function(e,r){for(var a=Math.round,n={},i=1e5/(72*(e.unitsPerEm||2048)),o=0;o-1;o--){var s=i[o];if(/{.*[{\[]/.test(s))(l=s.split("{").join("{\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);else if(/\].*}/.test(s)){var l;(l=s.split("]").join("]\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l)}if(/}.*}/.test(s))(l=s.split("}").join("}\n").split("\n")).unshift(1),l.unshift(o),i.splice.apply(i,l);/^\b[^\s]+\b$/.test(s.trim())?(i[o+1]=s+" "+i[o+1].trim(),i.splice(o,1)):s.indexOf("coord")>-1&&s.indexOf("[")<0&&s.indexOf("{")<0&&(i[o]+=" Coordinate {}")}var u=i.shift();return/V1.0/.exec(u)?console.warn("THREE.VRMLLoader: V1.0 not supported yet."):/V2.0/.exec(u)&&function(e,n){var i={},o=/(\b|\-|\+)([\d\.e]+)/,s=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g,l=/([\d\.\+\-e]+)\s+([\d\.\+\-e]+)\s+([\d\.\+\-e]+)/g;function u(e,t,r,n,i){for(var o=!0===i?1:-1,s=[],l={},u={},c=0;cu.y:m.y>=l.y&&m.y0)for(var f=0;f0&&this.indexes.push(c),c=[]):c.push(parseInt(i[f])));/]/.exec(t)&&(c.length>0&&this.indexes.push(c),c=[],this.isRecordingFaces=!1,e[this.recordingFieldname]=this.indexes)}else if(this.isRecordingPoints){if("Coordinate"==e.nodeType)for(;null!==(i=l.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2]),z:parseFloat(i[3])},this.points.push(n);if("TextureCoordinate"==e.nodeType)for(;null!==(i=s.exec(t));)n={x:parseFloat(i[1]),y:parseFloat(i[2])},this.points.push(n);/]/.exec(t)&&(this.isRecordingPoints=!1,e.points=this.points)}else if(this.isRecordingAngles){if(i.length>0)for(f=0;f-1&&"PointLight"===o.nodeType&&(o.nodeType="AmbientLight");var c=void 0===o.on||o.on,d=void 0!==o.intensity?o.intensity:1,f=new a.Color;if(o.color&&f.copy(o.color),"AmbientLight"===o.nodeType)(l=new a.AmbientLight(f,d)).visible=c,s.add(l);else if("PointLight"===o.nodeType){var h=0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),(l=new a.PointLight(f,d,h)).visible=c,s.add(l)}else if("SpotLight"===o.nodeType){d=1,h=0;var p=Math.PI/3;c=!0;void 0!==o.radius&&o.radius<1e3&&(h=o.radius),void 0!==o.cutOffAngle&&(p=o.cutOffAngle),(l=new a.SpotLight(f,d,h,p,0)).visible=c,s.add(l)}else if("Transform"===o.nodeType||"Group"===o.nodeType){if(l=new a.Object3D,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),void 0!==o.translation){var m=o.translation;l.position.set(m.x,m.y,m.z)}if(void 0!==o.rotation){var v=o.rotation;l.quaternion.setFromAxisAngle(new a.Vector3(v.x,v.y,v.z),v.w)}if(void 0!==o.scale){var g=o.scale;l.scale.set(g.x,g.y,g.z)}s.add(l)}else if("Shape"===o.nodeType)l=new a.Mesh,/DEF/.exec(o.string)&&(l.name=/DEF\s+([^\s]+)/.exec(o.string)[1],i[l.name]=l),s.add(l);else if("Background"===o.nodeType){var y=2e4,x=new a.SphereBufferGeometry(y,20,20),b=new a.MeshBasicMaterial({fog:!1,side:a.BackSide});if(o.skyColor.length>1)u(x,y,o.skyAngle,o.skyColor,!0),b.vertexColors=a.VertexColors;else{var w=o.skyColor[0];b.color.setRGB(w.r,w.b,w.g)}if(n.add(new a.Mesh(x,b)),void 0!==o.groundColor){y=12e3;var A=new a.SphereBufferGeometry(y,20,20,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),M=new a.MeshBasicMaterial({fog:!1,side:a.BackSide,vertexColors:a.VertexColors});u(A,y,o.groundAngle,o.groundColor,!1),n.add(new a.Mesh(A,M))}}else{if(/geometry/.exec(o.string)){if("Box"===o.nodeType){g=o.size;s.geometry=new a.BoxBufferGeometry(g.x,g.y,g.z)}else if("Cylinder"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.radius,o.radius,o.height);else if("Cone"===o.nodeType)s.geometry=new a.CylinderBufferGeometry(o.topRadius,o.bottomRadius,o.height);else if("Sphere"===o.nodeType)s.geometry=new a.SphereBufferGeometry(o.radius);else if("IndexedFaceSet"===o.nodeType){var T,S,E,_,F,P=new a.BufferGeometry,L=[],C=[];for(j=0,E=o.children.length;j-1){var O=/DEF\s+([^\s]+)/.exec(V.string)[1];i[O]=L.slice(0)}if(V.string.indexOf("USE")>-1){W=/USE\s+([^\s]+)/.exec(V.string)[1];L=i[W]}}}var N=0;if(o.coordIndex){var I=[],R=[];for(T=new a.Vector3,S=new a.Vector2,j=0,E=o.coordIndex.length;j=3&&N0&&P.addAttribute("uv",new a.Float32BufferAttribute(C,2)),P.computeVertexNormals(),P.computeBoundingSphere(),/DEF/.exec(o.string)&&(P.name=/DEF ([^\s]+)/.exec(o.string)[1],i[P.name]=P),s.geometry=P}return}if(/appearance/.exec(o.string)){for(var j=0;j>1^-(1&c),a[n]=s*(l+o),n+=i}},n.prototype.decompressIndices_=function(e,t,r,a,n){for(var i=0,o=0;o>1,p=e.charCodeAt(u+4)+1>>1,m=e.charCodeAt(u+5)+1>>1;l[s++]=n[0]*(c+h),l[s++]=n[1]*(d+p),l[s++]=n[2]*(f+m),l[s++]=n[0]*h,l[s++]=n[1]*p,l[s++]=n[2]*m}return l},n.prototype.decompressMesh=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],d=u,f=new Float32Array(o*c),h=0;h>1^-(1&d);l[c]+=f,s[t*u+c]=l[c],o[t*u+c]=a[c]*(l[c]+r[c])}},n.prototype.accumulateNormal=function(e,t,r,a,n){var i=a[8*e],o=a[8*e+1],s=a[8*e+2],l=a[8*t],u=a[8*t+1],c=a[8*t+2],d=a[8*r],f=a[8*r+1],h=a[8*r+2];l-=i,d-=i,i=(u-=o)*(h-=s)-(c-=s)*(f-=o),o=c*d-l*h,s=l*f-u*d,n[3*e]+=i,n[3*e+1]+=o,n[3*e+2]+=s,n[3*t]+=i,n[3*t+1]+=o,n[3*t+2]+=s,n[3*r]+=i,n[3*r+1]+=o,n[3*r+2]+=s},n.prototype.decompressMesh2=function(e,t,r,a,n,i){for(var o=r.decodeScales.length,s=r.decodeOffsets,l=r.decodeScales,u=t.attribRange[0],c=t.attribRange[1],d=t.codeRange[0],f=3*t.codeRange[2],h=new Uint16Array(f),p=new Int32Array(3*c),m=new Uint16Array(o),v=new Uint16Array(o*c),g=new Float32Array(o*c),y=0,x=0,b=0;b>1^-(1&L))+v[o*M+P]+v[o*T+P]-v[o*S+P];m[P]=C,v[o*y+P]=C,g[o*y+P]=l[P]*(C+s[P])}y++}else this.copyAttrib(o,v,m,F);this.accumulateNormal(M,T,F,v,p)}else{var O=y-(w-A);h[x++]=O,w===A?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,O);var N=y-(w=e.charCodeAt(d++));h[x++]=N,0===w?this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++):this.copyAttrib(o,v,m,N);var I=y-(w=e.charCodeAt(d++));if(h[x++]=I,0===w){for(P=0;P<5;P++)m[P]=(v[o*O+P]+v[o*N+P])/2;this.decodeAttrib2(e,o,s,l,u,c,g,v,m,y++)}else this.copyAttrib(o,v,m,I);this.accumulateNormal(O,N,I,v,p)}}for(b=0;b>1^-(1&B)),g[o*b+6]=k*U+(j>>1^-(1&j)),g[o*b+7]=k*D+(V>>1^-(1&V))}i(a,n,g,h,void 0,t)},n.prototype.downloadMesh=function(e,t,r,a,n){var i=this,s=0;o(e,(function(e){!function(e){for(;s0)throw new Error("Invalid string. Length must be a multiple of 4");o=new s(3*d/4-(i="="===e[d-2]?2:"="===e[d-1]?1:0)),a=i>0?d-4:d;var f=0;for(t=0,r=0;t>16,o[f++]=(65280&n)>>8,o[f++]=255&n;return 2===i?(n=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,o[f++]=255&n):1===i&&(n=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,o[f++]=n>>8&255,o[f++]=255&n),o}function n(e,a){var n,i,s,l,u=0;if("UInt64"===o.attributes.header_type?u=8:"UInt32"===o.attributes.header_type&&(u=4),"binary"===e.attributes.format&&a){var c,d,f,h,p,m;if("Float32"===e.attributes.type)var v=new Float32Array;else if("Int64"===e.attributes.type)v=new Int32Array;d=(c=r(e["#text"]))[0];for(var g=1;g0?3-h%3:0,(p=[]).push(m),f=3*u;for(g=0;g0){r.attributes={};for(var a=0;a0&&(v[g].text=n(v[g],d)),g++;switch(f[h]){case"PointData":var x=parseInt(c.attributes.NumberOfPoints),b=m.attributes.Normals;if(x>0)for(var w=0,A=v.length;w0){M=m.DataArray.attributes.NumberOfComponents;(s=new Float32Array(x*M)).set(m.DataArray.text,0)}break;case"Strips":var T=parseInt(c.attributes.NumberOfStrips);if(T>0){var S=new Int32Array(m.DataArray[0].text.length),E=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),E.set(m.DataArray[1].text,0);var _=T+S.length;u=new Uint32Array(3*_-9*T);var F=0;for(w=0,A=T;w0&&(O=E[w-1]);var N=0;for(C=E[w],O=0;N0&&(O=E[w-1])}}break;case"Polys":var I=parseInt(c.attributes.NumberOfPolys);if(I>0){S=new Int32Array(m.DataArray[0].text.length),E=new Int32Array(m.DataArray[1].text.length);S.set(m.DataArray[0].text,0),E.set(m.DataArray[1].text,0);_=I+S.length;u=new Uint32Array(3*_-9*I);F=0;var R=0;for(w=0,A=I,O=0;w=3)for(var O=parseInt(C[0]),N=1,I=0;I=3){var R,U;for(I=0;I=u.byteLength)break}var M=new a.BufferGeometry;return M.setIndex(new a.BufferAttribute(h,1)),M.addAttribute("position",new a.BufferAttribute(d,3)),f.length===d.length&&M.addAttribute("normal",new a.BufferAttribute(f,3)),M}(e)}}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},i=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:0;if(e){for(var r=t;r-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_readLine",value:function(e){for(var t=0;;){var r=-1;if(-1===(r=e.indexOf("//",t))&&(r=e.indexOf("#",t)),!(r>-1&&r<2))break;var a=-1;t=(a=e.indexOf("\r\n",t))>0?a+2:(a=e.indexOf("\r",t))>0?a+1:e.indexOf("\n",t)+1}return e.substr(t)}},{key:"_isBinary",value:function(e){var t=new DataView(e);if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var r=t.byteLength,a=0;a127)return!0;return!1}},{key:"ensureBinary",value:function(e){if("string"==typeof e){for(var t=new Uint8Array(e.length),r=0;r0&&(this.baseDir=this.url.substr(0,this.url.lastIndexOf("/")+1));this.Hierarchies.children=[],this._hierarchieParse(this.Hierarchies,16),this._changeRoot(),this._currentObject=this.Hierarchies.children.shift(),this.mainloop()}},{key:"_hierarchieParse",value:function(e,t){for(var r=t;;){var a=this._data.indexOf("{",r)+1,n=this._data.indexOf("}",r),i=this._data.indexOf("{",a)+1;if(!(a>0&&n>a)){r=-1===a?this._data.length:n+1;break}var o={children:[]},s=this._readLine(this._data.substr(r,a-r-1)).trim(),l=s.split(/ /g);if(l.length>0?(o.type=l[0],l.length>=2?o.name=l[1]:o.name=l[0]+this.Hierarchies.children.length):(o.name=s,o.type=""),"Animation"===o.type){o.data=this._data.substr(i,n-i).trim();var u=this._hierarchieParse(o,n+1);r=u.end,o.children=u.parent.children}else{var c=this._data.lastIndexOf(";",i>0?Math.min(i,n):n);if(o.data=this._data.substr(a,c-a).trim(),i<=0||n0||!this._currentObject.worked?setTimeout((function(){e.mainloop()}),1):setTimeout((function(){e.onLoad({models:e.Meshes,animations:e.animations})}),1)}},{key:"mainProc",value:function(){for(var e=!1;;){if(!this._currentObject.worked){switch(this._currentObject.type){case"template":break;case"AnimTicksPerSecond":this.animTicksPerSecond=parseInt(this._currentObject.data);break;case"Frame":this._setFrame();break;case"FrameTransformMatrix":this._setFrameTransformMatrix();break;case"Mesh":this._changeRoot(),this._currentGeo={},this._currentGeo.name=this._currentObject.name.trim(),this._currentGeo.parentName=this._getParentName(this._currentObject).trim(),this._currentGeo.VertexSetedBoneCount=[],this._currentGeo.Geometry=new a.Geometry,this._currentGeo.Materials=[],this._currentGeo.normalVectors=[],this._currentGeo.BoneInfs=[],this._currentGeo.baseFrame=this._currentFrame,this._makeBoneFrom_CurrentFrame(),this._readVertexDatas(),e=!0;break;case"MeshNormals":this._readVertexDatas();break;case"MeshTextureCoords":this._setMeshTextureCoords();break;case"VertexDuplicationIndices":break;case"MeshMaterialList":this._setMeshMaterialList();break;case"Material":this._setMaterial();break;case"SkinWeights":this._setSkinWeights();break;case"AnimationSet":this._changeRoot(),this._currentAnime={},this._currentAnime.name=this._currentObject.name.trim(),this._currentAnime.AnimeFrames=[];break;case"Animation":this._currentAnimeFrames&&this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=new s,this._currentAnimeFrames.boneName=this._currentObject.data.trim();break;case"AnimationKey":this._readAnimationKey(),e=!0}this._currentObject.worked=!0}if(this._currentObject.children.length>0){if(this._currentObject=this._currentObject.children.shift(),this.debug&&console.log("processing "+this._currentObject.name),e)break}else if(this._currentObject.worked&&this._currentObject.parent&&!this._currentObject.parent.parent&&this._changeRoot(),this._currentObject.parent?this._currentObject=this._currentObject.parent:e=!0,e)break}}},{key:"_changeRoot",value:function(){null!=this._currentGeo&&this._currentGeo.name&&this._makeOutputGeometry(),this._currentGeo={},null!=this._currentAnime&&this._currentAnime.name&&(this._currentAnimeFrames&&(this._currentAnime.AnimeFrames.push(this._currentAnimeFrames),this._currentAnimeFrames=null),this._makeOutputAnimation()),this._currentAnime={}}},{key:"_getParentName",value:function(e){return e.parent?e.parent.name?e.parent.name:this._getParentName(e.parent):""}},{key:"_setFrame",value:function(){this._nowFrameName=this._currentObject.name.trim(),this._currentFrame={},this._currentFrame.name=this._nowFrameName,this._currentFrame.children=[],this._currentObject.parent&&this._currentObject.parent.name&&(this._currentFrame.parentName=this._currentObject.parent.name),this.frameHierarchie.push(this._nowFrameName),this.HieStack[this._nowFrameName]=this._currentFrame}},{key:"_setFrameTransformMatrix",value:function(){this._currentFrame.FrameTransformMatrix=new a.Matrix4;var e=this._currentObject.data.split(",");this._ParseMatrixData(this._currentFrame.FrameTransformMatrix,e),this._makeBoneFrom_CurrentFrame()}},{key:"_makeBoneFrom_CurrentFrame",value:function(){if(this._currentFrame.FrameTransformMatrix){var e=new a.Bone;if(e.name=this._currentFrame.name,e.applyMatrix(this._currentFrame.FrameTransformMatrix),e.matrixWorld=e.matrix,e.FrameTransformMatrix=this._currentFrame.FrameTransformMatrix,this._currentFrame.putBone=e,this._currentFrame.parentName)for(var t in this.HieStack)this.HieStack[t].name===this._currentFrame.parentName&&this.HieStack[t].putBone.add(this._currentFrame.putBone)}}},{key:"_readVertexDatas",value:function(){for(var e=0,t=0,r=0,a=0,n=0;;){var i=!1;if(0===r){e=this._readInt1(e).endRead,r=1,n=0,(a=this._currentObject.data.indexOf(";;",e)+1)<=0&&(a=this._currentObject.data.length)}else{var o=0;switch(t){case 0:o=this._currentObject.data.indexOf(",",e)+1;break;case 1:o=this._currentObject.data.indexOf(";,",e)+1}switch((0===o||o>a)&&(o=a,r=0,i=!0),this._currentObject.type){case"Mesh":switch(t){case 0:this._readVertex1(this._currentObject.data.substr(e,o-e));break;case 1:this._readFace1(this._currentObject.data.substr(e,o-e))}break;case"MeshNormals":switch(t){case 0:this._readNormalVector1(this._currentObject.data.substr(e,o-e));break;case 1:this._readNormalFace1(this._currentObject.data.substr(e,o-e),n)}}e=o+1,n++,i&&t++}if(e>=this._currentObject.data.length)break}}},{key:"_readInt1",value:function(e){var t=this._currentObject.data.indexOf(";",e);return{refI:parseInt(this._currentObject.data.substr(e,t-e)),endRead:t+1}}},{key:"_readVertex1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.Geometry.vertices.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2]))),this._currentGeo.Geometry.skinIndices.push(new a.Vector4(0,0,0,0)),this._currentGeo.Geometry.skinWeights.push(new a.Vector4(1,0,0,0)),this._currentGeo.VertexSetedBoneCount.push(0)}},{key:"_readFace1",value:function(e){var t=this._readLine(e.trim()).substr(2,e.length-4).split(",");this._currentGeo.Geometry.faces.push(new a.Face3(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),new a.Vector3(1,1,1).normalize()))}},{key:"_readNormalVector1",value:function(e){var t=this._readLine(e.trim()).substr(0,e.length-2).split(";");this._currentGeo.normalVectors.push(new a.Vector3(parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])))}},{key:"_readNormalFace1",value:function(e,t){var r=this._readLine(e.trim()).substr(2,e.length-4).split(","),a=parseInt(r[0],10),n=this._currentGeo.normalVectors[a];a=parseInt(r[1],10);var i=this._currentGeo.normalVectors[a];a=parseInt(r[2],10);var o=this._currentGeo.normalVectors[a];this._currentGeo.Geometry.faces[t].vertexNormals=[n,i,o]}},{key:"_setMeshNormals",value:function(){for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var a=this._currentObject.data.indexOf(",",e)+1;-1===a&&(a=this._currentObject.data.indexOf(";;",e)+1,t=2,r=0);var n=this._currentObject.data.substr(e,a-e),i=this._readLine(n.trim()).split(";");this._currentGeo.normalVectors.push([parseFloat(i[0]),parseFloat(i[1]),parseFloat(i[2])]),e=a+1}}if(e>=this._currentObject.data.length)break}}},{key:"_setMeshTextureCoords",value:function(){this._tmpUvArray=[],this._currentGeo.Geometry.faceVertexUvs=[],this._currentGeo.Geometry.faceVertexUvs.push([]);for(var e=0,t=0,r=0;;){switch(t){case 0:if(0===r){e=this._readInt1(0).endRead,r=1}else{var n=this._currentObject.data.indexOf(",",e)+1;0===n&&(n=this._currentObject.data.length,t=2,r=0);var i=this._currentObject.data.substr(e,n-e),o=this._readLine(i.trim()).split(";");this.IsUvYReverse?this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),1-parseFloat(o[1]))):this._tmpUvArray.push(new a.Vector2(parseFloat(o[0]),parseFloat(o[1]))),e=n+1}}if(e>=this._currentObject.data.length)break}this._currentGeo.Geometry.faceVertexUvs[0]=[];for(var s=0;s=this._currentObject.data.length||t>=3)break}}},{key:"_setMaterial",value:function(){var e=new a.MeshPhongMaterial({color:16777215*Math.random()});e.side=a.FrontSide,e.name=this._currentObject.name;var t=0,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t),i=this._readLine(n.trim()).split(";");e.color.r=parseFloat(i[0]),e.color.g=parseFloat(i[1]),e.color.b=parseFloat(i[2]),t=r+2,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t),e.shininess=parseFloat(this._readLine(n)),t=r+1,r=this._currentObject.data.indexOf(";;",t),n=this._currentObject.data.substr(t,r-t);var o=this._readLine(n.trim()).split(";");e.specular.r=parseFloat(o[0]),e.specular.g=parseFloat(o[1]),e.specular.b=parseFloat(o[2]),t=r+2,-1===(r=this._currentObject.data.indexOf(";;",t))&&(r=this._currentObject.data.length),n=this._currentObject.data.substr(t,r-t);var s=this._readLine(n.trim()).split(";");e.emissive.r=parseFloat(s[0]),e.emissive.g=parseFloat(s[1]),e.emissive.b=parseFloat(s[2]);for(var l=null;this._currentObject.children.length>0;){l=this._currentObject.children.shift(),this.debug&&console.log("processing "+l.name);var u=l.data.substr(1,l.data.length-2);switch(l.type){case"TextureFilename":e.map=this.texloader.load(this.baseDir+u);break;case"BumpMapFilename":e.bumpMap=this.texloader.load(this.baseDir+u),e.bumpScale=.05;break;case"NormalMapFilename":e.normalMap=this.texloader.load(this.baseDir+u),e.normalScale=new a.Vector2(2,2);break;case"EmissiveMapFilename":e.emissiveMap=this.texloader.load(this.baseDir+u);break;case"LightMapFilename":e.lightMap=this.texloader.load(this.baseDir+u)}}this._currentGeo.Materials.push(e)}},{key:"_setSkinWeights",value:function(){var e=new o,t=0,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);t=r+1,e.boneName=n.substr(1,n.length-2),e.BoneIndex=this._currentGeo.BoneInfs.length,t=(r=this._currentObject.data.indexOf(";",t))+1,r=this._currentObject.data.indexOf(";",t),n=this._currentObject.data.substr(t,r-t);for(var i=this._readLine(n.trim()).split(","),s=0;s0)for(var o=0;o0){var t=[];this._makePutBoneList(this._currentGeo.baseFrame.parentName,t);for(var r=0;r4&&console.log("warn! over 4 bone weight! :"+s)}}for(var u=0;u0){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,i&&e.context.disable(e.context.STENCIL_TEST),e.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,e.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new a.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,e.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new a.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionX,e.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=a.OutlinePass.BlurDirectionY,e.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,i&&e.context.enable(e.context.STENCIL_TEST),e.render(this.scene,this.camera,r,!1),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=r.texture,e.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new a.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new a.Vector2(.5,.5)},textureMatrix:{value:new a.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},visibleEdgeColor:{value:new a.Vector3(1,1,1)},hiddenEdgeColor:{value:new a.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(e){return new a.ShaderMaterial({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new a.Vector2(.5,.5)},direction:{value:new a.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include \t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new a.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:a.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),s.BlurDirectionX=new a.Vector2(1,0),s.BlurDirectionY=new a.Vector2(0,1),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=r(1),i=(a=n)&&a.__esModule?a:{default:a};var o=function(e,t,r,a,n){i.default.call(this),this.scene=e,this.camera=t,this.overrideMaterial=r,this.clearColor=a,this.clearAlpha=void 0!==n?n:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1};o.prototype=Object.assign(Object.create(i.default.prototype),{constructor:o,render:function(e,t,r,a,n){var i,o,s=e.autoClear;e.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(i=e.getClearColor().getHex(),o=e.getClearAlpha(),e.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&e.clearDepth(),e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),this.clearColor&&e.setClearColor(i,o),this.scene.overrideMaterial=null,e.autoClear=s}}),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=c(r(1)),i=c(r(19)),o=c(r(20)),s=c(r(2)),l=c(r(21)),u=c(r(22));function c(e){return e&&e.__esModule?e:{default:e}}var d=function(e,t,r,u,c){(n.default.call(this),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.supportsDepthTextureExtension=void 0!==r&&r,this.supportsNormalTexture=void 0!==u&&u,this.oldClearColor=new a.Color,this.oldClearAlpha=1,this.params={output:0,saoBias:.5,saoIntensity:.18,saoScale:1,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},this.resolution=void 0!==c?new a.Vector2(c.x,c.y):new a.Vector2(256,256),this.saoRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat}),this.blurIntermediateRenderTarget=this.saoRenderTarget.clone(),this.beautyRenderTarget=this.saoRenderTarget.clone(),this.normalRenderTarget=new a.WebGLRenderTarget(this.resolution.x,this.resolution.y,{minFilter:a.NearestFilter,magFilter:a.NearestFilter,format:a.RGBAFormat}),this.depthRenderTarget=this.normalRenderTarget.clone(),this.supportsDepthTextureExtension)&&((r=new a.DepthTexture).type=a.UnsignedShortType,r.minFilter=a.NearestFilter,r.maxFilter=a.NearestFilter,this.beautyRenderTarget.depthTexture=r,this.beautyRenderTarget.depthBuffer=!0);this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.normalMaterial=new a.MeshNormalMaterial,this.normalMaterial.blending=a.NoBlending,void 0===i.default&&console.error("THREE.SAOPass relies on THREE.SAOShader"),this.saoMaterial=new a.ShaderMaterial({defines:Object.assign({},i.default.defines),fragmentShader:i.default.fragmentShader,vertexShader:i.default.vertexShader,uniforms:a.UniformsUtils.clone(i.default.uniforms)}),this.saoMaterial.extensions.derivatives=!0,this.saoMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.saoMaterial.defines.NORMAL_TEXTURE=this.supportsNormalTexture?1:0,this.saoMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.saoMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.saoMaterial.uniforms.tNormal.value=this.normalRenderTarget.texture,this.saoMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.blending=a.NoBlending,void 0===o.default&&console.error("THREE.SAOPass relies on THREE.DepthLimitedBlurShader"),this.vBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.vBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.vBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.vBlurMaterial.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.vBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.vBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.vBlurMaterial.blending=a.NoBlending,this.hBlurMaterial=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(o.default.uniforms),defines:Object.assign({},o.default.defines),vertexShader:o.default.vertexShader,fragmentShader:o.default.fragmentShader}),this.hBlurMaterial.defines.DEPTH_PACKING=this.supportsDepthTextureExtension?0:1,this.hBlurMaterial.defines.PERSPECTIVE_CAMERA=this.camera.isPerspectiveCamera?1:0,this.hBlurMaterial.uniforms.tDiffuse.value=this.blurIntermediateRenderTarget.texture,this.hBlurMaterial.uniforms.tDepth.value=this.supportsDepthTextureExtension?r:this.depthRenderTarget.texture,this.hBlurMaterial.uniforms.size.value.set(this.resolution.x,this.resolution.y),this.hBlurMaterial.blending=a.NoBlending,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.CopyShader"),this.materialCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(s.default.uniforms),vertexShader:s.default.vertexShader,fragmentShader:s.default.fragmentShader,blending:a.NoBlending}),this.materialCopy.transparent=!0,this.materialCopy.depthTest=!1,this.materialCopy.depthWrite=!1,this.materialCopy.blending=a.CustomBlending,this.materialCopy.blendSrc=a.DstColorFactor,this.materialCopy.blendDst=a.ZeroFactor,this.materialCopy.blendEquation=a.AddEquation,this.materialCopy.blendSrcAlpha=a.DstAlphaFactor,this.materialCopy.blendDstAlpha=a.ZeroFactor,this.materialCopy.blendEquationAlpha=a.AddEquation,void 0===s.default&&console.error("THREE.SAOPass relies on THREE.UnpackDepthRGBAShader"),this.depthCopy=new a.ShaderMaterial({uniforms:a.UniformsUtils.clone(l.default.uniforms),vertexShader:l.default.vertexShader,fragmentShader:l.default.fragmentShader,blending:a.NoBlending}),this.quadCamera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.quadScene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quadScene.add(this.quad)};d.OUTPUT={Beauty:1,Default:0,SAO:2,Depth:3,Normal:4},d.prototype=Object.assign(Object.create(n.default.prototype),{constructor:d,render:function(e,t,r,n,i){if(this.renderToScreen&&(this.materialCopy.blending=a.NoBlending,this.materialCopy.uniforms.tDiffuse.value=r.texture,this.materialCopy.needsUpdate=!0,this.renderPass(e,this.materialCopy,null)),1!==this.params.output){this.oldClearColor.copy(e.getClearColor()),this.oldClearAlpha=e.getClearAlpha();var o=e.autoClear;e.autoClear=!1,e.clearTarget(this.depthRenderTarget),this.saoMaterial.uniforms.bias.value=this.params.saoBias,this.saoMaterial.uniforms.intensity.value=this.params.saoIntensity,this.saoMaterial.uniforms.scale.value=this.params.saoScale,this.saoMaterial.uniforms.kernelRadius.value=this.params.saoKernelRadius,this.saoMaterial.uniforms.minResolution.value=this.params.saoMinResolution,this.saoMaterial.uniforms.cameraNear.value=this.camera.near,this.saoMaterial.uniforms.cameraFar.value=this.camera.far;var s=this.params.saoBlurDepthCutoff*(this.camera.far-this.camera.near);this.vBlurMaterial.uniforms.depthCutoff.value=s,this.hBlurMaterial.uniforms.depthCutoff.value=s,this.vBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.vBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.hBlurMaterial.uniforms.cameraNear.value=this.camera.near,this.hBlurMaterial.uniforms.cameraFar.value=this.camera.far,this.params.saoBlurRadius=Math.floor(this.params.saoBlurRadius),this.prevStdDev===this.params.saoBlurStdDev&&this.prevNumSamples===this.params.saoBlurRadius||(u.default.configure(this.vBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(0,1)),u.default.configure(this.hBlurMaterial,this.params.saoBlurRadius,this.params.saoBlurStdDev,new a.Vector2(1,0)),this.prevStdDev=this.params.saoBlurStdDev,this.prevNumSamples=this.params.saoBlurRadius),e.setClearColor(0),e.render(this.scene,this.camera,this.beautyRenderTarget,!0),this.supportsDepthTextureExtension||this.renderOverride(e,this.depthMaterial,this.depthRenderTarget,0,1),this.supportsNormalTexture&&this.renderOverride(e,this.normalMaterial,this.normalRenderTarget,7829503,1),this.renderPass(e,this.saoMaterial,this.saoRenderTarget,16777215,1),this.params.saoBlur&&(this.renderPass(e,this.vBlurMaterial,this.blurIntermediateRenderTarget,16777215,1),this.renderPass(e,this.hBlurMaterial,this.saoRenderTarget,16777215,1));var l=this.materialCopy;3===this.params.output?this.supportsDepthTextureExtension?(this.materialCopy.uniforms.tDiffuse.value=this.beautyRenderTarget.depthTexture,this.materialCopy.needsUpdate=!0):(this.depthCopy.uniforms.tDiffuse.value=this.depthRenderTarget.texture,this.depthCopy.needsUpdate=!0,l=this.depthCopy):4===this.params.output?(this.materialCopy.uniforms.tDiffuse.value=this.normalRenderTarget.texture,this.materialCopy.needsUpdate=!0):(this.materialCopy.uniforms.tDiffuse.value=this.saoRenderTarget.texture,this.materialCopy.needsUpdate=!0),0===this.params.output?l.blending=a.CustomBlending:l.blending=a.NoBlending,this.renderPass(e,l,this.renderToScreen?null:r),e.setClearColor(this.oldClearColor,this.oldClearAlpha),e.autoClear=o}},renderPass:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.quad.material=t,e.render(this.quadScene,this.quadCamera,r,l),e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},renderOverride:function(e,t,r,a,n){var i=e.getClearColor(),o=e.getClearAlpha(),s=e.autoClear;e.autoClear=!1,a=t.clearColor||a,n=t.clearAlpha||n;var l=null!=a;l&&(e.setClearColor(a),e.setClearAlpha(n||0)),this.scene.overrideMaterial=t,e.render(this.scene,this.camera,r,l),this.scene.overrideMaterial=null,e.autoClear=s,e.setClearColor(i),e.setClearAlpha(o)},setSize:function(e,t){this.beautyRenderTarget.setSize(e,t),this.saoRenderTarget.setSize(e,t),this.blurIntermediateRenderTarget.setSize(e,t),this.normalRenderTarget.setSize(e,t),this.depthRenderTarget.setSize(e,t),this.saoMaterial.uniforms.size.value.set(e,t),this.saoMaterial.uniforms.cameraInverseProjectionMatrix.value.getInverse(this.camera.projectionMatrix),this.saoMaterial.uniforms.cameraProjectionMatrix.value=this.camera.projectionMatrix,this.saoMaterial.needsUpdate=!0,this.vBlurMaterial.uniforms.size.value.set(e,t),this.vBlurMaterial.needsUpdate=!0,this.hBlurMaterial.uniforms.size.value.set(e,t),this.hBlurMaterial.needsUpdate=!0}}),t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e){n.default.call(this),void 0===i.default&&console.error("THREE.SavePass relies on THREE.CopyShader");var t=i.default;this.textureID="tDiffuse",this.uniforms=a.UniformsUtils.clone(t.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderTarget=e,void 0===this.renderTarget&&(this.renderTarget=new a.WebGLRenderTarget(window.innerWidth,window.innerHeight,{minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBFormat,stencilBuffer:!1}),this.renderTarget.texture.name="SavePass.rt"),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=r.texture),this.quad.material=this.material,e.render(this.scene,this.camera,this.renderTarget,this.clear)}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(23));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),this.edgesRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new a.WebGLRenderTarget(e,t,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:a.LinearFilter,format:a.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var r=new Image;r.src=this.getAreaTexture(),this.areaTexture=new a.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=a.RGBFormat,this.areaTexture.minFilter=a.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.needsUpdate=!0,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),this.searchTexture=new a.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=a.NearestFilter,this.searchTexture.minFilter=a.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.needsUpdate=!0,this.searchTexture.flipY=!1,void 0===i.default&&console.error("THREE.SMAAPass relies on THREE.SMAAShader"),this.uniformsEdges=a.UniformsUtils.clone(i.default[0].uniforms),this.uniformsEdges.resolution.value.set(1/e,1/t),this.materialEdges=new a.ShaderMaterial({defines:Object.assign({},i.default[0].defines),uniforms:this.uniformsEdges,vertexShader:i.default[0].vertexShader,fragmentShader:i.default[0].fragmentShader}),this.uniformsWeights=a.UniformsUtils.clone(i.default[1].uniforms),this.uniformsWeights.resolution.value.set(1/e,1/t),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new a.ShaderMaterial({defines:Object.assign({},i.default[1].defines),uniforms:this.uniformsWeights,vertexShader:i.default[1].vertexShader,fragmentShader:i.default[1].fragmentShader}),this.uniformsBlend=a.UniformsUtils.clone(i.default[2].uniforms),this.uniformsBlend.resolution.value.set(1/e,1/t),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new a.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:i.default[2].vertexShader,fragmentShader:i.default[2].fragmentShader}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){this.uniformsEdges.tDiffuse.value=r.texture,this.quad.material=this.materialEdges,e.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,e.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=r.texture,this.quad.material=this.materialBlend,this.renderToScreen?e.render(this.scene,this.camera):e.render(this.scene,this.camera,t,this.clear)},setSize:function(e,t){this.edgesRT.setSize(e,t),this.weightsRT.setSize(e,t),this.materialEdges.uniforms.resolution.value.set(1/e,1/t),this.materialWeights.uniforms.resolution.value.set(1/e,1/t),this.materialBlend.uniforms.resolution.value.set(1/e,1/t)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUpLjJYNJkM+IRzQ+PQvIeAMTrBS2LEiaiR9b/5PuT6Ap/AcfAFO4Y3dA3DFH7/VS+M8k4baEAQfMI4QfbVDDGIRg7GKaIY52qAjTAgTvGBAPGIIghOCYAUrGFNgzA7Q3QhgCwfwAnwe5vDejgG44o/fbm1C5ZlYQvQDARPAIQGxCWBM+wWl37ZQESb4gImexGMDouhGLx1Cst0Saa4b4AqO4Hk4gxo+3DHAV/nx27p3JziPM2pVgoiia5MdEzCGULprIN7gEEeQ5IQxEBBBQnxhsDb5auGmAAYcHMA9eAAz8PBol8/xij9+C4Djlim4gJjWcwZBhCBgMIIYxGAVIkH3ZtcBuLdtRFMWsPGoY9rN+HoBji9VBYdwD2ZQg4cnO7OSq/z4rU5KKdwVbFAjNojCQzTlCLPFSxt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8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(3)),i=o(r(25));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,o){if(void 0===i.default)return console.warn("THREE.SSAOPass depends on THREE.SSAOShader"),new n.default;n.default.call(this,i.default),this.width=void 0!==r?r:512,this.height=void 0!==o?o:256,this.renderToScreen=!1,this.camera2=t,this.scene2=e,this.depthMaterial=new a.MeshDepthMaterial,this.depthMaterial.depthPacking=a.RGBADepthPacking,this.depthMaterial.blending=a.NoBlending,this.depthRenderTarget=new a.WebGLRenderTarget(this.width,this.height,{minFilter:a.LinearFilter,magFilter:a.LinearFilter}),this.uniforms.tDepth.value=this.depthRenderTarget.texture,this.uniforms.size.value.set(this.width,this.height),this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far,this.uniforms.radius.value=4,this.uniforms.onlyAO.value=!1,this.uniforms.aoClamp.value=.25,this.uniforms.lumInfluence.value=.7;Object.defineProperties(this,{radius:{get:function(){return this.uniforms.radius.value},set:function(e){this.uniforms.radius.value=e}},onlyAO:{get:function(){return this.uniforms.onlyAO.value},set:function(e){this.uniforms.onlyAO.value=e}},aoClamp:{get:function(){return this.uniforms.aoClamp.value},set:function(e){this.uniforms.aoClamp.value=e}},lumInfluence:{get:function(){return this.uniforms.lumInfluence.value},set:function(e){this.uniforms.lumInfluence.value=e}}})};(s.prototype=Object.create(n.default.prototype)).render=function(e,t,r,a,i){this.scene2.overrideMaterial=this.depthMaterial,e.render(this.scene2,this.camera2,this.depthRenderTarget,!0),this.scene2.overrideMaterial=null,n.default.prototype.render.call(this,e,t,r,a,i)},s.prototype.setScene=function(e){this.scene2=e},s.prototype.setCamera=function(e){this.camera2=e,this.uniforms.cameraNear.value=this.camera2.near,this.uniforms.cameraFar.value=this.camera2.far},s.prototype.setSize=function(e,t){this.width=e,this.height=t,this.uniforms.size.value.set(this.width,this.height),this.depthRenderTarget.setSize(this.width,this.height)},t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),i=r(24),o=(a=i)&&a.__esModule?a:{default:a};var s=function(e,t,r){void 0===o.default&&console.error("THREE.TAARenderPass relies on THREE.SSAARenderPass"),o.default.call(this,e,t,r),this.sampleLevel=0,this.accumulate=!1};s.JitterVectors=o.default.JitterVectors,s.prototype=Object.assign(Object.create(o.default.prototype),{constructor:s,render:function(e,t,r,a){if(!this.accumulate)return o.default.prototype.render.call(this,e,t,r,a),void(this.accumulateIndex=-1);var i=s.JitterVectors[5];this.sampleRenderTarget||(this.sampleRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.sampleRenderTarget.texture.name="TAARenderPass.sample"),this.holdRenderTarget||(this.holdRenderTarget=new n.WebGLRenderTarget(r.width,r.height,this.params),this.holdRenderTarget.texture.name="TAARenderPass.hold"),this.accumulate&&-1===this.accumulateIndex&&(o.default.prototype.render.call(this,e,this.holdRenderTarget,r,a),this.accumulateIndex=0);var l=e.autoClear;e.autoClear=!1;var u=1/i.length;if(this.accumulateIndex>=0&&this.accumulateIndex=i.length)break}this.camera.clearViewOffset&&this.camera.clearViewOffset()}var h=this.accumulateIndex*u;h>0&&(this.copyUniforms.opacity.value=1,this.copyUniforms.tDiffuse.value=this.sampleRenderTarget.texture,e.render(this.scene2,this.camera2,t,!0)),h<1&&(this.copyUniforms.opacity.value=1-h,this.copyUniforms.tDiffuse.value=this.holdRenderTarget.texture,e.render(this.scene2,this.camera2,t,0===h)),e.autoClear=l}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=o(r(1)),i=o(r(2));function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t){n.default.call(this),void 0===i.default&&console.error("THREE.TexturePass relies on THREE.CopyShader");var r=i.default;this.map=e,this.opacity=void 0!==t?t:1,this.uniforms=a.UniformsUtils.clone(r.uniforms),this.material=new a.ShaderMaterial({uniforms:this.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,depthTest:!1,depthWrite:!1}),this.needsSwap=!1,this.camera=new a.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new a.Scene,this.quad=new a.Mesh(new a.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)};s.prototype=Object.assign(Object.create(n.default.prototype),{constructor:s,render:function(e,t,r,a,n){var i=e.autoClear;e.autoClear=!1,this.quad.material=this.material,this.uniforms.opacity.value=this.opacity,this.uniforms.tDiffuse.value=this.map,this.material.transparent=this.opacity<1,e.render(this.scene,this.camera,this.renderToScreen?null:r,this.clear),e.autoClear=i}}),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)),n=s(r(1)),i=s(r(2)),o=s(r(26));function s(e){return e&&e.__esModule?e:{default:e}}var l=function(e,t,r,s){n.default.call(this),this.strength=void 0!==t?t:1,this.radius=r,this.threshold=s,this.resolution=void 0!==e?new a.Vector2(e.x,e.y):new a.Vector2(256,256);var l={minFilter:a.LinearFilter,magFilter:a.LinearFilter,format:a.RGBAFormat};this.renderTargetsHorizontal=[],this.renderTargetsVertical=[],this.nMips=5;var u=Math.round(this.resolution.x/2),c=Math.round(this.resolution.y/2);this.renderTargetBright=new a.WebGLRenderTarget(u,c,l),this.renderTargetBright.texture.name="UnrealBloomPass.bright",this.renderTargetBright.texture.generateMipmaps=!1;for(var d=0;d\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat fSigma = float(SIGMA);\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\t\t\t\t\t\tfloat x = float(i);\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += (sample1 + sample2) * w;\t\t\t\t\t\tweightSum += 2.0 * w;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\n\t\t\t\t}"})},getCompositeMaterial:function(e){return new a.ShaderMaterial({defines:{NUM_MIPS:e},uniforms:{blurTexture1:{value:null},blurTexture2:{value:null},blurTexture3:{value:null},blurTexture4:{value:null},blurTexture5:{value:null},dirtTexture:{value:null},bloomStrength:{value:1},bloomFactors:{value:null},bloomTintColors:{value:null},bloomRadius:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D blurTexture1;\t\t\t\tuniform sampler2D blurTexture2;\t\t\t\tuniform sampler2D blurTexture3;\t\t\t\tuniform sampler2D blurTexture4;\t\t\t\tuniform sampler2D blurTexture5;\t\t\t\tuniform sampler2D dirtTexture;\t\t\t\tuniform float bloomStrength;\t\t\t\tuniform float bloomRadius;\t\t\t\tuniform float bloomFactors[NUM_MIPS];\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\t\t\t\t\t\t\t\tfloat lerpBloomFactor(const in float factor) { \t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\t\t\t\t}\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) + \t\t\t\t\t\t\t\t\t\t\t\t\t lerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\t\t\t\t}"})}}),l.BlurDirectionX=new a.Vector2(1,0),l.BlurDirectionY=new a.Vector2(0,1),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WaterRefractionShader=t.VignetteShader=t.VerticalTiltShiftShader=t.VerticalBlurShader=t.UnpackDepthRGBAShader=t.TriangleBlurShader=t.ToneMapShader=t.TechnicolorShader=t.SSAOShader=t.SobelOperatorShader=t.SMAAShader=t.SepiaShader=t.SAOShader=t.RGBShiftShader=t.PixelShader=t.ParallaxShader=t.NormalMapShader=t.MirrorShader=t.LuminosityShader=t.LuminosityHighPassShader=t.KaleidoShader=t.HueSaturationShader=t.HorizontalTiltShiftShader=t.HorizontalBlurShader=t.HalftoneShader=t.GammaCorrectionShader=t.FXAAShader=t.FresnelShader=t.FreiChenShader=t.FocusShader=t.FilmShader=t.DotScreenShader=t.DOFMipMapShader=t.DigitalGlitch=t.DepthLimitedBlurShader=t.CopyShader=t.ConvolutionShader=t.ColorifyShader=t.ColorCorrectionShader=t.BrightnessContrastShader=t.BokehShader2=t.BokehShader=t.BlurShaderUtils=t.BlendShader=t.BleachBypassShader=t.BasicShader=void 0;var a=q(r(113)),n=q(r(114)),i=q(r(115)),o=q(r(22)),s=q(r(14)),l=q(r(116)),u=q(r(117)),c=q(r(118)),d=q(r(119)),f=q(r(13)),h=q(r(2)),p=q(r(20)),m=q(r(17)),v=q(r(120)),g=q(r(15)),y=q(r(16)),x=q(r(121)),b=q(r(122)),w=q(r(123)),A=q(r(124)),M=q(r(125)),T=q(r(18)),S=q(r(126)),E=q(r(127)),_=q(r(128)),F=q(r(129)),P=q(r(26)),L=q(r(11)),C=q(r(130)),O=q(r(131)),N=(q(r(132)),q(r(133))),I=q(r(134)),R=q(r(135)),U=q(r(19)),D=q(r(136)),k=q(r(23)),B=q(r(137)),j=q(r(25)),V=q(r(138)),G=q(r(12)),z=q(r(139)),X=q(r(21)),H=q(r(140)),Y=q(r(141)),W=q(r(142)),Q=q(r(143));function q(e){return e&&e.__esModule?e:{default:e}}t.BasicShader=a.default,t.BleachBypassShader=n.default,t.BlendShader=i.default,t.BlurShaderUtils=o.default,t.BokehShader=s.default,t.BokehShader2=l.default,t.BrightnessContrastShader=u.default,t.ColorCorrectionShader=c.default,t.ColorifyShader=d.default,t.ConvolutionShader=f.default,t.CopyShader=h.default,t.DepthLimitedBlurShader=p.default,t.DigitalGlitch=m.default,t.DOFMipMapShader=v.default,t.DotScreenShader=g.default,t.FilmShader=y.default,t.FocusShader=x.default,t.FreiChenShader=b.default,t.FresnelShader=w.default,t.FXAAShader=A.default,t.GammaCorrectionShader=M.default,t.HalftoneShader=T.default,t.HorizontalBlurShader=S.default,t.HorizontalTiltShiftShader=E.default,t.HueSaturationShader=_.default,t.KaleidoShader=F.default,t.LuminosityHighPassShader=P.default,t.LuminosityShader=L.default,t.MirrorShader=C.default,t.NormalMapShader=O.default,t.ParallaxShader=N.default,t.PixelShader=I.default,t.RGBShiftShader=R.default,t.SAOShader=U.default,t.SepiaShader=D.default,t.SMAAShader=k.default,t.SobelOperatorShader=B.default,t.SSAOShader=j.default,t.TechnicolorShader=V.default,t.ToneMapShader=G.default,t.TriangleBlurShader=z.default,t.UnpackDepthRGBAShader=X.default,t.VerticalBlurShader=H.default,t.VerticalTiltShiftShader=Y.default,t.VignetteShader=W.default,t.WaterRefractionShader=Q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{},vertexShader:["void main() {","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["void main() {","gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 base = texture2D( tDiffuse, vUv );","vec3 lumCoeff = vec3( 0.25, 0.65, 0.1 );","float lum = dot( lumCoeff, base.rgb );","vec3 blend = vec3( lum );","float L = min( 1.0, max( 0.0, 10.0 * ( lum - 0.45 ) ) );","vec3 result1 = 2.0 * base.rgb * blend;","vec3 result2 = 1.0 - 2.0 * ( 1.0 - blend ) * ( 1.0 - base.rgb );","vec3 newColor = mix( result1, result2, L );","float A2 = opacity * base.a;","vec3 mixRGB = A2 * newColor.rgb;","mixRGB += ( ( 1.0 - A2 ) * base.rgb );","gl_FragColor = vec4( mixRGB, base.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse1:{value:null},tDiffuse2:{value:null},mixRatio:{value:.5},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform float mixRatio;","uniform sampler2D tDiffuse1;","uniform sampler2D tDiffuse2;","varying vec2 vUv;","void main() {","vec4 texel1 = texture2D( tDiffuse1, vUv );","vec4 texel2 = texture2D( tDiffuse2, vUv );","gl_FragColor = opacity * mix( texel1, texel2, mixRatio );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{textureWidth:{value:1},textureHeight:{value:1},focalDepth:{value:1},focalLength:{value:24},fstop:{value:.9},tColor:{value:null},tDepth:{value:null},maxblur:{value:1},showFocus:{value:0},manualdof:{value:0},vignetting:{value:0},depthblur:{value:0},threshold:{value:.5},gain:{value:2},bias:{value:.5},fringe:{value:.7},znear:{value:.1},zfar:{value:100},noise:{value:1},dithering:{value:1e-4},pentagon:{value:0},shaderFocus:{value:1},focusCoords:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#include ","varying vec2 vUv;","uniform sampler2D tColor;","uniform sampler2D tDepth;","uniform float textureWidth;","uniform float textureHeight;","uniform float focalDepth; //focal distance value in meters, but you may use autofocus option below","uniform float focalLength; //focal length in mm","uniform float fstop; //f-stop value","uniform bool showFocus; //show debug focus point and focal range (red = focal point, green = focal range)","/*","make sure that these two values are the same for your camera, otherwise distances will be wrong.","*/","uniform float znear; // camera clipping start","uniform float zfar; // camera clipping end","//------------------------------------------","//user variables","const int samples = SAMPLES; //samples on the first ring","const int rings = RINGS; //ring count","const int maxringsamples = rings * samples;","uniform bool manualdof; // manual dof calculation","float ndofstart = 1.0; // near dof blur start","float ndofdist = 2.0; // near dof blur falloff distance","float fdofstart = 1.0; // far dof blur start","float fdofdist = 3.0; // far dof blur falloff distance","float CoC = 0.03; //circle of confusion size in mm (35mm film = 0.03mm)","uniform bool vignetting; // use optical lens vignetting","float vignout = 1.3; // vignetting outer border","float vignin = 0.0; // vignetting inner border","float vignfade = 22.0; // f-stops till vignete fades","uniform bool shaderFocus;","// disable if you use external focalDepth value","uniform vec2 focusCoords;","// autofocus point on screen (0.0,0.0 - left lower corner, 1.0,1.0 - upper right)","// if center of screen use vec2(0.5, 0.5);","uniform float maxblur;","//clamp value of max blur (0.0 = no blur, 1.0 default)","uniform float threshold; // highlight threshold;","uniform float gain; // highlight gain;","uniform float bias; // bokeh edge bias","uniform float fringe; // bokeh chromatic aberration / fringing","uniform bool noise; //use noise instead of pattern for sample dithering","uniform float dithering;","uniform bool depthblur; // blur the depth buffer","float dbsize = 1.25; // depth blur size","/*","next part is experimental","not looking good with small sample and ring count","looks okay starting from samples = 4, rings = 4","*/","uniform bool pentagon; //use pentagon as bokeh shape?","float feather = 0.4; //pentagon shape feather","//------------------------------------------","float getDepth( const in vec2 screenPosition ) {","\t#if DEPTH_PACKING == 1","\treturn unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );","\t#else","\treturn texture2D( tDepth, screenPosition ).x;","\t#endif","}","float penta(vec2 coords) {","//pentagonal shape","float scale = float(rings) - 1.3;","vec4 HS0 = vec4( 1.0, 0.0, 0.0, 1.0);","vec4 HS1 = vec4( 0.309016994, 0.951056516, 0.0, 1.0);","vec4 HS2 = vec4(-0.809016994, 0.587785252, 0.0, 1.0);","vec4 HS3 = vec4(-0.809016994,-0.587785252, 0.0, 1.0);","vec4 HS4 = vec4( 0.309016994,-0.951056516, 0.0, 1.0);","vec4 HS5 = vec4( 0.0 ,0.0 , 1.0, 1.0);","vec4 one = vec4( 1.0 );","vec4 P = vec4((coords),vec2(scale, scale));","vec4 dist = vec4(0.0);","float inorout = -4.0;","dist.x = dot( P, HS0 );","dist.y = dot( P, HS1 );","dist.z = dot( P, HS2 );","dist.w = dot( P, HS3 );","dist = smoothstep( -feather, feather, dist );","inorout += dot( dist, one );","dist.x = dot( P, HS4 );","dist.y = HS5.w - abs( P.z );","dist = smoothstep( -feather, feather, dist );","inorout += dist.x;","return clamp( inorout, 0.0, 1.0 );","}","float bdepth(vec2 coords) {","// Depth buffer blur","float d = 0.0;","float kernel[9];","vec2 offset[9];","vec2 wh = vec2(1.0/textureWidth,1.0/textureHeight) * dbsize;","offset[0] = vec2(-wh.x,-wh.y);","offset[1] = vec2( 0.0, -wh.y);","offset[2] = vec2( wh.x -wh.y);","offset[3] = vec2(-wh.x, 0.0);","offset[4] = vec2( 0.0, 0.0);","offset[5] = vec2( wh.x, 0.0);","offset[6] = vec2(-wh.x, wh.y);","offset[7] = vec2( 0.0, wh.y);","offset[8] = vec2( wh.x, wh.y);","kernel[0] = 1.0/16.0; kernel[1] = 2.0/16.0; kernel[2] = 1.0/16.0;","kernel[3] = 2.0/16.0; kernel[4] = 4.0/16.0; kernel[5] = 2.0/16.0;","kernel[6] = 1.0/16.0; kernel[7] = 2.0/16.0; kernel[8] = 1.0/16.0;","for( int i=0; i<9; i++ ) {","float tmp = getDepth( coords + offset[ i ] );","d += tmp * kernel[i];","}","return d;","}","vec3 color(vec2 coords,float blur) {","//processing the sample","vec3 col = vec3(0.0);","vec2 texel = vec2(1.0/textureWidth,1.0/textureHeight);","col.r = texture2D(tColor,coords + vec2(0.0,1.0)*texel*fringe*blur).r;","col.g = texture2D(tColor,coords + vec2(-0.866,-0.5)*texel*fringe*blur).g;","col.b = texture2D(tColor,coords + vec2(0.866,-0.5)*texel*fringe*blur).b;","vec3 lumcoeff = vec3(0.299,0.587,0.114);","float lum = dot(col.rgb, lumcoeff);","float thresh = max((lum-threshold)*gain, 0.0);","return col+mix(vec3(0.0),col,thresh*blur);","}","vec3 debugFocus(vec3 col, float blur, float depth) {","float edge = 0.002*depth; //distance based edge smoothing","float m = clamp(smoothstep(0.0,edge,blur),0.0,1.0);","float e = clamp(smoothstep(1.0-edge,1.0,blur),0.0,1.0);","col = mix(col,vec3(1.0,0.5,0.0),(1.0-m)*0.6);","col = mix(col,vec3(0.0,0.5,1.0),((1.0-e)-(1.0-m))*0.2);","return col;","}","float linearize(float depth) {","return -zfar * znear / (depth * (zfar - znear) - zfar);","}","float vignette() {","float dist = distance(vUv.xy, vec2(0.5,0.5));","dist = smoothstep(vignout+(fstop/vignfade), vignin+(fstop/vignfade), dist);","return clamp(dist,0.0,1.0);","}","float gather(float i, float j, int ringsamples, inout vec3 col, float w, float h, float blur) {","float rings2 = float(rings);","float step = PI*2.0 / float(ringsamples);","float pw = cos(j*step)*i;","float ph = sin(j*step)*i;","float p = 1.0;","if (pentagon) {","p = penta(vec2(pw,ph));","}","col += color(vUv.xy + vec2(pw*w,ph*h), blur) * mix(1.0, i/rings2, bias) * p;","return 1.0 * mix(1.0, i /rings2, bias) * p;","}","void main() {","//scene depth calculation","float depth = linearize( getDepth( vUv.xy ) );","// Blur depth?","if (depthblur) {","depth = linearize(bdepth(vUv.xy));","}","//focal plane calculation","float fDepth = focalDepth;","if (shaderFocus) {","fDepth = linearize( getDepth( focusCoords ) );","}","// dof blur factor calculation","float blur = 0.0;","if (manualdof) {","float a = depth-fDepth; // Focal plane","float b = (a-fdofstart)/fdofdist; // Far DoF","float c = (-a-ndofstart)/ndofdist; // Near Dof","blur = (a>0.0) ? b : c;","} else {","float f = focalLength; // focal length in mm","float d = fDepth*1000.0; // focal plane in mm","float o = depth*1000.0; // depth in mm","float a = (o*f)/(o-f);","float b = (d*f)/(d-f);","float c = (d-f)/(d*fstop*CoC);","blur = abs(a-b)*c;","}","blur = clamp(blur,0.0,1.0);","// calculation of pattern for dithering","vec2 noise = vec2(rand(vUv.xy), rand( vUv.xy + vec2( 0.4, 0.6 ) ) )*dithering*blur;","// getting blur x and y step factor","float w = (1.0/textureWidth)*blur*maxblur+noise.x;","float h = (1.0/textureHeight)*blur*maxblur+noise.y;","// calculation of final color","vec3 col = vec3(0.0);","if(blur < 0.05) {","//some optimization thingy","col = texture2D(tColor, vUv.xy).rgb;","} else {","col = texture2D(tColor, vUv.xy).rgb;","float s = 1.0;","int ringsamples;","for (int i = 1; i <= rings; i++) {","/*unboxstart*/","ringsamples = i * samples;","for (int j = 0 ; j < maxringsamples ; j++) {","if (j >= ringsamples) break;","s += gather(float(i), float(j), ringsamples, col, w, h, blur);","}","/*unboxend*/","}","col /= s; //divide by sample count","}","if (showFocus) {","col = debugFocus(col, blur, depth);","}","if (vignetting) {","col *= vignette();","}","gl_FragColor.rgb = col;","gl_FragColor.a = 1.0;","} "].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},brightness:{value:0},contrast:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float brightness;","uniform float contrast;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb += brightness;","if (contrast > 0.0) {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;","} else {","gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{tDiffuse:{value:null},powRGB:{value:new a.Vector3(2,2,2)},mulRGB:{value:new a.Vector3(1,1,1)},addRGB:{value:new a.Vector3(0,0,0)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec3 powRGB;","uniform vec3 mulRGB;","uniform vec3 addRGB;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","gl_FragColor.rgb = mulRGB * pow( ( gl_FragColor.rgb + addRGB ), powRGB );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},color:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Color)(16777215)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float v = dot( texel.xyz, luma );","gl_FragColor = vec4( v * color, texel.w );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tColor:{value:null},tDepth:{value:null},focus:{value:1},maxblur:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float focus;","uniform float maxblur;","uniform sampler2D tColor;","uniform sampler2D tDepth;","varying vec2 vUv;","void main() {","vec4 depth = texture2D( tDepth, vUv );","float factor = depth.x - focus;","vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );","gl_FragColor = col;","gl_FragColor.a = 1.0;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},screenWidth:{value:1024},screenHeight:{value:1024},sampleDistance:{value:.94},waveFactor:{value:.00125}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float screenWidth;","uniform float screenHeight;","uniform float sampleDistance;","uniform float waveFactor;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color, org, tmp, add;","float sample_dist, f;","vec2 vin;","vec2 uv = vUv;","add = color = org = texture2D( tDiffuse, uv );","vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );","sample_dist = dot( vin, vin ) * 2.0;","f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;","vec2 sampleSize = vec2( 1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );","add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );","if( tmp.b < color.b ) color = tmp;","color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );","color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );","gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},aspect:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(512,512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","uniform vec2 aspect;","vec2 texel = vec2(1.0 / aspect.x, 1.0 / aspect.y);","mat3 G[9];","const mat3 g0 = mat3( 0.3535533845424652, 0, -0.3535533845424652, 0.5, 0, -0.5, 0.3535533845424652, 0, -0.3535533845424652 );","const mat3 g1 = mat3( 0.3535533845424652, 0.5, 0.3535533845424652, 0, 0, 0, -0.3535533845424652, -0.5, -0.3535533845424652 );","const mat3 g2 = mat3( 0, 0.3535533845424652, -0.5, -0.3535533845424652, 0, 0.3535533845424652, 0.5, -0.3535533845424652, 0 );","const mat3 g3 = mat3( 0.5, -0.3535533845424652, 0, -0.3535533845424652, 0, 0.3535533845424652, 0, 0.3535533845424652, -0.5 );","const mat3 g4 = mat3( 0, -0.5, 0, 0.5, 0, 0.5, 0, -0.5, 0 );","const mat3 g5 = mat3( -0.5, 0, 0.5, 0, 0, 0, 0.5, 0, -0.5 );","const mat3 g6 = mat3( 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.6666666865348816, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204 );","const mat3 g7 = mat3( -0.3333333432674408, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, 0.6666666865348816, 0.1666666716337204, -0.3333333432674408, 0.1666666716337204, -0.3333333432674408 );","const mat3 g8 = mat3( 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408, 0.3333333432674408 );","void main(void)","{","G[0] = g0,","G[1] = g1,","G[2] = g2,","G[3] = g3,","G[4] = g4,","G[5] = g5,","G[6] = g6,","G[7] = g7,","G[8] = g8;","mat3 I;","float cnv[9];","vec3 sample;","for (float i=0.0; i<3.0; i++) {","for (float j=0.0; j<3.0; j++) {","sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;","I[int(i)][int(j)] = length(sample);","}","}","for (int i=0; i<9; i++) {","float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);","cnv[i] = dp3 * dp3;","}","float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);","float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);","gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{mRefractionRatio:{value:1.02},mFresnelBias:{value:.1},mFresnelPower:{value:2},mFresnelScale:{value:1},tCube:{value:null}},vertexShader:["uniform float mRefractionRatio;","uniform float mFresnelBias;","uniform float mFresnelScale;","uniform float mFresnelPower;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vec3 worldNormal = normalize( mat3( modelMatrix[0].xyz, modelMatrix[1].xyz, modelMatrix[2].xyz ) * normal );","vec3 I = worldPosition.xyz - cameraPosition;","vReflect = reflect( I, worldNormal );","vRefract[0] = refract( normalize( I ), worldNormal, mRefractionRatio );","vRefract[1] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.99 );","vRefract[2] = refract( normalize( I ), worldNormal, mRefractionRatio * 0.98 );","vReflectionFactor = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( I ), worldNormal ), mFresnelPower );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform samplerCube tCube;","varying vec3 vReflect;","varying vec3 vRefract[3];","varying float vReflectionFactor;","void main() {","vec4 reflectedColor = textureCube( tCube, vec3( -vReflect.x, vReflect.yz ) );","vec4 refractedColor = vec4( 1.0 );","refractedColor.r = textureCube( tCube, vec3( -vRefract[0].x, vRefract[0].yz ) ).r;","refractedColor.g = textureCube( tCube, vec3( -vRefract[1].x, vRefract[1].yz ) ).g;","refractedColor.b = textureCube( tCube, vec3( -vRefract[2].x, vRefract[2].yz ) ).b;","gl_FragColor = mix( refractedColor, reflectedColor, clamp( vReflectionFactor, 0.0, 1.0 ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["precision highp float;","","uniform sampler2D tDiffuse;","","uniform vec2 resolution;","","varying vec2 vUv;","","// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)","","//----------------------------------------------------------------------------------","// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag","// SDK Version: v3.00","// Email: gameworks@nvidia.com","// Site: http://developer.nvidia.com/","//","// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.","//","// Redistribution and use in source and binary forms, with or without","// modification, are permitted provided that the following conditions","// are met:","// * Redistributions of source code must retain the above copyright","// notice, this list of conditions and the following disclaimer.","// * Redistributions in binary form must reproduce the above copyright","// notice, this list of conditions and the following disclaimer in the","// documentation and/or other materials provided with the distribution.","// * Neither the name of NVIDIA CORPORATION nor the names of its","// contributors may be used to endorse or promote products derived","// from this software without specific prior written permission.","//","// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY","// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE","// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR","// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR","// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,","// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,","// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR","// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY","// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT","// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE","// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","//","//----------------------------------------------------------------------------------","","#define FXAA_PC 1","#define FXAA_GLSL_100 1","#define FXAA_QUALITY_PRESET 12","","#define FXAA_GREEN_AS_LUMA 1","","/*--------------------------------------------------------------------------*/","#ifndef FXAA_PC_CONSOLE"," //"," // The console algorithm for PC is included"," // for developers targeting really low spec machines."," // Likely better to just run FXAA_PC, and use a really low preset."," //"," #define FXAA_PC_CONSOLE 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_120"," #define FXAA_GLSL_120 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GLSL_130"," #define FXAA_GLSL_130 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_3"," #define FXAA_HLSL_3 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_4"," #define FXAA_HLSL_4 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_HLSL_5"," #define FXAA_HLSL_5 0","#endif","/*==========================================================================*/","#ifndef FXAA_GREEN_AS_LUMA"," //"," // For those using non-linear color,"," // and either not able to get luma in alpha, or not wanting to,"," // this enables FXAA to run using green as a proxy for luma."," // So with this enabled, no need to pack luma in alpha."," //"," // This will turn off AA on anything which lacks some amount of green."," // Pure red and blue or combination of only R and B, will get no AA."," //"," // Might want to lower the settings for both,"," // fxaaConsoleEdgeThresholdMin"," // fxaaQualityEdgeThresholdMin"," // In order to insure AA does not get turned off on colors"," // which contain a minor amount of green."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_GREEN_AS_LUMA 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_EARLY_EXIT"," //"," // Controls algorithm's early exit path."," // On PS3 turning this ON adds 2 cycles to the shader."," // On 360 turning this OFF adds 10ths of a millisecond to the shader."," // Turning this off on console will result in a more blurry image."," // So this defaults to on."," //"," // 1 = On."," // 0 = Off."," //"," #define FXAA_EARLY_EXIT 1","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_DISCARD"," //"," // Only valid for PC OpenGL currently."," // Probably will not work when FXAA_GREEN_AS_LUMA = 1."," //"," // 1 = Use discard on pixels which don't need AA."," // For APIs which enable concurrent TEX+ROP from same surface."," // 0 = Return unchanged color on pixels which don't need AA."," //"," #define FXAA_DISCARD 0","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_FAST_PIXEL_OFFSET"," //"," // Used for GLSL 120 only."," //"," // 1 = GL API supports fast pixel offsets"," // 0 = do not use fast pixel offsets"," //"," #ifdef GL_EXT_gpu_shader4"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_FAST_PIXEL_OFFSET 1"," #endif"," #ifndef FXAA_FAST_PIXEL_OFFSET"," #define FXAA_FAST_PIXEL_OFFSET 0"," #endif","#endif","/*--------------------------------------------------------------------------*/","#ifndef FXAA_GATHER4_ALPHA"," //"," // 1 = API supports gather4 on alpha channel."," // 0 = API does not support gather4 on alpha channel."," //"," #if (FXAA_HLSL_5 == 1)"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_ARB_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifdef GL_NV_gpu_shader5"," #define FXAA_GATHER4_ALPHA 1"," #endif"," #ifndef FXAA_GATHER4_ALPHA"," #define FXAA_GATHER4_ALPHA 0"," #endif","#endif","","","/*============================================================================"," FXAA QUALITY - TUNING KNOBS","------------------------------------------------------------------------------","NOTE the other tuning knobs are now in the shader function inputs!","============================================================================*/","#ifndef FXAA_QUALITY_PRESET"," //"," // Choose the quality preset."," // This needs to be compiled into the shader as it effects code."," // Best option to include multiple presets is to"," // in each shader define the preset, then include this file."," //"," // OPTIONS"," // -----------------------------------------------------------------------"," // 10 to 15 - default medium dither (10=fastest, 15=highest quality)"," // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)"," // 39 - no dither, very expensive"," //"," // NOTES"," // -----------------------------------------------------------------------"," // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)"," // 13 = about same speed as FXAA 3.9 and better than 12"," // 23 = closest to FXAA 3.9 visually and performance wise"," // _ = the lowest digit is directly related to performance"," // _ = the highest digit is directly related to style"," //"," #define FXAA_QUALITY_PRESET 12","#endif","","","/*============================================================================",""," FXAA QUALITY - PRESETS","","============================================================================*/","","/*============================================================================"," FXAA QUALITY - MEDIUM DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 10)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 3.0"," #define FXAA_QUALITY_P2 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 11)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 3.0"," #define FXAA_QUALITY_P3 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 12)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 4.0"," #define FXAA_QUALITY_P4 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 13)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 4.0"," #define FXAA_QUALITY_P5 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 14)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 4.0"," #define FXAA_QUALITY_P6 12.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 15)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 12.0","#endif","","/*============================================================================"," FXAA QUALITY - LOW DITHER PRESETS","============================================================================*/","#if (FXAA_QUALITY_PRESET == 20)"," #define FXAA_QUALITY_PS 3"," #define FXAA_QUALITY_P0 1.5"," #define FXAA_QUALITY_P1 2.0"," #define FXAA_QUALITY_P2 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 21)"," #define FXAA_QUALITY_PS 4"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 22)"," #define FXAA_QUALITY_PS 5"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 23)"," #define FXAA_QUALITY_PS 6"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 24)"," #define FXAA_QUALITY_PS 7"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 3.0"," #define FXAA_QUALITY_P6 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 25)"," #define FXAA_QUALITY_PS 8"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 4.0"," #define FXAA_QUALITY_P7 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 26)"," #define FXAA_QUALITY_PS 9"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 4.0"," #define FXAA_QUALITY_P8 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 27)"," #define FXAA_QUALITY_PS 10"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 4.0"," #define FXAA_QUALITY_P9 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 28)"," #define FXAA_QUALITY_PS 11"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 4.0"," #define FXAA_QUALITY_P10 8.0","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_QUALITY_PRESET == 29)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.5"," #define FXAA_QUALITY_P2 2.0"," #define FXAA_QUALITY_P3 2.0"," #define FXAA_QUALITY_P4 2.0"," #define FXAA_QUALITY_P5 2.0"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","/*============================================================================"," FXAA QUALITY - EXTREME QUALITY","============================================================================*/","#if (FXAA_QUALITY_PRESET == 39)"," #define FXAA_QUALITY_PS 12"," #define FXAA_QUALITY_P0 1.0"," #define FXAA_QUALITY_P1 1.0"," #define FXAA_QUALITY_P2 1.0"," #define FXAA_QUALITY_P3 1.0"," #define FXAA_QUALITY_P4 1.0"," #define FXAA_QUALITY_P5 1.5"," #define FXAA_QUALITY_P6 2.0"," #define FXAA_QUALITY_P7 2.0"," #define FXAA_QUALITY_P8 2.0"," #define FXAA_QUALITY_P9 2.0"," #define FXAA_QUALITY_P10 4.0"," #define FXAA_QUALITY_P11 8.0","#endif","","","","/*============================================================================",""," API PORTING","","============================================================================*/","#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)"," #define FxaaBool bool"," #define FxaaDiscard discard"," #define FxaaFloat float"," #define FxaaFloat2 vec2"," #define FxaaFloat3 vec3"," #define FxaaFloat4 vec4"," #define FxaaHalf float"," #define FxaaHalf2 vec2"," #define FxaaHalf3 vec3"," #define FxaaHalf4 vec4"," #define FxaaInt2 ivec2"," #define FxaaSat(x) clamp(x, 0.0, 1.0)"," #define FxaaTex sampler2D","#else"," #define FxaaBool bool"," #define FxaaDiscard clip(-1)"," #define FxaaFloat float"," #define FxaaFloat2 float2"," #define FxaaFloat3 float3"," #define FxaaFloat4 float4"," #define FxaaHalf half"," #define FxaaHalf2 half2"," #define FxaaHalf3 half3"," #define FxaaHalf4 half4"," #define FxaaSat(x) saturate(x)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_100 == 1)"," #define FxaaTexTop(t, p) texture2D(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_120 == 1)"," // Requires,"," // #version 120"," // And at least,"," // #extension GL_EXT_gpu_shader4 : enable"," // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)"," #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)"," #if (FXAA_FAST_PIXEL_OFFSET == 1)"," #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)"," #else"," #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)"," #endif"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_GLSL_130 == 1)",' // Requires "#version 130" or better'," #define FxaaTexTop(t, p) textureLod(t, p, 0.0)"," #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)"," #if (FXAA_GATHER4_ALPHA == 1)"," // use #extension GL_ARB_gpu_shader5 : enable"," #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)"," #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)"," #define FxaaTexGreen4(t, p) textureGather(t, p, 1)"," #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)"," #endif","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_3 == 1)"," #define FxaaInt2 float2"," #define FxaaTex sampler2D"," #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))"," #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_4 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)","#endif","/*--------------------------------------------------------------------------*/","#if (FXAA_HLSL_5 == 1)"," #define FxaaInt2 int2"," struct FxaaTex { SamplerState smpl; Texture2D tex; };"," #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)"," #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)"," #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)"," #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)"," #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)"," #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)","#endif","","","/*============================================================================"," GREEN AS LUMA OPTION SUPPORT FUNCTION","============================================================================*/","#if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }","#else"," FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }","#endif","","","","","/*============================================================================",""," FXAA3 QUALITY - PC","","============================================================================*/","#if (FXAA_PC == 1)","/*--------------------------------------------------------------------------*/","FxaaFloat4 FxaaPixelShader("," //"," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy} = center of pixel"," FxaaFloat2 pos,"," //"," // Used only for FXAA Console, and not used on the 360 version."," // Use noperspective interpolation here (turn off perspective interpolation)."," // {xy_} = upper left of pixel"," // {_zw} = lower right of pixel"," FxaaFloat4 fxaaConsolePosPos,"," //"," // Input color texture."," // {rgb_} = color in linear or perceptual color space"," // if (FXAA_GREEN_AS_LUMA == 0)"," // {__a} = luma in perceptual color space (not linear)"," FxaaTex tex,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 2nd sampler."," // This sampler needs to have an exponent bias of -1."," FxaaTex fxaaConsole360TexExpBiasNegOne,"," //"," // Only used on the optimized 360 version of FXAA Console.",' // For everything but 360, just use the same input here as for "tex".'," // For 360, same texture, just alias with a 3nd sampler."," // This sampler needs to have an exponent bias of -2."," FxaaTex fxaaConsole360TexExpBiasNegTwo,"," //"," // Only used on FXAA Quality."," // This must be from a constant/uniform."," // {x_} = 1.0/screenWidthInPixels"," // {_y} = 1.0/screenHeightInPixels"," FxaaFloat2 fxaaQualityRcpFrame,"," //"," // Only used on FXAA Console."," // This must be from a constant/uniform."," // This effects sub-pixel AA quality and inversely sharpness."," // Where N ranges between,"," // N = 0.50 (default)"," // N = 0.33 (sharper)"," // {x__} = -N/screenWidthInPixels"," // {_y_} = -N/screenHeightInPixels"," // {_z_} = N/screenWidthInPixels"," // {__w} = N/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt,"," //"," // Only used on FXAA Console."," // Not used on 360, but used on PS3 and PC."," // This must be from a constant/uniform."," // {x__} = -2.0/screenWidthInPixels"," // {_y_} = -2.0/screenHeightInPixels"," // {_z_} = 2.0/screenWidthInPixels"," // {__w} = 2.0/screenHeightInPixels"," FxaaFloat4 fxaaConsoleRcpFrameOpt2,"," //"," // Only used on FXAA Console."," // Only used on 360 in place of fxaaConsoleRcpFrameOpt2."," // This must be from a constant/uniform."," // {x__} = 8.0/screenWidthInPixels"," // {_y_} = 8.0/screenHeightInPixels"," // {_z_} = -4.0/screenWidthInPixels"," // {__w} = -4.0/screenHeightInPixels"," FxaaFloat4 fxaaConsole360RcpFrameOpt2,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_SUBPIX define."," // It is here now to allow easier tuning."," // Choose the amount of sub-pixel aliasing removal."," // This can effect sharpness."," // 1.00 - upper limit (softer)"," // 0.75 - default amount of filtering"," // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)"," // 0.25 - almost off"," // 0.00 - completely off"," FxaaFloat fxaaQualitySubpix,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // The minimum amount of local contrast required to apply algorithm."," // 0.333 - too little (faster)"," // 0.250 - low quality"," // 0.166 - default"," // 0.125 - high quality"," // 0.063 - overkill (slower)"," FxaaFloat fxaaQualityEdgeThreshold,"," //"," // Only used on FXAA Quality."," // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // 0.0833 - upper limit (default, the start of visible unfiltered edges)"," // 0.0625 - high quality (faster)"," // 0.0312 - visible limit (slower)"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaQualityEdgeThresholdMin,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3."," // Due to the PS3 being ALU bound,"," // there are only three safe values here: 2 and 4 and 8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // For all other platforms can be a non-power of two."," // 8.0 is sharper (default!!!)"," // 4.0 is softer"," // 2.0 is really soft (good only for vector graphics inputs)"," FxaaFloat fxaaConsoleEdgeSharpness,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define."," // It is here now to allow easier tuning."," // This does not effect PS3, as this needs to be compiled in."," // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3."," // Due to the PS3 being ALU bound,"," // there are only two safe values here: 1/4 and 1/8."," // These options use the shaders ability to a free *|/ by 2|4|8."," // The console setting has a different mapping than the quality setting."," // Other platforms can use other values."," // 0.125 leaves less aliasing, but is softer (default!!!)"," // 0.25 leaves more aliasing, and is sharper"," FxaaFloat fxaaConsoleEdgeThreshold,"," //"," // Only used on FXAA Console."," // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define."," // It is here now to allow easier tuning."," // Trims the algorithm from processing darks."," // The console setting has a different mapping than the quality setting."," // This only applies when FXAA_EARLY_EXIT is 1."," // This does not apply to PS3,"," // PS3 was simplified to avoid more shader instructions."," // 0.06 - faster but more aliasing in darks"," // 0.05 - default"," // 0.04 - slower and less aliasing in darks"," // Special notes when using FXAA_GREEN_AS_LUMA,"," // Likely want to set this to zero."," // As colors that are mostly not-green"," // will appear very dark in the green channel!"," // Tune by looking at mostly non-green content,"," // then start at zero and increase until aliasing is a problem."," FxaaFloat fxaaConsoleEdgeThresholdMin,"," //"," // Extra constants for 360 FXAA Console only."," // Use zeros or anything else for other platforms."," // These must be in physical constant registers and NOT immedates."," // Immedates will result in compiler un-optimizing."," // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)"," FxaaFloat4 fxaaConsole360ConstDir",") {","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posM;"," posM.x = pos.x;"," posM.y = pos.y;"," #if (FXAA_GATHER4_ALPHA == 1)"," #if (FXAA_DISCARD == 0)"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #endif"," #if (FXAA_GREEN_AS_LUMA == 0)"," FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));"," #else"," FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);"," FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));"," #endif"," #if (FXAA_DISCARD == 1)"," #define lumaM luma4A.w"," #endif"," #define lumaE luma4A.z"," #define lumaS luma4A.x"," #define lumaSE luma4A.y"," #define lumaNW luma4B.w"," #define lumaN luma4B.z"," #define lumaW luma4B.x"," #else"," FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);"," #if (FXAA_GREEN_AS_LUMA == 0)"," #define lumaM rgbyM.w"," #else"," #define lumaM rgbyM.y"," #endif"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));"," #endif"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat maxSM = max(lumaS, lumaM);"," FxaaFloat minSM = min(lumaS, lumaM);"," FxaaFloat maxESM = max(lumaE, maxSM);"," FxaaFloat minESM = min(lumaE, minSM);"," FxaaFloat maxWN = max(lumaN, lumaW);"," FxaaFloat minWN = min(lumaN, lumaW);"," FxaaFloat rangeMax = max(maxWN, maxESM);"," FxaaFloat rangeMin = min(minWN, minESM);"," FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;"," FxaaFloat range = rangeMax - rangeMin;"," FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);"," FxaaBool earlyExit = range < rangeMaxClamped;","/*--------------------------------------------------------------------------*/"," if(earlyExit)"," #if (FXAA_DISCARD == 1)"," FxaaDiscard;"," #else"," return rgbyM;"," #endif","/*--------------------------------------------------------------------------*/"," #if (FXAA_GATHER4_ALPHA == 0)"," #if (FXAA_GLSL_100 == 1)"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));"," #else"," FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif"," #else"," FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));"," FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));"," #endif","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNS = lumaN + lumaS;"," FxaaFloat lumaWE = lumaW + lumaE;"," FxaaFloat subpixRcpRange = 1.0/range;"," FxaaFloat subpixNSWE = lumaNS + lumaWE;"," FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;"," FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNESE = lumaNE + lumaSE;"," FxaaFloat lumaNWNE = lumaNW + lumaNE;"," FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;"," FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;","/*--------------------------------------------------------------------------*/"," FxaaFloat lumaNWSW = lumaNW + lumaSW;"," FxaaFloat lumaSWSE = lumaSW + lumaSE;"," FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);"," FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);"," FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;"," FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;"," FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;"," FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;","/*--------------------------------------------------------------------------*/"," FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;"," FxaaFloat lengthSign = fxaaQualityRcpFrame.x;"," FxaaBool horzSpan = edgeHorz >= edgeVert;"," FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;","/*--------------------------------------------------------------------------*/"," if(!horzSpan) lumaN = lumaW;"," if(!horzSpan) lumaS = lumaE;"," if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;"," FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;","/*--------------------------------------------------------------------------*/"," FxaaFloat gradientN = lumaN - lumaM;"," FxaaFloat gradientS = lumaS - lumaM;"," FxaaFloat lumaNN = lumaN + lumaM;"," FxaaFloat lumaSS = lumaS + lumaM;"," FxaaBool pairN = abs(gradientN) >= abs(gradientS);"," FxaaFloat gradient = max(abs(gradientN), abs(gradientS));"," if(pairN) lengthSign = -lengthSign;"," FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posB;"," posB.x = posM.x;"," posB.y = posM.y;"," FxaaFloat2 offNP;"," offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;"," offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;"," if(!horzSpan) posB.x += lengthSign * 0.5;"," if( horzSpan) posB.y += lengthSign * 0.5;","/*--------------------------------------------------------------------------*/"," FxaaFloat2 posN;"," posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;"," posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;"," FxaaFloat2 posP;"," posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;"," posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;"," FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;"," FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));"," FxaaFloat subpixE = subpixC * subpixC;"," FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));","/*--------------------------------------------------------------------------*/"," if(!pairN) lumaNN = lumaSS;"," FxaaFloat gradientScaled = gradient * 1.0/4.0;"," FxaaFloat lumaMM = lumaM - lumaNN * 0.5;"," FxaaFloat subpixF = subpixD * subpixE;"," FxaaBool lumaMLTZero = lumaMM < 0.0;","/*--------------------------------------------------------------------------*/"," lumaEndN -= lumaNN * 0.5;"," lumaEndP -= lumaNN * 0.5;"," FxaaBool doneN = abs(lumaEndN) >= gradientScaled;"," FxaaBool doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;"," FxaaBool doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;","/*--------------------------------------------------------------------------*/"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 3)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 4)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 5)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 6)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 7)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 8)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 9)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 10)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 11)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;","/*--------------------------------------------------------------------------*/"," #if (FXAA_QUALITY_PS > 12)"," if(doneNP) {"," if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));"," if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));"," if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;"," if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;"," doneN = abs(lumaEndN) >= gradientScaled;"," doneP = abs(lumaEndP) >= gradientScaled;"," if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;"," if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;"," doneNP = (!doneN) || (!doneP);"," if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;"," if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }"," #endif","/*--------------------------------------------------------------------------*/"," }","/*--------------------------------------------------------------------------*/"," FxaaFloat dstN = posM.x - posN.x;"," FxaaFloat dstP = posP.x - posM.x;"," if(!horzSpan) dstN = posM.y - posN.y;"," if(!horzSpan) dstP = posP.y - posM.y;","/*--------------------------------------------------------------------------*/"," FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;"," FxaaFloat spanLength = (dstP + dstN);"," FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;"," FxaaFloat spanLengthRcp = 1.0/spanLength;","/*--------------------------------------------------------------------------*/"," FxaaBool directionN = dstN < dstP;"," FxaaFloat dst = min(dstN, dstP);"," FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;"," FxaaFloat subpixG = subpixF * subpixF;"," FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;"," FxaaFloat subpixH = subpixG * fxaaQualitySubpix;","/*--------------------------------------------------------------------------*/"," FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;"," FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);"," if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;"," if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;"," #if (FXAA_DISCARD == 1)"," return FxaaTexTop(tex, posM);"," #else"," return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);"," #endif","}","/*==========================================================================*/","#endif","","void main() {"," gl_FragColor = FxaaPixelShader("," vUv,"," vec4(0.0),"," tDiffuse,"," tDiffuse,"," tDiffuse,"," resolution,"," vec4(0.0),"," vec4(0.0),"," vec4(0.0),"," 0.75,"," 0.166,"," 0.0833,"," 0.0,"," 0.0,"," 0.0,"," vec4(0.0)"," );",""," // TODO avoid querying texture twice for same texel"," gl_FragColor.a = texture2D(tDiffuse, vUv).a;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","gl_FragColor = LinearToGamma( tex, float( GAMMA_FACTOR ) );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},h:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float hh = h * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * hh, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * hh, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * hh, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * hh, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * hh, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},hue:{value:0},saturation:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float hue;","uniform float saturation;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D( tDiffuse, vUv );","float angle = hue * 3.14159265;","float s = sin(angle), c = cos(angle);","vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;","float len = length(gl_FragColor.rgb);","gl_FragColor.rgb = vec3(","dot(gl_FragColor.rgb, weights.xyz),","dot(gl_FragColor.rgb, weights.zxy),","dot(gl_FragColor.rgb, weights.yzx)",");","float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;","if (saturation > 0.0) {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));","} else {","gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);","}","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},sides:{value:6},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float sides;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 p = vUv - 0.5;","float r = length(p);","float a = atan(p.y, p.x) + angle;","float tau = 2. * 3.1416 ;","a = mod(a, tau/sides);","a = abs(a - tau/sides/2.) ;","p = r * vec2(cos(a), sin(a));","vec4 color = texture2D(tDiffuse, p + 0.5);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},side:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform int side;","varying vec2 vUv;","void main() {","vec2 p = vUv;","if (side == 0){","if (p.x > 0.5) p.x = 1.0 - p.x;","}else if (side == 1){","if (p.x < 0.5) p.x = 1.0 - p.x;","}else if (side == 2){","if (p.y < 0.5) p.y = 1.0 - p.y;","}else if (side == 3){","if (p.y > 0.5) p.y = 1.0 - p.y;","} ","vec4 color = texture2D(tDiffuse, p);","gl_FragColor = color;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));var n={uniforms:{heightMap:{value:null},resolution:{value:new a.Vector2(512,512)},scale:{value:new a.Vector2(1,1)},height:{value:.05}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float height;","uniform vec2 resolution;","uniform sampler2D heightMap;","varying vec2 vUv;","void main() {","float val = texture2D( heightMap, vUv ).x;","float valU = texture2D( heightMap, vUv + vec2( 1.0 / resolution.x, 0.0 ) ).x;","float valV = texture2D( heightMap, vUv + vec2( 0.0, 1.0 / resolution.y ) ).x;","gl_FragColor = vec4( ( 0.5 * normalize( vec3( val - valU, val - valV, height ) ) + 0.5 ), 1.0 );","}"].join("\n")};t.default=n},function(e,t,r){"use strict";var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0));a.ShaderLib.ocean_sim_vertex={vertexShader:["varying vec2 vUV;","void main (void) {","vUV = position.xy * 0.5 + 0.5;","gl_Position = vec4(position, 1.0 );","}"].join("\n")},a.ShaderLib.ocean_subtransform={uniforms:{u_input:{value:null},u_transformSize:{value:512},u_subtransformSize:{value:250}},fragmentShader:["precision highp float;","#include ","uniform sampler2D u_input;","uniform float u_transformSize;","uniform float u_subtransformSize;","varying vec2 vUV;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","void main (void) {","#ifdef HORIZONTAL","float index = vUV.x * u_transformSize - 0.5;","#else","float index = vUV.y * u_transformSize - 0.5;","#endif","float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);","#ifdef HORIZONTAL","vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;","#else","vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;","vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;","#endif","float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);","vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));","vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);","vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);","gl_FragColor = vec4(outputA, outputB);","}"].join("\n")},a.ShaderLib.ocean_initial_spectrum={uniforms:{u_wind:{value:new a.Vector2(10,10)},u_resolution:{value:512},u_size:{value:250}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","const float CM = 0.23;","uniform vec2 u_wind;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + pow2(k / KM)));","}","float tanh (float x) {","return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 K = (2.0 * PI * vec2(n, m)) / u_size;","float k = length(K);","float l_wind = length(u_wind);","float Omega = 0.84;","float kp = G * pow2(Omega / l_wind);","float c = omega(k) / k;","float cp = omega(kp) / kp;","float Lpm = exp(-1.25 * pow2(kp / k));","float gamma = 1.7;","float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));","float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));","float Jp = pow(gamma, Gamma);","float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));","float alphap = 0.006 * sqrt(Omega);","float Bl = 0.5 * alphap * cp / c * Fp;","float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);","float uStar = 0.41 * l_wind / log(10.0 / z0);","float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));","float Fm = exp(-0.25 * pow2(k / KM - 1.0));","float Bh = 0.5 * alpham * CM / c * Fm * Lpm;","float a0 = log(2.0) / 4.0;","float am = 0.13 * uStar / CM;","float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));","float cosPhi = dot(normalize(u_wind), normalize(K));","float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));","float dk = 2.0 * PI / u_size;","float h = sqrt(S / 2.0) * dk;","if (K.x == 0.0 && K.y == 0.0) {","h = 0.0;","}","gl_FragColor = vec4(h, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_phase={uniforms:{u_phases:{value:null},u_deltaTime:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform sampler2D u_phases;","uniform float u_deltaTime;","uniform float u_resolution;","uniform float u_size;","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","float deltaTime = 1.0 / 60.0;","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","float deltaPhase = omega(length(waveVector)) * u_deltaTime;","phase = mod(phase + deltaPhase, 2.0 * PI);","gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);","}"].join("\n")},a.ShaderLib.ocean_spectrum={uniforms:{u_size:{value:null},u_resolution:{value:null},u_choppiness:{value:null},u_phases:{value:null},u_initialSpectrum:{value:null}},fragmentShader:["precision highp float;","#include ","const float G = 9.81;","const float KM = 370.0;","varying vec2 vUV;","uniform float u_size;","uniform float u_resolution;","uniform float u_choppiness;","uniform sampler2D u_phases;","uniform sampler2D u_initialSpectrum;","vec2 multiplyComplex (vec2 a, vec2 b) {","return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);","}","vec2 multiplyByI (vec2 z) {","return vec2(-z[1], z[0]);","}","float omega (float k) {","return sqrt(G * k * (1.0 + k * k / KM * KM));","}","void main (void) {","vec2 coordinates = gl_FragCoord.xy - 0.5;","float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;","float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;","vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;","float phase = texture2D(u_phases, vUV).r;","vec2 phaseVector = vec2(cos(phase), sin(phase));","vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;","vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;","h0Star.y *= -1.0;","vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));","vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;","vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;","if (waveVector.x == 0.0 && waveVector.y == 0.0) {","h = vec2(0.0);","hX = vec2(0.0);","hZ = vec2(0.0);","}","gl_FragColor = vec4(hX + multiplyByI(h), hZ);","}"].join("\n")},a.ShaderLib.ocean_normals={uniforms:{u_displacementMap:{value:null},u_resolution:{value:null},u_size:{value:null}},fragmentShader:["precision highp float;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform float u_resolution;","uniform float u_size;","void main (void) {","float texel = 1.0 / u_resolution;","float texelSize = u_size / u_resolution;","vec3 center = texture2D(u_displacementMap, vUV).rgb;","vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;","vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;","vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;","vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;","vec3 topRight = cross(right, top);","vec3 topLeft = cross(top, left);","vec3 bottomLeft = cross(left, bottom);","vec3 bottomRight = cross(bottom, right);","gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);","}"].join("\n")},a.ShaderLib.ocean_main={uniforms:{u_displacementMap:{value:null},u_normalMap:{value:null},u_geometrySize:{value:null},u_size:{value:null},u_projectionMatrix:{value:null},u_viewMatrix:{value:null},u_cameraPosition:{value:null},u_skyColor:{value:null},u_oceanColor:{value:null},u_sunDirection:{value:null},u_exposure:{value:null}},vertexShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform mat4 u_projectionMatrix;","uniform mat4 u_viewMatrix;","uniform float u_size;","uniform float u_geometrySize;","uniform sampler2D u_displacementMap;","void main (void) {","vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);","vPos = newPos;","vUV = uv;","gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);","}"].join("\n"),fragmentShader:["precision highp float;","varying vec3 vPos;","varying vec2 vUV;","uniform sampler2D u_displacementMap;","uniform sampler2D u_normalMap;","uniform vec3 u_cameraPosition;","uniform vec3 u_oceanColor;","uniform vec3 u_skyColor;","uniform vec3 u_sunDirection;","uniform float u_exposure;","vec3 hdr (vec3 color, float exposure) {","return 1.0 - exp(-color * exposure);","}","void main (void) {","vec3 normal = texture2D(u_normalMap, vUV).rgb;","vec3 view = normalize(u_cameraPosition - vPos);","float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);","vec3 sky = fresnel * u_skyColor;","float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);","vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;","vec3 color = sky + water;","gl_FragColor = vec4(hdr(color, u_exposure), 1.0);","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={modes:{none:"NO_PARALLAX",basic:"USE_BASIC_PARALLAX",steep:"USE_STEEP_PARALLAX",occlusion:"USE_OCLUSION_PARALLAX",relief:"USE_RELIEF_PARALLAX"},uniforms:{bumpMap:{value:null},map:{value:null},parallaxScale:{value:null},parallaxMinLayers:{value:null},parallaxMaxLayers:{value:null}},vertexShader:["varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","void main() {","vUv = uv;","vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","vViewPosition = -mvPosition.xyz;","vNormal = normalize( normalMatrix * normal );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fragmentShader:["uniform sampler2D bumpMap;","uniform sampler2D map;","uniform float parallaxScale;","uniform float parallaxMinLayers;","uniform float parallaxMaxLayers;","varying vec2 vUv;","varying vec3 vViewPosition;","varying vec3 vNormal;","#ifdef USE_BASIC_PARALLAX","vec2 parallaxMap( in vec3 V ) {","float initialHeight = texture2D( bumpMap, vUv ).r;","vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;","return vUv - texCoordOffset;","}","#else","vec2 parallaxMap( in vec3 V ) {","float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );","float layerHeight = 1.0 / numLayers;","float currentLayerHeight = 0.0;","vec2 dtex = parallaxScale * V.xy / V.z / numLayers;","vec2 currentTextureCoords = vUv;","float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","for ( int i = 0; i < 30; i += 1 ) {","if ( heightFromTexture <= currentLayerHeight ) {","break;","}","currentLayerHeight += layerHeight;","currentTextureCoords -= dtex;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","}","#ifdef USE_STEEP_PARALLAX","return currentTextureCoords;","#elif defined( USE_RELIEF_PARALLAX )","vec2 deltaTexCoord = dtex / 2.0;","float deltaHeight = layerHeight / 2.0;","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","const int numSearches = 5;","for ( int i = 0; i < numSearches; i += 1 ) {","deltaTexCoord /= 2.0;","deltaHeight /= 2.0;","heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;","if( heightFromTexture > currentLayerHeight ) {","currentTextureCoords -= deltaTexCoord;","currentLayerHeight += deltaHeight;","} else {","currentTextureCoords += deltaTexCoord;","currentLayerHeight -= deltaHeight;","}","}","return currentTextureCoords;","#elif defined( USE_OCLUSION_PARALLAX )","vec2 prevTCoords = currentTextureCoords + dtex;","float nextH = heightFromTexture - currentLayerHeight;","float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;","float weight = nextH / ( nextH - prevH );","return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );","#else","return vUv;","#endif","}","#endif","vec2 perturbUv( vec3 surfPosition, vec3 surfNormal, vec3 viewPosition ) {","vec2 texDx = dFdx( vUv );","vec2 texDy = dFdy( vUv );","vec3 vSigmaX = dFdx( surfPosition );","vec3 vSigmaY = dFdy( surfPosition );","vec3 vR1 = cross( vSigmaY, surfNormal );","vec3 vR2 = cross( surfNormal, vSigmaX );","float fDet = dot( vSigmaX, vR1 );","vec2 vProjVscr = ( 1.0 / fDet ) * vec2( dot( vR1, viewPosition ), dot( vR2, viewPosition ) );","vec3 vProjVtex;","vProjVtex.xy = texDx * vProjVscr.x + texDy * vProjVscr.y;","vProjVtex.z = dot( surfNormal, viewPosition );","return parallaxMap( vProjVtex );","}","void main() {","vec2 mapUv = perturbUv( -vViewPosition, normalize( vNormal ), normalize( vViewPosition ) );","gl_FragColor = texture2D( map, mapUv );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:null},pixelSize:{value:1}},vertexShader:["varying highp vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float pixelSize;","uniform vec2 resolution;","varying highp vec2 vUv;","void main(){","vec2 dxy = pixelSize / resolution;","vec2 coord = dxy * floor( vUv / dxy );","gl_FragColor = texture2D(tDiffuse, coord);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:.005},angle:{value:0}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float amount;","uniform float angle;","varying vec2 vUv;","void main() {","vec2 offset = amount * vec2( cos(angle), sin(angle));","vec4 cr = texture2D(tDiffuse, vUv + offset);","vec4 cga = texture2D(tDiffuse, vUv);","vec4 cb = texture2D(tDiffuse, vUv - offset);","gl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},amount:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float amount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 color = texture2D( tDiffuse, vUv );","vec3 c = color.rgb;","color.r = dot( c, vec3( 1.0 - 0.607 * amount, 0.769 * amount, 0.189 * amount ) );","color.g = dot( c, vec3( 0.349 * amount, 1.0 - 0.314 * amount, 0.168 * amount ) );","color.b = dot( c, vec3( 0.272 * amount, 0.534 * amount, 1.0 - 0.869 * amount ) );","gl_FragColor = vec4( min( vec3( 1.0 ), color.rgb ), color.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},resolution:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","void main() {","vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );","const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );","const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );","float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;","float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1, 0 ) ).r;","float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1, 1 ) ).r;","float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2( 0, -1 ) ).r;","float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2( 0, 0 ) ).r;","float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2( 0, 1 ) ).r;","float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2( 1, -1 ) ).r;","float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2( 1, 0 ) ).r;","float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2( 1, 1 ) ).r;","float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ","Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ","Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ","float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ","Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ","Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ","float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );","gl_FragColor = vec4( vec3( G ), 1 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 tex = texture2D( tDiffuse, vec2( vUv.x, vUv.y ) );","vec4 newTex = vec4(tex.r, (tex.g + tex.b) * .5, (tex.g + tex.b) * .5, 1.0);","gl_FragColor = newTex;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{texture:{value:null},delta:{value:new(function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(0)).Vector2)(1,1)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include ","#define ITERATIONS 10.0","uniform sampler2D texture;","uniform vec2 delta;","varying vec2 vUv;","void main() {","vec4 color = vec4( 0.0 );","float total = 0.0;","float offset = rand( vUv );","for ( float t = -ITERATIONS; t <= ITERATIONS; t ++ ) {","float percent = ( t + offset - 0.5 ) / ITERATIONS;","float weight = 1.0 - abs( percent );","color += texture2D( texture, vUv + delta * percent ) * weight;","total += weight;","}","gl_FragColor = color / total;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},v:{value:1/512},r:{value:.35}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","uniform float r;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","float vv = v * abs( r - vUv.y );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * vv ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * vv ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * vv ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * vv ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * vv ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{tDiffuse:{value:null},offset:{value:1},darkness:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float offset;","uniform float darkness;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );","gl_FragColor = vec4( mix( texel.rgb, vec3( 1.0 - darkness ), dot( uv, uv ) ), texel.a );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a={uniforms:{color:{type:"c",value:null},time:{type:"f",value:0},tDiffuse:{type:"t",value:null},tDudv:{type:"t",value:null},textureMatrix:{type:"m4",value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec2 vUv;","varying vec4 vUvRefraction;","void main() {","\tvUv = uv;","\tvUvRefraction = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform float time;","uniform sampler2D tDiffuse;","uniform sampler2D tDudv;","varying vec2 vUv;","varying vec4 vUvRefraction;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ),blendOverlay( base.b, blend.b ) );","}","void main() {"," float waveStrength = 0.1;"," float waveSpeed = 0.03;","\tvec2 distortedUv = texture2D( tDudv, vec2( vUv.x + time * waveSpeed, vUv.y ) ).rg * waveStrength;","\tdistortedUv = vUv.xy + vec2( distortedUv.x, distortedUv.y + time * waveSpeed );","\tvec2 distortion = ( texture2D( tDudv, distortedUv ).rg * 2.0 - 1.0 ) * waveStrength;"," vec4 uv = vec4( vUvRefraction );"," uv.xy += distortion;","\tvec4 base = texture2DProj( tDiffuse, uv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Volume=void 0;var a,n=r(10),i=(a=n)&&a.__esModule?a:{default:a};t.Volume=i.default}]))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=r(5);Object.defineProperty(t,"CopyShader",{enumerable:!0,get:function(){return h(a).default}});var n=r(2);Object.defineProperty(t,"Pass",{enumerable:!0,get:function(){return h(n).default}});var i=r(6);Object.defineProperty(t,"ShaderPass",{enumerable:!0,get:function(){return h(i).default}});var o=r(15);Object.defineProperty(t,"RenderingPass",{enumerable:!0,get:function(){return h(o).default}});var s=r(16);Object.defineProperty(t,"TexturePass",{enumerable:!0,get:function(){return h(s).default}});var l=r(17);Object.defineProperty(t,"RenderPass",{enumerable:!0,get:function(){return h(l).default}});var u=r(7);Object.defineProperty(t,"MaskPass",{enumerable:!0,get:function(){return h(u).default}});var c=r(8);Object.defineProperty(t,"ClearMaskPass",{enumerable:!0,get:function(){return h(c).default}});var d=r(18);Object.defineProperty(t,"ClearPass",{enumerable:!0,get:function(){return h(d).default}});var f=r(19);function h(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"default",{enumerable:!0,get:function(){return h(f).default}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,n=function(){function e(e,t){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{tolerance:0};if(!e)throw new Error("You should specify the element you want to test");"string"==typeof e&&(e=document.querySelector(e));var r=e.getBoundingClientRect();return(r.bottom-t.tolerance>0&&r.right-t.tolerance>0&&r.left+t.tolerance<(window.innerWidth||document.documentElement.clientWidth)&&r.top+t.tolerance<(window.innerHeight||document.documentElement.clientHeight))}function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0,container:""};if(!e)throw new Error("You should specify the element you want to test");if("string"==typeof e&&(e=document.querySelector(e)),"string"==typeof t&&(t={tolerance:0,container:document.querySelector(t)}),"string"==typeof t.container&&(t.container=document.querySelector(t.container)),t instanceof HTMLElement&&(t={tolerance:0,container:t}),!t.container)throw new Error("You should specify a container element");var r=t.container.getBoundingClientRect();return(e.offsetTop+e.clientHeight-t.tolerance>t.container.scrollTop&&e.offsetLeft+e.clientWidth-t.tolerance>t.container.scrollLeft&&e.offsetLeft+t.tolerance0&&void 0!==arguments[0]?arguments[0]:{tolerance:0,debounce:100,container:window};this.options={},this.trackedElements={},Object.defineProperties(this.options,{container:{configurable:!1,enumerable:!1,get:function(){var e=void 0;return"string"==typeof n.container?e=document.querySelector(n.container):n.container instanceof HTMLElement&&(e=n.container),e||window},set:function(e){n.container=e}},debounce:{get:function(){return parseInt(n.debounce,10)||100},set:function(e){n.debounce=e}},tolerance:{get:function(){return parseInt(n.tolerance,10)||0},set:function(e){n.tolerance=e}}}),Object.defineProperty(this,"_scroll",{enumerable:!1,configurable:!1,writable:!1,value:this._debouncedScroll.call(this)}),e=document.querySelector("body"),t=function(){Object.keys(a.trackedElements).forEach((function(e){a.on("enter",e),a.on("leave",e)}))},(r=window.MutationObserver||window.WebKitMutationObserver)?new r(t).observe(e,{childList:!0,subtree:!0}):(e.addEventListener("DOMNodeInserted",t,!1),e.addEventListener("DOMNodeRemoved",t,!1)),this.attach()}return Object.defineProperties(r.prototype,{_debouncedScroll:{configurable:!1,writable:!1,enumerable:!1,value:function(){var r=this,a=void 0;return function(){clearTimeout(a),a=setTimeout((function(){!function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{tolerance:0},n=Object.keys(r),i=void 0;n.length&&(i=a.container===window?e:t,n.forEach((function(e){r[e].nodes.forEach((function(t){if(i(t.node,a)?(t.wasVisible=t.isVisible,t.isVisible=!0):(t.wasVisible=t.isVisible,t.isVisible=!1),!0===t.isVisible&&!1===t.wasVisible){if(!r[e].enter)return;Object.keys(r[e].enter).forEach((function(a){"function"==typeof r[e].enter[a]&&r[e].enter[a](t.node,"enter")}))}if(!1===t.isVisible&&!0===t.wasVisible){if(!r[e].leave)return;Object.keys(r[e].leave).forEach((function(a){"function"==typeof r[e].leave[a]&&r[e].leave[a](t.node,"leave")}))}}))})))}(r.trackedElements,r.options)}),r.options.debounce)}}},attach:{configurable:!1,writable:!1,enumerable:!1,value:function(){var e=this.options.container;e instanceof HTMLElement&&"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),e.addEventListener("scroll",this._scroll,{passive:!0}),window.addEventListener("resize",this._scroll,{passive:!0}),this._scroll(),this.attached=!0}},destroy:{configurable:!1,writable:!1,enumerable:!1,value:function(){this.options.container.removeEventListener("scroll",this._scroll),window.removeEventListener("resize",this._scroll),this.attached=!1}},off:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){var a=Object.keys(this.trackedElements[t].enter||{}),n=Object.keys(this.trackedElements[t].leave||{});if({}.hasOwnProperty.call(this.trackedElements,t))if(r){if(this.trackedElements[t][e]){var i="function"==typeof r?r.name:r;delete this.trackedElements[t][e][i]}}else delete this.trackedElements[t][e];a.length||n.length||delete this.trackedElements[t]}},on:{configurable:!1,writable:!1,enumerable:!1,value:function(e,t,r){if(!e)throw new Error("No event given. Choose either enter or leave");if(!t)throw new Error("No selector to track");if(["enter","leave"].indexOf(e)<0)throw new Error(e+" event is not supported");({}).hasOwnProperty.call(this.trackedElements,t)||(this.trackedElements[t]={}),this.trackedElements[t].nodes=[];for(var a=0,n=document.querySelectorAll(t);a=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}).call(this,r(20))},function(e,t,r){"use strict";var a=r(0);function n(e,t){var r,n,i,o,s;this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new a.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:a.MOUSE.LEFT,ZOOM:a.MOUSE.MIDDLE,PAN:a.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return m.phi},this.getAzimuthalAngle=function(){return m.theta},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(u),l.update(),h=f.NONE},this.update=(r=new a.Vector3,n=(new a.Quaternion).setFromUnitVectors(e.up,new a.Vector3(0,1,0)),i=n.clone().inverse(),o=new a.Vector3,s=new a.Quaternion,function(){var e=l.object.position;return r.copy(e).sub(l.target),r.applyQuaternion(n),m.setFromVector3(r),l.autoRotate&&h===f.NONE&&L(2*Math.PI/60/60*l.autoRotateSpeed),m.theta+=v.theta,m.phi+=v.phi,m.theta=Math.max(l.minAzimuthAngle,Math.min(l.maxAzimuthAngle,m.theta)),m.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,m.phi)),m.makeSafe(),m.radius*=g,m.radius=Math.max(l.minDistance,Math.min(l.maxDistance,m.radius)),l.target.add(y),r.setFromSpherical(m),r.applyQuaternion(i),e.copy(l.target).add(r),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor):v.set(0,0,0),g=1,y.set(0,0,0),!!(x||o.distanceToSquared(l.object.position)>p||8*(1-s.dot(l.object.quaternion))>p)&&(l.dispatchEvent(u),o.copy(l.object.position),s.copy(l.object.quaternion),x=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",Y,!1),l.domElement.removeEventListener("mousedown",k,!1),l.domElement.removeEventListener("wheel",V,!1),l.domElement.removeEventListener("touchstart",z,!1),l.domElement.removeEventListener("touchend",H,!1),l.domElement.removeEventListener("touchmove",X,!1),document.removeEventListener("mousemove",B,!1),document.removeEventListener("mouseup",j,!1),window.removeEventListener("keydown",G,!1)};var l=this,u={type:"change"},c={type:"start"},d={type:"end"},f={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},h=f.NONE,p=1e-6,m=new a.Spherical,v=new a.Spherical,g=1,y=new a.Vector3,x=!1,b=new a.Vector2,w=new a.Vector2,A=new a.Vector2,M=new a.Vector2,T=new a.Vector2,S=new a.Vector2,E=new a.Vector2,_=new a.Vector2,F=new a.Vector2;function P(){return Math.pow(.95,l.zoomSpeed)}function L(e){v.theta-=e}function C(e){v.phi-=e}var O,N=(O=new a.Vector3,function(e,t){O.setFromMatrixColumn(t,0),O.multiplyScalar(-e),y.add(O)}),I=function(){var e=new a.Vector3;return function(t,r){e.setFromMatrixColumn(r,1),e.multiplyScalar(t),y.add(e)}}(),R=function(){var e=new a.Vector3;return function(t,r){var n=l.domElement===document?l.domElement.body:l.domElement;if(l.object instanceof a.PerspectiveCamera){var i=l.object.position;e.copy(i).sub(l.target);var o=e.length();o*=Math.tan(l.object.fov/2*Math.PI/180),N(2*t*o/n.clientHeight,l.object.matrix),I(2*r*o/n.clientHeight,l.object.matrix)}else l.object instanceof a.OrthographicCamera?(N(t*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),I(r*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function U(e){l.object instanceof a.PerspectiveCamera?g/=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function D(e){l.object instanceof a.PerspectiveCamera?g*=e:l.object instanceof a.OrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/e)),l.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function k(e){if(!1!==l.enabled){switch(e.preventDefault(),e.button){case l.mouseButtons.ORBIT:if(!1===l.enableRotate)return;!function(e){b.set(e.clientX,e.clientY)}(e),h=f.ROTATE;break;case l.mouseButtons.ZOOM:if(!1===l.enableZoom)return;!function(e){E.set(e.clientX,e.clientY)}(e),h=f.DOLLY;break;case l.mouseButtons.PAN:if(!1===l.enablePan)return;!function(e){M.set(e.clientX,e.clientY)}(e),h=f.PAN}h!==f.NONE&&(document.addEventListener("mousemove",B,!1),document.addEventListener("mouseup",j,!1),l.dispatchEvent(c))}}function B(e){if(!1!==l.enabled)switch(e.preventDefault(),h){case f.ROTATE:if(!1===l.enableRotate)return;!function(e){w.set(e.clientX,e.clientY),A.subVectors(w,b);var t=l.domElement===document?l.domElement.body:l.domElement;L(2*Math.PI*A.x/t.clientWidth*l.rotateSpeed),C(2*Math.PI*A.y/t.clientHeight*l.rotateSpeed),b.copy(w),l.update()}(e);break;case f.DOLLY:if(!1===l.enableZoom)return;!function(e){_.set(e.clientX,e.clientY),F.subVectors(_,E),F.y>0?U(P()):F.y<0&&D(P()),E.copy(_),l.update()}(e);break;case f.PAN:if(!1===l.enablePan)return;!function(e){T.set(e.clientX,e.clientY),S.subVectors(T,M),R(S.x,S.y),M.copy(T),l.update()}(e)}}function j(e){!1!==l.enabled&&(document.removeEventListener("mousemove",B,!1),document.removeEventListener("mouseup",j,!1),l.dispatchEvent(d),h=f.NONE)}function V(e){!1===l.enabled||!1===l.enableZoom||h!==f.NONE&&h!==f.ROTATE||(e.preventDefault(),e.stopPropagation(),function(e){e.deltaY<0?D(P()):e.deltaY>0&&U(P()),l.update()}(e),l.dispatchEvent(c),l.dispatchEvent(d))}function G(e){!1!==l.enabled&&!1!==l.enableKeys&&!1!==l.enablePan&&function(e){switch(e.keyCode){case l.keys.UP:R(0,l.keyPanSpeed),l.update();break;case l.keys.BOTTOM:R(0,-l.keyPanSpeed),l.update();break;case l.keys.LEFT:R(l.keyPanSpeed,0),l.update();break;case l.keys.RIGHT:R(-l.keyPanSpeed,0),l.update()}}(e)}function z(e){if(!1!==l.enabled){switch(e.touches.length){case 1:if(!1===l.enableRotate)return;!function(e){b.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=f.TOUCH_ROTATE;break;case 2:if(!1===l.enableZoom)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);E.set(0,a)}(e),h=f.TOUCH_DOLLY;break;case 3:if(!1===l.enablePan)return;!function(e){M.set(e.touches[0].pageX,e.touches[0].pageY)}(e),h=f.TOUCH_PAN;break;default:h=f.NONE}h!==f.NONE&&l.dispatchEvent(c)}}function X(e){if(!1!==l.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===l.enableRotate)return;if(h!==f.TOUCH_ROTATE)return;!function(e){w.set(e.touches[0].pageX,e.touches[0].pageY),A.subVectors(w,b);var t=l.domElement===document?l.domElement.body:l.domElement;L(2*Math.PI*A.x/t.clientWidth*l.rotateSpeed),C(2*Math.PI*A.y/t.clientHeight*l.rotateSpeed),b.copy(w),l.update()}(e);break;case 2:if(!1===l.enableZoom)return;if(h!==f.TOUCH_DOLLY)return;!function(e){var t=e.touches[0].pageX-e.touches[1].pageX,r=e.touches[0].pageY-e.touches[1].pageY,a=Math.sqrt(t*t+r*r);_.set(0,a),F.subVectors(_,E),F.y>0?D(P()):F.y<0&&U(P()),E.copy(_),l.update()}(e);break;case 3:if(!1===l.enablePan)return;if(h!==f.TOUCH_PAN)return;!function(e){T.set(e.touches[0].pageX,e.touches[0].pageY),S.subVectors(T,M),R(S.x,S.y),M.copy(T),l.update()}(e);break;default:h=f.NONE}}function H(e){!1!==l.enabled&&(l.dispatchEvent(d),h=f.NONE)}function Y(e){!1!==l.enabled&&e.preventDefault()}l.domElement.addEventListener("contextmenu",Y,!1),l.domElement.addEventListener("mousedown",k,!1),l.domElement.addEventListener("wheel",V,!1),l.domElement.addEventListener("touchstart",z,!1),l.domElement.addEventListener("touchend",H,!1),l.domElement.addEventListener("touchmove",X,!1),window.addEventListener("keydown",G,!1),this.update()}n.prototype=Object.create(a.EventDispatcher.prototype),n.prototype.constructor=n,Object.defineProperties(n.prototype,{center:{get:function(){return console.warn("OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.enableDamping},set:function(e){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor},set:function(e){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.dampingFactor=e}}});var i=r(3),o=r(4),s=r.n(o),l=r(9),u=r.n(l),c=r(10);r(11)("minerender");r.d(t,"a",(function(){return f}));const d={showAxes:!1,showGrid:!1,autoResize:!1,controls:{enabled:!0,zoom:!0,rotate:!0,pan:!0,keys:!0},camera:{type:"perspective",x:20,y:35,z:20,target:[0,0,0]},canvas:{width:void 0,height:void 0},pauseHidden:!0,forceContext:!1,sendStats:!0};class f{constructor(e,t,r){this.element=r||document.body,this.options=Object.assign({},d,t,e),this.renderType="_Base_"}toImage(e,t){if(t||(t="image/png"),this._renderer){if(e){let e=document.createElement("canvas"),r=e.getContext("2d");return e.width=this._renderer.domElement.width,e.height=this._renderer.domElement.height,r.drawImage(this._renderer.domElement,0,0),function(e){let t,r,a,n=e.getContext("2d"),i=document.createElement("canvas").getContext("2d"),o=n.getImageData(0,0,e.width,e.height),s=o.data.length,l={top:null,left:null,right:null,bottom:null};for(t=0;t{if(this._scene){(new i.GLTFExporter).parse(this._scene,e=>{t(e)},e)}else r()})}toPLY(e){if(this._scene){return(new i.PLYExporter).parse(this._scene,e)}}initScene(e,t){let r=this;if(console.log(" "),console.log("%c ","font-size: 100px; background: url(https://minerender.org/img/minerender.svg) no-repeat;"),console.log("MineRender/"+(r.renderType||r.constructor.name)+"/1.4.7"),console.log("PRODUCTION build"),console.log("Built @ 2021-02-01T16:31:09.617Z"),console.log(" "),r.options.sendStats){let e,t=!1;try{t=window.self!==window.top}catch(e){return!0}try{e=new URL(t?document.referrer:window.location).hostname}catch(e){console.warn("Failed to get hostname")}c.post({url:"https://minerender.org/stats.php",data:{action:"init",type:r.renderType,host:e,source:t?"iframe":"javascript"}})}let l,d=new a.Scene;r._scene=d,l="orthographic"===r.options.camera.type?new a.OrthographicCamera((r.options.canvas.width||window.innerWidth)/-2,(r.options.canvas.width||window.innerWidth)/2,(r.options.canvas.height||window.innerHeight)/2,(r.options.canvas.height||window.innerHeight)/-2,1,1e3):new a.PerspectiveCamera(75,(r.options.canvas.width||window.innerWidth)/(r.options.canvas.height||window.innerHeight),5,1e3),r._camera=l,r.options.camera.zoom&&(l.zoom=r.options.camera.zoom);let f=new a.WebGLRenderer({alpha:!0,antialias:!0,preserveDrawingBuffer:!0});r._renderer=f,f.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),f.setClearColor(0,0),f.setPixelRatio(window.devicePixelRatio),f.shadowMap.enabled=!0,f.shadowMap.type=a.PCFSoftShadowMap,r.element.appendChild(r._canvas=f.domElement);let h=new s.a(f);h.setSize(r.options.canvas.width||window.innerWidth,r.options.canvas.height||window.innerHeight),r._composer=h;let p=new i.SSAARenderPass(d,l);p.unbiased=!0,h.addPass(p);let m=new o.ShaderPass(o.CopyShader);m.renderToScreen=!0,h.addPass(m),r.options.autoResize&&(r._resizeListener=function(){let e=r.element&&r.element!==document.body?r.element.offsetWidth:window.innerWidth,t=r.element&&r.element!==document.body?r.element.offsetHeight:window.innerHeight;r._resize(e,t)},window.addEventListener("resize",r._resizeListener)),r._resize=function(e,t){"orthographic"===r.options.camera.type?(l.left=e/-2,l.right=e/2,l.top=t/2,l.bottom=t/-2):l.aspect=e/t,l.updateProjectionMatrix(),f.setSize(e,t),h.setSize(e,t)},r.options.showAxes&&d.add(new a.AxesHelper(50)),r.options.showGrid&&d.add(new a.GridHelper(100,100));let v=new a.AmbientLight(16777215);d.add(v);let g=new n(l,f.domElement);r._controls=g,g.enableZoom=r.options.controls.zoom,g.enableRotate=r.options.controls.rotate,g.enablePan=r.options.controls.pan,g.enableKeys=r.options.controls.keys,g.target.set(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]),l.position.x=r.options.camera.x,l.position.y=r.options.camera.y,l.position.z=r.options.camera.z,l.lookAt(new a.Vector3(r.options.camera.target[0],r.options.camera.target[1],r.options.camera.target[2]));let y=function(){r._animId=requestAnimationFrame(y),r.onScreen&&("function"==typeof e&&e(),h.render())};r._animate=y,t||y(),r.onScreen=!0;let x="minerender-canvas-"+r._scene.uuid+"-"+Date.now();if(r._canvas.id=x,r.options.pauseHidden){r.onScreen=!1;let e=new u.a;r._onScreenObserver=e,e.on("enter","#"+x,(e,t)=>{r.onScreen=!0,r.options.forceContext&&r._renderer.forceContextRestore()}),e.on("leave","#"+x,(e,t)=>{r.onScreen=!1,r.options.forceContext&&r._renderer.forceContextLoss()})}}addToScene(e){let t=this;t._scene&&e&&(e.userData.renderType=t.renderType,t._scene.add(e))}clearScene(e,t){if(e||t)for(let r=this._scene.children.length-1;r>=0;r--){let a=this._scene.children[r];if(t){if(t(a))continue}e&&a.userData.renderType!==this.renderType||(h(a,!0),this._scene.remove(a))}else for(;this._scene.children.length>0;)this._scene.remove(this._scene.children[0])}dispose(){cancelAnimationFrame(this._animId),this._onScreenObserver&&this._onScreenObserver.destroy(),this.clearScene(),this._canvas.remove();let e=this.element;for(;e.firstChild;)e.removeChild(e.firstChild);this.options.autoResize&&window.removeEventListener("resize",this._resizeListener)}}function h(e,t){if(e&&(e.geometry&&e.geometry.dispose&&e.geometry.dispose(),e.material&&e.material.dispose&&e.material.dispose(),e.texture&&e.texture.dispose&&e.texture.dispose(),e.children)){let r=e.children;for(let e=0;e=0;t--)e.remove(r[t])}}},function(e,t,r){"use strict";r.r(t),function(e){var a=r(0),n=r(1),i=r(12);let o={camera:{type:"perspective",x:20,y:35,z:20,target:[0,18,0]},makeNonTransparentOpaque:!0};class s extends i.a{constructor(e,t){super(e,o,t),this.renderType="SkinRender",this._animId=-1,this.element.skinRender=this,this.attached=!1}render(e,t){let r=this,i=!1,o=(o,s)=>{i=!0,o.needsUpdate=!0,s&&(s.needsUpdate=!0);let c=-1;32===o.image.height?c=0:64===o.image.height?c=1:console.error("Couldn't detect texture version. Invalid dimensions: "+o.image.width+"x"+o.image.height),console.log("Skin Texture Version: "+c),o.magFilter=a.NearestFilter,o.minFilter=a.NearestFilter,o.anisotropy=0,s&&(s.magFilter=a.NearestFilter,s.minFilter=a.NearestFilter,s.anisotropy=0,s.format=a.RGBFormat),32===o.image.height&&(o.format=a.RGBFormat),r.attached||r._scene?console.log("[SkinRender] is attached - skipping scene init"):super.initScene((function(){r.element.dispatchEvent(new CustomEvent("skinRender",{detail:{playerModel:r.playerModel}}))})),console.log("Slim: "+d);let f=function(e,t,r,i,o){console.log("capeType: "+o);let s=new a.Object3D;s.name="headGroup",s.position.x=0,s.position.y=28,s.position.z=0,s.translateOnAxis(new a.Vector3(0,1,0),-4);let c=l(e,8,8,8,n.a.head[r],i,"head");if(c.translateOnAxis(new a.Vector3(0,1,0),4),s.add(c),r>=1){let t=l(e,8.504,8.504,8.504,n.a.hat,i,"hat",!0);t.translateOnAxis(new a.Vector3(0,1,0),4),s.add(t)}let d=new a.Object3D;d.name="bodyGroup",d.position.x=0,d.position.y=18,d.position.z=0;let f=l(e,8,12,4,n.a.body[r],i,"body");if(d.add(f),r>=1){let t=l(e,8.504,12.504,4.504,n.a.jacket,i,"jacket",!0);d.add(t)}let h=new a.Object3D;h.name="leftArmGroup",h.position.x=i?-5.5:-6,h.position.y=18,h.position.z=0,h.translateOnAxis(new a.Vector3(0,1,0),4);let p=l(e,i?3:4,12,4,n.a.leftArm[r],i,"leftArm");if(p.translateOnAxis(new a.Vector3(0,1,0),-4),h.add(p),r>=1){let t=l(e,i?3.504:4.504,12.504,4.504,n.a.leftSleeve,i,"leftSleeve",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),h.add(t)}let m=new a.Object3D;m.name="rightArmGroup",m.position.x=i?5.5:6,m.position.y=18,m.position.z=0,m.translateOnAxis(new a.Vector3(0,1,0),4);let v=l(e,i?3:4,12,4,n.a.rightArm[r],i,"rightArm");if(v.translateOnAxis(new a.Vector3(0,1,0),-4),m.add(v),r>=1){let t=l(e,i?3.504:4.504,12.504,4.504,n.a.rightSleeve,i,"rightSleeve",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),m.add(t)}let g=new a.Object3D;g.name="leftLegGroup",g.position.x=-2,g.position.y=6,g.position.z=0,g.translateOnAxis(new a.Vector3(0,1,0),4);let y=l(e,4,12,4,n.a.leftLeg[r],i,"leftLeg");if(y.translateOnAxis(new a.Vector3(0,1,0),-4),g.add(y),r>=1){let t=l(e,4.504,12.504,4.504,n.a.leftTrousers,i,"leftTrousers",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),g.add(t)}let x=new a.Object3D;x.name="rightLegGroup",x.position.x=2,x.position.y=6,x.position.z=0,x.translateOnAxis(new a.Vector3(0,1,0),4);let b=l(e,4,12,4,n.a.rightLeg[r],i,"rightLeg");if(b.translateOnAxis(new a.Vector3(0,1,0),-4),x.add(b),r>=1){let t=l(e,4.504,12.504,4.504,n.a.rightTrousers,i,"rightTrousers",!0);t.translateOnAxis(new a.Vector3(0,1,0),-4),x.add(t)}let w=new a.Object3D;if(w.add(s),w.add(d),w.add(h),w.add(m),w.add(g),w.add(x),t){console.log(n.a);let e=n.a.capeRelative;"optifine"===o&&(e=n.a.capeOptifineRelative),"labymod"===o&&(e=n.a.capeLabymodRelative),e=JSON.parse(JSON.stringify(e)),console.log(e);for(let r in e)e[r].x*=t.image.width,e[r].w*=t.image.width,e[r].y*=t.image.height,e[r].h*=t.image.height;console.log(e);let r=new a.Object3D;r.name="capeGroup",r.position.x=0,r.position.y=16,r.position.z=-2.5,r.translateOnAxis(new a.Vector3(0,1,0),8),r.translateOnAxis(new a.Vector3(0,0,1),.5);let i=l(t,10,16,1,e,!1,"cape");i.rotation.x=u(10),i.translateOnAxis(new a.Vector3(0,1,0),-8),i.translateOnAxis(new a.Vector3(0,0,1),-.5),i.rotation.y=u(180),r.add(i),w.add(r)}return w}(o,s,c,d,e._capeType?e._capeType:e.optifine?"optifine":"minecraft");r.addToScene(f),r.playerModel=f,"function"==typeof t&&t()};r._skinImage=new Image,r._skinImage.crossOrigin="anonymous",r._capeImage=new Image,r._capeImage.crossOrigin="anonymous";let s=void 0!==e.cape||void 0!==e.capeUrl||void 0!==e.capeData||void 0!==e.mineskin,d=!1,f=!1,h=!1,p=new a.Texture,m=new a.Texture;if(p.image=r._skinImage,r._skinImage.onload=function(){if(r._skinImage){if(f=!0,console.log("Skin Image Loaded"),void 0===e.slim&&32!==r._skinImage.height){let e=document.createElement("canvas"),t=e.getContext("2d");e.width=r._skinImage.width,e.height=r._skinImage.height,t.drawImage(r._skinImage,0,0),console.log("Slim Detection:");let a=t.getImageData(46,52,1,12).data,n=t.getImageData(54,20,1,12).data,i=!0;for(let e=3;e<48;e+=4){if(255===a[e]){i=!1;break}if(255===n[e]){i=!1;break}}console.log(i),i&&(d=!0)}if(r.options.makeNonTransparentOpaque&&32!==r._skinImage.height){let e=document.createElement("canvas"),n=e.getContext("2d");e.width=r._skinImage.width,e.height=r._skinImage.height,n.drawImage(r._skinImage,0,0);let i=document.createElement("canvas"),o=i.getContext("2d");i.width=r._skinImage.width,i.height=r._skinImage.height;let s=n.getImageData(0,0,e.width,e.height),l=s.data;function t(e,t){return e>0&&t>0&&e<32&&t<32||(e>32&&t>16&&e<64&&t<32||e>16&&t>48&&e<48&&t<64)}for(let r=0;r178||t(n,i))&&(l[r+3]=255)}o.putImageData(s,0,0),console.log(i.toDataURL()),p=new a.CanvasTexture(i)}!f||!h&&s||i||o(p,m)}},r._skinImage.onerror=function(e){console.warn("Skin Image Error"),console.warn(e)},console.log("Has Cape: "+s),s?(m.image=r._capeImage,r._capeImage.onload=function(){r._capeImage&&(h=!0,console.log("Cape Image Loaded"),h&&f&&(i||o(p,m)))},r._capeImage.onerror=function(e){console.warn("Cape Image Error"),console.warn(e),h=!0,f&&(i||o(p))}):(m=null,r._capeImage=null),"string"==typeof e)0===e.indexOf("http")?r._skinImage.src=e:e.length<=16?c("https://minerender.org/nameToUuid.php?name="+e,(function(t,a){if(t)return console.log(t);console.log(a),r._skinImage.src="https://crafatar.com/skins/"+(a.id?a.id:e)})):e.length<=36?image.src="https://crafatar.com/skins/"+e+"?overlay":r._skinImage.src=e;else{if("object"!=typeof e)throw new Error("Invalid texture value");if(e.url?r._skinImage.src=e.url:e.data?r._skinImage.src=e.data:e.username?c("https://minerender.org/nameToUuid.php?name="+e.username,(function(t,a){if(t)return console.log(t);r._skinImage.src="https://crafatar.com/skins/"+(a.id?a.id:e.username)+"?overlay"})):e.uuid?r._skinImage.src="https://crafatar.com/skins/"+e.uuid+"?overlay":e.mineskin&&(r._skinImage.src="https://api.mineskin.org/render/texture/"+e.mineskin),e.cape)if(e.cape.length>36){c(e.cape.startsWith("http")?e.cape:"https://api.capes.dev/get/"+e.cape,(function(t,a){if(t)return console.log(t);a.exists&&(e._capeType=a.type,r._capeImage.src=a.imageUrls.base.full)}))}else{let t="https://api.capes.dev/load/";e.capeUser?t+=e.capeUser:e.username?t+=e.username:e.uuid?t+=e.uuid:console.warn("Couldn't find a user to get a cape from"),c(t+="/"+e.cape,(function(t,a){if(t)return console.log(t);a.exists&&(e._capeType=a.type,r._capeImage.src=a.imageUrls.base.full)}))}else e.capeUrl?r._capeImage.src=e.capeUrl:e.capeData?r._capeImage.src=e.capeData:e.mineskin&&(r._capeImage.src="https://api.mineskin.org/render/texture/"+e.mineskin+"/cape");d=e.slim}}resize(e,t){return this._resize(e,t)}reset(){this._skinImage=null,this._capeImage=null,this._animId&&cancelAnimationFrame(this._animId),this._canvas&&this._canvas.remove()}getPlayerModel(){return this.playerModel}getModelByName(e){return this._scene.getObjectByName(e,!0)}toggleSkinPart(e,t){this._scene.getObjectByName(e,!0).visible=t}}function l(e,t,r,n,i,o,s,l){let u=e.image.width,c=e.image.height,d=new a.BoxGeometry(t,r,n),f=new a.MeshBasicMaterial({map:e,transparent:l||!1,alphaTest:.1,side:l?a.DoubleSide:a.FrontSide});d.computeBoundingBox(),d.faceVertexUvs[0]=[];let h=["right","left","top","bottom","front","back"],p=[];for(let e=0;e0&&void 0!==arguments[0]?arguments[0]:this.clock.getDelta(),t=this.renderer.getRenderTarget(),r=!1,a=void 0,n=void 0,i=this.passes.length;for(n=0;n1)for(var r=1;r0)return function(e){if((e=String(e)).length>100)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*n;case"minutes":case"minute":case"mins":case"min":case"m":return s*a;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}(e);if("number"===u&&!1===isNaN(e))return t.long?s(l=e,i,"day")||s(l,n,"hour")||s(l,a,"minute")||s(l,r,"second")||l+" ms":function(e){if(e>=i)return Math.round(e/i)+"d";if(e>=n)return Math.round(e/n)+"h";if(e>=a)return Math.round(e/a)+"m";if(e>=r)return Math.round(e/r)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}]); \ No newline at end of file diff --git a/package.json b/package.json index 3be1c926..556e1ca8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "minerender", - "version": "1.4.6", + "version": "1.4.7", "description": "", "main": "src/combined/index.js", "scripts": {