decord/source/lib/guild/GuildThreadSubscriptions.tsx

205 lines
5.3 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 6007
2026-07-27 11:26:19 +00:00
// Function ID: 53584
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-23 10:11:24 +00:00
// Dependencies: [6, 7, 1362, 2]
2026-07-20 16:05:17 +00:00
2026-07-25 08:10:48 +00:00
// Module 6007 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _classCallCheck from "_classCallCheck";
import _defineProperties from "_defineProperties";
function _createForOfIteratorHelperLoose(iterable) {
let closure_0 = iterable;
iterable = "undefined" !== typeof Symbol;
if (iterable) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol;
2026-07-23 10:11:24 +00:00
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (!iterable) {
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (iterable) {
const iter = iterable.call(iterable);
2026-07-20 16:05:17 +00:00
const next = iter.next;
return next.bind(iter);
} else {
const _Array = Array;
2026-07-23 10:11:24 +00:00
let tmp = iterable;
if (!Array.isArray(iterable)) {
2026-07-20 16:05:17 +00:00
let tmp2;
2026-07-23 10:11:24 +00:00
if (iterable) {
if ("string" === typeof iterable) {
tmp2 = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
const toString = {}.toString;
2026-07-23 10:11:24 +00:00
const substr = toString.call(iterable).slice(8, -1);
2026-07-20 16:05:17 +00:00
let name = substr;
if (tmp3) {
2026-07-23 10:11:24 +00:00
name = iterable.constructor.name;
2026-07-20 16:05:17 +00:00
}
if ("Map" !== name) {
if ("Set" !== name) {
if ("Arguments" === name) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr;
}
const _Array2 = Array;
2026-07-23 10:11:24 +00:00
arr = Array.from(iterable);
const callResult = toString.call(iterable);
tmp3 = "Object" === substr && iterable.constructor;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2;
if (!tmp2) {
const _TypeError = TypeError;
const typeError = new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
throw typeError;
}
}
if (tmp) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0;
2026-07-20 16:05:17 +00:00
return () => {
2026-07-23 10:11:24 +00:00
if (closure_1 >= length.length) {
2026-07-20 16:05:17 +00:00
let obj = { done: true };
} else {
obj = { done: false };
closure_1 = tmp3 + 1;
2026-07-23 10:11:24 +00:00
obj.value = length[+closure_1];
2026-07-20 16:05:17 +00:00
}
return obj;
};
}
}
function _arrayLikeToArray(arg0, arg1) {
let length;
if (tmp) {
length = arg0.length;
}
const ArrayResult = Array(length);
for (let num = 0; num < length; num = num + 1) {
ArrayResult[num] = arg0[num];
}
return ArrayResult;
}
2026-07-23 10:11:24 +00:00
let tmp2 = (() => {
2026-07-20 16:05:17 +00:00
class GuildThreadSubscriptions {
constructor(arg0) {
2026-07-23 10:11:24 +00:00
tmp = outer1_2(this, GuildThreadSubscriptions);
2026-07-20 16:05:17 +00:00
this._subscriptions = {};
this._onChange = arg0;
return;
}
}
let obj = {
key: "reset",
value() {
this._subscriptions = {};
}
};
const items = [obj, , , , , , ];
obj = {
key: "get",
value(arg0) {
return this._get(arg0).keys();
}
};
items[1] = obj;
obj = {
key: "getSubscribedThreadIds",
value() {
const set = new Set();
for (const key10011 in this._subscriptions) {
let tmp2 = key10011;
2026-07-23 10:11:24 +00:00
let tmp3 = outer1_4;
2026-07-20 16:05:17 +00:00
let obj2 = this._subscriptions[key10011];
2026-07-23 10:11:24 +00:00
let tmp4 = outer1_4(obj2.keys());
2026-07-20 16:05:17 +00:00
let iter2 = tmp4();
if (iter2.done) {
continue;
} else {
let addResult = set.add(iter2.value);
let iter = tmp4();
iter2 = iter;
}
continue;
}
return set;
}
};
items[2] = obj;
items[3] = {
key: "_get",
value(arg0) {
let tmp = this._subscriptions[arg0];
if (null == tmp) {
2026-07-23 10:11:24 +00:00
const tmp4 = GuildThreadSubscriptions(outer1_1[2]);
2026-07-20 16:05:17 +00:00
const prototype = tmp4.prototype;
2026-07-23 10:11:24 +00:00
tmp = new tmp4({ max: 3, updateAgeOnGet: true });
2026-07-20 16:05:17 +00:00
}
return tmp;
}
};
items[4] = {
key: "clear",
value(_pending) {
const self = this;
if (_pending in this._subscriptions) {
const _subscriptions = self._subscriptions;
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
self._onChange(_pending, []);
}
}
};
items[5] = {
key: "subscribe",
value(_pending) {
const self = this;
const _getResult = this._get(_pending);
if (_getResult.has(arg1)) {
const _Date3 = Date;
const result = _getResult.set(arg1, Date.now());
let flag = false;
} else {
if (tmp2) {
const _Date = Date;
const result1 = _getResult.set(arg2, Date.now());
}
const _Date2 = Date;
const result2 = _getResult.set(arg1, Date.now());
self._subscriptions[_pending] = _getResult;
self._onChange(_pending, _getResult.keys());
flag = true;
2026-07-23 10:11:24 +00:00
tmp2 = null != arg2 && _getResult.has(arg2);
2026-07-20 16:05:17 +00:00
}
return flag;
}
};
items[6] = {
key: "unsubscribe",
value(_pending) {
const self = this;
if (_pending in this._subscriptions) {
const tmp = !self._subscriptions[_pending].has(arg1);
let flag2 = !tmp;
if (!tmp) {
obj.del(arg1);
self._onChange(_pending, obj.keys());
flag2 = true;
}
return flag2;
} else {
return false;
}
}
};
return callback(GuildThreadSubscriptions, items);
2026-07-23 10:11:24 +00:00
})();
let result = require("priv").fileFinishedImporting("lib/guild/GuildThreadSubscriptions.tsx");
2026-07-20 16:05:17 +00:00
export default tmp2;