react-vr-pannellum
Version:
react VR全景图组件 超简单实用
40 lines (32 loc) • 1.36 MB
JavaScript
/*
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
* This devtool is neither made for production nor for readable output files.
* It uses "eval()" calls to create a separate source file in the browser devtools.
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
* or disable the default devtool with "devtool: false".
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
*/
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./index.js":
/*!******************!*\
!*** ./index.js ***!
\******************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _src_components_vr_pannellum__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/components/vr-pannellum */ \"./src/components/vr-pannellum/index.jsx\");\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_src_components_vr_pannellum__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack://react-vr-pannellum/./index.js?");
/***/ }),
/***/ "./public/app.js":
/*!***********************!*\
!*** ./public/app.js ***!
\***********************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/esm/slicedToArray.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom/client */ \"./node_modules/react-dom/client.js\");\n/* harmony import */ var _app_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./app.css */ \"./public/app.css\");\n/* harmony import */ var react_vr_pannellum__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-vr-pannellum */ \"./index.js\");\n\n\n // import Pannellum from \"../index\";\n\n\n\n\n\nfunction App() {\n var config = {\n autoRotate: 0,\n hfov: 60,\n minHfov: 10,\n maxHfov: 60\n };\n var scenes = {\n oneScene: {\n type: \"cubemap\",\n cubeMap: [\"https://krpano-pro.oss-accelerate.aliyuncs.com/static/resource/publish/krpano/1481085216446902274/quanjing/2205/40419783638860705/pano_f.jpg?x-oss-process=style/nocut_compress\", \"https://krpano-pro.oss-accelerate.aliyuncs.com/static/resource/publish/krpano/1481085216446902274/quanjing/2205/40419783638860705/pano_r.jpg?x-oss-process=style/nocut_compress\", \"https://krpano-pro.oss-accelerate.aliyuncs.com/static/resource/publish/krpano/1481085216446902274/quanjing/2205/40419783638860705/pano_b.jpg?x-oss-process=style/nocut_compress\", \"https://krpano-pro.oss-accelerate.aliyuncs.com/static/resource/publish/krpano/1481085216446902274/quanjing/2205/40419783638860705/pano_l.jpg?x-oss-process=style/nocut_compress\", \"https://krpano-pro.oss-accelerate.aliyuncs.com/static/resource/publish/krpano/1481085216446902274/quanjing/2205/40419783638860705/pano_u.jpg?x-oss-process=style/nocut_compress\", \"https://krpano-pro.oss-accelerate.aliyuncs.com/static/resource/publish/krpano/1481085216446902274/quanjing/2205/40419783638860705/pano_d.jpg?x-oss-process=style/nocut_compress\"]\n },\n twoScene: {\n type: \"cubemap\",\n cubeMap: [\"https://img.alicdn.com/imgextra/i4/O1CN014TNffn1nlaTfA98Fg_!!6000000005130-0-tps-1500-1500.jpg\", \"https://img.alicdn.com/imgextra/i3/O1CN01LsO1Bk20QbKpFTUQr_!!6000000006844-0-tps-1500-1500.jpg\", \"https://img.alicdn.com/imgextra/i1/O1CN01sS5m781ya6JgLSaVk_!!6000000006594-0-tps-1500-1500.jpg\", \"https://img.alicdn.com/imgextra/i3/O1CN01uTWCLc1XOCOuA92H0_!!6000000002913-0-tps-1500-1500.jpg\", \"https://img.alicdn.com/imgextra/i4/O1CN016lU3YJ1JdrJuFTcWt_!!6000000001052-0-tps-1500-1500.jpg\", \"https://img.alicdn.com/imgextra/i2/O1CN01nYe2Mn1ohkmBVyKpp_!!6000000005257-0-tps-1500-1500.jpg\"]\n },\n threeScene: {\n type: \"equirectangular\",\n panorama: \"https://pannellum.org/images/bma-1.jpg\"\n },\n fourScene: {\n type: \"equirectangular\",\n panorama: \"https://pannellum.org/images/tocopilla.jpg\"\n }\n };\n var hotSpots = [{\n pitch: -10,\n // 指定热点位置的俯仰部分\n yaw: 0,\n // 指定热点位置的偏航部分\n clickHandlerFunc: function clickHandlerFunc() {},\n // 热点被点击函数\n scale: false,\n // VR缩放时,热点是否自动缩放以匹配相对于VR的视野变化 默认为false\n sId: \"oneScene\",\n // 热点需要加载到那个场景下,必传\n text: \"热点自带Tooltip\" // 热点自带Tooltip,设置为空或不设置则不会显示\n\n }, {\n pitch: 20,\n // 指定热点水平方向偏移角度\n yaw: 0,\n // 指定热点垂直方向偏移角度\n cssClass: [\"campGate-hot\"],\n // 热点的class类名,设置样式, 默认是空数组, 如果传值了则会覆盖默认热点样式\n clickHandlerFunc: function clickHandlerFunc() {\n viewer.loadScene(\"twoScene\");\n },\n // 热点被点击函数\n sId: \"oneScene\" // 热点需要加载到那个场景下,必传\n\n }, {\n sId: \"twoScene\",\n // 热点需要加载到那个场景下,必传\n cssClass: [\"campGate-hot\"],\n clickHandlerFunc: function clickHandlerFunc() {\n viewer.loadScene(\"threeScene\");\n }\n }, {\n sId: \"threeScene\",\n cssClass: [\"campGate-hot\"],\n clickHandlerFunc: function clickHandlerFunc() {\n viewer.loadScene(\"fourScene\");\n }\n }, {\n sId: \"fourScene\",\n cssClass: [\"campGate-hot\"],\n clickHandlerFunc: function clickHandlerFunc() {\n viewer.loadScene(\"oneScene\");\n }\n }, {\n pitch: -20,\n yaw: 20,\n sId: \"fourScene\",\n text: \"第四个场景\"\n }];\n\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),\n _useState2 = (0,_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(_useState, 2),\n viewer = _useState2[0],\n setViewer = _useState2[1]; // viewer的实例\n\n\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_vr_pannellum__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n setViewer: setViewer,\n config: config,\n width: \"100%\",\n height: \"100vh\",\n firstSceneId: \"oneScene\",\n scenes: scenes,\n hotSpots: hotSpots,\n delayTime: 0\n }));\n}\n\nvar root = react_dom_client__WEBPACK_IMPORTED_MODULE_2__.createRoot(document.getElementById(\"root\"));\nroot.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement((react__WEBPACK_IMPORTED_MODULE_1___default().StrictMode), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(App, null)));\n\n//# sourceURL=webpack://react-vr-pannellum/./public/app.js?");
/***/ }),
/***/ "./src/components/source/pannellum.js":
/*!********************************************!*\
!*** ./src/components/source/pannellum.js ***!
\********************************************/
/***/ (() => {
eval("// Pannellum 2.5.6, https://github.com/mpetroff/pannellum\nwindow.libpannellum = function (E, g, p) {\n function Ba(K) {\n function ja(a, e) {\n return 1 == a.level && 1 != e.level ? -1 : 1 == e.level && 1 != a.level ? 1 : e.timestamp - a.timestamp;\n }\n\n function Q(a, e) {\n return a.level != e.level ? a.level - e.level : a.diff - e.diff;\n }\n\n function ka(a, e, c, g, l, h) {\n this.vertices = a;\n this.side = e;\n this.level = c;\n this.x = g;\n this.y = l;\n this.path = h.replace(\"%s\", e).replace(\"%l\", c).replace(\"%x\", g).replace(\"%y\", l);\n }\n\n function Ja(a, e, g, p, l) {\n var h;\n var d = e.vertices;\n h = la(a, d.slice(0, 3));\n var u = la(a, d.slice(3, 6)),\n x = la(a, d.slice(6, 9)),\n d = la(a, d.slice(9, 12)),\n t = h[0] + u[0] + x[0] + d[0];\n -4 == t || 4 == t ? h = !1 : (t = h[1] + u[1] + x[1] + d[1], h = -4 == t || 4 == t ? !1 : 4 != h[2] + u[2] + x[2] + d[2]);\n\n if (h) {\n h = e.vertices;\n u = h[0] + h[3] + h[6] + h[9];\n x = h[1] + h[4] + h[7] + h[10];\n d = h[2] + h[5] + h[8] + h[11];\n t = Math.sqrt(u * u + x * x + d * d);\n d = Math.asin(d / t);\n u = Math.atan2(x, u) - p;\n u += u > Math.PI ? -2 * Math.PI : u < -Math.PI ? 2 * Math.PI : 0;\n u = Math.abs(u);\n e.diff = Math.acos(Math.sin(g) * Math.sin(d) + Math.cos(g) * Math.cos(d) * Math.cos(u));\n u = !1;\n\n for (x = 0; x < c.nodeCache.length; x++) {\n if (c.nodeCache[x].path == e.path) {\n u = !0;\n c.nodeCache[x].timestamp = c.nodeCacheTimestamp++;\n c.nodeCache[x].diff = e.diff;\n c.currentNodes.push(c.nodeCache[x]);\n break;\n }\n }\n\n u || (e.timestamp = c.nodeCacheTimestamp++, c.currentNodes.push(e), c.nodeCache.push(e));\n\n if (e.level < c.level) {\n var d = m.cubeResolution * Math.pow(2, e.level - m.maxLevel),\n u = Math.ceil(d * m.invTileResolution) - 1,\n x = d % m.tileResolution * 2,\n k = 2 * d % m.tileResolution;\n 0 === k && (k = m.tileResolution);\n 0 === x && (x = 2 * m.tileResolution);\n t = 0.5;\n if (e.x == u || e.y == u) t = 1 - m.tileResolution / (m.tileResolution + k);\n var y = 1 - t,\n d = [],\n s = t,\n z = t,\n D = t,\n I = y,\n A = y,\n B = y;\n if (k < m.tileResolution) if (e.x == u && e.y != u) {\n if (A = z = 0.5, \"d\" == e.side || \"u\" == e.side) B = D = 0.5;\n } else e.x != u && e.y == u && (I = s = 0.5, \"l\" == e.side || \"r\" == e.side) && (B = D = 0.5);\n x <= m.tileResolution && (e.x == u && (s = 0, I = 1, \"l\" == e.side || \"r\" == e.side) && (D = 0, B = 1), e.y == u && (z = 0, A = 1, \"d\" == e.side || \"u\" == e.side) && (D = 0, B = 1));\n k = [h[0], h[1], h[2], h[0] * s + h[3] * I, h[1] * t + h[4] * y, h[2] * D + h[5] * B, h[0] * s + h[6] * I, h[1] * z + h[7] * A, h[2] * D + h[8] * B, h[0] * t + h[9] * y, h[1] * z + h[10] * A, h[2] * D + h[11] * B];\n k = new ka(k, e.side, e.level + 1, 2 * e.x, 2 * e.y, m.fullpath);\n d.push(k);\n e.x == u && x <= m.tileResolution || (k = [h[0] * s + h[3] * I, h[1] * t + h[4] * y, h[2] * D + h[5] * B, h[3], h[4], h[5], h[3] * t + h[6] * y, h[4] * z + h[7] * A, h[5] * D + h[8] * B, h[0] * s + h[6] * I, h[1] * z + h[7] * A, h[2] * D + h[8] * B], k = new ka(k, e.side, e.level + 1, 2 * e.x + 1, 2 * e.y, m.fullpath), d.push(k));\n e.x == u && x <= m.tileResolution || e.y == u && x <= m.tileResolution || (k = [h[0] * s + h[6] * I, h[1] * z + h[7] * A, h[2] * D + h[8] * B, h[3] * t + h[6] * y, h[4] * z + h[7] * A, h[5] * D + h[8] * B, h[6], h[7], h[8], h[9] * s + h[6] * I, h[10] * t + h[7] * y, h[11] * D + h[8] * B], k = new ka(k, e.side, e.level + 1, 2 * e.x + 1, 2 * e.y + 1, m.fullpath), d.push(k));\n e.y == u && x <= m.tileResolution || (k = [h[0] * t + h[9] * y, h[1] * z + h[10] * A, h[2] * D + h[11] * B, h[0] * s + h[6] * I, h[1] * z + h[7] * A, h[2] * D + h[8] * B, h[9] * s + h[6] * I, h[10] * t + h[7] * y, h[11] * D + h[8] * B, h[9], h[10], h[11]], k = new ka(k, e.side, e.level + 1, 2 * e.x, 2 * e.y + 1, m.fullpath), d.push(k));\n\n for (e = 0; e < d.length; e++) {\n Ja(a, d[e], g, p, l);\n }\n }\n }\n }\n\n function ta() {\n return [-1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, -1, 1, 1, 1, 1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, -1, -1, 1, 1, 1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1];\n }\n\n function ua(a, e, c) {\n var g = Math.sin(e);\n e = Math.cos(e);\n if (\"x\" == c) return [a[0], e * a[1] + g * a[2], e * a[2] - g * a[1], a[3], e * a[4] + g * a[5], e * a[5] - g * a[4], a[6], e * a[7] + g * a[8], e * a[8] - g * a[7]];\n if (\"y\" == c) return [e * a[0] - g * a[2], a[1], e * a[2] + g * a[0], e * a[3] - g * a[5], a[4], e * a[5] + g * a[3], e * a[6] - g * a[8], a[7], e * a[8] + g * a[6]];\n if (\"z\" == c) return [e * a[0] + g * a[1], e * a[1] - g * a[0], a[2], e * a[3] + g * a[4], e * a[4] - g * a[3], a[5], e * a[6] + g * a[7], e * a[7] - g * a[6], a[8]];\n }\n\n function ma(a) {\n return [a[0], a[4], a[8], a[12], a[1], a[5], a[9], a[13], a[2], a[6], a[10], a[14], a[3], a[7], a[11], a[15]];\n }\n\n function Ka(a) {\n La(a, a.path + \".\" + m.extension, function (e, c) {\n a.texture = e;\n a.textureLoaded = c ? 2 : 1;\n }, va.crossOrigin);\n }\n\n function la(a, e) {\n var c = [a[0] * e[0] + a[1] * e[1] + a[2] * e[2], a[4] * e[0] + a[5] * e[1] + a[6] * e[2], a[11] + a[8] * e[0] + a[9] * e[1] + a[10] * e[2], 1 / (a[12] * e[0] + a[13] * e[1] + a[14] * e[2])],\n g = c[0] * c[3],\n l = c[1] * c[3],\n c = c[2] * c[3],\n h = [0, 0, 0];\n -1 > g && (h[0] = -1);\n 1 < g && (h[0] = 1);\n -1 > l && (h[1] = -1);\n 1 < l && (h[1] = 1);\n if (-1 > c || 1 < c) h[2] = 1;\n return h;\n }\n\n function Ea() {\n console.log(\"Reducing canvas size due to error 1286!\");\n A.width = Math.round(A.width / 2);\n A.height = Math.round(A.height / 2);\n }\n\n var A = g.createElement(\"canvas\");\n A.style.width = A.style.height = \"100%\";\n K.appendChild(A);\n var c, a, U, V, $, R, wa, ga, m, z, F, ca, Fa, Y, na, va;\n\n this.init = function (L, e, Ca, H, l, h, d, u) {\n function x(a) {\n if (E) {\n var e = a * a * 4,\n h = new Uint8ClampedArray(e),\n c = u.backgroundColor ? u.backgroundColor : [0, 0, 0];\n c[0] *= 255;\n c[1] *= 255;\n c[2] *= 255;\n\n for (var b = 0; b < e; b++) {\n h[b++] = c[0], h[b++] = c[1], h[b++] = c[2];\n }\n\n a = new ImageData(h, a, a);\n\n for (t = 0; 6 > t; t++) {\n 0 == m[t].width && (m[t] = a);\n }\n }\n }\n\n e === p && (e = \"equirectangular\");\n if (\"equirectangular\" != e && \"cubemap\" != e && \"multires\" != e) throw console.log(\"Error: invalid image type specified!\"), {\n type: \"config error\"\n };\n z = e;\n m = L;\n F = Ca;\n va = u || {};\n\n if (c) {\n U && (a.detachShader(c, U), a.deleteShader(U));\n V && (a.detachShader(c, V), a.deleteShader(V));\n a.bindBuffer(a.ARRAY_BUFFER, null);\n a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, null);\n c.texture && a.deleteTexture(c.texture);\n if (c.nodeCache) for (L = 0; L < c.nodeCache.length; L++) {\n a.deleteTexture(c.nodeCache[L].texture);\n }\n a.deleteProgram(c);\n c = p;\n }\n\n ga = p;\n var t,\n E = !1,\n y;\n if (\"cubemap\" == z) for (t = 0; 6 > t; t++) {\n 0 < m[t].width ? (y === p && (y = m[t].width), y != m[t].width && console.log(\"Cube faces have inconsistent widths: \" + y + \" vs. \" + m[t].width)) : E = !0;\n }\n \"cubemap\" == z && 0 !== (y & y - 1) && (navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/) || navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 9_/) || navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 10_/) || navigator.userAgent.match(/Trident.*rv[ :]*11\\./)) || (a || (a = A.getContext(\"experimental-webgl\", {\n alpha: !1,\n depth: !1\n })), a && 1286 == a.getError() && Ea());\n\n if (!a && (\"multires\" == z && m.hasOwnProperty(\"fallbackPath\") || \"cubemap\" == z) && (\"WebkitAppearance\" in g.documentElement.style || navigator.userAgent.match(/Trident.*rv[ :]*11\\./) || -1 !== navigator.appVersion.indexOf(\"MSIE 10\"))) {\n R && K.removeChild(R);\n R = g.createElement(\"div\");\n R.className = \"pnlm-world\";\n H = m.basePath ? m.basePath + m.fallbackPath : m.fallbackPath;\n var Q = \"frblud\".split(\"\"),\n S = 0;\n\n l = function l() {\n var a = g.createElement(\"canvas\");\n a.className = \"pnlm-face pnlm-\" + Q[this.side] + \"face\";\n R.appendChild(a);\n var e = a.getContext(\"2d\");\n a.style.width = this.width + 4 + \"px\";\n a.style.height = this.height + 4 + \"px\";\n a.width = this.width + 4;\n a.height = this.height + 4;\n e.drawImage(this, 2, 2);\n var h = e.getImageData(0, 0, a.width, a.height),\n c = h.data,\n b,\n d;\n\n for (b = 2; b < a.width - 2; b++) {\n for (d = 0; 4 > d; d++) {\n c[4 * (b + a.width) + d] = c[4 * (b + 2 * a.width) + d], c[4 * (b + a.width * (a.height - 2)) + d] = c[4 * (b + a.width * (a.height - 3)) + d];\n }\n }\n\n for (b = 2; b < a.height - 2; b++) {\n for (d = 0; 4 > d; d++) {\n c[4 * (b * a.width + 1) + d] = c[4 * (b * a.width + 2) + d], c[4 * ((b + 1) * a.width - 2) + d] = c[4 * ((b + 1) * a.width - 3) + d];\n }\n }\n\n for (d = 0; 4 > d; d++) {\n c[4 * (a.width + 1) + d] = c[4 * (2 * a.width + 2) + d], c[4 * (2 * a.width - 2) + d] = c[4 * (3 * a.width - 3) + d], c[4 * (a.width * (a.height - 2) + 1) + d] = c[4 * (a.width * (a.height - 3) + 2) + d], c[4 * (a.width * (a.height - 1) - 2) + d] = c[4 * (a.width * (a.height - 2) - 3) + d];\n }\n\n for (b = 1; b < a.width - 1; b++) {\n for (d = 0; 4 > d; d++) {\n c[4 * b + d] = c[4 * (b + a.width) + d], c[4 * (b + a.width * (a.height - 1)) + d] = c[4 * (b + a.width * (a.height - 2)) + d];\n }\n }\n\n for (b = 1; b < a.height - 1; b++) {\n for (d = 0; 4 > d; d++) {\n c[b * a.width * 4 + d] = c[4 * (b * a.width + 1) + d], c[4 * ((b + 1) * a.width - 1) + d] = c[4 * ((b + 1) * a.width - 2) + d];\n }\n }\n\n for (d = 0; 4 > d; d++) {\n c[d] = c[4 * (a.width + 1) + d], c[4 * (a.width - 1) + d] = c[4 * (2 * a.width - 2) + d], c[a.width * (a.height - 1) * 4 + d] = c[4 * (a.width * (a.height - 2) + 1) + d], c[4 * (a.width * a.height - 1) + d] = c[4 * (a.width * (a.height - 1) - 2) + d];\n }\n\n e.putImageData(h, 0, 0);\n D.call(this);\n };\n\n var D = function D() {\n 0 < this.width ? ($ === p && ($ = this.width), $ != this.width && console.log(\"Fallback faces have inconsistent widths: \" + $ + \" vs. \" + this.width)) : E = !0;\n S++;\n 6 == S && ($ = this.width, K.appendChild(R), d());\n },\n E = !1;\n\n for (t = 0; 6 > t; t++) {\n h = new Image(), h.crossOrigin = va.crossOrigin ? va.crossOrigin : \"anonymous\", h.side = t, h.onload = l, h.onerror = D, h.src = \"multires\" == z ? H.replace(\"%s\", Q[t]) + \".\" + m.extension : m[t].src;\n }\n\n x($);\n } else {\n if (!a) throw console.log(\"Error: no WebGL support detected!\"), {\n type: \"no webgl\"\n };\n \"cubemap\" == z && x(y);\n m.fullpath = m.basePath ? m.basePath + m.path : m.path;\n m.invTileResolution = 1 / m.tileResolution;\n L = ta();\n wa = [];\n\n for (t = 0; 6 > t; t++) {\n wa[t] = L.slice(12 * t, 12 * t + 12), L = ta();\n }\n\n L = 0;\n\n if (\"equirectangular\" == z) {\n if (L = a.getParameter(a.MAX_TEXTURE_SIZE), Math.max(m.width / 2, m.height) > L) throw console.log(\"Error: The image is too big; it's \" + m.width + \"px wide, but this device's maximum supported size is \" + 2 * L + \"px.\"), {\n type: \"webgl size error\",\n width: m.width,\n maxWidth: 2 * L\n };\n } else if (\"cubemap\" == z && y > a.getParameter(a.MAX_CUBE_MAP_TEXTURE_SIZE)) throw console.log(\"Error: The image is too big; it's \" + y + \"px wide, but this device's maximum supported size is \" + L + \"px.\"), {\n type: \"webgl size error\",\n width: y,\n maxWidth: L\n };\n\n u === p || u.horizonPitch === p && u.horizonRoll === p || (ga = [u.horizonPitch == p ? 0 : u.horizonPitch, u.horizonRoll == p ? 0 : u.horizonRoll]);\n y = a.TEXTURE_2D;\n a.viewport(0, 0, a.drawingBufferWidth, a.drawingBufferHeight);\n a.getShaderPrecisionFormat && (e = a.getShaderPrecisionFormat(a.FRAGMENT_SHADER, a.HIGH_FLOAT)) && 1 > e.precision && (oa = oa.replace(\"highp\", \"mediump\"));\n U = a.createShader(a.VERTEX_SHADER);\n e = s;\n \"multires\" == z && (e = k);\n a.shaderSource(U, e);\n a.compileShader(U);\n V = a.createShader(a.FRAGMENT_SHADER);\n e = pa;\n \"cubemap\" == z ? (y = a.TEXTURE_CUBE_MAP, e = qa) : \"multires\" == z && (e = bb);\n a.shaderSource(V, e);\n a.compileShader(V);\n c = a.createProgram();\n a.attachShader(c, U);\n a.attachShader(c, V);\n a.linkProgram(c);\n a.getShaderParameter(U, a.COMPILE_STATUS) || console.log(a.getShaderInfoLog(U));\n a.getShaderParameter(V, a.COMPILE_STATUS) || console.log(a.getShaderInfoLog(V));\n a.getProgramParameter(c, a.LINK_STATUS) || console.log(a.getProgramInfoLog(c));\n a.useProgram(c);\n c.drawInProgress = !1;\n e = u.backgroundColor ? u.backgroundColor : [0, 0, 0];\n a.clearColor(e[0], e[1], e[2], 1);\n a.clear(a.COLOR_BUFFER_BIT);\n c.texCoordLocation = a.getAttribLocation(c, \"a_texCoord\");\n a.enableVertexAttribArray(c.texCoordLocation);\n \"multires\" != z ? (ca || (ca = a.createBuffer()), a.bindBuffer(a.ARRAY_BUFFER, ca), a.bufferData(a.ARRAY_BUFFER, new Float32Array([-1, 1, 1, 1, 1, -1, -1, 1, 1, -1, -1, -1]), a.STATIC_DRAW), a.vertexAttribPointer(c.texCoordLocation, 2, a.FLOAT, !1, 0, 0), c.aspectRatio = a.getUniformLocation(c, \"u_aspectRatio\"), a.uniform1f(c.aspectRatio, a.drawingBufferWidth / a.drawingBufferHeight), c.psi = a.getUniformLocation(c, \"u_psi\"), c.theta = a.getUniformLocation(c, \"u_theta\"), c.f = a.getUniformLocation(c, \"u_f\"), c.h = a.getUniformLocation(c, \"u_h\"), c.v = a.getUniformLocation(c, \"u_v\"), c.vo = a.getUniformLocation(c, \"u_vo\"), c.rot = a.getUniformLocation(c, \"u_rot\"), a.uniform1f(c.h, H / (2 * Math.PI)), a.uniform1f(c.v, l / Math.PI), a.uniform1f(c.vo, h / Math.PI * 2), \"equirectangular\" == z && (c.backgroundColor = a.getUniformLocation(c, \"u_backgroundColor\"), a.uniform4fv(c.backgroundColor, e.concat([1]))), c.texture = a.createTexture(), a.bindTexture(y, c.texture), \"cubemap\" == z ? (a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, m[1]), a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, m[3]), a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, m[4]), a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, m[5]), a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, m[0]), a.texImage2D(a.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, m[2])) : m.width <= L ? (a.uniform1i(a.getUniformLocation(c, \"u_splitImage\"), 0), a.texImage2D(y, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, m)) : (a.uniform1i(a.getUniformLocation(c, \"u_splitImage\"), 1), H = g.createElement(\"canvas\"), H.width = m.width / 2, H.height = m.height, H = H.getContext(\"2d\"), H.drawImage(m, 0, 0), l = H.getImageData(0, 0, m.width / 2, m.height), a.texImage2D(y, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, l), c.texture2 = a.createTexture(), a.activeTexture(a.TEXTURE1), a.bindTexture(y, c.texture2), a.uniform1i(a.getUniformLocation(c, \"u_image1\"), 1), H.drawImage(m, -m.width / 2, 0), l = H.getImageData(0, 0, m.width / 2, m.height), a.texImage2D(y, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, l), a.texParameteri(y, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(y, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE), a.texParameteri(y, a.TEXTURE_MIN_FILTER, a.LINEAR), a.texParameteri(y, a.TEXTURE_MAG_FILTER, a.LINEAR), a.activeTexture(a.TEXTURE0)), a.texParameteri(y, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE), a.texParameteri(y, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE), a.texParameteri(y, a.TEXTURE_MIN_FILTER, a.LINEAR), a.texParameteri(y, a.TEXTURE_MAG_FILTER, a.LINEAR)) : (c.vertPosLocation = a.getAttribLocation(c, \"a_vertCoord\"), a.enableVertexAttribArray(c.vertPosLocation), Fa || (Fa = a.createBuffer()), Y || (Y = a.createBuffer()), na || (na = a.createBuffer()), a.bindBuffer(a.ARRAY_BUFFER, Y), a.bufferData(a.ARRAY_BUFFER, new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]), a.STATIC_DRAW), a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, na), a.bufferData(a.ELEMENT_ARRAY_BUFFER, new Uint16Array([0, 1, 2, 0, 2, 3]), a.STATIC_DRAW), c.perspUniform = a.getUniformLocation(c, \"u_perspMatrix\"), c.cubeUniform = a.getUniformLocation(c, \"u_cubeMatrix\"), c.level = -1, c.currentNodes = [], c.nodeCache = [], c.nodeCacheTimestamp = 0);\n H = a.getError();\n if (0 !== H) throw console.log(\"Error: Something went wrong with WebGL!\", H), {\n type: \"webgl error\"\n };\n d();\n }\n };\n\n this.destroy = function () {\n K !== p && (A !== p && K.contains(A) && K.removeChild(A), R !== p && K.contains(R) && K.removeChild(R));\n\n if (a) {\n var c = a.getExtension(\"WEBGL_lose_context\");\n c && c.loseContext();\n }\n };\n\n this.resize = function () {\n var g = E.devicePixelRatio || 1;\n A.width = A.clientWidth * g;\n A.height = A.clientHeight * g;\n a && (1286 == a.getError() && Ea(), a.viewport(0, 0, a.drawingBufferWidth, a.drawingBufferHeight), \"multires\" != z && a.uniform1f(c.aspectRatio, A.clientWidth / A.clientHeight));\n };\n\n this.resize();\n\n this.setPose = function (a, c) {\n ga = [a, c];\n };\n\n this.render = function (g, e, k, s) {\n var l,\n h = 0;\n s === p && (s = {});\n s.roll && (h = s.roll);\n\n if (ga !== p) {\n l = ga[0];\n var d = ga[1],\n u = g,\n x = e,\n t = Math.cos(d) * Math.sin(g) * Math.sin(l) + Math.cos(g) * (Math.cos(l) * Math.cos(e) + Math.sin(d) * Math.sin(l) * Math.sin(e)),\n E = -Math.sin(g) * Math.sin(d) + Math.cos(g) * Math.cos(d) * Math.sin(e);\n g = Math.cos(d) * Math.cos(l) * Math.sin(g) + Math.cos(g) * (-Math.cos(e) * Math.sin(l) + Math.cos(l) * Math.sin(d) * Math.sin(e));\n g = Math.asin(Math.max(Math.min(g, 1), -1));\n e = Math.atan2(E, t);\n l = [Math.cos(u) * (Math.sin(d) * Math.sin(l) * Math.cos(x) - Math.cos(l) * Math.sin(x)), Math.cos(u) * Math.cos(d) * Math.cos(x), Math.cos(u) * (Math.cos(l) * Math.sin(d) * Math.cos(x) + Math.sin(x) * Math.sin(l))];\n d = [-Math.cos(g) * Math.sin(e), Math.cos(g) * Math.cos(e)];\n d = Math.acos(Math.max(Math.min((l[0] * d[0] + l[1] * d[1]) / (Math.sqrt(l[0] * l[0] + l[1] * l[1] + l[2] * l[2]) * Math.sqrt(d[0] * d[0] + d[1] * d[1])), 1), -1));\n 0 > l[2] && (d = 2 * Math.PI - d);\n h += d;\n }\n\n if (a || \"multires\" != z && \"cubemap\" != z) {\n if (\"multires\" != z) k = 2 * Math.atan(Math.tan(0.5 * k) / (a.drawingBufferWidth / a.drawingBufferHeight)), k = 1 / Math.tan(0.5 * k), a.uniform1f(c.psi, e), a.uniform1f(c.theta, g), a.uniform1f(c.rot, h), a.uniform1f(c.f, k), !0 === F && \"equirectangular\" == z && (a.bindTexture(a.TEXTURE_2D, c.texture), a.texImage2D(a.TEXTURE_2D, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, m)), a.drawArrays(a.TRIANGLES, 0, 6);else {\n l = a.drawingBufferWidth / a.drawingBufferHeight;\n d = 2 * Math.atan(Math.tan(k / 2) * a.drawingBufferHeight / a.drawingBufferWidth);\n d = 1 / Math.tan(d / 2);\n l = [d / l, 0, 0, 0, 0, d, 0, 0, 0, 0, 100.1 / -99.9, 20 / -99.9, 0, 0, -1, 0];\n\n for (d = 1; d < m.maxLevel && a.drawingBufferWidth > m.tileResolution * Math.pow(2, d - 1) * Math.tan(k / 2) * 0.707;) {\n d++;\n }\n\n c.level = d;\n d = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n d = ua(d, -h, \"z\");\n d = ua(d, -g, \"x\");\n d = ua(d, e, \"y\");\n d = [d[0], d[1], d[2], 0, d[3], d[4], d[5], 0, d[6], d[7], d[8], 0, 0, 0, 0, 1];\n a.uniformMatrix4fv(c.perspUniform, !1, new Float32Array(ma(l)));\n a.uniformMatrix4fv(c.cubeUniform, !1, new Float32Array(ma(d)));\n h = [l[0] * d[0], l[0] * d[1], l[0] * d[2], 0, l[5] * d[4], l[5] * d[5], l[5] * d[6], 0, l[10] * d[8], l[10] * d[9], l[10] * d[10], l[11], -d[8], -d[9], -d[10], 0];\n c.nodeCache.sort(ja);\n if (200 < c.nodeCache.length && c.nodeCache.length > c.currentNodes.length + 50) for (l = c.nodeCache.splice(200, c.nodeCache.length - 200), d = 0; d < l.length; d++) {\n a.deleteTexture(l[d].texture);\n }\n c.currentNodes = [];\n d = \"fbudlr\".split(\"\");\n\n for (l = 0; 6 > l; l++) {\n u = new ka(wa[l], d[l], 1, 0, 0, m.fullpath), Ja(h, u, g, e, k);\n }\n\n c.currentNodes.sort(Q);\n\n for (g = S.length - 1; 0 <= g; g--) {\n -1 === c.currentNodes.indexOf(S[g].node) && (S[g].node.textureLoad = !1, S.splice(g, 1));\n }\n\n if (0 === S.length) for (g = 0; g < c.currentNodes.length; g++) {\n if (e = c.currentNodes[g], !e.texture && !e.textureLoad) {\n e.textureLoad = !0;\n setTimeout(Ka, 0, e);\n break;\n }\n }\n\n if (!c.drawInProgress) {\n c.drawInProgress = !0;\n a.clear(a.COLOR_BUFFER_BIT);\n\n for (g = 0; g < c.currentNodes.length; g++) {\n 1 < c.currentNodes[g].textureLoaded && (a.bindBuffer(a.ARRAY_BUFFER, Fa), a.bufferData(a.ARRAY_BUFFER, new Float32Array(c.currentNodes[g].vertices), a.STATIC_DRAW), a.vertexAttribPointer(c.vertPosLocation, 3, a.FLOAT, !1, 0, 0), a.bindBuffer(a.ARRAY_BUFFER, Y), a.vertexAttribPointer(c.texCoordLocation, 2, a.FLOAT, !1, 0, 0), a.bindTexture(a.TEXTURE_2D, c.currentNodes[g].texture), a.drawElements(a.TRIANGLES, 6, a.UNSIGNED_SHORT, 0));\n }\n\n c.drawInProgress = !1;\n }\n }\n if (s.returnImage !== p) return A.toDataURL(\"image/png\");\n } else for (l = $ / 2, s = {\n f: \"translate3d(-\" + (l + 2) + \"px, -\" + (l + 2) + \"px, -\" + l + \"px)\",\n b: \"translate3d(\" + (l + 2) + \"px, -\" + (l + 2) + \"px, \" + l + \"px) rotateX(180deg) rotateZ(180deg)\",\n u: \"translate3d(-\" + (l + 2) + \"px, -\" + l + \"px, \" + (l + 2) + \"px) rotateX(270deg)\",\n d: \"translate3d(-\" + (l + 2) + \"px, \" + l + \"px, -\" + (l + 2) + \"px) rotateX(90deg)\",\n l: \"translate3d(-\" + l + \"px, -\" + (l + 2) + \"px, \" + (l + 2) + \"px) rotateX(180deg) rotateY(90deg) rotateZ(180deg)\",\n r: \"translate3d(\" + l + \"px, -\" + (l + 2) + \"px, -\" + (l + 2) + \"px) rotateY(270deg)\"\n }, k = 1 / Math.tan(k / 2), k = k * A.clientWidth / 2 + \"px\", e = \"perspective(\" + k + \") translateZ(\" + k + \") rotateX(\" + g + \"rad) rotateY(\" + e + \"rad) \", k = Object.keys(s), g = 0; 6 > g; g++) {\n if (h = R.querySelector(\".pnlm-\" + k[g] + \"face\")) h.style.webkitTransform = e + s[k[g]], h.style.transform = e + s[k[g]];\n }\n };\n\n this.isLoading = function () {\n if (a && \"multires\" == z) for (var g = 0; g < c.currentNodes.length; g++) {\n if (!c.currentNodes[g].textureLoaded) return !0;\n }\n return !1;\n };\n\n this.getCanvas = function () {\n return A;\n };\n\n var S = [],\n La = function () {\n function c() {\n var d = this;\n this.texture = this.callback = null;\n this.image = new Image();\n this.image.crossOrigin = l ? l : \"anonymous\";\n\n var e = function e() {\n if (0 < d.image.width && 0 < d.image.height) {\n var c = d.image;\n a.bindTexture(a.TEXTURE_2D, d.texture);\n a.texImage2D(a.TEXTURE_2D, 0, a.RGB, a.RGB, a.UNSIGNED_BYTE, c);\n a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MAG_FILTER, a.LINEAR);\n a.texParameteri(a.TEXTURE_2D, a.TEXTURE_MIN_FILTER, a.LINEAR);\n a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_S, a.CLAMP_TO_EDGE);\n a.texParameteri(a.TEXTURE_2D, a.TEXTURE_WRAP_T, a.CLAMP_TO_EDGE);\n a.bindTexture(a.TEXTURE_2D, null);\n d.callback(d.texture, !0);\n } else d.callback(d.texture, !1);\n\n S.length ? (c = S.shift(), d.loadTexture(c.src, c.texture, c.callback)) : k[g++] = d;\n };\n\n this.image.addEventListener(\"load\", e);\n this.image.addEventListener(\"error\", e);\n }\n\n function e(a, c, e, g) {\n this.node = a;\n this.src = c;\n this.texture = e;\n this.callback = g;\n }\n\n var g = 4,\n k = {},\n l;\n\n c.prototype.loadTexture = function (a, c, e) {\n this.texture = c;\n this.callback = e;\n this.image.src = a;\n };\n\n for (var h = 0; h < g; h++) {\n k[h] = new c();\n }\n\n return function (c, h, m, p) {\n l = p;\n p = a.createTexture();\n g ? k[--g].loadTexture(h, p, m) : S.push(new e(c, h, p, m));\n return p;\n };\n }();\n }\n\n var s = \"attribute vec2 a_texCoord;varying vec2 v_texCoord;void main() {gl_Position = vec4(a_texCoord, 0.0, 1.0);v_texCoord = a_texCoord;}\",\n k = \"attribute vec3 a_vertCoord;attribute vec2 a_texCoord;uniform mat4 u_cubeMatrix;uniform mat4 u_perspMatrix;varying mediump vec2 v_texCoord;void main(void) {gl_Position = u_perspMatrix * u_cubeMatrix * vec4(a_vertCoord, 1.0);v_texCoord = a_texCoord;}\",\n oa = \"precision highp float;\\nuniform float u_aspectRatio;\\nuniform float u_psi;\\nuniform float u_theta;\\nuniform float u_f;\\nuniform float u_h;\\nuniform float u_v;\\nuniform float u_vo;\\nuniform float u_rot;\\nconst float PI = 3.14159265358979323846264;\\nuniform sampler2D u_image0;\\nuniform sampler2D u_image1;\\nuniform bool u_splitImage;\\nuniform samplerCube u_imageCube;\\nvarying vec2 v_texCoord;\\nuniform vec4 u_backgroundColor;\\nvoid main() {\\nfloat x = v_texCoord.x * u_aspectRatio;\\nfloat y = v_texCoord.y;\\nfloat sinrot = sin(u_rot);\\nfloat cosrot = cos(u_rot);\\nfloat rot_x = x * cosrot - y * sinrot;\\nfloat rot_y = x * sinrot + y * cosrot;\\nfloat sintheta = sin(u_theta);\\nfloat costheta = cos(u_theta);\\nfloat a = u_f * costheta - rot_y * sintheta;\\nfloat root = sqrt(rot_x * rot_x + a * a);\\nfloat lambda = atan(rot_x / root, a / root) + u_psi;\\nfloat phi = atan((rot_y * costheta + u_f * sintheta) / root);\",\n qa = oa + \"float cosphi = cos(phi);\\ngl_FragColor = textureCube(u_imageCube, vec3(cosphi*sin(lambda), sin(phi), cosphi*cos(lambda)));\\n}\",\n pa = oa + \"lambda = mod(lambda + PI, PI * 2.0) - PI;\\nvec2 coord = vec2(lambda / PI, phi / (PI / 2.0));\\nif(coord.x < -u_h || coord.x > u_h || coord.y < -u_v + u_vo || coord.y > u_v + u_vo)\\ngl_FragColor = u_backgroundColor;\\nelse {\\nif(u_splitImage) {\\nif(coord.x < 0.0)\\ngl_FragColor = texture2D(u_image0, vec2((coord.x + u_h) / u_h, (-coord.y + u_v + u_vo) / (u_v * 2.0)));\\nelse\\ngl_FragColor = texture2D(u_image1, vec2((coord.x + u_h) / u_h - 1.0, (-coord.y + u_v + u_vo) / (u_v * 2.0)));\\n} else {\\ngl_FragColor = texture2D(u_image0, vec2((coord.x + u_h) / (u_h * 2.0), (-coord.y + u_v + u_vo) / (u_v * 2.0)));\\n}\\n}\\n}\",\n bb = \"varying mediump vec2 v_texCoord;uniform sampler2D u_sampler;void main(void) {gl_FragColor = texture2D(u_sampler, v_texCoord);}\";\n return {\n renderer: function renderer(g, k, p, s) {\n return new Ba(g, k, p, s);\n }\n };\n}(window, document);\n\nwindow.pannellum = function (E, g, p) {\n function Ba(s, k) {\n function oa() {\n var a = g.createElement(\"div\");\n a.innerHTML = \"\\x3c!--[if lte IE 9]><i></i><![endif]--\\x3e\";\n if (1 == a.getElementsByTagName(\"i\").length) K();else {\n ra = b.hfov;\n Ga = b.pitch;\n var f;\n\n if (\"cubemap\" == b.type) {\n P = [];\n\n for (a = 0; 6 > a; a++) {\n P.push(new Image()), P[a].crossOrigin = b.crossOrigin;\n }\n\n q.load.lbox.style.display = \"block\";\n q.load.lbar.style.display = \"none\";\n } else if (\"multires\" == b.type) a = JSON.parse(JSON.stringify(b.multiRes)), b.basePath && b.multiRes.basePath && !/^(?:[a-z]+:)?\\/\\//i.test(b.multiRes.basePath) ? a.basePath = b.basePath + b.multiRes.basePath : b.multiRes.basePath ? a.basePath = b.multiRes.basePath : b.basePath && (a.basePath = b.basePath), P = a;else if (!0 === b.dynamic) P = b.panorama;else {\n if (b.panorama === p) {\n K(b.strings.noPanoramaError);\n return;\n }\n\n P = new Image();\n }\n\n if (\"cubemap\" == b.type) for (var n = 6, c = function c() {\n n--;\n 0 === n && pa();\n }, d = function d(a) {\n var ea = g.createElement(\"a\");\n ea.href = a.target.src;\n ea.textContent = ea.href;\n K(b.strings.fileAccessError.replace(\"%s\", ea.outerHTML));\n }, a = 0; a < P.length; a++) {\n f = b.cubeMap[a], \"null\" == f ? (console.log(\"Will use background instead of missing cubemap face \" + a), c()) : (b.basePath && !qa(f) && (f = b.basePath + f), P[a].onload = c, P[a].onerror = d, P[a].src = I(f));\n } else if (\"multires\" == b.type) pa();else if (f = \"\", b.basePath && (f = b.basePath), !0 !== b.dynamic) {\n f = qa(b.panorama) ? b.panorama : f + b.panorama;\n\n P.onload = function () {\n E.URL.revokeObjectURL(this.src);\n pa();\n };\n\n var e = new XMLHttpRequest();\n\n e.onloadend = function () {\n if (200 != e.status) {\n var a = g.createElement(\"a\");\n a.href = f;\n a.textContent = a.href;\n K(b.strings.fileAccessError.replace(\"%s\", a.outerHTML));\n }\n\n Ba(this.response);\n q.load.msg.innerHTML = \"\";\n };\n\n e.onprogress = function (a) {\n if (a.lengthComputable) {\n q.load.lbarFill.style.width = a.loaded / a.total * 100 + \"%\";\n var b, ea;\n 1E6 < a.total ? (b = \"MB\", ea = (a.loaded / 1E6).toFixed(2), a = (a.total / 1E6).toFixed(2)) : 1E3 < a.total ? (b = \"kB\", ea = (a.loaded / 1E3).toFixed(1), a = (a.total / 1E3).toFixed(1)) : (b = \"B\", ea = a.loaded, a = a.total);\n q.load.msg.innerHTML = ea + \" / \" + a + \" \" + b;\n } else q.load.lbox.style.display = \"block\", q.load.lbar.style.display = \"none\";\n };\n\n try {\n e.open(\"GET\", f, !0);\n } catch (h) {\n K(b.strings.malformedURLError);\n }\n\n e.responseType = \"blob\";\n e.setRequestHeader(\"Accept\", \"image/*,*/*;q=0.9\");\n e.withCredentials = \"use-credentials\" === b.crossOrigin;\n e.send();\n }\n b.draggable && J.classList.add(\"pnlm-grab\");\n J.classList.remove(\"pnlm-grabbing\");\n Ma = !0 === b.dynamicUpdate;\n b.dynamic && Ma && (P = b.panorama, pa());\n }\n }\n\n function qa(a) {\n return /^(?:[a-z]+:)?\\/\\//i.test(a) || \"/\" == a[0] || \"blob:\" == a.slice(0, 5);\n }\n\n function pa() {\n C || (C = new libpannellum.renderer(M));\n Sa || (Sa = !0, W.addEventListener(\"mousedown\", ka, !1), g.addEventListener(\"mousemove\", ua, !1), g.addEventListener(\"mouseup\", ma, !1), b.mouseZoom && (J.addEventListener(\"mousewheel\", U, !1), J.addEventListener(\"DOMMouseScroll\", U, !1)), b.doubleClickZoom && W.addEventListener(\"dblclick\", Ja, !1), s.addEventListener(\"mozfullscreenchange\", d, !1), s.addEventListener(\"webkitfullscreenchange\", d, !1), s.addEventListener(\"msfullscreenchange\", d, !1), s.addEventListener(\"fullscreenchange\", d, !1), E.addEventListener(\"resize\", z, !1), E.addEventListener(\"orientationchange\", z, !1), b.disableKeyboardCtrl || (s.addEventListener(\"keydown\", V, !1), s.addEventListener(\"keyup\", R, !1), s.addEventListener(\"blur\", $, !1)), g.addEventListener(\"mouseleave\", ma, !1), \"\" === g.documentElement.style.pointerAction && \"\" === g.documentElement.style.touchAction ? (W.addEventListener(\"pointerdown\", A, !1), W.addEventListener(\"pointermove\", c, !1), W.addEventListener(\"pointerup\", a, !1), W.addEventListener(\"pointerleave\", a, !1)) : (W.addEventListener(\"touchstart\", Ka, !1), W.addEventListener(\"touchmove\", la, !1), W.addEventListener(\"touchend\", Ea, !1)), E.navigator.pointerEnabled && (s.style.touchAction = \"none\"));\n va();\n x(b.hfov);\n setTimeout(function () {}, 500);\n }\n\n function Ba(a) {\n var f = new FileReader();\n f.addEventListener(\"loadend\", function () {\n var n = f.result;\n\n if (navigator.userAgent.toLowerCase().match(/(iphone|ipod|ipad).* os 8_/)) {\n var c = n.indexOf(\"\\xFF\\xC2\");\n (0 > c || 65536 < c) && K(b.strings.iOS8WebGLError);\n }\n\n c = n.indexOf(\"<x:xmpmeta\");\n\n if (-1 < c && !0 !== b.ignoreGPanoXMP) {\n var d = n.substring(c, n.indexOf(\"</x:xmpmeta>\") + 12),\n e = function e(a) {\n var b;\n 0 <= d.indexOf(a + '=\"') ? (b = d.substring(d.indexOf(a + '=\"') + a.length + 2), b = b.substring(0, b.indexOf('\"'))) : 0 <= d.indexOf(a + \">\") && (b = d.substring(d.indexOf(a + \">\") + a.length + 1), b = b.substring(0, b.indexOf(\"<\")));\n return b !== p ? Number(b) : null;\n },\n n = e(\"GPano:FullPanoWidthPixels\"),\n c = e(\"GPano:CroppedAreaImageWidthPixels\"),\n g = e(\"GPano:FullPanoHeightPixels\"),\n h = e(\"GPano:CroppedAreaImageHeightPixels\"),\n l = e(\"GPano:CroppedAreaTopPixels\"),\n k = e(\"GPano:PoseHeadingDegrees\"),\n m = e(\"GPano:PosePitchDegrees\"),\n e = e(\"GPano:PoseRollDegrees\");\n\n null !== n && null !== c && null !== g && null !== h && null !== l && (0 > aa.indexOf(\"haov\") && (b.haov = c / n * 360), 0 > aa.indexOf(\"vaov\") && (b.vaov = h / g * 180), 0 > aa.indexOf(\"vOffset\") && (b.vOffset = -180 * ((l + h / 2) / g - 0.5)), null !== k && 0 > aa.indexOf(\"northOffset\") && (b.northOffset = k, !1 !== b.compass && (b.compass = !0)), null !== m && null !== e && (0 > aa.indexOf(\"horizonPitch\") && (b.horizonPitch = m), 0 > aa.indexOf(\"horizonRoll\") && (b.horizonRoll = e)));\n }\n\n P.src = E.URL.createObjectURL(a);\n });\n f.readAsBinaryString !== p ? f.readAsBinaryString(a) : f.readAsText(a);\n }\n\n function K(a) {\n a === p && (a = b.strings.genericWebGLError);\n q.errorMsg.innerHTML = \"<p>\" + a + \"</p>\";\n v.load.style.display = \"none\";\n q.load.box.style.display = \"none\";\n q.errorMsg.style.display = \"table\";\n Na = !0;\n G = p;\n M.style.display = \"none\";\n B(\"error\", a);\n }\n\n function ja(a) {\n var b = Q(a);\n fa.style.left = b.x + \"px\";\n fa.style.top = b.y + \"px\";\n clearTimeout(ja.t1);\n clearTimeout(ja.t2);\n fa.style.display = \"block\";\n fa.style.opacity = 1;\n ja.t1 = setTimeout(function () {\n fa.style.opacity = 0;\n }, 2E3);\n ja.t2 = setTimeout(function () {\n fa.style.display = \"none\";\n }, 2500);\n a.preventDefault();\n }\n\n function Q(a) {\n var b = s.getBoundingClientRect(),\n n = {};\n n.x = (a.clientX || a.pageX) - b.left;\n n.y = (a.clientY || a.pageY) - b.top;\n return n;\n }\n\n function ka(a) {\n a.preventDefault();\n s.focus();\n\n if (G && b.draggable) {\n var f = Q(a);\n\n if (b.hotSpotDebug) {\n var n = ta(a);\n console.log(\"Pitch: \" + n[0] + \", Yaw: \" + n[1] + \", Center Pitch: \" + b.pitch + \", Center Yaw: \" + b.yaw + \", HFOV: \" + b.hfov);\n }\n\n t();\n Da();\n b.roll = 0;\n w.hfov = 0;\n ha = !0;\n N = Date.now();\n xa = f.x;\n ya = f.y;\n Oa = b.yaw;\n Pa = b.pitch;\n J.classList.add(\"pnlm-grabbing\");\n J.classList.remove(\"pnlm-grab\");\n B(\"mousedown\", a);\n F();\n }\n }\n\n function Ja(a) {\n b.minHfov === b.hfov ? da.setHfov(ra, 1E3) : (a = ta(a), da.lookAt(a[0], a[1], b.minHfov, 1E3));\n }\n\n function ta(a) {\n var f = Q(a);\n a = C.getCanvas();\n var n = a.clientWidth,\n c = a.clientHeight;\n a = f.x / n * 2 - 1;\n var c = (1 - f.y / c * 2) * c / n,\n e = 1 / Math.tan(b.hfov * Math.PI / 360),\n d = Math.sin(b.pitch * Math.PI / 180),\n g = Math.cos(b.pitch * Math.PI / 180),\n f = e * g - c * d,\n n = Math.sqrt(a * a + f * f),\n c = 180 * Math.atan((c * g + e * d) / n) / Math.PI;\n a = 180 * Math.atan2(a / n, f / n) / Math.PI + b.yaw;\n -180 > a && (a += 360);\n 180 < a && (a -= 360);\n return [c, a];\n }\n\n function ua(a) {\n if (ha && G) {\n N = Date.now();\n var f = C.getCanvas(),\n n = f.clientWidth,\n f = f.clientHeight;\n a = Q(a);\n var c = 180 * (Math.atan(xa / n * 2 - 1) - Math.atan(a.x / n * 2 - 1)) / Math.PI * b.hfov / 90 + Oa;\n w.yaw = (c - b.yaw) % 360 * 0.2;\n b.yaw = c;\n n = 360 * Math.atan(Math.tan(b.hfov / 360 * Math.PI) * f / n) / Math.PI;\n n = 180 * (Math.atan(a.y / f * 2 - 1) - Math.atan(ya / f * 2 - 1)) / Math.PI * n / 90 + Pa;\n w.pitch = 0.2 * (n - b.pitch);\n b.pitch = n;\n }\n }\n\n function ma(a) {\n ha && (ha = !1, 15 < Date.now() - N && (w.pitch = w.yaw = 0), J.classList.add(\"pnlm-grab\"), J.classList.remove(\"pnlm-grabbing\"), N = Date.now(), B(\"mouseup\", a));\n }\n\n function Ka(a) {\n if (G && b.draggable) {\n t();\n Da();\n b.roll = 0;\n w.hfov = 0;\n var f = Q(a.targetTouches[0]);\n xa = f.x;\n ya = f.y;\n\n if (2 == a.targetTouches.length) {\n var n = Q(a.targetTouches[1]);\n xa += 0.5 * (n.x - f.x);\n ya += 0.5 * (n.y - f.y);\n Ha = Math.sqrt((f.x - n.x) * (f.x - n.x) + (f.y - n.y) * (f.y - n.y));\n }\n\n ha = !0;\n N = Date.now();\n Oa = b.yaw;\n Pa = b.pitch;\n B(\"touchstart\", a);\n F();\n }\n }\n\n function la(a) {\n if (b.draggable && (a.preventDefault(), G && (N = Date.now()), ha && G)) {\n var f = Q(a.targetTouches[0]),\n n = f.x,\n c = f.y;\n 2 == a.targetTouches.length && -1 != Ha && (a = Q(a.targetTouches[1]), n += 0.5 * (a.x - f.x), c += 0.5 * (a.y - f.y), f = Math.sqrt((f.x - a.x) * (f.x - a.x) + (f.y - a.y) * (f.y - a.y)), x(b.hfov + 0.1 * (Ha - f)), Ha = f);\n f = b.hfov / 360 * b.touchPanSpeedCoeffFactor;\n n = (xa - n) * f + Oa;\n w.yaw = (n - b.yaw) % 360 * 0.2;\n b.yaw = n;\n c = (c - ya) * f + Pa;\n w.pitch = 0.2 * (c - b.pitch);\n b.pitch = c;\n }\n }\n\n function Ea() {\n ha = !1;\n 150 < Date.now() - N && (w.pitch = w.yaw = 0);\n Ha = -1;\n N = Date.now();\n B(\"touchend\", event);\n }\n\n function A(a) {\n \"touch\" == a.pointerType && G && b.draggable && (ia.push(a.pointerId), za.push({\n clientX: a.clientX,\n clientY: a.clientY\n }), a.targetTouches = za, Ka(a), a.preventDefault());\n }\n\n function c(a) {\n if (\"touch\" == a.pointerType && b.draggable) for (var f = 0; f < ia.length; f++) {\n if (a.pointerId == ia[f]) {\n za[f].clientX = a.clientX;\n za[f].clientY = a.clientY;\n a.targetTouches = za;\n la(a);\n a.preventDefault();\n break;\n }\n }\n }\n\n function a(a) {\n if (\"touch\" == a.pointerType) {\n for (var b = !1, n = 0; n < ia.length; n++) {\n a.pointerId == ia[n] && (ia[n] = p), ia[n] && (b = !0);\n }\n\n b || (ia = [], za = [], Ea());\n a.preventDefault();\n }\n }\n\n function U(a) {\n G && (\"fullscreenonly\" != b.mouseZoom || Aa) && (a.preventDefault(), t(), N = Date.now(), a.wheelDeltaY ? (x(b.hfov - 0.05 * a.wheelDeltaY), w.hfov = 0 > a.wheelDelta ? 1 : -1) : a.wheelDelta ? (x(b.hfov - 0.05 * a.wheelDelta), w.hfov = 0 > a.wheelDelta ? 1 : -1) : a.detail && (x(b.hfov + 1.5 * a.detail), w.hfov = 0 < a.detail ? 1 : -1), F());\n }\n\n function V(a) {\n t();\n N = Dat