2026-10-12 16:32:48 +00:00
|
|
|
// Module ID: 5402
|
|
|
|
|
// Function ID: 5403
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: MarkupRules
|
2026-10-12 16:32:48 +00:00
|
|
|
// Dependencies: [32, 729, 2065, 2119, 2087, 1390, 1085, 5403, 5404, 5087, 5405, 1126, 5408, 2122, 5409, 4962, 5410, 1949, 5411, 5412, 5425, 4764, 5427, 8156, 14057, 8131, 8132, 5401, 8158, 12, 2]
|
2026-09-18 19:45:33 +00:00
|
|
|
// Exports: hydrateCommandMention
|
|
|
|
|
|
2026-10-12 16:32:48 +00:00
|
|
|
// Module 5402 (MarkupRules)
|
2026-10-07 22:43:51 +00:00
|
|
|
import intl2 from "intl" /* 1126 */;
|
2026-10-12 16:32:48 +00:00
|
|
|
import UnicodeEmojisDefault from "UnicodeEmojis" /* 4764 */;
|
|
|
|
|
import HighlightJsAnsiLanguage from "HighlightJsAnsiLanguage" /* 5087 */;
|
|
|
|
|
import ApplicationCommandConstants from "ApplicationCommandConstants" /* 5403 */;
|
|
|
|
|
import ChannelAutocompleteConstants from "ChannelAutocompleteConstants" /* 5404 */;
|
|
|
|
|
import MarkupLinkRule from "MarkupLinkRule" /* 5405 */;
|
|
|
|
|
import useHasEnhancedRoleColors from "useHasEnhancedRoleColors" /* 5408 */;
|
|
|
|
|
import NicknameUtilsDefault from "NicknameUtils" /* 5409 */;
|
|
|
|
|
import StaticRouteRendering from "StaticRouteRendering" /* 5410 */;
|
|
|
|
|
import MarkupTextRuleDefault from "MarkupTextRule" /* 5411 */;
|
|
|
|
|
import MarkupChannelMentionRuleDefault from "MarkupChannelMentionRule" /* 5412 */;
|
|
|
|
|
import MarkupAttachmentLinkRuleDefault from "MarkupAttachmentLinkRule" /* 5425 */;
|
|
|
|
|
import getSoundmojiASTFromString from "getSoundmojiASTFromString" /* 5427 */;
|
|
|
|
|
import MarkupListRuleDefault from "MarkupListRule" /* 8131 */;
|
|
|
|
|
import MarkupSubtextRuleDefault from "MarkupSubtextRule" /* 8132 */;
|
|
|
|
|
import TimestampUtils from "TimestampUtils" /* 8156 */;
|
|
|
|
|
import PlatformMarkupRulesDefault from "PlatformMarkupRules" /* 8158 */;
|
|
|
|
|
import MarkupHeadingRuleDefault from "MarkupHeadingRule" /* 14057 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import _slicedToArray from "_slicedToArray" /* 32 */;
|
2026-10-07 22:43:51 +00:00
|
|
|
import _toArray from "_toArray" /* 729 */;
|
2026-10-12 16:32:48 +00:00
|
|
|
import ChannelStore from "ChannelStore" /* 2065 */;
|
|
|
|
|
import GuildRoleStore from "GuildRoleStore" /* 2119 */;
|
|
|
|
|
import GuildStore from "GuildStore" /* 2087 */;
|
|
|
|
|
import UserStore from "UserStore" /* 1390 */;
|
2026-10-07 22:43:51 +00:00
|
|
|
import Constants from "Constants" /* 1085 */;
|
2026-10-12 16:32:48 +00:00
|
|
|
import module_1949_mod from "module_1949" /* 1949 */;
|
|
|
|
|
import combineMarkupRules_mod from "combineMarkupRules" /* 5401 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import module_12_mod from "module_12" /* 12 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
const require = globalThis.__r;
|
2026-09-18 19:45:33 +00:00
|
|
|
const MarkupLinkRuleDefault = MarkupLinkRule;
|
|
|
|
|
const getSoundmojiASTFromStringDefault = getSoundmojiASTFromString;
|
|
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let c10;
|
|
|
|
|
let c9;
|
2026-10-12 16:32:48 +00:00
|
|
|
let module_1949;
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj2;
|
|
|
|
|
let obj21;
|
|
|
|
|
let obj3;
|
|
|
|
|
let obj4;
|
|
|
|
|
let obj5;
|
|
|
|
|
let obj6;
|
|
|
|
|
let obj7;
|
|
|
|
|
let obj8;
|
|
|
|
|
let unpackModuleId;
|
|
|
|
|
function match(arg0) {
|
|
|
|
|
const obj = /^(¯\\_\(ツ\)_\/¯)/;
|
|
|
|
|
return obj.exec(arg0);
|
|
|
|
|
}
|
|
|
|
|
function parse(content) {
|
|
|
|
|
return { type: "text", content: content[1] };
|
|
|
|
|
}
|
|
|
|
|
const match2 = function match(arg0) {
|
|
|
|
|
const obj = /^```(?:([a-z0-9_+\-.#]+?)\n)?\n*([^\n][^]*?)\n*```/i;
|
|
|
|
|
return obj.exec(arg0);
|
|
|
|
|
};
|
|
|
|
|
const parse2 = function parse(arg0, arg1, inQuote) {
|
|
|
|
|
let str2;
|
|
|
|
|
let str = arg0[1];
|
|
|
|
|
if (str == null) {
|
|
|
|
|
str = "";
|
|
|
|
|
}
|
|
|
|
|
const obj = { lang: str, content: str2, inQuote: inQuote.inQuote || inQuote.formatInline || false };
|
|
|
|
|
str2 = arg0[2];
|
|
|
|
|
if (str2 == null) {
|
|
|
|
|
str2 = "";
|
|
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
};
|
|
|
|
|
const match3 = function match(arg0) {
|
|
|
|
|
const obj = /^<@&(\d+)>/;
|
|
|
|
|
return obj.exec(arg0);
|
|
|
|
|
};
|
|
|
|
|
const parse3 = function parse(arg0, arg1, returnMentionIds) {
|
|
|
|
|
let tmp;
|
|
|
|
|
let tmp3;
|
|
|
|
|
[, tmp] = arg0;
|
|
|
|
|
if (returnMentionIds.returnMentionIds) {
|
|
|
|
|
tmp3 = { type: "roleMention", id: tmp };
|
|
|
|
|
const obj = { type: "roleMention", id: tmp };
|
|
|
|
|
} else {
|
|
|
|
|
tmp3 = hydrateRoleMention(tmp, returnMentionIds);
|
|
|
|
|
}
|
|
|
|
|
return tmp3;
|
|
|
|
|
};
|
|
|
|
|
const match4 = function match(arg0) {
|
|
|
|
|
const obj = /^<@!?(\d+)>|^(@(?:everyone|here))/;
|
|
|
|
|
const match = obj.exec(arg0);
|
|
|
|
|
let tmp2 = null;
|
|
|
|
|
if (null != match) {
|
|
|
|
|
tmp2 = match;
|
|
|
|
|
}
|
|
|
|
|
return tmp2;
|
|
|
|
|
};
|
|
|
|
|
const parse4 = function parse(arg0, arg1, returnMentionIds) {
|
|
|
|
|
let tmp2;
|
|
|
|
|
if (returnMentionIds.returnMentionIds) {
|
|
|
|
|
let obj3;
|
|
|
|
|
if (null == arg0[1]) {
|
|
|
|
|
obj3 = { type: "mention", text: arg0[0] };
|
|
|
|
|
const obj2 = { type: "mention", text: arg0[0] };
|
|
|
|
|
} else {
|
|
|
|
|
obj3 = { type: "mention", id: arg0[1] };
|
|
|
|
|
}
|
|
|
|
|
tmp2 = obj3;
|
|
|
|
|
} else {
|
|
|
|
|
const obj = { fullMatch: null, id: null, everyoneOrHere: null };
|
|
|
|
|
[obj.fullMatch, obj.id, obj.everyoneOrHere] = arg0;
|
|
|
|
|
tmp2 = hydrateUserMention(obj, returnMentionIds);
|
|
|
|
|
}
|
|
|
|
|
return tmp2;
|
|
|
|
|
};
|
|
|
|
|
const match5 = function match(arg0, arg1, arg2) {
|
|
|
|
|
let match;
|
|
|
|
|
if (null == arg2) {
|
|
|
|
|
const obj = /^(@silent(?![^\s]))/;
|
|
|
|
|
match = obj.exec(arg0);
|
|
|
|
|
} else {
|
|
|
|
|
match = null;
|
|
|
|
|
}
|
|
|
|
|
return match;
|
|
|
|
|
};
|
|
|
|
|
const parse5 = function parse(content) {
|
|
|
|
|
return { type: "silentPrefix", content: content[0] };
|
|
|
|
|
};
|
|
|
|
|
const match6 = function match(arg0) {
|
|
|
|
|
const obj = /^<\/((?:(?:[\x2D0-9A-Z_a-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0900-\u0950\u0955-\u0963\u0966-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E3A\u0E40-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8E0-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9
|
|
|
|
|
return obj.exec(arg0);
|
|
|
|
|
};
|
|
|
|
|
const parse6 = function parse(arg0, arg1, returnMentionIds) {
|
|
|
|
|
let items1;
|
|
|
|
|
let obj2;
|
|
|
|
|
if (returnMentionIds.returnMentionIds) {
|
|
|
|
|
obj2 = { type: "commandMention", id: arg0[2] };
|
|
|
|
|
const obj = { type: "commandMention", id: arg0[2] };
|
|
|
|
|
} else {
|
|
|
|
|
const items = [];
|
|
|
|
|
const arr = _toArray(arg0[1].split(" "));
|
|
|
|
|
HermesBuiltin.arraySpread(items, arr.slice(1), 0);
|
2026-10-12 16:32:48 +00:00
|
|
|
const mapped = items.map(f92036);
|
2026-10-01 14:13:23 +00:00
|
|
|
const _HermesInternal = HermesInternal;
|
|
|
|
|
obj2 = { type: "commandMention", channelId: returnMentionIds.channelId, commandId: arg0[2], commandName: arg0[1], commandKey: "" + arg0[2] + mapped.join(""), content: items1 };
|
|
|
|
|
const _HermesInternal2 = HermesInternal;
|
|
|
|
|
items1 = [{ type: "text", content: "" + arg0[1] }];
|
|
|
|
|
const obj3 = { type: "text", content: "" + arg0[1] };
|
|
|
|
|
}
|
|
|
|
|
return obj2;
|
|
|
|
|
};
|
|
|
|
|
const match7 = function match(arg0, allowTimeMentionInput) {
|
|
|
|
|
let match = null;
|
|
|
|
|
if (allowTimeMentionInput.allowTimeMentionInput) {
|
|
|
|
|
const obj = /^<@time:([^>]*)>/;
|
|
|
|
|
match = obj.exec(arg0);
|
|
|
|
|
}
|
|
|
|
|
return match;
|
|
|
|
|
};
|
|
|
|
|
const parse7 = function parse(content) {
|
|
|
|
|
return { type: "timestampMentionInput", content: content[1] };
|
|
|
|
|
};
|
|
|
|
|
const match8 = function match(arg0, allowGameMentions) {
|
|
|
|
|
let match = null;
|
|
|
|
|
if (allowGameMentions.allowGameMentions) {
|
|
|
|
|
match = GAME_MENTION_RAW_RE.exec(arg0);
|
|
|
|
|
}
|
|
|
|
|
return match;
|
|
|
|
|
};
|
|
|
|
|
const parse8 = function parse(gameId) {
|
|
|
|
|
return { type: "gameMention", gameId: gameId[1] };
|
|
|
|
|
};
|
|
|
|
|
const match9 = function match(arg0) {
|
|
|
|
|
const EMOJI_NAME_RE = UnicodeEmojisDefault.EMOJI_NAME_RE;
|
|
|
|
|
const match = EMOJI_NAME_RE.exec(arg0);
|
|
|
|
|
let tmp4 = null;
|
|
|
|
|
if (null != match) {
|
|
|
|
|
tmp4 = null;
|
|
|
|
|
const tmpResult = UnicodeEmojisDefault;
|
|
|
|
|
if ("" !== tmpResult.convertNameToSurrogate(match[1])) {
|
|
|
|
|
tmp4 = match;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return tmp4;
|
|
|
|
|
};
|
|
|
|
|
const parse9 = function parse(arg0) {
|
|
|
|
|
const obj = UnicodeEmojisDefault;
|
|
|
|
|
let content = obj.convertNameToSurrogate(arg0[1]);
|
|
|
|
|
if (null == content) {
|
|
|
|
|
const _HermesInternal = HermesInternal;
|
|
|
|
|
content = ":" + arg0[1] + ":";
|
|
|
|
|
}
|
|
|
|
|
return { type: "text", content };
|
|
|
|
|
};
|
|
|
|
|
const match10 = function match(arg0) {
|
|
|
|
|
const soundmojiRawFormatRegex = getSoundmojiASTFromString.soundmojiRawFormatRegex;
|
|
|
|
|
return soundmojiRawFormatRegex.exec(arg0);
|
|
|
|
|
};
|
|
|
|
|
const parse10 = function parse(arg0, arg1, arg2) {
|
|
|
|
|
return getSoundmojiASTFromStringDefault(arg0, arg2);
|
|
|
|
|
};
|
|
|
|
|
const match11 = function match(arg0) {
|
|
|
|
|
const obj = /^<a?:(\w+):(\d+)>/;
|
|
|
|
|
return obj.exec(arg0);
|
|
|
|
|
};
|
|
|
|
|
const parse11 = function parse(arg0) {
|
|
|
|
|
const obj = { type: "text", content: ":" + arg0[1] + ":" };
|
|
|
|
|
return obj;
|
|
|
|
|
};
|
|
|
|
|
const match12 = function match(arg0) {
|
|
|
|
|
const TIMESTAMP_REGEX = TimestampUtils.TIMESTAMP_REGEX;
|
|
|
|
|
return TIMESTAMP_REGEX.exec(arg0);
|
|
|
|
|
};
|
|
|
|
|
const parse12 = function parse(arg0) {
|
|
|
|
|
let tmp;
|
|
|
|
|
let tmp2;
|
|
|
|
|
let tmp3;
|
|
|
|
|
[tmp, tmp2, tmp3] = arg0;
|
|
|
|
|
const obj = TimestampUtils;
|
|
|
|
|
let parseTimestampResult = obj.parseTimestamp(tmp2, tmp3);
|
|
|
|
|
if (null == parseTimestampResult) {
|
|
|
|
|
parseTimestampResult = { type: "text", content: tmp };
|
|
|
|
|
const obj2 = { type: "text", content: tmp };
|
|
|
|
|
} else {
|
|
|
|
|
parseTimestampResult.type = "timestamp";
|
|
|
|
|
}
|
|
|
|
|
return parseTimestampResult;
|
|
|
|
|
};
|
|
|
|
|
const match13 = function match(arg0) {
|
|
|
|
|
return regex2.exec(arg0);
|
|
|
|
|
};
|
|
|
|
|
const parse13 = function parse(arg0, fn, channelId) {
|
|
|
|
|
const obj = { content: fn(arg0[1], channelId), channelId: channelId.channelId };
|
|
|
|
|
return obj;
|
|
|
|
|
};
|
|
|
|
|
const match14 = function match(arg0) {
|
|
|
|
|
return unpackModuleId.exec(arg0);
|
|
|
|
|
};
|
|
|
|
|
const parse14 = function parse(arg0, arg1, guildId) {
|
|
|
|
|
const tmp = _slicedToArray(arg0, 3);
|
|
|
|
|
return hydrateStaticRouteLink(tmp[1], tmp[2], guildId);
|
|
|
|
|
};
|
2026-10-12 16:32:48 +00:00
|
|
|
const f92036 = (item) => "" + SUB_COMMAND_KEY_SEPARATOR + item;
|
2026-09-18 19:45:33 +00:00
|
|
|
function parseLink(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let items;
|
|
|
|
|
let obj3;
|
|
|
|
|
const obj = MarkupLinkRule;
|
|
|
|
|
const punycodeLinkResult = obj.punycodeLink(arg0[1]);
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null == punycodeLinkResult) {
|
2026-10-01 14:13:23 +00:00
|
|
|
obj3 = { type: "text", content: arg0[1] };
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj2 = { type: "text", content: arg0[1] };
|
|
|
|
|
} else {
|
2026-10-12 16:32:48 +00:00
|
|
|
obj3 = { type: "link", content: items, target: punycodeLinkResult.target, title: "IconComponent" };
|
2026-10-01 14:13:23 +00:00
|
|
|
items = [{ type: "text", content: punycodeLinkResult.displayTarget }];
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj4 = { type: "text", content: punycodeLinkResult.displayTarget };
|
|
|
|
|
}
|
|
|
|
|
return obj3;
|
|
|
|
|
}
|
|
|
|
|
function hydrateRoleMention(roleId, guildId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let guild;
|
|
|
|
|
let id1;
|
|
|
|
|
let intl;
|
|
|
|
|
let items;
|
|
|
|
|
let secondary_color;
|
|
|
|
|
let tertiary_color;
|
|
|
|
|
let tmp11;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != guildId.guildId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
guild = GuildStore.getGuild(guildId.guildId);
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
|
|
|
|
guild = null;
|
|
|
|
|
if (null != guildId.channelId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const getGuild = GuildStore.getGuild;
|
2026-09-18 19:45:33 +00:00
|
|
|
const channel = ChannelStore.getChannel(guildId.channelId);
|
|
|
|
|
guildId = undefined;
|
|
|
|
|
if (channel != null) {
|
|
|
|
|
guildId = channel.getGuildId();
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
guild = getGuild(guildId);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let role = null;
|
|
|
|
|
if (null != guild) {
|
|
|
|
|
role = GuildRoleStore.getRole(guild.id, roleId);
|
|
|
|
|
}
|
|
|
|
|
if (null == role) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = { type: "text", content: "@" + intl.string(intl2.t["YV4F/n"]) };
|
|
|
|
|
intl = intl2.intl;
|
2026-09-18 19:45:33 +00:00
|
|
|
const _HermesInternal3 = HermesInternal;
|
|
|
|
|
return obj;
|
|
|
|
|
} else {
|
|
|
|
|
let id;
|
2026-10-01 14:13:23 +00:00
|
|
|
const getHasEnhancedRoleColorsForRole = useHasEnhancedRoleColors.getHasEnhancedRoleColorsForRole;
|
|
|
|
|
useHasEnhancedRoleColors;
|
|
|
|
|
const tmp19 = require;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (guild != null) {
|
|
|
|
|
id = guild.id;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let hasEnhancedRoleColorsForRole = getHasEnhancedRoleColorsForRole(id, role);
|
2026-09-18 19:45:33 +00:00
|
|
|
if (hasEnhancedRoleColorsForRole) {
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp19Result = tmp19(2122);
|
2026-10-01 14:13:23 +00:00
|
|
|
hasEnhancedRoleColorsForRole = !tmp19Result.getIsDefaultErc(role);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj2 = { type: "mention", channelId: guildId.channelId, guildId: id1, roleId, roleColor: role.color, roleColors: tmp11, roleName: "@" + role.name, color: null, colorString: null, content: items };
|
|
|
|
|
id1 = null;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != guild) {
|
|
|
|
|
id1 = guild.id;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp11 = null;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (hasEnhancedRoleColorsForRole) {
|
|
|
|
|
const colors = role.colors;
|
|
|
|
|
let primary_color;
|
|
|
|
|
if (colors != null) {
|
|
|
|
|
primary_color = colors.primary_color;
|
|
|
|
|
}
|
|
|
|
|
const colors2 = role.colors;
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj4 = { primaryColor: primary_color, secondaryColor: secondary_color, tertiaryColor: tertiary_color };
|
|
|
|
|
secondary_color = undefined;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (colors2 != null) {
|
|
|
|
|
secondary_color = colors2.secondary_color;
|
|
|
|
|
}
|
|
|
|
|
const colors3 = role.colors;
|
2026-10-01 14:13:23 +00:00
|
|
|
tertiary_color = undefined;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (colors3 != null) {
|
|
|
|
|
tertiary_color = colors3.tertiary_color;
|
|
|
|
|
}
|
|
|
|
|
tmp11 = obj4;
|
|
|
|
|
}
|
|
|
|
|
const _HermesInternal = HermesInternal;
|
|
|
|
|
({ color: obj3.color, colorString: obj3.colorString } = role);
|
|
|
|
|
const _HermesInternal2 = HermesInternal;
|
2026-10-01 14:13:23 +00:00
|
|
|
items = [{ type: "text", content: "@" + role.name }];
|
|
|
|
|
const obj5 = { type: "text", content: "@" + role.name };
|
2026-09-18 19:45:33 +00:00
|
|
|
return obj2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function hydrateUserMention(everyoneOrHere, channelId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let fullMatch;
|
|
|
|
|
let guildId;
|
|
|
|
|
let id;
|
|
|
|
|
let items;
|
|
|
|
|
let tmp14;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ fullMatch, id } = everyoneOrHere);
|
2026-10-01 14:13:23 +00:00
|
|
|
everyoneOrHere = everyoneOrHere.everyoneOrHere;
|
2026-09-18 19:45:33 +00:00
|
|
|
const str = UserStore.getUser(id);
|
|
|
|
|
const channel = ChannelStore.getChannel(channelId.channelId);
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp;
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp2;
|
|
|
|
|
if (null != str) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const id2 = str.id;
|
2026-09-18 19:45:33 +00:00
|
|
|
let str1 = str.toString();
|
|
|
|
|
if (null != channel) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj2 = NicknameUtilsDefault;
|
|
|
|
|
let nickname = obj2.getNickname(channel.getGuildId(), channelId.channelId, str);
|
|
|
|
|
const tmp4 = importDefault;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (nickname == null) {
|
2026-10-12 16:32:48 +00:00
|
|
|
const tmp4Result = tmp4(4962);
|
2026-10-01 14:13:23 +00:00
|
|
|
nickname = tmp4Result.getName(str);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
str1 = nickname;
|
|
|
|
|
}
|
|
|
|
|
tmp2 = str1;
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp = id2;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const isMatch = null != id && regex.test(id.trim());
|
2026-09-18 19:45:33 +00:00
|
|
|
let combined = fullMatch;
|
|
|
|
|
if (isMatch) {
|
|
|
|
|
combined = fullMatch;
|
|
|
|
|
if (channelId.unknownUserMentionPlaceholder) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const intl = intl2.intl;
|
2026-09-18 19:45:33 +00:00
|
|
|
const _HermesInternal = HermesInternal;
|
2026-10-01 14:13:23 +00:00
|
|
|
combined = "@" + intl.string(intl2.t.sKdZ6U);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = { type: "mention", userId: tmp, channelId: channelId.channelId, viewingChannelId: channelId.viewingChannelId, guildId, parsedUserId: tmp14, roleName: everyoneOrHere, content: items };
|
|
|
|
|
guildId = undefined;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (channel != null) {
|
|
|
|
|
guildId = channel.getGuildId();
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp14 = null;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (isMatch) {
|
|
|
|
|
tmp14 = id;
|
|
|
|
|
}
|
|
|
|
|
if (null != tmp2) {
|
|
|
|
|
const _HermesInternal2 = HermesInternal;
|
|
|
|
|
combined = "@" + tmp2;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
items = [{ type: "text", content: combined }];
|
2026-09-18 19:45:33 +00:00
|
|
|
return obj;
|
|
|
|
|
}
|
2026-09-21 13:40:21 +00:00
|
|
|
function hydrateStaticRouteLink(id, itemId, guildId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let items;
|
2026-10-12 16:32:48 +00:00
|
|
|
let tmp6;
|
|
|
|
|
let tmp7;
|
|
|
|
|
guildId = guildId.guildId;
|
|
|
|
|
if (guildId == null) {
|
|
|
|
|
const channel = ChannelStore.getChannel(guildId.channelId);
|
|
|
|
|
let guildId1;
|
|
|
|
|
if (channel != null) {
|
|
|
|
|
guildId1 = channel.getGuildId();
|
2026-09-21 13:40:21 +00:00
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
guildId = guildId1;
|
2026-09-21 13:40:21 +00:00
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
const obj2 = StaticRouteRendering;
|
|
|
|
|
const result = obj2.staticRouteToTranslation(id);
|
|
|
|
|
const obj3 = StaticRouteRendering;
|
|
|
|
|
const result1 = obj3.staticRouteToItemString(GuildRoleStore, id, itemId, guildId);
|
2026-09-21 13:40:21 +00:00
|
|
|
let str = "";
|
|
|
|
|
if (null != result1) {
|
|
|
|
|
const _HermesInternal = HermesInternal;
|
|
|
|
|
str = " \u203A " + result1;
|
|
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
const obj = { type: "staticRouteLink", content: items, mainContent: tmp6, itemContent: tmp7, itemId, id, guildId, channelId: id };
|
2026-10-01 14:13:23 +00:00
|
|
|
items = [];
|
2026-10-12 16:32:48 +00:00
|
|
|
const obj4 = { type: "text", content: result + str };
|
|
|
|
|
items[0] = obj4;
|
|
|
|
|
tmp6 = null;
|
2026-09-21 13:40:21 +00:00
|
|
|
if (null != result) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const items1 = [{ type: "text", content: result }];
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp6 = items1;
|
|
|
|
|
const obj5 = { type: "text", content: result };
|
2026-09-21 13:40:21 +00:00
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp7 = null;
|
2026-09-21 13:40:21 +00:00
|
|
|
if (null != result1) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const items2 = [{ type: "text", content: result1 }];
|
2026-10-12 16:32:48 +00:00
|
|
|
tmp7 = items2;
|
|
|
|
|
const obj6 = { type: "text", content: result1 };
|
2026-09-21 13:40:21 +00:00
|
|
|
}
|
2026-10-12 16:32:48 +00:00
|
|
|
return obj;
|
2026-09-21 13:40:21 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
({ ID_REGEX: c9, MARKDOWN_SPOILER_REGEXP: c10, MARKDOWN_STATIC_ROUTE_NAME_REGEXP: unpackModuleId } = Constants);
|
|
|
|
|
const SUB_COMMAND_KEY_SEPARATOR = ApplicationCommandConstants.SUB_COMMAND_KEY_SEPARATOR;
|
|
|
|
|
const GAME_MENTION_RAW_RE = ChannelAutocompleteConstants.GAME_MENTION_RAW_RE;
|
2026-09-18 19:45:33 +00:00
|
|
|
const re14 = /^( *>>> +([\s\S]*))|^( *>(?!>>) +[^\n]*(\n *>(?!>>) +[^\n]*)*\n?)/;
|
|
|
|
|
const re15 = /^$|\n *$/;
|
|
|
|
|
const re16 = /^ *>>> ?/;
|
|
|
|
|
const re17 = /^ *> ?/gm;
|
|
|
|
|
const re18 = /^((?:https?|steam):\/\/[^\s<]+[^<.,:;"'\]\s])/;
|
2026-10-09 10:34:53 +00:00
|
|
|
const regExp = new RegExp(HighlightJsAnsiLanguage.ANSI_CONTROL_SEQUENCE_RE, "g");
|
2026-10-12 16:32:48 +00:00
|
|
|
let obj = { newline: module_1949.defaultRules.newline, paragraph: module_1949.defaultRules.paragraph, escape: obj2, blockQuote: obj3, link: MarkupLinkRuleDefault, autolink: obj4, mailto: obj5, tel: obj6, url: obj7, strong: module_1949.defaultRules.strong, em: module_1949.defaultRules.em, u: module_1949.defaultRules.u, br: module_1949.defaultRules.br, text: MarkupTextRuleDefault, inlineCode: obj8, emoticon: { order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["\u00AF"], match, parse }, codeBlock: { order: module_1949.defaultRules.codeBlock.order, requiredFirstCharacters: ["`"], match: match2, parse: parse2 }, roleMention: { order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["<"], match: match3, parse: parse3 }, mention: { order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["<", "@"], match: match4, parse: parse4 }, silentPrefix: { order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["@"], match: match5, parse: parse5 }, channelMention: MarkupChannelMentionRuleDefault.channelMention, channelOrMessageUrl: MarkupChannelMentionRuleDefault.channelOrMessageUrl, mediaPostLink: MarkupChannelMentionRuleDefault.mediaPostLink, attachmentLink: MarkupAttachmentLinkRuleDefault.attachmentLink, commandMention: { order: module_1949.defaultRules.text.order, requiredFirstCharacters: ["<"], match: match6, parse: parse6 }, timestampMentionInput: { order: module_1949.defaultRules.text.order, requiredFirstCharacters: ["<"], match: match7, parse: parse7 }, gameMention: { order: module_1949.defaultRules.text.order, requiredFirstCharacters: ["<"], match: match8, parse: parse8 }, emoji: { order: MarkupTextRuleDefault.order, requiredFirstCharacters: [":"], match: match9, parse: parse9 }, soundboard: { order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["<"], match: match10, parse: parse10 }, customEmoji: { order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["<"], match: match11, parse: parse11 }, timestamp: { order: MarkupTextRuleDefault.order - 1, requiredFirstCharacters: ["<"], match: match12, parse: parse12 }, s: obj21, spoiler: { order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["|"], match: match13, parse: parse13 }, staticRouteLink: { order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["<"], match: match14, parse: parse14 }, heading: MarkupHeadingRuleDefault, list: MarkupListRuleDefault, subtext: MarkupSubtextRuleDefault };
|
2026-10-01 14:13:23 +00:00
|
|
|
obj2 = {
|
|
|
|
|
match(arg0, allowEscape, arg2) {
|
|
|
|
|
let match = null;
|
|
|
|
|
if (false !== allowEscape.allowEscape) {
|
2026-10-12 16:32:48 +00:00
|
|
|
const str = module_1949.defaultRules.escape;
|
2026-10-01 14:13:23 +00:00
|
|
|
match = str.match(arg0, allowEscape, arg2);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return match;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
};
|
2026-10-12 16:32:48 +00:00
|
|
|
let merged = Object.assign(module_1949.defaultRules.escape);
|
2026-10-01 14:13:23 +00:00
|
|
|
obj3 = {
|
|
|
|
|
requiredFirstCharacters: [" ", ">"],
|
|
|
|
|
match(arg0, prevCapture) {
|
|
|
|
|
prevCapture = prevCapture.prevCapture;
|
|
|
|
|
if (!prevCapture.inQuote) {
|
|
|
|
|
if (!prevCapture.nested) {
|
|
|
|
|
if (null == prevCapture) {
|
|
|
|
|
return re14.exec(arg0);
|
|
|
|
|
} else {
|
|
|
|
|
let match = null;
|
|
|
|
|
if (re15.test(prevCapture[0])) {
|
|
|
|
|
match = re14.exec(arg0);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return match;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
},
|
2026-10-01 14:13:23 +00:00
|
|
|
parse(arg0, fn, inQuote) {
|
|
|
|
|
const BooleanResult = Boolean(re16.exec(arg0[0]));
|
|
|
|
|
let tmp2 = re16;
|
|
|
|
|
if (!BooleanResult) {
|
|
|
|
|
tmp2 = re17;
|
|
|
|
|
}
|
|
|
|
|
let flag = inQuote.inQuote;
|
|
|
|
|
const replaced = str.replace(tmp2, "");
|
|
|
|
|
if (!flag) {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
|
|
|
|
const tmp4 = inQuote.inline || false;
|
|
|
|
|
inQuote.inQuote = true;
|
|
|
|
|
if (!BooleanResult) {
|
|
|
|
|
inQuote.inline = true;
|
|
|
|
|
}
|
|
|
|
|
const content = fn(replaced, inQuote);
|
|
|
|
|
inQuote.inQuote = flag;
|
|
|
|
|
inQuote.inline = tmp4;
|
|
|
|
|
if (0 === content.length) {
|
|
|
|
|
content.push({ type: "text", content: " " });
|
|
|
|
|
}
|
|
|
|
|
return { content, type: "blockQuote" };
|
|
|
|
|
}
|
|
|
|
|
};
|
2026-10-12 16:32:48 +00:00
|
|
|
const merged1 = Object.assign(module_1949.defaultRules.blockQuote);
|
2026-10-01 14:13:23 +00:00
|
|
|
obj4 = { parse: parseLink };
|
2026-10-12 16:32:48 +00:00
|
|
|
const merged2 = Object.assign(module_1949.defaultRules.autolink);
|
2026-10-01 14:13:23 +00:00
|
|
|
obj5 = {
|
2026-10-12 16:32:48 +00:00
|
|
|
match: module_1949.inlineRegex(/^<([^\s<>@]+@[^\s<>@]+\.[^\s<>@]+)>/),
|
2026-09-18 19:45:33 +00:00
|
|
|
requiredFirstCharacters: ["<"],
|
2026-10-01 14:13:23 +00:00
|
|
|
parse(arg0) {
|
|
|
|
|
let items;
|
|
|
|
|
let text = obj;
|
|
|
|
|
const tmp = arg0[1];
|
|
|
|
|
if (!arg0[1].startsWith("mailto:")) {
|
|
|
|
|
text = `mailto:${obj}`;
|
|
|
|
|
}
|
|
|
|
|
const obj2 = { type: "link", content: items, target: text };
|
|
|
|
|
items = [{ type: "text", content: tmp }];
|
2026-09-18 19:45:33 +00:00
|
|
|
return obj2;
|
|
|
|
|
}
|
|
|
|
|
};
|
2026-10-12 16:32:48 +00:00
|
|
|
const merged3 = Object.assign(module_1949.defaultRules.mailto);
|
|
|
|
|
module_1949 = module_1949_mod;
|
2026-10-01 14:13:23 +00:00
|
|
|
obj6 = {
|
2026-09-18 19:45:33 +00:00
|
|
|
requiredFirstCharacters: ["<"],
|
2026-10-12 16:32:48 +00:00
|
|
|
match: module_1949.inlineRegex(/^<((?:(?:tel|sms):\+?|\+)(?:(?:[0-9]|\([0-9]+\)))(?:[- .\/]?(?:[0-9]|\([0-9]+\)))+)>/),
|
2026-09-18 19:45:33 +00:00
|
|
|
parse(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let items;
|
|
|
|
|
const obj = arg0[1];
|
|
|
|
|
const tmp = arg0[1];
|
|
|
|
|
const replaced = obj.replaceAll(/[ \/]+/g, "-");
|
|
|
|
|
let text = replaced;
|
|
|
|
|
const startsWithResult = replaced.startsWith("tel:") || replaced.startsWith("sms:");
|
|
|
|
|
if (!startsWithResult) {
|
|
|
|
|
text = `tel:${obj2}`;
|
|
|
|
|
}
|
|
|
|
|
const obj3 = { type: "link", content: items, target: text };
|
|
|
|
|
items = [{ type: "text", content: tmp }];
|
|
|
|
|
return obj3;
|
|
|
|
|
}
|
|
|
|
|
};
|
2026-10-12 16:32:48 +00:00
|
|
|
const merged4 = Object.assign(module_1949.defaultRules.mailto);
|
|
|
|
|
module_1949 = module_1949_mod;
|
2026-10-01 14:13:23 +00:00
|
|
|
obj7 = {
|
|
|
|
|
requiredFirstCharacters: ["h", "s"],
|
|
|
|
|
match(arg0, inline) {
|
|
|
|
|
if (inline.inline) {
|
|
|
|
|
const match = re18.exec(arg0);
|
|
|
|
|
if (null != match) {
|
|
|
|
|
const first = match[0];
|
|
|
|
|
let diff = first.length - 1;
|
|
|
|
|
let substr = first;
|
|
|
|
|
if (0 <= diff) {
|
|
|
|
|
let num2 = 0;
|
|
|
|
|
substr = first;
|
|
|
|
|
if (")" === first[diff]) {
|
|
|
|
|
const index = first.indexOf("(", num2);
|
|
|
|
|
while (-1 !== index) {
|
|
|
|
|
let diff1 = diff - 1;
|
|
|
|
|
substr = first;
|
|
|
|
|
if (0 <= diff1) {
|
|
|
|
|
diff = diff1;
|
|
|
|
|
num2 = tmp7;
|
|
|
|
|
substr = first;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
substr = first.slice(0, first.length - 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
match[1] = substr;
|
|
|
|
|
match[0] = substr;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return match;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
return null;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
},
|
2026-10-01 14:13:23 +00:00
|
|
|
parse: parseLink
|
|
|
|
|
};
|
2026-10-12 16:32:48 +00:00
|
|
|
const merged5 = Object.assign(module_1949.defaultRules.url);
|
2026-10-01 14:13:23 +00:00
|
|
|
obj8 = {
|
|
|
|
|
parse(arg0, fn, parseInlineCodeChildContent) {
|
2026-10-12 16:32:48 +00:00
|
|
|
const inlineCode = module_1949.defaultRules.inlineCode;
|
2026-10-01 14:13:23 +00:00
|
|
|
const parsed = inlineCode.parse(arg0, fn, parseInlineCodeChildContent);
|
|
|
|
|
let tmp2 = parsed;
|
|
|
|
|
if (true === parseInlineCodeChildContent.parseInlineCodeChildContent) {
|
|
|
|
|
const obj = { validationChildContent: fn(parsed.content, parseInlineCodeChildContent) };
|
|
|
|
|
const merged = Object.assign(parsed);
|
|
|
|
|
tmp2 = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return tmp2;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
};
|
2026-10-12 16:32:48 +00:00
|
|
|
const merged6 = Object.assign(module_1949.defaultRules.inlineCode);
|
2026-10-01 14:13:23 +00:00
|
|
|
({ order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["\u00AF"], match, parse });
|
2026-10-12 16:32:48 +00:00
|
|
|
({ order: module_1949.defaultRules.codeBlock.order, requiredFirstCharacters: ["`"], match: match2, parse: parse2 });
|
2026-10-01 14:13:23 +00:00
|
|
|
({ order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["<"], match: match3, parse: parse3 });
|
|
|
|
|
({ order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["<", "@"], match: match4, parse: parse4 });
|
|
|
|
|
({ order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["@"], match: match5, parse: parse5 });
|
2026-10-12 16:32:48 +00:00
|
|
|
({ order: module_1949.defaultRules.text.order, requiredFirstCharacters: ["<"], match: match6, parse: parse6 });
|
|
|
|
|
({ order: module_1949.defaultRules.text.order, requiredFirstCharacters: ["<"], match: match7, parse: parse7 });
|
|
|
|
|
({ order: module_1949.defaultRules.text.order, requiredFirstCharacters: ["<"], match: match8, parse: parse8 });
|
2026-10-01 14:13:23 +00:00
|
|
|
({ order: MarkupTextRuleDefault.order, requiredFirstCharacters: [":"], match: match9, parse: parse9 });
|
|
|
|
|
({ order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["<"], match: match10, parse: parse10 });
|
|
|
|
|
({ order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["<"], match: match11, parse: parse11 });
|
|
|
|
|
({ order: MarkupTextRuleDefault.order - 1, requiredFirstCharacters: ["<"], match: match12, parse: parse12 });
|
2026-10-12 16:32:48 +00:00
|
|
|
obj21 = { order: module_1949.defaultRules.u.order, requiredFirstCharacters: ["~"], match: module_1949.inlineRegex(/^~~([\s\S]+?)~~(?!_)/), parse: module_1949.defaultRules.u.parse };
|
|
|
|
|
module_1949 = module_1949_mod;
|
2026-10-01 14:13:23 +00:00
|
|
|
({ order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["|"], match: match13, parse: parse13 });
|
|
|
|
|
({ order: MarkupTextRuleDefault.order, requiredFirstCharacters: ["<"], match: match14, parse: parse14 });
|
2026-09-18 19:45:33 +00:00
|
|
|
let items = [obj, ];
|
|
|
|
|
let combineMarkupRules = combineMarkupRules_mod;
|
|
|
|
|
items[1] = PlatformMarkupRulesDefault;
|
|
|
|
|
const importDefaultResult3Result = combineMarkupRules(items);
|
2026-10-01 14:13:23 +00:00
|
|
|
let module_12 = module_12_mod;
|
|
|
|
|
const omitResult = module_12.omit(importDefaultResult3Result, ["inlineCode", "codeBlock", "br", "blockQuote", "subtext", "soundboard"]);
|
|
|
|
|
module_12 = module_12_mod;
|
|
|
|
|
const omitResult1 = module_12.omit(importDefaultResult3Result, ["inlineCode", "codeBlock", "br", "blockQuote", "autolink", "url", "attachmentLink", "mention", "roleMention", "channelMention", "channelOrMessageUrl", "mediaPostLink", "subtext", "soundboard", "gameMention"]);
|
|
|
|
|
module_12 = module_12_mod;
|
|
|
|
|
const omitResult2 = module_12.omit(importDefaultResult3Result, ["codeBlock", "br", "mention", "channel", "roleMention", "attachmentLink", "subtext", "soundboard", "gameMention"]);
|
|
|
|
|
module_12 = module_12_mod;
|
|
|
|
|
let items1 = [importDefaultResult3Result, ];
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj24 = {
|
|
|
|
|
inlineCode: {
|
|
|
|
|
match(arg0, arg1, arg2) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const str = importDefaultResult3Result.codeBlock;
|
|
|
|
|
const match = str.match(arg0, arg1, arg2);
|
|
|
|
|
const tmp = importDefaultResult3Result;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != match) {
|
2026-10-09 10:34:53 +00:00
|
|
|
let formatted;
|
|
|
|
|
if (match[1] != null) {
|
|
|
|
|
formatted = str3.toLowerCase();
|
|
|
|
|
}
|
|
|
|
|
if ("ansi" === formatted) {
|
|
|
|
|
const obj = match[2];
|
|
|
|
|
match[2] = obj.replaceAll(regExp, "");
|
|
|
|
|
}
|
2026-09-18 19:45:33 +00:00
|
|
|
return match;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
const str2 = tmp.inlineCode;
|
|
|
|
|
const match1 = str2.match(arg0, arg1, arg2);
|
2026-09-18 19:45:33 +00:00
|
|
|
let tmp4;
|
|
|
|
|
if (null != match1) {
|
|
|
|
|
tmp4 = match1;
|
|
|
|
|
}
|
|
|
|
|
return tmp4;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
2026-10-01 14:13:23 +00:00
|
|
|
items1[1] = obj24;
|
|
|
|
|
const omitResult3 = module_12.omit(combineMarkupRules(items1), ["blockQuote", "codeBlock", "br"]);
|
|
|
|
|
module_12 = module_12_mod;
|
|
|
|
|
const omitResult4 = module_12.omit(importDefaultResult3Result, ["codeBlock", "br", "blockQuote"]);
|
|
|
|
|
module_12 = module_12_mod;
|
|
|
|
|
const omitResult5 = module_12.omit(importDefaultResult3Result, ["codeBlock", "br", "attachmentLink", "mention", "roleMention", "channel", "paragraph", "newline", "soundboard"]);
|
|
|
|
|
module_12 = module_12_mod;
|
|
|
|
|
const omitResult6 = module_12.omit(importDefaultResult3Result, ["codeBlock", "blockQuote", "br"]);
|
|
|
|
|
module_12 = module_12_mod;
|
|
|
|
|
let items2 = [, ];
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj25 = {
|
|
|
|
|
highlightWord: {
|
|
|
|
|
order: -1,
|
|
|
|
|
match(arr, parseDepth) {
|
|
|
|
|
if (null != parseDepth.parseDepth) {
|
|
|
|
|
if (parseDepth.parseDepth > 10) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (null != parseDepth.highlightWord) {
|
|
|
|
|
if (0 !== parseDepth.highlightWord.length) {
|
|
|
|
|
const index = arr.indexOf(parseDepth.highlightWord);
|
|
|
|
|
if (-1 === index) {
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
|
|
|
|
let tmp2 = 0 === arr.length;
|
|
|
|
|
if (!tmp2) {
|
|
|
|
|
let tmp = 0 === index;
|
|
|
|
|
if (!tmp) {
|
|
|
|
|
const str = arr.charAt(index - 1);
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp = "" === str.trim();
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
tmp2 = tmp;
|
|
|
|
|
}
|
|
|
|
|
let tmp3 = !tmp2;
|
|
|
|
|
if (tmp2) {
|
|
|
|
|
const sum = index + parseDepth.highlightWord.length;
|
|
|
|
|
let tmp5 = sum === arr.length;
|
|
|
|
|
if (!tmp5) {
|
|
|
|
|
const str3 = arr.charAt(sum);
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp5 = "" === str3.trim();
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
tmp3 = !tmp5;
|
|
|
|
|
}
|
|
|
|
|
let tmp6 = index;
|
|
|
|
|
let tmp7 = index;
|
|
|
|
|
if (tmp3) {
|
|
|
|
|
while (true) {
|
|
|
|
|
let index1 = arr.indexOf(parseDepth.highlightWord, tmp6 + 1);
|
|
|
|
|
let tmp9 = 0 === arr.length;
|
|
|
|
|
if (!tmp9) {
|
|
|
|
|
let tmp10 = 0 === index1;
|
|
|
|
|
if (!tmp10) {
|
|
|
|
|
let str6 = arr.charAt(index1 - 1);
|
|
|
|
|
tmp10 = "" === str6.trim();
|
|
|
|
|
}
|
|
|
|
|
tmp9 = tmp10;
|
|
|
|
|
}
|
|
|
|
|
let tmp11 = !tmp9;
|
|
|
|
|
if (tmp9) {
|
|
|
|
|
let sum1 = index1 + parseDepth.highlightWord.length;
|
|
|
|
|
let tmp13 = sum1 === arr.length;
|
|
|
|
|
if (!tmp13) {
|
|
|
|
|
let str7 = arr.charAt(sum1);
|
|
|
|
|
tmp13 = "" === str7.trim();
|
|
|
|
|
}
|
|
|
|
|
tmp11 = !tmp13;
|
|
|
|
|
}
|
|
|
|
|
tmp7 = index1;
|
|
|
|
|
if (!tmp11) {
|
|
|
|
|
break;
|
|
|
|
|
} else {
|
|
|
|
|
tmp6 = index1;
|
|
|
|
|
tmp7 = index1;
|
|
|
|
|
if (-1 === index1) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (-1 === tmp7) {
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
|
|
|
|
const substr = arr.substring(0, tmp7);
|
|
|
|
|
const items = [arr, parseDepth.highlightWord, substr, arr.substring(tmp7 + parseDepth.highlightWord.length)];
|
|
|
|
|
return items;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
},
|
|
|
|
|
parse(arg0, arg1, arg2) {
|
|
|
|
|
let num = module.parseDepth;
|
|
|
|
|
if (num == null) {
|
|
|
|
|
num = 0;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = { parseDepth: num + 1 };
|
2026-09-18 19:45:33 +00:00
|
|
|
const merged = Object.assign(module);
|
|
|
|
|
const _module = require("ChannelStore");
|
|
|
|
|
const _module1 = require("GuildRoleStore");
|
|
|
|
|
const items = [..._module, obj2, ..._module1];
|
|
|
|
|
return items;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
2026-10-01 14:13:23 +00:00
|
|
|
items2[0] = obj25;
|
|
|
|
|
const omitResult7 = module_12.omit(importDefaultResult3Result, ["codeBlock", "br", "inlineCode"]);
|
|
|
|
|
combineMarkupRules = combineMarkupRules_mod;
|
|
|
|
|
module_12 = module_12_mod;
|
|
|
|
|
items2[1] = module_12.omit(importDefaultResult3Result, ["url"]);
|
|
|
|
|
const obj26 = { RULES: importDefaultResult3Result, CHANNEL_TOPIC_RULES: omitResult, VOICE_CHANNEL_STATUS_RULES: omitResult1, EMBED_TITLE_RULES: omitResult2, INLINE_REPLY_RULES: omitResult3, GUILD_VERIFICATION_FORM_RULES: omitResult4, GUILD_EVENT_RULES: omitResult6, PROFILE_BIO_RULES: omitResult5, AUTO_MODERATION_SYSTEM_MESSAGE_RULES: combineMarkupRules(items2), NATIVE_SEARCH_RESULT_LINK_RULES: omitResult7 };
|
2026-09-18 19:45:33 +00:00
|
|
|
let result = size.fileFinishedImporting("modules/markup/MarkupRules.tsx");
|
|
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
export default obj26;
|
2026-09-18 19:45:33 +00:00
|
|
|
export { hydrateRoleMention };
|
|
|
|
|
export { hydrateUserMention };
|
|
|
|
|
export const hydrateCommandMention = function hydrateCommandMention(name, commandId, channelId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let items1;
|
2026-09-18 19:45:33 +00:00
|
|
|
const items = [..._toArray(name.split(" ")).slice(1)];
|
2026-10-01 14:13:23 +00:00
|
|
|
_toArray(name.split(" "));
|
2026-10-12 16:32:48 +00:00
|
|
|
const mapped = items.map(f92036);
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = { type: "commandMention", channelId: channelId.channelId, commandId, commandName: name, commandKey: "" + commandId + mapped.join(""), content: items1 };
|
|
|
|
|
items1 = [{ type: "text", content: "" + name }];
|
|
|
|
|
({ type: "text", content: "" + name });
|
2026-09-18 19:45:33 +00:00
|
|
|
return obj;
|
|
|
|
|
};
|
2026-09-21 13:40:21 +00:00
|
|
|
export { hydrateStaticRouteLink };
|