"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("regex-combined-emojis"),y=require("emoji-toolkit/emoji_strategy.json"),f=new RegExp(U.emojiPattern,"g"),j="9.0",u="https://cdn.jsdelivr.net/joypixels/assets/"+j+"/png/unicode/32/";exports.customEmojiAssetUrl=null;exports.emojiImageUrlSmall=u;exports.emojiFileExtensionSmall=".png";exports.emojiImageUrlLarge=u;exports.emojiFileExtensionLarge=".png";const m=y,g=new RegExp("(^| |(?<=:))(:\\w+:)","g");function E(){return m}function A(e,t=".png"){e.endsWith("/")||(e=e+"/"),exports.emojiImageUrlSmall=e,exports.emojiFileExtensionSmall=t}function x(e,t=".svg"){e.endsWith("/")||(e=e+"/"),exports.emojiImageUrlLarge=e,exports.emojiFileExtensionLarge=t}function P(e){exports.customEmojiAssetUrl=e}function T(e){h(e)}function h(e){const t=["custom","date_added","image"],o=["date_added","image","unicode_output","shortname","shortname_alternates","custom","name"],n=(s,i,r)=>{if(s[i]===void 0){if(!t.includes(i))return;s[i]=r}else Array.isArray(s[i])?s[i]=s[i].concat(r):s[i]=r};Object.entries(e).forEach(s=>{const[i,r]=s;if(i in m){const d=m[i];for(const c in r){const C=r[c];n(d,c,C)}}else o.every(c=>r[c]!==void 0)?m[i]=r:console.error("The following custom emoji doesn't contain the required properties:",r)})}function a(e){function t(n,s){if(!(!n||typeof n!="object")){if("shortname"in n&&(n.shortname===e||n.shortname_alternates.includes(e)))return n.key=s,o=n,!0;Object.keys(n).some(function(i){return t(n[i],i)})}}let o;return t(E(),null),o}function p(e){var o;if(e.startsWith(":"))return e;const t=l(e);return(o=m[t])==null?void 0:o.shortname}function l(e){let t="";for(const o of e){const n=o.codePointAt(0).toString(16).padStart(4,"0");["200d","fe0f"].includes(n)||(t!==""&&(t=t+"-"),t=t+n)}return t}function v(e){const t=e.split("-");let o="";return t.forEach(n=>{o=o+String.fromCodePoint(parseInt(n,16))}),o}function R(e){if(e=e==null?void 0:e.trim(),e.startsWith(":")&&e.endsWith(":"))return a(e);{const t=l(e),o=m[t];return o&&(o.key=t),o}}function _(e){const t=(e.match(g)||[]).map(o=>o.trim());return S(t)}function S(e){const t=e?e.filter(o=>a(o)):[];return new Set(t)}function J(e){const t=[...e.matchAll(f)],o=t.length?t.map(n=>n[0]):[];return new Set(o)}exports.codeToEmojiData=R;exports.defaultEmojiAssetUrl=u;exports.emojiJson=m;exports.emojiRegex=f;exports.emojiShortCodeRegex=g;exports.emojiVersion=j;exports.filterValidShortCodes=S;exports.findEmojis=J;exports.findShortCodes=_;exports.getEmojiData=E;exports.getEmojiShortCode=p;exports.setCustomEmojiJson=T;exports.setCustomEmojiUrl=P;exports.setEmojiAssetUrlLarge=x;exports.setEmojiAssetUrlSmall=A;exports.shortcodeToEmojiData=a;exports.stringToUnicode=v;exports.unicodeToString=l;exports.validateCustomEmojiJson=h;
//# sourceMappingURL=index.cjs.map
