JavaScript 65.5%
Python 17.8%
CSS 13%
HTML 3.7%
1"use strict";23Object.defineProperty(exports, "__esModule", {4 value: true5});6exports["default"] = void 0;7var _inflator = _interopRequireDefault(require("../inflator.js"));8function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }9function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }10function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }11function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }12function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }13function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }14function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /*15 * noVNC: HTML5 VNC client16 * Copyright (C) 2024 The noVNC authors17 * Licensed under MPL 2.0 (see LICENSE.txt)18 *19 * See README.md for usage and integration instructions.20 *21 */22var ZlibDecoder = exports["default"] = /*#__PURE__*/function () {23 function ZlibDecoder() {24 _classCallCheck(this, ZlibDecoder);25 this._zlib = new _inflator["default"]();26 this._length = 0;27 }28 return _createClass(ZlibDecoder, [{29 key: "decodeRect",30 value: function decodeRect(x, y, width, height, sock, display, depth) {31 if (width === 0 || height === 0) {32 return true;33 }34 if (this._length === 0) {35 if (sock.rQwait("ZLIB", 4)) {36 return false;37 }38 this._length = sock.rQshift32();39 }40 if (sock.rQwait("ZLIB", this._length)) {41 return false;42 }43 var data = new Uint8Array(sock.rQshiftBytes(this._length, false));44 this._length = 0;45 this._zlib.setInput(data);46 data = this._zlib.inflate(width * height * 4);47 this._zlib.setInput(null);4849 // Max sure the image is fully opaque50 for (var i = 0; i < width * height; i++) {51 data[i * 4 + 3] = 255;52 }53 display.blitImage(x, y, width, height, data, 0);54 return true;55 }56 }]);57}();