mirror of
https://gitlab.com/octospacc/octospacc.gitlab.io
synced 2025-02-08 16:08:38 +01:00
482 lines
1.3 MiB
JavaScript
482 lines
1.3 MiB
JavaScript
|
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.telegram=n():e.telegram=n()}(self,()=>(()=>{var __webpack_modules__={"./node_modules/@cryptography/aes/dist/es/aes.js":
|
|||
|
/*!*******************************************************!*\
|
|||
|
!*** ./node_modules/@cryptography/aes/dist/es/aes.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 */ \"CTR\": () => (/* binding */ AES_IGE$1),\n/* harmony export */ \"IGE\": () => (/* binding */ AES_IGE),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nvar S = new Uint8Array(256);\nvar Si = new Uint8Array(256);\nvar T1 = new Uint32Array(256);\nvar T2 = new Uint32Array(256);\nvar T3 = new Uint32Array(256);\nvar T4 = new Uint32Array(256);\nvar T5 = new Uint32Array(256);\nvar T6 = new Uint32Array(256);\nvar T7 = new Uint32Array(256);\nvar T8 = new Uint32Array(256);\nfunction computeTables() {\n var d = new Uint8Array(256);\n var t = new Uint8Array(256);\n var x2;\n var x4;\n var x8;\n var s;\n var tEnc;\n var tDec;\n var x = 0;\n var xInv = 0;\n // Compute double and third tables\n for (var i = 0; i < 256; i++) {\n d[i] = i << 1 ^ (i >> 7) * 283;\n t[d[i] ^ i] = i;\n }\n for (; !S[x]; x ^= x2 || 1) {\n // Compute sbox\n s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n S[x] = s;\n Si[s] = x;\n // Compute MixColumns\n x8 = d[x4 = d[x2 = d[x]]];\n tDec = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100;\n tEnc = d[s] * 0x101 ^ s * 0x1010100;\n T1[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T2[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T3[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T4[x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n T5[s] = tDec = tDec << 24 ^ tDec >>> 8;\n T6[s] = tDec = tDec << 24 ^ tDec >>> 8;\n T7[s] = tDec = tDec << 24 ^ tDec >>> 8;\n T8[s] = tDec = tDec << 24 ^ tDec >>> 8;\n xInv = t[xInv] || 1;\n }\n}\n\n/**\n * Gets a uint32 from string in big-endian order order\n */\nfunction s2i(str, pos) {\n return (str.charCodeAt(pos) << 24\n ^ str.charCodeAt(pos + 1) << 16\n ^ str.charCodeAt(pos + 2) << 8\n ^ str.charCodeAt(pos + 3));\n}\n\n/* eslint-disable import/prefer-default-export */\n/**\n * Helper function for transforming string key to Uint32Array\n */\nfunction getWords(key) {\n if (key instanceof Uint32Array) {\n return key;\n }\n if (typeof key === 'string') {\n if (key.length % 4 !== 0)\n for (var i = key.length % 4; i <= 4; i++)\n key += '\\0x00';\n var buf = new Uint32Array(key.length / 4);\n for (var i = 0; i < key.length; i += 4)\n buf[i / 4] = s2i(key, i);\n return buf;\n }\n if (key instanceof Uint8Array) {\n var buf = new Uint32Array(key.length / 4);\n for (var i = 0; i < key.length; i += 4) {\n buf[i / 4] = (key[i] << 24\n ^ key[i + 1] << 16\n ^ key[i + 2] << 8\n ^ key[i + 3]);\n }\n return buf;\n }\n throw new Error('Unable to create 32-bit words');\n}\nfunction xor(left, right, to) {\n if (to === void 0) { to = left; }\n for (var i = 0; i < left.length; i++)\n to[i] = left[i] ^ right[i];\n}\n\ncomputeTables();\n/**\n * Low-level AES Cipher\n */\nvar AES = /** @class */ (function () {\n function AES(_key) {\n var key = getWords(_key);\n if (key.length !== 4 && key.length !== 6 && key.length !== 8) {\n throw new Error('Invalid key size');\n }\n this.encKey = new Uint32Array(4 * key.length + 28);\n this.decKey = new Uint32Array(4 * key.length + 28);\n this.encKey.set(key);\n var rcon = 1;\n var i = key.length;\n var tmp;\n // schedule encryption keys\n for (; i < 4 * key.length + 28; i++) {\n tmp = this.encKey[i - 1];\n // apply sbox\n if (i % key.length === 0 || (key.length === 8 && i % key.length === 4)) {\n tm
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/async-mutex/lib/Mutex.js ***!
|
|||
|
\***********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nvar tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");\nvar Semaphore_1 = __webpack_require__(/*! ./Semaphore */ "./node_modules/async-mutex/lib/Semaphore.js");\nvar Mutex = /** @class */ (function () {\n function Mutex(cancelError) {\n this._semaphore = new Semaphore_1.default(1, cancelError);\n }\n Mutex.prototype.acquire = function () {\n return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {\n var _a, releaser;\n return (0, tslib_1.__generator)(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, this._semaphore.acquire()];\n case 1:\n _a = _b.sent(), releaser = _a[1];\n return [2 /*return*/, releaser];\n }\n });\n });\n };\n Mutex.prototype.runExclusive = function (callback) {\n return this._semaphore.runExclusive(function () { return callback(); });\n };\n Mutex.prototype.isLocked = function () {\n return this._semaphore.isLocked();\n };\n Mutex.prototype.waitForUnlock = function () {\n return this._semaphore.waitForUnlock();\n };\n /** @deprecated Deprecated in 0.3.0, will be removed in 0.4.0. Use runExclusive instead. */\n Mutex.prototype.release = function () {\n this._semaphore.release();\n };\n Mutex.prototype.cancel = function () {\n return this._semaphore.cancel();\n };\n return Mutex;\n}());\nexports["default"] = Mutex;\n\n\n//# sourceURL=webpack://telegram/./node_modules/async-mutex/lib/Mutex.js?')},"./node_modules/async-mutex/lib/Semaphore.js":
|
|||
|
/*!***************************************************!*\
|
|||
|
!*** ./node_modules/async-mutex/lib/Semaphore.js ***!
|
|||
|
\***************************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nvar tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");\nvar errors_1 = __webpack_require__(/*! ./errors */ "./node_modules/async-mutex/lib/errors.js");\nvar Semaphore = /** @class */ (function () {\n function Semaphore(_maxConcurrency, _cancelError) {\n if (_cancelError === void 0) { _cancelError = errors_1.E_CANCELED; }\n this._maxConcurrency = _maxConcurrency;\n this._cancelError = _cancelError;\n this._queue = [];\n this._waiters = [];\n if (_maxConcurrency <= 0) {\n throw new Error(\'semaphore must be initialized to a positive value\');\n }\n this._value = _maxConcurrency;\n }\n Semaphore.prototype.acquire = function () {\n var _this = this;\n var locked = this.isLocked();\n var ticketPromise = new Promise(function (resolve, reject) {\n return _this._queue.push({ resolve: resolve, reject: reject });\n });\n if (!locked)\n this._dispatch();\n return ticketPromise;\n };\n Semaphore.prototype.runExclusive = function (callback) {\n return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {\n var _a, value, release;\n return (0, tslib_1.__generator)(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, this.acquire()];\n case 1:\n _a = _b.sent(), value = _a[0], release = _a[1];\n _b.label = 2;\n case 2:\n _b.trys.push([2, , 4, 5]);\n return [4 /*yield*/, callback(value)];\n case 3: return [2 /*return*/, _b.sent()];\n case 4:\n release();\n return [7 /*endfinally*/];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n Semaphore.prototype.waitForUnlock = function () {\n return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {\n var waitPromise;\n var _this = this;\n return (0, tslib_1.__generator)(this, function (_a) {\n if (!this.isLocked()) {\n return [2 /*return*/, Promise.resolve()];\n }\n waitPromise = new Promise(function (resolve) { return _this._waiters.push({ resolve: resolve }); });\n return [2 /*return*/, waitPromise];\n });\n });\n };\n Semaphore.prototype.isLocked = function () {\n return this._value <= 0;\n };\n /** @deprecated Deprecated in 0.3.0, will be removed in 0.4.0. Use runExclusive instead. */\n Semaphore.prototype.release = function () {\n if (this._maxConcurrency > 1) {\n throw new Error(\'this method is unavailable on semaphores with concurrency > 1; use the scoped release returned by acquire instead\');\n }\n if (this._currentReleaser) {\n var releaser = this._currentReleaser;\n this._currentReleaser = undefined;\n releaser();\n }\n };\n Semaphore.prototype.cancel = function () {\n var _this = this;\n this._queue.forEach(function (ticket) { return ticket.reject(_this._cancelError); });\n this._queue = [];\n };\n Semaphore.prototype._dispatch = function () {\n var _this = this;\n var nextTicket = this._queue.shift();\n if (!nextTicket)\n return;\n var released = false;\n this._currentReleaser = function () {\n if (released)\n return;\n released = true;\n _this._value++;\n _this._resolveWaiters();\n _this._dispatch();\n };\n nextTicket.resolve([this._value--, this._currentRele
|
|||
|
/*!************************************************!*\
|
|||
|
!*** ./node_modules/async-mutex/lib/errors.js ***!
|
|||
|
\************************************************/(__unused_webpack_module,exports)=>{"use strict";eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.E_CANCELED = exports.E_ALREADY_LOCKED = exports.E_TIMEOUT = void 0;\nexports.E_TIMEOUT = new Error('timeout while waiting for mutex to become available');\nexports.E_ALREADY_LOCKED = new Error('mutex already locked');\nexports.E_CANCELED = new Error('request for lock canceled');\n\n\n//# sourceURL=webpack://telegram/./node_modules/async-mutex/lib/errors.js?")},"./node_modules/async-mutex/lib/index.js":
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/async-mutex/lib/index.js ***!
|
|||
|
\***********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.tryAcquire = exports.withTimeout = exports.Semaphore = exports.Mutex = void 0;\nvar tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");\nvar Mutex_1 = __webpack_require__(/*! ./Mutex */ "./node_modules/async-mutex/lib/Mutex.js");\nObject.defineProperty(exports, "Mutex", ({ enumerable: true, get: function () { return Mutex_1.default; } }));\nvar Semaphore_1 = __webpack_require__(/*! ./Semaphore */ "./node_modules/async-mutex/lib/Semaphore.js");\nObject.defineProperty(exports, "Semaphore", ({ enumerable: true, get: function () { return Semaphore_1.default; } }));\nvar withTimeout_1 = __webpack_require__(/*! ./withTimeout */ "./node_modules/async-mutex/lib/withTimeout.js");\nObject.defineProperty(exports, "withTimeout", ({ enumerable: true, get: function () { return withTimeout_1.withTimeout; } }));\nvar tryAcquire_1 = __webpack_require__(/*! ./tryAcquire */ "./node_modules/async-mutex/lib/tryAcquire.js");\nObject.defineProperty(exports, "tryAcquire", ({ enumerable: true, get: function () { return tryAcquire_1.tryAcquire; } }));\n(0, tslib_1.__exportStar)(__webpack_require__(/*! ./errors */ "./node_modules/async-mutex/lib/errors.js"), exports);\n\n\n//# sourceURL=webpack://telegram/./node_modules/async-mutex/lib/index.js?')},"./node_modules/async-mutex/lib/tryAcquire.js":
|
|||
|
/*!****************************************************!*\
|
|||
|
!*** ./node_modules/async-mutex/lib/tryAcquire.js ***!
|
|||
|
\****************************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.tryAcquire = void 0;\nvar errors_1 = __webpack_require__(/*! ./errors */ "./node_modules/async-mutex/lib/errors.js");\nvar withTimeout_1 = __webpack_require__(/*! ./withTimeout */ "./node_modules/async-mutex/lib/withTimeout.js");\n// eslint-disable-next-lisne @typescript-eslint/explicit-module-boundary-types\nfunction tryAcquire(sync, alreadyAcquiredError) {\n if (alreadyAcquiredError === void 0) { alreadyAcquiredError = errors_1.E_ALREADY_LOCKED; }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (0, withTimeout_1.withTimeout)(sync, 0, alreadyAcquiredError);\n}\nexports.tryAcquire = tryAcquire;\n\n\n//# sourceURL=webpack://telegram/./node_modules/async-mutex/lib/tryAcquire.js?')},"./node_modules/async-mutex/lib/withTimeout.js":
|
|||
|
/*!*****************************************************!*\
|
|||
|
!*** ./node_modules/async-mutex/lib/withTimeout.js ***!
|
|||
|
\*****************************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.withTimeout = void 0;\nvar tslib_1 = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js");\nvar errors_1 = __webpack_require__(/*! ./errors */ "./node_modules/async-mutex/lib/errors.js");\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nfunction withTimeout(sync, timeout, timeoutError) {\n var _this = this;\n if (timeoutError === void 0) { timeoutError = errors_1.E_TIMEOUT; }\n return {\n acquire: function () {\n return new Promise(function (resolve, reject) { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {\n var isTimeout, handle, ticket, release, e_1;\n return (0, tslib_1.__generator)(this, function (_a) {\n switch (_a.label) {\n case 0:\n isTimeout = false;\n handle = setTimeout(function () {\n isTimeout = true;\n reject(timeoutError);\n }, timeout);\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, sync.acquire()];\n case 2:\n ticket = _a.sent();\n if (isTimeout) {\n release = Array.isArray(ticket) ? ticket[1] : ticket;\n release();\n }\n else {\n clearTimeout(handle);\n resolve(ticket);\n }\n return [3 /*break*/, 4];\n case 3:\n e_1 = _a.sent();\n if (!isTimeout) {\n clearTimeout(handle);\n reject(e_1);\n }\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n }); });\n },\n runExclusive: function (callback) {\n return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {\n var release, ticket;\n return (0, tslib_1.__generator)(this, function (_a) {\n switch (_a.label) {\n case 0:\n release = function () { return undefined; };\n _a.label = 1;\n case 1:\n _a.trys.push([1, , 7, 8]);\n return [4 /*yield*/, this.acquire()];\n case 2:\n ticket = _a.sent();\n if (!Array.isArray(ticket)) return [3 /*break*/, 4];\n release = ticket[1];\n return [4 /*yield*/, callback(ticket[0])];\n case 3: return [2 /*return*/, _a.sent()];\n case 4:\n release = ticket;\n return [4 /*yield*/, callback()];\n case 5: return [2 /*return*/, _a.sent()];\n case 6: return [3 /*break*/, 8];\n case 7:\n release();\n return [7 /*endfinally*/];\n case 8: return [2 /*return*/];\n }\n });\n });\n },\n /** @deprecated Deprecated in 0.3.0, will be removed in 0.4.0. Use runExclusive instead. */\n release: function () {\n sync.release();\n },\n cancel: func
|
|||
|
/*!*******************************!*\
|
|||
|
!*** ./browser/CryptoFile.js ***!
|
|||
|
\*******************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function () {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n Object.defineProperty(o, "default", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o["default"] = v;\n});\n\nvar __importStar = this && this.__importStar || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n\n __setModuleDefault(result, mod);\n\n return result;\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\n\nconst crypto = __importStar(__webpack_require__(/*! ./crypto/crypto */ "./browser/crypto/crypto.js"));\n\nexports["default"] = crypto;\n\n//# sourceURL=webpack://telegram/./browser/CryptoFile.js?')},"./browser/Helpers.js":
|
|||
|
/*!****************************!*\
|
|||
|
!*** ./browser/Helpers.js ***!
|
|||
|
\****************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports._entityType = exports._EntityType = exports.TotalList = exports.crc32 = exports.bufferXor = exports.sleep = exports.getRandomInt = exports.getMinBigInt = exports.returnBigInt = exports.getByteArray = exports.modExp = exports.sha256 = exports.sha1 = exports.convertToLittle = exports.generateKeyDataFromNonce = exports.stripText = exports.generateRandomBytes = exports.bigIntMod = exports.mod = exports.generateRandomLong = exports.readBufferFromBigInt = exports.toSignedLittleBuffer = exports.isArrayLike = exports.betterConsoleLog = exports.groupBy = exports.escapeRegex = exports.generateRandomBigInt = exports.readBigIntFromBuffer = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst CryptoFile_1 = __importDefault(__webpack_require__(/*! ./CryptoFile */ "./browser/CryptoFile.js"));\n/**\n * converts a buffer to big int\n * @param buffer\n * @param little\n * @param signed\n * @returns {bigInt.BigInteger}\n */\n\n\nfunction readBigIntFromBuffer(buffer, little = true, signed = false) {\n let randBuffer = buffer_1.Buffer.from(buffer);\n const bytesNumber = randBuffer.length;\n\n if (little) {\n randBuffer = randBuffer.reverse();\n }\n\n let bigIntVar = (0, big_integer_1.default)(randBuffer.toString("hex"), 16);\n\n if (signed && Math.floor(bigIntVar.toString(2).length / 8) >= bytesNumber) {\n bigIntVar = bigIntVar.subtract((0, big_integer_1.default)(2).pow((0, big_integer_1.default)(bytesNumber * 8)));\n }\n\n return bigIntVar;\n}\n\nexports.readBigIntFromBuffer = readBigIntFromBuffer;\n\nfunction generateRandomBigInt() {\n return readBigIntFromBuffer(generateRandomBytes(8), false);\n}\n\nexports.generateRandomBigInt = generateRandomBigInt;\n\nfunction escapeRegex(string) {\n return string.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, "\\\\$&");\n}\n\nexports.escapeRegex = escapeRegex;\n\nfunction groupBy(list, keyGetter) {\n const map = new Map();\n list.forEach(item => {\n const key = keyGetter(item);\n const collection = map.get(key);\n\n if (!collection) {\n map.set(key, [item]);\n } else {\n collection.push(item);\n }\n });\n return map;\n}\n\nexports.groupBy = groupBy;\n/**\n * Outputs the object in a better way by hiding all the private methods/attributes.\n * @param object - the class to use\n */\n\nfunction betterConsoleLog(object) {\n const toPrint = {};\n\n for (const key in object) {\n if (object.hasOwnProperty(key)) {\n if (!key.startsWith("_") && key != "originalArgs") {\n toPrint[key] = object[key];\n }\n }\n }\n\n return toPrint;\n}\n\nexports.betterConsoleLog = betterConsoleLog;\n/**\n * Helper to find if a given object is an array (or similar)\n */\n\nconst isArrayLike = x => x && typeof x.length === "number" && typeof x !== "function" && typeof x !== "string";\n\nexports.isArrayLike = isArrayLike;\n/*\nexport function addSurrogate(text: string) {\n let temp = "";\n for (const letter of text) {\n const t = letter.charCodeAt(0);\n if (0x1000 < t && t < 0x10FFFF) {\n const b = Buffer.from(letter, "utf16le");\n const r = String.fromCharCode(b.readUInt16LE(0)) + String.fromCharCode(b.readUInt16LE(2));\n temp += r;\n } else {\n text += letter;\n }\n }\n return temp;\n}\n\n */\n\n/**\n * Special case signed little ints\n * @param big\n * @param number\n * @returns {Buffer}\n */\n\nfunction toSignedLittleBuffer(big, number = 8) {\n const bigNumber = returnBigInt(big);\n const byteArray = [];\n\n for (let i = 0; i < number; i++) {\n byteArray[i] = bigNumb
|
|||
|
/*!*****************************!*\
|
|||
|
!*** ./browser/Password.js ***!
|
|||
|
\*****************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.computeDigest = exports.computeCheck = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst tl_1 = __webpack_require__(/*! ./tl */ "./browser/tl/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ./Helpers */ "./browser/Helpers.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst CryptoFile_1 = __importDefault(__webpack_require__(/*! ./CryptoFile */ "./browser/CryptoFile.js"));\n\nconst SIZE_FOR_HASH = 256;\n/**\n *\n *\n * @param prime{BigInteger}\n * @param g{BigInteger}\n */\n\n/*\nWe don\'t support changing passwords yet\nfunction checkPrimeAndGoodCheck(prime, g) {\n console.error(\'Unsupported function `checkPrimeAndGoodCheck` call. Arguments:\', prime, g)\n\n const goodPrimeBitsCount = 2048\n if (prime < 0 || prime.bitLength() !== goodPrimeBitsCount) {\n throw new Error(`bad prime count ${prime.bitLength()},expected ${goodPrimeBitsCount}`)\n }\n // TODO this is kinda slow\n if (Factorizator.factorize(prime)[0] !== 1) {\n throw new Error(\'give "prime" is not prime\')\n }\n if (g.eq(bigInt(2))) {\n if ((prime.remainder(bigInt(8))).neq(bigInt(7))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 8}`)\n }\n } else if (g.eq(bigInt(3))) {\n if ((prime.remainder(bigInt(3))).neq(bigInt(2))) {\n throw new Error(`bad g ${g}, mod3 ${prime % 3}`)\n }\n // eslint-disable-next-line no-empty\n } else if (g.eq(bigInt(4))) {\n\n } else if (g.eq(bigInt(5))) {\n if (!([ bigInt(1), bigInt(4) ].includes(prime.remainder(bigInt(5))))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 5}`)\n }\n } else if (g.eq(bigInt(6))) {\n if (!([ bigInt(19), bigInt(23) ].includes(prime.remainder(bigInt(24))))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 24}`)\n }\n } else if (g.eq(bigInt(7))) {\n if (!([ bigInt(3), bigInt(5), bigInt(6) ].includes(prime.remainder(bigInt(7))))) {\n throw new Error(`bad g ${g}, mod8 ${prime % 7}`)\n }\n } else {\n throw new Error(`bad g ${g}`)\n }\n const primeSub1Div2 = (prime.subtract(bigInt(1))).divide(bigInt(2))\n if (Factorizator.factorize(primeSub1Div2)[0] !== 1) {\n throw new Error(\'(prime - 1) // 2 is not prime\')\n }\n}\n*/\n\n/**\n *\n * @param primeBytes{Buffer}\n * @param g{number}\n */\n\nfunction checkPrimeAndGood(primeBytes, g) {\n const goodPrime = buffer_1.Buffer.from([0xc7, 0x1c, 0xae, 0xb9, 0xc6, 0xb1, 0xc9, 0x04, 0x8e, 0x6c, 0x52, 0x2f, 0x70, 0xf1, 0x3f, 0x73, 0x98, 0x0d, 0x40, 0x23, 0x8e, 0x3e, 0x21, 0xc1, 0x49, 0x34, 0xd0, 0x37, 0x56, 0x3d, 0x93, 0x0f, 0x48, 0x19, 0x8a, 0x0a, 0xa7, 0xc1, 0x40, 0x58, 0x22, 0x94, 0x93, 0xd2, 0x25, 0x30, 0xf4, 0xdb, 0xfa, 0x33, 0x6f, 0x6e, 0x0a, 0xc9, 0x25, 0x13, 0x95, 0x43, 0xae, 0xd4, 0x4c, 0xce, 0x7c, 0x37, 0x20, 0xfd, 0x51, 0xf6, 0x94, 0x58, 0x70, 0x5a, 0xc6, 0x8c, 0xd4, 0xfe, 0x6b, 0x6b, 0x13, 0xab, 0xdc, 0x97, 0x46, 0x51, 0x29, 0x69, 0x32, 0x84, 0x54, 0xf1, 0x8f, 0xaf, 0x8c, 0x59, 0x5f, 0x64, 0x24, 0x77, 0xfe, 0x96, 0xbb, 0x2a, 0x94, 0x1d, 0x5b, 0xcd, 0x1d, 0x4a, 0xc8, 0xcc, 0x49, 0x88, 0x07, 0x08, 0xfa, 0x9b, 0x37, 0x8e, 0x3c, 0x4f, 0x3a, 0x90, 0x60, 0xbe, 0xe6, 0x7c, 0xf9, 0xa4, 0xa4, 0xa6, 0x95, 0x81, 0x10, 0x51, 0x90, 0x7e, 0x16, 0x27, 0x53, 0xb5, 0x6b, 0x0f, 0x6b, 0x41, 0x0d, 0xba, 0x74, 0xd8, 0xa8, 0x4b, 0x2a, 0x14, 0xb3, 0x14, 0x4e, 0x0e, 0xf1, 0x28, 0x47, 0x54, 0xfd, 0x17, 0xed, 0x95, 0x0d, 0x59, 0x65, 0xb4, 0xb9, 0xdd, 0x46, 0x58, 0x2d, 0xb1, 0x17, 0x8d, 0x16, 0x9c, 0x6b, 0xc4, 0x65, 0xb0, 0xd6, 0xff, 0x9c, 0xa3, 0x92, 0x8f, 0xef, 0x5b, 0x9a, 0xe4, 0xe4, 0x1
|
|||
|
/*!**************************!*\
|
|||
|
!*** ./browser/Utils.js ***!
|
|||
|
\**************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.getDisplayName = exports.rtrim = exports.parseUsername = exports.resolveInviteLink = exports.parseID = exports.parsePhone = exports.getMessageId = exports.resolveId = exports.getPeerId = exports.sanitizeParseMode = exports.getPeer = exports.getAppropriatedPartSize = exports.getInputMedia = exports.getInputGeo = exports.getAttributes = exports.getExtension = exports.isImage = exports.isAudio = exports.getInputDocument = exports.getInputPhoto = exports.strippedPhotoToJpg = exports.getInputChatPhoto = exports.getInputMessage = exports.getInputUser = exports.getInputChannel = exports.getInnerText = exports._getEntityPair = exports._photoSizeByteCount = exports.getInputPeer = exports.chunks = exports.getFileInfo = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst tl_1 = __webpack_require__(/*! ./tl */ "./browser/tl/index.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst mime_1 = __importDefault(__webpack_require__(/*! mime */ "./node_modules/mime/index.js"));\n\nconst markdown_1 = __webpack_require__(/*! ./extensions/markdown */ "./browser/extensions/markdown.js");\n\nfunction getFileInfo(fileLocation) {\n if (!fileLocation || !fileLocation.SUBCLASS_OF_ID) {\n _raiseCastFail(fileLocation, "InputFileLocation");\n }\n\n if (fileLocation.SUBCLASS_OF_ID == 354669666) {\n return {\n dcId: undefined,\n location: fileLocation,\n size: undefined\n };\n }\n\n let location;\n\n if (fileLocation instanceof tl_1.Api.Message) {\n location = fileLocation.media;\n }\n\n if (fileLocation instanceof tl_1.Api.MessageMediaDocument) {\n location = fileLocation.document;\n } else if (fileLocation instanceof tl_1.Api.MessageMediaPhoto) {\n location = fileLocation.photo;\n }\n\n if (location instanceof tl_1.Api.Document) {\n return {\n dcId: location.dcId,\n location: new tl_1.Api.InputDocumentFileLocation({\n id: location.id,\n accessHash: location.accessHash,\n fileReference: location.fileReference,\n thumbSize: ""\n }),\n size: location.size\n };\n } else if (location instanceof tl_1.Api.Photo) {\n return {\n dcId: location.dcId,\n location: new tl_1.Api.InputPhotoFileLocation({\n id: location.id,\n accessHash: location.accessHash,\n fileReference: location.fileReference,\n thumbSize: location.sizes[location.sizes.length - 1].type\n }),\n size: (0, big_integer_1.default)(_photoSizeByteCount(location.sizes[location.sizes.length - 1]) || 0)\n };\n }\n\n _raiseCastFail(fileLocation, "InputFileLocation");\n}\n\nexports.getFileInfo = getFileInfo;\n/**\n * Turns the given iterable into chunks of the specified size,\n * which is 100 by default since that\'s what Telegram uses the most.\n */\n\nfunction* chunks(arr, size = 100) {\n for (let i = 0; i < arr.length; i += size) {\n yield arr.slice(i, i + size);\n }\n}\n\nexports.chunks = chunks;\n\nconst html_1 = __webpack_require__(/*! ./extensions/html */ "./browser/extensions/html.js");\n\nconst Helpers_1 = __webpack_require__(/*! ./Helpers */ "./browser/Helpers.js");\n\nconst USERNAME_RE = new RegExp("@|(?:https?:\\\\/\\\\/)?(?:www\\\\.)?" + "(?:telegram\\\\.(?:me|dog)|t\\\\.me)\\\\/(@|joinchat\\\\/)?", "i");\nconst JPEG_HEADER = buffer_1.Buffer.from("ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc000
|
|||
|
/*!****************************!*\
|
|||
|
!*** ./browser/Version.js ***!
|
|||
|
\****************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.version = void 0;\nexports.version = "2.17.0";\n\n//# sourceURL=webpack://telegram/./browser/Version.js?')},"./browser/client/2fa.js":
|
|||
|
/*!*******************************!*\
|
|||
|
!*** ./browser/client/2fa.js ***!
|
|||
|
\*******************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.updateTwoFaSettings = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst Password_1 = __webpack_require__(/*! ../Password */ "./browser/Password.js");\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst index_1 = __webpack_require__(/*! ../index */ "./browser/index.js");\n/**\n * Changes the 2FA settings of the logged in user.\n Note that this method may be *incredibly* slow depending on the\n prime numbers that must be used during the process to make sure\n that everything is safe.\n\n Has no effect if both current and new password are omitted.\n\n * @param client: The telegram client instance\n * @param isCheckPassword: Must be ``true`` if you want to check the current password\n * @param currentPassword: The current password, to authorize changing to ``new_password``.\n Must be set if changing existing 2FA settings.\n Must **not** be set if 2FA is currently disabled.\n Passing this by itself will remove 2FA (if correct).\n * @param newPassword: The password to set as 2FA.\n If 2FA was already enabled, ``currentPassword`` **must** be set.\n Leaving this blank or `undefined` will remove the password.\n * @param hint: Hint to be displayed by Telegram when it asks for 2FA.\n Must be set when changing or creating a new password.\n Has no effect if ``newPassword`` is not set.\n * @param email: Recovery and verification email. If present, you must also\n set `emailCodeCallback`, else it raises an Error.\n * @param emailCodeCallback: If an email is provided, a callback that returns the code sent\n to it must also be set. This callback may be asynchronous.\n It should return a string with the code. The length of the\n code will be passed to the callback as an input parameter.\n * @param onEmailCodeError: Called when an error happens while sending an email.\n\n If the callback returns an invalid code, it will raise an rpc error with the message\n ``CODE_INVALID``\n\n * @returns Promise<void>\n * @throws this method can throw:\n "PASSWORD_HASH_INVALID" if you entered a wrong password (or set it to undefined).\n "EMAIL_INVALID" if the entered email is wrong\n "EMAIL_HASH_EXPIRED" if the user took too long to verify their email\n */\n\n\nasync function updateTwoFaSettings(client, {\n isCheckPassword,\n currentPassword,\n newPassword,\n hint = "",\n email,\n emailCodeCallback,\n onEmailCodeError\n}) {\n if (!newPassword && !currentPassword) {\n throw new Error("Neither `currentPassword` nor `newPassword` is present");\n }\n\n if (email && !(emailCodeCallback && onEmailCodeError)) {\n throw new Error("`email` present without `emailCodeCallback` and `onEmailCodeError`");\n }\n\n const pwd = await client.invoke(new tl_1.Api.account.GetPassword());\n\n if (!(pwd.newAlgo instanceof tl_1.Api.PasswordKdfAlgoUnknown)) {\n pwd.newAlgo.salt1 = buffer_1.Buffer.concat([pwd.newAlgo.salt1, (0, Helpers_1.generateRandomBytes)(32)]);\n }\n\n if (!pwd.hasPassword && currentPassword) {\n currentPassword = undefined;\n }\n\n const password = currentPassword ? await (0, Password_1.computeCheck)(pwd, currentPassword) : new tl_1.Api.InputCheckPasswordEmpty();\n\n if (isCheckPassword) {\n await client.invoke(new tl_1.Api.auth.CheckPassword({\n password\n }));\n return;\n }\n\n if (pwd.newAlgo instanceof tl_1.Api.PasswordKdfAlgoUnknown) {\n throw new Error("Unknown password encryption method");\n }\n\n try {\n await client.invoke(new tl_1.Api.account.UpdatePasswordSettings({\n password,\n newSettings: new tl_1.Api.account.PasswordInputSettings({\n newAlgo: pwd.newAlgo,\n newPasswordHash: newPassword ? await (0, Password_1.computeDigest)(pwd.newAlgo, newPassword) : buffer_1.Buffer.alloc(0),\n hint,\n email,\n
|
|||
|
/*!******************************************!*\
|
|||
|
!*** ./browser/client/TelegramClient.js ***!
|
|||
|
\******************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function () {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n Object.defineProperty(o, "default", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o["default"] = v;\n});\n\nvar __importStar = this && this.__importStar || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n\n __setModuleDefault(result, mod);\n\n return result;\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.TelegramClient = void 0;\n\nconst telegramBaseClient_1 = __webpack_require__(/*! ./telegramBaseClient */ "./browser/client/telegramBaseClient.js");\n\nconst authMethods = __importStar(__webpack_require__(/*! ./auth */ "./browser/client/auth.js"));\n\nconst botMethods = __importStar(__webpack_require__(/*! ./bots */ "./browser/client/bots.js"));\n\nconst buttonsMethods = __importStar(__webpack_require__(/*! ./buttons */ "./browser/client/buttons.js"));\n\nconst downloadMethods = __importStar(__webpack_require__(/*! ./downloads */ "./browser/client/downloads.js"));\n\nconst parseMethods = __importStar(__webpack_require__(/*! ./messageParse */ "./browser/client/messageParse.js"));\n\nconst messageMethods = __importStar(__webpack_require__(/*! ./messages */ "./browser/client/messages.js"));\n\nconst updateMethods = __importStar(__webpack_require__(/*! ./updates */ "./browser/client/updates.js"));\n\nconst uploadMethods = __importStar(__webpack_require__(/*! ./uploads */ "./browser/client/uploads.js"));\n\nconst userMethods = __importStar(__webpack_require__(/*! ./users */ "./browser/client/users.js"));\n\nconst chatMethods = __importStar(__webpack_require__(/*! ./chats */ "./browser/client/chats.js"));\n\nconst dialogMethods = __importStar(__webpack_require__(/*! ./dialogs */ "./browser/client/dialogs.js"));\n\nconst twoFA = __importStar(__webpack_require__(/*! ./2fa */ "./browser/client/2fa.js"));\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst Utils_1 = __webpack_require__(/*! ../Utils */ "./browser/Utils.js");\n\nconst network_1 = __webpack_require__(/*! ../network */ "./browser/network/index.js");\n\nconst AllTLObjects_1 = __webpack_require__(/*! ../tl/AllTLObjects */ "./browser/tl/AllTLObjects.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst updates_1 = __webpack_require__(/*! ./updates */ "./browser/client/updates.js");\n\nconst Logger_1 = __webpack_require__(/*! ../extensions/Logger */ "./browser/extensions/Logger.js");\n\nconst inspect_1 = __webpack_require__(/*! ../inspect */ "./browser/inspect.js");\n\nconst platform_1 = __webpack_require__(/*! ../platform */ "./browser/platform.js");\n/**\n * The TelegramClient uses several methods in different files to provide all the common functionality in a nice interface.</br>\n * **In short, to create a client you must do:**\n *\n * ```ts\n * import {TelegramClient} from "telegram";\n *\n * const client = new TelegramClient(new StringSession(\'\'),apiId,apiHash,{});\n * ```\n *\n * You don\'t need to import any methods that are inside the TelegramClient class as they binding in it.\n */\n\n\nclass TelegramClient extends telegramBaseClient_1.TelegramBaseClient {\n /**\n * @param session - a session to be used to save the connection and auth key to. This can be a custom session that inherits MemorySession.\n * @param apiId - The API ID you obtained from https://my.telegram.org.\n * @param apiHash - T
|
|||
|
/*!********************************!*\
|
|||
|
!*** ./browser/client/auth.js ***!
|
|||
|
\********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function () {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n Object.defineProperty(o, "default", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o["default"] = v;\n});\n\nvar __importStar = this && this.__importStar || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n\n __setModuleDefault(result, mod);\n\n return result;\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports._authFlow = exports.signInBot = exports.signInWithPassword = exports.sendCode = exports.signInUserWithQrCode = exports.signInUser = exports.checkAuthorization = exports.start = void 0;\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst utils = __importStar(__webpack_require__(/*! ../Utils */ "./browser/Utils.js"));\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst Password_1 = __webpack_require__(/*! ../Password */ "./browser/Password.js");\n\nconst QR_CODE_TIMEOUT = 30000; // region public methods\n\n/** @hidden */\n\nasync function start(client, authParams) {\n if (!client.connected) {\n await client.connect();\n }\n\n if (await client.checkAuthorization()) {\n return;\n }\n\n const apiCredentials = {\n apiId: client.apiId,\n apiHash: client.apiHash\n };\n await _authFlow(client, apiCredentials, authParams);\n}\n\nexports.start = start;\n/** @hidden */\n\nasync function checkAuthorization(client) {\n try {\n await client.invoke(new tl_1.Api.updates.GetState());\n return true;\n } catch (e) {\n return false;\n }\n}\n\nexports.checkAuthorization = checkAuthorization;\n/** @hidden */\n\nasync function signInUser(client, apiCredentials, authParams) {\n let phoneNumber;\n let phoneCodeHash;\n let isCodeViaApp = false;\n\n while (1) {\n try {\n if (typeof authParams.phoneNumber === "function") {\n try {\n phoneNumber = await authParams.phoneNumber();\n } catch (err) {\n if (err.errorMessage === "RESTART_AUTH_WITH_QR") {\n return client.signInUserWithQrCode(apiCredentials, authParams);\n }\n\n throw err;\n }\n } else {\n phoneNumber = authParams.phoneNumber;\n }\n\n const sendCodeResult = await client.sendCode(apiCredentials, phoneNumber, authParams.forceSMS);\n phoneCodeHash = sendCodeResult.phoneCodeHash;\n isCodeViaApp = sendCodeResult.isCodeViaApp;\n\n if (typeof phoneCodeHash !== "string") {\n throw new Error("Failed to retrieve phone code hash");\n }\n\n break;\n } catch (err) {\n if (typeof authParams.phoneNumber !== "function") {\n throw err;\n }\n\n const shouldWeStop = await authParams.onError(err);\n\n if (shouldWeStop) {\n throw new Error("AUTH_USER_CANCEL");\n }\n }\n }\n\n let phoneCode;\n let isRegistrationRequired = false;\n let termsOfService;\n\n while (1) {\n try {\n try {\n phoneCode = await authParams.phoneCode(isCodeViaApp);\n } catch (err) {\n // This is the support for changing phone number from the phone code screen.\n if (err.errorMessage === "RESTART_AUTH") {\n return client.signInUser(apiCredentials, authParams);\n }\n }\n\n if (!phoneCode) {\n throw new Error("Code is empty");\n } // May raise PhoneCodeEmptyError, PhoneCodeExpiredError,\n // PhoneCodeHashEmptyE
|
|||
|
/*!********************************!*\
|
|||
|
!*** ./browser/client/bots.js ***!
|
|||
|
\********************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.inlineQuery = void 0;\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst inlineResults_1 = __webpack_require__(/*! ../tl/custom/inlineResults */ "./browser/tl/custom/inlineResults.js");\n\nvar GetInlineBotResults = tl_1.Api.messages.GetInlineBotResults; // BotMethods\n\n/** @hidden */\n\nasync function inlineQuery(client, bot, query, entity, offset, geoPoint) {\n bot = await client.getInputEntity(bot);\n let peer = new tl_1.Api.InputPeerSelf();\n\n if (entity) {\n peer = await client.getInputEntity(entity);\n }\n\n const result = await client.invoke(new GetInlineBotResults({\n bot: bot,\n peer: peer,\n query: query,\n offset: offset || "",\n geoPoint: geoPoint\n }));\n return new inlineResults_1.InlineResults(client, result, entity ? peer : undefined);\n}\n\nexports.inlineQuery = inlineQuery;\n\n//# sourceURL=webpack://telegram/./browser/client/bots.js?')},"./browser/client/buttons.js":
|
|||
|
/*!***********************************!*\
|
|||
|
!*** ./browser/client/buttons.js ***!
|
|||
|
\***********************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.buildReplyMarkup = void 0;\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst button_1 = __webpack_require__(/*! ../tl/custom/button */ "./browser/tl/custom/button.js");\n\nconst messageButton_1 = __webpack_require__(/*! ../tl/custom/messageButton */ "./browser/tl/custom/messageButton.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js"); // ButtonMethods\n\n/** @hidden */\n\n\nfunction buildReplyMarkup(buttons, inlineOnly = false) {\n if (buttons == undefined) {\n return undefined;\n }\n\n if ("SUBCLASS_OF_ID" in buttons) {\n if (buttons.SUBCLASS_OF_ID == 0xe2e10ef2) {\n return buttons;\n }\n }\n\n if (!(0, Helpers_1.isArrayLike)(buttons)) {\n buttons = [[buttons]];\n } else if (!buttons || !(0, Helpers_1.isArrayLike)(buttons[0])) {\n // @ts-ignore\n buttons = [buttons];\n }\n\n let isInline = false;\n let isNormal = false;\n let resize = undefined;\n const singleUse = false;\n const selective = false;\n const rows = []; // @ts-ignore\n\n for (const row of buttons) {\n const current = [];\n\n for (let button of row) {\n if (button instanceof button_1.Button) {\n if (button.resize != undefined) {\n resize = button.resize;\n }\n\n if (button.singleUse != undefined) {\n resize = button.singleUse;\n }\n\n if (button.selective != undefined) {\n resize = button.selective;\n }\n\n button = button.button;\n } else if (button instanceof messageButton_1.MessageButton) {\n button = button.button;\n }\n\n const inline = button_1.Button._isInline(button);\n\n if (!isInline && inline) {\n isInline = true;\n }\n\n if (!isNormal && inline) {\n isNormal = false;\n }\n\n if (button.SUBCLASS_OF_ID == 0xbad74a3) {\n // 0xbad74a3 == crc32(b\'KeyboardButton\')\n current.push(button);\n }\n }\n\n if (current) {\n rows.push(new tl_1.Api.KeyboardButtonRow({\n buttons: current\n }));\n }\n }\n\n if (inlineOnly && isNormal) {\n throw new Error("You cannot use non-inline buttons here");\n } else if (isInline === isNormal && isNormal) {\n throw new Error("You cannot mix inline with normal buttons");\n } else if (isInline) {\n return new tl_1.Api.ReplyInlineMarkup({\n rows: rows\n });\n }\n\n return new tl_1.Api.ReplyKeyboardMarkup({\n rows: rows,\n resize: resize,\n singleUse: singleUse,\n selective: selective\n });\n}\n\nexports.buildReplyMarkup = buildReplyMarkup;\n\n//# sourceURL=webpack://telegram/./browser/client/buttons.js?')},"./browser/client/chats.js":
|
|||
|
/*!*********************************!*\
|
|||
|
!*** ./browser/client/chats.js ***!
|
|||
|
\*********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.getParticipants = exports.iterParticipants = exports._ParticipantsIter = void 0;\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst requestIter_1 = __webpack_require__(/*! ../requestIter */ "./browser/requestIter.js");\n\nconst __1 = __webpack_require__(/*! ../ */ "./browser/index.js");\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst inspect_1 = __webpack_require__(/*! ../inspect */ "./browser/inspect.js");\n\nconst _MAX_PARTICIPANTS_CHUNK_SIZE = 200;\nconst _MAX_ADMIN_LOG_CHUNK_SIZE = 100;\nconst _MAX_PROFILE_PHOTO_CHUNK_SIZE = 100;\n\nclass _ChatAction {\n constructor(client, chat, action, params = {\n delay: 4,\n autoCancel: true\n }) {\n this._client = client;\n this._chat = chat;\n this._action = action;\n this._delay = params.delay;\n this.autoCancel = params.autoCancel;\n this._request = undefined;\n this._task = null;\n this._running = false;\n }\n\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n async start() {\n this._request = new tl_1.Api.messages.SetTyping({\n peer: this._chat,\n action: this._action\n });\n this._running = true;\n\n this._update();\n }\n\n async stop() {\n this._running = false;\n\n if (this.autoCancel) {\n await this._client.invoke(new tl_1.Api.messages.SetTyping({\n peer: this._chat,\n action: new tl_1.Api.SendMessageCancelAction()\n }));\n }\n }\n\n async _update() {\n while (this._running) {\n if (this._request != undefined) {\n await this._client.invoke(this._request);\n }\n\n await (0, Helpers_1.sleep)(this._delay * 1000);\n }\n }\n\n progress(current, total) {\n if ("progress" in this._action) {\n this._action.progress = 100 * Math.round(current / total);\n }\n }\n\n}\n\n_ChatAction._str_mapping = {\n typing: new tl_1.Api.SendMessageTypingAction(),\n contact: new tl_1.Api.SendMessageChooseContactAction(),\n game: new tl_1.Api.SendMessageGamePlayAction(),\n location: new tl_1.Api.SendMessageGeoLocationAction(),\n "record-audio": new tl_1.Api.SendMessageRecordAudioAction(),\n "record-voice": new tl_1.Api.SendMessageRecordAudioAction(),\n "record-round": new tl_1.Api.SendMessageRecordRoundAction(),\n "record-video": new tl_1.Api.SendMessageRecordVideoAction(),\n audio: new tl_1.Api.SendMessageUploadAudioAction({\n progress: 1\n }),\n voice: new tl_1.Api.SendMessageUploadAudioAction({\n progress: 1\n }),\n song: new tl_1.Api.SendMessageUploadAudioAction({\n progress: 1\n }),\n round: new tl_1.Api.SendMessageUploadRoundAction({\n progress: 1\n }),\n video: new tl_1.Api.SendMessageUploadVideoAction({\n progress: 1\n }),\n photo: new tl_1.Api.SendMessageUploadPhotoAction({\n progress: 1\n }),\n document: new tl_1.Api.SendMessageUploadDocumentAction({\n progress: 1\n }),\n file: new tl_1.Api.SendMessageUploadDocumentAction({\n progress: 1\n }),\n cancel: new tl_1.Api.SendMessageCancelAction()\n};\n\nclass _ParticipantsIter extends requestIter_1.RequestIter {\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n async _init({\n entity,\n filter,\n offset,\n search,\n showTotal\n }) {\n var _a, _b;\n\n if (!offset) {\n offset = 0;\n }\n\n if (filter && filter.constructor === Function) {\n if ([tl_1.Api.ChannelParticipantsBanned, tl_1.Api.ChannelParticipantsKicked, tl_1.Api.ChannelParticipantsSearch, tl_1.Api.ChannelParticipantsContacts].includes(filte
|
|||
|
/*!***********************************!*\
|
|||
|
!*** ./browser/client/dialogs.js ***!
|
|||
|
\***********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.getDialogs = exports.iterDialogs = exports._DialogsIter = void 0;\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst requestIter_1 = __webpack_require__(/*! ../requestIter */ "./browser/requestIter.js");\n\nconst index_1 = __webpack_require__(/*! ../index */ "./browser/index.js");\n\nconst dialog_1 = __webpack_require__(/*! ../tl/custom/dialog */ "./browser/tl/custom/dialog.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst Logger_1 = __webpack_require__(/*! ../extensions/Logger */ "./browser/extensions/Logger.js");\n\nconst _MAX_CHUNK_SIZE = 100;\n/**\n Get the key to get messages from a dialog.\n\n We cannot just use the message ID because channels share message IDs,\n and the peer ID is required to distinguish between them. But it is not\n necessary in small group chats and private chats.\n * @param {Api.TypePeer} [peer] the dialog peer\n * @param {number} [messageId] the message id\n * @return {[number,number]} the channel id and message id\n */\n\nfunction _dialogMessageKey(peer, messageId) {\n // can\'t use arrays as keys for map :( need to convert to string.\n return "" + [peer instanceof tl_1.Api.PeerChannel ? peer.channelId : undefined, messageId];\n}\n\nclass _DialogsIter extends requestIter_1.RequestIter {\n async _init({\n offsetDate,\n offsetId,\n offsetPeer,\n ignorePinned,\n ignoreMigrated,\n folder\n }) {\n this.request = new tl_1.Api.messages.GetDialogs({\n offsetDate,\n offsetId,\n offsetPeer,\n limit: 1,\n hash: big_integer_1.default.zero,\n excludePinned: ignorePinned,\n folderId: folder\n });\n\n if (this.limit <= 0) {\n // Special case, get a single dialog and determine count\n const dialogs = await this.client.invoke(this.request);\n\n if ("count" in dialogs) {\n this.total = dialogs.count;\n } else {\n this.total = dialogs.dialogs.length;\n }\n\n return true;\n }\n\n this.seen = new Set();\n this.offsetDate = offsetDate;\n this.ignoreMigrated = ignoreMigrated;\n }\n\n [Symbol.asyncIterator]() {\n return super[Symbol.asyncIterator]();\n }\n\n async _loadNextChunk() {\n if (!this.request || !this.seen || !this.buffer) {\n return;\n }\n\n this.request.limit = Math.min(this.left, _MAX_CHUNK_SIZE);\n const r = await this.client.invoke(this.request);\n\n if (r instanceof tl_1.Api.messages.DialogsNotModified) {\n return;\n }\n\n if ("count" in r) {\n this.total = r.count;\n } else {\n this.total = r.dialogs.length;\n }\n\n const entities = new Map();\n const messages = new Map();\n\n for (const entity of [...r.users, ...r.chats]) {\n if (entity instanceof tl_1.Api.UserEmpty || entity instanceof tl_1.Api.ChatEmpty) {\n continue;\n }\n\n entities.set(index_1.utils.getPeerId(entity), entity);\n }\n\n for (const m of r.messages) {\n let message = m;\n\n try {\n // todo make sure this never fails\n message._finishInit(this.client, entities, undefined);\n } catch (e) {\n this.client._log.error("Got error while trying to finish init message with id " + m.id);\n\n if (this.client._log.canSend(Logger_1.LogLevel.ERROR)) {\n console.error(e);\n }\n }\n\n messages.set(_dialogMessageKey(message.peerId, message.id), message);\n }\n\n for (const d of r.dialogs) {\n if (d instanceof tl_1.Api.DialogFolder) {\n continue;\n }\n\n const message = messages.get(_dialogMessageKey(d.peer, d.topMessage));\n\n if (this.offsetDate != undefined) {\n con
|
|||
|
/*!*************************************!*\
|
|||
|
!*** ./browser/client/downloads.js ***!
|
|||
|
\*************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function () {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n Object.defineProperty(o, "default", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o["default"] = v;\n});\n\nvar __importStar = this && this.__importStar || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n\n __setModuleDefault(result, mod);\n\n return result;\n};\n\nvar __asyncValues = this && this.__asyncValues || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var m = o[Symbol.asyncIterator],\n i;\n return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i);\n\n function verb(n) {\n i[n] = o[n] && function (v) {\n return new Promise(function (resolve, reject) {\n v = o[n](v), settle(resolve, reject, v.done, v.value);\n });\n };\n }\n\n function settle(resolve, reject, d, v) {\n Promise.resolve(v).then(function (v) {\n resolve({\n value: v,\n done: d\n });\n }, reject);\n }\n};\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.downloadProfilePhoto = exports._downloadPhoto = exports._downloadCachedPhotoSize = exports._downloadWebDocument = exports._downloadContact = exports._downloadDocument = exports.downloadMedia = exports.downloadFileV2 = exports.iterDownload = exports.GenericDownloadIter = exports.DirectDownloadIter = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst Utils_1 = __webpack_require__(/*! ../Utils */ "./browser/Utils.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst __1 = __webpack_require__(/*! ../ */ "./browser/index.js");\n\nconst requestIter_1 = __webpack_require__(/*! ../requestIter */ "./browser/requestIter.js");\n\nconst errors_1 = __webpack_require__(/*! ../errors */ "./browser/errors/index.js");\n\nconst fs_1 = __webpack_require__(/*! ./fs */ "./browser/client/fs.js");\n\nconst extensions_1 = __webpack_require__(/*! ../extensions */ "./browser/extensions/index.js");\n\nconst fs = __importStar(__webpack_require__(/*! ./fs */ "./browser/client/fs.js"));\n\nconst path_1 = __importDefault(__webpack_require__(/*! ./path */ "./browser/client/path.js"));\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js")); // All types\n\n\nconst sizeTypes = ["w", "y", "d", "x", "c", "m", "b", "a", "s"]; // Chunk sizes for `upload.getFile` must be multiple of the smallest size\n\nconst MIN_CHUNK_SIZE = 4096;\nconst DEFAULT_CHUNK_SIZE = 64; // kb\n\nconst ONE_MB = 1024 * 1024;\nconst REQUEST_TIMEOUT = 15000;\nconst DISCONNECT_SLEEP = 1000;\nconst TIMED_OUT_SLEEP = 1000;\nconst MAX_CHUNK_SIZE = 512 * 1024;\n\nclass DirectDownloadIter extends requestIter_1.RequestIter {\n constructor() {\n super(...arguments);\n this._timedOut = false;\n }\n\n async _init({\n fileLocation,\n dcId,\n offset,\n stride,\n chunkSize,\n requestSize,\n fileSize,\n msgData
|
|||
|
/*!******************************!*\
|
|||
|
!*** ./browser/client/fs.js ***!
|
|||
|
\******************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.existsSync = exports.lstatSync = exports.WriteStream = exports.createWriteStream = exports.promises = void 0;\nexports.promises = {\n lstat: (...args) => {},\n stat: (...args) => {},\n readFile: (...args) => {},\n open: (...args) => {}\n};\nexports.createWriteStream = {};\nexports.WriteStream = {};\nexports.lstatSync = {};\nexports.existsSync = {};\n\n//# sourceURL=webpack://telegram/./browser/client/fs.js?')},"./browser/client/index.js":
|
|||
|
/*!*********************************!*\
|
|||
|
!*** ./browser/client/index.js ***!
|
|||
|
\*********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function () {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n Object.defineProperty(o, "default", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o["default"] = v;\n});\n\nvar __importStar = this && this.__importStar || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n\n __setModuleDefault(result, mod);\n\n return result;\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.users = exports.uploads = exports.updates = exports.tgClient = exports.telegramBaseClient = exports.message = exports.messageParse = exports.downloads = exports.dialogs = exports.chats = exports.buttons = exports.bots = exports.auth = exports.twoFA = void 0;\n\nconst twoFA = __importStar(__webpack_require__(/*! ./2fa */ "./browser/client/2fa.js"));\n\nexports.twoFA = twoFA;\n\nconst auth = __importStar(__webpack_require__(/*! ./auth */ "./browser/client/auth.js"));\n\nexports.auth = auth;\n\nconst bots = __importStar(__webpack_require__(/*! ./bots */ "./browser/client/bots.js"));\n\nexports.bots = bots;\n\nconst buttons = __importStar(__webpack_require__(/*! ./buttons */ "./browser/client/buttons.js"));\n\nexports.buttons = buttons;\n\nconst chats = __importStar(__webpack_require__(/*! ./chats */ "./browser/client/chats.js"));\n\nexports.chats = chats;\n\nconst dialogs = __importStar(__webpack_require__(/*! ./dialogs */ "./browser/client/dialogs.js"));\n\nexports.dialogs = dialogs;\n\nconst downloads = __importStar(__webpack_require__(/*! ./downloads */ "./browser/client/downloads.js"));\n\nexports.downloads = downloads;\n\nconst messageParse = __importStar(__webpack_require__(/*! ./messageParse */ "./browser/client/messageParse.js"));\n\nexports.messageParse = messageParse;\n\nconst message = __importStar(__webpack_require__(/*! ./messages */ "./browser/client/messages.js"));\n\nexports.message = message;\n\nconst telegramBaseClient = __importStar(__webpack_require__(/*! ./telegramBaseClient */ "./browser/client/telegramBaseClient.js"));\n\nexports.telegramBaseClient = telegramBaseClient;\n\nconst tgClient = __importStar(__webpack_require__(/*! ./TelegramClient */ "./browser/client/TelegramClient.js"));\n\nexports.tgClient = tgClient;\n\nconst updates = __importStar(__webpack_require__(/*! ./updates */ "./browser/client/updates.js"));\n\nexports.updates = updates;\n\nconst uploads = __importStar(__webpack_require__(/*! ./uploads */ "./browser/client/uploads.js"));\n\nexports.uploads = uploads;\n\nconst users = __importStar(__webpack_require__(/*! ./users */ "./browser/client/users.js"));\n\nexports.users = users;\n\n//# sourceURL=webpack://telegram/./browser/client/index.js?')},"./browser/client/messageParse.js":
|
|||
|
/*!****************************************!*\
|
|||
|
!*** ./browser/client/messageParse.js ***!
|
|||
|
\****************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports._getResponseMessage = exports._parseMessageText = exports._replaceWithMention = exports.DEFAULT_DELIMITERS = void 0;\n\nconst Utils_1 = __webpack_require__(/*! ../Utils */ "./browser/Utils.js");\n\nconst api_1 = __webpack_require__(/*! ../tl/api */ "./browser/tl/api.js");\n\nconst index_1 = __webpack_require__(/*! ../index */ "./browser/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nexports.DEFAULT_DELIMITERS = {\n "**": api_1.Api.MessageEntityBold,\n __: api_1.Api.MessageEntityItalic,\n "~~": api_1.Api.MessageEntityStrike,\n "`": api_1.Api.MessageEntityCode,\n "```": api_1.Api.MessageEntityPre\n};\n/** @hidden */\n\nasync function _replaceWithMention(client, entities, i, user) {\n try {\n entities[i] = new api_1.Api.InputMessageEntityMentionName({\n offset: entities[i].offset,\n length: entities[i].length,\n userId: await client.getInputEntity(user)\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n\nexports._replaceWithMention = _replaceWithMention;\n/** @hidden */\n\nasync function _parseMessageText(client, message, parseMode) {\n if (parseMode == false) {\n return [message, []];\n }\n\n if (parseMode == undefined) {\n if (client.parseMode == undefined) {\n return [message, []];\n }\n\n parseMode = client.parseMode;\n } else if (typeof parseMode === "string") {\n parseMode = (0, Utils_1.sanitizeParseMode)(parseMode);\n }\n\n const [rawMessage, msgEntities] = parseMode.parse(message);\n\n for (let i = msgEntities.length - 1; i >= 0; i--) {\n const e = msgEntities[i];\n\n if (e instanceof api_1.Api.MessageEntityTextUrl) {\n const m = /^@|\\+|tg:\\/\\/user\\?id=(\\d+)/.exec(e.url);\n\n if (m) {\n const userIdOrUsername = m[1] ? Number(m[1]) : e.url;\n const isMention = await _replaceWithMention(client, msgEntities, i, userIdOrUsername);\n\n if (!isMention) {\n msgEntities.splice(i, 1);\n }\n }\n }\n }\n\n return [rawMessage, msgEntities];\n}\n\nexports._parseMessageText = _parseMessageText;\n/** @hidden */\n\nfunction _getResponseMessage(client, request, result, inputChat) {\n let updates = [];\n let entities = new Map();\n\n if (result instanceof api_1.Api.UpdateShort) {\n updates = [result.update];\n } else if (result instanceof api_1.Api.Updates || result instanceof api_1.Api.UpdatesCombined) {\n updates = result.updates;\n\n for (const x of [...result.users, ...result.chats]) {\n entities.set(index_1.utils.getPeerId(x), x);\n }\n } else {\n return;\n }\n\n const randomToId = new Map();\n const idToMessage = new Map();\n let schedMessage;\n\n for (const update of updates) {\n if (update instanceof api_1.Api.UpdateMessageID) {\n randomToId.set(update.randomId.toString(), update.id);\n } else if (update instanceof api_1.Api.UpdateNewChannelMessage || update instanceof api_1.Api.UpdateNewMessage) {\n update.message._finishInit(client, entities, inputChat);\n\n if ("randomId" in request || (0, Helpers_1.isArrayLike)(request)) {\n idToMessage.set(update.message.id, update.message);\n } else {\n return update.message;\n }\n } else if (update instanceof api_1.Api.UpdateEditMessage && "peer" in request && (0, Helpers_1._entityType)(request.peer) != Helpers_1._EntityType.CHANNEL) {\n update.message._finishInit(client, entities, inputChat);\n\n if ("randomId" in request) {\n idToMessage.set(update.message.id, update.message);\n } else if ("id" in request && request.id === up
|
|||
|
/*!************************************!*\
|
|||
|
!*** ./browser/client/messages.js ***!
|
|||
|
\************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __asyncValues = this && this.__asyncValues || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var m = o[Symbol.asyncIterator],\n i;\n return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i);\n\n function verb(n) {\n i[n] = o[n] && function (v) {\n return new Promise(function (resolve, reject) {\n v = o[n](v), settle(resolve, reject, v.done, v.value);\n });\n };\n }\n\n function settle(resolve, reject, d, v) {\n Promise.resolve(v).then(function (v) {\n resolve({\n value: v,\n done: d\n });\n }, reject);\n }\n};\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.getCommentData = exports.markAsRead = exports._pin = exports.unpinMessage = exports.pinMessage = exports.deleteMessages = exports.editMessage = exports.forwardMessages = exports.sendMessage = exports.getMessages = exports.iterMessages = exports._IDsIter = exports._MessagesIter = void 0;\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst requestIter_1 = __webpack_require__(/*! ../requestIter */ "./browser/requestIter.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst Utils_1 = __webpack_require__(/*! ../Utils */ "./browser/Utils.js");\n\nconst __1 = __webpack_require__(/*! ../ */ "./browser/index.js");\n\nconst messageParse_1 = __webpack_require__(/*! ./messageParse */ "./browser/client/messageParse.js");\n\nconst users_1 = __webpack_require__(/*! ./users */ "./browser/client/users.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst uploads_1 = __webpack_require__(/*! ./uploads */ "./browser/client/uploads.js");\n\nconst _MAX_CHUNK_SIZE = 100;\n\nclass _MessagesIter extends requestIter_1.RequestIter {\n async _init({\n entity,\n offsetId,\n minId,\n maxId,\n fromUser,\n offsetDate,\n addOffset,\n filter,\n search,\n replyTo\n }) {\n var e_1, _a;\n\n if (entity) {\n this.entity = await this.client.getInputEntity(entity);\n } else {\n this.entity = undefined;\n\n if (this.reverse) {\n throw new Error("Cannot reverse global search");\n }\n }\n\n if (this.reverse) {\n offsetId = Math.max(offsetId, minId);\n\n if (offsetId && maxId) {\n if (maxId - offsetId <= 1) {\n return false;\n }\n }\n\n if (!maxId) {\n maxId = Number.MAX_SAFE_INTEGER;\n }\n } else {\n offsetId = Math.max(offsetId, maxId);\n\n if (offsetId && minId) {\n if (offsetId - minId <= 1) {\n return false;\n }\n }\n }\n\n if (this.reverse) {\n if (offsetId) {\n offsetId += 1;\n } else if (!offsetDate) {\n offsetId = 1;\n }\n }\n\n if (fromUser) {\n fromUser = await this.client.getInputEntity(fromUser);\n }\n\n if (!this.entity && fromUser) {\n this.entity = new tl_1.Api.InputPeerEmpty();\n }\n\n if (!filter) {\n filter = new tl_1.Api.InputMessagesFilterEmpty();\n }\n\n if (!this.entity) {\n this.request = new tl_1.Api.messages.SearchGlobal({\n q: search || "",\n filter: filter,\n minDate: undefined,\n // TODO fix this smh\n maxDate: offsetDate,\n offsetRate: undefined,\n offsetPeer: new tl_1.Api.InputPeerEmpty(),\n offsetId: offsetId,\n limit: 1\n });\n } else if (replyTo !== undefined) {\n this.request = new tl_1.Api.messages.GetReplies({\n
|
|||
|
/*!******************************!*\
|
|||
|
!*** ./browser/client/os.js ***!
|
|||
|
\******************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = {\n type: () => {\n return "Browser";\n },\n release: () => {\n return "1.0";\n }\n};\n\n//# sourceURL=webpack://telegram/./browser/client/os.js?')},"./browser/client/path.js":
|
|||
|
/*!********************************!*\
|
|||
|
!*** ./browser/client/path.js ***!
|
|||
|
\********************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports["default"] = {\n basename(...args) {},\n\n resolve(...args) {},\n\n path(...args) {},\n\n join(...args) {}\n\n};\n\n//# sourceURL=webpack://telegram/./browser/client/path.js?')},"./browser/client/telegramBaseClient.js":
|
|||
|
/*!**********************************************!*\
|
|||
|
!*** ./browser/client/telegramBaseClient.js ***!
|
|||
|
\**********************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.TelegramBaseClient = void 0;\n\nconst __1 = __webpack_require__(/*! ../ */ "./browser/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst connection_1 = __webpack_require__(/*! ../network/connection */ "./browser/network/connection/index.js");\n\nconst sessions_1 = __webpack_require__(/*! ../sessions */ "./browser/sessions/index.js");\n\nconst extensions_1 = __webpack_require__(/*! ../extensions */ "./browser/extensions/index.js");\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst os_1 = __importDefault(__webpack_require__(/*! ./os */ "./browser/client/os.js"));\n\nconst entityCache_1 = __webpack_require__(/*! ../entityCache */ "./browser/entityCache.js");\n\nconst markdown_1 = __webpack_require__(/*! ../extensions/markdown */ "./browser/extensions/markdown.js");\n\nconst network_1 = __webpack_require__(/*! ../network */ "./browser/network/index.js");\n\nconst AllTLObjects_1 = __webpack_require__(/*! ../tl/AllTLObjects */ "./browser/tl/AllTLObjects.js");\n\nconst TCPMTProxy_1 = __webpack_require__(/*! ../network/connection/TCPMTProxy */ "./browser/network/connection/TCPMTProxy.js");\n\nconst async_mutex_1 = __webpack_require__(/*! async-mutex */ "./node_modules/async-mutex/lib/index.js");\n\nconst Logger_1 = __webpack_require__(/*! ../extensions/Logger */ "./browser/extensions/Logger.js");\n\nconst platform_1 = __webpack_require__(/*! ../platform */ "./browser/platform.js");\n\nconst EXPORTED_SENDER_RECONNECT_TIMEOUT = 1000; // 1 sec\n\nconst EXPORTED_SENDER_RELEASE_TIMEOUT = 30000; // 30 sec\n\nconst DEFAULT_DC_ID = 4;\nconst DEFAULT_IPV4_IP = platform_1.isNode ? "149.154.167.91" : "vesta.web.telegram.org";\nconst DEFAULT_IPV6_IP = "2001:067c:04e8:f004:0000:0000:0000:000a";\nconst clientParamsDefault = {\n connection: platform_1.isNode ? connection_1.ConnectionTCPFull : connection_1.ConnectionTCPObfuscated,\n networkSocket: platform_1.isNode ? extensions_1.PromisedNetSockets : extensions_1.PromisedWebSockets,\n useIPV6: false,\n timeout: 10,\n requestRetries: 5,\n connectionRetries: Infinity,\n retryDelay: 1000,\n downloadRetries: 5,\n autoReconnect: true,\n sequentialUpdates: false,\n floodSleepThreshold: 60,\n deviceModel: "",\n systemVersion: "",\n appVersion: "",\n langCode: "en",\n systemLangCode: "en",\n _securityChecks: true,\n useWSS: platform_1.isBrowser ? window.location.protocol == "https:" : false,\n testServers: false\n};\n\nclass TelegramBaseClient {\n constructor(session, apiId, apiHash, clientParams) {\n var _a;\n /** The current gramJS version. */\n\n\n this.__version__ = __1.version;\n /** @hidden */\n\n this._ALBUMS = new Map();\n /** @hidden */\n\n this._exportedSenderPromises = new Map();\n /** @hidden */\n\n this._exportedSenderReleaseTimeouts = new Map();\n clientParams = Object.assign(Object.assign({}, clientParamsDefault), clientParams);\n\n if (!apiId || !apiHash) {\n throw new Error("Your API ID or Hash cannot be empty or undefined");\n }\n\n if (clientParams.baseLogger) {\n this._log = clientParams.baseLogger;\n } else {\n this._log = new extensions_1.Logger();\n }\n\n this._log.info("Running gramJS version " + __1.version);\n\n if (session && typeof session == "string") {\n session = new sessions_1.StoreSession(session);\n }\n\n if (!(session instanceof sessions_1.Session)) {\n throw new Error("Only StringSession and StoreSessions are supported currently :( ");\n }\n\n this._floodSleepThreshold = clientParams.floodSleepThreshold;\n this.session = session;\n this.apiId = apiId;\n this.apiHash = apiHash;\n this._useIPV6 = clientParams.us
|
|||
|
/*!***********************************!*\
|
|||
|
!*** ./browser/client/updates.js ***!
|
|||
|
\***********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports._updateLoop = exports._dispatchUpdate = exports._processUpdate = exports._handleUpdate = exports.catchUp = exports.listEventHandlers = exports.removeEventHandler = exports.addEventHandler = exports.on = exports.StopPropagation = void 0;\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst network_1 = __webpack_require__(/*! ../network */ "./browser/network/index.js");\n\nconst index_1 = __webpack_require__(/*! ../index */ "./browser/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst PING_INTERVAL = 9000; // 9 sec\n\nconst PING_TIMEOUT = 10000; // 10 sec\n\nconst PING_FAIL_ATTEMPTS = 3;\nconst PING_FAIL_INTERVAL = 100; // ms\n\nconst PING_DISCONNECT_DELAY = 60000; // 1 min\n\n/**\n If this exception is raised in any of the handlers for a given event,\n it will stop the execution of all other registered event handlers.\n It can be seen as the ``StopIteration`` in a for loop but for events.\n */\n\nclass StopPropagation extends Error {}\n\nexports.StopPropagation = StopPropagation;\n/** @hidden */\n\nfunction on(client, event) {\n return f => {\n client.addEventHandler(f, event);\n return f;\n };\n}\n\nexports.on = on;\n/** @hidden */\n\nfunction addEventHandler(client, callback, event) {\n if (event == undefined) {\n // recursive imports :(\n const raw = (__webpack_require__(/*! ../events/Raw */ "./browser/events/Raw.js").Raw);\n\n event = new raw({});\n }\n\n event.client = client;\n\n client._eventBuilders.push([event, callback]);\n}\n\nexports.addEventHandler = addEventHandler;\n/** @hidden */\n\nfunction removeEventHandler(client, callback, event) {\n client._eventBuilders = client._eventBuilders.filter(function (item) {\n return item[0] !== event && item[1] !== callback;\n });\n}\n\nexports.removeEventHandler = removeEventHandler;\n/** @hidden */\n\nfunction listEventHandlers(client) {\n return client._eventBuilders;\n}\n\nexports.listEventHandlers = listEventHandlers;\n/** @hidden */\n\nfunction catchUp() {// TODO\n}\n\nexports.catchUp = catchUp;\n/** @hidden */\n\nfunction _handleUpdate(client, update) {\n if (typeof update === "number") {\n if ([-1, 0, 1].includes(update)) {\n _dispatchUpdate(client, {\n update: new network_1.UpdateConnectionState(update)\n });\n\n return;\n }\n } //this.session.processEntities(update)\n\n\n client._entityCache.add(update);\n\n client.session.processEntities(update);\n\n if (update instanceof tl_1.Api.Updates || update instanceof tl_1.Api.UpdatesCombined) {\n // TODO deal with entities\n const entities = new Map();\n\n for (const x of [...update.users, ...update.chats]) {\n entities.set(index_1.utils.getPeerId(x), x);\n }\n\n for (const u of update.updates) {\n _processUpdate(client, u, update.updates, entities);\n }\n } else if (update instanceof tl_1.Api.UpdateShort) {\n _processUpdate(client, update.update, null);\n } else {\n _processUpdate(client, update, null);\n }\n}\n\nexports._handleUpdate = _handleUpdate;\n/** @hidden */\n\nfunction _processUpdate(client, update, others, entities) {\n update._entities = entities || new Map();\n const args = {\n update: update,\n others: others\n };\n\n _dispatchUpdate(client, args);\n}\n\nexports._processUpdate = _processUpdate;\n/** @hidden */\n\nasync function _dispatchUpdate(client, args) {\n for (const [builder, callback] of client._eventBuilders) {\n if (!builder || !callback) {\n continue;\n }\n\n if (!builder.resolved) {\n await builder.resolve(client);\n
|
|||
|
/*!***********************************!*\
|
|||
|
!*** ./browser/client/uploads.js ***!
|
|||
|
\***********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.sendFile = exports._sendAlbum = exports._fileToMedia = exports.uploadFile = exports.CustomFile = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst Utils_1 = __webpack_require__(/*! ../Utils */ "./browser/Utils.js");\n\nconst path_1 = __importDefault(__webpack_require__(/*! ./path */ "./browser/client/path.js"));\n\nconst fs_1 = __webpack_require__(/*! ./fs */ "./browser/client/fs.js");\n\nconst index_1 = __webpack_require__(/*! ../index */ "./browser/index.js");\n\nconst messageParse_1 = __webpack_require__(/*! ./messageParse */ "./browser/client/messageParse.js");\n\nconst messages_1 = __webpack_require__(/*! ./messages */ "./browser/client/messages.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n/**\n * A custom file class that mimics the browser\'s File class.<br/>\n * You should use this whenever you want to upload a file.\n */\n\n\nclass CustomFile {\n constructor(name, size, path, buffer) {\n this.name = name;\n this.size = size;\n this.path = path;\n this.buffer = buffer;\n }\n\n}\n\nexports.CustomFile = CustomFile;\n\nclass CustomBuffer {\n constructor(options) {\n this.options = options;\n\n if (!options.buffer && !options.filePath) {\n throw new Error("Either one of `buffer` or `filePath` should be specified");\n }\n }\n\n async slice(begin, end) {\n const {\n buffer,\n filePath\n } = this.options;\n\n if (buffer) {\n return buffer.slice(begin, end);\n } else if (filePath) {\n const buffSize = end - begin;\n const buff = buffer_1.Buffer.alloc(buffSize);\n const fHandle = await fs_1.promises.open(filePath, "r");\n await fHandle.read(buff, 0, buffSize, begin);\n await fHandle.close();\n return buffer_1.Buffer.from(buff);\n }\n\n return buffer_1.Buffer.alloc(0);\n }\n\n}\n\nconst KB_TO_BYTES = 1024;\nconst LARGE_FILE_THRESHOLD = 10 * 1024 * 1024;\nconst UPLOAD_TIMEOUT = 15 * 1000;\nconst DISCONNECT_SLEEP = 1000;\nconst BUFFER_SIZE_2GB = 2 ** 31;\n\nasync function getFileBuffer(file, fileSize, maxBufferSize) {\n const options = {};\n\n if (fileSize > maxBufferSize && file instanceof CustomFile) {\n options.filePath = file.path;\n } else {\n options.buffer = buffer_1.Buffer.from(await fileToBuffer(file));\n }\n\n return new CustomBuffer(options);\n}\n/** @hidden */\n\n\nasync function uploadFile(client, fileParams) {\n const {\n file,\n onProgress\n } = fileParams;\n let {\n workers\n } = fileParams;\n const {\n name,\n size\n } = file;\n const fileId = (0, Helpers_1.readBigIntFromBuffer)((0, Helpers_1.generateRandomBytes)(8), true, true);\n const isLarge = size > LARGE_FILE_THRESHOLD;\n const partSize = (0, Utils_1.getAppropriatedPartSize)((0, big_integer_1.default)(size)) * KB_TO_BYTES;\n const partCount = Math.floor((size + partSize - 1) / partSize);\n const buffer = await getFileBuffer(file, size, fileParams.maxBufferSize || BUFFER_SIZE_2GB - 1); // Make sure a new sender can be created before starting upload\n\n await client.getSender(client.session.dcId);\n\n if (!workers || !size) {\n workers = 1;\n }\n\n if (workers >= partCount) {\n workers = partCount;\n }\n\n let progress = 0;\n\n if (onProgress) {\n onProgress(progress);\n }\n\n for (let i = 0; i < partCount; i += workers) {\n const sendingParts = [];\n let end = i + workers;\n\n if (end > partCount) {\n end = partCount;\n }\n\n for (let j = i; j < e
|
|||
|
/*!*********************************!*\
|
|||
|
!*** ./browser/client/users.js ***!
|
|||
|
\*********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports._selfId = exports._getInputNotify = exports._getInputDialog = exports._getPeer = exports.getPeerId = exports._getEntityFromString = exports.getInputEntity = exports.getEntity = exports.isUserAuthorized = exports.isBot = exports.getMe = exports.invoke = void 0;\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst Utils_1 = __webpack_require__(/*! ../Utils */ "./browser/Utils.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst __1 = __webpack_require__(/*! ../ */ "./browser/index.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst Logger_1 = __webpack_require__(/*! ../extensions/Logger */ "./browser/extensions/Logger.js"); // UserMethods {\n// region Invoking Telegram request\n\n/** @hidden */\n\n\nasync function invoke(client, request, sender) {\n if (request.classType !== "request") {\n throw new Error("You can only invoke MTProtoRequests");\n }\n\n if (!sender) {\n sender = client._sender;\n }\n\n if (sender == undefined) {\n throw new Error("Cannot send requests while disconnected. You need to call .connect()");\n }\n\n await request.resolve(client, __1.utils);\n client._lastRequest = new Date().getTime();\n let attempt;\n\n for (attempt = 0; attempt < client._requestRetries; attempt++) {\n try {\n const promise = sender.send(request);\n const result = await promise;\n client.session.processEntities(result);\n\n client._entityCache.add(result);\n\n return result;\n } catch (e) {\n if (e instanceof __1.errors.ServerError || e.errorMessage === "RPC_CALL_FAIL" || e.errorMessage === "RPC_MCGET_FAIL") {\n client._log.warn(`Telegram is having internal issues ${e.constructor.name}`);\n\n await (0, Helpers_1.sleep)(2000);\n } else if (e instanceof __1.errors.FloodWaitError || e instanceof __1.errors.FloodTestPhoneWaitError) {\n if (e.seconds <= client.floodSleepThreshold) {\n client._log.info(`Sleeping for ${e.seconds}s on flood wait (Caused by ${request.className})`);\n\n await (0, Helpers_1.sleep)(e.seconds * 1000);\n } else {\n throw e;\n }\n } else if (e instanceof __1.errors.PhoneMigrateError || e instanceof __1.errors.NetworkMigrateError || e instanceof __1.errors.UserMigrateError) {\n client._log.info(`Phone migrated to ${e.newDc}`);\n\n const shouldRaise = e instanceof __1.errors.PhoneMigrateError || e instanceof __1.errors.NetworkMigrateError;\n\n if (shouldRaise && (await client.isUserAuthorized())) {\n throw e;\n }\n\n await client._switchDC(e.newDc);\n } else {\n throw e;\n }\n }\n }\n\n throw new Error(`Request was unsuccessful ${attempt} time(s)`);\n}\n\nexports.invoke = invoke;\n/** @hidden */\n\nasync function getMe(client, inputPeer = false) {\n if (inputPeer && client._selfInputPeer) {\n return client._selfInputPeer;\n }\n\n const me = (await client.invoke(new tl_1.Api.users.GetUsers({\n id: [new tl_1.Api.InputUserSelf()]\n })))[0];\n client._bot = me.bot;\n\n if (!client._selfInputPeer) {\n client._selfInputPeer = __1.utils.getInputPeer(me, false);\n }\n\n return inputPeer ? client._selfInputPeer : me;\n}\n\nexports.getMe = getMe;\n/** @hidden */\n\nasync function isBot(client) {\n if (client._bot === undefined) {\n const me = await client.getMe();\n\n if (me) {\n return !(me instanceof tl_1.Api.InputPeerUser) ? me.bot : undefined;\n }\n }\n\n return client._bot;\n}\n\nexports.isBot = isBot;\n/** @hidden */\n\nasync function isUserAuthorized(client) {\n try {\n await client.inv
|
|||
|
/*!***********************************!*\
|
|||
|
!*** ./browser/crypto/AuthKey.js ***!
|
|||
|
\***********************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.AuthKey = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst extensions_1 = __webpack_require__(/*! ../extensions */ "./browser/extensions/index.js");\n\nconst Helpers_2 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nclass AuthKey {\n constructor(value, hash) {\n if (!hash || !value) {\n return;\n }\n\n this._key = value;\n this._hash = hash;\n const reader = new extensions_1.BinaryReader(hash);\n this.auxHash = reader.readLong(false);\n reader.read(4);\n this.keyId = reader.readLong(false);\n }\n\n async setKey(value) {\n if (!value) {\n this._key = this.auxHash = this.keyId = this._hash = undefined;\n return;\n }\n\n if (value instanceof AuthKey) {\n this._key = value._key;\n this.auxHash = value.auxHash;\n this.keyId = value.keyId;\n this._hash = value._hash;\n return;\n }\n\n this._key = value;\n this._hash = await (0, Helpers_1.sha1)(this._key);\n const reader = new extensions_1.BinaryReader(this._hash);\n this.auxHash = reader.readLong(false);\n reader.read(4);\n this.keyId = reader.readLong(false);\n }\n\n async waitForKey() {\n while (!this.keyId) {\n await (0, Helpers_2.sleep)(20);\n }\n }\n\n getKey() {\n return this._key;\n } // TODO : This doesn\'t really fit here, it\'s only used in authentication\n\n /**\n * Calculates the new nonce hash based on the current class fields\' values\n * @param newNonce\n * @param number\n * @returns {bigInt.BigInteger}\n */\n\n\n async calcNewNonceHash(newNonce, number) {\n if (this.auxHash) {\n const nonce = (0, Helpers_1.toSignedLittleBuffer)(newNonce, 32);\n const n = buffer_1.Buffer.alloc(1);\n n.writeUInt8(number, 0);\n const data = buffer_1.Buffer.concat([nonce, buffer_1.Buffer.concat([n, (0, Helpers_1.readBufferFromBigInt)(this.auxHash, 8, true)])]); // Calculates the message key from the given data\n\n const shaData = (await (0, Helpers_1.sha1)(data)).slice(4, 20);\n return (0, Helpers_1.readBigIntFromBuffer)(shaData, true, true);\n }\n\n throw new Error("Auth key not set");\n }\n\n equals(other) {\n var _a;\n\n return other instanceof this.constructor && this._key && buffer_1.Buffer.isBuffer(other.getKey()) && ((_a = other.getKey()) === null || _a === void 0 ? void 0 : _a.equals(this._key));\n }\n\n}\n\nexports.AuthKey = AuthKey;\n\n//# sourceURL=webpack://telegram/./browser/crypto/AuthKey.js?')},"./browser/crypto/CTR.js":
|
|||
|
/*!*******************************!*\
|
|||
|
!*** ./browser/crypto/CTR.js ***!
|
|||
|
\*******************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function () {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n Object.defineProperty(o, "default", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o["default"] = v;\n});\n\nvar __importStar = this && this.__importStar || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n\n __setModuleDefault(result, mod);\n\n return result;\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.CTR = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst crypto = __importStar(__webpack_require__(/*! ./crypto */ "./browser/crypto/crypto.js"));\n\nclass CTR {\n constructor(key, iv) {\n if (!buffer_1.Buffer.isBuffer(key) || !buffer_1.Buffer.isBuffer(iv) || iv.length !== 16) {\n throw new Error("Key and iv need to be a buffer");\n }\n\n this.cipher = crypto.createCipheriv("AES-256-CTR", key, iv);\n }\n\n encrypt(data) {\n return buffer_1.Buffer.from(this.cipher.update(data));\n }\n\n}\n\nexports.CTR = CTR;\n\n//# sourceURL=webpack://telegram/./browser/crypto/CTR.js?')},"./browser/crypto/Factorizator.js":
|
|||
|
/*!****************************************!*\
|
|||
|
!*** ./browser/crypto/Factorizator.js ***!
|
|||
|
\****************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.Factorizator = void 0;\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nclass Factorizator {\n /**\n * Calculates the greatest common divisor\n * @param a {BigInteger}\n * @param b {BigInteger}\n * @returns {BigInteger}\n */\n static gcd(a, b) {\n while (b.neq(big_integer_1.default.zero)) {\n const temp = b;\n b = a.remainder(b);\n a = temp;\n }\n\n return a;\n }\n /**\n * Factorizes the given number and returns both the divisor and the number divided by the divisor\n * @param pq {BigInteger}\n * @returns {{p: *, q: *}}\n */\n\n\n static factorize(pq) {\n if (pq.remainder(2).equals(big_integer_1.default.zero)) {\n return {\n p: (0, big_integer_1.default)(2),\n q: pq.divide((0, big_integer_1.default)(2))\n };\n }\n\n let y = big_integer_1.default.randBetween((0, big_integer_1.default)(1), pq.minus(1));\n const c = big_integer_1.default.randBetween((0, big_integer_1.default)(1), pq.minus(1));\n const m = big_integer_1.default.randBetween((0, big_integer_1.default)(1), pq.minus(1));\n let g = big_integer_1.default.one;\n let r = big_integer_1.default.one;\n let q = big_integer_1.default.one;\n let x = big_integer_1.default.zero;\n let ys = big_integer_1.default.zero;\n let k;\n\n while (g.eq(big_integer_1.default.one)) {\n x = y;\n\n for (let i = 0; (0, big_integer_1.default)(i).lesser(r); i++) {\n y = (0, Helpers_1.modExp)(y, (0, big_integer_1.default)(2), pq).add(c).remainder(pq);\n }\n\n k = big_integer_1.default.zero;\n\n while (k.lesser(r) && g.eq(big_integer_1.default.one)) {\n ys = y;\n const condition = big_integer_1.default.min(m, r.minus(k));\n\n for (let i = 0; (0, big_integer_1.default)(i).lesser(condition); i++) {\n y = (0, Helpers_1.modExp)(y, (0, big_integer_1.default)(2), pq).add(c).remainder(pq);\n q = q.multiply(x.minus(y).abs()).remainder(pq);\n }\n\n g = Factorizator.gcd(q, pq);\n k = k.add(m);\n }\n\n r = r.multiply(2);\n }\n\n if (g.eq(pq)) {\n while (true) {\n ys = (0, Helpers_1.modExp)(ys, (0, big_integer_1.default)(2), pq).add(c).remainder(pq);\n g = Factorizator.gcd(x.minus(ys).abs(), pq);\n\n if (g.greater(1)) {\n break;\n }\n }\n }\n\n const p = g;\n q = pq.divide(g);\n return p < q ? {\n p: p,\n q: q\n } : {\n p: q,\n q: p\n };\n }\n\n}\n\nexports.Factorizator = Factorizator;\n\n//# sourceURL=webpack://telegram/./browser/crypto/Factorizator.js?')},"./browser/crypto/IGE.js":
|
|||
|
/*!*******************************!*\
|
|||
|
!*** ./browser/crypto/IGE.js ***!
|
|||
|
\*******************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.IGE = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst Helpers = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst {\n IGE: aes_ige\n} = __webpack_require__(/*! @cryptography/aes */ "./node_modules/@cryptography/aes/dist/es/aes.js");\n\nclass IGENEW {\n constructor(key, iv) {\n this.ige = new aes_ige(key, iv);\n }\n /**\n * Decrypts the given text in 16-bytes blocks by using the given key and 32-bytes initialization vector\n * @param cipherText {Buffer}\n * @returns {Buffer}\n */\n\n\n decryptIge(cipherText) {\n return Helpers.convertToLittle(this.ige.decrypt(cipherText));\n }\n /**\n * Encrypts the given text in 16-bytes blocks by using the given key and 32-bytes initialization vector\n * @param plainText {Buffer}\n * @returns {Buffer}\n */\n\n\n encryptIge(plainText) {\n const padding = plainText.length % 16;\n\n if (padding) {\n plainText = buffer_1.Buffer.concat([plainText, Helpers.generateRandomBytes(16 - padding)]);\n }\n\n return Helpers.convertToLittle(this.ige.encrypt(plainText));\n }\n\n}\n\nexports.IGE = IGENEW;\n\n//# sourceURL=webpack://telegram/./browser/crypto/IGE.js?')},"./browser/crypto/RSA.js":
|
|||
|
/*!*******************************!*\
|
|||
|
!*** ./browser/crypto/RSA.js ***!
|
|||
|
\*******************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.encrypt = exports._serverKeys = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst PUBLIC_KEYS = [{\n fingerprint: (0, big_integer_1.default)("-3414540481677951611"),\n n: (0, big_integer_1.default)("2937959817066933702298617714945612856538843112005886376816255642404751219133084745514657634448776440866" + "1701890505066208632169112269581063774293102577308490531282748465986139880977280302242772832972539403531" + "3160108704012876427630091361567343395380424193887227773571344877461690935390938502512438971889287359033" + "8945177273024525306296338410881284207988753897636046529094613963869149149606209957083647645485599631919" + "2747663615955633778034897140982517446405334423701359108810182097749467210509584293428076654573384828809" + "574217079944388301239431309115013843331317877374435868468779972014486325557807783825502498215169806323"),\n e: 65537\n}, {\n fingerprint: (0, big_integer_1.default)("-5595554452916591101"),\n n: (0, big_integer_1.default)("2534288944884041556497168959071347320689884775908477905258202659454602246385394058588521595116849196570822" + "26493991806038180742006204637761354248846321625124031637930839216416315647409595294193595958529411668489405859523" + "37613333022396096584117954892216031229237302943701877588456738335398602461675225081791820393153757504952636234951" + "32323782003654358104782690612092797248736680529211579223142368426126233039432475078545094258975175539015664775146" + "07193514399690599495696153028090507215003302390050778898553239175099482557220816446894421272976054225797071426466" + "60768825302832201908302295573257427896031830742328565032949"),\n e: 65537\n}];\nexports._serverKeys = new Map();\nPUBLIC_KEYS.forEach(_a => {\n var {\n fingerprint\n } = _a,\n keyInfo = __rest(_a, ["fingerprint"]);\n\n exports._serverKeys.set(fingerprint.toString(), keyInfo);\n});\n/**\n * Encrypts the given data known the fingerprint to be used\n * in the way Telegram requires us to do so (sha1(data) + data + padding)\n\n * @param fingerprint the fingerprint of the RSA key.\n * @param data the data to be encrypted.\n * @returns {Buffer|*|undefined} the cipher text, or undefined if no key matching this fingerprint is found.\n */\n\nasync function encrypt(fingerprint, data) {\n const key = exports._serverKeys.get(fingerprint.toString());\n\n if (!key) {\n return undefined;\n } // len(sha1.digest) is always 20, so we\'re left with 255 - 20 - x padding\n\n\n const rand = (0, Helpers_1.generateRandomBytes)(235 - data.length);\n const toEncrypt = buffer_1.Buffer.concat([await (0, Helpers_1.sha1)(data), data, rand]); // rsa module rsa.encrypt adds 11 bits for padding which we don\'t want\n // rsa module uses rsa.transform.bytes2int(to_encrypt), easier way:\n\n const payload = (0, Helpers_1.readBigIntFromBuffer)(toEncrypt, false);\n const encrypted = (0, Helpers_1.modExp)(payload, (0, big_integer_1.default)(key.e), key.n); // rsa module uses transform.int2bytes(encrypted, keylength), easier:\n\n return (0, Helpers_1.readBufferFromBigInt)(encryp
|
|||
|
/*!**************************************!*\
|
|||
|
!*** ./browser/crypto/converters.js ***!
|
|||
|
\**************************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ab2i = exports.i2ab = exports.isBigEndian = exports.ab2iBig = exports.ab2iLow = exports.i2abBig = exports.i2abLow = void 0;\n/**\n * Uint32Array -> ArrayBuffer (low-endian os)\n */\n\nfunction i2abLow(buf) {\n const uint8 = new Uint8Array(buf.length * 4);\n let i = 0;\n\n for (let j = 0; j < buf.length; j++) {\n const int = buf[j];\n uint8[i++] = int >>> 24;\n uint8[i++] = int >> 16 & 0xff;\n uint8[i++] = int >> 8 & 0xff;\n uint8[i++] = int & 0xff;\n }\n\n return uint8.buffer;\n}\n\nexports.i2abLow = i2abLow;\n/**\n * Uint32Array -> ArrayBuffer (big-endian os)\n */\n\nfunction i2abBig(buf) {\n return buf.buffer;\n}\n\nexports.i2abBig = i2abBig;\n/**\n * ArrayBuffer -> Uint32Array (low-endian os)\n */\n\nfunction ab2iLow(ab) {\n const uint8 = new Uint8Array(ab);\n const buf = new Uint32Array(uint8.length / 4);\n\n for (let i = 0; i < uint8.length; i += 4) {\n buf[i / 4] = uint8[i] << 24 ^ uint8[i + 1] << 16 ^ uint8[i + 2] << 8 ^ uint8[i + 3];\n }\n\n return buf;\n}\n\nexports.ab2iLow = ab2iLow;\n/**\n * ArrayBuffer -> Uint32Array (big-endian os)\n */\n\nfunction ab2iBig(ab) {\n return new Uint32Array(ab);\n}\n\nexports.ab2iBig = ab2iBig;\nexports.isBigEndian = new Uint8Array(new Uint32Array([0x01020304]))[0] === 0x01;\nexports.i2ab = exports.isBigEndian ? i2abBig : i2abLow;\nexports.ab2i = exports.isBigEndian ? ab2iBig : ab2iLow;\n\n//# sourceURL=webpack://telegram/./browser/crypto/converters.js?')},"./browser/crypto/crypto.js":
|
|||
|
/*!**********************************!*\
|
|||
|
!*** ./browser/crypto/crypto.js ***!
|
|||
|
\**********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.createHash = exports.pbkdf2Sync = exports.Hash = exports.randomBytes = exports.createCipheriv = exports.createDecipheriv = exports.CTR = exports.Counter = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst aes_1 = __importDefault(__webpack_require__(/*! @cryptography/aes */ "./node_modules/@cryptography/aes/dist/es/aes.js"));\n\nconst converters_1 = __webpack_require__(/*! ./converters */ "./browser/crypto/converters.js");\n\nconst words_1 = __webpack_require__(/*! ./words */ "./browser/crypto/words.js");\n\nclass Counter {\n constructor(initialValue) {\n this._counter = buffer_1.Buffer.from(initialValue);\n }\n\n increment() {\n for (let i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n }\n\n}\n\nexports.Counter = Counter;\n\nclass CTR {\n constructor(key, counter) {\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter);\n }\n\n this._counter = counter;\n this._remainingCounter = undefined;\n this._remainingCounterIndex = 16;\n this._aes = new aes_1.default((0, words_1.getWords)(key));\n }\n\n update(plainText) {\n return this.encrypt(plainText);\n }\n\n encrypt(plainText) {\n const encrypted = buffer_1.Buffer.from(plainText);\n\n for (let i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = buffer_1.Buffer.from((0, converters_1.i2ab)(this._aes.encrypt((0, converters_1.ab2i)(this._counter._counter))));\n this._remainingCounterIndex = 0;\n\n this._counter.increment();\n }\n\n if (this._remainingCounter) {\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n }\n\n return encrypted;\n }\n\n}\n\nexports.CTR = CTR; // endregion\n\nfunction createDecipheriv(algorithm, key, iv) {\n if (algorithm.includes("ECB")) {\n throw new Error("Not supported");\n } else {\n return new CTR(key, iv);\n }\n}\n\nexports.createDecipheriv = createDecipheriv;\n\nfunction createCipheriv(algorithm, key, iv) {\n if (algorithm.includes("ECB")) {\n throw new Error("Not supported");\n } else {\n return new CTR(key, iv);\n }\n}\n\nexports.createCipheriv = createCipheriv;\n\nfunction randomBytes(count) {\n const bytes = new Uint8Array(count);\n crypto.getRandomValues(bytes);\n return bytes;\n}\n\nexports.randomBytes = randomBytes;\n\nclass Hash {\n constructor(algorithm) {\n this.algorithm = algorithm;\n }\n\n update(data) {\n //We shouldn\'t be needing new Uint8Array but it doesn\'t\n //work without it\n this.data = new Uint8Array(data);\n }\n\n async digest() {\n if (this.data) {\n if (this.algorithm === "sha1") {\n return buffer_1.Buffer.from(await self.crypto.subtle.digest("SHA-1", this.data));\n } else if (this.algorithm === "sha256") {\n return buffer_1.Buffer.from(await self.crypto.subtle.digest("SHA-256", this.data));\n }\n }\n\n return buffer_1.Buffer.alloc(0);\n }\n\n}\n\nexports.Hash = Hash;\n\nasync function pbkdf2Sync(password, salt, iterations, ...args) {\n const passwordKey = await crypto.subtle.importKey("raw", password, {\n name: "PBKDF2"\n }, false, ["deriveBits"]);\n return buffer_1.Buffer.from(await crypto.subtle.deriveBits({\n name: "PBKDF2",\n hash: "SHA-512",\n salt,\n iterations\n }, passwordKey, 512));\n}\n\nexports.pbkdf2Sync = pbkdf2Sync;\n\nfunction createHash(algorithm) {\n return new Hash(algorithm);\n}\n\nexports.createHash = createHash;\n\n//# sourceURL=webpack://telegram/./browser/crypto/crypto.js?')},"./browser/c
|
|||
|
/*!*********************************!*\
|
|||
|
!*** ./browser/crypto/words.js ***!
|
|||
|
\*********************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n/*\n * Imported from https://github.com/spalt08/cryptography/blob/master/packages/aes/src/utils/words.ts\n */\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.xor = exports.getWords = exports.s2i = void 0;\n\nfunction s2i(str, pos) {\n return str.charCodeAt(pos) << 24 ^ str.charCodeAt(pos + 1) << 16 ^ str.charCodeAt(pos + 2) << 8 ^ str.charCodeAt(pos + 3);\n}\n\nexports.s2i = s2i;\n/**\n * Helper function for transforming string key to Uint32Array\n */\n\nfunction getWords(key) {\n if (key instanceof Uint32Array) {\n return key;\n }\n\n if (typeof key === "string") {\n if (key.length % 4 !== 0) for (let i = key.length % 4; i <= 4; i++) key += "\\0x00";\n const buf = new Uint32Array(key.length / 4);\n\n for (let i = 0; i < key.length; i += 4) buf[i / 4] = s2i(key, i);\n\n return buf;\n }\n\n if (key instanceof Uint8Array) {\n const buf = new Uint32Array(key.length / 4);\n\n for (let i = 0; i < key.length; i += 4) {\n buf[i / 4] = key[i] << 24 ^ key[i + 1] << 16 ^ key[i + 2] << 8 ^ key[i + 3];\n }\n\n return buf;\n }\n\n throw new Error("Unable to create 32-bit words");\n}\n\nexports.getWords = getWords;\n\nfunction xor(left, right, to = left) {\n for (let i = 0; i < left.length; i++) to[i] = left[i] ^ right[i];\n}\n\nexports.xor = xor;\n\n//# sourceURL=webpack://telegram/./browser/crypto/words.js?')},"./browser/entityCache.js":
|
|||
|
/*!********************************!*\
|
|||
|
!*** ./browser/entityCache.js ***!
|
|||
|
\********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval(' // Which updates have the following fields?\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.EntityCache = void 0;\n\nconst Utils_1 = __webpack_require__(/*! ./Utils */ "./browser/Utils.js");\n\nconst Helpers_1 = __webpack_require__(/*! ./Helpers */ "./browser/Helpers.js");\n\nconst tl_1 = __webpack_require__(/*! ./tl */ "./browser/tl/index.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nclass EntityCache {\n constructor() {\n this.cacheMap = new Map();\n }\n\n add(entities) {\n const temp = [];\n\n if (!(0, Helpers_1.isArrayLike)(entities)) {\n if (entities != undefined) {\n if (typeof entities == "object") {\n if ("chats" in entities) {\n temp.push(...entities.chats);\n }\n\n if ("users" in entities) {\n temp.push(...entities.users);\n }\n\n if ("user" in entities) {\n temp.push(entities.user);\n }\n }\n }\n\n if (temp.length) {\n entities = temp;\n } else {\n return;\n }\n }\n\n for (const entity of entities) {\n try {\n const pid = (0, Utils_1.getPeerId)(entity);\n\n if (!this.cacheMap.has(pid.toString())) {\n this.cacheMap.set(pid.toString(), (0, Utils_1.getInputPeer)(entity));\n }\n } catch (e) {}\n }\n }\n\n get(item) {\n if (item == undefined) {\n throw new Error("No cached entity for the given key");\n }\n\n item = (0, Helpers_1.returnBigInt)(item);\n\n if (item.lesser(big_integer_1.default.zero)) {\n let res;\n\n try {\n res = this.cacheMap.get((0, Utils_1.getPeerId)(item).toString());\n\n if (res) {\n return res;\n }\n } catch (e) {\n throw new Error("Invalid key will not have entity");\n }\n }\n\n for (const cls of [tl_1.Api.PeerUser, tl_1.Api.PeerChat, tl_1.Api.PeerChannel]) {\n const result = this.cacheMap.get((0, Utils_1.getPeerId)(new cls({\n userId: item,\n chatId: item,\n channelId: item\n })).toString());\n\n if (result) {\n return result;\n }\n }\n\n throw new Error("No cached entity for the given key");\n }\n\n}\n\nexports.EntityCache = EntityCache;\n\n//# sourceURL=webpack://telegram/./browser/entityCache.js?')},"./browser/errors/Common.js":
|
|||
|
/*!**********************************!*\
|
|||
|
!*** ./browser/errors/Common.js ***!
|
|||
|
\**********************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.BadMessageError = exports.CdnFileTamperedError = exports.SecurityError = exports.InvalidBufferError = exports.InvalidChecksumError = exports.TypeNotFoundError = exports.ReadCancelledError = void 0;\n/**\n * Occurs when a read operation was cancelled.\n */\n\nclass ReadCancelledError extends Error {\n constructor() {\n super("The read operation was cancelled.");\n }\n\n}\n\nexports.ReadCancelledError = ReadCancelledError;\n/**\n * Occurs when a type is not found, for example,\n * when trying to read a TLObject with an invalid constructor code.\n */\n\nclass TypeNotFoundError extends Error {\n constructor(invalidConstructorId, remaining) {\n super(`Could not find a matching Constructor ID for the TLObject that was supposed to be\n read with ID ${invalidConstructorId}. Most likely, a TLObject was trying to be read when\n it should not be read. Remaining bytes: ${remaining.length}`);\n\n if (typeof alert !== "undefined") {\n alert(`Missing MTProto Entity: Please, make sure to add TL definition for ID ${invalidConstructorId}`);\n }\n\n this.invalidConstructorId = invalidConstructorId;\n this.remaining = remaining;\n }\n\n}\n\nexports.TypeNotFoundError = TypeNotFoundError;\n/**\n * Occurs when using the TCP full mode and the checksum of a received\n * packet doesn\'t match the expected checksum.\n */\n\nclass InvalidChecksumError extends Error {\n constructor(checksum, validChecksum) {\n super(`Invalid checksum (${checksum} when ${validChecksum} was expected). This packet should be skipped.`);\n this.checksum = checksum;\n this.validChecksum = validChecksum;\n }\n\n}\n\nexports.InvalidChecksumError = InvalidChecksumError;\n/**\n * Occurs when the buffer is invalid, and may contain an HTTP error code.\n * For instance, 404 means "forgotten/broken authorization key", while\n */\n\nclass InvalidBufferError extends Error {\n constructor(payload) {\n let code = undefined;\n\n if (payload.length === 4) {\n code = -payload.readInt32LE(0);\n super(`Invalid response buffer (HTTP code ${code})`);\n } else {\n super(`Invalid response buffer (too short ${payload})`);\n }\n\n this.code = code;\n this.payload = payload;\n }\n\n}\n\nexports.InvalidBufferError = InvalidBufferError;\n/**\n * Generic security error, mostly used when generating a new AuthKey.\n */\n\nclass SecurityError extends Error {\n constructor(...args) {\n if (!args.length) {\n args = ["A security check failed."];\n }\n\n super(...args);\n }\n\n}\n\nexports.SecurityError = SecurityError;\n/**\n * Occurs when there\'s a hash mismatch between the decrypted CDN file\n * and its expected hash.\n */\n\nclass CdnFileTamperedError extends SecurityError {\n constructor() {\n super("The CDN file has been altered and its download cancelled.");\n }\n\n}\n\nexports.CdnFileTamperedError = CdnFileTamperedError;\n/**\n * Occurs when handling a badMessageNotification\n */\n\nclass BadMessageError extends Error {\n constructor(request, code) {\n let errorMessage = BadMessageError.ErrorMessages[code] || `Unknown error code (this should not happen): ${code}.`;\n errorMessage += ` Caused by ${request.className}`;\n super(errorMessage);\n this.errorMessage = errorMessage;\n this.code = code;\n }\n\n}\n\nexports.BadMessageError = BadMessageError;\nBadMessageError.ErrorMessages = {\n 16: "msg_id too low (most likely, client time is wrong it would be worthwhile to " + "synchronize it using msg_id notifications and re-send the original message " + "with the “correct” msg_id or wrap it in a container with a new msg_id if the " + "original message had waited too long on the client to be transmitted).",\n 17: "msg_id too high (similar to the previous case, the client time has to be " + "synchronized, and the message re-sent with the correct msg_id).",\n 18: "Incorrect two lower order msg_id bits
|
|||
|
/*!*****************************************!*\
|
|||
|
!*** ./browser/errors/RPCBaseErrors.js ***!
|
|||
|
\*****************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.TimedOutError = exports.ServerError = exports.FloodError = exports.AuthKeyError = exports.NotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.BadRequestError = exports.InvalidDCError = exports.RPCError = void 0;\n\nconst ts_custom_error_1 = __webpack_require__(/*! ts-custom-error */ "./node_modules/ts-custom-error/dist/custom-error.mjs");\n\nclass RPCError extends ts_custom_error_1.CustomError {\n constructor(message, request, code) {\n super("{0}: {1}{2}".replace("{0}", (code === null || code === void 0 ? void 0 : code.toString()) || "").replace("{1}", message || "").replace("{2}", RPCError._fmtRequest(request)));\n this.code = code;\n this.errorMessage = message;\n }\n\n static _fmtRequest(request) {\n // TODO fix this\n if (request) {\n return ` (caused by ${request.className})`;\n } else {\n return "";\n }\n }\n\n}\n\nexports.RPCError = RPCError;\n/**\n * The request must be repeated, but directed to a different data center.\n */\n\nclass InvalidDCError extends RPCError {\n constructor(message, request, code) {\n super(message, request, code);\n this.code = code || 303;\n this.errorMessage = message || "ERROR_SEE_OTHER";\n }\n\n}\n\nexports.InvalidDCError = InvalidDCError;\n/**\n * The query contains errors. In the event that a request was created\n * using a form and contains user generated data, the user should be\n * notified that the data must be corrected before the query is repeated.\n */\n\nclass BadRequestError extends RPCError {\n constructor() {\n super(...arguments);\n this.code = 400;\n this.errorMessage = "BAD_REQUEST";\n }\n\n}\n\nexports.BadRequestError = BadRequestError;\n/**\n * There was an unauthorized attempt to use functionality available only\n * to authorized users.\n */\n\nclass UnauthorizedError extends RPCError {\n constructor() {\n super(...arguments);\n this.code = 401;\n this.errorMessage = "UNAUTHORIZED";\n }\n\n}\n\nexports.UnauthorizedError = UnauthorizedError;\n/**\n * Privacy violation. For example, an attempt to write a message to\n * someone who has blacklisted the current user.\n */\n\nclass ForbiddenError extends RPCError {\n constructor() {\n super(...arguments);\n this.code = 403;\n this.errorMessage = "FORBIDDEN";\n }\n\n}\n\nexports.ForbiddenError = ForbiddenError;\n/**\n * An attempt to invoke a non-existent object, such as a method.\n */\n\nclass NotFoundError extends RPCError {\n constructor() {\n super(...arguments);\n this.code = 404;\n this.errorMessage = "NOT_FOUND";\n }\n\n}\n\nexports.NotFoundError = NotFoundError;\n/**\n * Errors related to invalid authorization key, like\n * AUTH_KEY_DUPLICATED which can cause the connection to fail.\n */\n\nclass AuthKeyError extends RPCError {\n constructor() {\n super(...arguments);\n this.code = 406;\n this.errorMessage = "AUTH_KEY";\n }\n\n}\n\nexports.AuthKeyError = AuthKeyError;\n/**\n * The maximum allowed number of attempts to invoke the given method\n * with the given input parameters has been exceeded. For example, in an\n * attempt to request a large number of text messages (SMS) for the same\n * phone number.\n */\n\nclass FloodError extends RPCError {\n constructor() {\n super(...arguments);\n this.code = 420;\n this.errorMessage = "FLOOD";\n }\n\n}\n\nexports.FloodError = FloodError;\n/**\n * An internal server error occurred while a request was being processed\n * for example, there was a disruption while accessing a database or file\n * storage\n */\n\nclass ServerError extends RPCError {\n constructor() {\n super(...arguments);\n this.code = 500; // Also witnessed as -500\n\n this.errorMessage = "INTERNAL";\n }\n\n}\n\nexports.ServerError = ServerError;\n/**\n * Clicking the inline buttons of bots that never (or take to long to)\n * call ``answerCallbackQuery`` will res
|
|||
|
/*!****************************************!*\
|
|||
|
!*** ./browser/errors/RPCErrorList.js ***!
|
|||
|
\****************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.rpcErrorRe = exports.MsgWaitError = exports.EmailUnconfirmedError = exports.NetworkMigrateError = exports.FileMigrateError = exports.FloodTestPhoneWaitError = exports.FloodWaitError = exports.SlowModeWaitError = exports.PhoneMigrateError = exports.UserMigrateError = void 0;\n\nconst RPCBaseErrors_1 = __webpack_require__(/*! ./RPCBaseErrors */ "./browser/errors/RPCBaseErrors.js");\n\nclass UserMigrateError extends RPCBaseErrors_1.InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n super(`The user whose identity is being used to execute queries is associated with DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);\n this.message = `The user whose identity is being used to execute queries is associated with DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);\n this.newDc = newDc;\n }\n\n}\n\nexports.UserMigrateError = UserMigrateError;\n\nclass PhoneMigrateError extends RPCBaseErrors_1.InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n super(`The phone number a user is trying to use for authorization is associated with DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);\n this.message = `The phone number a user is trying to use for authorization is associated with DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);\n this.newDc = newDc;\n }\n\n}\n\nexports.PhoneMigrateError = PhoneMigrateError;\n\nclass SlowModeWaitError extends RPCBaseErrors_1.FloodError {\n constructor(args) {\n const seconds = Number(args.capture || 0);\n super(`A wait of ${seconds} seconds is required before sending another message in this chat` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);\n this.message = `A wait of ${seconds} seconds is required before sending another message in this chat` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);\n this.seconds = seconds;\n }\n\n}\n\nexports.SlowModeWaitError = SlowModeWaitError;\n\nclass FloodWaitError extends RPCBaseErrors_1.FloodError {\n constructor(args) {\n const seconds = Number(args.capture || 0);\n super(`A wait of ${seconds} seconds is required` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);\n this.message = `A wait of ${seconds} seconds is required` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);\n this.seconds = seconds;\n }\n\n}\n\nexports.FloodWaitError = FloodWaitError;\n\nclass FloodTestPhoneWaitError extends RPCBaseErrors_1.FloodError {\n constructor(args) {\n const seconds = Number(args.capture || 0);\n super(`A wait of ${seconds} seconds is required in the test servers` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);\n this.message = `A wait of ${seconds} seconds is required in the test servers` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);\n this.seconds = seconds;\n }\n\n}\n\nexports.FloodTestPhoneWaitError = FloodTestPhoneWaitError;\n\nclass FileMigrateError extends RPCBaseErrors_1.InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n super(`The file to be accessed is currently stored in DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);\n this.message = `The file to be accessed is currently stored in DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request);\n this.newDc = newDc;\n }\n\n}\n\nexports.FileMigrateError = FileMigrateError;\n\nclass NetworkMigrateError extends RPCBaseErrors_1.InvalidDCError {\n constructor(args) {\n const newDc = Number(args.capture || 0);\n super(`The source IP address is associated with DC ${newDc}` + RPCBaseErrors_1.RPCError._fmtRequest(args.request), args.request);\n this.message = `The source IP address is associated with DC ${newDc}` + RPCBaseErrors_1.RPCErro
|
|||
|
/*!*********************************!*\
|
|||
|
!*** ./browser/errors/index.js ***!
|
|||
|
\*********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function () {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nvar __exportStar = this && this.__exportStar || function (m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.RPCMessageToError = void 0;\n\nconst RPCBaseErrors_1 = __webpack_require__(/*! ./RPCBaseErrors */ "./browser/errors/RPCBaseErrors.js");\n\nconst RPCErrorList_1 = __webpack_require__(/*! ./RPCErrorList */ "./browser/errors/RPCErrorList.js");\n\nfunction RPCMessageToError(rpcError, request) {\n for (const [msgRegex, Cls] of RPCErrorList_1.rpcErrorRe) {\n const m = rpcError.errorMessage.match(msgRegex);\n\n if (m) {\n const capture = m.length === 2 ? parseInt(m[1]) : null;\n return new Cls({\n request: request,\n capture: capture\n });\n }\n }\n\n return new RPCBaseErrors_1.RPCError(rpcError.errorMessage, request, rpcError.errorCode);\n}\n\nexports.RPCMessageToError = RPCMessageToError;\n\n__exportStar(__webpack_require__(/*! ./Common */ "./browser/errors/Common.js"), exports);\n\n__exportStar(__webpack_require__(/*! ./RPCBaseErrors */ "./browser/errors/RPCBaseErrors.js"), exports);\n\n__exportStar(__webpack_require__(/*! ./RPCErrorList */ "./browser/errors/RPCErrorList.js"), exports);\n\n//# sourceURL=webpack://telegram/./browser/errors/index.js?')},"./browser/events/NewMessage.js":
|
|||
|
/*!**************************************!*\
|
|||
|
!*** ./browser/events/NewMessage.js ***!
|
|||
|
\**************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.NewMessageEvent = exports.NewMessage = void 0;\n\nconst common_1 = __webpack_require__(/*! ./common */ "./browser/events/common.js");\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst Logger_1 = __webpack_require__(/*! ../extensions/Logger */ "./browser/extensions/Logger.js");\n/**\n * Occurs whenever a new text message or a message with media arrives.\n * @example\n * ```ts\n * async function eventPrint(event: NewMessageEvent) {\n * const message = event.message;\n *\n * // Checks if it\'s a private message (from user or bot)\n * if (event.isPrivate){\n * // prints sender id\n * console.log(message.senderId);\n * // read message\n * if (message.text == "hello"){\n * const sender = await message.getSender();\n * console.log("sender is",sender);\n * await client.sendMessage(sender,{\n * message:`hi your id is ${message.senderId}`\n * });\n * }\n * }\n * }\n * // adds an event handler for new messages\n * client.addEventHandler(eventPrint, new NewMessage({}));\n * ```\n */\n\n\nclass NewMessage extends common_1.EventBuilder {\n constructor(newMessageParams = {}) {\n let {\n chats,\n func,\n incoming,\n outgoing,\n fromUsers,\n forwards,\n pattern,\n blacklistChats = false\n } = newMessageParams;\n\n if (incoming && outgoing) {\n incoming = outgoing = undefined;\n } else if (incoming != undefined && outgoing == undefined) {\n outgoing = !incoming;\n } else if (outgoing != undefined && incoming == undefined) {\n incoming = !outgoing;\n } else if (outgoing == false && incoming == false) {\n throw new Error("Don\'t create an event handler if you don\'t want neither incoming nor outgoing!");\n }\n\n super({\n chats,\n blacklistChats,\n func\n });\n this.incoming = incoming;\n this.outgoing = outgoing;\n this.fromUsers = fromUsers;\n this.forwards = forwards;\n this.pattern = pattern;\n this._noCheck = [incoming, outgoing, chats, pattern, fromUsers, forwards, func].every(v => v == undefined);\n }\n\n async _resolve(client) {\n await super._resolve(client);\n this.fromUsers = await (0, common_1._intoIdSet)(client, this.fromUsers);\n }\n\n build(update, callback, selfId) {\n if (update instanceof tl_1.Api.UpdateNewMessage || update instanceof tl_1.Api.UpdateNewChannelMessage) {\n if (!(update.message instanceof tl_1.Api.Message)) {\n return undefined;\n }\n\n const event = new NewMessageEvent(update.message, update);\n this.addAttributes(event);\n return event;\n } else if (update instanceof tl_1.Api.UpdateShortMessage) {\n return new NewMessageEvent(new tl_1.Api.Message({\n out: update.out,\n mentioned: update.mentioned,\n mediaUnread: update.mediaUnread,\n silent: update.silent,\n id: update.id,\n peerId: new tl_1.Api.PeerUser({\n userId: update.userId\n }),\n fromId: new tl_1.Api.PeerUser({\n userId: update.out ? selfId : update.userId\n }),\n message: update.message,\n date: update.date,\n fwdFrom: update.fwdFrom,\n viaBotId: update.viaBotId,\n replyTo: update.replyTo,\n entities: update.entities,\n ttlPeriod: update.ttlPeriod\n }), update);\n } else if (update instanceof tl_1.Api.UpdateShortChatMessage) {\n return new NewMessageEvent(new tl_1.Api.Message({\n out: update.out,\n mentioned: update.mentioned,\n mediaUnread: update.mediaUnread,\n silent: update.silent,\n id: update.id,\n peerId: new tl_1.Api.PeerChat({\n chatId: update.chatId\n }),\n fromId: new tl_1.Api.PeerUser({\n userId: update.out ? selfId : update.fromId\n
|
|||
|
/*!*******************************!*\
|
|||
|
!*** ./browser/events/Raw.js ***!
|
|||
|
\*******************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.Raw = void 0;\n\nconst common_1 = __webpack_require__(/*! ./common */ "./browser/events/common.js");\n/**\n * The RAW updates that telegram sends. these are {@link Api.TypeUpdate} objects.\n * The are useful to handle custom events that you need like user typing or games.\n * @example\n * ```ts\n * client.addEventHandler((update) => {\n * console.log("Received new Update");\n * console.log(update);\n * });\n * ```\n */\n\n\nclass Raw extends common_1.EventBuilder {\n constructor(params) {\n super({\n func: params.func\n });\n this.types = params.types;\n }\n\n async resolve(client) {\n this.resolved = true;\n }\n\n build(update) {\n return update;\n }\n\n filter(event) {\n if (this.types) {\n let correct = false;\n\n for (const type of this.types) {\n if (event instanceof type) {\n correct = true;\n break;\n }\n }\n\n if (!correct) {\n return;\n }\n }\n\n return super.filter(event);\n }\n\n}\n\nexports.Raw = Raw;\n\n//# sourceURL=webpack://telegram/./browser/events/Raw.js?')},"./browser/events/common.js":
|
|||
|
/*!**********************************!*\
|
|||
|
!*** ./browser/events/common.js ***!
|
|||
|
\**********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.EventCommonSender = exports.EventCommon = exports.EventBuilder = exports._intoIdSet = void 0;\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst custom_1 = __webpack_require__(/*! ../tl/custom */ "./browser/tl/custom/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst __1 = __webpack_require__(/*! ../ */ "./browser/index.js");\n\nconst senderGetter_1 = __webpack_require__(/*! ../tl/custom/senderGetter */ "./browser/tl/custom/senderGetter.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst Utils_1 = __webpack_require__(/*! ../Utils */ "./browser/Utils.js");\n/** @hidden */\n\n\nasync function _intoIdSet(client, chats) {\n if (chats == undefined) {\n return undefined;\n }\n\n if (!(0, Helpers_1.isArrayLike)(chats)) {\n chats = [chats];\n }\n\n const result = new Set();\n\n for (let chat of chats) {\n if (typeof chat == "number" || typeof chat == "bigint" || typeof chat == "string" && (0, Utils_1.parseID)(chat) || big_integer_1.default.isInstance(chat)) {\n chat = (0, Helpers_1.returnBigInt)(chat);\n\n if (chat.lesser(0)) {\n result.add(chat.toString());\n } else {\n result.add(__1.utils.getPeerId(new tl_1.Api.PeerUser({\n userId: chat\n })));\n result.add(__1.utils.getPeerId(new tl_1.Api.PeerChat({\n chatId: chat\n })));\n result.add(__1.utils.getPeerId(new tl_1.Api.PeerChannel({\n channelId: chat\n })));\n }\n } else if (typeof chat == "object" && chat.SUBCLASS_OF_ID == 0x2d45687) {\n result.add(__1.utils.getPeerId(chat));\n } else {\n chat = await client.getInputEntity(chat);\n\n if (chat instanceof tl_1.Api.InputPeerSelf) {\n chat = await client.getMe(true);\n }\n\n result.add(__1.utils.getPeerId(chat));\n }\n }\n\n return Array.from(result);\n}\n\nexports._intoIdSet = _intoIdSet;\n/**\n * The common event builder, with builtin support to filter per chat.<br/>\n * All events inherit this.\n */\n\nclass EventBuilder {\n constructor(eventParams) {\n var _a;\n\n this.chats = (_a = eventParams.chats) === null || _a === void 0 ? void 0 : _a.map(x => x.toString());\n this.blacklistChats = eventParams.blacklistChats || false;\n this.resolved = false;\n this.func = eventParams.func;\n }\n\n build(update, callback, selfId) {\n if (update) return update;\n }\n\n async resolve(client) {\n if (this.resolved) {\n return;\n }\n\n await this._resolve(client);\n this.resolved = true;\n }\n\n async _resolve(client) {\n this.chats = await _intoIdSet(client, this.chats);\n }\n\n filter(event) {\n if (!this.resolved) {\n return;\n }\n\n if (this.chats != undefined) {\n if (event.chatId == undefined) {\n return;\n }\n\n const inside = this.chats.includes(event.chatId.toString());\n\n if (inside == this.blacklistChats) {\n // If this chat matches but it\'s a blacklist ignore.\n // If it doesn\'t match but it\'s a whitelist ignore.\n return;\n }\n }\n\n if (this.func && !this.func(event)) {\n return;\n }\n\n return event;\n }\n\n}\n\nexports.EventBuilder = EventBuilder;\n\nclass EventCommon extends custom_1.ChatGetter {\n constructor({\n chatPeer = undefined,\n msgId = undefined,\n broadcast = undefined\n }) {\n super();\n this._eventName = "Event";\n custom_1.ChatGetter.initChatClass(this, {\n chatPeer,\n broadcast\n });\n this._entities = new Map();\n this._client = undefined;\n this._messageId = msgId;\n
|
|||
|
/*!*********************************!*\
|
|||
|
!*** ./browser/events/index.js ***!
|
|||
|
\*********************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.NewMessageEvent = exports.NewMessage = exports.Raw = void 0;\n\nvar Raw_1 = __webpack_require__(/*! ./Raw */ "./browser/events/Raw.js");\n\nObject.defineProperty(exports, "Raw", ({\n enumerable: true,\n get: function () {\n return Raw_1.Raw;\n }\n}));\n\nvar NewMessage_1 = __webpack_require__(/*! ./NewMessage */ "./browser/events/NewMessage.js");\n\nObject.defineProperty(exports, "NewMessage", ({\n enumerable: true,\n get: function () {\n return NewMessage_1.NewMessage;\n }\n}));\nObject.defineProperty(exports, "NewMessageEvent", ({\n enumerable: true,\n get: function () {\n return NewMessage_1.NewMessageEvent;\n }\n}));\n\n//# sourceURL=webpack://telegram/./browser/events/index.js?')},"./browser/extensions/AsyncQueue.js":
|
|||
|
/*!******************************************!*\
|
|||
|
!*** ./browser/extensions/AsyncQueue.js ***!
|
|||
|
\******************************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.AsyncQueue = void 0;\n\nclass AsyncQueue {\n constructor() {\n this._queue = [];\n this.canPush = true;\n\n this.resolvePush = value => {};\n\n this.resolveGet = value => {};\n\n this.canGet = new Promise(resolve => {\n this.resolveGet = resolve;\n });\n }\n\n async push(value) {\n await this.canPush;\n\n this._queue.push(value);\n\n this.resolveGet(true);\n this.canPush = new Promise(resolve => {\n this.resolvePush = resolve;\n });\n }\n\n async pop() {\n await this.canGet;\n\n const returned = this._queue.pop();\n\n this.resolvePush(true);\n this.canGet = new Promise(resolve => {\n this.resolveGet = resolve;\n });\n return returned;\n }\n\n}\n\nexports.AsyncQueue = AsyncQueue;\n\n//# sourceURL=webpack://telegram/./browser/extensions/AsyncQueue.js?')},"./browser/extensions/BinaryReader.js":
|
|||
|
/*!********************************************!*\
|
|||
|
!*** ./browser/extensions/BinaryReader.js ***!
|
|||
|
\********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.BinaryReader = void 0;\n\nconst errors_1 = __webpack_require__(/*! ../errors */ "./browser/errors/index.js");\n\nconst core_1 = __webpack_require__(/*! ../tl/core */ "./browser/tl/core/index.js");\n\nconst AllTLObjects_1 = __webpack_require__(/*! ../tl/AllTLObjects */ "./browser/tl/AllTLObjects.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nclass BinaryReader {\n /**\n * Small utility class to read binary data.\n * @param data {Buffer}\n */\n constructor(data) {\n this.stream = data;\n this._last = undefined;\n this.offset = 0;\n } // region Reading\n // "All numbers are written as little endian."\n // https://core.telegram.org/mtproto\n\n /**\n * Reads a single byte value.\n */\n\n\n readByte() {\n return this.read(1)[0];\n }\n /**\n * Reads an integer (4 bytes or 32 bits) value.\n * @param signed {Boolean}\n */\n\n\n readInt(signed = true) {\n let res;\n\n if (signed) {\n res = this.stream.readInt32LE(this.offset);\n } else {\n res = this.stream.readUInt32LE(this.offset);\n }\n\n this.offset += 4;\n return res;\n }\n /**\n * Reads a long integer (8 bytes or 64 bits) value.\n * @param signed\n * @returns {BigInteger}\n */\n\n\n readLong(signed = true) {\n return this.readLargeInt(64, signed);\n }\n /**\n * Reads a real floating point (4 bytes) value.\n * @returns {number}\n */\n\n\n readFloat() {\n return this.read(4).readFloatLE(0);\n }\n /**\n * Reads a real floating point (8 bytes) value.\n * @returns {BigInteger}\n */\n\n\n readDouble() {\n // was this a bug ? it should have been <d\n return this.read(8).readDoubleLE(0);\n }\n /**\n * Reads a n-bits long integer value.\n * @param bits\n * @param signed {Boolean}\n */\n\n\n readLargeInt(bits, signed = true) {\n const buffer = this.read(Math.floor(bits / 8));\n return (0, Helpers_1.readBigIntFromBuffer)(buffer, true, signed);\n }\n /**\n * Read the given amount of bytes, or -1 to read all remaining.\n * @param length {number}\n * @param checkLength {boolean} whether to check if the length overflows or not.\n */\n\n\n read(length = -1, checkLength = true) {\n if (length === -1) {\n length = this.stream.length - this.offset;\n }\n\n const result = this.stream.slice(this.offset, this.offset + length);\n this.offset += length;\n\n if (checkLength && result.length !== length) {\n throw Error(`No more data left to read (need ${length}, got ${result.length}: ${result}); last read ${this._last}`);\n }\n\n this._last = result;\n return result;\n }\n /**\n * Gets the byte array representing the current buffer as a whole.\n * @returns {Buffer}\n */\n\n\n getBuffer() {\n return this.stream;\n } // endregion\n // region Telegram custom reading\n\n /**\n * Reads a Telegram-encoded byte array, without the need of\n * specifying its length.\n * @returns {Buffer}\n */\n\n\n tgReadBytes() {\n const firstByte = this.readByte();\n let padding;\n let length;\n\n if (firstByte === 254) {\n length = this.readByte() | this.readByte() << 8 | this.readByte() << 16;\n padding = length % 4;\n } else {\n length = firstByte;\n padding = (length + 1) % 4;\n }\n\n const data = this.read(length);\n\n if (padding > 0) {\n padding = 4 - padding;\n this.read(padding);\n }\n\n return data;\n }\n /**\n * Reads a Telegram-encoded string.\n * @returns {string}\n */\n\n\n tgReadString() {\n return this.tgReadBytes().toString("utf-8");\n }\n /**\n * Reads a Telegram boolean value.\n * @returns {boolean}\n */\n\n\n tgReadBool() {\n const value = this.readInt(false);\n\n if (value === 0x997275b5) {\n // boolTrue\n return true;\n } else if (value === 0xbc799737) {\n // boo
|
|||
|
/*!********************************************!*\
|
|||
|
!*** ./browser/extensions/BinaryWriter.js ***!
|
|||
|
\********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.BinaryWriter = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nclass BinaryWriter {\n constructor(stream) {\n this._stream = stream;\n }\n\n write(buffer) {\n this._stream = buffer_1.Buffer.concat([this._stream, buffer]);\n }\n\n getValue() {\n return this._stream;\n }\n\n}\n\nexports.BinaryWriter = BinaryWriter;\n\n//# sourceURL=webpack://telegram/./browser/extensions/BinaryWriter.js?')},"./browser/extensions/Logger.js":
|
|||
|
/*!**************************************!*\
|
|||
|
!*** ./browser/extensions/Logger.js ***!
|
|||
|
\**************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval(' // let _level: string | undefined = undefined;\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.Logger = exports.LogLevel = void 0;\n\nconst platform_1 = __webpack_require__(/*! ../platform */ "./browser/platform.js");\n\nvar LogLevel;\n\n(function (LogLevel) {\n LogLevel["NONE"] = "none";\n LogLevel["ERROR"] = "error";\n LogLevel["WARN"] = "warn";\n LogLevel["INFO"] = "info";\n LogLevel["DEBUG"] = "debug";\n})(LogLevel = exports.LogLevel || (exports.LogLevel = {}));\n\nclass Logger {\n constructor(level) {\n this.levels = ["error", "warn", "info", "debug"]; // if (!_level) {\n // _level = level || "info"; // defaults to info\n // }\n\n this._logLevel = level || LogLevel.INFO;\n this.isBrowser = !platform_1.isNode;\n\n if (!this.isBrowser) {\n this.colors = {\n start: "\\x1b[2m",\n warn: "\\x1b[35m",\n info: "\\x1b[33m",\n debug: "\\x1b[36m",\n error: "\\x1b[31m",\n end: "\\x1b[0m"\n };\n } else {\n this.colors = {\n start: "%c",\n warn: "color : #ff00ff",\n info: "color : #ffff00",\n debug: "color : #00ffff",\n error: "color : #ff0000",\n end: ""\n };\n }\n\n this.messageFormat = "[%t] [%l] - [%m]";\n this.tzOffset = new Date().getTimezoneOffset() * 60000;\n }\n /**\n *\n * @param level {string}\n * @returns {boolean}\n */\n\n\n canSend(level) {\n return this._logLevel ? this.levels.indexOf(this._logLevel) >= this.levels.indexOf(level) : false;\n }\n /**\n * @param message {string}\n */\n\n\n warn(message) {\n this._log(LogLevel.WARN, message, this.colors.warn);\n }\n /**\n * @param message {string}\n */\n\n\n info(message) {\n this._log(LogLevel.INFO, message, this.colors.info);\n }\n /**\n * @param message {string}\n */\n\n\n debug(message) {\n this._log(LogLevel.DEBUG, message, this.colors.debug);\n }\n /**\n * @param message {string}\n */\n\n\n error(message) {\n this._log(LogLevel.ERROR, message, this.colors.error);\n }\n\n format(message, level) {\n return this.messageFormat.replace("%t", this.getDateTime()).replace("%l", level.toUpperCase()).replace("%m", message);\n }\n\n get logLevel() {\n return this._logLevel;\n }\n\n setLevel(level) {\n this._logLevel = level;\n }\n\n static setLevel(level) {\n console.log("Logger.setLevel is deprecated, it will has no effect. Please, use client.setLogLevel instead.");\n }\n /**\n * @param level {string}\n * @param message {string}\n * @param color {string}\n */\n\n\n _log(level, message, color) {\n if (this.canSend(level)) {\n this.log(level, message, color);\n } else {\n return;\n }\n }\n /**\n * Override this function for custom Logger. <br />\n *\n * @remarks use `this.isBrowser` to check and handle for different environment.\n * @param level {string}\n * @param message {string}\n * @param color {string}\n */\n\n\n log(level, message, color) {\n if (!this.isBrowser) {\n console.log(color + this.format(message, level) + this.colors.end);\n } else {\n console.log(this.colors.start + this.format(message, level), color);\n }\n }\n\n getDateTime() {\n return new Date(Date.now() - this.tzOffset).toISOString().slice(0, -1);\n }\n\n}\n\nexports.Logger = Logger;\n\n//# sourceURL=webpack://telegram/./browser/extensions/Logger.js?')},"./browser/extensions/MessagePacker.js":
|
|||
|
/*!*********************************************!*\
|
|||
|
!*** ./browser/extensions/MessagePacker.js ***!
|
|||
|
\*********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.MessagePacker = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst core_1 = __webpack_require__(/*! ../tl/core */ "./browser/tl/core/index.js");\n\nconst core_2 = __webpack_require__(/*! ../tl/core */ "./browser/tl/core/index.js");\n\nconst BinaryWriter_1 = __webpack_require__(/*! ./BinaryWriter */ "./browser/extensions/BinaryWriter.js");\n\nclass MessagePacker {\n constructor(state, logger) {\n this._state = state;\n this._queue = [];\n this._pendingStates = [];\n this._ready = new Promise(resolve => {\n this.setReady = resolve;\n });\n this._log = logger;\n }\n\n values() {\n return this._queue;\n }\n\n append(state) {\n this._queue.push(state);\n\n if (this.setReady) {\n this.setReady(true);\n }\n }\n\n extend(states) {\n for (const state of states) {\n this.append(state);\n }\n }\n\n async get() {\n if (!this._queue.length) {\n this._ready = new Promise(resolve => {\n this.setReady = resolve;\n });\n await this._ready;\n }\n\n let data;\n let buffer = new BinaryWriter_1.BinaryWriter(buffer_1.Buffer.alloc(0));\n const batch = [];\n let size = 0;\n\n while (this._queue.length && batch.length <= core_1.MessageContainer.MAXIMUM_LENGTH) {\n const state = this._queue.shift();\n\n size += state.data.length + core_2.TLMessage.SIZE_OVERHEAD;\n\n if (size <= core_1.MessageContainer.MAXIMUM_SIZE) {\n let afterId;\n\n if (state.after) {\n afterId = state.after.msgId;\n }\n\n state.msgId = await this._state.writeDataAsMessage(buffer, state.data, state.request.classType === "request", afterId);\n\n this._log.debug(`Assigned msgId = ${state.msgId} to ${state.request.className || state.request.constructor.name}`);\n\n batch.push(state);\n continue;\n }\n\n if (batch.length) {\n this._queue.unshift(state);\n\n break;\n }\n\n this._log.warn(`Message payload for ${state.request.className || state.request.constructor.name} is too long ${state.data.length} and cannot be sent`);\n\n state.promise.reject("Request Payload is too big");\n size = 0;\n }\n\n if (!batch.length) {\n return null;\n }\n\n if (batch.length > 1) {\n const b = buffer_1.Buffer.alloc(8);\n b.writeUInt32LE(core_1.MessageContainer.CONSTRUCTOR_ID, 0);\n b.writeInt32LE(batch.length, 4);\n data = buffer_1.Buffer.concat([b, buffer.getValue()]);\n buffer = new BinaryWriter_1.BinaryWriter(buffer_1.Buffer.alloc(0));\n const containerId = await this._state.writeDataAsMessage(buffer, data, false);\n\n for (const s of batch) {\n s.containerId = containerId;\n }\n }\n\n data = buffer.getValue();\n return {\n batch,\n data\n };\n }\n\n rejectAll() {\n this._pendingStates.forEach(requestState => {\n var _a;\n\n requestState.reject(new Error("Disconnect (caused from " + ((_a = requestState === null || requestState === void 0 ? void 0 : requestState.request) === null || _a === void 0 ? void 0 : _a.className) + ")"));\n });\n }\n\n}\n\nexports.MessagePacker = MessagePacker;\n\n//# sourceURL=webpack://telegram/./browser/extensions/MessagePacker.js?')},"./browser/extensions/PromisedNetSockets.js":
|
|||
|
/*!**************************************************!*\
|
|||
|
!*** ./browser/extensions/PromisedNetSockets.js ***!
|
|||
|
\**************************************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.PromisedNetSockets = void 0;\n\nclass PromisedNetSockets {\n constructor(...args) {}\n\n connect(...args) {}\n\n close(...args) {}\n\n write(...args) {}\n\n readExactly(...args) {}\n\n read(...args) {}\n\n}\n\nexports.PromisedNetSockets = PromisedNetSockets;\n\n//# sourceURL=webpack://telegram/./browser/extensions/PromisedNetSockets.js?')},"./browser/extensions/PromisedWebSockets.js":
|
|||
|
/*!**************************************************!*\
|
|||
|
!*** ./browser/extensions/PromisedWebSockets.js ***!
|
|||
|
\**************************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.PromisedWebSockets = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst websocket_1 = __webpack_require__(/*! websocket */ "./node_modules/websocket/lib/browser.js");\n\nconst async_mutex_1 = __webpack_require__(/*! async-mutex */ "./node_modules/async-mutex/lib/index.js");\n\nconst platform_1 = __webpack_require__(/*! ../platform */ "./browser/platform.js");\n\nconst mutex = new async_mutex_1.Mutex();\nconst closeError = new Error("WebSocket was closed");\n\nclass PromisedWebSockets {\n constructor() {\n this.client = undefined;\n this.stream = buffer_1.Buffer.alloc(0);\n this.closed = true;\n }\n\n async readExactly(number) {\n let readData = buffer_1.Buffer.alloc(0);\n\n while (true) {\n const thisTime = await this.read(number);\n readData = buffer_1.Buffer.concat([readData, thisTime]);\n number = number - thisTime.length;\n\n if (!number) {\n return readData;\n }\n }\n }\n\n async read(number) {\n if (this.closed) {\n throw closeError;\n }\n\n await this.canRead;\n\n if (this.closed) {\n throw closeError;\n }\n\n const toReturn = this.stream.slice(0, number);\n this.stream = this.stream.slice(number);\n\n if (this.stream.length === 0) {\n this.canRead = new Promise(resolve => {\n this.resolveRead = resolve;\n });\n }\n\n return toReturn;\n }\n\n async readAll() {\n if (this.closed || !(await this.canRead)) {\n throw closeError;\n }\n\n const toReturn = this.stream;\n this.stream = buffer_1.Buffer.alloc(0);\n this.canRead = new Promise(resolve => {\n this.resolveRead = resolve;\n });\n return toReturn;\n }\n\n getWebSocketLink(ip, port, testServers) {\n if (port === 443) {\n return `wss://${ip}:${port}/apiws${testServers ? "_test" : ""}`;\n } else {\n return `ws://${ip}:${port}/apiws${testServers ? "_test" : ""}`;\n }\n }\n\n async connect(port, ip, testServers = false) {\n this.stream = buffer_1.Buffer.alloc(0);\n this.canRead = new Promise(resolve => {\n this.resolveRead = resolve;\n });\n this.closed = false;\n this.website = this.getWebSocketLink(ip, port, testServers);\n this.client = new websocket_1.w3cwebsocket(this.website, "binary");\n return new Promise((resolve, reject) => {\n if (this.client) {\n this.client.onopen = () => {\n this.receive();\n resolve(this);\n };\n\n this.client.onerror = error => {\n reject(error);\n };\n\n this.client.onclose = () => {\n if (this.resolveRead) {\n this.resolveRead(false);\n }\n\n this.closed = true;\n }; //CONTEST\n\n\n if (platform_1.isBrowser) {\n window.addEventListener("offline", async () => {\n await this.close();\n\n if (this.resolveRead) {\n this.resolveRead(false);\n }\n });\n }\n }\n });\n }\n\n write(data) {\n if (this.closed) {\n throw closeError;\n }\n\n if (this.client) {\n this.client.send(data);\n }\n }\n\n async close() {\n if (this.client) {\n await this.client.close();\n }\n\n this.closed = true;\n }\n\n async receive() {\n if (this.client) {\n this.client.onmessage = async message => {\n const release = await mutex.acquire();\n\n try {\n let data; //CONTEST BROWSER\n\n data = buffer_1.Buffer.from(await new Response(message.data).arrayBuffer());\n this.stream = buffer_1.Buffer.concat([this.stream, data]);\n\n if (this.resolveRead) {\n this.resolveRead(true);\n }\n } finally {\n release();\n }\n };\n }\n }\n\n toString() {\n return "PromisedWebSocket";\n
|
|||
|
/*!************************************!*\
|
|||
|
!*** ./browser/extensions/html.js ***!
|
|||
|
\************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.HTMLParser = void 0;\n\nconst htmlparser2_1 = __webpack_require__(/*! htmlparser2 */ "./node_modules/htmlparser2/lib/index.js");\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst index_1 = __webpack_require__(/*! ../index */ "./browser/index.js");\n\nclass HTMLToTelegramParser {\n constructor() {\n this.text = "";\n this.entities = [];\n this._buildingEntities = new Map();\n this._openTags = [];\n this._openTagsMeta = [];\n }\n\n onopentag(name, attributes) {\n /*\n * This fires when a new tag is opened.\n *\n * If you don\'t need an aggregated `attributes` object,\n * have a look at the `onopentagname` and `onattribute` events.\n */\n this._openTags.unshift(name);\n\n this._openTagsMeta.unshift(undefined);\n\n let EntityType;\n const args = {};\n\n if (name == "strong" || name == "b") {\n EntityType = tl_1.Api.MessageEntityBold;\n } else if (name == "spoiler") {\n EntityType = tl_1.Api.MessageEntitySpoiler;\n } else if (name == "em" || name == "i") {\n EntityType = tl_1.Api.MessageEntityItalic;\n } else if (name == "u") {\n EntityType = tl_1.Api.MessageEntityUnderline;\n } else if (name == "del" || name == "s") {\n EntityType = tl_1.Api.MessageEntityStrike;\n } else if (name == "blockquote") {\n EntityType = tl_1.Api.MessageEntityBlockquote;\n } else if (name == "code") {\n const pre = this._buildingEntities.get("pre");\n\n if (pre && pre instanceof tl_1.Api.MessageEntityPre) {\n try {\n pre.language = attributes.class.slice("language-".length, attributes.class.length);\n } catch (e) {// no language block\n }\n } else {\n EntityType = tl_1.Api.MessageEntityCode;\n }\n } else if (name == "pre") {\n EntityType = tl_1.Api.MessageEntityPre;\n args["language"] = "";\n } else if (name == "a") {\n let url = attributes.href;\n\n if (!url) {\n return;\n }\n\n if (url.startsWith("mailto:")) {\n url = url.slice("mailto:".length, url.length);\n EntityType = tl_1.Api.MessageEntityEmail;\n } else {\n EntityType = tl_1.Api.MessageEntityTextUrl;\n args["url"] = url;\n url = undefined;\n }\n\n this._openTagsMeta.shift();\n\n this._openTagsMeta.unshift(url);\n }\n\n if (EntityType && !this._buildingEntities.has(name)) {\n this._buildingEntities.set(name, new EntityType(Object.assign({\n offset: this.text.length,\n length: 0\n }, args)));\n }\n }\n\n ontext(text) {\n const previousTag = this._openTags.length > 0 ? this._openTags[0] : "";\n\n if (previousTag == "a") {\n const url = this._openTagsMeta[0];\n\n if (url) {\n text = url;\n }\n }\n\n for (let [tag, entity] of this._buildingEntities) {\n entity.length += text.length;\n }\n\n this.text += text;\n }\n\n onclosetag(tagname) {\n this._openTagsMeta.shift();\n\n this._openTags.shift();\n\n const entity = this._buildingEntities.get(tagname);\n\n if (entity) {\n this._buildingEntities.delete(tagname);\n\n this.entities.push(entity);\n }\n }\n\n onattribute(name, value, quote) {}\n\n oncdataend() {}\n\n oncdatastart() {}\n\n oncomment(data) {}\n\n oncommentend() {}\n\n onend() {}\n\n onerror(error) {}\n\n onopentagname(name) {}\n\n onparserinit(parser) {}\n\n onprocessinginstruction(name, data) {}\n\n onreset() {}\n\n}\n\nclass HTMLParser {\n static parse(html) {\n if (!html) {\n return [html, []];\n }\n\n const handler = new HTMLToTelegramParser();\n const parser = new htmlparser2_1.Parser(handler);\n parser.write(html);\n parser.end();\n const text = index_1.helpers.stripText(handler.text, handler.entities);\n return [text, handler.entities];\n }\n\n static
|
|||
|
/*!*************************************!*\
|
|||
|
!*** ./browser/extensions/index.js ***!
|
|||
|
\*************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.AsyncQueue = exports.MessagePacker = exports.PromisedNetSockets = exports.PromisedWebSockets = exports.BinaryReader = exports.BinaryWriter = exports.Logger = void 0;\n\nvar Logger_1 = __webpack_require__(/*! ./Logger */ "./browser/extensions/Logger.js");\n\nObject.defineProperty(exports, "Logger", ({\n enumerable: true,\n get: function () {\n return Logger_1.Logger;\n }\n}));\n\nvar BinaryWriter_1 = __webpack_require__(/*! ./BinaryWriter */ "./browser/extensions/BinaryWriter.js");\n\nObject.defineProperty(exports, "BinaryWriter", ({\n enumerable: true,\n get: function () {\n return BinaryWriter_1.BinaryWriter;\n }\n}));\n\nvar BinaryReader_1 = __webpack_require__(/*! ./BinaryReader */ "./browser/extensions/BinaryReader.js");\n\nObject.defineProperty(exports, "BinaryReader", ({\n enumerable: true,\n get: function () {\n return BinaryReader_1.BinaryReader;\n }\n}));\n\nvar PromisedWebSockets_1 = __webpack_require__(/*! ./PromisedWebSockets */ "./browser/extensions/PromisedWebSockets.js");\n\nObject.defineProperty(exports, "PromisedWebSockets", ({\n enumerable: true,\n get: function () {\n return PromisedWebSockets_1.PromisedWebSockets;\n }\n}));\n\nvar PromisedNetSockets_1 = __webpack_require__(/*! ./PromisedNetSockets */ "./browser/extensions/PromisedNetSockets.js");\n\nObject.defineProperty(exports, "PromisedNetSockets", ({\n enumerable: true,\n get: function () {\n return PromisedNetSockets_1.PromisedNetSockets;\n }\n}));\n\nvar MessagePacker_1 = __webpack_require__(/*! ./MessagePacker */ "./browser/extensions/MessagePacker.js");\n\nObject.defineProperty(exports, "MessagePacker", ({\n enumerable: true,\n get: function () {\n return MessagePacker_1.MessagePacker;\n }\n}));\n\nvar AsyncQueue_1 = __webpack_require__(/*! ./AsyncQueue */ "./browser/extensions/AsyncQueue.js");\n\nObject.defineProperty(exports, "AsyncQueue", ({\n enumerable: true,\n get: function () {\n return AsyncQueue_1.AsyncQueue;\n }\n}));\n\n//# sourceURL=webpack://telegram/./browser/extensions/index.js?')},"./browser/extensions/markdown.js":
|
|||
|
/*!****************************************!*\
|
|||
|
!*** ./browser/extensions/markdown.js ***!
|
|||
|
\****************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.MarkdownParser = void 0;\n\nconst messageParse_1 = __webpack_require__(/*! ../client/messageParse */ "./browser/client/messageParse.js");\n\nclass MarkdownParser {\n // TODO maybe there is a better way :shrug:\n static parse(message) {\n let i = 0;\n const keys = {};\n\n for (const k in messageParse_1.DEFAULT_DELIMITERS) {\n keys[k] = false;\n }\n\n const entities = [];\n const tempEntities = {};\n\n while (i < message.length) {\n let foundIndex = -1;\n let foundDelim = undefined;\n\n for (const key of Object.keys(messageParse_1.DEFAULT_DELIMITERS)) {\n const index = message.indexOf(key, i);\n\n if (index > -1 && (foundIndex === -1 || index < foundIndex)) {\n foundIndex = index;\n foundDelim = key;\n }\n }\n\n if (foundIndex === -1 || foundDelim == undefined) {\n break;\n }\n\n if (!keys[foundDelim]) {\n tempEntities[foundDelim] = new messageParse_1.DEFAULT_DELIMITERS[foundDelim]({\n offset: foundIndex,\n length: -1,\n language: ""\n });\n keys[foundDelim] = true;\n } else {\n keys[foundDelim] = false;\n tempEntities[foundDelim].length = foundIndex - tempEntities[foundDelim].offset;\n entities.push(tempEntities[foundDelim]);\n }\n\n message = message.replace(foundDelim, "");\n i = foundIndex;\n }\n\n return [message, entities];\n }\n\n static unparse(text, entities) {\n const delimiters = messageParse_1.DEFAULT_DELIMITERS;\n\n if (!text || !entities) {\n return text;\n }\n\n let insertAt = [];\n const tempDelimiters = new Map();\n Object.keys(delimiters).forEach(key => {\n tempDelimiters.set(delimiters[key].className, key);\n });\n\n for (const entity of entities) {\n const s = entity.offset;\n const e = entity.offset + entity.length;\n const delimiter = tempDelimiters.get(entity.className);\n\n if (delimiter) {\n insertAt.push([s, delimiter]);\n insertAt.push([e, delimiter]);\n }\n }\n\n insertAt = insertAt.sort((a, b) => {\n return a[0] - b[0];\n });\n\n while (insertAt.length) {\n const [at, what] = insertAt.pop();\n text = text.slice(0, at) + what + text.slice(at);\n }\n\n return text;\n }\n\n}\n\nexports.MarkdownParser = MarkdownParser;\n\n//# sourceURL=webpack://telegram/./browser/extensions/markdown.js?')},"./browser/index.js":
|
|||
|
/*!**************************!*\
|
|||
|
!*** ./browser/index.js ***!
|
|||
|
\**************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function () {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n Object.defineProperty(o, "default", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o["default"] = v;\n});\n\nvar __importStar = this && this.__importStar || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n\n __setModuleDefault(result, mod);\n\n return result;\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.client = exports.password = exports.tl = exports.helpers = exports.extensions = exports.sessions = exports.errors = exports.utils = exports.Logger = exports.version = exports.Connection = exports.TelegramClient = exports.Api = void 0;\n\nvar tl_1 = __webpack_require__(/*! ./tl */ "./browser/tl/index.js");\n\nObject.defineProperty(exports, "Api", ({\n enumerable: true,\n get: function () {\n return tl_1.Api;\n }\n}));\n\nconst tl = __importStar(__webpack_require__(/*! ./tl */ "./browser/tl/index.js"));\n\nexports.tl = tl;\n\nvar TelegramClient_1 = __webpack_require__(/*! ./client/TelegramClient */ "./browser/client/TelegramClient.js");\n\nObject.defineProperty(exports, "TelegramClient", ({\n enumerable: true,\n get: function () {\n return TelegramClient_1.TelegramClient;\n }\n}));\n\nvar network_1 = __webpack_require__(/*! ./network */ "./browser/network/index.js");\n\nObject.defineProperty(exports, "Connection", ({\n enumerable: true,\n get: function () {\n return network_1.Connection;\n }\n}));\n\nvar Version_1 = __webpack_require__(/*! ./Version */ "./browser/Version.js");\n\nObject.defineProperty(exports, "version", ({\n enumerable: true,\n get: function () {\n return Version_1.version;\n }\n}));\n\nvar Logger_1 = __webpack_require__(/*! ./extensions/Logger */ "./browser/extensions/Logger.js");\n\nObject.defineProperty(exports, "Logger", ({\n enumerable: true,\n get: function () {\n return Logger_1.Logger;\n }\n}));\n\nconst utils = __importStar(__webpack_require__(/*! ./Utils */ "./browser/Utils.js"));\n\nexports.utils = utils;\n\nconst errors = __importStar(__webpack_require__(/*! ./errors */ "./browser/errors/index.js"));\n\nexports.errors = errors;\n\nconst sessions = __importStar(__webpack_require__(/*! ./sessions */ "./browser/sessions/index.js"));\n\nexports.sessions = sessions;\n\nconst extensions = __importStar(__webpack_require__(/*! ./extensions */ "./browser/extensions/index.js"));\n\nexports.extensions = extensions;\n\nconst helpers = __importStar(__webpack_require__(/*! ./Helpers */ "./browser/Helpers.js"));\n\nexports.helpers = helpers;\n\nconst client = __importStar(__webpack_require__(/*! ./client */ "./browser/client/index.js"));\n\nexports.client = client;\n\nconst password = __importStar(__webpack_require__(/*! ./Password */ "./browser/Password.js"));\n\nexports.password = password;\n\n//# sourceURL=webpack://telegram/./browser/index.js?')},"./browser/inspect.js":
|
|||
|
/*!****************************!*\
|
|||
|
!*** ./browser/inspect.js ***!
|
|||
|
\****************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.inspect = void 0;\nexports.inspect = {\n custom: ""\n};\n\n//# sourceURL=webpack://telegram/./browser/inspect.js?')},"./browser/network/Authenticator.js":
|
|||
|
/*!******************************************!*\
|
|||
|
!*** ./browser/network/Authenticator.js ***!
|
|||
|
\******************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.doAuthentication = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst errors_1 = __webpack_require__(/*! ../errors */ "./browser/errors/index.js");\n\nconst Factorizator_1 = __webpack_require__(/*! ../crypto/Factorizator */ "./browser/crypto/Factorizator.js");\n\nconst RSA_1 = __webpack_require__(/*! ../crypto/RSA */ "./browser/crypto/RSA.js");\n\nconst IGE_1 = __webpack_require__(/*! ../crypto/IGE */ "./browser/crypto/IGE.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst extensions_1 = __webpack_require__(/*! ../extensions */ "./browser/extensions/index.js");\n\nconst AuthKey_1 = __webpack_require__(/*! ../crypto/AuthKey */ "./browser/crypto/AuthKey.js");\n\nconst RETRIES = 20;\n\nasync function doAuthentication(sender, log) {\n // Step 1 sending: PQ Request, endianness doesn\'t matter since it\'s random\n let bytes = (0, Helpers_1.generateRandomBytes)(16);\n const nonce = (0, Helpers_1.readBigIntFromBuffer)(bytes, false, true);\n const resPQ = await sender.send(new tl_1.Api.ReqPqMulti({\n nonce\n }));\n log.debug("Starting authKey generation step 1");\n\n if (!(resPQ instanceof tl_1.Api.ResPQ)) {\n throw new errors_1.SecurityError(`Step 1 answer was ${resPQ}`);\n }\n\n if (resPQ.nonce.neq(nonce)) {\n throw new errors_1.SecurityError("Step 1 invalid nonce from server");\n }\n\n const pq = (0, Helpers_1.readBigIntFromBuffer)(resPQ.pq, false, true);\n log.debug("Finished authKey generation step 1"); // Step 2 sending: DH Exchange\n\n const {\n p,\n q\n } = Factorizator_1.Factorizator.factorize(pq);\n const pBuffer = (0, Helpers_1.getByteArray)(p);\n const qBuffer = (0, Helpers_1.getByteArray)(q);\n bytes = (0, Helpers_1.generateRandomBytes)(32);\n const newNonce = (0, Helpers_1.readBigIntFromBuffer)(bytes, true, true);\n const pqInnerData = new tl_1.Api.PQInnerData({\n pq: (0, Helpers_1.getByteArray)(pq),\n p: pBuffer,\n q: qBuffer,\n nonce: resPQ.nonce,\n serverNonce: resPQ.serverNonce,\n newNonce\n }).getBytes();\n\n if (pqInnerData.length > 144) {\n throw new errors_1.SecurityError("Step 1 invalid nonce from server");\n }\n\n let targetFingerprint;\n let targetKey;\n\n for (const fingerprint of resPQ.serverPublicKeyFingerprints) {\n targetKey = RSA_1._serverKeys.get(fingerprint.toString());\n\n if (targetKey !== undefined) {\n targetFingerprint = fingerprint;\n break;\n }\n }\n\n if (targetFingerprint === undefined || targetKey === undefined) {\n throw new errors_1.SecurityError("Step 2 could not find a valid key for fingerprints");\n } // Value should be padded to be made 192 exactly\n\n\n const padding = (0, Helpers_1.generateRandomBytes)(192 - pqInnerData.length);\n const dataWithPadding = buffer_1.Buffer.concat([pqInnerData, padding]);\n const dataPadReversed = buffer_1.Buffer.from(dataWithPadding).reverse();\n let encryptedData;\n\n for (let i = 0; i < RETRIES; i++) {\n const tempKey = (0, Helpers_1.generateRandomBytes)(32);\n const shaDigestKeyWithData = await (0, Helpers_1.sha256)(buffer_1.Buffer.concat([tempKey, dataWithPadding]));\n const dataWithHash = buffer_1.Buffer.concat([dataPadReversed, shaDigestKeyWithData]);\n const ige = new IGE_1.IGE(tempKey, buffer_1.Buffer.alloc(32));\n const aesEncrypted = ige.encryptIge(dataWithHash);\n const tempKeyXor = (0, Helpers_1.bufferXor)(tempKey, await (0, Helpers_1.sha256)(aesEncrypted));\n const keyAesEncrypt
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./browser/network/MTProtoPlainSender.js ***!
|
|||
|
\***********************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.MTProtoPlainSender = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n/**\n * This module contains the class used to communicate with Telegram\'s servers\n * in plain text, when no authorization key has been created yet.\n */\n\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst MTProtoState_1 = __webpack_require__(/*! ./MTProtoState */ "./browser/network/MTProtoState.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst errors_1 = __webpack_require__(/*! ../errors */ "./browser/errors/index.js");\n\nconst extensions_1 = __webpack_require__(/*! ../extensions */ "./browser/extensions/index.js");\n/**\n * MTProto Mobile Protocol plain sender (https://core.telegram.org/mtproto/description#unencrypted-messages)\n */\n\n\nclass MTProtoPlainSender {\n /**\n * Initializes the MTProto plain sender.\n * @param connection connection: the Connection to be used.\n * @param loggers\n */\n constructor(connection, loggers) {\n this._state = new MTProtoState_1.MTProtoState(undefined, loggers);\n this._connection = connection;\n }\n /**\n * Sends and receives the result for the given request.\n * @param request\n */\n\n\n async send(request) {\n let body = request.getBytes();\n\n let msgId = this._state._getNewMsgId();\n\n const m = (0, Helpers_1.toSignedLittleBuffer)(msgId, 8);\n const b = buffer_1.Buffer.alloc(4);\n b.writeInt32LE(body.length, 0);\n const res = buffer_1.Buffer.concat([buffer_1.Buffer.concat([buffer_1.Buffer.alloc(8), m, b]), body]);\n await this._connection.send(res);\n body = await this._connection.recv();\n\n if (body.length < 8) {\n throw new errors_1.InvalidBufferError(body);\n }\n\n const reader = new extensions_1.BinaryReader(body);\n const authKeyId = reader.readLong();\n\n if (authKeyId.neq((0, big_integer_1.default)(0))) {\n throw new Error("Bad authKeyId");\n }\n\n msgId = reader.readLong();\n\n if (msgId.eq((0, big_integer_1.default)(0))) {\n throw new Error("Bad msgId");\n }\n /** ^ We should make sure that the read ``msg_id`` is greater\n * than our own ``msg_id``. However, under some circumstances\n * (bad system clock/working behind proxies) this seems to not\n * be the case, which would cause endless assertion errors.\n */\n\n\n const length = reader.readInt();\n\n if (length <= 0) {\n throw new Error("Bad length");\n }\n /**\n * We could read length bytes and use those in a new reader to read\n * the next TLObject without including the padding, but since the\n * reader isn\'t used for anything else after this, it\'s unnecessary.\n */\n\n\n return reader.tgReadObject();\n }\n\n}\n\nexports.MTProtoPlainSender = MTProtoPlainSender;\n\n//# sourceURL=webpack://telegram/./browser/network/MTProtoPlainSender.js?')},"./browser/network/MTProtoSender.js":
|
|||
|
/*!******************************************!*\
|
|||
|
!*** ./browser/network/MTProtoSender.js ***!
|
|||
|
\******************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.MTProtoSender = void 0;\n/**\n * MTProto Mobile Protocol sender\n * (https://core.telegram.org/mtproto/description)\n * This class is responsible for wrapping requests into `TLMessage`\'s,\n * sending them over the network and receiving them in a safe manner.\n *\n * Automatic reconnection due to temporary network issues is a concern\n * for this class as well, including retry of messages that could not\n * be sent successfully.\n *\n * A new authorization key will be generated on connection if no other\n * key exists yet.\n */\n\nconst AuthKey_1 = __webpack_require__(/*! ../crypto/AuthKey */ "./browser/crypto/AuthKey.js");\n\nconst MTProtoState_1 = __webpack_require__(/*! ./MTProtoState */ "./browser/network/MTProtoState.js");\n\nconst extensions_1 = __webpack_require__(/*! ../extensions */ "./browser/extensions/index.js");\n\nconst extensions_2 = __webpack_require__(/*! ../extensions */ "./browser/extensions/index.js");\n\nconst core_1 = __webpack_require__(/*! ../tl/core */ "./browser/tl/core/index.js");\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst RequestState_1 = __webpack_require__(/*! ./RequestState */ "./browser/network/RequestState.js");\n\nconst Authenticator_1 = __webpack_require__(/*! ./Authenticator */ "./browser/network/Authenticator.js");\n\nconst MTProtoPlainSender_1 = __webpack_require__(/*! ./MTProtoPlainSender */ "./browser/network/MTProtoPlainSender.js");\n\nconst errors_1 = __webpack_require__(/*! ../errors */ "./browser/errors/index.js");\n\nconst _1 = __webpack_require__(/*! ./ */ "./browser/network/index.js");\n\nconst Logger_1 = __webpack_require__(/*! ../extensions/Logger */ "./browser/extensions/Logger.js");\n\nconst async_mutex_1 = __webpack_require__(/*! async-mutex */ "./node_modules/async-mutex/lib/index.js");\n\nconst real_cancellable_promise_1 = __webpack_require__(/*! real-cancellable-promise */ "./node_modules/real-cancellable-promise/dist/index.mjs");\n\nclass MTProtoSender {\n /**\n * @param authKey\n * @param opts\n */\n constructor(authKey, opts) {\n const args = Object.assign(Object.assign({}, MTProtoSender.DEFAULT_OPTIONS), opts);\n this._cancelSend = false;\n this._connection = undefined;\n this._log = args.logger;\n this._dcId = args.dcId;\n this._retries = args.retries;\n this._delay = args.delay;\n this._autoReconnect = args.autoReconnect;\n this._connectTimeout = args.connectTimeout;\n this._authKeyCallback = args.authKeyCallback;\n this._updateCallback = args.updateCallback;\n this._autoReconnectCallback = args.autoReconnectCallback;\n this._isMainSender = args.isMainSender;\n this._senderCallback = args.senderCallback;\n this._client = args.client;\n this._onConnectionBreak = args.onConnectionBreak;\n this._securityChecks = args.securityChecks;\n this._connectMutex = new async_mutex_1.Mutex();\n /**\n * whether we disconnected ourself or telegram did it.\n */\n\n this.userDisconnected = false;\n /**\n * If a disconnection happens for any other reason and it\n * was *not* user action then the pending messages won\'t\n * be cleared but on explicit user disconnection all the\n * pending futures should be cancelled.\n */\n\n this.isConnecting = false;\n this._authenticated = false;\n this._userConnected = false;\n this._reconnecting = false;\n this._disconnected = true;\n /**\n * We need to join the loops upon disconnection\n */\n\n this._sendLoopHandle = nul
|
|||
|
/*!*****************************************!*\
|
|||
|
!*** ./browser/network/MTProtoState.js ***!
|
|||
|
\*****************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.MTProtoState = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst __1 = __webpack_require__(/*! ../ */ "./browser/index.js");\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst core_1 = __webpack_require__(/*! ../tl/core */ "./browser/tl/core/index.js");\n\nconst extensions_1 = __webpack_require__(/*! ../extensions */ "./browser/extensions/index.js");\n\nconst IGE_1 = __webpack_require__(/*! ../crypto/IGE */ "./browser/crypto/IGE.js");\n\nconst errors_1 = __webpack_require__(/*! ../errors */ "./browser/errors/index.js");\n\nclass MTProtoState {\n /**\n *\n `telethon.network.mtprotosender.MTProtoSender` needs to hold a state\n in order to be able to encrypt and decrypt incoming/outgoing messages,\n as well as generating the message IDs. Instances of this class hold\n together all the required information.\n It doesn\'t make sense to use `telethon.sessions.abstract.Session` for\n the sender because the sender should *not* be concerned about storing\n this information to disk, as one may create as many senders as they\n desire to any other data center, or some CDN. Using the same session\n for all these is not a good idea as each need their own authkey, and\n the concept of "copying" sessions with the unnecessary entities or\n updates state for these connections doesn\'t make sense.\n While it would be possible to have a `MTProtoPlainState` that does no\n encryption so that it was usable through the `MTProtoLayer` and thus\n avoid the need for a `MTProtoPlainSender`, the `MTProtoLayer` is more\n focused to efficiency and this state is also more advanced (since it\n supports gzipping and invoking after other message IDs). There are too\n many methods that would be needed to make it convenient to use for the\n authentication process, at which point the `MTProtoPlainSender` is better\n * @param authKey\n * @param loggers\n * @param securityChecks\n */\n constructor(authKey, loggers, securityChecks = true) {\n this.authKey = authKey;\n this._log = loggers;\n this.timeOffset = 0;\n this.salt = big_integer_1.default.zero;\n this._sequence = 0;\n this.id = this._lastMsgId = big_integer_1.default.zero;\n this.msgIds = [];\n this.securityChecks = securityChecks;\n this.reset();\n }\n /**\n * Resets the state\n */\n\n\n reset() {\n // Session IDs can be random on every connection\n this.id = __1.helpers.generateRandomLong(true);\n this._sequence = 0;\n this._lastMsgId = big_integer_1.default.zero;\n this.msgIds = [];\n }\n /**\n * Updates the message ID to a new one,\n * used when the time offset changed.\n * @param message\n */\n\n\n updateMessageId(message) {\n message.msgId = this._getNewMsgId();\n }\n /**\n * Calculate the key based on Telegram guidelines, specifying whether it\'s the client or not\n * @param authKey\n * @param msgKey\n * @param client\n * @returns {{iv: Buffer, key: Buffer}}\n */\n\n\n async _calcKey(authKey, msgKey, client) {\n const x = client ? 0 : 8;\n const [sha256a, sha256b] = await Promise.all([(0, Helpers_1.sha256)(buffer_1.Buffer.concat([msgKey, authKey.slice(x, x + 36)])), (0, Helpers_1.sha256)(buffer_1.Buffer.concat([authKey.slice(x + 40, x + 76), msgKey]))]);\n const key = buffer_1.Buffer.concat([sha256a.slice(0, 8), sha256b.slice(8, 24), sha256a.slice(24, 32)]);\n const iv = buffer_1.Buffer.concat([sha256b.slice(0, 8), s
|
|||
|
/*!*****************************************!*\
|
|||
|
!*** ./browser/network/RequestState.js ***!
|
|||
|
\*****************************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.RequestState = void 0;\n\nclass RequestState {\n constructor(request, after = undefined) {\n this.containerId = undefined;\n this.msgId = undefined;\n this.request = request;\n this.data = request.getBytes();\n this.after = after;\n this.result = undefined;\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n\n}\n\nexports.RequestState = RequestState;\n\n//# sourceURL=webpack://telegram/./browser/network/RequestState.js?')},"./browser/network/connection/Connection.js":
|
|||
|
/*!**************************************************!*\
|
|||
|
!*** ./browser/network/connection/Connection.js ***!
|
|||
|
\**************************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ObfuscatedConnection = exports.PacketCodec = exports.Connection = void 0;\n\nconst extensions_1 = __webpack_require__(/*! ../../extensions */ "./browser/extensions/index.js");\n\nconst real_cancellable_promise_1 = __webpack_require__(/*! real-cancellable-promise */ "./node_modules/real-cancellable-promise/dist/index.mjs");\n/**\n * The `Connection` class is a wrapper around ``asyncio.open_connection``.\n *\n * Subclasses will implement different transport modes as atomic operations,\n * which this class eases doing since the exposed interface simply puts and\n * gets complete data payloads to and from queues.\n *\n * The only error that will raise from send and receive methods is\n * ``ConnectionError``, which will raise when attempting to send if\n * the client is disconnected (includes remote disconnections).\n */\n\n\nclass Connection {\n constructor({\n ip,\n port,\n dcId,\n loggers,\n proxy,\n socket,\n testServers\n }) {\n this._ip = ip;\n this._port = port;\n this._dcId = dcId;\n this._log = loggers;\n this._proxy = proxy;\n this._connected = false;\n this._sendTask = undefined;\n this._recvTask = undefined;\n this._codec = undefined;\n this._obfuscation = undefined; // TcpObfuscated and MTProxy\n\n this._sendArray = new extensions_1.AsyncQueue();\n this._recvArray = new extensions_1.AsyncQueue();\n this.socket = new socket(proxy);\n this._testServers = testServers;\n }\n\n async _connect() {\n this._log.debug("Connecting");\n\n this._codec = new this.PacketCodecClass(this);\n await this.socket.connect(this._port, this._ip, this._testServers);\n\n this._log.debug("Finished connecting"); // await this.socket.connect({host: this._ip, port: this._port});\n\n\n await this._initConn();\n }\n\n async connect() {\n await this._connect();\n this._connected = true;\n this._sendTask = this._sendLoop();\n this._recvTask = this._recvLoop();\n }\n\n _cancelLoops() {\n this.recvCancel.cancel();\n this.sendCancel.cancel();\n }\n\n async disconnect() {\n this._connected = false;\n\n this._cancelLoops();\n\n try {\n await this.socket.close();\n } catch (e) {\n this._log.error("error while closing socket connection");\n }\n }\n\n async send(data) {\n if (!this._connected) {\n throw new Error("Not connected");\n }\n\n await this._sendArray.push(data);\n }\n\n async recv() {\n while (this._connected) {\n const result = await this._recvArray.pop();\n\n if (result && result.length) {\n return result;\n }\n }\n\n throw new Error("Not connected");\n }\n\n async _sendLoop() {\n try {\n while (this._connected) {\n this.sendCancel = (0, real_cancellable_promise_1.pseudoCancellable)(this._sendArray.pop());\n const data = await this.sendCancel;\n\n if (!data) {\n continue;\n }\n\n await this._send(data);\n }\n } catch (e) {\n if (e instanceof real_cancellable_promise_1.Cancellation) {\n return;\n }\n\n this._log.info("The server closed the connection while sending");\n\n await this.disconnect();\n }\n }\n\n async _recvLoop() {\n let data;\n\n while (this._connected) {\n try {\n this.recvCancel = (0, real_cancellable_promise_1.pseudoCancellable)(this._recv());\n data = await this.recvCancel;\n } catch (e) {\n if (e instanceof real_cancellable_promise_1.Cancellation) {\n return;\n }\n\n this._log.info("The server closed the connection");\n\n await this.disconnect();\n\n if (!this._recvArray._queue.length) {\n await this._recvArray.push(undefined);\n }\n\n break;\n }\n\n try {\n await this._recvArray.push(data);\n } catch (e) {\n break;\n }
|
|||
|
/*!***************************************************!*\
|
|||
|
!*** ./browser/network/connection/TCPAbridged.js ***!
|
|||
|
\***************************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ConnectionTCPAbridged = exports.AbridgedPacketCodec = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst Connection_1 = __webpack_require__(/*! ./Connection */ "./browser/network/connection/Connection.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nclass AbridgedPacketCodec extends Connection_1.PacketCodec {\n constructor(props) {\n super(props);\n this.tag = AbridgedPacketCodec.tag;\n this.obfuscateTag = AbridgedPacketCodec.obfuscateTag;\n }\n\n encodePacket(data) {\n let length = data.length >> 2;\n let temp;\n\n if (length < 127) {\n const b = buffer_1.Buffer.alloc(1);\n b.writeUInt8(length, 0);\n temp = b;\n } else {\n temp = buffer_1.Buffer.concat([buffer_1.Buffer.from("7f", "hex"), (0, Helpers_1.readBufferFromBigInt)((0, big_integer_1.default)(length), 3)]);\n }\n\n return buffer_1.Buffer.concat([temp, data]);\n }\n\n async readPacket(reader) {\n const readData = await reader.read(1);\n let length = readData[0];\n\n if (length >= 127) {\n length = buffer_1.Buffer.concat([await reader.read(3), buffer_1.Buffer.alloc(1)]).readInt32LE(0);\n }\n\n return reader.read(length << 2);\n }\n\n}\n\nexports.AbridgedPacketCodec = AbridgedPacketCodec;\nAbridgedPacketCodec.tag = buffer_1.Buffer.from("ef", "hex");\nAbridgedPacketCodec.obfuscateTag = buffer_1.Buffer.from("efefefef", "hex");\n/**\n * This is the mode with the lowest overhead, as it will\n * only require 1 byte if the packet length is less than\n * 508 bytes (127 << 2, which is very common).\n */\n\nclass ConnectionTCPAbridged extends Connection_1.Connection {\n constructor() {\n super(...arguments);\n this.PacketCodecClass = AbridgedPacketCodec;\n }\n\n}\n\nexports.ConnectionTCPAbridged = ConnectionTCPAbridged;\n\n//# sourceURL=webpack://telegram/./browser/network/connection/TCPAbridged.js?')},"./browser/network/connection/TCPFull.js":
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./browser/network/connection/TCPFull.js ***!
|
|||
|
\***********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ConnectionTCPFull = exports.FullPacketCodec = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst Connection_1 = __webpack_require__(/*! ./Connection */ "./browser/network/connection/Connection.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst errors_1 = __webpack_require__(/*! ../../errors */ "./browser/errors/index.js");\n\nclass FullPacketCodec extends Connection_1.PacketCodec {\n constructor(connection) {\n super(connection);\n this._sendCounter = 0; // Telegram will ignore us otherwise\n }\n\n encodePacket(data) {\n // https://core.telegram.org/mtproto#tcp-transport\n // total length, sequence number, packet and checksum (CRC32)\n const length = data.length + 12;\n const e = buffer_1.Buffer.alloc(8);\n e.writeInt32LE(length, 0);\n e.writeInt32LE(this._sendCounter, 4);\n data = buffer_1.Buffer.concat([e, data]);\n const crc = buffer_1.Buffer.alloc(4);\n crc.writeUInt32LE((0, Helpers_1.crc32)(data), 0);\n this._sendCounter += 1;\n return buffer_1.Buffer.concat([data, crc]);\n }\n /**\n *\n * @param reader {PromisedWebSockets}\n * @returns {Promise<*>}\n */\n\n\n async readPacket(reader) {\n const packetLenSeq = await reader.readExactly(8); // 4 and 4\n\n if (packetLenSeq === undefined) {\n // Return empty buffer in case of issue\n return buffer_1.Buffer.alloc(0);\n }\n\n const packetLen = packetLenSeq.readInt32LE(0);\n let body = await reader.readExactly(packetLen - 8);\n const checksum = body.slice(-4).readUInt32LE(0);\n body = body.slice(0, -4);\n const validChecksum = (0, Helpers_1.crc32)(buffer_1.Buffer.concat([packetLenSeq, body]));\n\n if (!(validChecksum === checksum)) {\n throw new errors_1.InvalidChecksumError(checksum, validChecksum);\n }\n\n return body;\n }\n\n}\n\nexports.FullPacketCodec = FullPacketCodec;\n\nclass ConnectionTCPFull extends Connection_1.Connection {\n constructor() {\n super(...arguments);\n this.PacketCodecClass = FullPacketCodec;\n }\n\n}\n\nexports.ConnectionTCPFull = ConnectionTCPFull;\n\n//# sourceURL=webpack://telegram/./browser/network/connection/TCPFull.js?')},"./browser/network/connection/TCPMTProxy.js":
|
|||
|
/*!**************************************************!*\
|
|||
|
!*** ./browser/network/connection/TCPMTProxy.js ***!
|
|||
|
\**************************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ConnectionTCPMTProxyAbridged = exports.TCPMTProxy = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst Connection_1 = __webpack_require__(/*! ./Connection */ "./browser/network/connection/Connection.js");\n\nconst TCPAbridged_1 = __webpack_require__(/*! ./TCPAbridged */ "./browser/network/connection/TCPAbridged.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst CTR_1 = __webpack_require__(/*! ../../crypto/CTR */ "./browser/crypto/CTR.js");\n\nclass MTProxyIO {\n constructor(connection) {\n this.header = undefined;\n this.connection = connection.socket;\n this._packetClass = connection.PacketCodecClass;\n this._secret = connection._secret;\n this._dcId = connection._dcId;\n }\n\n async initHeader() {\n let secret = this._secret;\n const isDD = secret.length == 17 && secret[0] == 0xdd;\n secret = isDD ? secret.slice(1) : secret;\n\n if (secret.length != 16) {\n throw new Error("MTProxy secret must be a hex-string representing 16 bytes");\n }\n\n const keywords = [buffer_1.Buffer.from("50567247", "hex"), buffer_1.Buffer.from("474554", "hex"), buffer_1.Buffer.from("504f5354", "hex"), buffer_1.Buffer.from("eeeeeeee", "hex")];\n let random; // eslint-disable-next-line no-constant-condition\n\n while (true) {\n random = (0, Helpers_1.generateRandomBytes)(64);\n\n if (random[0] !== 0xef && !random.slice(4, 8).equals(buffer_1.Buffer.alloc(4))) {\n let ok = true;\n\n for (const key of keywords) {\n if (key.equals(random.slice(0, 4))) {\n ok = false;\n break;\n }\n }\n\n if (ok) {\n break;\n }\n }\n }\n\n random = random.toJSON().data;\n const randomReversed = buffer_1.Buffer.from(random.slice(8, 56)).reverse(); // Encryption has "continuous buffer" enabled\n\n const encryptKey = await (0, Helpers_1.sha256)(buffer_1.Buffer.concat([buffer_1.Buffer.from(random.slice(8, 40)), secret]));\n const encryptIv = buffer_1.Buffer.from(random.slice(40, 56));\n const decryptKey = await (0, Helpers_1.sha256)(buffer_1.Buffer.concat([buffer_1.Buffer.from(randomReversed.slice(0, 32)), secret]));\n const decryptIv = buffer_1.Buffer.from(randomReversed.slice(32, 48));\n const encryptor = new CTR_1.CTR(encryptKey, encryptIv);\n const decryptor = new CTR_1.CTR(decryptKey, decryptIv);\n random = buffer_1.Buffer.concat([buffer_1.Buffer.from(random.slice(0, 56)), this._packetClass.obfuscateTag, buffer_1.Buffer.from(random.slice(60))]);\n const dcIdBytes = buffer_1.Buffer.alloc(2);\n dcIdBytes.writeInt8(this._dcId, 0);\n random = buffer_1.Buffer.concat([buffer_1.Buffer.from(random.slice(0, 60)), dcIdBytes, buffer_1.Buffer.from(random.slice(62))]);\n random = buffer_1.Buffer.concat([buffer_1.Buffer.from(random.slice(0, 56)), buffer_1.Buffer.from(encryptor.encrypt(random).slice(56, 64)), buffer_1.Buffer.from(random.slice(64))]);\n this.header = random;\n this._encrypt = encryptor;\n this._decrypt = decryptor;\n }\n\n async read(n) {\n const data = await this.connection.readExactly(n);\n return this._decrypt.encrypt(data);\n }\n\n write(data) {\n this.connection.write(this._encrypt.encrypt(data));\n }\n\n}\n\nclass TCPMTProxy extends Connection_1.ObfuscatedConnection {\n constructor({\n ip,\n port,\n dcId,\n loggers,\n proxy,\n socket,\n testServers\n }) {\n super({\n ip: proxy.ip,\n port: proxy.port,\n dcId: dcId,\n loggers: loggers,\n socket: socket,\n proxy: proxy,\n testServers: testServers\n });\n this.ObfuscatedIO = MTProxyIO;\n\n if (!proxy.MTProxy) {\n throw new Error("This connection only supports MPTProxies");\n }\n\n if (!proxy.secret) {\n thro
|
|||
|
/*!*****************************************************!*\
|
|||
|
!*** ./browser/network/connection/TCPObfuscated.js ***!
|
|||
|
\*****************************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ConnectionTCPObfuscated = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst Connection_1 = __webpack_require__(/*! ./Connection */ "./browser/network/connection/Connection.js");\n\nconst TCPAbridged_1 = __webpack_require__(/*! ./TCPAbridged */ "./browser/network/connection/TCPAbridged.js");\n\nconst CTR_1 = __webpack_require__(/*! ../../crypto/CTR */ "./browser/crypto/CTR.js");\n\nclass ObfuscatedIO {\n constructor(connection) {\n this.header = undefined;\n this.connection = connection.socket;\n this._packetClass = connection.PacketCodecClass;\n }\n\n async initHeader() {\n // Obfuscated messages secrets cannot start with any of these\n const keywords = [buffer_1.Buffer.from("50567247", "hex"), buffer_1.Buffer.from("474554", "hex"), buffer_1.Buffer.from("504f5354", "hex"), buffer_1.Buffer.from("eeeeeeee", "hex")];\n let random; // eslint-disable-next-line no-constant-condition\n\n while (true) {\n random = (0, Helpers_1.generateRandomBytes)(64);\n\n if (random[0] !== 0xef && !random.slice(4, 8).equals(buffer_1.Buffer.alloc(4))) {\n let ok = true;\n\n for (const key of keywords) {\n if (key.equals(random.slice(0, 4))) {\n ok = false;\n break;\n }\n }\n\n if (ok) {\n break;\n }\n }\n }\n\n random = random.toJSON().data;\n const randomReversed = buffer_1.Buffer.from(random.slice(8, 56)).reverse(); // Encryption has "continuous buffer" enabled\n\n const encryptKey = buffer_1.Buffer.from(random.slice(8, 40));\n const encryptIv = buffer_1.Buffer.from(random.slice(40, 56));\n const decryptKey = buffer_1.Buffer.from(randomReversed.slice(0, 32));\n const decryptIv = buffer_1.Buffer.from(randomReversed.slice(32, 48));\n const encryptor = new CTR_1.CTR(encryptKey, encryptIv);\n const decryptor = new CTR_1.CTR(decryptKey, decryptIv);\n random = buffer_1.Buffer.concat([buffer_1.Buffer.from(random.slice(0, 56)), this._packetClass.obfuscateTag, buffer_1.Buffer.from(random.slice(60))]);\n random = buffer_1.Buffer.concat([buffer_1.Buffer.from(random.slice(0, 56)), buffer_1.Buffer.from(encryptor.encrypt(random).slice(56, 64)), buffer_1.Buffer.from(random.slice(64))]);\n this.header = random;\n this._encrypt = encryptor;\n this._decrypt = decryptor;\n }\n\n async read(n) {\n const data = await this.connection.readExactly(n);\n return this._decrypt.encrypt(data);\n }\n\n write(data) {\n this.connection.write(this._encrypt.encrypt(data));\n }\n\n}\n\nclass ConnectionTCPObfuscated extends Connection_1.ObfuscatedConnection {\n constructor() {\n super(...arguments);\n this.ObfuscatedIO = ObfuscatedIO;\n this.PacketCodecClass = TCPAbridged_1.AbridgedPacketCodec;\n }\n\n}\n\nexports.ConnectionTCPObfuscated = ConnectionTCPObfuscated;\n\n//# sourceURL=webpack://telegram/./browser/network/connection/TCPObfuscated.js?')},"./browser/network/connection/index.js":
|
|||
|
/*!*********************************************!*\
|
|||
|
!*** ./browser/network/connection/index.js ***!
|
|||
|
\*********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ConnectionTCPObfuscated = exports.ConnectionTCPAbridged = exports.ConnectionTCPFull = exports.Connection = void 0;\n\nvar Connection_1 = __webpack_require__(/*! ./Connection */ "./browser/network/connection/Connection.js");\n\nObject.defineProperty(exports, "Connection", ({\n enumerable: true,\n get: function () {\n return Connection_1.Connection;\n }\n}));\n\nvar TCPFull_1 = __webpack_require__(/*! ./TCPFull */ "./browser/network/connection/TCPFull.js");\n\nObject.defineProperty(exports, "ConnectionTCPFull", ({\n enumerable: true,\n get: function () {\n return TCPFull_1.ConnectionTCPFull;\n }\n}));\n\nvar TCPAbridged_1 = __webpack_require__(/*! ./TCPAbridged */ "./browser/network/connection/TCPAbridged.js");\n\nObject.defineProperty(exports, "ConnectionTCPAbridged", ({\n enumerable: true,\n get: function () {\n return TCPAbridged_1.ConnectionTCPAbridged;\n }\n}));\n\nvar TCPObfuscated_1 = __webpack_require__(/*! ./TCPObfuscated */ "./browser/network/connection/TCPObfuscated.js");\n\nObject.defineProperty(exports, "ConnectionTCPObfuscated", ({\n enumerable: true,\n get: function () {\n return TCPObfuscated_1.ConnectionTCPObfuscated;\n }\n}));\n\n//# sourceURL=webpack://telegram/./browser/network/connection/index.js?')},"./browser/network/index.js":
|
|||
|
/*!**********************************!*\
|
|||
|
!*** ./browser/network/index.js ***!
|
|||
|
\**********************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ConnectionTCPObfuscated = exports.ConnectionTCPAbridged = exports.ConnectionTCPFull = exports.Connection = exports.UpdateConnectionState = exports.MTProtoSender = exports.doAuthentication = exports.MTProtoPlainSender = void 0;\n\nvar MTProtoPlainSender_1 = __webpack_require__(/*! ./MTProtoPlainSender */ "./browser/network/MTProtoPlainSender.js");\n\nObject.defineProperty(exports, "MTProtoPlainSender", ({\n enumerable: true,\n get: function () {\n return MTProtoPlainSender_1.MTProtoPlainSender;\n }\n}));\n\nvar Authenticator_1 = __webpack_require__(/*! ./Authenticator */ "./browser/network/Authenticator.js");\n\nObject.defineProperty(exports, "doAuthentication", ({\n enumerable: true,\n get: function () {\n return Authenticator_1.doAuthentication;\n }\n}));\n\nvar MTProtoSender_1 = __webpack_require__(/*! ./MTProtoSender */ "./browser/network/MTProtoSender.js");\n\nObject.defineProperty(exports, "MTProtoSender", ({\n enumerable: true,\n get: function () {\n return MTProtoSender_1.MTProtoSender;\n }\n}));\n\nclass UpdateConnectionState {\n constructor(state) {\n this.state = state;\n }\n\n}\n\nexports.UpdateConnectionState = UpdateConnectionState;\nUpdateConnectionState.disconnected = -1;\nUpdateConnectionState.connected = 1;\nUpdateConnectionState.broken = 0;\n\nvar connection_1 = __webpack_require__(/*! ./connection */ "./browser/network/connection/index.js");\n\nObject.defineProperty(exports, "Connection", ({\n enumerable: true,\n get: function () {\n return connection_1.Connection;\n }\n}));\nObject.defineProperty(exports, "ConnectionTCPFull", ({\n enumerable: true,\n get: function () {\n return connection_1.ConnectionTCPFull;\n }\n}));\nObject.defineProperty(exports, "ConnectionTCPAbridged", ({\n enumerable: true,\n get: function () {\n return connection_1.ConnectionTCPAbridged;\n }\n}));\nObject.defineProperty(exports, "ConnectionTCPObfuscated", ({\n enumerable: true,\n get: function () {\n return connection_1.ConnectionTCPObfuscated;\n }\n}));\n\n//# sourceURL=webpack://telegram/./browser/network/index.js?')},"./browser/platform.js":
|
|||
|
/*!*****************************!*\
|
|||
|
!*** ./browser/platform.js ***!
|
|||
|
\*****************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.isNode = exports.isBrowser = exports.isDeno = void 0;\nexports.isDeno = "Deno" in globalThis;\nexports.isBrowser = !exports.isDeno && typeof window !== "undefined";\nexports.isNode = !exports.isBrowser;\n\n//# sourceURL=webpack://telegram/./browser/platform.js?')},"./browser/requestIter.js":
|
|||
|
/*!********************************!*\
|
|||
|
!*** ./browser/requestIter.js ***!
|
|||
|
\********************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __asyncValues = this && this.__asyncValues || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var m = o[Symbol.asyncIterator],\n i;\n return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i);\n\n function verb(n) {\n i[n] = o[n] && function (v) {\n return new Promise(function (resolve, reject) {\n v = o[n](v), settle(resolve, reject, v.done, v.value);\n });\n };\n }\n\n function settle(resolve, reject, d, v) {\n Promise.resolve(v).then(function (v) {\n resolve({\n value: v,\n done: d\n });\n }, reject);\n }\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.RequestIter = void 0;\n\nconst Helpers_1 = __webpack_require__(/*! ./Helpers */ "./browser/Helpers.js");\n\nconst _1 = __webpack_require__(/*! ./ */ "./browser/index.js");\n\nclass RequestIter {\n constructor(client, limit, params = {}, args = {}) {\n this.client = client;\n this.reverse = params.reverse;\n this.waitTime = params.waitTime;\n this.limit = Math.max(!limit ? Number.MAX_SAFE_INTEGER : limit, 0);\n this.left = this.limit;\n this.buffer = undefined;\n this.kwargs = args;\n this.index = 0;\n this.total = undefined;\n this.lastLoad = 0;\n }\n\n async _init(kwargs) {// for overload\n }\n\n [Symbol.asyncIterator]() {\n this.buffer = undefined;\n this.index = 0;\n this.lastLoad = 0;\n this.left = this.limit;\n return {\n next: async () => {\n if (this.buffer == undefined) {\n this.buffer = [];\n\n if (await this._init(this.kwargs)) {\n this.left = this.buffer.length;\n }\n }\n\n if (this.left <= 0) {\n return {\n value: undefined,\n done: true\n };\n }\n\n if (this.index == this.buffer.length) {\n if (this.waitTime) {\n await (0, Helpers_1.sleep)(this.waitTime - (new Date().getTime() / 1000 - this.lastLoad));\n }\n\n this.lastLoad = new Date().getTime() / 1000;\n this.index = 0;\n this.buffer = [];\n const nextChunk = await this._loadNextChunk();\n\n if (nextChunk === false) {\n // we exit;\n return {\n value: undefined,\n done: true\n };\n }\n\n if (nextChunk) {\n this.left = this.buffer.length;\n }\n }\n\n if (!this.buffer || !this.buffer.length) {\n return {\n value: undefined,\n done: true\n };\n }\n\n const result = this.buffer[this.index];\n this.left -= 1;\n this.index += 1;\n return {\n value: result,\n done: false\n };\n }\n };\n }\n\n async collect() {\n var e_1, _a;\n\n const result = new _1.helpers.TotalList();\n\n try {\n for (var _b = __asyncValues(this), _c; _c = await _b.next(), !_c.done;) {\n const message = _c.value;\n result.push(message);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) await _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n result.total = this.total;\n return result;\n }\n\n async _loadNextChunk() {\n throw new Error("Not Implemented");\n }\n\n}\n\nexports.RequestIter = RequestIter;\n\n//# sourceURL=webpack://telegram/./browser/requestIter.js?')},"./browser/sessions/Abstract.js":
|
|||
|
/*!**************************************!*\
|
|||
|
!*** ./browser/sessions/Abstract.js ***!
|
|||
|
\**************************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.Session = void 0;\n\nclass Session {}\n\nexports.Session = Session;\n\n//# sourceURL=webpack://telegram/./browser/sessions/Abstract.js?')},"./browser/sessions/Memory.js":
|
|||
|
/*!************************************!*\
|
|||
|
!*** ./browser/sessions/Memory.js ***!
|
|||
|
\************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.MemorySession = void 0;\n\nconst Abstract_1 = __webpack_require__(/*! ./Abstract */ "./browser/sessions/Abstract.js");\n\nconst tl_1 = __webpack_require__(/*! ../tl */ "./browser/tl/index.js");\n\nconst big_integer_1 = __importDefault(__webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js"));\n\nconst Utils_1 = __webpack_require__(/*! ../Utils */ "./browser/Utils.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst __1 = __webpack_require__(/*! ../ */ "./browser/index.js");\n\nclass MemorySession extends Abstract_1.Session {\n constructor() {\n super();\n this._serverAddress = undefined;\n this._dcId = 0;\n this._port = undefined;\n this._takeoutId = undefined;\n this._entities = new Set();\n this._updateStates = {};\n }\n\n setDC(dcId, serverAddress, port) {\n this._dcId = dcId | 0;\n this._serverAddress = serverAddress;\n this._port = port;\n }\n\n get dcId() {\n return this._dcId;\n }\n\n get serverAddress() {\n return this._serverAddress;\n }\n\n get port() {\n return this._port;\n }\n\n get authKey() {\n return this._authKey;\n }\n\n set authKey(value) {\n this._authKey = value;\n }\n\n get takeoutId() {\n return this._takeoutId;\n }\n\n set takeoutId(value) {\n this._takeoutId = value;\n }\n\n getAuthKey(dcId) {\n if (dcId && dcId !== this.dcId) {\n // Not supported.\n return undefined;\n }\n\n return this.authKey;\n }\n\n setAuthKey(authKey, dcId) {\n if (dcId && dcId !== this.dcId) {\n // Not supported.\n return undefined;\n }\n\n this.authKey = authKey;\n }\n\n close() {}\n\n save() {}\n\n async load() {}\n\n delete() {}\n\n _entityValuesToRow(id, hash, username, phone, name) {\n // While this is a simple implementation it might be overrode by,\n // other classes so they don\'t need to implement the plural form\n // of the method. Don\'t remove.\n return [id, hash, username, phone, name];\n }\n\n _entityToRow(e) {\n if (!(e.classType === "constructor")) {\n return;\n }\n\n let p;\n let markedId;\n\n try {\n p = (0, Utils_1.getInputPeer)(e, false);\n markedId = (0, Utils_1.getPeerId)(p);\n } catch (e) {\n return;\n }\n\n let pHash;\n\n if (p instanceof tl_1.Api.InputPeerUser || p instanceof tl_1.Api.InputPeerChannel) {\n pHash = p.accessHash;\n } else if (p instanceof tl_1.Api.InputPeerChat) {\n pHash = big_integer_1.default.zero;\n } else {\n return;\n }\n\n let username = e.username;\n\n if (username) {\n username = username.toLowerCase();\n }\n\n const phone = e.phone;\n const name = (0, Utils_1.getDisplayName)(e);\n return this._entityValuesToRow(markedId, pHash, username, phone, name);\n }\n\n _entitiesToRows(tlo) {\n let entities = [];\n\n if (!(tlo.classType === "constructor") && (0, Helpers_1.isArrayLike)(tlo)) {\n // This may be a list of users already for instance\n entities = tlo;\n } else {\n if (typeof tlo === "object") {\n if ("user" in tlo) {\n entities.push(tlo.user);\n }\n\n if ("chat" in tlo) {\n entities.push(tlo.chat);\n }\n\n if ("channel" in tlo) {\n entities.push(tlo.channel);\n }\n\n if ("chats" in tlo && (0, Helpers_1.isArrayLike)(tlo.chats)) {\n entities = entities.concat(tlo.chats);\n }\n\n if ("users" in tlo && (0, Helpers_1.isArrayLike)(tlo.users)) {\n entities = entities.concat(tlo.users);\n }\n }\n }\n\n const rows = []; // Rows to add (id, hash, username, phone, name)\n\n for (const e of entities
|
|||
|
/*!******************************************!*\
|
|||
|
!*** ./browser/sessions/StoreSession.js ***!
|
|||
|
\******************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n "default": mod\n };\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.StoreSession = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst Memory_1 = __webpack_require__(/*! ./Memory */ "./browser/sessions/Memory.js");\n\nconst store2_1 = __importDefault(__webpack_require__(/*! store2 */ "./node_modules/store2/dist/store2.js"));\n\nconst AuthKey_1 = __webpack_require__(/*! ../crypto/AuthKey */ "./browser/crypto/AuthKey.js");\n\nclass StoreSession extends Memory_1.MemorySession {\n constructor(sessionName, divider = ":") {\n super();\n\n if (typeof localStorage === "undefined" || localStorage === null) {\n const LocalStorage = (__webpack_require__(/*! ./localStorage */ "./browser/sessions/localStorage.js").LocalStorage);\n\n this.store = store2_1.default.area(sessionName, new LocalStorage("./" + sessionName));\n } else {\n this.store = store2_1.default.area(sessionName, localStorage);\n }\n\n if (divider == undefined) {\n divider = ":";\n }\n\n this.sessionName = sessionName + divider;\n }\n\n async load() {\n let authKey = this.store.get(this.sessionName + "authKey");\n\n if (authKey && typeof authKey === "object") {\n this._authKey = new AuthKey_1.AuthKey();\n\n if ("data" in authKey) {\n authKey = buffer_1.Buffer.from(authKey.data);\n }\n\n await this._authKey.setKey(authKey);\n }\n\n const dcId = this.store.get(this.sessionName + "dcId");\n\n if (dcId) {\n this._dcId = dcId;\n }\n\n const port = this.store.get(this.sessionName + "port");\n\n if (port) {\n this._port = port;\n }\n\n const serverAddress = this.store.get(this.sessionName + "serverAddress");\n\n if (serverAddress) {\n this._serverAddress = serverAddress;\n }\n }\n\n setDC(dcId, serverAddress, port) {\n this.store.set(this.sessionName + "dcId", dcId);\n this.store.set(this.sessionName + "port", port);\n this.store.set(this.sessionName + "serverAddress", serverAddress);\n super.setDC(dcId, serverAddress, port);\n }\n\n set authKey(value) {\n this._authKey = value;\n this.store.set(this.sessionName + "authKey", value === null || value === void 0 ? void 0 : value.getKey());\n }\n\n get authKey() {\n return this._authKey;\n }\n\n processEntities(tlo) {\n const rows = this._entitiesToRows(tlo);\n\n if (!rows) {\n return;\n }\n\n for (const row of rows) {\n row.push(new Date().getTime().toString());\n this.store.set(this.sessionName + row[0], row);\n }\n }\n\n getEntityRowsById(id, exact = true) {\n return this.store.get(this.sessionName + id.toString());\n }\n\n}\n\nexports.StoreSession = StoreSession;\n\n//# sourceURL=webpack://telegram/./browser/sessions/StoreSession.js?')},"./browser/sessions/StringSession.js":
|
|||
|
/*!*******************************************!*\
|
|||
|
!*** ./browser/sessions/StringSession.js ***!
|
|||
|
\*******************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.StringSession = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst Memory_1 = __webpack_require__(/*! ./Memory */ "./browser/sessions/Memory.js");\n\nconst extensions_1 = __webpack_require__(/*! ../extensions */ "./browser/extensions/index.js");\n\nconst AuthKey_1 = __webpack_require__(/*! ../crypto/AuthKey */ "./browser/crypto/AuthKey.js");\n\nconst CURRENT_VERSION = "1";\n\nclass StringSession extends Memory_1.MemorySession {\n /**\n * This session file can be easily saved and loaded as a string. According\n * to the initial design, it contains only the data that is necessary for\n * successful connection and authentication, so takeout ID is not stored.\n * It is thought to be used where you don\'t want to create any on-disk\n * files but would still like to be able to save and load existing sessions\n * by other means.\n * You can use custom `encode` and `decode` functions, if present:\n * `encode` definition must be ``function encode(value: Buffer) -> string:``.\n * `decode` definition must be ``function decode(value: string) -> Buffer:``.\n * @param session {string|null}\n */\n constructor(session) {\n super();\n\n if (session) {\n if (session[0] !== CURRENT_VERSION) {\n throw new Error("Not a valid string");\n }\n\n session = session.slice(1);\n const r = StringSession.decode(session);\n const reader = new extensions_1.BinaryReader(r);\n this._dcId = reader.read(1).readUInt8(0);\n\n if (session.length == 352) {\n // Telethon session\n const ip_v4 = reader.read(4); // TODO looks ugly smh\n\n this._serverAddress = ip_v4[0].toString() + "." + ip_v4[1].toString() + "." + ip_v4[2].toString() + "." + ip_v4[3].toString();\n } else {\n // TODO find a better of doing this\n const serverAddressLen = reader.read(2).readInt16BE(0);\n\n if (serverAddressLen > 100) {\n reader.offset -= 2;\n this._serverAddress = reader.read(16).toString("hex").match(/.{1,4}/g).map(val => val.replace(/^0+/, "")).join(":").replace(/0000\\:/g, ":").replace(/:{2,}/g, "::");\n } else {\n this._serverAddress = reader.read(serverAddressLen).toString();\n }\n }\n\n this._port = reader.read(2).readInt16BE(0);\n this._key = reader.read(-1);\n }\n }\n /**\n * @param x {Buffer}\n * @returns {string}\n */\n\n\n static encode(x) {\n return x.toString("base64");\n }\n /**\n * @param x {string}\n * @returns {Buffer}\n */\n\n\n static decode(x) {\n return buffer_1.Buffer.from(x, "base64");\n }\n\n async load() {\n if (this._key) {\n this._authKey = new AuthKey_1.AuthKey();\n await this._authKey.setKey(this._key);\n }\n }\n\n save() {\n if (!this.authKey || !this.serverAddress || !this.port) {\n return "";\n } // TS is weird\n\n\n const key = this.authKey.getKey();\n\n if (!key) {\n return "";\n }\n\n const dcBuffer = buffer_1.Buffer.from([this.dcId]);\n const addressBuffer = buffer_1.Buffer.from(this.serverAddress);\n const addressLengthBuffer = buffer_1.Buffer.alloc(2);\n addressLengthBuffer.writeInt16BE(addressBuffer.length, 0);\n const portBuffer = buffer_1.Buffer.alloc(2);\n portBuffer.writeInt16BE(this.port, 0);\n return CURRENT_VERSION + StringSession.encode(buffer_1.Buffer.concat([dcBuffer, addressLengthBuffer, addressBuffer, portBuffer, key]));\n }\n\n}\n\nexports.StringSession = StringSession;\n\n//# sourceURL=webpack://telegram/./browser/sessions/StringSession.js?')},"./browser/sessions/index.js":
|
|||
|
/*!***********************************!*\
|
|||
|
!*** ./browser/sessions/index.js ***!
|
|||
|
\***********************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.Session = exports.StoreSession = exports.StringSession = exports.MemorySession = void 0;\n\nvar Memory_1 = __webpack_require__(/*! ./Memory */ "./browser/sessions/Memory.js");\n\nObject.defineProperty(exports, "MemorySession", ({\n enumerable: true,\n get: function () {\n return Memory_1.MemorySession;\n }\n}));\n\nvar StringSession_1 = __webpack_require__(/*! ./StringSession */ "./browser/sessions/StringSession.js");\n\nObject.defineProperty(exports, "StringSession", ({\n enumerable: true,\n get: function () {\n return StringSession_1.StringSession;\n }\n}));\n\nvar StoreSession_1 = __webpack_require__(/*! ./StoreSession */ "./browser/sessions/StoreSession.js");\n\nObject.defineProperty(exports, "StoreSession", ({\n enumerable: true,\n get: function () {\n return StoreSession_1.StoreSession;\n }\n}));\n\nvar Abstract_1 = __webpack_require__(/*! ./Abstract */ "./browser/sessions/Abstract.js");\n\nObject.defineProperty(exports, "Session", ({\n enumerable: true,\n get: function () {\n return Abstract_1.Session;\n }\n})); // @ts-ignore\n//export {CacheApiSession} from \'./CacheApiSession\';\n\n//# sourceURL=webpack://telegram/./browser/sessions/index.js?')},"./browser/sessions/localStorage.js":
|
|||
|
/*!******************************************!*\
|
|||
|
!*** ./browser/sessions/localStorage.js ***!
|
|||
|
\******************************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.LocalStorage = void 0;\n\nclass LocalStorage {\n constructor(location) {\n throw new Error("Do not call me");\n }\n\n}\n\nexports.LocalStorage = LocalStorage;\n\n//# sourceURL=webpack://telegram/./browser/sessions/localStorage.js?')},"./browser/tl/AllTLObjects.js":
|
|||
|
/*!************************************!*\
|
|||
|
!*** ./browser/tl/AllTLObjects.js ***!
|
|||
|
\************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.tlobjects = exports.LAYER = void 0;\nexports.LAYER = 158;\n\nconst _1 = __webpack_require__(/*! ./ */ "./browser/tl/index.js");\n\nconst tlobjects = {};\nexports.tlobjects = tlobjects;\n\nfor (const tl of Object.values(_1.Api)) {\n if ("CONSTRUCTOR_ID" in tl) {\n tlobjects[tl.CONSTRUCTOR_ID] = tl;\n } else {\n for (const sub of Object.values(tl)) {\n tlobjects[sub.CONSTRUCTOR_ID] = sub;\n }\n }\n}\n\n//# sourceURL=webpack://telegram/./browser/tl/AllTLObjects.js?')},"./browser/tl/api.js":
|
|||
|
/*!***************************!*\
|
|||
|
!*** ./browser/tl/api.js ***!
|
|||
|
\***************************/(module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst {\n inspect\n} = __webpack_require__(/*! ../inspect */ "./browser/inspect.js");\n\nconst bigInt = __webpack_require__(/*! big-integer */ "./node_modules/big-integer/BigInteger.js");\n\nconst {\n generateRandomBytes,\n readBigIntFromBuffer,\n isArrayLike,\n betterConsoleLog\n} = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst tlContent = __webpack_require__(/*! ./apiTl.js */ "./browser/tl/apiTl.js");\n\nconst schemeContent = __webpack_require__(/*! ./schemaTl.js */ "./browser/tl/schemaTl.js");\n\nfunction generateRandomBigInt() {\n return readBigIntFromBuffer(generateRandomBytes(8), false, true);\n}\n\nconst {\n parseTl,\n serializeBytes,\n serializeDate\n} = __webpack_require__(/*! ./generationHelpers */ "./browser/tl/generationHelpers.js");\n\nconst {\n toSignedLittleBuffer\n} = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst NAMED_AUTO_CASTS = new Set(["chatId,int"]);\nconst NAMED_BLACKLIST = new Set(["discardEncryption"]);\nconst AUTO_CASTS = new Set(["InputPeer", "InputChannel", "InputUser", "InputDialogPeer", "InputNotifyPeer", "InputMedia", "InputPhoto", "InputMessage", "InputDocument", "InputChatPhoto"]);\n\nclass CastError extends Error {\n constructor(objectName, expected, actual, ...params) {\n // Pass remaining arguments (including vendor specific ones) to parent constructor\n const message = "Found wrong type for " + objectName + ". expected " + expected + " but received " + actual + ".If you think this is a mistake please report it.";\n super(message, ...params); // Maintains proper stack trace for where our error was thrown (only available on V8)\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, CastError);\n }\n\n this.name = "CastError"; // Custom debugging information\n }\n\n}\n\nconst CACHING_SUPPORTED = typeof self !== "undefined" && self.localStorage !== undefined;\nconst CACHE_KEY = "GramJs:apiCache";\n\nfunction buildApiFromTlSchema() {\n let definitions;\n const fromCache = CACHING_SUPPORTED && loadFromCache();\n\n if (fromCache) {\n definitions = fromCache;\n } else {\n definitions = loadFromTlSchemas();\n\n if (CACHING_SUPPORTED) {\n localStorage.setItem(CACHE_KEY, JSON.stringify(definitions));\n }\n }\n\n return createClasses("all", definitions);\n}\n\nfunction loadFromCache() {\n const jsonCache = localStorage.getItem(CACHE_KEY);\n return jsonCache && JSON.parse(jsonCache);\n}\n\nfunction loadFromTlSchemas() {\n const [constructorParamsApi, functionParamsApi] = extractParams(tlContent);\n const [constructorParamsSchema, functionParamsSchema] = extractParams(schemeContent);\n const constructors = [].concat(constructorParamsApi, constructorParamsSchema);\n const requests = [].concat(functionParamsApi, functionParamsSchema);\n return [].concat(constructors, requests);\n}\n\nfunction extractParams(fileContent) {\n const f = parseTl(fileContent, 109);\n const constructors = [];\n const functions = [];\n\n for (const d of f) {\n d.isFunction ? functions.push(d) : constructors.push(d);\n }\n\n return [constructors, functions];\n}\n\nfunction argToBytes(x, type, argName, requestName) {\n switch (type) {\n case "int":\n const i = buffer_1.Buffer.alloc(4);\n i.writeInt32LE(x, 0);\n return i;\n\n case "long":\n return toSignedLittleBuffer(x, 8);\n\n case "int128":\n return toSignedLittleBuffer(x, 16);\n\n case "int256":\n return toSignedLittleBuffer(x, 32);\n\n case "double":\n const d = buffer_1.Buffer.alloc(8);\n d.writeDoubleLE(x, 0);\n return d;\n\n case "string":\n return serializeBytes(x);\n\n case "Bool":\n return x ? buffer_1.Buffer.from("b5757299", "hex") : buffer_1.Buffer.from("379779bc", "hex");\n\n case "true":\n ret
|
|||
|
/*!*****************************!*\
|
|||
|
!*** ./browser/tl/apiTl.js ***!
|
|||
|
\*****************************/module=>{"use strict";eval("\n\nmodule.exports = `\nboolFalse#bc799737 = Bool;\nboolTrue#997275b5 = Bool;\ntrue#3fedd339 = True;\nvector#1cb5c415 {t:Type} # [ t ] = Vector t;\nerror#c4b9f9bb code:int text:string = Error;\nnull#56730bcc = Null;\ninputPeerEmpty#7f3b18ea = InputPeer;\ninputPeerSelf#7da07ec9 = InputPeer;\ninputPeerChat#35a95cb9 chat_id:long = InputPeer;\ninputPeerUser#dde8a54c user_id:long access_hash:long = InputPeer;\ninputPeerChannel#27bcbbfc channel_id:long access_hash:long = InputPeer;\ninputPeerUserFromMessage#a87b0a1c peer:InputPeer msg_id:int user_id:long = InputPeer;\ninputPeerChannelFromMessage#bd2a0840 peer:InputPeer msg_id:int channel_id:long = InputPeer;\ninputUserEmpty#b98886cf = InputUser;\ninputUserSelf#f7c1b13f = InputUser;\ninputUser#f21158c6 user_id:long access_hash:long = InputUser;\ninputUserFromMessage#1da448e2 peer:InputPeer msg_id:int user_id:long = InputUser;\ninputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;\ninputFile#f52ff27f id:long parts:int name:string md5_checksum:string = InputFile;\ninputFileBig#fa4f0bb5 id:long parts:int name:string = InputFile;\ninputMediaEmpty#9664f57f = InputMedia;\ninputMediaUploadedPhoto#1e287d04 flags:# spoiler:flags.2?true file:InputFile stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;\ninputMediaPhoto#b3ba0635 flags:# spoiler:flags.1?true id:InputPhoto ttl_seconds:flags.0?int = InputMedia;\ninputMediaGeoPoint#f9c44144 geo_point:InputGeoPoint = InputMedia;\ninputMediaContact#f8ab7dfb phone_number:string first_name:string last_name:string vcard:string = InputMedia;\ninputMediaUploadedDocument#5b38c6c1 flags:# nosound_video:flags.3?true force_file:flags.4?true spoiler:flags.5?true file:InputFile thumb:flags.2?InputFile mime_type:string attributes:Vector<DocumentAttribute> stickers:flags.0?Vector<InputDocument> ttl_seconds:flags.1?int = InputMedia;\ninputMediaDocument#33473058 flags:# spoiler:flags.2?true id:InputDocument ttl_seconds:flags.0?int query:flags.1?string = InputMedia;\ninputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string provider:string venue_id:string venue_type:string = InputMedia;\ninputMediaPhotoExternal#e5bbfe1a flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaDocumentExternal#fb52dc99 flags:# spoiler:flags.1?true url:string ttl_seconds:flags.0?int = InputMedia;\ninputMediaGame#d33f43f3 id:InputGame = InputMedia;\ninputMediaInvoice#8eb5a6d5 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string extended_media:flags.2?InputMedia = InputMedia;\ninputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia;\ninputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector<bytes> solution:flags.1?string solution_entities:flags.1?Vector<MessageEntity> = InputMedia;\ninputMediaDice#e66fbf7b emoticon:string = InputMedia;\ninputChatPhotoEmpty#1ca48f57 = InputChatPhoto;\ninputChatUploadedPhoto#bdcdaec0 flags:# file:flags.0?InputFile video:flags.1?InputFile video_start_ts:flags.2?double video_emoji_markup:flags.3?VideoSize = InputChatPhoto;\ninputChatPhoto#8953ad37 id:InputPhoto = InputChatPhoto;\ninputGeoPointEmpty#e4c123d6 = InputGeoPoint;\ninputGeoPoint#48222faf flags:# lat:double long:double accuracy_radius:flags.0?int = InputGeoPoint;\ninputPhotoEmpty#1cd7bf0d = InputPhoto;\ninputPhoto#3bb3b94a id:long access_hash:long file_reference:bytes = InputPhoto;\ninputFileLocation#dfdaabe1 volume_id:long local_id:int secret:long file_reference:bytes = InputFileLocation;\ninputEncryptedFileLocation#f5235d55 id:long access_hash:long = InputFileLocation;\ninputDocumentFileLocation#bad07584 id:long access_hash:long file_reference:bytes thumb_size:string = InputFileLocation;\ninputSecureFileLocation#cbc7ee28 id:long access_hash:long = InputFileLocati
|
|||
|
/*!***************************************!*\
|
|||
|
!*** ./browser/tl/core/GZIPPacked.js ***!
|
|||
|
\***************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.GZIPPacked = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst __1 = __webpack_require__(/*! ../ */ "./browser/tl/index.js");\n\nconst pako_1 = __webpack_require__(/*! pako */ "./node_modules/pako/index.js");\n\nclass GZIPPacked {\n constructor(data) {\n this.data = data;\n this.CONSTRUCTOR_ID = 0x3072cfa1;\n this.classType = "constructor";\n }\n\n static async gzipIfSmaller(contentRelated, data) {\n if (contentRelated && data.length > 512) {\n const gzipped = await new GZIPPacked(data).toBytes();\n\n if (gzipped.length < data.length) {\n return gzipped;\n }\n }\n\n return data;\n }\n\n static gzip(input) {\n return buffer_1.Buffer.from(input); // TODO this usually makes it faster for large requests\n //return Buffer.from(deflate(input, { level: 9, gzip: true }))\n }\n\n static ungzip(input) {\n return buffer_1.Buffer.from((0, pako_1.inflate)(input));\n }\n\n async toBytes() {\n const g = buffer_1.Buffer.alloc(4);\n g.writeUInt32LE(GZIPPacked.CONSTRUCTOR_ID, 0);\n return buffer_1.Buffer.concat([g, (0, __1.serializeBytes)(await GZIPPacked.gzip(this.data))]);\n }\n\n static async read(reader) {\n const constructor = reader.readInt(false);\n\n if (constructor !== GZIPPacked.CONSTRUCTOR_ID) {\n throw new Error("not equal");\n }\n\n return GZIPPacked.gzip(reader.tgReadBytes());\n }\n\n static async fromReader(reader) {\n const data = reader.tgReadBytes();\n return new GZIPPacked(await GZIPPacked.ungzip(data));\n }\n\n}\n\nexports.GZIPPacked = GZIPPacked;\nGZIPPacked.CONSTRUCTOR_ID = 0x3072cfa1;\nGZIPPacked.classType = "constructor";\n\n//# sourceURL=webpack://telegram/./browser/tl/core/GZIPPacked.js?')},"./browser/tl/core/MessageContainer.js":
|
|||
|
/*!*********************************************!*\
|
|||
|
!*** ./browser/tl/core/MessageContainer.js ***!
|
|||
|
\*********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.MessageContainer = void 0;\n\nconst TLMessage_1 = __webpack_require__(/*! ./TLMessage */ "./browser/tl/core/TLMessage.js");\n\nclass MessageContainer {\n constructor(messages) {\n this.CONSTRUCTOR_ID = 0x73f1f8dc;\n this.messages = messages;\n this.classType = "constructor";\n }\n\n static async fromReader(reader) {\n const messages = [];\n const length = reader.readInt();\n\n for (let x = 0; x < length; x++) {\n const msgId = reader.readLong();\n const seqNo = reader.readInt();\n const length = reader.readInt();\n const before = reader.tellPosition();\n const obj = reader.tgReadObject();\n reader.setPosition(before + length);\n const tlMessage = new TLMessage_1.TLMessage(msgId, seqNo, obj);\n messages.push(tlMessage);\n }\n\n return new MessageContainer(messages);\n }\n\n}\n\nexports.MessageContainer = MessageContainer;\nMessageContainer.CONSTRUCTOR_ID = 0x73f1f8dc;\nMessageContainer.classType = "constructor"; // Maximum size in bytes for the inner payload of the container.\n// Telegram will close the connection if the payload is bigger.\n// The overhead of the container itself is subtracted.\n\nMessageContainer.MAXIMUM_SIZE = 1044456 - 8; // Maximum amount of messages that can\'t be sent inside a single\n// container, inclusive. Beyond this limit Telegram will respond\n// with BAD_MESSAGE 64 (invalid container).\n//\n// This limit is not 100% accurate and may in some cases be higher.\n// However, sending up to 100 requests at once in a single container\n// is a reasonable conservative value, since it could also depend on\n// other factors like size per request, but we cannot know this.\n\nMessageContainer.MAXIMUM_LENGTH = 100;\n\n//# sourceURL=webpack://telegram/./browser/tl/core/MessageContainer.js?')},"./browser/tl/core/RPCResult.js":
|
|||
|
/*!**************************************!*\
|
|||
|
!*** ./browser/tl/core/RPCResult.js ***!
|
|||
|
\**************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.RPCResult = void 0;\n\nconst api_1 = __webpack_require__(/*! ../api */ "./browser/tl/api.js");\n\nconst _1 = __webpack_require__(/*! ./ */ "./browser/tl/core/index.js");\n\nclass RPCResult {\n constructor(reqMsgId, body, error) {\n this.CONSTRUCTOR_ID = 0xf35c6d01;\n this.reqMsgId = reqMsgId;\n this.body = body;\n this.error = error;\n this.classType = "constructor";\n }\n\n static async fromReader(reader) {\n const msgId = reader.readLong();\n const innerCode = reader.readInt(false);\n\n if (innerCode === api_1.Api.RpcError.CONSTRUCTOR_ID) {\n return new RPCResult(msgId, undefined, api_1.Api.RpcError.fromReader(reader));\n }\n\n if (innerCode === _1.GZIPPacked.CONSTRUCTOR_ID) {\n return new RPCResult(msgId, (await _1.GZIPPacked.fromReader(reader)).data);\n }\n\n reader.seek(-4); // This reader.read() will read more than necessary, but it\'s okay.\n // We could make use of MessageContainer\'s length here, but since\n // it\'s not necessary we don\'t need to care about it.\n\n return new RPCResult(msgId, reader.read(), undefined);\n }\n\n}\n\nexports.RPCResult = RPCResult;\nRPCResult.CONSTRUCTOR_ID = 0xf35c6d01;\nRPCResult.classType = "constructor";\n\n//# sourceURL=webpack://telegram/./browser/tl/core/RPCResult.js?')},"./browser/tl/core/TLMessage.js":
|
|||
|
/*!**************************************!*\
|
|||
|
!*** ./browser/tl/core/TLMessage.js ***!
|
|||
|
\**************************************/(__unused_webpack_module,exports)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.TLMessage = void 0;\n\nclass TLMessage {\n constructor(msgId, seqNo, obj) {\n this.msgId = msgId;\n this.seqNo = seqNo;\n this.obj = obj;\n this.classType = "constructor";\n }\n\n}\n\nexports.TLMessage = TLMessage;\nTLMessage.SIZE_OVERHEAD = 12;\nTLMessage.classType = "constructor";\n\n//# sourceURL=webpack://telegram/./browser/tl/core/TLMessage.js?')},"./browser/tl/core/index.js":
|
|||
|
/*!**********************************!*\
|
|||
|
!*** ./browser/tl/core/index.js ***!
|
|||
|
\**********************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.GZIPPacked = exports.MessageContainer = exports.TLMessage = exports.RPCResult = exports.coreObjects = void 0;\n\nconst TLMessage_1 = __webpack_require__(/*! ./TLMessage */ "./browser/tl/core/TLMessage.js");\n\nObject.defineProperty(exports, "TLMessage", ({\n enumerable: true,\n get: function () {\n return TLMessage_1.TLMessage;\n }\n}));\n\nconst RPCResult_1 = __webpack_require__(/*! ./RPCResult */ "./browser/tl/core/RPCResult.js");\n\nObject.defineProperty(exports, "RPCResult", ({\n enumerable: true,\n get: function () {\n return RPCResult_1.RPCResult;\n }\n}));\n\nconst MessageContainer_1 = __webpack_require__(/*! ./MessageContainer */ "./browser/tl/core/MessageContainer.js");\n\nObject.defineProperty(exports, "MessageContainer", ({\n enumerable: true,\n get: function () {\n return MessageContainer_1.MessageContainer;\n }\n}));\n\nconst GZIPPacked_1 = __webpack_require__(/*! ./GZIPPacked */ "./browser/tl/core/GZIPPacked.js");\n\nObject.defineProperty(exports, "GZIPPacked", ({\n enumerable: true,\n get: function () {\n return GZIPPacked_1.GZIPPacked;\n }\n}));\nexports.coreObjects = new Map([[RPCResult_1.RPCResult.CONSTRUCTOR_ID, RPCResult_1.RPCResult], [GZIPPacked_1.GZIPPacked.CONSTRUCTOR_ID, GZIPPacked_1.GZIPPacked], [MessageContainer_1.MessageContainer.CONSTRUCTOR_ID, MessageContainer_1.MessageContainer]]);\n\n//# sourceURL=webpack://telegram/./browser/tl/core/index.js?')},"./browser/tl/custom/button.js":
|
|||
|
/*!*************************************!*\
|
|||
|
!*** ./browser/tl/custom/button.js ***!
|
|||
|
\*************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.Button = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst api_1 = __webpack_require__(/*! ../api */ "./browser/tl/api.js");\n\nconst __1 = __webpack_require__(/*! ../../ */ "./browser/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst inspect_1 = __webpack_require__(/*! ../../inspect */ "./browser/inspect.js");\n\nclass Button {\n constructor(button, resize, singleUse, selective) {\n this.button = button;\n this.resize = resize;\n this.singleUse = singleUse;\n this.selective = selective;\n }\n\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n static _isInline(button) {\n return button instanceof api_1.Api.KeyboardButtonCallback || button instanceof api_1.Api.KeyboardButtonSwitchInline || button instanceof api_1.Api.KeyboardButtonUrl || button instanceof api_1.Api.KeyboardButtonUrlAuth || button instanceof api_1.Api.InputKeyboardButtonUrlAuth;\n }\n\n static inline(text, data) {\n if (!data) {\n data = buffer_1.Buffer.from(text, "utf-8");\n }\n\n if (data.length > 64) {\n throw new Error("Too many bytes for the data");\n }\n\n return new api_1.Api.KeyboardButtonCallback({\n text: text,\n data: data\n });\n }\n\n static switchInline(text, query = "", samePeer = false) {\n return new api_1.Api.KeyboardButtonSwitchInline({\n text,\n query,\n samePeer\n });\n }\n\n static url(text, url) {\n return new api_1.Api.KeyboardButtonUrl({\n text: text,\n url: url || text\n });\n }\n\n static auth(text, url, bot, writeAccess, fwdText) {\n return new api_1.Api.InputKeyboardButtonUrlAuth({\n text,\n url: url || text,\n bot: __1.utils.getInputUser(bot || new api_1.Api.InputUserSelf()),\n requestWriteAccess: writeAccess,\n fwdText: fwdText\n });\n }\n\n static text(text, resize, singleUse, selective) {\n return new this(new api_1.Api.KeyboardButton({\n text\n }), resize, singleUse, selective);\n }\n\n static requestLocation(text, resize, singleUse, selective) {\n return new this(new api_1.Api.KeyboardButtonRequestGeoLocation({\n text\n }), resize, singleUse, selective);\n }\n\n static requestPhone(text, resize, singleUse, selective) {\n return new this(new api_1.Api.KeyboardButtonRequestPhone({\n text\n }), resize, singleUse, selective);\n }\n\n static requestPoll(text, resize, singleUse, selective) {\n return new this(new api_1.Api.KeyboardButtonRequestPoll({\n text\n }), resize, singleUse, selective);\n }\n\n static clear() {\n return new api_1.Api.ReplyKeyboardHide({});\n }\n\n static forceReply() {\n return new api_1.Api.ReplyKeyboardForceReply({});\n }\n\n}\n\nexports.Button = Button;\n\n//# sourceURL=webpack://telegram/./browser/tl/custom/button.js?')},"./browser/tl/custom/chatGetter.js":
|
|||
|
/*!*****************************************!*\
|
|||
|
!*** ./browser/tl/custom/chatGetter.js ***!
|
|||
|
\*****************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __asyncValues = this && this.__asyncValues || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");\n var m = o[Symbol.asyncIterator],\n i;\n return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i);\n\n function verb(n) {\n i[n] = o[n] && function (v) {\n return new Promise(function (resolve, reject) {\n v = o[n](v), settle(resolve, reject, v.done, v.value);\n });\n };\n }\n\n function settle(resolve, reject, d, v) {\n Promise.resolve(v).then(function (v) {\n resolve({\n value: v,\n done: d\n });\n }, reject);\n }\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ChatGetter = void 0;\n\nconst __1 = __webpack_require__(/*! ../../ */ "./browser/index.js");\n\nconst api_1 = __webpack_require__(/*! ../api */ "./browser/tl/api.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst inspect_1 = __webpack_require__(/*! ../../inspect */ "./browser/inspect.js");\n\nclass ChatGetter {\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n static initChatClass(c, {\n chatPeer,\n inputChat,\n chat,\n broadcast\n }) {\n c._chatPeer = chatPeer;\n c._inputChat = inputChat;\n c._chat = chat;\n c._broadcast = broadcast;\n c._client = undefined;\n }\n\n get chat() {\n return this._chat;\n }\n\n async getChat() {\n var _a;\n\n if (!this._chat || "min" in this._chat && (await this.getInputChat())) {\n try {\n if (this._inputChat) {\n this._chat = await ((_a = this._client) === null || _a === void 0 ? void 0 : _a.getEntity(this._inputChat));\n }\n } catch (e) {\n await this._refetchChat();\n }\n }\n\n return this._chat;\n }\n\n get inputChat() {\n if (!this._inputChat && this._chatPeer && this._client) {\n try {\n this._inputChat = this._client._entityCache.get(__1.utils.getPeerId(this._chatPeer));\n } catch (e) {}\n }\n\n return this._inputChat;\n }\n\n async getInputChat() {\n var e_1, _a;\n\n if (!this.inputChat && this.chatId && this._client) {\n try {\n const target = this.chatId;\n\n try {\n for (var _b = __asyncValues(this._client.iterDialogs({\n limit: 100\n })), _c; _c = await _b.next(), !_c.done;) {\n const dialog = _c.value;\n\n if (dialog.id.eq(target)) {\n this._chat = dialog.entity;\n this._inputChat = dialog.inputEntity;\n break;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) await _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n } catch (e) {// do nothing\n }\n\n return this._inputChat;\n }\n\n return this._inputChat;\n }\n\n get chatId() {\n return this._chatPeer ? (0, Helpers_1.returnBigInt)(__1.utils.getPeerId(this._chatPeer)) : undefined;\n }\n\n get isPrivate() {\n return this._chatPeer ? this._chatPeer instanceof api_1.Api.PeerUser : undefined;\n }\n\n get isGroup() {\n if (!this._broadcast && this.chat && "broadcast" in this.chat) {\n this._broadcast = Boolean(this.chat.broadcast);\n }\n\n if (this._chatPeer instanceof api_1.Api.PeerChannel) {\n if (this._broadcast === undefined) {\n return undefined;\n } else {\n return !this._broadcast;\n }\n }\n\n return this._chatPeer instanceof api_1.Api.PeerChat;\n }\n\n get isChannel() {\n return this._chatPeer instanceof api_1.Api.
|
|||
|
/*!*************************************!*\
|
|||
|
!*** ./browser/tl/custom/dialog.js ***!
|
|||
|
\*************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.Dialog = void 0;\n\nconst api_1 = __webpack_require__(/*! ../api */ "./browser/tl/api.js");\n\nconst Utils_1 = __webpack_require__(/*! ../../Utils */ "./browser/Utils.js");\n\nconst draft_1 = __webpack_require__(/*! ./draft */ "./browser/tl/custom/draft.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst inspect_1 = __webpack_require__(/*! ../../inspect */ "./browser/inspect.js");\n\nclass Dialog {\n constructor(client, dialog, entities, message) {\n this._client = client;\n this.dialog = dialog;\n this.pinned = !!dialog.pinned;\n this.folderId = dialog.folderId;\n this.archived = dialog.folderId != undefined;\n this.message = message;\n this.date = this.message.date;\n this.entity = entities.get((0, Utils_1.getPeerId)(dialog.peer));\n this.inputEntity = (0, Utils_1.getInputPeer)(this.entity);\n\n if (this.entity) {\n this.id = (0, Helpers_1.returnBigInt)((0, Utils_1.getPeerId)(this.entity)); // ^ May be InputPeerSelf();\n\n this.name = this.title = (0, Utils_1.getDisplayName)(this.entity);\n }\n\n this.unreadCount = dialog.unreadCount;\n this.unreadMentionsCount = dialog.unreadMentionsCount;\n\n if (!this.entity) {\n throw new Error("Entity not found for dialog");\n }\n\n this.draft = new draft_1.Draft(client, this.entity, this.dialog.draft);\n this.isUser = this.entity instanceof api_1.Api.User;\n this.isGroup = !!(this.entity instanceof api_1.Api.Chat || this.entity instanceof api_1.Api.ChatForbidden || this.entity instanceof api_1.Api.Channel && this.entity.megagroup);\n this.isChannel = this.entity instanceof api_1.Api.Channel;\n }\n\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n}\n\nexports.Dialog = Dialog;\n\n//# sourceURL=webpack://telegram/./browser/tl/custom/dialog.js?')},"./browser/tl/custom/draft.js":
|
|||
|
/*!************************************!*\
|
|||
|
!*** ./browser/tl/custom/draft.js ***!
|
|||
|
\************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.Draft = void 0;\n\nconst Utils_1 = __webpack_require__(/*! ../../Utils */ "./browser/Utils.js");\n\nconst api_1 = __webpack_require__(/*! ../api */ "./browser/tl/api.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst inspect_1 = __webpack_require__(/*! ../../inspect */ "./browser/inspect.js");\n\nclass Draft {\n constructor(client, entity, draft) {\n this._client = client;\n this._peer = (0, Utils_1.getPeer)(entity);\n this._entity = entity;\n this._inputEntity = entity ? (0, Utils_1.getInputPeer)(entity) : undefined;\n\n if (!draft || !(draft instanceof api_1.Api.DraftMessage)) {\n draft = new api_1.Api.DraftMessage({\n message: "",\n date: -1\n });\n }\n\n if (!(draft instanceof api_1.Api.DraftMessageEmpty)) {\n this.linkPreview = !draft.noWebpage;\n this._text = client.parseMode ? client.parseMode.unparse(draft.message, draft.entities || []) : draft.message;\n this._rawText = draft.message;\n this.date = draft.date;\n this.replyToMsgId = draft.replyToMsgId;\n }\n }\n\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n get entity() {\n return this._entity;\n }\n\n get inputEntity() {\n if (!this._inputEntity) {\n this._inputEntity = this._client._entityCache.get(this._peer);\n }\n\n return this._inputEntity;\n }\n\n}\n\nexports.Draft = Draft;\n\n//# sourceURL=webpack://telegram/./browser/tl/custom/draft.js?')},"./browser/tl/custom/file.js":
|
|||
|
/*!***********************************!*\
|
|||
|
!*** ./browser/tl/custom/file.js ***!
|
|||
|
\***********************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.File = void 0;\n\nconst api_1 = __webpack_require__(/*! ../api */ "./browser/tl/api.js");\n\nconst Utils_1 = __webpack_require__(/*! ../../Utils */ "./browser/Utils.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst inspect_1 = __webpack_require__(/*! ../../inspect */ "./browser/inspect.js");\n\nclass File {\n constructor(media) {\n this.media = media;\n }\n\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n get id() {\n throw new Error("Unsupported");\n }\n\n get name() {\n return this._fromAttr(api_1.Api.DocumentAttributeFilename, "fileName");\n }\n\n get mimeType() {\n if (this.media instanceof api_1.Api.Photo) {\n return "image/jpeg";\n } else if (this.media instanceof api_1.Api.Document) {\n return this.media.mimeType;\n }\n }\n\n get width() {\n return this._fromAttr([api_1.Api.DocumentAttributeImageSize, api_1.Api.DocumentAttributeVideo], "w");\n }\n\n get height() {\n return this._fromAttr([api_1.Api.DocumentAttributeImageSize, api_1.Api.DocumentAttributeVideo], "h");\n }\n\n get duration() {\n return this._fromAttr([api_1.Api.DocumentAttributeAudio, api_1.Api.DocumentAttributeVideo], "duration");\n }\n\n get title() {\n return this._fromAttr(api_1.Api.DocumentAttributeAudio, "title");\n }\n\n get performer() {\n return this._fromAttr(api_1.Api.DocumentAttributeAudio, "performer");\n }\n\n get emoji() {\n return this._fromAttr(api_1.Api.DocumentAttributeSticker, "alt");\n }\n\n get stickerSet() {\n return this._fromAttr(api_1.Api.DocumentAttributeSticker, "stickerset");\n }\n\n get size() {\n if (this.media instanceof api_1.Api.Photo) {\n return (0, Utils_1._photoSizeByteCount)(this.media.sizes[-1]);\n } else if (this.media instanceof api_1.Api.Document) {\n return this.media.size;\n }\n }\n\n _fromAttr(cls, field) {\n if (this.media instanceof api_1.Api.Document) {\n for (const attr of this.media.attributes) {\n if (attr instanceof cls) {\n return attr[field];\n }\n }\n }\n }\n\n}\n\nexports.File = File;\n\n//# sourceURL=webpack://telegram/./browser/tl/custom/file.js?')},"./browser/tl/custom/forward.js":
|
|||
|
/*!**************************************!*\
|
|||
|
!*** ./browser/tl/custom/forward.js ***!
|
|||
|
\**************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.Forward = void 0;\n\nconst chatGetter_1 = __webpack_require__(/*! ./chatGetter */ "./browser/tl/custom/chatGetter.js");\n\nconst senderGetter_1 = __webpack_require__(/*! ./senderGetter */ "./browser/tl/custom/senderGetter.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst Utils_1 = __webpack_require__(/*! ../../Utils */ "./browser/Utils.js");\n\nconst inspect_1 = __webpack_require__(/*! ../../inspect */ "./browser/inspect.js");\n\nclass Forward extends senderGetter_1.SenderGetter {\n constructor(client, original, entities) {\n super(); // contains info for the original header sent by telegram.\n\n this.originalFwd = original;\n let senderId = undefined;\n let sender = undefined;\n let inputSender = undefined;\n let peer = undefined;\n let chat = undefined;\n let inputChat = undefined;\n\n if (original.fromId) {\n const ty = (0, Helpers_1._entityType)(original.fromId);\n\n if (ty === Helpers_1._EntityType.USER) {\n senderId = (0, Utils_1.getPeerId)(original.fromId);\n [sender, inputSender] = (0, Utils_1._getEntityPair)(senderId, entities, client._entityCache);\n } else if (ty === Helpers_1._EntityType.CHANNEL || ty === Helpers_1._EntityType.CHAT) {\n peer = original.fromId;\n [chat, inputChat] = (0, Utils_1._getEntityPair)((0, Utils_1.getPeerId)(peer), entities, client._entityCache);\n }\n }\n\n chatGetter_1.ChatGetter.initChatClass(this, {\n chatPeer: peer,\n inputChat: inputChat\n });\n senderGetter_1.SenderGetter.initSenderClass(this, {\n senderId: senderId ? (0, Helpers_1.returnBigInt)(senderId) : undefined,\n sender: sender,\n inputSender: inputSender\n });\n this._client = client;\n }\n\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n}\n\nexports.Forward = Forward;\n\n//# sourceURL=webpack://telegram/./browser/tl/custom/forward.js?')},"./browser/tl/custom/index.js":
|
|||
|
/*!************************************!*\
|
|||
|
!*** ./browser/tl/custom/index.js ***!
|
|||
|
\************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.ChatGetter = void 0;\n\nvar chatGetter_1 = __webpack_require__(/*! ./chatGetter */ "./browser/tl/custom/chatGetter.js");\n\nObject.defineProperty(exports, "ChatGetter", ({\n enumerable: true,\n get: function () {\n return chatGetter_1.ChatGetter;\n }\n}));\n\n//# sourceURL=webpack://telegram/./browser/tl/custom/index.js?')},"./browser/tl/custom/inlineResult.js":
|
|||
|
/*!*******************************************!*\
|
|||
|
!*** ./browser/tl/custom/inlineResult.js ***!
|
|||
|
\*******************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.InlineResult = void 0;\n\nconst api_1 = __webpack_require__(/*! ../api */ "./browser/tl/api.js");\n\nconst __1 = __webpack_require__(/*! ../../ */ "./browser/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst inspect_1 = __webpack_require__(/*! ../../inspect */ "./browser/inspect.js");\n\nclass InlineResult {\n constructor(client, original, queryId, entity) {\n this._ARTICLE = "article";\n this._PHOTO = "photo";\n this._GIF = "gif";\n this._VIDEO = "video";\n this._VIDEO_GIF = "mpeg4_gif";\n this._AUDIO = "audio";\n this._DOCUMENT = "document";\n this._LOCATION = "location";\n this._VENUE = "venue";\n this._CONTACT = "contact";\n this._GAME = "game";\n this._client = client;\n this.result = original;\n this._queryId = queryId;\n this._entity = entity;\n }\n\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n get type() {\n return this.result.type;\n }\n\n get message() {\n return this.result.sendMessage;\n }\n\n get description() {\n return this.result.description;\n }\n\n get url() {\n if (this.result instanceof api_1.Api.BotInlineResult) {\n return this.result.url;\n }\n }\n\n get photo() {\n if (this.result instanceof api_1.Api.BotInlineResult) {\n return this.result.thumb;\n } else {\n return this.result.photo;\n }\n }\n\n get document() {\n if (this.result instanceof api_1.Api.BotInlineResult) {\n return this.result.content;\n } else {\n return this.result.document;\n }\n }\n\n async click(entity, replyTo, silent = false, clearDraft = false, hideVia = false) {\n if (entity) {\n entity = await this._client.getInputEntity(entity);\n } else if (this._entity) {\n entity = this._entity;\n } else {\n throw new Error("You must provide the entity where the result should be sent to");\n }\n\n const replyId = replyTo ? __1.utils.getMessageId(replyTo) : undefined;\n const request = new api_1.Api.messages.SendInlineBotResult({\n peer: entity,\n queryId: this._queryId,\n id: this.result.id,\n silent: silent,\n clearDraft: clearDraft,\n hideVia: hideVia,\n replyToMsgId: replyId\n });\n return await this._client.invoke(request);\n }\n\n}\n\nexports.InlineResult = InlineResult;\n\n//# sourceURL=webpack://telegram/./browser/tl/custom/inlineResult.js?')},"./browser/tl/custom/inlineResults.js":
|
|||
|
/*!********************************************!*\
|
|||
|
!*** ./browser/tl/custom/inlineResults.js ***!
|
|||
|
\********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.InlineResults = void 0;\n\nconst inlineResult_1 = __webpack_require__(/*! ./inlineResult */ "./browser/tl/custom/inlineResult.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst inspect_1 = __webpack_require__(/*! ../../inspect */ "./browser/inspect.js");\n\nclass InlineResults extends Array {\n constructor(client, original, entity) {\n super(...original.results.map(res => new inlineResult_1.InlineResult(client, res, original.queryId, entity)));\n this.result = original;\n this.queryId = original.queryId;\n this.cacheTime = original.cacheTime;\n this._validUntil = new Date().getTime() / 1000 + this.cacheTime;\n this.users = original.users;\n this.gallery = Boolean(original.gallery);\n this.nextOffset = original.nextOffset;\n this.switchPm = original.switchPm;\n }\n\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n resultsValid() {\n return new Date().getTime() / 1000 < this._validUntil;\n }\n\n}\n\nexports.InlineResults = InlineResults;\n\n//# sourceURL=webpack://telegram/./browser/tl/custom/inlineResults.js?')},"./browser/tl/custom/message.js":
|
|||
|
/*!**************************************!*\
|
|||
|
!*** ./browser/tl/custom/message.js ***!
|
|||
|
\**************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\n\nvar __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, {\n enumerable: true,\n get: function () {\n return m[k];\n }\n });\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nvar __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {\n Object.defineProperty(o, "default", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o["default"] = v;\n});\n\nvar __importStar = this && this.__importStar || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n\n __setModuleDefault(result, mod);\n\n return result;\n};\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.CustomMessage = void 0;\n\nconst senderGetter_1 = __webpack_require__(/*! ./senderGetter */ "./browser/tl/custom/senderGetter.js");\n\nconst api_1 = __webpack_require__(/*! ../api */ "./browser/tl/api.js");\n\nconst chatGetter_1 = __webpack_require__(/*! ./chatGetter */ "./browser/tl/custom/chatGetter.js");\n\nconst utils = __importStar(__webpack_require__(/*! ../../Utils */ "./browser/Utils.js"));\n\nconst forward_1 = __webpack_require__(/*! ./forward */ "./browser/tl/custom/forward.js");\n\nconst file_1 = __webpack_require__(/*! ./file */ "./browser/tl/custom/file.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst users_1 = __webpack_require__(/*! ../../client/users */ "./browser/client/users.js");\n\nconst Logger_1 = __webpack_require__(/*! ../../extensions/Logger */ "./browser/extensions/Logger.js");\n\nconst messageButton_1 = __webpack_require__(/*! ./messageButton */ "./browser/tl/custom/messageButton.js");\n\nconst inspect_1 = __webpack_require__(/*! ../../inspect */ "./browser/inspect.js");\n/**\n * This custom class aggregates both {@link Api.Message} and {@link Api.MessageService} to ease accessing their members.<br/>\n * <br/>\n * Remember that this class implements {@link ChatGetter} and {@link SenderGetter}<br/>\n * which means you have access to all their sender and chat properties and methods.\n */\n\n\nclass CustomMessage extends senderGetter_1.SenderGetter {\n constructor(args) {\n super();\n this.init(args);\n }\n\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n init({\n id,\n peerId = undefined,\n date = undefined,\n out = undefined,\n mentioned = undefined,\n mediaUnread = undefined,\n silent = undefined,\n post = undefined,\n fromId = undefined,\n replyTo = undefined,\n message = undefined,\n fwdFrom = undefined,\n viaBotId = undefined,\n media = undefined,\n replyMarkup = undefined,\n entities = undefined,\n views = undefined,\n editDate = undefined,\n postAuthor = undefined,\n groupedId = undefined,\n fromScheduled = undefined,\n legacy = undefined,\n editHide = undefined,\n pinned = undefined,\n restrictionReason = undefined,\n forwards = undefined,\n replies = undefined,\n action = undefined,\n reactions = undefined,\n noforwards = undefined,\n ttlPeriod = undefined,\n _entities = new Map()\n }) {\n if (!id) throw new Error("id is a required attribute for Message");\n let senderId = undefined;\n\n if (fromId) {\n senderId = utils.getPeerId(fromId);\n } else if (peerId) {\n if (post || !out && peerId instanceof api_1.Api.PeerUser) {\n senderId = utils.getPeerId(peerId);\n }\n } // Common properties to all messages\n\n\n this._entities = _entities;\n this.out = out;\n this.mentioned = mentioned;\n this.mediaUnread = mediaUnread;\n this.silent = silent;\n this.post
|
|||
|
/*!********************************************!*\
|
|||
|
!*** ./browser/tl/custom/messageButton.js ***!
|
|||
|
\********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.MessageButton = void 0;\n\nconst api_1 = __webpack_require__(/*! ../api */ "./browser/tl/api.js");\n\nconst button_1 = __webpack_require__(/*! ./button */ "./browser/tl/custom/button.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst Password_1 = __webpack_require__(/*! ../../Password */ "./browser/Password.js");\n\nconst inspect_1 = __webpack_require__(/*! ../../inspect */ "./browser/inspect.js");\n\nclass MessageButton {\n constructor(client, original, chat, bot, msgId) {\n this.button = original;\n this._bot = bot;\n this._chat = chat;\n this._msgId = msgId;\n this._client = client;\n }\n\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n get client() {\n return this._client;\n }\n\n get text() {\n return !(this.button instanceof button_1.Button) ? this.button.text : "";\n }\n\n get data() {\n if (this.button instanceof api_1.Api.KeyboardButtonCallback) {\n return this.button.data;\n }\n }\n\n get inlineQuery() {\n if (this.button instanceof api_1.Api.KeyboardButtonSwitchInline) {\n return this.button.query;\n }\n }\n\n get url() {\n if (this.button instanceof api_1.Api.KeyboardButtonUrl) {\n return this.button.url;\n }\n }\n /**\n * Emulates the behaviour of clicking this button.\n If it\'s a normal `KeyboardButton` with text, a message will be\n sent, and the sent `Message <Message>` returned.\n If it\'s an inline `KeyboardButtonCallback` with text and data,\n it will be "clicked" and the `BotCallbackAnswer` returned.\n If it\'s an inline `KeyboardButtonSwitchInline` button, the\n `StartBot` will be invoked and the resulting updates\n returned.\n If it\'s a `KeyboardButtonUrl`, the URL of the button will\n be returned.\n If it\'s a `KeyboardButtonRequestPhone`, you must indicate that you\n want to ``sharePhone=True`` in order to share it. Sharing it is not a\n default because it is a privacy concern and could happen accidentally.\n You may also use ``sharePhone=phone`` to share a specific number, in\n which case either `str` or `InputMediaContact` should be used.\n If it\'s a `KeyboardButtonRequestGeoLocation`, you must pass a\n tuple in ``shareGeo=[longitude, latitude]``. Note that Telegram seems\n to have some heuristics to determine impossible locations, so changing\n this value a lot quickly may not work as expected. You may also pass a\n `InputGeoPoint` if you find the order confusing.\n */\n\n\n async click({\n sharePhone = false,\n shareGeo = [0, 0],\n password\n }) {\n if (this.button instanceof api_1.Api.KeyboardButton) {\n return this._client.sendMessage(this._chat, {\n message: this.button.text,\n parseMode: undefined\n });\n } else if (this.button instanceof api_1.Api.KeyboardButtonCallback) {\n let encryptedPassword;\n\n if (password != undefined) {\n const pwd = await this.client.invoke(new api_1.Api.account.GetPassword());\n encryptedPassword = await (0, Password_1.computeCheck)(pwd, password);\n }\n\n const request = new api_1.Api.messages.GetBotCallbackAnswer({\n peer: this._chat,\n msgId: this._msgId,\n data: this.button.data,\n password: encryptedPassword\n });\n\n try {\n return await this._client.invoke(request);\n } catch (e) {\n if (e.errorMessage == "BOT_RESPONSE_TIMEOUT") {\n return null;\n }\n\n throw e;\n }\n } else if (this.button instanceof api_1.Api.KeyboardButtonSwitchInline) {\n return this._client.invoke(new api_1.Api.messages.StartBot({\n bot: this._bot,\n peer: this._chat,\n startParam: this.button.query\n }));\n } else if (this.button instanceof api_1.Api.KeyboardButtonUrl) {\n
|
|||
|
/*!*******************************************!*\
|
|||
|
!*** ./browser/tl/custom/senderGetter.js ***!
|
|||
|
\*******************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.SenderGetter = void 0;\n\nconst api_1 = __webpack_require__(/*! ../api */ "./browser/tl/api.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../../Helpers */ "./browser/Helpers.js");\n\nconst chatGetter_1 = __webpack_require__(/*! ./chatGetter */ "./browser/tl/custom/chatGetter.js");\n\nconst inspect_1 = __webpack_require__(/*! ../../inspect */ "./browser/inspect.js");\n\nclass SenderGetter extends chatGetter_1.ChatGetter {\n [inspect_1.inspect.custom]() {\n return (0, Helpers_1.betterConsoleLog)(this);\n }\n\n static initSenderClass(c, {\n senderId,\n sender,\n inputSender\n }) {\n c._senderId = senderId;\n c._sender = sender;\n c._inputSender = inputSender;\n c._client = undefined;\n }\n\n get sender() {\n return this._sender;\n }\n\n async getSender() {\n if (this._client && (!this._sender || this._sender instanceof api_1.Api.Channel && this._sender.min) && (await this.getInputSender())) {\n try {\n this._sender = await this._client.getEntity(this._inputSender);\n } catch (e) {\n await this._refetchSender();\n }\n }\n\n return this._sender;\n }\n\n get inputSender() {\n if (!this._inputSender && this._senderId && this._client) {\n try {\n this._inputSender = this._client._entityCache.get(this._senderId);\n } catch (e) {}\n }\n\n return this._inputSender;\n }\n\n async getInputSender() {\n if (!this.inputSender && this._senderId && this._client) {\n await this._refetchSender();\n }\n\n return this._inputSender;\n }\n\n get senderId() {\n return this._senderId;\n }\n\n async _refetchSender() {}\n\n}\n\nexports.SenderGetter = SenderGetter;\n\n//# sourceURL=webpack://telegram/./browser/tl/custom/senderGetter.js?')},"./browser/tl/generationHelpers.js":
|
|||
|
/*!*****************************************!*\
|
|||
|
!*** ./browser/tl/generationHelpers.js ***!
|
|||
|
\*****************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.variableSnakeToCamelCase = exports.snakeToCamelCase = exports.CORE_TYPES = exports.fromLine = exports.buildArgConfig = exports.parseTl = exports.findAll = exports.serializeDate = exports.serializeBytes = void 0;\n\nconst buffer_1 = __webpack_require__(/*! buffer/ */ "./node_modules/buffer/index.js");\n\nconst Helpers_1 = __webpack_require__(/*! ../Helpers */ "./browser/Helpers.js");\n\nconst snakeToCamelCase = name => {\n const result = name.replace(/(?:^|_)([a-z])/g, (_, g) => g.toUpperCase());\n return result.replace(/_/g, "");\n};\n\nexports.snakeToCamelCase = snakeToCamelCase;\n\nconst variableSnakeToCamelCase = str => str.replace(/([-_][a-z])/g, group => group.toUpperCase().replace("-", "").replace("_", ""));\n\nexports.variableSnakeToCamelCase = variableSnakeToCamelCase;\nconst CORE_TYPES = new Set([0xbc799737, 0x997275b5, 0x3fedd339, 0xc4b9f9bb, 0x56730bcc // null#56730bcc = Null;\n]);\nexports.CORE_TYPES = CORE_TYPES;\nconst AUTH_KEY_TYPES = new Set([0x05162463, 0x83c95aec, 0xa9f55f95, 0x3c6a84d4, 0x56fddf88, 0xd0e8075c, 0xb5890dba, 0x6643b654, 0xd712e4be, 0xf5045f1f, 0x3072cfa1 // gzip_packed\n]);\n\nconst fromLine = (line, isFunction) => {\n const match = line.match(/([\\w.]+)(?:#([0-9a-fA-F]+))?(?:\\s{?\\w+:[\\w\\d<>#.?!]+}?)*\\s=\\s([\\w\\d<>#.?]+);$/);\n\n if (!match) {\n // Probably "vector#1cb5c415 {t:Type} # [ t ] = Vector t;"\n throw new Error(`Cannot parse TLObject ${line}`);\n }\n\n const argsMatch = findAll(/({)?(\\w+):([\\w\\d<>#.?!]+)}?/, line);\n const currentConfig = {\n name: match[1],\n constructorId: parseInt(match[2], 16),\n argsConfig: {},\n subclassOfId: (0, Helpers_1.crc32)(match[3]),\n result: match[3],\n isFunction: isFunction,\n namespace: undefined\n };\n\n if (!currentConfig.constructorId) {\n const hexId = "";\n let args;\n\n if (Object.values(currentConfig.argsConfig).length) {\n args = ` ${Object.keys(currentConfig.argsConfig).map(arg => arg.toString()).join(" ")}`;\n } else {\n args = "";\n }\n\n const representation = `${currentConfig.name}${hexId}${args} = ${currentConfig.result}`.replace(/(:|\\?)bytes /g, "$1string ").replace(/</g, " ").replace(/>|{|}/g, "").replace(/ \\w+:flags(\\d+)?\\.\\d+\\?true/g, "");\n\n if (currentConfig.name === "inputMediaInvoice") {\n // eslint-disable-next-line no-empty\n if (currentConfig.name === "inputMediaInvoice") {}\n }\n\n currentConfig.constructorId = (0, Helpers_1.crc32)(buffer_1.Buffer.from(representation, "utf8"));\n }\n\n for (const [brace, name, argType] of argsMatch) {\n if (brace === undefined) {\n // @ts-ignore\n currentConfig.argsConfig[variableSnakeToCamelCase(name)] = buildArgConfig(name, argType);\n }\n }\n\n if (currentConfig.name.includes(".")) {\n [currentConfig.namespace, currentConfig.name] = currentConfig.name.split(/\\.(.+)/);\n }\n\n currentConfig.name = snakeToCamelCase(currentConfig.name);\n /*\n for (const arg in currentConfig.argsConfig){\n if (currentConfig.argsConfig.hasOwnProperty(arg)){\n if (currentConfig.argsConfig[arg].flagIndicator){\n delete currentConfig.argsConfig[arg]\n }\n }\n }*/\n\n return currentConfig;\n};\n\nexports.fromLine = fromLine;\n\nfunction buildArgConfig(name, argType) {\n name = name === "self" ? "is_self" : name; // Default values\n\n const currentConfig = {\n isVector: false,\n isFlag: false,\n skipConstructorId: false,\n flagName: null,\n flagIndex: -1,\n flagIndicator: true,\n type: null,\n useVectorId: null\n }; // Special case: some types can be inferred, which makes it\n // less annoying to type. Currently the only type that can\n // be inferred is if the name is \'random_id\', to which a\n // random ID will be assigned if left as None (the default)\n\n const canBeInferred = name === "random_id"; // The type can be an ind
|
|||
|
/*!*****************************!*\
|
|||
|
!*** ./browser/tl/index.js ***!
|
|||
|
\*****************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.serializeDate = exports.serializeBytes = exports.Api = void 0;\n\nconst api_1 = __webpack_require__(/*! ./api */ "./browser/tl/api.js");\n\nObject.defineProperty(exports, "Api", ({\n enumerable: true,\n get: function () {\n return api_1.Api;\n }\n}));\n\nconst patched_1 = __webpack_require__(/*! ./patched */ "./browser/tl/patched/index.js");\n\n(0, patched_1.patchAll)();\n\nvar generationHelpers_1 = __webpack_require__(/*! ./generationHelpers */ "./browser/tl/generationHelpers.js");\n\nObject.defineProperty(exports, "serializeBytes", ({\n enumerable: true,\n get: function () {\n return generationHelpers_1.serializeBytes;\n }\n}));\nObject.defineProperty(exports, "serializeDate", ({\n enumerable: true,\n get: function () {\n return generationHelpers_1.serializeDate;\n }\n}));\n\n//# sourceURL=webpack://telegram/./browser/tl/index.js?')},"./browser/tl/patched/index.js":
|
|||
|
/*!*************************************!*\
|
|||
|
!*** ./browser/tl/patched/index.js ***!
|
|||
|
\*************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", ({\n value: true\n}));\nexports.patchAll = void 0;\n\nconst api_1 = __webpack_require__(/*! ../api */ "./browser/tl/api.js");\n\nconst message_1 = __webpack_require__(/*! ../custom/message */ "./browser/tl/custom/message.js");\n\nfunction getGetter(obj, prop) {\n while (obj) {\n let getter = Object.getOwnPropertyDescriptor(obj, prop);\n\n if (getter && getter.get) {\n return getter.get;\n }\n\n obj = Object.getPrototypeOf(obj);\n }\n}\n\nfunction getSetter(obj, prop) {\n while (obj) {\n let getter = Object.getOwnPropertyDescriptor(obj, prop);\n\n if (getter && getter.set) {\n return getter.set;\n }\n\n obj = Object.getPrototypeOf(obj);\n }\n}\n\nconst getInstanceMethods = obj => {\n let keys = {\n methods: new Set(),\n setters: new Set(),\n getters: new Set()\n };\n let topObject = obj;\n\n const mapAllMethods = property => {\n const getter = getGetter(topObject, property);\n const setter = getSetter(topObject, property);\n\n if (getter) {\n keys["getters"].add(property);\n } else if (setter) {\n keys["setters"].add(property);\n } else {\n if (!(property == "constructor")) {\n keys["methods"].add(property);\n }\n }\n };\n\n do {\n Object.getOwnPropertyNames(obj).map(mapAllMethods); // walk-up the prototype chain\n\n obj = Object.getPrototypeOf(obj);\n } while ( // not the the Object prototype methods (hasOwnProperty, etc...)\n obj && Object.getPrototypeOf(obj));\n\n return keys;\n};\n\nfunction patchClass(clazz) {\n const {\n getters,\n setters,\n methods\n } = getInstanceMethods(message_1.CustomMessage.prototype);\n\n for (const getter of getters) {\n Object.defineProperty(clazz.prototype, getter, {\n get: getGetter(message_1.CustomMessage.prototype, getter)\n });\n }\n\n for (const setter of setters) {\n Object.defineProperty(clazz.prototype, setter, {\n set: getSetter(message_1.CustomMessage.prototype, setter)\n });\n }\n\n for (const method of methods) {\n clazz.prototype[method] = message_1.CustomMessage.prototype[method];\n }\n}\n\nfunction patchAll() {\n patchClass(api_1.Api.Message);\n patchClass(api_1.Api.MessageService);\n}\n\nexports.patchAll = patchAll;\n\n//# sourceURL=webpack://telegram/./browser/tl/patched/index.js?')},"./browser/tl/schemaTl.js":
|
|||
|
/*!********************************!*\
|
|||
|
!*** ./browser/tl/schemaTl.js ***!
|
|||
|
\********************************/module=>{"use strict";eval("\n\nmodule.exports = `\nresPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector<long> = ResPQ;\np_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data;\np_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;\np_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data;\np_q_inner_data_temp_dc#56fddf88 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int expires_in:int = P_Q_inner_data;\nbind_auth_key_inner#75a3f765 nonce:long temp_auth_key_id:long perm_auth_key_id:long temp_session_id:long expires_at:int = BindAuthKeyInner;\nserver_DH_params_fail#79cb045d nonce:int128 server_nonce:int128 new_nonce_hash:int128 = Server_DH_Params;\nserver_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;\nserver_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;\nclient_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data;\ndh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer;\ndh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer;\ndh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;\ndestroy_auth_key_ok#f660e1d4 = DestroyAuthKeyRes;\ndestroy_auth_key_none#0a9f2259 = DestroyAuthKeyRes;\ndestroy_auth_key_fail#ea109b13 = DestroyAuthKeyRes;\n---functions---\nreq_pq#60469778 nonce:int128 = ResPQ;\nreq_pq_multi#be7e8ef1 nonce:int128 = ResPQ;\nreq_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params;\nset_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;\ndestroy_auth_key#d1435160 = DestroyAuthKeyRes;\n---types---\nmsgs_ack#62d6b459 msg_ids:Vector<long> = MsgsAck;\nbad_msg_notification#a7eff811 bad_msg_id:long bad_msg_seqno:int error_code:int = BadMsgNotification;\nbad_server_salt#edab447b bad_msg_id:long bad_msg_seqno:int error_code:int new_server_salt:long = BadMsgNotification;\nmsgs_state_req#da69fb52 msg_ids:Vector<long> = MsgsStateReq;\nmsgs_state_info#04deb57d req_msg_id:long info:string = MsgsStateInfo;\nmsgs_all_info#8cc0d131 msg_ids:Vector<long> info:string = MsgsAllInfo;\nmsg_detailed_info#276d3ec6 msg_id:long answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_new_detailed_info#809db6df answer_msg_id:long bytes:int status:int = MsgDetailedInfo;\nmsg_resend_req#7d861a08 msg_ids:Vector<long> = MsgResendReq;\nrpc_error#2144ca19 error_code:int error_message:string = RpcError;\nrpc_answer_unknown#5e2ad36e = RpcDropAnswer;\nrpc_answer_dropped_running#cd78e586 = RpcDropAnswer;\nrpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer;\nfuture_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;\nfuture_salts#ae500895 req_msg_id:long now:int salts:vector<future_salt> = FutureSalts;\npong#347773c5 msg_id:long ping_id:long = Pong;\ndestroy_session_ok#e22045fc session_id:long = DestroySessionRes;\ndestroy_session_none#62d350c9 session_id:long = DestroySessionRes;\nnew_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession;\nhttp_wait#9299359f max_delay:int wait_after:int max_wait:int = HttpWait;\nipPort#d433ad73 ipv4:int port:int = IpPort;\nipPortSecret#37982646 ipv4:int port:int secret:bytes = IpPort;\naccessPointRule#4679b65f phone_prefix_rules:string dc_id:int ips:vector<IpPort> = AccessPointRule;\nhelp.configSimple#5a592a6c date:int expires:int rules:vector<AccessPointRule> = help.ConfigSimple;\ntlsClientHello blocks:vector<TlsBlock>
|
|||
|
/*!*****************************************!*\
|
|||
|
!*** ./node_modules/base64-js/index.js ***!
|
|||
|
\*****************************************/(__unused_webpack_module,exports)=>{"use strict";eval("\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[
|
|||
|
/*!************************************************!*\
|
|||
|
!*** ./node_modules/big-integer/BigInteger.js ***!
|
|||
|
\************************************************/(module,exports,__webpack_require__)=>{eval('/* module decorator */ module = __webpack_require__.nmd(module);\nvar __WEBPACK_AMD_DEFINE_RESULT__;var bigInt = (function (undefined) {\r\n "use strict";\r\n\r\n var BASE = 1e7,\r\n LOG_BASE = 7,\r\n MAX_INT = 9007199254740992,\r\n MAX_INT_ARR = smallToArray(MAX_INT),\r\n DEFAULT_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";\r\n\r\n var supportsNativeBigInt = typeof BigInt === "function";\r\n\r\n function Integer(v, radix, alphabet, caseSensitive) {\r\n if (typeof v === "undefined") return Integer[0];\r\n if (typeof radix !== "undefined") return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);\r\n return parseValue(v);\r\n }\r\n\r\n function BigInteger(value, sign) {\r\n this.value = value;\r\n this.sign = sign;\r\n this.isSmall = false;\r\n }\r\n BigInteger.prototype = Object.create(Integer.prototype);\r\n\r\n function SmallInteger(value) {\r\n this.value = value;\r\n this.sign = value < 0;\r\n this.isSmall = true;\r\n }\r\n SmallInteger.prototype = Object.create(Integer.prototype);\r\n\r\n function NativeBigInt(value) {\r\n this.value = value;\r\n }\r\n NativeBigInt.prototype = Object.create(Integer.prototype);\r\n\r\n function isPrecise(n) {\r\n return -MAX_INT < n && n < MAX_INT;\r\n }\r\n\r\n function smallToArray(n) { // For performance reasons doesn\'t reference BASE, need to change this function if BASE changes\r\n if (n < 1e7)\r\n return [n];\r\n if (n < 1e14)\r\n return [n % 1e7, Math.floor(n / 1e7)];\r\n return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];\r\n }\r\n\r\n function arrayToSmall(arr) { // If BASE changes this function may need to change\r\n trim(arr);\r\n var length = arr.length;\r\n if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {\r\n switch (length) {\r\n case 0: return 0;\r\n case 1: return arr[0];\r\n case 2: return arr[0] + arr[1] * BASE;\r\n default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE;\r\n }\r\n }\r\n return arr;\r\n }\r\n\r\n function trim(v) {\r\n var i = v.length;\r\n while (v[--i] === 0);\r\n v.length = i + 1;\r\n }\r\n\r\n function createArray(length) { // function shamelessly stolen from Yaffle\'s library https://github.com/Yaffle/BigInteger\r\n var x = new Array(length);\r\n var i = -1;\r\n while (++i < length) {\r\n x[i] = 0;\r\n }\r\n return x;\r\n }\r\n\r\n function truncate(n) {\r\n if (n > 0) return Math.floor(n);\r\n return Math.ceil(n);\r\n }\r\n\r\n function add(a, b) { // assumes a and b are arrays with a.length >= b.length\r\n var l_a = a.length,\r\n l_b = b.length,\r\n r = new Array(l_a),\r\n carry = 0,\r\n base = BASE,\r\n sum, i;\r\n for (i = 0; i < l_b; i++) {\r\n sum = a[i] + b[i] + carry;\r\n carry = sum >= base ? 1 : 0;\r\n r[i] = sum - carry * base;\r\n }\r\n while (i < l_a) {\r\n sum = a[i] + carry;\r\n carry = sum === base ? 1 : 0;\r\n r[i++] = sum - carry * base;\r\n }\r\n if (carry > 0) r.push(carry);\r\n return r;\r\n }\r\n\r\n function addAny(a, b) {\r\n if (a.length >= b.length) return add(a, b);\r\n return add(b, a);\r\n }\r\n\r\n function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT\r\n var l = a.length,\r\n r = new Array(l),\r\n base = BASE,\r\n sum, i;\r\n for (i = 0; i < l; i++) {\r\n sum = a[i] - base + carry;\r\n carry = Math.floor(sum / base);\r\n
|
|||
|
/*!**************************************!*\
|
|||
|
!*** ./node_modules/buffer/index.js ***!
|
|||
|
\**************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval("/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n\n\nconst base64 = __webpack_require__(/*! base64-js */ \"./node_modules/base64-js/index.js\")\nconst ieee754 = __webpack_require__(/*! ieee754 */ \"./node_modules/ieee754/index.js\")\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument
|
|||
|
/*!*********************************************************!*\
|
|||
|
!*** ./node_modules/dom-serializer/lib/foreignNames.js ***!
|
|||
|
\*********************************************************/(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.attributeNames = exports.elementNames = void 0;\nexports.elementNames = new Map([\n ["altglyph", "altGlyph"],\n ["altglyphdef", "altGlyphDef"],\n ["altglyphitem", "altGlyphItem"],\n ["animatecolor", "animateColor"],\n ["animatemotion", "animateMotion"],\n ["animatetransform", "animateTransform"],\n ["clippath", "clipPath"],\n ["feblend", "feBlend"],\n ["fecolormatrix", "feColorMatrix"],\n ["fecomponenttransfer", "feComponentTransfer"],\n ["fecomposite", "feComposite"],\n ["feconvolvematrix", "feConvolveMatrix"],\n ["fediffuselighting", "feDiffuseLighting"],\n ["fedisplacementmap", "feDisplacementMap"],\n ["fedistantlight", "feDistantLight"],\n ["fedropshadow", "feDropShadow"],\n ["feflood", "feFlood"],\n ["fefunca", "feFuncA"],\n ["fefuncb", "feFuncB"],\n ["fefuncg", "feFuncG"],\n ["fefuncr", "feFuncR"],\n ["fegaussianblur", "feGaussianBlur"],\n ["feimage", "feImage"],\n ["femerge", "feMerge"],\n ["femergenode", "feMergeNode"],\n ["femorphology", "feMorphology"],\n ["feoffset", "feOffset"],\n ["fepointlight", "fePointLight"],\n ["fespecularlighting", "feSpecularLighting"],\n ["fespotlight", "feSpotLight"],\n ["fetile", "feTile"],\n ["feturbulence", "feTurbulence"],\n ["foreignobject", "foreignObject"],\n ["glyphref", "glyphRef"],\n ["lineargradient", "linearGradient"],\n ["radialgradient", "radialGradient"],\n ["textpath", "textPath"],\n]);\nexports.attributeNames = new Map([\n ["definitionurl", "definitionURL"],\n ["attributename", "attributeName"],\n ["attributetype", "attributeType"],\n ["basefrequency", "baseFrequency"],\n ["baseprofile", "baseProfile"],\n ["calcmode", "calcMode"],\n ["clippathunits", "clipPathUnits"],\n ["diffuseconstant", "diffuseConstant"],\n ["edgemode", "edgeMode"],\n ["filterunits", "filterUnits"],\n ["glyphref", "glyphRef"],\n ["gradienttransform", "gradientTransform"],\n ["gradientunits", "gradientUnits"],\n ["kernelmatrix", "kernelMatrix"],\n ["kernelunitlength", "kernelUnitLength"],\n ["keypoints", "keyPoints"],\n ["keysplines", "keySplines"],\n ["keytimes", "keyTimes"],\n ["lengthadjust", "lengthAdjust"],\n ["limitingconeangle", "limitingConeAngle"],\n ["markerheight", "markerHeight"],\n ["markerunits", "markerUnits"],\n ["markerwidth", "markerWidth"],\n ["maskcontentunits", "maskContentUnits"],\n ["maskunits", "maskUnits"],\n ["numoctaves", "numOctaves"],\n ["pathlength", "pathLength"],\n ["patterncontentunits", "patternContentUnits"],\n ["patterntransform", "patternTransform"],\n ["patternunits", "patternUnits"],\n ["pointsatx", "pointsAtX"],\n ["pointsaty", "pointsAtY"],\n ["pointsatz", "pointsAtZ"],\n ["preservealpha", "preserveAlpha"],\n ["preserveaspectratio", "preserveAspectRatio"],\n ["primitiveunits", "primitiveUnits"],\n ["refx", "refX"],\n ["refy", "refY"],\n ["repeatcount", "repeatCount"],\n ["repeatdur", "repeatDur"],\n ["requiredextensions", "requiredExtensions"],\n ["requiredfeatures", "requiredFeatures"],\n ["specularconstant", "specularConstant"],\n ["specularexponent", "specularExponent"],\n ["spreadmethod", "spreadMethod"],\n ["startoffset", "startOffset"],\n ["stddeviation", "stdDeviation"],\n ["stitchtiles", "stitchTiles"],\n ["surfacescale", "surfaceScale"],\n ["systemlanguage", "systemLanguage"],\n ["tablevalues", "tableValues"],\n ["targetx", "targetX"],\n ["targety", "targetY"],\n ["textlength", "textLength"],\n ["viewbox", "viewBox"],\n ["viewtarget", "viewTarget"],\n ["xchannelselector", "xChannelSelector"],\n ["ychannelselector", "yChannelSelector"],\n ["zoomandpan", "zoomAndPan"],\n]);\n\n\n//# sourceURL=webpack://telegram/./node_modules/dom-serializer/lib/foreignNames.js?')},"./node_modul
|
|||
|
/*!**************************************************!*\
|
|||
|
!*** ./node_modules/dom-serializer/lib/index.js ***!
|
|||
|
\**************************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, "default", { enumerable: true, value: v });\n}) : function(o, v) {\n o["default"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\n/*\n * Module dependencies\n */\nvar ElementType = __importStar(__webpack_require__(/*! domelementtype */ "./node_modules/domelementtype/lib/index.js"));\nvar entities_1 = __webpack_require__(/*! entities */ "./node_modules/entities/lib/index.js");\n/**\n * Mixed-case SVG and MathML tags & attributes\n * recognized by the HTML parser.\n *\n * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign\n */\nvar foreignNames_1 = __webpack_require__(/*! ./foreignNames */ "./node_modules/dom-serializer/lib/foreignNames.js");\nvar unencodedElements = new Set([\n "style",\n "script",\n "xmp",\n "iframe",\n "noembed",\n "noframes",\n "plaintext",\n "noscript",\n]);\n/**\n * Format attributes\n */\nfunction formatAttributes(attributes, opts) {\n if (!attributes)\n return;\n return Object.keys(attributes)\n .map(function (key) {\n var _a, _b;\n var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";\n if (opts.xmlMode === "foreign") {\n /* Fix up mixed-case attribute names */\n key = (_b = foreignNames_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;\n }\n if (!opts.emptyAttrs && !opts.xmlMode && value === "") {\n return key;\n }\n return key + "=\\"" + (opts.decodeEntities !== false\n ? entities_1.encodeXML(value)\n : value.replace(/"/g, """)) + "\\"";\n })\n .join(" ");\n}\n/**\n * Self-enclosing tags\n */\nvar singleTag = new Set([\n "area",\n "base",\n "basefont",\n "br",\n "col",\n "command",\n "embed",\n "frame",\n "hr",\n "img",\n "input",\n "isindex",\n "keygen",\n "link",\n "meta",\n "param",\n "source",\n "track",\n "wbr",\n]);\n/**\n * Renders a DOM node or an array of DOM nodes to a string.\n *\n * Can be thought of as the equivalent of the `outerHTML` of the passed node(s).\n *\n * @param node Node to be rendered.\n * @param options Changes serialization behavior\n */\nfunction render(node, options) {\n if (options === void 0) { options = {}; }\n var nodes = "length" in node ? node : [node];\n var output = "";\n for (var i = 0; i < nodes.length; i++) {\n output += renderNode(nodes[i], options);\n }\n return output;\n}\nexports["default"] = render;\nfunction renderNode(node, options) {\n switch (node.type) {\n case ElementType.Root:\n return render(node.children, options);\n case ElementType.Directive:\n case ElementType.Doctype:\n r
|
|||
|
/*!**************************************************!*\
|
|||
|
!*** ./node_modules/domelementtype/lib/index.js ***!
|
|||
|
\**************************************************/(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;\n/** Types of elements found in htmlparser2\'s DOM */\nvar ElementType;\n(function (ElementType) {\n /** Type for the root element of a document */\n ElementType["Root"] = "root";\n /** Type for Text */\n ElementType["Text"] = "text";\n /** Type for <? ... ?> */\n ElementType["Directive"] = "directive";\n /** Type for \x3c!-- ... --\x3e */\n ElementType["Comment"] = "comment";\n /** Type for <script> tags */\n ElementType["Script"] = "script";\n /** Type for <style> tags */\n ElementType["Style"] = "style";\n /** Type for Any tag */\n ElementType["Tag"] = "tag";\n /** Type for <![CDATA[ ... ]]> */\n ElementType["CDATA"] = "cdata";\n /** Type for <!doctype ...> */\n ElementType["Doctype"] = "doctype";\n})(ElementType = exports.ElementType || (exports.ElementType = {}));\n/**\n * Tests whether an element is a tag or not.\n *\n * @param elem Element to test\n */\nfunction isTag(elem) {\n return (elem.type === ElementType.Tag ||\n elem.type === ElementType.Script ||\n elem.type === ElementType.Style);\n}\nexports.isTag = isTag;\n// Exports for backwards compatibility\n/** Type for the root element of a document */\nexports.Root = ElementType.Root;\n/** Type for Text */\nexports.Text = ElementType.Text;\n/** Type for <? ... ?> */\nexports.Directive = ElementType.Directive;\n/** Type for \x3c!-- ... --\x3e */\nexports.Comment = ElementType.Comment;\n/** Type for <script> tags */\nexports.Script = ElementType.Script;\n/** Type for <style> tags */\nexports.Style = ElementType.Style;\n/** Type for Any tag */\nexports.Tag = ElementType.Tag;\n/** Type for <![CDATA[ ... ]]> */\nexports.CDATA = ElementType.CDATA;\n/** Type for <!doctype ...> */\nexports.Doctype = ElementType.Doctype;\n\n\n//# sourceURL=webpack://telegram/./node_modules/domelementtype/lib/index.js?')},"./node_modules/domhandler/lib/index.js":
|
|||
|
/*!**********************************************!*\
|
|||
|
!*** ./node_modules/domhandler/lib/index.js ***!
|
|||
|
\**********************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.DomHandler = void 0;\nvar domelementtype_1 = __webpack_require__(/*! domelementtype */ "./node_modules/domelementtype/lib/index.js");\nvar node_1 = __webpack_require__(/*! ./node */ "./node_modules/domhandler/lib/node.js");\n__exportStar(__webpack_require__(/*! ./node */ "./node_modules/domhandler/lib/node.js"), exports);\nvar reWhitespace = /\\s+/g;\n// Default options\nvar defaultOpts = {\n normalizeWhitespace: false,\n withStartIndices: false,\n withEndIndices: false,\n xmlMode: false,\n};\nvar DomHandler = /** @class */ (function () {\n /**\n * @param callback Called once parsing has completed.\n * @param options Settings for the handler.\n * @param elementCB Callback whenever a tag is closed.\n */\n function DomHandler(callback, options, elementCB) {\n /** The elements of the DOM */\n this.dom = [];\n /** The root element for the DOM */\n this.root = new node_1.Document(this.dom);\n /** Indicated whether parsing has been completed. */\n this.done = false;\n /** Stack of open tags. */\n this.tagStack = [this.root];\n /** A data node that is still being written to. */\n this.lastNode = null;\n /** Reference to the parser instance. Used for location information. */\n this.parser = null;\n // Make it possible to skip arguments, for backwards-compatibility\n if (typeof options === "function") {\n elementCB = options;\n options = defaultOpts;\n }\n if (typeof callback === "object") {\n options = callback;\n callback = undefined;\n }\n this.callback = callback !== null && callback !== void 0 ? callback : null;\n this.options = options !== null && options !== void 0 ? options : defaultOpts;\n this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;\n }\n DomHandler.prototype.onparserinit = function (parser) {\n this.parser = parser;\n };\n // Resets the handler back to starting state\n DomHandler.prototype.onreset = function () {\n this.dom = [];\n this.root = new node_1.Document(this.dom);\n this.done = false;\n this.tagStack = [this.root];\n this.lastNode = null;\n this.parser = null;\n };\n // Signals the handler that parsing is done\n DomHandler.prototype.onend = function () {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n };\n DomHandler.prototype.onerror = function (error) {\n this.handleCallback(error);\n };\n DomHandler.prototype.onclosetag = function () {\n this.lastNode = null;\n var elem = this.tagStack.pop();\n if (this.options.withEndIndices) {\n elem.endIndex = this.parser.endIndex;\n }\n if (this.elementCB)\n this.elementCB(elem);\n };\n DomHandler.prototype.onopentag = function (name, attribs) {\n var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : undefined;\n var element = new node_1.Element(name, attribs, undefined, type);\n this.addNode(element);\n this.tagStack.push(element);\n };\n DomHandler.prototype.ontext = function (data) {\n var normalizeWhitesp
|
|||
|
/*!*********************************************!*\
|
|||
|
!*** ./node_modules/domhandler/lib/node.js ***!
|
|||
|
\*********************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0;\nvar domelementtype_1 = __webpack_require__(/*! domelementtype */ "./node_modules/domelementtype/lib/index.js");\nvar nodeTypes = new Map([\n [domelementtype_1.ElementType.Tag, 1],\n [domelementtype_1.ElementType.Script, 1],\n [domelementtype_1.ElementType.Style, 1],\n [domelementtype_1.ElementType.Directive, 1],\n [domelementtype_1.ElementType.Text, 3],\n [domelementtype_1.ElementType.CDATA, 4],\n [domelementtype_1.ElementType.Comment, 8],\n [domelementtype_1.ElementType.Root, 9],\n]);\n/**\n * This object will be used as the prototype for Nodes when creating a\n * DOM-Level-1-compliant structure.\n */\nvar Node = /** @class */ (function () {\n /**\n *\n * @param type The type of the node.\n */\n function Node(type) {\n this.type = type;\n /** Parent of the node */\n this.parent = null;\n /** Previous sibling */\n this.prev = null;\n /** Next sibling */\n this.next = null;\n /** The start index of the node. Requires `withStartIndices` on the handler to be `true. */\n this.startIndex = null;\n /** The end index of the node. Requires `withEndIndices` on the handler to be `true. */\n this.endIndex = null;\n }\n Object.defineProperty(Node.prototype, "nodeType", {\n // Read-only aliases\n get: function () {\n var _a;\n return (_a = nodeTypes.get(this.type)) !== null && _a !== void 0 ? _a : 1;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, "parentNode", {\n // Read-write aliases for properties\n get: function () {\n return this.parent;\n },\n set: function (parent) {\n this.parent = parent;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, "previousSibling", {\n get: function () {\n return this.prev;\n },\n set: function (prev) {\n this.prev = prev;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Node.prototype, "nextSibling", {\n get: function () {\n return this.next;\n },\n set: function (next) {\n this.next = next;\n },\n enumerable: false,\n configur
|
|||
|
/*!********************************************!*\
|
|||
|
!*** ./node_modules/domutils/lib/feeds.js ***!
|
|||
|
\********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.getFeed = void 0;\nvar stringify_1 = __webpack_require__(/*! ./stringify */ "./node_modules/domutils/lib/stringify.js");\nvar legacy_1 = __webpack_require__(/*! ./legacy */ "./node_modules/domutils/lib/legacy.js");\n/**\n * Get the feed object from the root of a DOM tree.\n *\n * @param doc - The DOM to to extract the feed from.\n * @returns The feed.\n */\nfunction getFeed(doc) {\n var feedRoot = getOneElement(isValidFeed, doc);\n return !feedRoot\n ? null\n : feedRoot.name === "feed"\n ? getAtomFeed(feedRoot)\n : getRssFeed(feedRoot);\n}\nexports.getFeed = getFeed;\n/**\n * Parse an Atom feed.\n *\n * @param feedRoot The root of the feed.\n * @returns The parsed feed.\n */\nfunction getAtomFeed(feedRoot) {\n var _a;\n var childs = feedRoot.children;\n var feed = {\n type: "atom",\n items: (0, legacy_1.getElementsByTagName)("entry", childs).map(function (item) {\n var _a;\n var children = item.children;\n var entry = { media: getMediaElements(children) };\n addConditionally(entry, "id", "id", children);\n addConditionally(entry, "title", "title", children);\n var href = (_a = getOneElement("link", children)) === null || _a === void 0 ? void 0 : _a.attribs.href;\n if (href) {\n entry.link = href;\n }\n var description = fetch("summary", children) || fetch("content", children);\n if (description) {\n entry.description = description;\n }\n var pubDate = fetch("updated", children);\n if (pubDate) {\n entry.pubDate = new Date(pubDate);\n }\n return entry;\n }),\n };\n addConditionally(feed, "id", "id", childs);\n addConditionally(feed, "title", "title", childs);\n var href = (_a = getOneElement("link", childs)) === null || _a === void 0 ? void 0 : _a.attribs.href;\n if (href) {\n feed.link = href;\n }\n addConditionally(feed, "description", "subtitle", childs);\n var updated = fetch("updated", childs);\n if (updated) {\n feed.updated = new Date(updated);\n }\n addConditionally(feed, "author", "email", childs, true);\n return feed;\n}\n/**\n * Parse a RSS feed.\n *\n * @param feedRoot The root of the feed.\n * @returns The parsed feed.\n */\nfunction getRssFeed(feedRoot) {\n var _a, _b;\n var childs = (_b = (_a = getOneElement("channel", feedRoot.children)) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : [];\n var feed = {\n type: feedRoot.name.substr(0, 3),\n id: "",\n items: (0, legacy_1.getElementsByTagName)("item", feedRoot.children).map(function (item) {\n var children = item.children;\n var entry = { media: getMediaElements(children) };\n addConditionally(entry, "id", "guid", children);\n addConditionally(entry, "title", "title", children);\n addConditionally(entry, "link", "link", children);\n addConditionally(entry, "description", "description", children);\n var pubDate = fetch("pubDate", children);\n if (pubDate)\n entry.pubDate = new Date(pubDate);\n return entry;\n }),\n };\n addConditionally(feed, "title", "title", childs);\n addConditionally(feed, "link", "link", childs);\n addConditionally(feed, "description", "description", childs);\n var updated = fetch("lastBuildDate", childs);\n if (updated) {\n feed.updated = new Date(updated);\n }\n addConditionally(feed, "author", "managingEditor", childs, true);\n return feed;\n}\nvar MEDIA_KEYS_STRING = ["url", "type", "lang"];\nvar MEDIA_KEYS_INT = [\n "fileSize",\n "bitrate",\n "framerate",\n "samplingrate",\n "chan
|
|||
|
/*!**********************************************!*\
|
|||
|
!*** ./node_modules/domutils/lib/helpers.js ***!
|
|||
|
\**********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.uniqueSort = exports.compareDocumentPosition = exports.removeSubsets = void 0;\nvar domhandler_1 = __webpack_require__(/*! domhandler */ "./node_modules/domhandler/lib/index.js");\n/**\n * Given an array of nodes, remove any member that is contained by another.\n *\n * @param nodes Nodes to filter.\n * @returns Remaining nodes that aren\'t subtrees of each other.\n */\nfunction removeSubsets(nodes) {\n var idx = nodes.length;\n /*\n * Check if each node (or one of its ancestors) is already contained in the\n * array.\n */\n while (--idx >= 0) {\n var node = nodes[idx];\n /*\n * Remove the node if it is not unique.\n * We are going through the array from the end, so we only\n * have to check nodes that preceed the node under consideration in the array.\n */\n if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {\n nodes.splice(idx, 1);\n continue;\n }\n for (var ancestor = node.parent; ancestor; ancestor = ancestor.parent) {\n if (nodes.includes(ancestor)) {\n nodes.splice(idx, 1);\n break;\n }\n }\n }\n return nodes;\n}\nexports.removeSubsets = removeSubsets;\n/**\n * Compare the position of one node against another node in any other document.\n * The return value is a bitmask with the following values:\n *\n * Document order:\n * > There is an ordering, document order, defined on all the nodes in the\n * > document corresponding to the order in which the first character of the\n * > XML representation of each node occurs in the XML representation of the\n * > document after expansion of general entities. Thus, the document element\n * > node will be the first node. Element nodes occur before their children.\n * > Thus, document order orders element nodes in order of the occurrence of\n * > their start-tag in the XML (after expansion of entities). The attribute\n * > nodes of an element occur after the element and before its children. The\n * > relative order of attribute nodes is implementation-dependent./\n *\n * Source:\n * http://www.w3.org/TR/DOM-Level-3-Core/glossary.html#dt-document-order\n *\n * @param nodeA The first node to use in the comparison\n * @param nodeB The second node to use in the comparison\n * @returns A bitmask describing the input nodes\' relative position.\n *\n * See http://dom.spec.whatwg.org/#dom-node-comparedocumentposition for\n * a description of these values.\n */\nfunction compareDocumentPosition(nodeA, nodeB) {\n var aParents = [];\n var bParents = [];\n if (nodeA === nodeB) {\n return 0;\n }\n var current = (0, domhandler_1.hasChildren)(nodeA) ? nodeA : nodeA.parent;\n while (current) {\n aParents.unshift(current);\n current = current.parent;\n }\n current = (0, domhandler_1.hasChildren)(nodeB) ? nodeB : nodeB.parent;\n while (current) {\n bParents.unshift(current);\n current = current.parent;\n }\n var maxIdx = Math.min(aParents.length, bParents.length);\n var idx = 0;\n while (idx < maxIdx && aParents[idx] === bParents[idx]) {\n idx++;\n }\n if (idx === 0) {\n return 1 /* DISCONNECTED */;\n }\n var sharedParent = aParents[idx - 1];\n var siblings = sharedParent.children;\n var aSibling = aParents[idx];\n var bSibling = bParents[idx];\n if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {\n if (sharedParent === nodeB) {\n return 4 /* FOLLOWING */ | 16 /* CONTAINED_BY */;\n }\n return 4 /* FOLLOWING */;\n }\n if (sharedParent === nodeA) {\n return 2 /* PRECEDING */ | 8 /* CONTAINS */;\n }\n return 2 /* PRECEDING */;\n}\nexports.compareDocumentPosition = compareDocumentPosition;\n/**\n * Sort an array of nodes based on their relative position in
|
|||
|
/*!********************************************!*\
|
|||
|
!*** ./node_modules/domutils/lib/index.js ***!
|
|||
|
\********************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.hasChildren = exports.isDocument = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = void 0;\n__exportStar(__webpack_require__(/*! ./stringify */ "./node_modules/domutils/lib/stringify.js"), exports);\n__exportStar(__webpack_require__(/*! ./traversal */ "./node_modules/domutils/lib/traversal.js"), exports);\n__exportStar(__webpack_require__(/*! ./manipulation */ "./node_modules/domutils/lib/manipulation.js"), exports);\n__exportStar(__webpack_require__(/*! ./querying */ "./node_modules/domutils/lib/querying.js"), exports);\n__exportStar(__webpack_require__(/*! ./legacy */ "./node_modules/domutils/lib/legacy.js"), exports);\n__exportStar(__webpack_require__(/*! ./helpers */ "./node_modules/domutils/lib/helpers.js"), exports);\n__exportStar(__webpack_require__(/*! ./feeds */ "./node_modules/domutils/lib/feeds.js"), exports);\n/** @deprecated Use these methods from `domhandler` directly. */\nvar domhandler_1 = __webpack_require__(/*! domhandler */ "./node_modules/domhandler/lib/index.js");\nObject.defineProperty(exports, "isTag", ({ enumerable: true, get: function () { return domhandler_1.isTag; } }));\nObject.defineProperty(exports, "isCDATA", ({ enumerable: true, get: function () { return domhandler_1.isCDATA; } }));\nObject.defineProperty(exports, "isText", ({ enumerable: true, get: function () { return domhandler_1.isText; } }));\nObject.defineProperty(exports, "isComment", ({ enumerable: true, get: function () { return domhandler_1.isComment; } }));\nObject.defineProperty(exports, "isDocument", ({ enumerable: true, get: function () { return domhandler_1.isDocument; } }));\nObject.defineProperty(exports, "hasChildren", ({ enumerable: true, get: function () { return domhandler_1.hasChildren; } }));\n\n\n//# sourceURL=webpack://telegram/./node_modules/domutils/lib/index.js?')},"./node_modules/domutils/lib/legacy.js":
|
|||
|
/*!*********************************************!*\
|
|||
|
!*** ./node_modules/domutils/lib/legacy.js ***!
|
|||
|
\*********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.getElementsByTagType = exports.getElementsByTagName = exports.getElementById = exports.getElements = exports.testElement = void 0;\nvar domhandler_1 = __webpack_require__(/*! domhandler */ "./node_modules/domhandler/lib/index.js");\nvar querying_1 = __webpack_require__(/*! ./querying */ "./node_modules/domutils/lib/querying.js");\nvar Checks = {\n tag_name: function (name) {\n if (typeof name === "function") {\n return function (elem) { return (0, domhandler_1.isTag)(elem) && name(elem.name); };\n }\n else if (name === "*") {\n return domhandler_1.isTag;\n }\n return function (elem) { return (0, domhandler_1.isTag)(elem) && elem.name === name; };\n },\n tag_type: function (type) {\n if (typeof type === "function") {\n return function (elem) { return type(elem.type); };\n }\n return function (elem) { return elem.type === type; };\n },\n tag_contains: function (data) {\n if (typeof data === "function") {\n return function (elem) { return (0, domhandler_1.isText)(elem) && data(elem.data); };\n }\n return function (elem) { return (0, domhandler_1.isText)(elem) && elem.data === data; };\n },\n};\n/**\n * @param attrib Attribute to check.\n * @param value Attribute value to look for.\n * @returns A function to check whether the a node has an attribute with a particular value.\n */\nfunction getAttribCheck(attrib, value) {\n if (typeof value === "function") {\n return function (elem) { return (0, domhandler_1.isTag)(elem) && value(elem.attribs[attrib]); };\n }\n return function (elem) { return (0, domhandler_1.isTag)(elem) && elem.attribs[attrib] === value; };\n}\n/**\n * @param a First function to combine.\n * @param b Second function to combine.\n * @returns A function taking a node and returning `true` if either\n * of the input functions returns `true` for the node.\n */\nfunction combineFuncs(a, b) {\n return function (elem) { return a(elem) || b(elem); };\n}\n/**\n * @param options An object describing nodes to look for.\n * @returns A function executing all checks in `options` and returning `true`\n * if any of them match a node.\n */\nfunction compileTest(options) {\n var funcs = Object.keys(options).map(function (key) {\n var value = options[key];\n return Object.prototype.hasOwnProperty.call(Checks, key)\n ? Checks[key](value)\n : getAttribCheck(key, value);\n });\n return funcs.length === 0 ? null : funcs.reduce(combineFuncs);\n}\n/**\n * @param options An object describing nodes to look for.\n * @param node The element to test.\n * @returns Whether the element matches the description in `options`.\n */\nfunction testElement(options, node) {\n var test = compileTest(options);\n return test ? test(node) : true;\n}\nexports.testElement = testElement;\n/**\n * @param options An object describing nodes to look for.\n * @param nodes Nodes to search through.\n * @param recurse Also consider child nodes.\n * @param limit Maximum number of nodes to return.\n * @returns All nodes that match `options`.\n */\nfunction getElements(options, nodes, recurse, limit) {\n if (limit === void 0) { limit = Infinity; }\n var test = compileTest(options);\n return test ? (0, querying_1.filter)(test, nodes, recurse, limit) : [];\n}\nexports.getElements = getElements;\n/**\n * @param id The unique ID attribute value to look for.\n * @param nodes Nodes to search through.\n * @param recurse Also consider child nodes.\n * @returns The node with the supplied ID.\n */\nfunction getElementById(id, nodes, recurse) {\n if (recurse === void 0) { recurse = true; }\n if (!Array.isArray(nodes))\n nodes = [nodes];\n return (0, querying_1.findOne)(getAttribCheck("id", id), nodes, recurse);\n}\nexports.getElementById = getElementB
|
|||
|
/*!***************************************************!*\
|
|||
|
!*** ./node_modules/domutils/lib/manipulation.js ***!
|
|||
|
\***************************************************/(__unused_webpack_module,exports)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.prepend = exports.prependChild = exports.append = exports.appendChild = exports.replaceElement = exports.removeElement = void 0;\n/**\n * Remove an element from the dom\n *\n * @param elem The element to be removed\n */\nfunction removeElement(elem) {\n if (elem.prev)\n elem.prev.next = elem.next;\n if (elem.next)\n elem.next.prev = elem.prev;\n if (elem.parent) {\n var childs = elem.parent.children;\n childs.splice(childs.lastIndexOf(elem), 1);\n }\n}\nexports.removeElement = removeElement;\n/**\n * Replace an element in the dom\n *\n * @param elem The element to be replaced\n * @param replacement The element to be added\n */\nfunction replaceElement(elem, replacement) {\n var prev = (replacement.prev = elem.prev);\n if (prev) {\n prev.next = replacement;\n }\n var next = (replacement.next = elem.next);\n if (next) {\n next.prev = replacement;\n }\n var parent = (replacement.parent = elem.parent);\n if (parent) {\n var childs = parent.children;\n childs[childs.lastIndexOf(elem)] = replacement;\n }\n}\nexports.replaceElement = replaceElement;\n/**\n * Append a child to an element.\n *\n * @param elem The element to append to.\n * @param child The element to be added as a child.\n */\nfunction appendChild(elem, child) {\n removeElement(child);\n child.next = null;\n child.parent = elem;\n if (elem.children.push(child) > 1) {\n var sibling = elem.children[elem.children.length - 2];\n sibling.next = child;\n child.prev = sibling;\n }\n else {\n child.prev = null;\n }\n}\nexports.appendChild = appendChild;\n/**\n * Append an element after another.\n *\n * @param elem The element to append after.\n * @param next The element be added.\n */\nfunction append(elem, next) {\n removeElement(next);\n var parent = elem.parent;\n var currNext = elem.next;\n next.next = currNext;\n next.prev = elem;\n elem.next = next;\n next.parent = parent;\n if (currNext) {\n currNext.prev = next;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.lastIndexOf(currNext), 0, next);\n }\n }\n else if (parent) {\n parent.children.push(next);\n }\n}\nexports.append = append;\n/**\n * Prepend a child to an element.\n *\n * @param elem The element to prepend before.\n * @param child The element to be added as a child.\n */\nfunction prependChild(elem, child) {\n removeElement(child);\n child.parent = elem;\n child.prev = null;\n if (elem.children.unshift(child) !== 1) {\n var sibling = elem.children[1];\n sibling.prev = child;\n child.next = sibling;\n }\n else {\n child.next = null;\n }\n}\nexports.prependChild = prependChild;\n/**\n * Prepend an element before another.\n *\n * @param elem The element to prepend before.\n * @param prev The element be added.\n */\nfunction prepend(elem, prev) {\n removeElement(prev);\n var parent = elem.parent;\n if (parent) {\n var childs = parent.children;\n childs.splice(childs.indexOf(elem), 0, prev);\n }\n if (elem.prev) {\n elem.prev.next = prev;\n }\n prev.parent = parent;\n prev.prev = elem.prev;\n prev.next = elem;\n elem.prev = prev;\n}\nexports.prepend = prepend;\n\n\n//# sourceURL=webpack://telegram/./node_modules/domutils/lib/manipulation.js?')},"./node_modules/domutils/lib/querying.js":
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/domutils/lib/querying.js ***!
|
|||
|
\***********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.findAll = exports.existsOne = exports.findOne = exports.findOneChild = exports.find = exports.filter = void 0;\nvar domhandler_1 = __webpack_require__(/*! domhandler */ "./node_modules/domhandler/lib/index.js");\n/**\n * Search a node and its children for nodes passing a test function.\n *\n * @param test Function to test nodes on.\n * @param node Node to search. Will be included in the result set if it matches.\n * @param recurse Also consider child nodes.\n * @param limit Maximum number of nodes to return.\n * @returns All nodes passing `test`.\n */\nfunction filter(test, node, recurse, limit) {\n if (recurse === void 0) { recurse = true; }\n if (limit === void 0) { limit = Infinity; }\n if (!Array.isArray(node))\n node = [node];\n return find(test, node, recurse, limit);\n}\nexports.filter = filter;\n/**\n * Search an array of node and its children for nodes passing a test function.\n *\n * @param test Function to test nodes on.\n * @param nodes Array of nodes to search.\n * @param recurse Also consider child nodes.\n * @param limit Maximum number of nodes to return.\n * @returns All nodes passing `test`.\n */\nfunction find(test, nodes, recurse, limit) {\n var result = [];\n for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {\n var elem = nodes_1[_i];\n if (test(elem)) {\n result.push(elem);\n if (--limit <= 0)\n break;\n }\n if (recurse && (0, domhandler_1.hasChildren)(elem) && elem.children.length > 0) {\n var children = find(test, elem.children, recurse, limit);\n result.push.apply(result, children);\n limit -= children.length;\n if (limit <= 0)\n break;\n }\n }\n return result;\n}\nexports.find = find;\n/**\n * Finds the first element inside of an array that matches a test function.\n *\n * @param test Function to test nodes on.\n * @param nodes Array of nodes to search.\n * @returns The first node in the array that passes `test`.\n */\nfunction findOneChild(test, nodes) {\n return nodes.find(test);\n}\nexports.findOneChild = findOneChild;\n/**\n * Finds one element in a tree that passes a test.\n *\n * @param test Function to test nodes on.\n * @param nodes Array of nodes to search.\n * @param recurse Also consider child nodes.\n * @returns The first child node that passes `test`.\n */\nfunction findOne(test, nodes, recurse) {\n if (recurse === void 0) { recurse = true; }\n var elem = null;\n for (var i = 0; i < nodes.length && !elem; i++) {\n var checked = nodes[i];\n if (!(0, domhandler_1.isTag)(checked)) {\n continue;\n }\n else if (test(checked)) {\n elem = checked;\n }\n else if (recurse && checked.children.length > 0) {\n elem = findOne(test, checked.children);\n }\n }\n return elem;\n}\nexports.findOne = findOne;\n/**\n * @param test Function to test nodes on.\n * @param nodes Array of nodes to search.\n * @returns Whether a tree of nodes contains at least one node passing a test.\n */\nfunction existsOne(test, nodes) {\n return nodes.some(function (checked) {\n return (0, domhandler_1.isTag)(checked) &&\n (test(checked) ||\n (checked.children.length > 0 &&\n existsOne(test, checked.children)));\n });\n}\nexports.existsOne = existsOne;\n/**\n * Search and array of nodes and its children for nodes passing a test function.\n *\n * Same as `find`, only with less options, leading to reduced complexity.\n *\n * @param test Function to test nodes on.\n * @param nodes Array of nodes to search.\n * @returns All nodes passing `test`.\n */\nfunction findAll(test, nodes) {\n var _a;\n var result = [];\n var stack = nodes.filter(domhandler_1.isTag);\n var elem;\n while ((elem =
|
|||
|
/*!************************************************!*\
|
|||
|
!*** ./node_modules/domutils/lib/stringify.js ***!
|
|||
|
\************************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.innerText = exports.textContent = exports.getText = exports.getInnerHTML = exports.getOuterHTML = void 0;\nvar domhandler_1 = __webpack_require__(/*! domhandler */ "./node_modules/domhandler/lib/index.js");\nvar dom_serializer_1 = __importDefault(__webpack_require__(/*! dom-serializer */ "./node_modules/dom-serializer/lib/index.js"));\nvar domelementtype_1 = __webpack_require__(/*! domelementtype */ "./node_modules/domelementtype/lib/index.js");\n/**\n * @param node Node to get the outer HTML of.\n * @param options Options for serialization.\n * @deprecated Use the `dom-serializer` module directly.\n * @returns `node`\'s outer HTML.\n */\nfunction getOuterHTML(node, options) {\n return (0, dom_serializer_1.default)(node, options);\n}\nexports.getOuterHTML = getOuterHTML;\n/**\n * @param node Node to get the inner HTML of.\n * @param options Options for serialization.\n * @deprecated Use the `dom-serializer` module directly.\n * @returns `node`\'s inner HTML.\n */\nfunction getInnerHTML(node, options) {\n return (0, domhandler_1.hasChildren)(node)\n ? node.children.map(function (node) { return getOuterHTML(node, options); }).join("")\n : "";\n}\nexports.getInnerHTML = getInnerHTML;\n/**\n * Get a node\'s inner text. Same as `textContent`, but inserts newlines for `<br>` tags.\n *\n * @deprecated Use `textContent` instead.\n * @param node Node to get the inner text of.\n * @returns `node`\'s inner text.\n */\nfunction getText(node) {\n if (Array.isArray(node))\n return node.map(getText).join("");\n if ((0, domhandler_1.isTag)(node))\n return node.name === "br" ? "\\n" : getText(node.children);\n if ((0, domhandler_1.isCDATA)(node))\n return getText(node.children);\n if ((0, domhandler_1.isText)(node))\n return node.data;\n return "";\n}\nexports.getText = getText;\n/**\n * Get a node\'s text content.\n *\n * @param node Node to get the text content of.\n * @returns `node`\'s text content.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent}\n */\nfunction textContent(node) {\n if (Array.isArray(node))\n return node.map(textContent).join("");\n if ((0, domhandler_1.hasChildren)(node) && !(0, domhandler_1.isComment)(node)) {\n return textContent(node.children);\n }\n if ((0, domhandler_1.isText)(node))\n return node.data;\n return "";\n}\nexports.textContent = textContent;\n/**\n * Get a node\'s inner text.\n *\n * @param node Node to get the inner text of.\n * @returns `node`\'s inner text.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/innerText}\n */\nfunction innerText(node) {\n if (Array.isArray(node))\n return node.map(innerText).join("");\n if ((0, domhandler_1.hasChildren)(node) && (node.type === domelementtype_1.ElementType.Tag || (0, domhandler_1.isCDATA)(node))) {\n return innerText(node.children);\n }\n if ((0, domhandler_1.isText)(node))\n return node.data;\n return "";\n}\nexports.innerText = innerText;\n\n\n//# sourceURL=webpack://telegram/./node_modules/domutils/lib/stringify.js?')},"./node_modules/domutils/lib/traversal.js":
|
|||
|
/*!************************************************!*\
|
|||
|
!*** ./node_modules/domutils/lib/traversal.js ***!
|
|||
|
\************************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.prevElementSibling = exports.nextElementSibling = exports.getName = exports.hasAttrib = exports.getAttributeValue = exports.getSiblings = exports.getParent = exports.getChildren = void 0;\nvar domhandler_1 = __webpack_require__(/*! domhandler */ \"./node_modules/domhandler/lib/index.js\");\nvar emptyArray = [];\n/**\n * Get a node's children.\n *\n * @param elem Node to get the children of.\n * @returns `elem`'s children, or an empty array.\n */\nfunction getChildren(elem) {\n var _a;\n return (_a = elem.children) !== null && _a !== void 0 ? _a : emptyArray;\n}\nexports.getChildren = getChildren;\n/**\n * Get a node's parent.\n *\n * @param elem Node to get the parent of.\n * @returns `elem`'s parent node.\n */\nfunction getParent(elem) {\n return elem.parent || null;\n}\nexports.getParent = getParent;\n/**\n * Gets an elements siblings, including the element itself.\n *\n * Attempts to get the children through the element's parent first.\n * If we don't have a parent (the element is a root node),\n * we walk the element's `prev` & `next` to get all remaining nodes.\n *\n * @param elem Element to get the siblings of.\n * @returns `elem`'s siblings.\n */\nfunction getSiblings(elem) {\n var _a, _b;\n var parent = getParent(elem);\n if (parent != null)\n return getChildren(parent);\n var siblings = [elem];\n var prev = elem.prev, next = elem.next;\n while (prev != null) {\n siblings.unshift(prev);\n (_a = prev, prev = _a.prev);\n }\n while (next != null) {\n siblings.push(next);\n (_b = next, next = _b.next);\n }\n return siblings;\n}\nexports.getSiblings = getSiblings;\n/**\n * Gets an attribute from an element.\n *\n * @param elem Element to check.\n * @param name Attribute name to retrieve.\n * @returns The element's attribute value, or `undefined`.\n */\nfunction getAttributeValue(elem, name) {\n var _a;\n return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name];\n}\nexports.getAttributeValue = getAttributeValue;\n/**\n * Checks whether an element has an attribute.\n *\n * @param elem Element to check.\n * @param name Attribute name to look for.\n * @returns Returns whether `elem` has the attribute `name`.\n */\nfunction hasAttrib(elem, name) {\n return (elem.attribs != null &&\n Object.prototype.hasOwnProperty.call(elem.attribs, name) &&\n elem.attribs[name] != null);\n}\nexports.hasAttrib = hasAttrib;\n/**\n * Get the tag name of an element.\n *\n * @param elem The element to get the name for.\n * @returns The tag name of `elem`.\n */\nfunction getName(elem) {\n return elem.name;\n}\nexports.getName = getName;\n/**\n * Returns the next element sibling of a node.\n *\n * @param elem The element to get the next sibling of.\n * @returns `elem`'s next sibling that is a tag.\n */\nfunction nextElementSibling(elem) {\n var _a;\n var next = elem.next;\n while (next !== null && !(0, domhandler_1.isTag)(next))\n (_a = next, next = _a.next);\n return next;\n}\nexports.nextElementSibling = nextElementSibling;\n/**\n * Returns the previous element sibling of a node.\n *\n * @param elem The element to get the previous sibling of.\n * @returns `elem`'s previous sibling that is a tag.\n */\nfunction prevElementSibling(elem) {\n var _a;\n var prev = elem.prev;\n while (prev !== null && !(0, domhandler_1.isTag)(prev))\n (_a = prev, prev = _a.prev);\n return prev;\n}\nexports.prevElementSibling = prevElementSibling;\n\n\n//# sourceURL=webpack://telegram/./node_modules/domutils/lib/traversal.js?")},"./node_modules/entities/lib/decode.js":
|
|||
|
/*!*********************************************!*\
|
|||
|
!*** ./node_modules/entities/lib/decode.js ***!
|
|||
|
\*********************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.decodeHTML = exports.decodeHTMLStrict = exports.decodeXML = void 0;\nvar entities_json_1 = __importDefault(__webpack_require__(/*! ./maps/entities.json */ "./node_modules/entities/lib/maps/entities.json"));\nvar legacy_json_1 = __importDefault(__webpack_require__(/*! ./maps/legacy.json */ "./node_modules/entities/lib/maps/legacy.json"));\nvar xml_json_1 = __importDefault(__webpack_require__(/*! ./maps/xml.json */ "./node_modules/entities/lib/maps/xml.json"));\nvar decode_codepoint_1 = __importDefault(__webpack_require__(/*! ./decode_codepoint */ "./node_modules/entities/lib/decode_codepoint.js"));\nvar strictEntityRe = /&(?:[a-zA-Z0-9]+|#[xX][\\da-fA-F]+|#\\d+);/g;\nexports.decodeXML = getStrictDecoder(xml_json_1.default);\nexports.decodeHTMLStrict = getStrictDecoder(entities_json_1.default);\nfunction getStrictDecoder(map) {\n var replace = getReplacer(map);\n return function (str) { return String(str).replace(strictEntityRe, replace); };\n}\nvar sorter = function (a, b) { return (a < b ? 1 : -1); };\nexports.decodeHTML = (function () {\n var legacy = Object.keys(legacy_json_1.default).sort(sorter);\n var keys = Object.keys(entities_json_1.default).sort(sorter);\n for (var i = 0, j = 0; i < keys.length; i++) {\n if (legacy[j] === keys[i]) {\n keys[i] += ";?";\n j++;\n }\n else {\n keys[i] += ";";\n }\n }\n var re = new RegExp("&(?:" + keys.join("|") + "|#[xX][\\\\da-fA-F]+;?|#\\\\d+;?)", "g");\n var replace = getReplacer(entities_json_1.default);\n function replacer(str) {\n if (str.substr(-1) !== ";")\n str += ";";\n return replace(str);\n }\n // TODO consider creating a merged map\n return function (str) { return String(str).replace(re, replacer); };\n})();\nfunction getReplacer(map) {\n return function replace(str) {\n if (str.charAt(1) === "#") {\n var secondChar = str.charAt(2);\n if (secondChar === "X" || secondChar === "x") {\n return decode_codepoint_1.default(parseInt(str.substr(3), 16));\n }\n return decode_codepoint_1.default(parseInt(str.substr(2), 10));\n }\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n return map[str.slice(1, -1)] || str;\n };\n}\n\n\n//# sourceURL=webpack://telegram/./node_modules/entities/lib/decode.js?')},"./node_modules/entities/lib/decode_codepoint.js":
|
|||
|
/*!*******************************************************!*\
|
|||
|
!*** ./node_modules/entities/lib/decode_codepoint.js ***!
|
|||
|
\*******************************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nvar decode_json_1 = __importDefault(__webpack_require__(/*! ./maps/decode.json */ "./node_modules/entities/lib/maps/decode.json"));\n// Adapted from https://github.com/mathiasbynens/he/blob/master/src/he.js#L94-L119\nvar fromCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nString.fromCodePoint ||\n function (codePoint) {\n var output = "";\n if (codePoint > 0xffff) {\n codePoint -= 0x10000;\n output += String.fromCharCode(((codePoint >>> 10) & 0x3ff) | 0xd800);\n codePoint = 0xdc00 | (codePoint & 0x3ff);\n }\n output += String.fromCharCode(codePoint);\n return output;\n };\nfunction decodeCodePoint(codePoint) {\n if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {\n return "\\uFFFD";\n }\n if (codePoint in decode_json_1.default) {\n codePoint = decode_json_1.default[codePoint];\n }\n return fromCodePoint(codePoint);\n}\nexports["default"] = decodeCodePoint;\n\n\n//# sourceURL=webpack://telegram/./node_modules/entities/lib/decode_codepoint.js?')},"./node_modules/entities/lib/encode.js":
|
|||
|
/*!*********************************************!*\
|
|||
|
!*** ./node_modules/entities/lib/encode.js ***!
|
|||
|
\*********************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = void 0;\nvar xml_json_1 = __importDefault(__webpack_require__(/*! ./maps/xml.json */ "./node_modules/entities/lib/maps/xml.json"));\nvar inverseXML = getInverseObj(xml_json_1.default);\nvar xmlReplacer = getInverseReplacer(inverseXML);\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in XML\n * documents using XML entities.\n *\n * If a character has no equivalent entity, a\n * numeric hexadecimal reference (eg. `ü`) will be used.\n */\nexports.encodeXML = getASCIIEncoder(inverseXML);\nvar entities_json_1 = __importDefault(__webpack_require__(/*! ./maps/entities.json */ "./node_modules/entities/lib/maps/entities.json"));\nvar inverseHTML = getInverseObj(entities_json_1.default);\nvar htmlReplacer = getInverseReplacer(inverseHTML);\n/**\n * Encodes all entities and non-ASCII characters in the input.\n *\n * This includes characters that are valid ASCII characters in HTML documents.\n * For example `#` will be encoded as `#`. To get a more compact output,\n * consider using the `encodeNonAsciiHTML` function.\n *\n * If a character has no equivalent entity, a\n * numeric hexadecimal reference (eg. `ü`) will be used.\n */\nexports.encodeHTML = getInverse(inverseHTML, htmlReplacer);\n/**\n * Encodes all non-ASCII characters, as well as characters not valid in HTML\n * documents using HTML entities.\n *\n * If a character has no equivalent entity, a\n * numeric hexadecimal reference (eg. `ü`) will be used.\n */\nexports.encodeNonAsciiHTML = getASCIIEncoder(inverseHTML);\nfunction getInverseObj(obj) {\n return Object.keys(obj)\n .sort()\n .reduce(function (inverse, name) {\n inverse[obj[name]] = "&" + name + ";";\n return inverse;\n }, {});\n}\nfunction getInverseReplacer(inverse) {\n var single = [];\n var multiple = [];\n for (var _i = 0, _a = Object.keys(inverse); _i < _a.length; _i++) {\n var k = _a[_i];\n if (k.length === 1) {\n // Add value to single array\n single.push("\\\\" + k);\n }\n else {\n // Add value to multiple array\n multiple.push(k);\n }\n }\n // Add ranges to single characters.\n single.sort();\n for (var start = 0; start < single.length - 1; start++) {\n // Find the end of a run of characters\n var end = start;\n while (end < single.length - 1 &&\n single[end].charCodeAt(1) + 1 === single[end + 1].charCodeAt(1)) {\n end += 1;\n }\n var count = 1 + end - start;\n // We want to replace at least three characters\n if (count < 3)\n continue;\n single.splice(start, count, single[start] + "-" + single[end]);\n }\n multiple.unshift("[" + single.join("") + "]");\n return new RegExp(multiple.join("|"), "g");\n}\n// /[^\\0-\\x7F]/gu\nvar reNonASCII = /(?:[\\x80-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/g;\nvar getCodePoint = \n// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\nString.prototype.codePointAt != null\n ? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n function (str) { return str.codePointAt(0); }\n : // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n function (c) {\n return (c.charCodeAt(0) - 0xd800) * 0x400 +\n c.charCodeAt(1) -\n 0xdc00 +\n 0x10000;\n };\nfunction singleCharReplacer(c) {\n return "&#x" + (c.length > 1 ? getCodePoint(c) : c.c
|
|||
|
/*!********************************************!*\
|
|||
|
!*** ./node_modules/entities/lib/index.js ***!
|
|||
|
\********************************************/(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";eval('\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.encodeHTML5 = exports.encodeHTML4 = exports.escapeUTF8 = exports.escape = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = void 0;\nvar decode_1 = __webpack_require__(/*! ./decode */ "./node_modules/entities/lib/decode.js");\nvar encode_1 = __webpack_require__(/*! ./encode */ "./node_modules/entities/lib/encode.js");\n/**\n * Decodes a string with entities.\n *\n * @param data String to decode.\n * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.\n * @deprecated Use `decodeXML` or `decodeHTML` directly.\n */\nfunction decode(data, level) {\n return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data);\n}\nexports.decode = decode;\n/**\n * Decodes a string with entities. Does not allow missing trailing semicolons for entities.\n *\n * @param data String to decode.\n * @param level Optional level to decode at. 0 = XML, 1 = HTML. Default is 0.\n * @deprecated Use `decodeHTMLStrict` or `decodeXML` directly.\n */\nfunction decodeStrict(data, level) {\n return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data);\n}\nexports.decodeStrict = decodeStrict;\n/**\n * Encodes a string with entities.\n *\n * @param data String to encode.\n * @param level Optional level to encode at. 0 = XML, 1 = HTML. Default is 0.\n * @deprecated Use `encodeHTML`, `encodeXML` or `encodeNonAsciiHTML` directly.\n */\nfunction encode(data, level) {\n return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data);\n}\nexports.encode = encode;\nvar encode_2 = __webpack_require__(/*! ./encode */ "./node_modules/entities/lib/encode.js");\nObject.defineProperty(exports, "encodeXML", ({ enumerable: true, get: function () { return encode_2.encodeXML; } }));\nObject.defineProperty(exports, "encodeHTML", ({ enumerable: true, get: function () { return encode_2.encodeHTML; } }));\nObject.defineProperty(exports, "encodeNonAsciiHTML", ({ enumerable: true, get: function () { return encode_2.encodeNonAsciiHTML; } }));\nObject.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return encode_2.escape; } }));\nObject.defineProperty(exports, "escapeUTF8", ({ enumerable: true, get: function () { return encode_2.escapeUTF8; } }));\n// Legacy aliases (deprecated)\nObject.defineProperty(exports, "encodeHTML4", ({ enumerable: true, get: function () { return encode_2.encodeHTML; } }));\nObject.defineProperty(exports, "encodeHTML5", ({ enumerable: true, get: function () { return encode_2.encodeHTML; } }));\nvar decode_2 = __webpack_require__(/*! ./decode */ "./node_modules/entities/lib/decode.js");\nObject.defineProperty(exports, "decodeXML", ({ enumerable: true, get: function () { return decode_2.decodeXML; } }));\nObject.defineProperty(exports, "decodeHTML", ({ enumerable: true, get: function () { return decode_2.decodeHTML; } }));\nObject.defineProperty(exports, "decodeHTMLStrict", ({ enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } }));\n// Legacy aliases (deprecated)\nObject.defineProperty(exports, "decodeHTML4", ({ enumerable: true, get: function () { return decode_2.decodeHTML; } }));\nObject.defineProperty(exports, "decodeHTML5", ({ enumerable: true, get: function () { return decode_2.decodeHTML; } }));\nObject.defineProperty(exports, "decodeHTML4Strict", ({ enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } }));\nObject.defineProperty(exports, "decodeHTML5Strict", ({ enumerable: true, get: function () { return decode_2.decodeHTMLStrict; } }));\nObject.defineProperty(exports, "decodeXMLStrict", ({ enumerable: true, get: function () { return decod
|
|||
|
/*!****************************************!*\
|
|||
|
!*** ./node_modules/es5-ext/global.js ***!
|
|||
|
\****************************************/module=>{eval('var naiveFallback = function () {\n\tif (typeof self === "object" && self) return self;\n\tif (typeof window === "object" && window) return window;\n\tthrow new Error("Unable to resolve global `this`");\n};\n\nmodule.exports = (function () {\n\tif (this) return this;\n\n\t// Unexpected strict mode (may happen if e.g. bundled into ESM module)\n\n\t// Fallback to standard globalThis if available\n\tif (typeof globalThis === "object" && globalThis) return globalThis;\n\n\t// Thanks @mathiasbynens -> https://mathiasbynens.be/notes/globalthis\n\t// In all ES5+ engines global object inherits from Object.prototype\n\t// (if you approached one that doesn\'t please report)\n\ttry {\n\t\tObject.defineProperty(Object.prototype, "__global__", {\n\t\t\tget: function () { return this; },\n\t\t\tconfigurable: true\n\t\t});\n\t} catch (error) {\n\t\t// Unfortunate case of updates to Object.prototype being restricted\n\t\t// via preventExtensions, seal or freeze\n\t\treturn naiveFallback();\n\t}\n\ttry {\n\t\t// Safari case (window.__global__ works, but __global__ does not)\n\t\tif (!__global__) return naiveFallback();\n\t\treturn __global__;\n\t} finally {\n\t\tdelete Object.prototype.__global__;\n\t}\n})();\n\n\n//# sourceURL=webpack://telegram/./node_modules/es5-ext/global.js?')},"./node_modules/htmlparser2/lib/FeedHandler.js":
|
|||
|
/*!*****************************************************!*\
|
|||
|
!*** ./node_modules/htmlparser2/lib/FeedHandler.js ***!
|
|||
|
\*****************************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== "function" && b !== null)\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, "default", { enumerable: true, value: v });\n}) : function(o, v) {\n o["default"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.parseFeed = exports.FeedHandler = void 0;\nvar domhandler_1 = __importDefault(__webpack_require__(/*! domhandler */ "./node_modules/domhandler/lib/index.js"));\nvar DomUtils = __importStar(__webpack_require__(/*! domutils */ "./node_modules/domutils/lib/index.js"));\nvar Parser_1 = __webpack_require__(/*! ./Parser */ "./node_modules/htmlparser2/lib/Parser.js");\nvar FeedItemMediaMedium;\n(function (FeedItemMediaMedium) {\n FeedItemMediaMedium[FeedItemMediaMedium["image"] = 0] = "image";\n FeedItemMediaMedium[FeedItemMediaMedium["audio"] = 1] = "audio";\n FeedItemMediaMedium[FeedItemMediaMedium["video"] = 2] = "video";\n FeedItemMediaMedium[FeedItemMediaMedium["document"] = 3] = "document";\n FeedItemMediaMedium[FeedItemMediaMedium["executable"] = 4] = "executable";\n})(FeedItemMediaMedium || (FeedItemMediaMedium = {}));\nvar FeedItemMediaExpression;\n(function (FeedItemMediaExpression) {\n FeedItemMediaExpression[FeedItemMediaExpression["sample"] = 0] = "sample";\n FeedItemMediaExpression[FeedItemMediaExpression["full"] = 1] = "full";\n FeedItemMediaExpression[FeedItemMediaExpression["nonstop"] = 2] = "nonstop";\n})(FeedItemMediaExpression || (FeedItemMediaExpression = {}));\n// TODO: Consume data as it is coming in\nvar FeedHandler = /** @class */ (function (_super) {\n __extends(FeedHandler, _super);\n /**\n *\n * @param callback\n * @param options\n */\n function FeedHandler(callback, options) {\n var _this = this;\n if (typeof callback === "object") {\n callback = undefined;\n options = callback;\n }\n _this = _super.call(this, callback, options) || this;\n return _this;\n }\n FeedHandler.prototype.onend = function () {\n var _a, _b;\n var feedRoot = getOneElement(isValidFeed, this.dom);\n if (!feedRoot) {\n this.handleCallback(new Error("couldn\'t find root of feed"));\n return;\n }\n var feed = {};\n if (feedRoot.name === "feed") {\n var childs = feedRoot.ch
|
|||
|
/*!************************************************!*\
|
|||
|
!*** ./node_modules/htmlparser2/lib/Parser.js ***!
|
|||
|
\************************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.Parser = void 0;\nvar Tokenizer_1 = __importDefault(__webpack_require__(/*! ./Tokenizer */ "./node_modules/htmlparser2/lib/Tokenizer.js"));\nvar formTags = new Set([\n "input",\n "option",\n "optgroup",\n "select",\n "button",\n "datalist",\n "textarea",\n]);\nvar pTag = new Set(["p"]);\nvar openImpliesClose = {\n tr: new Set(["tr", "th", "td"]),\n th: new Set(["th"]),\n td: new Set(["thead", "th", "td"]),\n body: new Set(["head", "link", "script"]),\n li: new Set(["li"]),\n p: pTag,\n h1: pTag,\n h2: pTag,\n h3: pTag,\n h4: pTag,\n h5: pTag,\n h6: pTag,\n select: formTags,\n input: formTags,\n output: formTags,\n button: formTags,\n datalist: formTags,\n textarea: formTags,\n option: new Set(["option"]),\n optgroup: new Set(["optgroup", "option"]),\n dd: new Set(["dt", "dd"]),\n dt: new Set(["dt", "dd"]),\n address: pTag,\n article: pTag,\n aside: pTag,\n blockquote: pTag,\n details: pTag,\n div: pTag,\n dl: pTag,\n fieldset: pTag,\n figcaption: pTag,\n figure: pTag,\n footer: pTag,\n form: pTag,\n header: pTag,\n hr: pTag,\n main: pTag,\n nav: pTag,\n ol: pTag,\n pre: pTag,\n section: pTag,\n table: pTag,\n ul: pTag,\n rt: new Set(["rt", "rp"]),\n rp: new Set(["rt", "rp"]),\n tbody: new Set(["thead", "tbody"]),\n tfoot: new Set(["thead", "tbody"]),\n};\nvar voidElements = new Set([\n "area",\n "base",\n "basefont",\n "br",\n "col",\n "command",\n "embed",\n "frame",\n "hr",\n "img",\n "input",\n "isindex",\n "keygen",\n "link",\n "meta",\n "param",\n "source",\n "track",\n "wbr",\n]);\nvar foreignContextElements = new Set(["math", "svg"]);\nvar htmlIntegrationElements = new Set([\n "mi",\n "mo",\n "mn",\n "ms",\n "mtext",\n "annotation-xml",\n "foreignObject",\n "desc",\n "title",\n]);\nvar reNameEnd = /\\s|\\//;\nvar Parser = /** @class */ (function () {\n function Parser(cbs, options) {\n if (options === void 0) { options = {}; }\n var _a, _b, _c, _d, _e;\n /** The start index of the last event. */\n this.startIndex = 0;\n /** The end index of the last event. */\n this.endIndex = null;\n this.tagname = "";\n this.attribname = "";\n this.attribvalue = "";\n this.attribs = null;\n this.stack = [];\n this.foreignContext = [];\n this.options = options;\n this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};\n this.lowerCaseTagNames = (_a = options.lowerCaseTags) !== null && _a !== void 0 ? _a : !options.xmlMode;\n this.lowerCaseAttributeNames =\n (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : !options.xmlMode;\n this.tokenizer = new ((_c = options.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer_1.default)(this.options, this);\n (_e = (_d = this.cbs).onparserinit) === null || _e === void 0 ? void 0 : _e.call(_d, this);\n }\n Parser.prototype.updatePosition = function (initialOffset) {\n if (this.endIndex === null) {\n if (this.tokenizer.sectionStart <= initialOffset) {\n this.startIndex = 0;\n }\n else {\n this.startIndex = this.tokenizer.sectionStart - initialOffset;\n }\n }\n else {\n this.startIndex = this.endIndex + 1;\n }\n this.endIndex = this.tokenizer.getAbsoluteIndex();\n };\n // Tokenizer event handlers\n Parser.prototype.ontext = function (data) {\n var _a, _b;\n this.updatePosition(1);\n this.endIndex--
|
|||
|
/*!***************************************************!*\
|
|||
|
!*** ./node_modules/htmlparser2/lib/Tokenizer.js ***!
|
|||
|
\***************************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nvar decode_codepoint_1 = __importDefault(__webpack_require__(/*! entities/lib/decode_codepoint */ "./node_modules/entities/lib/decode_codepoint.js"));\nvar entities_json_1 = __importDefault(__webpack_require__(/*! entities/lib/maps/entities.json */ "./node_modules/entities/lib/maps/entities.json"));\nvar legacy_json_1 = __importDefault(__webpack_require__(/*! entities/lib/maps/legacy.json */ "./node_modules/entities/lib/maps/legacy.json"));\nvar xml_json_1 = __importDefault(__webpack_require__(/*! entities/lib/maps/xml.json */ "./node_modules/entities/lib/maps/xml.json"));\nfunction whitespace(c) {\n return c === " " || c === "\\n" || c === "\\t" || c === "\\f" || c === "\\r";\n}\nfunction isASCIIAlpha(c) {\n return (c >= "a" && c <= "z") || (c >= "A" && c <= "Z");\n}\nfunction ifElseState(upper, SUCCESS, FAILURE) {\n var lower = upper.toLowerCase();\n if (upper === lower) {\n return function (t, c) {\n if (c === lower) {\n t._state = SUCCESS;\n }\n else {\n t._state = FAILURE;\n t._index--;\n }\n };\n }\n return function (t, c) {\n if (c === lower || c === upper) {\n t._state = SUCCESS;\n }\n else {\n t._state = FAILURE;\n t._index--;\n }\n };\n}\nfunction consumeSpecialNameChar(upper, NEXT_STATE) {\n var lower = upper.toLowerCase();\n return function (t, c) {\n if (c === lower || c === upper) {\n t._state = NEXT_STATE;\n }\n else {\n t._state = 3 /* InTagName */;\n t._index--; // Consume the token again\n }\n };\n}\nvar stateBeforeCdata1 = ifElseState("C", 24 /* BeforeCdata2 */, 16 /* InDeclaration */);\nvar stateBeforeCdata2 = ifElseState("D", 25 /* BeforeCdata3 */, 16 /* InDeclaration */);\nvar stateBeforeCdata3 = ifElseState("A", 26 /* BeforeCdata4 */, 16 /* InDeclaration */);\nvar stateBeforeCdata4 = ifElseState("T", 27 /* BeforeCdata5 */, 16 /* InDeclaration */);\nvar stateBeforeCdata5 = ifElseState("A", 28 /* BeforeCdata6 */, 16 /* InDeclaration */);\nvar stateBeforeScript1 = consumeSpecialNameChar("R", 35 /* BeforeScript2 */);\nvar stateBeforeScript2 = consumeSpecialNameChar("I", 36 /* BeforeScript3 */);\nvar stateBeforeScript3 = consumeSpecialNameChar("P", 37 /* BeforeScript4 */);\nvar stateBeforeScript4 = consumeSpecialNameChar("T", 38 /* BeforeScript5 */);\nvar stateAfterScript1 = ifElseState("R", 40 /* AfterScript2 */, 1 /* Text */);\nvar stateAfterScript2 = ifElseState("I", 41 /* AfterScript3 */, 1 /* Text */);\nvar stateAfterScript3 = ifElseState("P", 42 /* AfterScript4 */, 1 /* Text */);\nvar stateAfterScript4 = ifElseState("T", 43 /* AfterScript5 */, 1 /* Text */);\nvar stateBeforeStyle1 = consumeSpecialNameChar("Y", 45 /* BeforeStyle2 */);\nvar stateBeforeStyle2 = consumeSpecialNameChar("L", 46 /* BeforeStyle3 */);\nvar stateBeforeStyle3 = consumeSpecialNameChar("E", 47 /* BeforeStyle4 */);\nvar stateAfterStyle1 = ifElseState("Y", 49 /* AfterStyle2 */, 1 /* Text */);\nvar stateAfterStyle2 = ifElseState("L", 50 /* AfterStyle3 */, 1 /* Text */);\nvar stateAfterStyle3 = ifElseState("E", 51 /* AfterStyle4 */, 1 /* Text */);\nvar stateBeforeSpecialT = consumeSpecialNameChar("I", 54 /* BeforeTitle1 */);\nvar stateBeforeTitle1 = consumeSpecialNameChar("T", 55 /* BeforeTitle2 */);\nvar stateBeforeTitle2 = consumeSpecialNameChar("L", 56 /* BeforeTitle3 */);\nvar stateBeforeTitle3 = consumeSpecialNameChar("E", 57 /* BeforeTitle4 */);\nvar stateAfterSpecialTEnd = ifElseState("I", 58 /* AfterTitle1 */, 1 /* Text */);\nvar stateAfterTitle1 = ifElseState("T", 59 /* AfterTitle2 */, 1 /* Text */);\nvar stateAfterTitle2 = ifElseS
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/htmlparser2/lib/index.js ***!
|
|||
|
\***********************************************/function(__unused_webpack_module,exports,__webpack_require__){"use strict";eval('\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, "default", { enumerable: true, value: v });\n}) : function(o, v) {\n o["default"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { "default": mod };\n};\nObject.defineProperty(exports, "__esModule", ({ value: true }));\nexports.RssHandler = exports.DefaultHandler = exports.DomUtils = exports.ElementType = exports.Tokenizer = exports.createDomStream = exports.parseDOM = exports.parseDocument = exports.DomHandler = exports.Parser = void 0;\nvar Parser_1 = __webpack_require__(/*! ./Parser */ "./node_modules/htmlparser2/lib/Parser.js");\nObject.defineProperty(exports, "Parser", ({ enumerable: true, get: function () { return Parser_1.Parser; } }));\nvar domhandler_1 = __webpack_require__(/*! domhandler */ "./node_modules/domhandler/lib/index.js");\nObject.defineProperty(exports, "DomHandler", ({ enumerable: true, get: function () { return domhandler_1.DomHandler; } }));\nObject.defineProperty(exports, "DefaultHandler", ({ enumerable: true, get: function () { return domhandler_1.DomHandler; } }));\n// Helper methods\n/**\n * Parses the data, returns the resulting document.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n */\nfunction parseDocument(data, options) {\n var handler = new domhandler_1.DomHandler(undefined, options);\n new Parser_1.Parser(handler, options).end(data);\n return handler.root;\n}\nexports.parseDocument = parseDocument;\n/**\n * Parses data, returns an array of the root nodes.\n *\n * Note that the root nodes still have a `Document` node as their parent.\n * Use `parseDocument` to get the `Document` node instead.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n * @deprecated Use `parseDocument` instead.\n */\nfunction parseDOM(data, options) {\n return parseDocument(data, options).children;\n}\nexports.parseDOM = parseDOM;\n/**\n * Creates a parser instance, with an attached DOM handler.\n *\n * @param cb A callback that will be called once parsing has been completed.\n * @param options Optional options for the parser and DOM builder.\n * @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM.\n */\nfunction createDomStream(cb, options, elementCb) {\n var handler = new domhandler_1.DomHandler(cb, options, elementCb);\n return new Parser_1.Parser(handler, options);\n}\nexports.createDomStream = createDomStream;\nvar Tokenizer_1 = __webpack_require__(/*! ./Tokenizer */ "./node_modules/htmlparser2/lib/Tokenizer.js");\nObject.defineProperty(exports, "Tokenizer", ({ enumerable: true, get: function () { return __importDefault(Tokenizer_1).default; } }));\nvar ElementType = __importStar(__webpack_require__(/*! domelementtype */ "./node_modules/domelementtype/lib/index.js"));\nexports.ElementType = ElementType;\
|
|||
|
/*!***************************************!*\
|
|||
|
!*** ./node_modules/ieee754/index.js ***!
|
|||
|
\***************************************/(__unused_webpack_module,exports)=>{eval("/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n\n\n//# sourceURL=webpack://telegram/./node_modules/ieee754/index.js?")},"./node_modules/mime/Mime.js":
|
|||
|
/*!***********************************!*\
|
|||
|
!*** ./node_modules/mime/Mime.js ***!
|
|||
|
\***********************************/module=>{"use strict";eval("\n\n/**\n * @param typeMap [Object] Map of MIME type -> Array[extensions]\n * @param ...\n */\nfunction Mime() {\n this._types = Object.create(null);\n this._extensions = Object.create(null);\n\n for (let i = 0; i < arguments.length; i++) {\n this.define(arguments[i]);\n }\n\n this.define = this.define.bind(this);\n this.getType = this.getType.bind(this);\n this.getExtension = this.getExtension.bind(this);\n}\n\n/**\n * Define mimetype -> extension mappings. Each key is a mime-type that maps\n * to an array of extensions associated with the type. The first extension is\n * used as the default extension for the type.\n *\n * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});\n *\n * If a type declares an extension that has already been defined, an error will\n * be thrown. To suppress this error and force the extension to be associated\n * with the new type, pass `force`=true. Alternatively, you may prefix the\n * extension with \"*\" to map the type to extension, without mapping the\n * extension to the type.\n *\n * e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']});\n *\n *\n * @param map (Object) type definitions\n * @param force (Boolean) if true, force overriding of existing definitions\n */\nMime.prototype.define = function(typeMap, force) {\n for (let type in typeMap) {\n let extensions = typeMap[type].map(function(t) {\n return t.toLowerCase();\n });\n type = type.toLowerCase();\n\n for (let i = 0; i < extensions.length; i++) {\n const ext = extensions[i];\n\n // '*' prefix = not the preferred type for this extension. So fixup the\n // extension, and skip it.\n if (ext[0] === '*') {\n continue;\n }\n\n if (!force && (ext in this._types)) {\n throw new Error(\n 'Attempt to change mapping for \"' + ext +\n '\" extension from \"' + this._types[ext] + '\" to \"' + type +\n '\". Pass `force=true` to allow this, otherwise remove \"' + ext +\n '\" from the list of extensions for \"' + type + '\".'\n );\n }\n\n this._types[ext] = type;\n }\n\n // Use first extension as default\n if (force || !this._extensions[type]) {\n const ext = extensions[0];\n this._extensions[type] = (ext[0] !== '*') ? ext : ext.substr(1);\n }\n }\n};\n\n/**\n * Lookup a mime type based on extension\n */\nMime.prototype.getType = function(path) {\n path = String(path);\n let last = path.replace(/^.*[/\\\\]/, '').toLowerCase();\n let ext = last.replace(/^.*\\./, '').toLowerCase();\n\n let hasPath = last.length < path.length;\n let hasDot = ext.length < last.length - 1;\n\n return (hasDot || !hasPath) && this._types[ext] || null;\n};\n\n/**\n * Return file extension associated with a mime type\n */\nMime.prototype.getExtension = function(type) {\n type = /^\\s*([^;\\s]*)/.test(type) && RegExp.$1;\n return type && this._extensions[type.toLowerCase()] || null;\n};\n\nmodule.exports = Mime;\n\n\n//# sourceURL=webpack://telegram/./node_modules/mime/Mime.js?")},"./node_modules/mime/index.js":
|
|||
|
/*!************************************!*\
|
|||
|
!*** ./node_modules/mime/index.js ***!
|
|||
|
\************************************/(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\nlet Mime = __webpack_require__(/*! ./Mime */ "./node_modules/mime/Mime.js");\nmodule.exports = new Mime(__webpack_require__(/*! ./types/standard */ "./node_modules/mime/types/standard.js"), __webpack_require__(/*! ./types/other */ "./node_modules/mime/types/other.js"));\n\n\n//# sourceURL=webpack://telegram/./node_modules/mime/index.js?')},"./node_modules/mime/types/other.js":
|
|||
|
/*!******************************************!*\
|
|||
|
!*** ./node_modules/mime/types/other.js ***!
|
|||
|
\******************************************/module=>{eval('module.exports = {"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans
|
|||
|
/*!*********************************************!*\
|
|||
|
!*** ./node_modules/mime/types/standard.js ***!
|
|||
|
\*********************************************/module=>{eval('module.exports = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"appl
|
|||
|
/*!************************************!*\
|
|||
|
!*** ./node_modules/pako/index.js ***!
|
|||
|
\************************************/(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('// Top level file is just a mixin of submodules & constants\n\n\nconst { Deflate, deflate, deflateRaw, gzip } = __webpack_require__(/*! ./lib/deflate */ "./node_modules/pako/lib/deflate.js");\n\nconst { Inflate, inflate, inflateRaw, ungzip } = __webpack_require__(/*! ./lib/inflate */ "./node_modules/pako/lib/inflate.js");\n\nconst constants = __webpack_require__(/*! ./lib/zlib/constants */ "./node_modules/pako/lib/zlib/constants.js");\n\nmodule.exports.Deflate = Deflate;\nmodule.exports.deflate = deflate;\nmodule.exports.deflateRaw = deflateRaw;\nmodule.exports.gzip = gzip;\nmodule.exports.Inflate = Inflate;\nmodule.exports.inflate = inflate;\nmodule.exports.inflateRaw = inflateRaw;\nmodule.exports.ungzip = ungzip;\nmodule.exports.constants = constants;\n\n\n//# sourceURL=webpack://telegram/./node_modules/pako/index.js?')},"./node_modules/pako/lib/deflate.js":
|
|||
|
/*!******************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/deflate.js ***!
|
|||
|
\******************************************/(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\n\nconst zlib_deflate = __webpack_require__(/*! ./zlib/deflate */ \"./node_modules/pako/lib/zlib/deflate.js\");\nconst utils = __webpack_require__(/*! ./utils/common */ \"./node_modules/pako/lib/utils/common.js\");\nconst strings = __webpack_require__(/*! ./utils/strings */ \"./node_modules/pako/lib/utils/strings.js\");\nconst msg = __webpack_require__(/*! ./zlib/messages */ \"./node_modules/pako/lib/zlib/messages.js\");\nconst ZStream = __webpack_require__(/*! ./zlib/zstream */ \"./node_modules/pako/lib/zlib/zstream.js\");\n\nconst toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END,\n Z_DEFAULT_COMPRESSION,\n Z_DEFAULT_STRATEGY,\n Z_DEFLATED\n} = __webpack_require__(/*! ./zlib/constants */ \"./node_modules/pako/lib/zlib/constants.js\");\n\n/* ===========================================================================*/\n\n\n/**\n * class Deflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[deflate]],\n * [[deflateRaw]] and [[gzip]].\n **/\n\n/* internal\n * Deflate.chunks -> Array\n *\n * Chunks of output data, if [[Deflate#onData]] not overridden.\n **/\n\n/**\n * Deflate.result -> Uint8Array\n *\n * Compressed result, generated by default [[Deflate#onData]]\n * and [[Deflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Deflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Deflate.err -> Number\n *\n * Error code after deflate finished. 0 (Z_OK) on success.\n * You will not need it in real life, because deflate errors\n * are possible only on wrong options or bad `onData` / `onEnd`\n * custom handlers.\n **/\n\n/**\n * Deflate.msg -> String\n *\n * Error message, if [[Deflate.err]] != 0\n **/\n\n\n/**\n * new Deflate(options)\n * - options (Object): zlib deflate options.\n *\n * Creates new deflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `level`\n * - `windowBits`\n * - `memLevel`\n * - `strategy`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw deflate\n * - `gzip` (Boolean) - create gzip wrapper\n * - `header` (Object) - custom header for gzip\n * - `text` (Boolean) - true if compressed data believed to be text\n * - `time` (Number) - modification time, unix timestamp\n * - `os` (Number) - operation system code\n * - `extra` (Array) - array of bytes with extra data (max 65536)\n * - `name` (String) - file name (binary string)\n * - `comment` (String) - comment (binary string)\n * - `hcrc` (Boolean) - true if header crc should be added\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const deflate = new pako.Deflate({ level: 3});\n *\n * deflate.push(chunk1, false);\n * deflate.push(chunk2, true); // true -> last chunk\n *\n * if (deflate.err) { throw new Error(deflate.err); }\n *\n * console.log(deflate.result);\n * ```\n **/\nfunction Deflate(options) {\n this.options = utils.assign({\n level: Z_DEFAULT_COMPRESSION,\n method: Z_DEFLATED,\n chunkSize: 16384,\n windowBits: 15,\n memLevel: 8,\n strategy: Z_DEFAULT_STRATEGY\n }, options || {});\n\n let opt = this.options;\n\n if (opt.raw && (opt.windowBits > 0)) {\n opt.windowBits = -opt.windowBits;\n }\n\n else if (opt.gzip && (opt.windowBits > 0) && (opt.windowBits < 16)) {\n opt.windowBit
|
|||
|
/*!******************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/inflate.js ***!
|
|||
|
\******************************************/(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval("\n\n\nconst zlib_inflate = __webpack_require__(/*! ./zlib/inflate */ \"./node_modules/pako/lib/zlib/inflate.js\");\nconst utils = __webpack_require__(/*! ./utils/common */ \"./node_modules/pako/lib/utils/common.js\");\nconst strings = __webpack_require__(/*! ./utils/strings */ \"./node_modules/pako/lib/utils/strings.js\");\nconst msg = __webpack_require__(/*! ./zlib/messages */ \"./node_modules/pako/lib/zlib/messages.js\");\nconst ZStream = __webpack_require__(/*! ./zlib/zstream */ \"./node_modules/pako/lib/zlib/zstream.js\");\nconst GZheader = __webpack_require__(/*! ./zlib/gzheader */ \"./node_modules/pako/lib/zlib/gzheader.js\");\n\nconst toString = Object.prototype.toString;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_FINISH,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR\n} = __webpack_require__(/*! ./zlib/constants */ \"./node_modules/pako/lib/zlib/constants.js\");\n\n/* ===========================================================================*/\n\n\n/**\n * class Inflate\n *\n * Generic JS-style wrapper for zlib calls. If you don't need\n * streaming behaviour - use more simple functions: [[inflate]]\n * and [[inflateRaw]].\n **/\n\n/* internal\n * inflate.chunks -> Array\n *\n * Chunks of output data, if [[Inflate#onData]] not overridden.\n **/\n\n/**\n * Inflate.result -> Uint8Array|String\n *\n * Uncompressed result, generated by default [[Inflate#onData]]\n * and [[Inflate#onEnd]] handlers. Filled after you push last chunk\n * (call [[Inflate#push]] with `Z_FINISH` / `true` param).\n **/\n\n/**\n * Inflate.err -> Number\n *\n * Error code after inflate finished. 0 (Z_OK) on success.\n * Should be checked if broken data possible.\n **/\n\n/**\n * Inflate.msg -> String\n *\n * Error message, if [[Inflate.err]] != 0\n **/\n\n\n/**\n * new Inflate(options)\n * - options (Object): zlib inflate options.\n *\n * Creates new inflator instance with specified params. Throws exception\n * on bad params. Supported options:\n *\n * - `windowBits`\n * - `dictionary`\n *\n * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)\n * for more information on these.\n *\n * Additional options, for internal needs:\n *\n * - `chunkSize` - size of generated data chunks (16K by default)\n * - `raw` (Boolean) - do raw inflate\n * - `to` (String) - if equal to 'string', then result will be converted\n * from utf8 to utf16 (javascript) string. When string output requested,\n * chunk length can differ from `chunkSize`, depending on content.\n *\n * By default, when no options set, autodetect deflate/gzip data format via\n * wrapper header.\n *\n * ##### Example:\n *\n * ```javascript\n * const pako = require('pako')\n * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])\n * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);\n *\n * const inflate = new pako.Inflate({ level: 3});\n *\n * inflate.push(chunk1, false);\n * inflate.push(chunk2, true); // true -> last chunk\n *\n * if (inflate.err) { throw new Error(inflate.err); }\n *\n * console.log(inflate.result);\n * ```\n **/\nfunction Inflate(options) {\n this.options = utils.assign({\n chunkSize: 1024 * 64,\n windowBits: 15,\n to: ''\n }, options || {});\n\n const opt = this.options;\n\n // Force window size for `raw` data, if not set directly,\n // because we have no header for autodetect.\n if (opt.raw && (opt.windowBits >= 0) && (opt.windowBits < 16)) {\n opt.windowBits = -opt.windowBits;\n if (opt.windowBits === 0) { opt.windowBits = -15; }\n }\n\n // If `windowBits` not defined (and mode not raw) - set autodetect flag for gzip/deflate\n if ((opt.windowBits >= 0) && (opt.windowBits < 16) &&\n !(options && options.windowBits)) {\n opt.windowBits += 32;\n }\n\n // Gzip header has n
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/utils/common.js ***!
|
|||
|
\***********************************************/module=>{"use strict";eval("\n\n\nconst _has = (obj, key) => {\n return Object.prototype.hasOwnProperty.call(obj, key);\n};\n\nmodule.exports.assign = function (obj /*from1, from2, from3, ...*/) {\n const sources = Array.prototype.slice.call(arguments, 1);\n while (sources.length) {\n const source = sources.shift();\n if (!source) { continue; }\n\n if (typeof source !== 'object') {\n throw new TypeError(source + 'must be non-object');\n }\n\n for (const p in source) {\n if (_has(source, p)) {\n obj[p] = source[p];\n }\n }\n }\n\n return obj;\n};\n\n\n// Join array of chunks to single array.\nmodule.exports.flattenChunks = (chunks) => {\n // calculate data length\n let len = 0;\n\n for (let i = 0, l = chunks.length; i < l; i++) {\n len += chunks[i].length;\n }\n\n // join chunks\n const result = new Uint8Array(len);\n\n for (let i = 0, pos = 0, l = chunks.length; i < l; i++) {\n let chunk = chunks[i];\n result.set(chunk, pos);\n pos += chunk.length;\n }\n\n return result;\n};\n\n\n//# sourceURL=webpack://telegram/./node_modules/pako/lib/utils/common.js?")},"./node_modules/pako/lib/utils/strings.js":
|
|||
|
/*!************************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/utils/strings.js ***!
|
|||
|
\************************************************/module=>{"use strict";eval("// String encode/decode helpers\n\n\n\n// Quick check if we can use fast array to bin string conversion\n//\n// - apply(Array) can fail on Android 2.2\n// - apply(Uint8Array) can fail on iOS 5.1 Safari\n//\nlet STR_APPLY_UIA_OK = true;\n\ntry { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (__) { STR_APPLY_UIA_OK = false; }\n\n\n// Table with utf8 lengths (calculated by first byte of sequence)\n// Note, that 5 & 6-byte values and some 4-byte values can not be represented in JS,\n// because max possible codepoint is 0x10ffff\nconst _utf8len = new Uint8Array(256);\nfor (let q = 0; q < 256; q++) {\n _utf8len[q] = (q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1);\n}\n_utf8len[254] = _utf8len[254] = 1; // Invalid sequence start\n\n\n// convert string to array (typed, when possible)\nmodule.exports.string2buf = (str) => {\n if (typeof TextEncoder === 'function' && TextEncoder.prototype.encode) {\n return new TextEncoder().encode(str);\n }\n\n let buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0;\n\n // count binary size\n for (m_pos = 0; m_pos < str_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n buf_len += c < 0x80 ? 1 : c < 0x800 ? 2 : c < 0x10000 ? 3 : 4;\n }\n\n // allocate buffer\n buf = new Uint8Array(buf_len);\n\n // convert\n for (i = 0, m_pos = 0; i < buf_len; m_pos++) {\n c = str.charCodeAt(m_pos);\n if ((c & 0xfc00) === 0xd800 && (m_pos + 1 < str_len)) {\n c2 = str.charCodeAt(m_pos + 1);\n if ((c2 & 0xfc00) === 0xdc00) {\n c = 0x10000 + ((c - 0xd800) << 10) + (c2 - 0xdc00);\n m_pos++;\n }\n }\n if (c < 0x80) {\n /* one byte */\n buf[i++] = c;\n } else if (c < 0x800) {\n /* two bytes */\n buf[i++] = 0xC0 | (c >>> 6);\n buf[i++] = 0x80 | (c & 0x3f);\n } else if (c < 0x10000) {\n /* three bytes */\n buf[i++] = 0xE0 | (c >>> 12);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n } else {\n /* four bytes */\n buf[i++] = 0xf0 | (c >>> 18);\n buf[i++] = 0x80 | (c >>> 12 & 0x3f);\n buf[i++] = 0x80 | (c >>> 6 & 0x3f);\n buf[i++] = 0x80 | (c & 0x3f);\n }\n }\n\n return buf;\n};\n\n// Helper\nconst buf2binstring = (buf, len) => {\n // On Chrome, the arguments in a function call that are allowed is `65534`.\n // If the length of the buffer is smaller than that, we can use this optimization,\n // otherwise we will take a slower path.\n if (len < 65534) {\n if (buf.subarray && STR_APPLY_UIA_OK) {\n return String.fromCharCode.apply(null, buf.length === len ? buf : buf.subarray(0, len));\n }\n }\n\n let result = '';\n for (let i = 0; i < len; i++) {\n result += String.fromCharCode(buf[i]);\n }\n return result;\n};\n\n\n// convert array to string\nmodule.exports.buf2string = (buf, max) => {\n const len = max || buf.length;\n\n if (typeof TextDecoder === 'function' && TextDecoder.prototype.decode) {\n return new TextDecoder().decode(buf.subarray(0, max));\n }\n\n let i, out;\n\n // Reserve max possible length (2 words per char)\n // NB: by unknown reasons, Array is significantly faster for\n // String.fromCharCode.apply than Uint16Array.\n const utf16buf = new Array(len * 2);\n\n for (out = 0, i = 0; i < len;) {\n let c = buf[i++];\n // quick process ascii\n if (c < 0x80) { utf16buf[out++] = c; continue; }\n\n let c_len = _utf8len[c];\n // skip 5 & 6 byte codes\n if (c_len > 4) { utf16buf[out++] = 0xfffd; i += c_len - 1; continue; }\n\n // apply mask on first byte\n c &= c_len === 2 ? 0x1f : c_len === 3 ? 0x0f : 0x07;\n // join the rest\n while (c_len > 1 && i < len) {\n c = (c << 6) | (buf[i++] & 0x3f);\n c_len--;\n }\n\n // te
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/zlib/adler32.js ***!
|
|||
|
\***********************************************/module=>{"use strict";eval("\n\n// Note: adler32 takes 12% for level 0 and 2% for level 6.\n// It isn't worth it to make additional optimizations as in original.\n// Small size is preferable.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = (adler, buf, len, pos) => {\n let s1 = (adler & 0xffff) |0,\n s2 = ((adler >>> 16) & 0xffff) |0,\n n = 0;\n\n while (len !== 0) {\n // Set limit ~ twice less than 5552, to keep\n // s2 in 31-bits, because we force signed ints.\n // in other case %= will fail.\n n = len > 2000 ? 2000 : len;\n len -= n;\n\n do {\n s1 = (s1 + buf[pos++]) |0;\n s2 = (s2 + s1) |0;\n } while (--n);\n\n s1 %= 65521;\n s2 %= 65521;\n }\n\n return (s1 | (s2 << 16)) |0;\n};\n\n\nmodule.exports = adler32;\n\n\n//# sourceURL=webpack://telegram/./node_modules/pako/lib/zlib/adler32.js?")},"./node_modules/pako/lib/zlib/constants.js":
|
|||
|
/*!*************************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/zlib/constants.js ***!
|
|||
|
\*************************************************/module=>{"use strict";eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n\n /* Allowed flush values; see deflate() and inflate() below for details */\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_TREES: 6,\n\n /* Return codes for the compression/decompression functions. Negative values\n * are errors, positive values are used for special but normal events.\n */\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n //Z_VERSION_ERROR: -6,\n\n /* compression levels */\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n\n\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n\n /* Possible values of the data_type field (though see inflate()) */\n Z_BINARY: 0,\n Z_TEXT: 1,\n //Z_ASCII: 1, // = Z_TEXT (deprecated)\n Z_UNKNOWN: 2,\n\n /* The deflate compression method */\n Z_DEFLATED: 8\n //Z_NULL: null // Use -1 or null inline, depending on var type\n};\n\n\n//# sourceURL=webpack://telegram/./node_modules/pako/lib/zlib/constants.js?")},"./node_modules/pako/lib/zlib/crc32.js":
|
|||
|
/*!*********************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/zlib/crc32.js ***!
|
|||
|
\*********************************************/module=>{"use strict";eval("\n\n// Note: we can't get significant speed boost here.\n// So write code to minimize size - no pregenerated tables\n// and array tools dependencies.\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// Use ordinary array, since untyped makes no boost here\nconst makeTable = () => {\n let c, table = [];\n\n for (var n = 0; n < 256; n++) {\n c = n;\n for (var k = 0; k < 8; k++) {\n c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));\n }\n table[n] = c;\n }\n\n return table;\n};\n\n// Create table on load. Just 255 signed longs. Not a problem.\nconst crcTable = new Uint32Array(makeTable());\n\n\nconst crc32 = (crc, buf, len, pos) => {\n const t = crcTable;\n const end = pos + len;\n\n crc ^= -1;\n\n for (let i = pos; i < end; i++) {\n crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];\n }\n\n return (crc ^ (-1)); // >>> 0;\n};\n\n\nmodule.exports = crc32;\n\n\n//# sourceURL=webpack://telegram/./node_modules/pako/lib/zlib/crc32.js?")},"./node_modules/pako/lib/zlib/deflate.js":
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/zlib/deflate.js ***!
|
|||
|
\***********************************************/(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided \'as-is\', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align } = __webpack_require__(/*! ./trees */ "./node_modules/pako/lib/zlib/trees.js");\nconst adler32 = __webpack_require__(/*! ./adler32 */ "./node_modules/pako/lib/zlib/adler32.js");\nconst crc32 = __webpack_require__(/*! ./crc32 */ "./node_modules/pako/lib/zlib/crc32.js");\nconst msg = __webpack_require__(/*! ./messages */ "./node_modules/pako/lib/zlib/messages.js");\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_NO_FLUSH, Z_PARTIAL_FLUSH, Z_FULL_FLUSH, Z_FINISH, Z_BLOCK,\n Z_OK, Z_STREAM_END, Z_STREAM_ERROR, Z_DATA_ERROR, Z_BUF_ERROR,\n Z_DEFAULT_COMPRESSION,\n Z_FILTERED, Z_HUFFMAN_ONLY, Z_RLE, Z_FIXED, Z_DEFAULT_STRATEGY,\n Z_UNKNOWN,\n Z_DEFLATED\n} = __webpack_require__(/*! ./constants */ "./node_modules/pako/lib/zlib/constants.js");\n\n/*============================================================================*/\n\n\nconst MAX_MEM_LEVEL = 9;\n/* Maximum value for memLevel in deflateInit2 */\nconst MAX_WBITS = 15;\n/* 32K LZ77 window */\nconst DEF_MEM_LEVEL = 8;\n\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\nconst D_CODES = 30;\n/* number of distance codes */\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\nconst MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);\n\nconst PRESET_DICT = 0x20;\n\nconst INIT_STATE = 42;\nconst EXTRA_STATE = 69;\nconst NAME_STATE = 73;\nconst COMMENT_STATE = 91;\nconst HCRC_STATE = 103;\nconst BUSY_STATE = 113;\nconst FINISH_STATE = 666;\n\nconst BS_NEED_MORE = 1; /* block not completed, need more input or more output */\nconst BS_BLOCK_DONE = 2; /* block flush performed */\nconst BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */\nconst BS_FINISH_DONE = 4; /* finish done, accept no more input or output */\n\nconst OS_CODE = 0x03; // Unix :) . Don\'t detect, use this default.\n\nconst err = (strm, errorCode) => {\n strm.msg = msg[errorCode];\n return errorCode;\n};\n\nconst rank = (f) => {\n return ((f) << 1) - ((f) > 4 ? 9 : 0);\n};\n\nconst zero = (buf) => {\n let len = buf.length; while (--len >= 0) { buf[len] = 0; }\n};\n\n\n/* eslint-disable new-cap */\nlet HASH_ZLIB = (s, prev, data) => ((prev << s.hash_shift) ^ data) & s.hash_mask;\n// This hash causes less collisions, https://github.com/nodeca/pako/issues/135\n// But breaks binary compatibility\n//let HASH_FAST = (s, pre
|
|||
|
/*!************************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/zlib/gzheader.js ***!
|
|||
|
\************************************************/module=>{"use strict";eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction GZheader() {\n /* true if compressed data believed to be text */\n this.text = 0;\n /* modification time */\n this.time = 0;\n /* extra flags (not used when writing a gzip file) */\n this.xflags = 0;\n /* operating system */\n this.os = 0;\n /* pointer to extra field or Z_NULL if none */\n this.extra = null;\n /* extra field length (valid if extra != Z_NULL) */\n this.extra_len = 0; // Actually, we don't need it in JS,\n // but leave for few code modifications\n\n //\n // Setup limits is not necessary because in js we should not preallocate memory\n // for inflate use constant limit in 65536 bytes\n //\n\n /* space at extra (only when reading header) */\n // this.extra_max = 0;\n /* pointer to zero-terminated file name or Z_NULL */\n this.name = '';\n /* space at name (only when reading header) */\n // this.name_max = 0;\n /* pointer to zero-terminated comment or Z_NULL */\n this.comment = '';\n /* space at comment (only when reading header) */\n // this.comm_max = 0;\n /* true if there was or will be a header crc */\n this.hcrc = 0;\n /* true when done reading gzip header (not used when writing a gzip file) */\n this.done = false;\n}\n\nmodule.exports = GZheader;\n\n\n//# sourceURL=webpack://telegram/./node_modules/pako/lib/zlib/gzheader.js?")},"./node_modules/pako/lib/zlib/inffast.js":
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/zlib/inffast.js ***!
|
|||
|
\***********************************************/module=>{"use strict";eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n// See state defs from inflate.js\nconst BAD = 30; /* got a data error -- remain here until reset */\nconst TYPE = 12; /* i: waiting for type bits, including last-flag bit */\n\n/*\n Decode literal, length, and distance codes and write out the resulting\n literal and match bytes until either not enough input or output is\n available, an end-of-block is encountered, or a data error is encountered.\n When large enough input and output buffers are supplied to inflate(), for\n example, a 16K input buffer and a 64K output buffer, more than 95% of the\n inflate execution time is spent in this routine.\n\n Entry assumptions:\n\n state.mode === LEN\n strm.avail_in >= 6\n strm.avail_out >= 258\n start >= strm.avail_out\n state.bits < 8\n\n On return, state.mode is one of:\n\n LEN -- ran out of enough output space or enough available input\n TYPE -- reached end of block code, inflate() to interpret next block\n BAD -- error in block data\n\n Notes:\n\n - The maximum input bits used by a length/distance pair is 15 bits for the\n length code, 5 bits for the length extra, 15 bits for the distance code,\n and 13 bits for the distance extra. This totals 48 bits, or six bytes.\n Therefore if strm.avail_in >= 6, then there is enough input to avoid\n checking for available input while decoding.\n\n - The maximum bytes that a single length/distance pair can output is 258\n bytes, which is the maximum length that can be coded. inflate_fast()\n requires strm.avail_out >= 258 for each loop to avoid checking for\n output space.\n */\nmodule.exports = function inflate_fast(strm, start) {\n let _in; /* local strm.input */\n let last; /* have enough input while in < last */\n let _out; /* local strm.output */\n let beg; /* inflate()'s initial strm.output */\n let end; /* while out < end, enough space available */\n//#ifdef INFLATE_STRICT\n let dmax; /* maximum distance from zlib header */\n//#endif\n let wsize; /* window size or zero if not using window */\n let whave; /* valid bytes in the window */\n let wnext; /* window write index */\n // Use `s_window` instead `window`, avoid conflict with instrumentation tools\n let s_window; /* allocated sliding window, if wsize != 0 */\n let hold; /* local strm.hold */\n let bits; /* local strm.bits */\n let lcode; /* local strm.lencode */\n let dcode; /* local strm.distcode */\n let lmask; /* mask for first level of length codes */\n let dmask; /* mask for first level of distance codes */\n let here; /* retrieved table entry */\n let op; /* code bits, operation, extra bits, or */\n
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/zlib/inflate.js ***!
|
|||
|
\***********************************************/(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";eval('\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided \'as-is\', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst adler32 = __webpack_require__(/*! ./adler32 */ "./node_modules/pako/lib/zlib/adler32.js");\nconst crc32 = __webpack_require__(/*! ./crc32 */ "./node_modules/pako/lib/zlib/crc32.js");\nconst inflate_fast = __webpack_require__(/*! ./inffast */ "./node_modules/pako/lib/zlib/inffast.js");\nconst inflate_table = __webpack_require__(/*! ./inftrees */ "./node_modules/pako/lib/zlib/inftrees.js");\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\nconst {\n Z_FINISH, Z_BLOCK, Z_TREES,\n Z_OK, Z_STREAM_END, Z_NEED_DICT, Z_STREAM_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_BUF_ERROR,\n Z_DEFLATED\n} = __webpack_require__(/*! ./constants */ "./node_modules/pako/lib/zlib/constants.js");\n\n\n/* STATES ====================================================================*/\n/* ===========================================================================*/\n\n\nconst HEAD = 1; /* i: waiting for magic header */\nconst FLAGS = 2; /* i: waiting for method and flags (gzip) */\nconst TIME = 3; /* i: waiting for modification time (gzip) */\nconst OS = 4; /* i: waiting for extra flags and operating system (gzip) */\nconst EXLEN = 5; /* i: waiting for extra length (gzip) */\nconst EXTRA = 6; /* i: waiting for extra bytes (gzip) */\nconst NAME = 7; /* i: waiting for end of file name (gzip) */\nconst COMMENT = 8; /* i: waiting for end of comment (gzip) */\nconst HCRC = 9; /* i: waiting for header crc (gzip) */\nconst DICTID = 10; /* i: waiting for dictionary check value */\nconst DICT = 11; /* waiting for inflateSetDictionary() call */\nconst TYPE = 12; /* i: waiting for type bits, including last-flag bit */\nconst TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */\nconst STORED = 14; /* i: waiting for stored size (length and complement) */\nconst COPY_ = 15; /* i/o: same as COPY below, but only first time in */\nconst COPY = 16; /* i/o: waiting for input or output to copy stored block */\nconst TABLE = 17; /* i: waiting for dynamic block table lengths */\nconst LENLENS = 18; /* i: waiting for code length code lengths */\nconst CODELENS = 19; /* i: waiting for length/lit and distance code lengths */\nconst LEN_ = 20; /* i: same as LEN below, but only first time in */\nconst LEN = 21; /* i: waiting for length/lit/eob code */\nconst LENEXT = 22; /* i: waiting for length extra bits */\nconst DIST = 23; /* i: waiting for distance code */\nconst DISTEXT = 24; /* i: waiting for distance extra bits */\nconst MATCH = 25; /* o: waiting for output space to copy string */\nconst LIT = 26;
|
|||
|
/*!************************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/zlib/inftrees.js ***!
|
|||
|
\************************************************/module=>{"use strict";eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nconst MAXBITS = 15;\nconst ENOUGH_LENS = 852;\nconst ENOUGH_DISTS = 592;\n//const ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);\n\nconst CODES = 0;\nconst LENS = 1;\nconst DISTS = 2;\n\nconst lbase = new Uint16Array([ /* Length codes 257..285 base */\n 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,\n 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0\n]);\n\nconst lext = new Uint8Array([ /* Length codes 257..285 extra */\n 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,\n 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78\n]);\n\nconst dbase = new Uint16Array([ /* Distance codes 0..29 base */\n 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,\n 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,\n 8193, 12289, 16385, 24577, 0, 0\n]);\n\nconst dext = new Uint8Array([ /* Distance codes 0..29 extra */\n 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,\n 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,\n 28, 28, 29, 29, 64, 64\n]);\n\nconst inflate_table = (type, lens, lens_index, codes, table, table_index, work, opts) =>\n{\n const bits = opts.bits;\n //here = opts.here; /* table entry for duplication */\n\n let len = 0; /* a code's length in bits */\n let sym = 0; /* index of code symbols */\n let min = 0, max = 0; /* minimum and maximum code lengths */\n let root = 0; /* number of index bits for root table */\n let curr = 0; /* number of index bits for current table */\n let drop = 0; /* code bits to drop for sub-table */\n let left = 0; /* number of prefix codes available */\n let used = 0; /* code entries in table used */\n let huff = 0; /* Huffman code */\n let incr; /* for incrementing code, index */\n let fill; /* index for replicating entries */\n let low; /* low bits for current root entry */\n let mask; /* mask for low root bits */\n let next; /* next available space in table */\n let base = null; /* base value table to use */\n let base_index = 0;\n// let shoextra; /* extra bits table to use */\n let end; /* use base and extra for symbol > end */\n const count = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */\n const offs = new Uint16Array(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */\n let extra = null;\n let extra_index = 0;\n\n let here_bits, here_op, here_val;\n\n /*\n Process a set of code lengths to create a canonical Huffman code. The\n code lengths are lens[0..codes-1]. Each length corresponds to the\n symbols 0..codes-1. The Huffman code is generated by first sorting the\n symbols by length from short to long, and retaining the symbol order\n for codes with equal lengths. Then the code starts with all zero bits\n for the first code of the shortest length, and the codes are integer
|
|||
|
/*!************************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/zlib/messages.js ***!
|
|||
|
\************************************************/module=>{"use strict";eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nmodule.exports = {\n 2: 'need dictionary', /* Z_NEED_DICT 2 */\n 1: 'stream end', /* Z_STREAM_END 1 */\n 0: '', /* Z_OK 0 */\n '-1': 'file error', /* Z_ERRNO (-1) */\n '-2': 'stream error', /* Z_STREAM_ERROR (-2) */\n '-3': 'data error', /* Z_DATA_ERROR (-3) */\n '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */\n '-5': 'buffer error', /* Z_BUF_ERROR (-5) */\n '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */\n};\n\n\n//# sourceURL=webpack://telegram/./node_modules/pako/lib/zlib/messages.js?")},"./node_modules/pako/lib/zlib/trees.js":
|
|||
|
/*!*********************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/zlib/trees.js ***!
|
|||
|
\*********************************************/module=>{"use strict";eval('\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided \'as-is\', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\n/* eslint-disable space-unary-ops */\n\n/* Public constants ==========================================================*/\n/* ===========================================================================*/\n\n\n//const Z_FILTERED = 1;\n//const Z_HUFFMAN_ONLY = 2;\n//const Z_RLE = 3;\nconst Z_FIXED = 4;\n//const Z_DEFAULT_STRATEGY = 0;\n\n/* Possible values of the data_type field (though see inflate()) */\nconst Z_BINARY = 0;\nconst Z_TEXT = 1;\n//const Z_ASCII = 1; // = Z_TEXT\nconst Z_UNKNOWN = 2;\n\n/*============================================================================*/\n\n\nfunction zero(buf) { let len = buf.length; while (--len >= 0) { buf[len] = 0; } }\n\n// From zutil.h\n\nconst STORED_BLOCK = 0;\nconst STATIC_TREES = 1;\nconst DYN_TREES = 2;\n/* The three kinds of block type */\n\nconst MIN_MATCH = 3;\nconst MAX_MATCH = 258;\n/* The minimum and maximum match lengths */\n\n// From deflate.h\n/* ===========================================================================\n * Internal compression state.\n */\n\nconst LENGTH_CODES = 29;\n/* number of length codes, not counting the special END_BLOCK code */\n\nconst LITERALS = 256;\n/* number of literal bytes 0..255 */\n\nconst L_CODES = LITERALS + 1 + LENGTH_CODES;\n/* number of Literal or Length codes, including the END_BLOCK code */\n\nconst D_CODES = 30;\n/* number of distance codes */\n\nconst BL_CODES = 19;\n/* number of codes used to transfer the bit lengths */\n\nconst HEAP_SIZE = 2 * L_CODES + 1;\n/* maximum heap size */\n\nconst MAX_BITS = 15;\n/* All codes must not exceed MAX_BITS bits */\n\nconst Buf_size = 16;\n/* size of bit buffer in bi_buf */\n\n\n/* ===========================================================================\n * Constants\n */\n\nconst MAX_BL_BITS = 7;\n/* Bit length codes must not exceed MAX_BL_BITS bits */\n\nconst END_BLOCK = 256;\n/* end of block literal code */\n\nconst REP_3_6 = 16;\n/* repeat previous bit length 3-6 times (2 bits of repeat count) */\n\nconst REPZ_3_10 = 17;\n/* repeat a zero length 3-10 times (3 bits of repeat count) */\n\nconst REPZ_11_138 = 18;\n/* repeat a zero length 11-138 times (7 bits of repeat count) */\n\n/* eslint-disable comma-spacing,array-bracket-spacing */\nconst extra_lbits = /* extra bits for each length code */\n new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]);\n\nconst extra_dbits = /* extra bits for each distance code */\n new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]);\n\nconst extra_blbits = /* extra bits for each bit length code */\n new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]);\n\nconst bl_order =\n new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);\n/* eslint-enable comma-spacing,array-bracket-spacing */\n\n/* The lengths of the bit length codes are sent in order of decreasing\n * probability,
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/pako/lib/zlib/zstream.js ***!
|
|||
|
\***********************************************/module=>{"use strict";eval("\n\n// (C) 1995-2013 Jean-loup Gailly and Mark Adler\n// (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin\n//\n// This software is provided 'as-is', without any express or implied\n// warranty. In no event will the authors be held liable for any damages\n// arising from the use of this software.\n//\n// Permission is granted to anyone to use this software for any purpose,\n// including commercial applications, and to alter it and redistribute it\n// freely, subject to the following restrictions:\n//\n// 1. The origin of this software must not be misrepresented; you must not\n// claim that you wrote the original software. If you use this software\n// in a product, an acknowledgment in the product documentation would be\n// appreciated but is not required.\n// 2. Altered source versions must be plainly marked as such, and must not be\n// misrepresented as being the original software.\n// 3. This notice may not be removed or altered from any source distribution.\n\nfunction ZStream() {\n /* next input byte */\n this.input = null; // JS specific, because we have no pointers\n this.next_in = 0;\n /* number of bytes available at input */\n this.avail_in = 0;\n /* total number of input bytes read so far */\n this.total_in = 0;\n /* next output byte should be put there */\n this.output = null; // JS specific, because we have no pointers\n this.next_out = 0;\n /* remaining free space at output */\n this.avail_out = 0;\n /* total number of bytes output so far */\n this.total_out = 0;\n /* last error message, NULL if no error */\n this.msg = ''/*Z_NULL*/;\n /* not visible by applications */\n this.state = null;\n /* best guess about the data type: binary or text */\n this.data_type = 2/*Z_UNKNOWN*/;\n /* adler32 value of the uncompressed data */\n this.adler = 0;\n}\n\nmodule.exports = ZStream;\n\n\n//# sourceURL=webpack://telegram/./node_modules/pako/lib/zlib/zstream.js?")},"./node_modules/store2/dist/store2.js":
|
|||
|
/*!********************************************!*\
|
|||
|
!*** ./node_modules/store2/dist/store2.js ***!
|
|||
|
\********************************************/function(module){eval("/*! store2 - v2.13.2 - 2022-03-14\n* Copyright (c) 2022 Nathan Bubna; Licensed (MIT OR GPL-3.0) */\n;(function(window, define) {\n var _ = {\n version: \"2.13.2\",\n areas: {},\n apis: {},\n\n // utilities\n inherit: function(api, o) {\n for (var p in api) {\n if (!o.hasOwnProperty(p)) {\n Object.defineProperty(o, p, Object.getOwnPropertyDescriptor(api, p));\n }\n }\n return o;\n },\n stringify: function(d, fn) {\n return d === undefined || typeof d === \"function\" ? d+'' : JSON.stringify(d,fn||_.replace);\n },\n parse: function(s, fn) {\n // if it doesn't parse, return as is\n try{ return JSON.parse(s,fn||_.revive); }catch(e){ return s; }\n },\n\n // extension hooks\n fn: function(name, fn) {\n _.storeAPI[name] = fn;\n for (var api in _.apis) {\n _.apis[api][name] = fn;\n }\n },\n get: function(area, key){ return area.getItem(key); },\n set: function(area, key, string){ area.setItem(key, string); },\n remove: function(area, key){ area.removeItem(key); },\n key: function(area, i){ return area.key(i); },\n length: function(area){ return area.length; },\n clear: function(area){ area.clear(); },\n\n // core functions\n Store: function(id, area, namespace) {\n var store = _.inherit(_.storeAPI, function(key, data, overwrite) {\n if (arguments.length === 0){ return store.getAll(); }\n if (typeof data === \"function\"){ return store.transact(key, data, overwrite); }// fn=data, alt=overwrite\n if (data !== undefined){ return store.set(key, data, overwrite); }\n if (typeof key === \"string\" || typeof key === \"number\"){ return store.get(key); }\n if (typeof key === \"function\"){ return store.each(key); }\n if (!key){ return store.clear(); }\n return store.setAll(key, data);// overwrite=data, data=key\n });\n store._id = id;\n try {\n var testKey = '__store2_test';\n area.setItem(testKey, 'ok');\n store._area = area;\n area.removeItem(testKey);\n } catch (e) {\n store._area = _.storage('fake');\n }\n store._ns = namespace || '';\n if (!_.areas[id]) {\n _.areas[id] = store._area;\n }\n if (!_.apis[store._ns+store._id]) {\n _.apis[store._ns+store._id] = store;\n }\n return store;\n },\n storeAPI: {\n // admin functions\n area: function(id, area) {\n var store = this[id];\n if (!store || !store.area) {\n store = _.Store(id, area, this._ns);//new area-specific api in this namespace\n if (!this[id]){ this[id] = store; }\n }\n return store;\n },\n namespace: function(namespace, singleArea) {\n if (!namespace){\n return this._ns ? this._ns.substring(0,this._ns.length-1) : '';\n }\n var ns = namespace, store = this[ns];\n if (!store || !store.namespace) {\n store = _.Store(this._id, this._area, this._ns+ns+'.');//new namespaced api\n if (!this[ns]){ this[ns] = store; }\n if (!singleArea) {\n for (var name in _.areas) {\n store.area(name, _.areas[name]);\n }\n }\n }\n return store;\n },\n isFake: function(force) {\n if (force) {\n this._real = this._area;\n
|
|||
|
/*!*****************************************!*\
|
|||
|
!*** ./node_modules/tslib/tslib.es6.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 */ "__assign": () => (/* binding */ __assign),\n/* harmony export */ "__asyncDelegator": () => (/* binding */ __asyncDelegator),\n/* harmony export */ "__asyncGenerator": () => (/* binding */ __asyncGenerator),\n/* harmony export */ "__asyncValues": () => (/* binding */ __asyncValues),\n/* harmony export */ "__await": () => (/* binding */ __await),\n/* harmony export */ "__awaiter": () => (/* binding */ __awaiter),\n/* harmony export */ "__classPrivateFieldGet": () => (/* binding */ __classPrivateFieldGet),\n/* harmony export */ "__classPrivateFieldSet": () => (/* binding */ __classPrivateFieldSet),\n/* harmony export */ "__createBinding": () => (/* binding */ __createBinding),\n/* harmony export */ "__decorate": () => (/* binding */ __decorate),\n/* harmony export */ "__exportStar": () => (/* binding */ __exportStar),\n/* harmony export */ "__extends": () => (/* binding */ __extends),\n/* harmony export */ "__generator": () => (/* binding */ __generator),\n/* harmony export */ "__importDefault": () => (/* binding */ __importDefault),\n/* harmony export */ "__importStar": () => (/* binding */ __importStar),\n/* harmony export */ "__makeTemplateObject": () => (/* binding */ __makeTemplateObject),\n/* harmony export */ "__metadata": () => (/* binding */ __metadata),\n/* harmony export */ "__param": () => (/* binding */ __param),\n/* harmony export */ "__read": () => (/* binding */ __read),\n/* harmony export */ "__rest": () => (/* binding */ __rest),\n/* harmony export */ "__spread": () => (/* binding */ __spread),\n/* harmony export */ "__spreadArray": () => (/* binding */ __spreadArray),\n/* harmony export */ "__spreadArrays": () => (/* binding */ __spreadArrays),\n/* harmony export */ "__values": () => (/* binding */ __values)\n/* harmony export */ });\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== "function" && b !== null)\r\n throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nfunction __rest(s, e) {\r\n var t = {
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/websocket/lib/browser.js ***!
|
|||
|
\***********************************************/(module,__unused_webpack_exports,__webpack_require__)=>{eval("var _globalThis;\nif (typeof globalThis === 'object') {\n\t_globalThis = globalThis;\n} else {\n\ttry {\n\t\t_globalThis = __webpack_require__(/*! es5-ext/global */ \"./node_modules/es5-ext/global.js\");\n\t} catch (error) {\n\t} finally {\n\t\tif (!_globalThis && typeof window !== 'undefined') { _globalThis = window; }\n\t\tif (!_globalThis) { throw new Error('Could not determine global this'); }\n\t}\n}\n\nvar NativeWebSocket = _globalThis.WebSocket || _globalThis.MozWebSocket;\nvar websocket_version = __webpack_require__(/*! ./version */ \"./node_modules/websocket/lib/version.js\");\n\n\n/**\n * Expose a W3C WebSocket class with just one or two arguments.\n */\nfunction W3CWebSocket(uri, protocols) {\n\tvar native_instance;\n\n\tif (protocols) {\n\t\tnative_instance = new NativeWebSocket(uri, protocols);\n\t}\n\telse {\n\t\tnative_instance = new NativeWebSocket(uri);\n\t}\n\n\t/**\n\t * 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket\n\t * class). Since it is an Object it will be returned as it is when creating an\n\t * instance of W3CWebSocket via 'new W3CWebSocket()'.\n\t *\n\t * ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2\n\t */\n\treturn native_instance;\n}\nif (NativeWebSocket) {\n\t['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'].forEach(function(prop) {\n\t\tObject.defineProperty(W3CWebSocket, prop, {\n\t\t\tget: function() { return NativeWebSocket[prop]; }\n\t\t});\n\t});\n}\n\n/**\n * Module exports.\n */\nmodule.exports = {\n 'w3cwebsocket' : NativeWebSocket ? W3CWebSocket : null,\n 'version' : websocket_version\n};\n\n\n//# sourceURL=webpack://telegram/./node_modules/websocket/lib/browser.js?")},"./node_modules/websocket/lib/version.js":
|
|||
|
/*!***********************************************!*\
|
|||
|
!*** ./node_modules/websocket/lib/version.js ***!
|
|||
|
\***********************************************/(module,__unused_webpack_exports,__webpack_require__)=>{eval('module.exports = __webpack_require__(/*! ../package.json */ "./node_modules/websocket/package.json").version;\n\n\n//# sourceURL=webpack://telegram/./node_modules/websocket/lib/version.js?')},"./node_modules/real-cancellable-promise/dist/index.mjs":
|
|||
|
/*!**************************************************************!*\
|
|||
|
!*** ./node_modules/real-cancellable-promise/dist/index.mjs ***!
|
|||
|
\**************************************************************/(__unused_webpack___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 */ \"CancellablePromise\": () => (/* binding */ CancellablePromise),\n/* harmony export */ \"Cancellation\": () => (/* binding */ Cancellation),\n/* harmony export */ \"buildCancellablePromise\": () => (/* binding */ buildCancellablePromise),\n/* harmony export */ \"isPromiseWithCancel\": () => (/* binding */ isPromiseWithCancel),\n/* harmony export */ \"pseudoCancellable\": () => (/* binding */ pseudoCancellable)\n/* harmony export */ });\n/**\r\n * If canceled, a [[`CancellablePromise`]] should throw an `Cancellation` object.\r\n */\r\nclass Cancellation extends Error {\r\n constructor(message = 'Promise canceled.') {\r\n super(message);\r\n }\r\n}\n\n/** @internal */\r\nconst noop = () => { };\n\n/**\r\n * Determines if an arbitrary value is a thenable with a cancel method.\r\n */\r\nfunction isPromiseWithCancel(value) {\r\n return (typeof value === 'object' &&\r\n typeof value.then === 'function' &&\r\n typeof value.cancel === 'function');\r\n}\r\n/**\r\n * A promise with a `cancel` method.\r\n *\r\n * If canceled, the `CancellablePromise` will reject with a [[`Cancellation`]]\r\n * object.\r\n *\r\n * @typeParam T what the `CancellablePromise` resolves to\r\n */\r\nclass CancellablePromise {\r\n /**\r\n * @param promise a normal promise or thenable\r\n * @param cancel a function that cancels `promise`. **Calling `cancel` after\r\n * `promise` has resolved must be a no-op.**\r\n */\r\n constructor(promise, cancel) {\r\n this.promise = Promise.resolve(promise);\r\n this.cancel = cancel;\r\n }\r\n /**\r\n * Analogous to `Promise.then`.\r\n *\r\n * `onFulfilled` on `onRejected` can return a value, a normal promise, or a\r\n * `CancellablePromise`. So you can make a chain a `CancellablePromise`s\r\n * like this:\r\n *\r\n * ```\r\n * const overallPromise = cancellableAsyncFunction1()\r\n * .then(cancellableAsyncFunction2)\r\n * .then(cancellableAsyncFunction3)\r\n * .then(cancellableAsyncFunction4)\r\n * ```\r\n *\r\n * Then if you call `overallPromise.cancel`, `cancel` is called on all\r\n * `CancellablePromise`s in the chain! In practice, this means that\r\n * whichever async operation is in progress will be canceled.\r\n *\r\n * @returns a new CancellablePromise\r\n */\r\n then(onFulfilled, onRejected) {\r\n let fulfill;\r\n let reject;\r\n let callbackPromiseWithCancel;\r\n if (onFulfilled) {\r\n fulfill = (value) => {\r\n const nextValue = onFulfilled(value);\r\n if (isPromiseWithCancel(nextValue))\r\n callbackPromiseWithCancel = nextValue;\r\n return nextValue;\r\n };\r\n }\r\n if (onRejected) {\r\n reject = (reason) => {\r\n const nextValue = onRejected(reason);\r\n if (isPromiseWithCancel(nextValue))\r\n callbackPromiseWithCancel = nextValue;\r\n return nextValue;\r\n };\r\n }\r\n const newPromise = this.promise.then(fulfill, reject);\r\n const newCancel = () => {\r\n this.cancel();\r\n callbackPromiseWithCancel === null || callbackPromiseWithCancel === void 0 ? void 0 : callbackPromiseWithCancel.cancel();\r\n };\r\n return new CancellablePromise(newPromise, newCancel);\r\n }\r\n /**\r\n * Analogous to `Promise.catch`.\r\n */\r\n catch(onRejected // eslint-disable-line @typescript-eslint/no-explicit-any -- to match the types used for Promise in the official lib.d.ts\r\n ) {\r\n return this.then(undefined, onRejected);\r\n }\r\n /**\r\n * Attaches a ca
|
|||
|
/*!************************************************************!*\
|
|||
|
!*** ./node_modules/ts-custom-error/dist/custom-error.mjs ***!
|
|||
|
\************************************************************/(__unused_webpack___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 */ \"CustomError\": () => (/* binding */ CustomError),\n/* harmony export */ \"customErrorFactory\": () => (/* binding */ customErrorFactory)\n/* harmony export */ });\nfunction fixProto(target, prototype) {\n var setPrototypeOf = Object.setPrototypeOf;\n setPrototypeOf ? setPrototypeOf(target, prototype) : target.__proto__ = prototype;\n}\nfunction fixStack(target, fn) {\n if (fn === void 0) {\n fn = target.constructor;\n }\n\n var captureStackTrace = Error.captureStackTrace;\n captureStackTrace && captureStackTrace(target, fn);\n}\n\nvar __extends = false || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) { if (b.hasOwnProperty(p)) { d[p] = b[p]; } }\n };\n\n return extendStatics(d, b);\n };\n\n return function (d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar CustomError = function (_super) {\n __extends(CustomError, _super);\n\n function CustomError(message) {\n var _newTarget = this.constructor;\n\n var _this = _super.call(this, message) || this;\n\n Object.defineProperty(_this, 'name', {\n value: _newTarget.name,\n enumerable: false,\n configurable: true\n });\n fixProto(_this, _newTarget.prototype);\n fixStack(_this);\n return _this;\n }\n\n return CustomError;\n}(Error);\n\nvar __spreadArrays = false || function () {\n var arguments$1 = arguments;\n\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) { s += arguments$1[i].length; }\n\n for (var r = Array(s), k = 0, i = 0; i < il; i++) { for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) { r[k] = a[j]; } }\n\n return r;\n};\nfunction customErrorFactory(fn, parent) {\n if (parent === void 0) {\n parent = Error;\n }\n\n function CustomError() {\n var arguments$1 = arguments;\n\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments$1[_i];\n }\n\n if (!(this instanceof CustomError)) { return new (CustomError.bind.apply(CustomError, __spreadArrays([void 0], args)))(); }\n parent.apply(this, args);\n Object.defineProperty(this, 'name', {\n value: fn.name || parent.name,\n enumerable: false,\n configurable: true\n });\n fn.apply(this, args);\n fixStack(this, CustomError);\n }\n\n return Object.defineProperties(CustomError, {\n prototype: {\n value: Object.create(parent.prototype, {\n constructor: {\n value: CustomError,\n writable: true,\n configurable: true\n }\n })\n }\n });\n}\n\n\n//# sourceMappingURL=custom-error.mjs.map\n\n\n//# sourceURL=webpack://telegram/./node_modules/ts-custom-error/dist/custom-error.mjs?")},"./node_modules/entities/lib/maps/decode.json":
|
|||
|
/*!****************************************************!*\
|
|||
|
!*** ./node_modules/entities/lib/maps/decode.json ***!
|
|||
|
\****************************************************/module=>{"use strict";eval('module.exports = JSON.parse(\'{"0":65533,"128":8364,"130":8218,"131":402,"132":8222,"133":8230,"134":8224,"135":8225,"136":710,"137":8240,"138":352,"139":8249,"140":338,"142":381,"145":8216,"146":8217,"147":8220,"148":8221,"149":8226,"150":8211,"151":8212,"152":732,"153":8482,"154":353,"155":8250,"156":339,"158":382,"159":376}\');\n\n//# sourceURL=webpack://telegram/./node_modules/entities/lib/maps/decode.json?')},"./node_modules/entities/lib/maps/entities.json":
|
|||
|
/*!******************************************************!*\
|
|||
|
!*** ./node_modules/entities/lib/maps/entities.json ***!
|
|||
|
\******************************************************/module=>{"use strict";eval('module.exports = JSON.parse(\'{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\\\'","ApplyFunction":"","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoub
|
|||
|
/*!****************************************************!*\
|
|||
|
!*** ./node_modules/entities/lib/maps/legacy.json ***!
|
|||
|
\****************************************************/module=>{"use strict";eval('module.exports = JSON.parse(\'{"Aacute":"Á","aacute":"á","Acirc":"Â","acirc":"â","acute":"´","AElig":"Æ","aelig":"æ","Agrave":"À","agrave":"à","amp":"&","AMP":"&","Aring":"Å","aring":"å","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","brvbar":"¦","Ccedil":"Ç","ccedil":"ç","cedil":"¸","cent":"¢","copy":"©","COPY":"©","curren":"¤","deg":"°","divide":"÷","Eacute":"É","eacute":"é","Ecirc":"Ê","ecirc":"ê","Egrave":"È","egrave":"è","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","frac12":"½","frac14":"¼","frac34":"¾","gt":">","GT":">","Iacute":"Í","iacute":"í","Icirc":"Î","icirc":"î","iexcl":"¡","Igrave":"Ì","igrave":"ì","iquest":"¿","Iuml":"Ï","iuml":"ï","laquo":"«","lt":"<","LT":"<","macr":"¯","micro":"µ","middot":"·","nbsp":" ","not":"¬","Ntilde":"Ñ","ntilde":"ñ","Oacute":"Ó","oacute":"ó","Ocirc":"Ô","ocirc":"ô","Ograve":"Ò","ograve":"ò","ordf":"ª","ordm":"º","Oslash":"Ø","oslash":"ø","Otilde":"Õ","otilde":"õ","Ouml":"Ö","ouml":"ö","para":"¶","plusmn":"±","pound":"£","quot":"\\\\"","QUOT":"\\\\"","raquo":"»","reg":"®","REG":"®","sect":"§","shy":"","sup1":"¹","sup2":"²","sup3":"³","szlig":"ß","THORN":"Þ","thorn":"þ","times":"×","Uacute":"Ú","uacute":"ú","Ucirc":"Û","ucirc":"û","Ugrave":"Ù","ugrave":"ù","uml":"¨","Uuml":"Ü","uuml":"ü","Yacute":"Ý","yacute":"ý","yen":"¥","yuml":"ÿ"}\');\n\n//# sourceURL=webpack://telegram/./node_modules/entities/lib/maps/legacy.json?')},"./node_modules/entities/lib/maps/xml.json":
|
|||
|
/*!*************************************************!*\
|
|||
|
!*** ./node_modules/entities/lib/maps/xml.json ***!
|
|||
|
\*************************************************/module=>{"use strict";eval('module.exports = JSON.parse(\'{"amp":"&","apos":"\\\'","gt":">","lt":"<","quot":"\\\\""}\');\n\n//# sourceURL=webpack://telegram/./node_modules/entities/lib/maps/xml.json?')},"./node_modules/websocket/package.json":
|
|||
|
/*!*********************************************!*\
|
|||
|
!*** ./node_modules/websocket/package.json ***!
|
|||
|
\*********************************************/module=>{"use strict";eval('module.exports = JSON.parse(\'{"name":"websocket","description":"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.","keywords":["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],"author":"Brian McKelvey <theturtle32@gmail.com> (https://github.com/theturtle32)","contributors":["Iñaki Baz Castillo <ibc@aliax.net> (http://dev.sipdoc.net)"],"version":"1.0.34","repository":{"type":"git","url":"https://github.com/theturtle32/WebSocket-Node.git"},"homepage":"https://github.com/theturtle32/WebSocket-Node","engines":{"node":">=4.0.0"},"dependencies":{"bufferutil":"^4.0.1","debug":"^2.2.0","es5-ext":"^0.10.50","typedarray-to-buffer":"^3.1.5","utf-8-validate":"^5.0.2","yaeti":"^0.0.6"},"devDependencies":{"buffer-equal":"^1.0.0","gulp":"^4.0.2","gulp-jshint":"^2.0.4","jshint-stylish":"^2.2.1","jshint":"^2.0.0","tape":"^4.9.1"},"config":{"verbose":false},"scripts":{"test":"tape test/unit/*.js","gulp":"gulp"},"main":"index","directories":{"lib":"./lib"},"browser":"lib/browser.js","license":"Apache-2.0"}\');\n\n//# sourceURL=webpack://telegram/./node_modules/websocket/package.json?')}},__webpack_module_cache__={};function __webpack_require__(e){var n=__webpack_module_cache__[e];if(void 0!==n)return n.exports;var t=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(t.exports,t,t.exports,__webpack_require__),t.loaded=!0,t.exports}__webpack_require__.d=((e,n)=>{for(var t in n)__webpack_require__.o(n,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}),__webpack_require__.o=((e,n)=>Object.prototype.hasOwnProperty.call(e,n)),__webpack_require__.r=(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}),__webpack_require__.nmd=(e=>(e.paths=[],e.children||(e.children=[]),e));var __webpack_exports__=__webpack_require__("./browser/index.js");return __webpack_exports__})());
|