/** * https://www.360-javascriptviewer.com/ * Skipped minification because the original files appears to be already minified. * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ !function(t, e) { if ("object" == typeof exports && "object" == typeof module) module.exports = e(); else if ("function" == typeof define && define.amd) define([], e); else { var n = e(); for (var r in n) ("object" == typeof exports ? exports : t)[r] = n[r] } }(this, (function() { return function(t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var i = e[r] = { i: r, l: !1, exports: {} }; return t[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports } return n.m = t, n.c = e, n.d = function(t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }) } , n.r = function(t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }) } , n.t = function(t, e) { if (1 & e && (t = n(t)), 8 & e) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) for (var i in t) n.d(r, i, function(e) { return t[e] } .bind(null, i)); return r } , n.n = function(t) { var e = t && t.__esModule ? function() { return t.default } : function() { return t } ; return n.d(e, "a", e), e } , n.o = function(t, e) { return Object.prototype.hasOwnProperty.call(t, e) } , n.p = "", n(n.s = 5) }([function(t, e, n) { "use strict"; var r, i = this && this.__extends || (r = function(t, e) { return (r = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(t, e) { t.__proto__ = e } || function(t, e) { for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n]) } )(t, e) } , function(t, e) { function n() { this.constructor = t } r(t, e), t.prototype = null === e ? Object.create(e) : (n.prototype = e.prototype, new n) } ); Object.defineProperty(e, "__esModule", { value: !0 }); var o = function(t) { function e(e) { var n = this; return e += " check the documentation at https://www.360-javascriptviewer.com/installation", (n = t.call(this, e) || this).name = "360 Javascript Viewer InputError", n } return i(e, t), e }(Error); e.default = o } , function(t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), e.mergeDeep = e.hexToRgb = e.now = e.removeEvent = e.addEvent = e.minusClient = e.plueClient = e.getAverageClient = e.getClient = e.getClients = e.getPositions = e.getDist = e.getPosition = e.getPositionEvent = e.isMultiTouch = e.getPinchDragPosition = e.getRotation = e.getRandomId = e.getRad = void 0; var r = n(12); function i(t, e) { var n = e[0] - t[0] , r = e[1] - t[1] , i = Math.atan2(r, n); return i >= 0 ? i : i + 2 * Math.PI } function o(t, e, n) { var r = t.clientX , i = t.clientY; return { clientX: r, clientY: i, deltaX: r - e.clientX, deltaY: i - e.clientY, distX: r - n.clientX, distY: i - n.clientY } } function a(t) { for (var e = Math.min(t.length, 2), n = [], r = 0; r < e; ++r) n.push(s(t[r])); return n } function s(t) { return { clientX: t.clientX, clientY: t.clientY } } function u(t) { return 1 === t.length ? t[0] : { clientX: (t[0].clientX + t[1].clientX) / 2, clientY: (t[0].clientY + t[1].clientY) / 2 } } function c(t, e) { return { clientX: t.clientX + e.clientX, clientY: t.clientY + e.clientY } } function l(t, e) { return { clientX: t.clientX - e.clientX, clientY: t.clientY - e.clientY } } e.getRad = i, e.getRandomId = function() { return "_" + Math.random().toString(36).substr(2, 9) } , e.getRotation = function(t) { return i([t[0].clientX, t[0].clientY], [t[1].clientX, t[1].clientY]) / Math.PI * 180 } , e.getPinchDragPosition = function(t, e, n, r) { var i = u(t) , a = u(e) , s = u(r); return o(c(r[0], l(i, s)), c(r[0], l(a, s)), n[0]) } , e.isMultiTouch = function(t) { return t.touches && t.touches.length >= 2 } , e.getPositionEvent = function(t) { return t.touches ? a(t.touches) : [s(t)] } , e.getPosition = o, e.getDist = function(t) { return Math.sqrt(Math.pow(t[0].clientX - t[1].clientX, 2) + Math.pow(t[0].clientY - t[1].clientY, 2)) } , e.getPositions = function(t, e, n) { return t.map((function(t, r) { return o(t, e[r], n[r]) } )) } , e.getClients = a, e.getClient = s, e.getAverageClient = u, e.plueClient = c, e.minusClient = l, e.addEvent = function(t, e, n, r) { t.addEventListener(e, n, r) } , e.removeEvent = function(t, e, n) { t.removeEventListener(e, n) } , e.now = function() { return Date.now ? Date.now() : (new Date).getTime() } , e.hexToRgb = function(t) { var e = r(t); return e ? { r: e.rgba[0], g: e.rgba[1], b: e.rgba[2], a: e.rgba[3] } : null } , e.mergeDeep = function t(e) { var n = e.objects , r = function(t) { return t && "object" == typeof t }; return n.reduce((function(e, n) { return Object.keys(n).forEach((function(i) { var o = e[i] , a = n[i]; Array.isArray(o) && Array.isArray(a) ? e[i] = o.concat.apply(o, a) : r(o) && r(a) ? e[i] = t({ objects: [o, a] }) : e[i] = a } )), e } ), {}) } } , function(t, e) { var n = /^\s+|\s+$/g , r = /^[-+]0x[0-9a-f]+$/i , i = /^0b[01]+$/i , o = /^0o[0-7]+$/i , a = parseInt , s = Object.prototype.toString; function u(t, e) { var u; if ("function" != typeof e) throw new TypeError("Expected a function"); return t = function(t) { var e = function(t) { if (!t) return 0 === t ? t : 0; if ((t = function(t) { if ("number" == typeof t) return t; if (function(t) { return "symbol" == typeof t || function(t) { return !!t && "object" == typeof t }(t) && "[object Symbol]" == s.call(t) }(t)) return NaN; if (c(t)) { var e = "function" == typeof t.valueOf ? t.valueOf() : t; t = c(e) ? e + "" : e } if ("string" != typeof t) return 0 === t ? t : +t; t = t.replace(n, ""); var u = i.test(t); return u || o.test(t) ? a(t.slice(2), u ? 2 : 8) : r.test(t) ? NaN : +t }(t)) === 1 / 0 || t === -1 / 0) { return 17976931348623157e292 * (t < 0 ? -1 : 1) } return t == t ? t : 0 }(t) , u = e % 1; return e == e ? u ? e - u : e : 0 }(t), function() { return --t > 0 && (u = e.apply(this, arguments)), t <= 1 && (e = void 0), u } } function c(t) { var e = typeof t; return !!t && ("object" == e || "function" == e) } t.exports = function(t) { return u(2, t) } } , function(t, e, n) { "use strict"; var r = this && this.__awaiter || function(t, e, n, r) { return new (n || (n = Promise))((function(i, o) { function a(t) { try { u(r.next(t)) } catch (t) { o(t) } } function s(t) { try { u(r.throw(t)) } catch (t) { o(t) } } function u(t) { var e; t.done ? i(t.value) : (e = t.value, e instanceof n ? e : new n((function(t) { t(e) } ))).then(a, s) } u((r = r.apply(t, e || [])).next()) } )) } , i = this && this.__generator || function(t, e) { var n, r, i, o, a = { label: 0, sent: function() { if (1 & i[0]) throw i[1]; return i[1] }, trys: [], ops: [] }; return o = { next: s(0), throw: s(1), return: s(2) }, "function" == typeof Symbol && (o[Symbol.iterator] = function() { return this } ), o; function s(o) { return function(s) { return function(o) { if (n) throw new TypeError("Generator is already executing."); for (; a; ) try { if (n = 1, r && (i = 2 & o[0] ? r.return : o[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, o[1])).done) return i; switch (r = 0, i && (o = [2 & o[0], i.value]), o[0]) { case 0: case 1: i = o; break; case 4: return a.label++, { value: o[1], done: !1 }; case 5: a.label++, r = o[1], o = [0]; continue; case 7: o = a.ops.pop(), a.trys.pop(); continue; default: if (!(i = a.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== o[0] && 2 !== o[0])) { a = 0; continue } if (3 === o[0] && (!i || o[1] > i[0] && o[1] < i[3])) { a.label = o[1]; break } if (6 === o[0] && a.label < i[1]) { a.label = i[1], i = o; break } if (i && a.label < i[2]) { a.label = i[2], a.ops.push(o); break } i[2] && a.ops.pop(), a.trys.pop(); continue } o = e.call(t, a) } catch (t) { o = [6, t], r = 0 } finally { n = i = 0 } if (5 & o[0]) throw o[1]; return { value: o[0] ? o[1] : void 0, done: !0 } }([o, s]) } } } ; Object.defineProperty(e, "__esModule", { value: !0 }), e.DomUtilities = void 0; var o = n(0) , a = function() { function t() {} return t.hideImage = function(t, e) { var n = e.document.getElementById(t.id); n && (n.style.display = "none") } , t.addHiddenStyle = function(t, e, n) { return void 0 === n && (n = 100), r(this, void 0, void 0, (function() { var n = this; return i(this, (function(o) { return [2, new Promise((function(o, a) { return r(n, void 0, void 0, (function() { var n; return i(this, (function(r) { return null === (n = e.document.getElementById(t)) ? a() : (n.classList.remove("jsv-show"), n.classList.add("jsv-hidden"), setTimeout((function() { o() } ), 2e3)), [2] } )) } )) } ))] } )) } )) } , t.hideImageSlow = function(t, e, n) { return void 0 === n && (n = 100), r(this, void 0, void 0, (function() { var o = this; return i(this, (function(a) { return [2, new Promise((function(a, s) { return r(o, void 0, void 0, (function() { var r, o, u; return i(this, (function(i) { return "" === t && a(), null === (r = e.document.getElementById(t)) ? s() : (o = 1, u = setInterval((function() { (o -= 50 / n) <= 0 && (clearInterval(u), o = 0, r.style.display = "none", r.style.visibility = "hidden", a()), r.style.opacity = "" + o, r.style.filter = "alpha(opacity=" + 100 * o + ")" } ), 50)), [2] } )) } )) } ))] } )) } )) } , t.addShowStyle = function(t, e, n) { return void 0 === n && (n = 100), r(this, void 0, void 0, (function() { var n = this; return i(this, (function(o) { return [2, new Promise((function(o, a) { return r(n, void 0, void 0, (function() { var n; return i(this, (function(r) { return null === (n = e.document.getElementById(t)) ? a() : (n.classList.remove("jsv-hidden"), n.classList.add("jsv-show"), setTimeout((function() { o() } ), 2e3)), [2] } )) } )) } ))] } )) } )) } , t.addStyles = function(t) { var e = t.document.createElement("style"); e.innerText = "\n .jsv-hidden { \n opacity:0;\n display: none;\n transition: opacity .8s ease-in-out\n }\n .jsv-show {\n opacity:1;\n display:unset;\n transition: opacity .8s ease-in-out\n }\n ", document.head.appendChild(e) } , t.showImage = function(t, e) { var n = e.document.getElementById(t.id); if (!n) throw "could not find element with id " + t.id; n.style.display = "block", n.style.removeProperty("z-index"), n.style.removeProperty("width"), n.style.removeProperty("position"), n.style.removeProperty("opacity"), n.style.removeProperty("filter"), n.style.removeProperty("visibility") } , t.getImageHolderElement = function(t, e, n) { var r = t.document.createElement("div"); return r.style.padding = "0", r.style.margin = "0", r.style.position = "relative", r.style.width = "100%", r.style.height = "100%", r.id = n, r } , t.removeElement = function(t) { t && t.parentNode && t.parentNode.removeChild(t) } , t.getMainHolderElement = function(t, e, n, r) { var i = e.document.getElementById(t); if (i instanceof HTMLDivElement) return i.style.position = "relative", i; throw new o.default('Could not find main holder with id "' + t + '". Did you create an element like
') } , t.createLink = function(t, e) { var n = t.document.createElement("a"); n.title = atob("MzYwIHByb2R1Y3Qgdmlld2VyLCAzNjAgc3Bpbg=="), n.style.position = "absolute", n.style.bottom = "10px", n.style.right = "10px", n.style.zIndex = "300", n.style.color = "#ccc", n.href = atob("aHR0cHM6Ly93d3cuMzYwLWphdmFzY3JpcHR2aWV3ZXIuY29t"), n.innerText = atob("MzYwIHByb2R1Y3Qgdmlld2Vy"), e.appendChild(n) } , t.getImageElement = function(t, e) { var n = e.document.createElement("img"); return n.src = t.src, n.id = t.id, n.style.userSelect = "none", n.style.display = "none", n.style.touchAction = "pan-x", n.style.touchAction = "pan-y", n } , t.setPointer = function(t, e) { t.style.cursor = e } , t.setTouchAction = function(t, e) { e && (t.style.touchAction = e) } , t }(); e.DomUtilities = a } , function(t, e) { t.exports = function(t) { var e = {}; function n(r) { if (e[r]) return e[r].exports; var i = e[r] = { i: r, l: !1, exports: {} }; return t[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports } return n.m = t, n.c = e, n.d = function(t, e, r) { n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: r }) } , n.r = function(t) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(t, "__esModule", { value: !0 }) } , n.t = function(t, e) { if (1 & e && (t = n(t)), 8 & e) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) for (var i in t) n.d(r, i, function(e) { return t[e] } .bind(null, i)); return r } , n.n = function(t) { var e = t && t.__esModule ? function() { return t.default } : function() { return t } ; return n.d(e, "a", e), e } , n.o = function(t, e) { return Object.prototype.hasOwnProperty.call(t, e) } , n.p = "", n(n.s = 4) }([function(t, e, n) { "use strict"; function r(t, e, n) { return e in t ? Object.defineProperty(t, e, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = n, t } function i(t) { if (Array.isArray(t)) { for (var e = 0, n = Array(t.length); e < t.length; e++) n[e] = t[e]; return n } return Array.from(t) } Object.defineProperty(e, "__esModule", { value: !0 }); var o = n(1) , a = n(2) , s = function() { throw new Error("Slot not connected") }; e.defaultSlotConfig = { noBuffer: !1 }; var u = function(t) { return Object.assign((function() { return s() } ), { config: t, lazy: function() { return s }, on: function() { return s }, slotName: "Not connected" }) } , c = function(t, e) { return Object.keys(e).reduce((function(n, r) { return n.concat(e[r][t] || []) } ), []) } , l = function(t) { return Object.keys(t).reduce((function(e, n) { var r = t[n] , o = Object.keys(r).filter((function(t) { return (r[t] || []).length > 0 } )) , a = [].concat(i(e), i(o)); return [].concat(i(new Set(a))) } ), []) }; e.slot = function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : e.defaultSlotConfig; return u(t) } , e.connectSlot = function(t, e) { var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {} , s = e.reduce((function(t, e, n) { return Object.assign({}, t, r({}, n, {})) } ), r({}, "LOCAL_TRANSPORT", {})) , u = e.reduce((function(t, e, n) { return Object.assign({}, t, r({}, n, {})) } ), {}) , d = function(t, e) { var n = function() {} , r = new Promise((function(t) { return n = t } )); u[t][e] = { registered: r, onRegister: n } } , h = [] , f = [] , g = function(t) { return h.forEach((function(e) { return e(t) } )) } , p = function(t) { return f.forEach((function(e) { return e(t) } )) }; function m(t, r) { var l = 2 === arguments.length , h = l ? r : t , f = l ? t : a.DEFAULT_PARAM; if (n.noBuffer || 0 === e.length) { var g = c(f, s); return o.callHandlers(h, g) } e.forEach((function(t, e) { u[e][f] || d(String(e), f) } )); var p = e.reduce((function(t, e, n) { return [].concat(i(t), [u[n][f].registered]) } ), []); return Promise.all(p).then((function() { var t = c(f, s); return o.callHandlers(h, t) } )) } function v(t, e) { return h.push(t), f.push(e), l(s).forEach(t), function() { l(s).forEach(e); var n = h.indexOf(t); n > -1 && h.splice(n, 1); var r = f.indexOf(e); r > -1 && f.splice(r, 1) } } function y(n, r) { var i = "" , o = function() { return new Promise((function(t) { return t() } )) }; return "string" == typeof n ? (i = n, o = r || o) : (i = a.DEFAULT_PARAM, o = n), e.forEach((function(e) { return e.registerHandler(t, i, o) } )), s.LOCAL_TRANSPORT[i] = (s.LOCAL_TRANSPORT[i] || []).concat(o), 1 === c(i, s).length && g(i), function() { e.forEach((function(e) { return e.unregisterHandler(t, i, o) } )); var n = (s.LOCAL_TRANSPORT[i] || []).indexOf(o); -1 !== n && s.LOCAL_TRANSPORT[i].splice(n, 1), 0 === c(i, s).length && p(i) } } return e.forEach((function(e, n) { e.addRemoteHandlerRegistrationCallback(t, (function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : a.DEFAULT_PARAM , e = arguments[1] , r = s[n][t] || []; s[n][t] = r.concat(e), 1 === c(t, s).length && g(t), u[n][t] || d(String(n), t), u[n][t].onRegister() } )), e.addRemoteHandlerUnregistrationCallback(t, (function() { var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : a.DEFAULT_PARAM , e = arguments[1] , r = s[n][t] || [] , i = r.indexOf(e); i > -1 && s[n][t].splice(i, 1), 0 === c(t, s).length && p(t), d(String(n), t) } )) } )), Object.assign(m, { on: y, lazy: v, config: n, slotName: t }) } } , function(t, e, n) { "use strict"; function r(t, e) { var n = null; try { n = t(e) } catch (t) { return Promise.reject(t) } return n && n.then ? n : Promise.resolve(n) } Object.defineProperty(e, "__esModule", { value: !0 }), e.callHandlers = function(t, e) { return e && 0 !== e.length ? 1 === e.length ? r(e[0], t) : Promise.all(e.map((function(e) { return r(e, t) } ))) : new Promise((function(t) {} )) } } , function(t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), e.DEFAULT_PARAM = "$_DEFAULT_$" } , function(t, e, n) { "use strict"; var r = function() { function t(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value"in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } return function(e, n, r) { return n && t(e.prototype, n), r && t(e, r), e } }(); function i(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") } Object.defineProperty(e, "__esModule", { value: !0 }); var o = function() { function t() { var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 5e3; i(this, t), this._timeout = e, this._onMessageCallbacks = [], this._onConnectCallbacks = [], this._onDisconnectCallbacks = [], this._onErrorCallbacks = [], this._ready = !1 } return r(t, [{ key: "onData", value: function(t) { -1 === this._onMessageCallbacks.indexOf(t) && this._onMessageCallbacks.push(t) } }, { key: "onConnect", value: function(t) { this._ready && t(), this._onConnectCallbacks.push(t) } }, { key: "onDisconnect", value: function(t) { this._onDisconnectCallbacks.push(t) } }, { key: "onError", value: function(t) { this._onErrorCallbacks.push(t) } }, { key: "_messageReceived", value: function(t) { this._onMessageCallbacks.forEach((function(e) { return e(t) } )) } }, { key: "_error", value: function(t) { this._onErrorCallbacks.forEach((function(e) { return e(t) } )) } }, { key: "_connected", value: function() { this._ready = !0, this._onConnectCallbacks.forEach((function(t) { return t() } )) } }, { key: "_disconnected", value: function() { this._ready = !1, this._onDisconnectCallbacks.forEach((function(t) { return t() } )) } }, { key: "timeout", get: function() { return this._timeout } }]), t }(); e.GenericChannel = o } , function(t, e, n) { t.exports = n(5) } , function(t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }); var r = n(0); e.slot = r.slot; var i = n(6); e.combineEvents = i.combineEvents, e.createEventBus = i.createEventBus; var o = n(3); e.GenericChannel = o.GenericChannel; var a = n(8); e.ChunkedChannel = a.ChunkedChannel; var s = n(2); e.DEFAULT_PARAM = s.DEFAULT_PARAM } , function(t, e, n) { "use strict"; function r(t) { if (Array.isArray(t)) { for (var e = 0, n = Array(t.length); e < t.length; e++) n[e] = t[e]; return n } return Array.from(t) } Object.defineProperty(e, "__esModule", { value: !0 }); var i = n(0) , o = n(7); e.combineEvents = function(t, e, n, i, o, a, s, u, c, l, d, h, f, g, p, m, v, y, b, w, x, E, R, I) { var _ = Array.from(arguments) , k = _.reduce((function(t, e) { return [].concat(r(t), r(Object.keys(e))) } ), []) , D = [].concat(r(new Set(k))); if (k.length > D.length) throw new Error("ts-event-bus: duplicate slots encountered in combineEvents."); return Object.assign.apply(Object, [{}].concat(r(_))) } , e.createEventBus = function(t) { var e = (t.channels || []).map((function(t) { return new o.Transport(t) } )); return Object.keys(t.events).reduce((function(n, r) { var o = t.events[r].config; return n[r] = i.connectSlot(r, e, o), n } ), {}) } } , function(t, e, n) { "use strict"; var r = function() { function t(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value"in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } return function(e, n, r) { return n && t(e.prototype, n), r && t(e, r), e } }(); Object.defineProperty(e, "__esModule", { value: !0 }); var i = n(1) , o = 0 , a = function() { function t(e) { var n = this; !function(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }(this, t), this._channel = e, this._localHandlers = {}, this._localHandlerRegistrations = {}, this._remoteHandlers = {}, this._remoteHandlerRegistrationCallbacks = {}, this._remoteHandlerDeletionCallbacks = {}, this._pendingRequests = {}, this._channelReady = !1, this._channel.onData((function(t) { switch (t.type) { case "request": return n._requestReceived(t); case "response": return n._responseReceived(t); case "handler_registered": return n._registerRemoteHandler(t); case "handler_unregistered": return n._unregisterRemoteHandler(t); case "error": return n._errorReceived(t); default: !function(t) { throw new Error("Should not happen: " + t) }(t) } } )), this._channel.onConnect((function() { n._channelReady = !0, Object.keys(n._localHandlerRegistrations).forEach((function(t) { n._localHandlerRegistrations[t].forEach((function(t) { n._channel.send(t) } )) } )) } )), this._channel.onDisconnect((function() { n._channelReady = !1, n._unregisterAllRemoteHandlers(), n._rejectAllPendingRequests(new Error("REMOTE_CONNECTION_CLOSED")) } )), this._channel.onError((function(t) { return n._rejectAllPendingRequests(t) } )) } return r(t, [{ key: "_requestReceived", value: function(t) { var e = this , n = t.slotName , r = t.data , o = t.id , a = t.param , s = this._localHandlers[n]; if (s) { var u = s[a]; u && i.callHandlers(r, u).then((function(t) { return e._channel.send({ type: "response", slotName: n, id: o, data: t, param: a }) } )).catch((function(t) { return e._channel.send({ id: o, message: "" + t, param: a, slotName: n, stack: t.stack || "", type: "error" }) } )) } } }, { key: "_responseReceived", value: function(t) { var e = t.slotName , n = t.data , r = t.id , i = t.param , o = this._pendingRequests[e]; o && o[i] && o[i][r] && (o[i][r].resolve(n), delete o[i][r]) } }, { key: "_errorReceived", value: function(t) { var e = t.slotName , n = t.id , r = t.message , i = t.stack , o = t.param , a = this._pendingRequests[e]; if (a && a[o] && a[o][n]) { var s = new Error(r + " on " + e + " with param " + o); s.stack = i || s.stack, this._pendingRequests[e][o][n].reject(s), delete this._pendingRequests[e][o][n] } } }, { key: "_registerRemoteHandler", value: function(t) { var e = this , n = t.slotName , r = t.param , i = this._remoteHandlerRegistrationCallbacks[n]; if (i) { var a = this._remoteHandlers[n]; if (!a || !a[r]) { var s = function(t) { return new Promise((function(i, a) { if (!e._channelReady) return a(new Error("CHANNEL_NOT_READY on " + n)); var s = "" + o++; e._pendingRequests[n] = e._pendingRequests[n] || {}, e._pendingRequests[n][r] = e._pendingRequests[n][r] || {}, e._pendingRequests[n][r][s] = { resolve: i, reject: a }, e._channel.send({ type: "request", id: s, slotName: n, param: r, data: t }), setTimeout((function() { var t = ((e._pendingRequests[n] || {})[r] || {})[s]; if (t) { var i = new Error("TIMED_OUT on " + n + " with param " + r); t.reject(i), delete e._pendingRequests[n][r][s] } } ), e._channel.timeout) } )) }; this._remoteHandlers[n] = this._remoteHandlers[n] || {}, this._remoteHandlers[n][r] = s, i(r, s) } } } }, { key: "_unregisterRemoteHandler", value: function(t) { var e = t.slotName , n = t.param , r = this._remoteHandlerDeletionCallbacks[e] , i = this._remoteHandlers[e]; if (i) { var o = i[n]; o && r && (r(n, o), delete this._remoteHandlers[e][n]) } } }, { key: "_unregisterAllRemoteHandlers", value: function() { var t = this; Object.keys(this._remoteHandlerDeletionCallbacks).forEach((function(e) { var n = t._remoteHandlers[e]; n && Object.keys(n).filter((function(t) { return n[t] } )).forEach((function(n) { return t._unregisterRemoteHandler({ slotName: e, param: n }) } )) } )) } }, { key: "_rejectAllPendingRequests", value: function(t) { var e = this; Object.keys(this._pendingRequests).forEach((function(n) { Object.keys(e._pendingRequests[n]).forEach((function(r) { Object.keys(e._pendingRequests[n][r]).forEach((function(i) { e._pendingRequests[n][r][i].reject(t) } )) } )), e._pendingRequests[n] = {} } )) } }, { key: "addRemoteHandlerRegistrationCallback", value: function(t, e) { this._remoteHandlerRegistrationCallbacks[t] || (this._remoteHandlerRegistrationCallbacks[t] = e) } }, { key: "addRemoteHandlerUnregistrationCallback", value: function(t, e) { this._remoteHandlerDeletionCallbacks[t] || (this._remoteHandlerDeletionCallbacks[t] = e) } }, { key: "registerHandler", value: function(t, e, n) { if (this._localHandlers[t] = this._localHandlers[t] || {}, this._localHandlers[t][e] = this._localHandlers[t][e] || [], this._localHandlers[t][e].push(n), 1 === this._localHandlers[t][e].length) { var r = { type: "handler_registered", param: e, slotName: t }; this._localHandlerRegistrations[e] = this._localHandlerRegistrations[e] || [], this._localHandlerRegistrations[e].push(r), this._channelReady && this._channel.send(r) } } }, { key: "unregisterHandler", value: function(t, e, n) { var r = this._localHandlers[t]; if (r && r[e]) { var i = r[e].indexOf(n); if (i > -1 && (r[e].splice(i, 1), 0 === r[e].length)) { var o = { type: "handler_unregistered", param: e, slotName: t }; this._channelReady && this._channel.send(o) } } } }]), t }(); e.Transport = a } , function(t, e, n) { "use strict"; var r = function() { function t(t, e) { for (var n = 0; n < e.length; n++) { var r = e[n]; r.enumerable = r.enumerable || !1, r.configurable = !0, "value"in r && (r.writable = !0), Object.defineProperty(t, r.key, r) } } return function(e, n, r) { return n && t(e.prototype, n), r && t(e, r), e } }() , i = function t(e, n, r) { null === e && (e = Function.prototype); var i = Object.getOwnPropertyDescriptor(e, n); if (void 0 === i) { var o = Object.getPrototypeOf(e); return null === o ? void 0 : t(o, n, r) } if ("value"in i) return i.value; var a = i.get; return void 0 !== a ? a.call(r) : void 0 }; Object.defineProperty(e, "__esModule", { value: !0 }); var o = n(3) , a = n(9) , s = function(t) { if (!t.chunkId) throw new Error("ChunkedMessage did not have a chunkId: " + JSON.stringify(t)) } , u = function(t) { function e(t) { !function(t, e) { if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function") }(this, e); var n = function(t, e) { if (!t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !e || "object" != typeof e && "function" != typeof e ? t : e }(this, (e.__proto__ || Object.getPrototypeOf(e)).call(this, t.timeout)); return n._buffer = {}, n._chunkSize = t.chunkSize, n._sender = t.sender, n._maxStringAlloc = t.maxStringAlloc || -1, n } return function(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, enumerable: !1, writable: !0, configurable: !0 } }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e) }(e, t), r(e, [{ key: "send", value: function(t) { var e = this , n = JSON.stringify(t); if (n.length <= this._chunkSize) this._sender(t); else { var r = function(t) { for (var e = new Uint16Array(t.length), n = 0, r = t.length; n < r; n++) e[n] = t.charCodeAt(n); return e }(n) , i = [].concat(function(t) { if (Array.isArray(t)) { for (var e = 0, n = Array(t.length); e < t.length; e++) n[e] = t[e]; return n } return Array.from(t) }(Array(30))).map((function() { return Math.random().toString(36)[3] } )).join(""); this._sender({ type: "chunk_start", chunkId: i, size: n.length }), !function t() { var n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0 , o = r.slice(n, n + e._chunkSize); o.length && (e._sender({ type: "chunk_data", chunkId: i, data: Array.from(o) }), t(n + e._chunkSize)) }(), this._sender({ type: "chunk_end", chunkId: i }) } } }, { key: "_messageReceived", value: function(t) { switch (t.type) { case "chunk_start": this._receiveNewChunk(t); break; case "chunk_data": this._receiveChunkData(t); break; case "chunk_end": var n = this._mergeChunks(t); i(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "_messageReceived", this).call(this, n); break; default: i(e.prototype.__proto__ || Object.getPrototypeOf(e.prototype), "_messageReceived", this).call(this, t) } } }, { key: "_receiveNewChunk", value: function(t) { if (s(t), this._buffer[t.chunkId]) throw new Error("There was already an entry in the buffer for chunkId " + t.chunkId); this._buffer[t.chunkId] = { id: t.chunkId, chunks: [], size: t.size } } }, { key: "_receiveChunkData", value: function(t) { if (s(t), !this._buffer[t.chunkId]) throw new Error("ChunkId " + t.chunkId + " was not found in the buffer"); this._buffer[t.chunkId].chunks.push(t.data) } }, { key: "_mergeChunks", value: function(t) { if (s(t), !this._buffer[t.chunkId]) throw new Error("ChunkId " + t.chunkId + " was not found in the buffer"); var e = this._buffer[t.chunkId].chunks.reduce((function(t, e, n) { return e.forEach((function(e, n) { return t.uintArray[t.currentIx + n] = e } )), t.currentIx += e.length, t } ), { uintArray: new Uint16Array(this._buffer[t.chunkId].size), currentIx: 0 }) , n = void 0 , r = function(t, e) { if (-1 === e) return String.fromCharCode.apply(null, t); for (var n = "", r = 0; r < t.length; r += e) r + e > t.length ? n += String.fromCharCode.apply(null, t.subarray(r)) : n += String.fromCharCode.apply(null, t.subarray(r, r + e)); return n }(e.uintArray, this._maxStringAlloc); try { n = JSON.parse(r) } catch (t) { throw new Error("Not a valid JSON string: " + r) } if (!a.isTransportMessage(n)) throw new Error("Not a transport message: " + JSON.stringify(n)); return n } }]), e }(o.GenericChannel); e.ChunkedChannel = u } , function(t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), e.isTransportMessage = function(t) { switch (t.type) { case "request": case "response": case "error": case "handler_unregistered": case "handler_registered": return !0; default: return !1 } } } ]) } , function(t, e, n) { "use strict"; var r = this && this.__awaiter || function(t, e, n, r) { return new (n || (n = Promise))((function(i, o) { function a(t) { try { u(r.next(t)) } catch (t) { o(t) } } function s(t) { try { u(r.throw(t)) } catch (t) { o(t) } } function u(t) { var e; t.done ? i(t.value) : (e = t.value, e instanceof n ? e : new n((function(t) { t(e) } ))).then(a, s) } u((r = r.apply(t, e || [])).next()) } )) } , i = this && this.__generator || function(t, e) { var n, r, i, o, a = { label: 0, sent: function() { if (1 & i[0]) throw i[1]; return i[1] }, trys: [], ops: [] }; return o = { next: s(0), throw: s(1), return: s(2) }, "function" == typeof Symbol && (o[Symbol.iterator] = function() { return this } ), o; function s(o) { return function(s) { return function(o) { if (n) throw new TypeError("Generator is already executing."); for (; a; ) try { if (n = 1, r && (i = 2 & o[0] ? r.return : o[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, o[1])).done) return i; switch (r = 0, i && (o = [2 & o[0], i.value]), o[0]) { case 0: case 1: i = o; break; case 4: return a.label++, { value: o[1], done: !1 }; case 5: a.label++, r = o[1], o = [0]; continue; case 7: o = a.ops.pop(), a.trys.pop(); continue; default: if (!(i = a.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== o[0] && 2 !== o[0])) { a = 0; continue } if (3 === o[0] && (!i || o[1] > i[0] && o[1] < i[3])) { a.label = o[1]; break } if (6 === o[0] && a.label < i[1]) { a.label = i[1], i = o; break } if (i && a.label < i[2]) { a.label = i[2], a.ops.push(o); break } i[2] && a.ops.pop(), a.trys.pop(); continue } o = e.call(t, a) } catch (t) { o = [6, t], r = 0 } finally { n = i = 0 } if (5 & o[0]) throw o[1]; return { value: o[0] ? o[1] : void 0, done: !0 } }([o, s]) } } } ; Object.defineProperty(e, "__esModule", { value: !0 }), e.JavascriptViewer = void 0; var o = n(6) , a = n(3) , s = n(1) , u = n(15) , c = n(4) , l = n(16) , d = n(17) , h = n(0) , f = n(18) , g = n(20) , p = { license: "", mainImageId: "jsv-image", mainHolderId: "jsv-holder", totalFrames: 72, imageUrls: [], speed: 80, inertia: 20, defaultProgressBar: !0, firstImageNumber: 1, imageUrlFormat: "", startFrameNo: 1, reverse: !1, autoRotate: 0, autoRotateSpeed: 0, autoRotateReverse: !1, enableImageEvents: !1, zoom: !1, zoomWheelSpeed: 50, zoomMax: 2, stopAtEdges: !1, enableChangeImageEvent: !1, cursorConfig: { default: "grab", drag: "grabbing", zoomIn: "zoom-in", zoomOut: "zoom-out", pan: "move" }, touchConfig: { default: "pan-y", drag: "pan-y", zoomIn: "pan-x", zoomOut: "pan-x", pan: "pan-x" }, autoCDNResizer: !1, notificationConfig: { dragToRotate: { showStartToRotateDefaultNotification: !1, imageUrl: "", languages: [], mainColor: "rgba(0,0,0,0.20)", textColor: "rgba(243,237,237,0.80)" } } } , m = function() { function t(e) { this.isStarted = !1, this.isDragged = !1, this.images = [], this.currentImageNumber = 1, this.previousImageNumber = 1, this.desiredRotationInDegrees = 0, this.mainImage = null, this.mainHolderElement = null, this.uniqueId = "", this.currentDegree = 0, this.currentSpeed = 0, this.inAnimation = !1, this.desiredRotationInDegreesStartSlowingDown = null, this.useEasing = !0, this.updateInAction = !1, this.window = null, this.startDragInvocations = 0, this.firstDrag = !1, this.standbyRefreshRate = 40, this.previousTargetDegree = null, this.nAutoRotations = 0, this.dragAllowed = !0, this.currentPointer = "default", this.currentTouch = "default", this.zoomPointerTimeout = null, this.zoom = null, this.options = s.mergeDeep({ objects: [p, e] }), this.currentSpeed = this.options.speed, this.options.totalFrames = this.getTotalFrames(), this.eventBus = t.initEventBus(), this.runningInBrowser() && (this.window = "undefined" != typeof window ? window : null) } return t.initEventBus = function() { return c.createEventBus({ events: l.default, channels: [] }) } , t.prototype.runningInBrowser = function() { return "undefined" != typeof window } , t.prototype.events = function() { return this.eventBus } , t.prototype.setSpeed = function(t) { this.currentSpeed = t > 999 || t < -999 ? 999 : t } , t.prototype.setInertia = function(t) { this.options.inertia = t > 99 ? 99 : t < 1 ? 1 : t } , t.prototype.initProgressBar = function() { if (this.options.defaultProgressBar) { this.options.mainImageId && o.Images.blurMainImage(this.options.mainImageId, this.window); var t = o.Images.createProgressBar(this.uniqueId, this.window, this.mainHolderElement) , e = new d.default(0,t.firstChild); this.eventBus.loadImage.on((function(t) { e.update(t.percentage) } )), this.eventBus.started.on((function() { t.style.display = "none" } )) } } , t.prototype.documentIsReady = function() { return "complete" === this.window.document.readyState } , t.prototype.isB = function() { var t = new RegExp(atob("KGdvb2dsZWJvdC98Ym90fEdvb2dsZWJvdC1Nb2JpbGV8R29vZ2xlYm90LUltYWdlfEdvb2dsZSBmYXZpY29ufE1lZGlhcGFydG5lcnMtR29vZ2xlfGJpbmdib3R8c2x1cnB8amF2YXx3Z2V0fGN1cmx8Q29tbW9ucy1IdHRwQ2xpZW50fFB5dGhvbi11cmxsaWJ8bGlid3d3fGh0dHB1bml0fG51dGNofHBocGNyYXdsfG1zbmJvdHxqeXhvYm90fEZBU1QtV2ViQ3Jhd2xlcnxGQVNUIEVudGVycHJpc2UgQ3Jhd2xlcnxiaWdsb3Ryb258dGVvbWF8Y29udmVyYXxzZWVrYm90fGdpZ2FibGFzdHxleGFib3R8bmdib3R8aWFfYXJjaGl2ZXJ8R2luZ2VyQ3Jhd2xlcnx3ZWJtb24gfGh0dHJhY2t8d2ViY3Jhd2xlcnxncnViLm9yZ3xVc2luZU5vdXZlbGxlQ3Jhd2xlcnxhbnRpYm90fG5ldHJlc2VhcmNoc2VydmVyfHNwZWVkeXxmbHVmZnl8YmlibnVtLmJuZnxmaW5kbGlua3xtc3Jib3R8cGFuc2NpZW50fHlhY3lib3R8QUlTZWFyY2hCb3R8SU9JfGlwcy1hZ2VudHx0YWdvb2JvdHxNSjEyYm90fGRvdGJvdHx3b3Jpb2JvdHx5YW5nYXxidXp6Ym90fG1sYm90fHlhbmRleGJvdHxwdXJlYm90fExpbmd1ZWUgQm90fFZveWFnZXJ8Q3liZXJQYXRyb2x8dm9pbGFib3R8YmFpZHVzcGlkZXJ8Y2l0ZXNlZXJ4Ym90fHNwYm90fHR3ZW5nYWJvdHxwb3N0cmFua3x0dXJuaXRpbmJvdHxzY3JpYmRib3R8cGFnZTJyc3N8c2l0ZWJvdHxsaW5rZGV4fEFkaWR4Ym90fGJsZWtrb2JvdHxlem9vbXN8ZG90Ym90fE1haWwuUlVfQm90fGRpc2NvYm90fGhlcml0cml4fGZpbmR0aGF0ZmlsZXxldXJvcGFyY2hpdmUub3JnfE5lcmRCeU5hdHVyZS5Cb3R8c2lzdHJpeCBjcmF3bGVyfGFocmVmc2JvdHxBYm91bmRleHxkb21haW5jcmF3bGVyfHdic2VhcmNoYm90fHN1bW1pZnl8Y2Nib3R8ZWRpc3RlcmJvdHxzZXpuYW1ib3R8ZWMybGlua2ZpbmRlcnxnc2xmYm90fGFpaGl0Ym90fGludGVsaXVtX2JvdHxmYWNlYm9va2V4dGVybmFsaGl0fHlldGl8UmV0cmV2b1BhZ2VBbmFseXplcnxsYi1zcGlkZXJ8c29nb3V8bHNzYm90fGNhcmVlcmJvdHx3b3Rib3h8d29jYm90fGljaGlyb3xEdWNrRHVja0JvdHxsc3Nyb2NrZXRjcmF3bGVyfGRydXBhY3R8d2ViY29tcGFueWNyYXdsZXJ8YWNvb25ib3R8b3BlbmluZGV4c3BpZGVyfGduYW0gZ25hbSBzcGlkZXJ8d2ViLWFyY2hpdmUtbmV0LmNvbS5ib3R8YmFja2xpbmtjcmF3bGVyfGNvY2NvY3xpbnRlZ3JvbWVkYnxjb250ZW50IGNyYXdsZXIgc3BpZGVyfHRvcGxpc3Rib3R8c2Vva2lja3Mtcm9ib3R8aXQybWVkaWEtZG9tYWluLWNyYXdsZXJ8aXAtd2ViLWNyYXdsZXIuY29tfHNpdGVleHBsb3Jlci5pbmZvfGVsaXNhYm90fHByb3hpbWljfGNoYW5nZWRldGVjdGlvbnxibGV4Ym90fGFyYWJvdHxXZVNFRTpTZWFyY2h8bmlraS1ib3R8Q3J5c3RhbFNlbWFudGljc0JvdHxyb2dlcmJvdHwzNjBTcGlkZXJ8cHNib3R8SW50ZXJmYXhTY2FuQm90fExpcHBlcmhleSBTRU8gU2VydmljZXxDQyBNZXRhZGF0YSBTY2FwZXJ8ZzAwZzFlLm5ldHxHcmFwZXNob3RDcmF3bGVyfHVybGFwcGVuZGJvdHxicmFpbm9ib3R8ZnItY3Jhd2xlcnxiaW5sYXJ8U2ltcGxlQ3Jhd2xlcnxMaXZlbGFwYm90fFR3aXR0ZXJib3R8Y1hlbnNlYm90fHNtdGJvdHxibmYuZnJfYm90fEE2LUluZGV4ZXJ8QURtYW50WHxGYWNlYm90fFR3aXR0ZXJib3R8T3JhbmdlQm90fG1lbW9yeWJvdHxBZHZCb3R8TWVnYUluZGV4fFNlbWFudGljU2Nob2xhckJvdHxsdHg3MXxuZXJkeWJvdHx4b3ZpYm90fEJVYmlOR3xRd2FudGlmeXxhcmNoaXZlLm9yZ19ib3R8QXBwbGVib3R8VHdlZXRtZW1lQm90fGNyYXdsZXI0anxmaW5keGJvdHxTZW1ydXNoQm90fHlvb3pCb3R8bGlwcGVyaGV5fHkhai1hc3J8RG9tYWluIFJlLUFuaW1hdG9yIEJvdHxBZGRUaGlzKQ=="),"i") , e = this.window.navigator.userAgent; return t.test(e) } , t.prototype.isLocalhost = function() { var t = this.window.location.hostname , e = this.window.location.port; return Boolean(-1 !== t.indexOf("dev.") || -1 !== t.indexOf("beta.") || -1 !== t.indexOf("file") || "" !== e || "localhost" === t || "[::1]" === t || t.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)) } , t.prototype.isV = function() { var t = this.window.location.host; return g.Helper.isValid(this.options.license, t) } , t.prototype.getFirstImageIndex = function() { return this.options.firstImageNumber && this.options.firstImageNumber > 0 && this.options.firstImageNumber - 1 < this.images.length ? this.options.firstImageNumber - 1 : 0 } , t.prototype.destroy = function() { return r(this, void 0, void 0, (function() { var e = this; return i(this, (function(n) { return [2, new Promise((function(n, r) { try { if (e.isStarted) { var i = e.window.document.getElementById(e.uniqueId); if (i && a.DomUtilities.removeElement(i), e.options.defaultProgressBar) { var o = e.window.document.getElementById("loader_" + e.uniqueId); a.DomUtilities.removeElement(o); var s = e.window.document.getElementById("link_" + e.uniqueId); a.DomUtilities.removeElement(s) } if (e.options.notificationConfig.dragToRotate.showStartToRotateDefaultNotification || e.options.notificationConfig.dragToRotate.imageUrl.length > 0) { var u = e.window.document.getElementById("notification_" + e.uniqueId); a.DomUtilities.removeElement(u) } a.DomUtilities.showImage(e.mainImage, e.window), e.mainHolderElement.outerHTML = e.mainHolderElement.outerHTML, e.isStarted = !1, e.images = [], e.mainImage = null, e.mainHolderElement = null, e.firstDrag = !1, e.eventBus = t.initEventBus(), n(!0) } else n(!1) } catch (t) { var c = "error with destroying viewer"; t instanceof Error && (c += t.toString()), r(c) } } ))] } )) } )) } , t.prototype.start = function() { return r(this, void 0, void 0, (function() { var t = this; return i(this, (function(e) { switch (e.label) { case 0: return this.documentIsReady() ? [3, 2] : [4, new Promise((function(t) { setTimeout((function() { t() } ), 200) } )).then((function() { return t.start() } ))]; case 1: return e.sent(), [3, 3]; case 2: return [2, this.startPresentation()]; case 3: return [2] } } )) } )) } , t.prototype.startPresentation = function() { return r(this, void 0, void 0, (function() { var t = this; return i(this, (function(e) { return [2, new Promise((function(e, n) { try { if (t.isStarted && n("Viewer " + t.uniqueId + " already started"), t.runningInBrowser() || n("Viewer " + t.uniqueId + " not started in browser"), a.DomUtilities.addStyles(t.window), t.registerStartEvents(), t.registerInputEvents(), t.mainImage = o.Images.getMainImage(t.options.mainImageId, t.window), t.mainHolderElement = a.DomUtilities.getMainHolderElement(t.options.mainHolderId, t.window, t.isB(), t.isLocalhost()), !t.isB() || t.isLocalhost() || t.isV() || a.DomUtilities.createLink(t.window, t.mainHolderElement), !t.isV() && !t.isLocalhost()) { var u = JSON.parse(JSON.stringify(t.options.notificationConfig)); u.dragToRotate.mainColor = "rgb(255 ,255,255)", u.dragToRotate.textColor = "rgb(55, 25, 2)", t.eventBus.startDragging.on((function(e) { if (e.invocations > 3) { clearTimeout(t.pbto); var n = o.Images.createOrGetPoweredBy(u, t.uniqueId, t.window, t.mainHolderElement, t.isLocalhost()); t.pbto = setTimeout((function() { a.DomUtilities.addHiddenStyle(n.id, t.window, 300).then((function() { a.DomUtilities.removeElement(n) } )) } ), 3e3) } } )) } t.uniqueId = t.uniqueId || s.getRandomId(), t.initProgressBar(), t.getImages().then((function(o) { return r(t, void 0, void 0, (function() { var t, r = this; return i(this, (function(i) { return this.images = o, t = a.DomUtilities.getImageHolderElement(this.window, this.mainHolderElement, this.uniqueId), [2, this.prepareImageHolder(t).then((function() { return r.mainHolderElement.appendChild(t), a.DomUtilities.hideImageSlow(r.mainImage.id, r.window).then((function() { r.inAnimation || (a.DomUtilities.showImage(r.images[r.getFirstImageIndex()], r.window), r.currentImageNumber = r.options.firstImageNumber || 1, r.previousImageNumber = r.options.firstImageNumber || 1, r.setCurrentDegree(r.currentImageNumber)), r.isStarted = !0, r.eventBus.started(!0), e() } )).catch((function(t) { r.handleError(t, n) } )) } )).catch((function(t) { r.handleError(t, n) } ))] } )) } )) } )).catch((function(e) { t.handleError(e, n) } )) } catch (e) { t.handleError(e, n) } } ))] } )) } )) } , t.prototype.handleError = function(t, e) { var n = this , r = "unknow error"; t instanceof Error && (r = t.toString(), this.reportError(r), this.destroy().then((function() { e(t.toString()) } )).catch((function(t) { n.reportError(t) } ))), e(r) } , t.prototype.registerInputEvents = function() { var t = this; this.eventBus.pinch.on((function(e) { return t.onPinchListener(e) } )), this.eventBus.doubleClick.on((function(e) { return t.onDoubleClickListener(e) } )), this.eventBus.scroll.on((function(e) { return t.onScrollListener(e) } )) } , t.prototype.startDragToRotateNotification = function() { o.Images.createReadyNotification(this.options.notificationConfig, this.uniqueId, this.window, this.mainHolderElement) } , t.prototype.hideDragToRotateNotification = function() { var t = this; this.unsubscribe(), this.options.zoom && this.zoomUnsubscribe(), o.Images.hideReadyNotification(this.options.notificationConfig, this.uniqueId, this.window).then((function() { var e = t.window.document.getElementById("notification_" + t.uniqueId); a.DomUtilities.removeElement(e) } )) } , t.prototype.registerStartEvents = function() { var t = this; (this.options.notificationConfig.dragToRotate.showStartToRotateDefaultNotification || this.options.notificationConfig.dragToRotate.imageUrl.length > 0) && (this.eventBus.started.on((function() { return t.startDragToRotateNotification() } )), this.unsubscribe = this.eventBus.startDragging.on((function() { return t.hideDragToRotateNotification() } )), this.options.zoom && (this.zoomUnsubscribe = this.eventBus.pinch.on((function() { return t.hideDragToRotateNotification() } )))), this.options.zoom && this.eventBus.started.on((function(e) { return t.registerZoom(e) } )), this.options.autoRotate > 0 && this.eventBus.started.on((function(e) { return t.runAutoRotate(e) } )) } , t.prototype.runAutoRotate = function(t) { var e = this; t ? this.autoRotate(this.options.autoRotate).then((function(t) { e.eventBus.endAutoRotate({ currentDegree: e.currentDegree, currentImage: e.images[e.currentImageNumber - 1], completed: t }) } )).catch((function(t) { e.reportError(t) } )) : this.destroy().then((function() { e.reportWarning("Failed starting autorotate") } )).catch((function(t) { return e.reportError(t) } )) } , t.prototype.registerZoom = function(t) { t && (this.zoom = new f.DefaultZoom(this.window,this.images,this.mainHolderElement,this.options.zoomMax)) } , t.prototype.onPinchListener = function(t) { var e, n = this; this.options.zoom && (this.dragAllowed = !1, null === (e = this.zoom) || void 0 === e || e.pinch(t, this.images[this.currentImageNumber - 1]), setTimeout((function() { n.dragAllowed = !0 } ), 1e3)) } , t.prototype.onDoubleClickListener = function(t) { var e, n; this.options.zoom && (null === (e = this.zoom) || void 0 === e ? void 0 : e.isZoomed()) && (null === (n = this.zoom) || void 0 === n || n.reset(this.images[this.currentImageNumber - 1]), this.setPointer("default")) } , t.prototype.onScrollListener = function(t) { var e, n, r = this; if (this.options.zoom) { this.cancelCurrentActions(), this.zoomPointerTimeout && clearTimeout(this.zoomPointerTimeout), null === (e = this.zoom) || void 0 === e || e.scroll(t, this.options.zoomWheelSpeed, this.images[this.currentImageNumber - 1]); var i = t.originalEvent.deltaY; (null === (n = this.zoom) || void 0 === n ? void 0 : n.isZoomed()) ? (i < 0 ? this.setPointer("zoomIn") : this.setPointer("zoomOut"), this.zoomPointerTimeout = this.window.setTimeout((function() { r.setPointer("pan") } ), 500)) : this.setPointer("default") } } , t.prototype.prepareImageHolder = function(t) { return r(this, void 0, void 0, (function() { var e, n, o, s, c, l = this; return i(this, (function(d) { return e = [], n = function(t, e) { return r(l, void 0, void 0, (function() { var n = this; return i(this, (function(r) { return [2, new Promise((function(r, i) { for (var o = [], a = 0; a < t.length; a++) o.push(e.call(n, t[a], a)); Promise.all(o).then((function(t) { return r(t) } )).catch((function(t) { return i(t) } )) } ))] } )) } )) } , o = function(n, r) { (l.options.zoom || l.options.enableImageEvents) && l.addZoomEvents(n), e.push(n), l.images[r].encoded = "", t.appendChild(n) } , s = function(t, e) { return new Promise((function(n, r) { var i = a.DomUtilities.getImageElement(t, l.window); i instanceof HTMLImageElement ? i.decode().then((function() { o.call(l, i, e), n(!0) } )).catch((function() { o.call(l, i, e), n(!1) } )) : r("could not find element with id " + t.id) } )) } , c = function() { var t, n; (l.options.zoom || l.options.enableImageEvents) && (null === (t = l.mainHolderElement) || void 0 === t || t.addEventListener("wheel", l.onScroll.bind(l), { passive: !1 }), null === (n = l.mainHolderElement) || void 0 === n || n.addEventListener("dblclick", l.onDoubleClick.bind(l), { passive: !0 })), new u.default(e,{ container: l.mainHolderElement, dragstart: l.dragStart.bind(l), dragend: l.dragEnd.bind(l), drag: l.drag.bind(l), preventDefault: !1, events: ["mouse", "touch"] }) } , [2, new Promise((function(t, e) { n(l.images, s).then((function() { c(), t() } )).catch((function(t) { e(t) } )) } ))] } )) } )) } , t.prototype.addZoomEvents = function(t) { var e = this; t.addEventListener("click", this.onClick.bind(this)), this.onScale(t, (function(t, n, r) { t > .5 && e.events().pinch({ completed: !0, currentImage: e.images[e.currentImageNumber - 1], currentDegree: e.currentDegree, originalEvent: r, scale: t, first: n }) } )) } , t.prototype.setPointer = function(t) { if (this.currentPointer !== t) { var e = this.options.cursorConfig[t]; this.currentPointer = t, a.DomUtilities.setPointer(this.mainHolderElement, e) } var n = this.options.touchConfig[t]; this.currentTouch !== n && (this.currentTouch = n, a.DomUtilities.setTouchAction(this.mainHolderElement, n)) } , t.prototype.onScale = function(t, e) { var n, r = this, i = !0, o = 0, a = !1; t.addEventListener("touchmove", (function(t) { if (2 === t.targetTouches.length) { var r = Math.hypot(t.targetTouches[0].pageX - t.targetTouches[1].pageX, t.targetTouches[0].pageY - t.targetTouches[1].pageY); a = !0, e(r, i, t), void 0 === n && (n = r, i = !1) } } ), { capture: !1, passive: !0 }), t.addEventListener("touchend", (function(t) { var e, s; if (n = void 0, i = !0, (null === (e = r.zoom) || void 0 === e ? void 0 : e.isZoomed()) && !a) { var u = (new Date).getTime() , c = u - o; clearTimeout(void 0), c < 500 && c > 0 && (null === (s = r.zoom) || void 0 === s || s.reset(r.images[r.currentImageNumber - 1])), o = u } a = !1 } ), { capture: !1, passive: !0 }) } , t.prototype.onClick = function(t) { this.events().click({ currentDegree: this.currentDegree, currentImage: this.images[this.currentImageNumber - 1], completed: !0, originalEvent: t }) } , t.prototype.onScroll = function(t) { t.preventDefault(), this.events().scroll({ currentDegree: this.currentDegree, currentImage: this.images[this.currentImageNumber - 1], completed: !0, originalEvent: t }) } , t.prototype.onDoubleClick = function(t) { this.events().doubleClick({ currentDegree: this.currentDegree, currentImage: this.images[this.currentImageNumber - 1], completed: !0, originalEvent: t }) } , t.prototype.reportError = function(t) { t += " | " + this.window.location.href, t += " | " + JSON.stringify(this.options), console.error("360 Javascript Viewer: " + t); var e = btoa(t) , n = new XMLHttpRequest; n.open("GET", "https://www.360-javascriptviewer.com/err?t=" + e, !0), n.send() } , t.prototype.reportWarning = function(t) { this.options.defaultProgressBar && console.warn("360 Javascript Viewer: " + t) } , t.prototype.updateImage = function() { var t = this; this.updateInAction = !0; if (0 === this.desiredRotationInDegrees) return this.inAnimation = !1, this.updateInAction = !1, this.desiredRotationInDegreesStartSlowingDown = null, new Promise((function(e) { e({ currentDegree: t.currentDegree }) } )); var e, n = this.getNextImageNumber(); if (this.options.stopAtEdges && !this.inAnimation) { var r = this.images.length; if (1 === this.previousImageNumber && n === r || this.previousImageNumber === r && 1 === n) return this.updateInAction = !1, new Promise((function(e) { e({ currentDegree: t.currentDegree }) } )) } return this.setCurrentImage(n), (e = this.getCurrentRefreshRate(), new Promise((function(t) { return setTimeout(t, e) } ))).then((function() { return t.updateImage() } )) } , t.prototype.zoomTo = function(t, e, n) { var r = this; return new Promise((function(i, o) { var a, s; if (r.options.zoom) { t > r.options.zoomMax && o("supplied zoom factor " + t + " higher then max zoom of " + r.options.zoomMax); var u = r.images[r.currentImageNumber - 1]; null === (a = r.zoom) || void 0 === a || a.reset(u), null === (s = r.zoom) || void 0 === s || s.zoom(t, e, n, u), r.setPointer(t > 1 ? "zoomIn" : "zoomOut"), i() } else o("zoom not activated") } )) } , t.prototype.rotateDegrees = function(t) { return this.inAnimation = !0, this.desiredRotationInDegrees = t, this.updateImage() } , t.prototype.resetZoom = function() { var t = this; return new Promise((function(e, n) { var r; t.options.zoom || n("zoom is not activated"), null === (r = t.zoom) || void 0 === r || r.reset(t.images[t.currentImageNumber - 1]), t.setPointer("default"), setTimeout((function() { e() } ), 500) } )) } , t.prototype.isZoomedIn = function() { var t; return !!this.options.zoom && (!!this.zoom && (null === (t = this.zoom) || void 0 === t ? void 0 : t.isZoomed())) } , t.prototype.rotateToFrame = function(t, e, n) { void 0 === e && (e = !0), void 0 === n && (n = !0); var r = 360 / this.options.totalFrames * (t - 1); return this.rotateToDegree(r, e, n) } , t.prototype.rotateToDegree = function(t, e, n) { var r = this; if (void 0 === e && (e = !0), void 0 === n && (n = !0), this.inAnimation = !0, this.cancelCurrentActions(), this.useEasing = n, this.desiredRotationInDegrees = 0, t = Math.round(t), this.previousTargetDegree === t || t === this.currentDegree) return this.useEasing = !0, new Promise((function(t) { t({ currentDegree: r.currentDegree }) } )); this.inAnimation = !0; var i = t > this.currentDegree ? t - this.currentDegree : 360 - this.currentDegree + t , o = t < this.currentDegree ? -1 * (this.currentDegree - t) : -1 * (this.currentDegree + (360 - t)); return this.desiredRotationInDegrees = e && Math.abs(o) < i ? o : i, this.previousTargetDegree = t, this.updateImage() } , t.prototype.cancelCurrentActions = function() { this.desiredRotationInDegrees = 0, this.previousTargetDegree = null, this.nAutoRotations = 0 } , t.prototype.dragEnd = function() { var t; this.isDragged = !1, this.options.zoom && (null === (t = this.zoom) || void 0 === t ? void 0 : t.isZoomed()) ? this.setPointer("pan") : this.setPointer("default"); var e = this.options.inertia / 100; this.desiredRotationInDegrees += -1 * e * this.desiredRotationInDegrees } , t.prototype.drag = function(t) { var e, n, r; if (this.options.zoom && (null === (e = this.zoom) || void 0 === e ? void 0 : e.isZoomed())) { if (t.inputEvent.targetTouches) if (t.inputEvent.targetTouches && 2 === t.inputEvent.targetTouches.length) if (Math.hypot(t.inputEvent.targetTouches[0].pageX - t.inputEvent.targetTouches[1].pageX, t.inputEvent.targetTouches[0].pageY - t.inputEvent.targetTouches[1].pageY) < 1) return; if (Math.hypot(t.deltaX, t.deltaY) < 1) return; return null === (n = this.zoom) || void 0 === n || n.pan(t.deltaX, t.deltaY, this.images[this.currentImageNumber - 1]), void this.setPointer("pan") } if (!(Math.abs(t.deltaY) > Math.abs(t.deltaX))) { if (!this.dragAllowed) return !1; if (this.window.TouchEvent && t instanceof TouchEvent && 2 === t.touches.length) return !1; var i = this.getDegreesOneImage() , o = t.deltaX / (null === (r = this.mainHolderElement) || void 0 === r ? void 0 : r.clientWidth) * this.getTotalFrames() * i; return o = this.options.speed / 100 * o, this.options.reverse || (o *= -1), this.desiredRotationInDegrees += o, this.updateInAction || this.updateImage(), this.setPointer("drag"), this.firstDrag && (this.startDragInvocations++, this.eventBus.startDragging({ invocations: this.startDragInvocations }), this.firstDrag = !1), this.isDragged } } , t.prototype.dragStart = function() { var t; this.dragAllowed && (this.options.zoom && (null === (t = this.zoom) || void 0 === t ? void 0 : t.isZoomed()) || (this.isDragged = !0, this.firstDrag = !0, this.setPointer("drag"), this.cancelCurrentActions())) } , t.prototype.getNextImageNumber = function() { var e = this.images.length , n = this.getDegreesOneImage() , r = this.currentImageNumber; return Math.abs(this.desiredRotationInDegrees) < n ? (this.viewerHasNoAction() && (this.desiredRotationInDegrees = 0), r) : (r = this.desiredRotationInDegrees > 0 ? t.increaseImageNumber(r, e) : t.decreaseImageNumber(r, e), this.decreaseDesiredRotation(n), r) } , t.prototype.getDegreesOneImage = function() { var t = this.images.length; return Math.round(360 / t) } , t.prototype.setCurrentDegree = function(t) { var e = this.getDegreesOneImage(); this.currentDegree = 1 === t ? 0 : (t - 1) * e } , t.decreaseImageNumber = function(t, e) { return --t < 1 ? e : t } , t.increaseImageNumber = function(t, e) { return ++t > e ? 1 : t } , t.prototype.decreaseDesiredRotation = function(t) { t = Math.abs(t), this.desiredRotationInDegrees < 0 ? this.desiredRotationInDegrees += t : this.desiredRotationInDegrees -= Math.abs(t) } , t.prototype.setCurrentImage = function(t) { t !== this.previousImageNumber && this.isStarted && (-1 !== this.previousImageNumber && a.DomUtilities.hideImage(this.images[this.previousImageNumber - 1], this.window), a.DomUtilities.showImage(this.images[t - 1], this.window), this.previousImageNumber = t, this.currentImageNumber = t, this.setCurrentDegree(t), this.options.enableChangeImageEvent && this.events().changeImage({ currentImage: this.images[t - 1], currentDegree: this.currentDegree, completed: !0 })) } , t.prototype.viewerHasNoAction = function() { return !this.isDragged } , t.prototype.getImages = function() { return r(this, void 0, void 0, (function() { return i(this, (function(t) { return [2, o.Images.getPossibleImages(this.mainHolderElement, this.mainImage, this.uniqueId, this.eventBus, this.options, this.window)] } )) } )) } , t.prototype.getTotalFrames = function() { var t = this.options.totalFrames; if (t > 0 && t <= 360) return this.options.imageUrls.length > 0 ? this.options.imageUrls.length : t; throw new h.default("totalFrames must be between 1 and 360 now " + t) } , t.speedToRefreshRate = function(t) { return (100 - t) / 2 } , t.prototype.getCurrentRefreshRate = function() { if (0 === this.desiredRotationInDegrees) return this.standbyRefreshRate; if (this.viewerHasNoAction() && this.useEasing) { this.desiredRotationInDegreesStartSlowingDown || (this.desiredRotationInDegreesStartSlowingDown = Math.abs(this.desiredRotationInDegrees)); var e = (1 - (1 - Math.abs(this.desiredRotationInDegrees) / this.desiredRotationInDegreesStartSlowingDown)) * this.currentSpeed; return e = (100 - this.options.inertia) / 100 * e, t.speedToRefreshRate(e) } return t.speedToRefreshRate(this.currentSpeed) } , t.prototype.autoRotate = function(t) { return r(this, void 0, void 0, (function() { var e, n = this; return i(this, (function(o) { return this.nAutoRotations = t, e = function(e) { return r(n, void 0, void 0, (function() { var n, r; return i(this, (function(i) { switch (i.label) { case 0: n = 0, n = 0, i.label = 1; case 1: return n < this.nAutoRotations ? this.isDragged || this.nAutoRotations !== t ? (e && this.setSpeed(this.options.speed), [3, 4]) : (n === t - 1 && (this.useEasing = !0), r = this.options.autoRotateReverse ? -360 : 360, [4, this.rotateDegrees(r)]) : [3, 4]; case 2: i.sent(), i.label = 3; case 3: return n++, [3, 1]; case 4: return [2, new Promise((function(e, r) { e(n === t - 1) } ))] } } )) } )) } , [2, new Promise((function(r, i) { n.useEasing = !1; var o = n.options.autoRotateSpeed !== n.options.speed; o && n.setSpeed(n.options.autoRotateSpeed), e(o).then((function() { o && n.setSpeed(n.options.speed), n.useEasing = !0, n.nAutoRotations === t ? r(!0) : r(!1) } )).catch((function(t) { n.reportError(t), i() } )) } ))] } )) } )) } , t }(); e.JavascriptViewer = m } , function(t, e, n) { "use strict"; var r = this && this.__awaiter || function(t, e, n, r) { return new (n || (n = Promise))((function(i, o) { function a(t) { try { u(r.next(t)) } catch (t) { o(t) } } function s(t) { try { u(r.throw(t)) } catch (t) { o(t) } } function u(t) { var e; t.done ? i(t.value) : (e = t.value, e instanceof n ? e : new n((function(t) { t(e) } ))).then(a, s) } u((r = r.apply(t, e || [])).next()) } )) } , i = this && this.__generator || function(t, e) { var n, r, i, o, a = { label: 0, sent: function() { if (1 & i[0]) throw i[1]; return i[1] }, trys: [], ops: [] }; return o = { next: s(0), throw: s(1), return: s(2) }, "function" == typeof Symbol && (o[Symbol.iterator] = function() { return this } ), o; function s(o) { return function(s) { return function(o) { if (n) throw new TypeError("Generator is already executing."); for (; a; ) try { if (n = 1, r && (i = 2 & o[0] ? r.return : o[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, o[1])).done) return i; switch (r = 0, i && (o = [2 & o[0], i.value]), o[0]) { case 0: case 1: i = o; break; case 4: return a.label++, { value: o[1], done: !1 }; case 5: a.label++, r = o[1], o = [0]; continue; case 7: o = a.ops.pop(), a.trys.pop(); continue; default: if (!(i = a.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== o[0] && 2 !== o[0])) { a = 0; continue } if (3 === o[0] && (!i || o[1] > i[0] && o[1] < i[3])) { a.label = o[1]; break } if (6 === o[0] && a.label < i[1]) { a.label = i[1], i = o; break } if (i && a.label < i[2]) { a.label = i[2], a.ops.push(o); break } i[2] && a.ops.pop(), a.trys.pop(); continue } o = e.call(t, a) } catch (t) { o = [6, t], r = 0 } finally { n = i = 0 } if (5 & o[0]) throw o[1]; return { value: o[0] ? o[1] : void 0, done: !0 } }([o, s]) } } } ; Object.defineProperty(e, "__esModule", { value: !0 }), e.Images = void 0; var o = n(0) , a = n(7) , s = n(8) , u = n(3) , c = function() { function t() {} return t.getFilename = function(t, e, n) { if (0 === e.length) { var r = n.split(".").pop(); if (void 0 === r) throw new o.default("no extension found in url: " + n + ", cannot generate other filenames"); var i = (t < 10 ? "0" : "") + t.toString(); return n.replace("." + r, "_" + i + "." + r) } var a = this.getImagesPath(n) , s = this.getImagesPath(e) || a , u = e.lastIndexOf("/") + 1; if (-1 !== (e = e.substr(u)).toLowerCase().indexOf("xxxx")) { if (t < 10) { i = "000" + t.toString(); return "" + s + e.replace("xxxx", i) } if (t > 9 && t < 100) { i = "00" + t.toString(); return "" + s + e.replace("xxxx", i) } if (t > 99) { i = "0" + t.toString(); return "" + s + e.replace("xxxx", i) } } if (-1 !== e.toLowerCase().indexOf("xxx")) { if (t < 10) { i = "00" + t.toString(); return "" + s + e.replace("xxx", i) } if (t > 9 && t < 100) { i = "0" + t.toString(); return "" + s + e.replace("xxx", i) } if (t > 99) { i = t.toString(); return "" + s + e.replace("xxx", i) } } if (-1 !== e.toLowerCase().indexOf("xx")) { i = (t < 10 ? "0" : "") + t.toString(); return "" + s + e.replace("xx", i) } if (-1 !== e.toLowerCase().indexOf("x")) { i = t.toString(); return "" + s + e.replace("x", i) } throw new o.default("no placeholder x or xx found in format: " + e) } , t.generateImagesUrlsFromFormat = function(t, e) { var n = [] , r = e.startFrameNo , i = e.totalFrames , o = e.imageUrlFormat; if (0 === t.length) return n; for (var a = r; i > n.length; a++) n.push(this.getFilename(a, o, t)); return n } , t.getPossibleImages = function(t, e, n, s, u, c) { return r(this, void 0, void 0, (function() { var r = this; return i(this, (function(i) { return [2, new Promise((function(i, l) { var d = u.totalFrames , h = u.imageUrls || [] , f = e.src , g = h.length > 0 ? h : r.generateImagesUrlsFromFormat(f, u) , p = g.map((function(e, r) { if (u.autoCDNResizer) { var i = t.clientWidth , o = t.clientHeight , a = new URL(e) , s = a.searchParams; s.set("height", o.toString()), s.set("width", i.toString()), e = a.toString() } return { src: e, id: n + r.toString(), sequence: r + 1, encoded: "" } } )) , m = 1; a.default(g, c, { onSingleImageComplete: function(t) { p[g.indexOf(t.url)].encoded = "", s.loadImage({ currentImage: m, totalImages: d, percentage: Math.round(m / d * 100), image: p[m - 1] }), m++ }, onSingleImageFail: function(t) { throw new o.default("Failed loading image, are you using a good imageUrlFormat? =>" + t) } }).then((function() { m - 1 === g.length ? i(p) : l("Not all images are loaded " + (m - 1) + " from " + g.length + ". \n Check the warning to see the image urls we are trying to fetch") } )).catch((function(t) { l(t) } )) } ))] } )) } )) } , t.getMainImage = function(t, e) { var n = e.document.getElementById(t); if (n instanceof HTMLImageElement) { var r = n.src; return n.hasAttribute("data-src") && (r = n.getAttribute("data-src")), { src: r, id: t, sequence: 0 } } throw new o.default('Could not find main image with id "' + t + '"') } , t.getMainImageFromURl = function(t) { return { src: t, id: "", sequence: 0 } } , t.getMainImageElement = function(t, e) { var n = e.document.getElementById(t); if (n instanceof HTMLImageElement) return n; throw new o.default('Could not find main image with id "' + t + '"') } , t.blurMainImage = function(t, e) { var n = e.document.getElementById(t); n instanceof HTMLImageElement && (n.style.filter = "blur(5px)") } , t.hideReadyNotification = function(t, e, n) { var r = "notification_" + e; return u.DomUtilities.addHiddenStyle(r, n, 700) } , t.createOrGetPoweredBy = function(t, e, n, r, i) { var o = "powered-by-" + e , a = window.document.getElementById(o); if (a) return a; var c = n.document.createElement("div"); c.style.position = "absolute", c.style.display = "flex", c.style.alignItems = "right", c.style.justifyContent = "top", c.id = o, c.style.zIndex = "200", c.style.top = "5%", c.style.right = "5%", c.style.width = "5%", c.style.minWidth = "30px", c.className = "jsv-hidden"; var l = i ? "" : window.location.host; return c.innerHTML = s.Notifications.getPoweredBy(t, l), r.appendChild(c), setTimeout((function() { u.DomUtilities.addShowStyle(o, window, 300) } ), 500), c } , t.createReadyNotification = function(t, e, n, r) { var i = n.document.createElement("div"); i.style.position = "absolute", i.style.display = "flex", i.style.alignItems = "center", i.style.justifyContent = "center", i.id = "notification_" + e, i.style.zIndex = "200", i.style.top = "50%", i.style.left = "50%", i.style.height = "20%", i.style.width = "20%", i.style.pointerEvents = "none", i.style.transform = "translate(-50%, -50%)", t.dragToRotate.showStartToRotateDefaultNotification && (i.innerHTML = s.Notifications.getReadyForRotate(t)), !t.dragToRotate.showStartToRotateDefaultNotification && t.dragToRotate.imageUrl.length > 0 && (i.innerHTML = s.Notifications.getNotificationCustomImage(t)), r.appendChild(i) } , t.createProgressBar = function(t, e, n) { var r = e.document.createElement("div"); r.style.display = "flex", r.style.position = "absolute", r.style.height = "5px", r.style.width = "30%", r.style.overflow = "hidden", r.style.backgroundColor = "#e9ecef", r.style.borderRadius = "0.25rem", r.id = "loader_" + t, r.style.zIndex = "200", r.style.top = "50%", r.style.left = "50%", r.style.transform = "translate(-50%, -50%)"; var i = e.document.createElement("div"); return i.style.backgroundColor = "#6a6d71", r.appendChild(i), n.appendChild(r), r } , t.getImagesPath = function(t) { var e = t.replace(/^.*[\\/]/, ""); return t.substring(0, t.length - e.length) } , t }(); e.Images = c } , function(t, e, n) { "use strict"; var r = this && this.__awaiter || function(t, e, n, r) { return new (n || (n = Promise))((function(i, o) { function a(t) { try { u(r.next(t)) } catch (t) { o(t) } } function s(t) { try { u(r.throw(t)) } catch (t) { o(t) } } function u(t) { var e; t.done ? i(t.value) : (e = t.value, e instanceof n ? e : new n((function(t) { t(e) } ))).then(a, s) } u((r = r.apply(t, e || [])).next()) } )) } , i = this && this.__generator || function(t, e) { var n, r, i, o, a = { label: 0, sent: function() { if (1 & i[0]) throw i[1]; return i[1] }, trys: [], ops: [] }; return o = { next: s(0), throw: s(1), return: s(2) }, "function" == typeof Symbol && (o[Symbol.iterator] = function() { return this } ), o; function s(o) { return function(s) { return function(o) { if (n) throw new TypeError("Generator is already executing."); for (; a; ) try { if (n = 1, r && (i = 2 & o[0] ? r.return : o[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, o[1])).done) return i; switch (r = 0, i && (o = [2 & o[0], i.value]), o[0]) { case 0: case 1: i = o; break; case 4: return a.label++, { value: o[1], done: !1 }; case 5: a.label++, r = o[1], o = [0]; continue; case 7: o = a.ops.pop(), a.trys.pop(); continue; default: if (!(i = a.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== o[0] && 2 !== o[0])) { a = 0; continue } if (3 === o[0] && (!i || o[1] > i[0] && o[1] < i[3])) { a.label = o[1]; break } if (6 === o[0] && a.label < i[1]) { a.label = i[1], i = o; break } if (i && a.label < i[2]) { a.label = i[2], a.ops.push(o); break } i[2] && a.ops.pop(), a.trys.pop(); continue } o = e.call(t, a) } catch (t) { o = [6, t], r = 0 } finally { n = i = 0 } if (5 & o[0]) throw o[1]; return { value: o[0] ? o[1] : void 0, done: !0 } }([o, s]) } } } , o = this && this.__spreadArrays || function() { for (var t = 0, e = 0, n = arguments.length; e < n; e++) t += arguments[e].length; var r = Array(t) , i = 0; for (e = 0; e < n; e++) for (var o = arguments[e], a = 0, s = o.length; a < s; a++, i++) r[i] = o[a]; return r } ; Object.defineProperty(e, "__esModule", { value: !0 }), e.default = function(t, e, n) { return r(this, void 0, void 0, (function() { var e, a, s, u = this; return i(this, (function(c) { return e = function(t) { return r(u, void 0, void 0, (function() { return i(this, (function(e) { return [2, new Promise((function(e, r) { var i = new Image; i.src = t, i.onload = function() { i.naturalWidth < 10 ? r(new Error("image (" + t + " is smaller then 10 px, probably not exist")) : (n.onSingleImageComplete({ result: "", url: t, status: 200 }), e()) } , i.onerror = function() { n.onSingleImageFail("failed loading " + t), r(new Error("error with loading url " + t)) } } ))] } )) } )) } , a = function(t, e) { for (var n = [], r = o(t), i = Math.ceil(r.length / e), a = 0; a < i; a++) n.push(r.splice(0, e)); return n } , s = function(t) { return r(u, void 0, void 0, (function() { return i(this, (function(n) { switch (n.label) { case 0: return [4, Promise.all(t.map(e))]; case 1: return n.sent(), [2] } } )) } )) } , [2, new Promise((function(e, n) { var r = a(t, 10) , i = function(t) { var o = t.shift(); void 0 !== o && s(o).then((function() { 0 === r.length ? e() : i(t) } )).catch((function(t) { n(t) } )) }; i(r) } ))] } )) } )) } } , function(t, e, n) { "use strict"; Object.defineProperty(e, "__esModule", { value: !0 }), e.Notifications = void 0; var r = n(9) , i = n(1) , o = function() { function t() {} return t.getNotificationCustomImage = function(t) { return '' } , t.getReadyForRotate = function(t) { return '