react-input-emoji 5.5.1 → 5.6.2

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.es.js CHANGED
@@ -5,15 +5,12 @@ import t from 'prop-types';
5
5
  function styleInject(css, ref) {
6
6
  if (ref === void 0) ref = {};
7
7
  var insertAt = ref.insertAt;
8
-
9
8
  if (!css || typeof document === 'undefined') {
10
9
  return;
11
10
  }
12
-
13
11
  var head = document.head || document.getElementsByTagName('head')[0];
14
12
  var style = document.createElement('style');
15
13
  style.type = 'text/css';
16
-
17
14
  if (insertAt === 'top') {
18
15
  if (head.firstChild) {
19
16
  head.insertBefore(style, head.firstChild);
@@ -23,7 +20,6 @@ function styleInject(css, ref) {
23
20
  } else {
24
21
  head.appendChild(style);
25
22
  }
26
-
27
23
  if (style.styleSheet) {
28
24
  style.styleSheet.cssText = css;
29
25
  } else {
@@ -34,377 +30,355 @@ function styleInject(css, ref) {
34
30
  var css_248z = ".react-input-emoji--container {\n color: #4b4b4b;\n text-rendering: optimizeLegibility;\n background-color: #fff;\n border: 1px solid #fff;\n border-radius: 21px;\n margin: 5px 10px;\n box-sizing: border-box;\n flex: 1 1 auto;\n font-size: 15px;\n font-family: sans-serif;\n font-weight: 400;\n line-height: 20px;\n min-height: 20px;\n min-width: 0;\n outline: none;\n width: inherit;\n will-change: width;\n vertical-align: baseline;\n border: 1px solid #eaeaea;\n margin-right: 0;\n}\n\n.react-input-emoji--wrapper {\n display: flex;\n overflow: hidden;\n flex: 1;\n position: relative;\n padding-right: 0;\n vertical-align: baseline;\n outline: none;\n margin: 0;\n padding: 0;\n border: 0;\n}\n\n.react-input-emoji--input {\n font-weight: 400;\n max-height: 100px;\n min-height: 20px;\n outline: none;\n overflow-x: hidden;\n overflow-y: auto;\n position: relative;\n white-space: pre-wrap;\n word-wrap: break-word;\n z-index: 1;\n width: 100%;\n user-select: text;\n padding: 9px 12px 11px;\n text-align: left;\n}\n\n.react-input-emoji--input img {\n vertical-align: middle;\n width: 18px !important;\n height: 18px !important;\n display: inline !important;\n margin-left: 1px;\n margin-right: 1px;\n}\n\n.react-input-emoji--overlay {\n position: fixed;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 9;\n}\n\n.react-input-emoji--placeholder {\n color: #a0a0a0;\n pointer-events: none;\n position: absolute;\n user-select: none;\n z-index: 2;\n left: 16px;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n width: calc(100% - 22px);\n}\n\n.react-input-emoji--button {\n position: relative;\n display: block;\n text-align: center;\n padding: 0 10px;\n overflow: hidden;\n transition: color 0.1s ease-out;\n margin: 0;\n box-shadow: none;\n background: none;\n border: none;\n outline: none;\n cursor: pointer;\n flex-shrink: 0;\n}\n\n.react-input-emoji--button svg {\n fill: #858585;\n}\n\n.react-input-emoji--button__show svg {\n fill: #128b7e;\n}\n\n.react-emoji {\n display: flex;\n align-items: center;\n position: relative;\n width: 100%;\n}\n\n.react-emoji-picker--container {\n position: absolute;\n top: 0;\n width: 100%;\n}\n\n.react-emoji-picker--wrapper {\n position: absolute;\n bottom: 0;\n right: 0;\n height: 435px;\n width: 352px;\n overflow: hidden;\n z-index: 10;\n}\n\n.react-emoji-picker {\n position: absolute;\n top: 0;\n left: 0;\n animation: slidein 0.1s ease-in-out;\n}\n\n.react-emoji-picker__show {\n top: 0;\n}\n\n.react-input-emoji--mention--container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 10;\n}\n\n.react-input-emoji--mention--list {\n background-color: #fafafa;\n border: 1px solid #eaeaea;\n border-radius: 4px;\n margin: 0;\n padding: 0;\n list-style: none;\n display: flex;\n gap: 5px;\n flex-direction: column;\n position: absolute;\n bottom: 0;\n width: 100%;\n left: 0;\n}\n\n.react-input-emoji--mention--item {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 5px 10px;\n background-color: transparent;\n width: 100%;\n margin: 0;\n border: 0;\n}\n\n.react-input-emoji--mention--item__selected {\n background-color: #eeeeee;\n}\n\n.react-input-emoji--mention--item--img {\n width: 34px;\n height: 34px;\n border-radius: 50%;\n}\n\n.react-input-emoji--mention--item--name {\n font-size: 16px;\n color: #333;\n}\n\n.react-input-emoji--mention--item--name__selected {\n color: green;\n}\n\n.react-input-emoji--mention--text {\n color: #039be5;\n}\n\n.react-input-emoji--mention--loading {\n background-color: #fafafa;\n border: 1px solid #eaeaea;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 10px 0;\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n}\n\n.react-input-emoji--mention--loading--spinner,\n.react-input-emoji--mention--loading--spinner::after {\n border-radius: 50%;\n width: 10em;\n height: 10em;\n}\n\n.react-input-emoji--mention--loading--spinner {\n margin: 1px auto;\n font-size: 2px;\n position: relative;\n text-indent: -9999em;\n border-top: 1.1em solid rgba(0, 0, 0, 0.1);\n border-right: 1.1em solid rgba(0, 0, 0, 0.1);\n border-bottom: 1.1em solid rgba(0, 0, 0, 0.1);\n border-left: 1.1em solid rgba(0, 0, 0, 0.4);\n transform: translateZ(0);\n animation: load8 1.1s infinite linear;\n}\n\n@keyframes load8 {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n@keyframes slidein {\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n}\n";
35
31
  styleInject(css_248z);
36
32
 
37
- function ownKeys(object, enumerableOnly) {
38
- var keys = Object.keys(object);
39
-
33
+ function _iterableToArrayLimit(r, l) {
34
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
35
+ if (null != t) {
36
+ var e,
37
+ n,
38
+ i,
39
+ u,
40
+ a = [],
41
+ f = !0,
42
+ o = !1;
43
+ try {
44
+ if (i = (t = t.call(r)).next, 0 === l) {
45
+ if (Object(t) !== t) return;
46
+ f = !1;
47
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
48
+ } catch (r) {
49
+ o = !0, n = r;
50
+ } finally {
51
+ try {
52
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
53
+ } finally {
54
+ if (o) throw n;
55
+ }
56
+ }
57
+ return a;
58
+ }
59
+ }
60
+ function ownKeys(e, r) {
61
+ var t = Object.keys(e);
40
62
  if (Object.getOwnPropertySymbols) {
41
- var symbols = Object.getOwnPropertySymbols(object);
42
- enumerableOnly && (symbols = symbols.filter(function (sym) {
43
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
44
- })), keys.push.apply(keys, symbols);
63
+ var o = Object.getOwnPropertySymbols(e);
64
+ r && (o = o.filter(function (r) {
65
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
66
+ })), t.push.apply(t, o);
45
67
  }
46
-
47
- return keys;
68
+ return t;
48
69
  }
49
-
50
- function _objectSpread2(target) {
51
- for (var i = 1; i < arguments.length; i++) {
52
- var source = null != arguments[i] ? arguments[i] : {};
53
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
54
- _defineProperty(target, key, source[key]);
55
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
56
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
70
+ function _objectSpread2(e) {
71
+ for (var r = 1; r < arguments.length; r++) {
72
+ var t = null != arguments[r] ? arguments[r] : {};
73
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
74
+ _defineProperty(e, r, t[r]);
75
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
76
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
57
77
  });
58
78
  }
59
-
60
- return target;
79
+ return e;
61
80
  }
62
-
63
81
  function _regeneratorRuntime() {
64
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
65
-
66
82
  _regeneratorRuntime = function () {
67
- return exports;
83
+ return e;
68
84
  };
69
-
70
- var exports = {},
71
- Op = Object.prototype,
72
- hasOwn = Op.hasOwnProperty,
73
- $Symbol = "function" == typeof Symbol ? Symbol : {},
74
- iteratorSymbol = $Symbol.iterator || "@@iterator",
75
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
76
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
77
-
78
- function define(obj, key, value) {
79
- return Object.defineProperty(obj, key, {
80
- value: value,
85
+ var t,
86
+ e = {},
87
+ r = Object.prototype,
88
+ n = r.hasOwnProperty,
89
+ o = Object.defineProperty || function (t, e, r) {
90
+ t[e] = r.value;
91
+ },
92
+ i = "function" == typeof Symbol ? Symbol : {},
93
+ a = i.iterator || "@@iterator",
94
+ c = i.asyncIterator || "@@asyncIterator",
95
+ u = i.toStringTag || "@@toStringTag";
96
+ function define(t, e, r) {
97
+ return Object.defineProperty(t, e, {
98
+ value: r,
81
99
  enumerable: !0,
82
100
  configurable: !0,
83
101
  writable: !0
84
- }), obj[key];
102
+ }), t[e];
85
103
  }
86
-
87
104
  try {
88
105
  define({}, "");
89
- } catch (err) {
90
- define = function (obj, key, value) {
91
- return obj[key] = value;
106
+ } catch (t) {
107
+ define = function (t, e, r) {
108
+ return t[e] = r;
92
109
  };
93
110
  }
94
-
95
- function wrap(innerFn, outerFn, self, tryLocsList) {
96
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
97
- generator = Object.create(protoGenerator.prototype),
98
- context = new Context(tryLocsList || []);
99
- return generator._invoke = function (innerFn, self, context) {
100
- var state = "suspendedStart";
101
- return function (method, arg) {
102
- if ("executing" === state) throw new Error("Generator is already running");
103
-
104
- if ("completed" === state) {
105
- if ("throw" === method) throw arg;
106
- return doneResult();
107
- }
108
-
109
- for (context.method = method, context.arg = arg;;) {
110
- var delegate = context.delegate;
111
-
112
- if (delegate) {
113
- var delegateResult = maybeInvokeDelegate(delegate, context);
114
-
115
- if (delegateResult) {
116
- if (delegateResult === ContinueSentinel) continue;
117
- return delegateResult;
118
- }
119
- }
120
-
121
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
122
- if ("suspendedStart" === state) throw state = "completed", context.arg;
123
- context.dispatchException(context.arg);
124
- } else "return" === context.method && context.abrupt("return", context.arg);
125
- state = "executing";
126
- var record = tryCatch(innerFn, self, context);
127
-
128
- if ("normal" === record.type) {
129
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
130
- return {
131
- value: record.arg,
132
- done: context.done
133
- };
134
- }
135
-
136
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
137
- }
138
- };
139
- }(innerFn, self, context), generator;
111
+ function wrap(t, e, r, n) {
112
+ var i = e && e.prototype instanceof Generator ? e : Generator,
113
+ a = Object.create(i.prototype),
114
+ c = new Context(n || []);
115
+ return o(a, "_invoke", {
116
+ value: makeInvokeMethod(t, r, c)
117
+ }), a;
140
118
  }
141
-
142
- function tryCatch(fn, obj, arg) {
119
+ function tryCatch(t, e, r) {
143
120
  try {
144
121
  return {
145
122
  type: "normal",
146
- arg: fn.call(obj, arg)
123
+ arg: t.call(e, r)
147
124
  };
148
- } catch (err) {
125
+ } catch (t) {
149
126
  return {
150
127
  type: "throw",
151
- arg: err
128
+ arg: t
152
129
  };
153
130
  }
154
131
  }
155
-
156
- exports.wrap = wrap;
157
- var ContinueSentinel = {};
158
-
132
+ e.wrap = wrap;
133
+ var h = "suspendedStart",
134
+ l = "suspendedYield",
135
+ f = "executing",
136
+ s = "completed",
137
+ y = {};
159
138
  function Generator() {}
160
-
161
139
  function GeneratorFunction() {}
162
-
163
140
  function GeneratorFunctionPrototype() {}
164
-
165
- var IteratorPrototype = {};
166
- define(IteratorPrototype, iteratorSymbol, function () {
141
+ var p = {};
142
+ define(p, a, function () {
167
143
  return this;
168
144
  });
169
- var getProto = Object.getPrototypeOf,
170
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
171
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
172
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
173
-
174
- function defineIteratorMethods(prototype) {
175
- ["next", "throw", "return"].forEach(function (method) {
176
- define(prototype, method, function (arg) {
177
- return this._invoke(method, arg);
145
+ var d = Object.getPrototypeOf,
146
+ v = d && d(d(values([])));
147
+ v && v !== r && n.call(v, a) && (p = v);
148
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
149
+ function defineIteratorMethods(t) {
150
+ ["next", "throw", "return"].forEach(function (e) {
151
+ define(t, e, function (t) {
152
+ return this._invoke(e, t);
178
153
  });
179
154
  });
180
155
  }
181
-
182
- function AsyncIterator(generator, PromiseImpl) {
183
- function invoke(method, arg, resolve, reject) {
184
- var record = tryCatch(generator[method], generator, arg);
185
-
186
- if ("throw" !== record.type) {
187
- var result = record.arg,
188
- value = result.value;
189
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
190
- invoke("next", value, resolve, reject);
191
- }, function (err) {
192
- invoke("throw", err, resolve, reject);
193
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
194
- result.value = unwrapped, resolve(result);
195
- }, function (error) {
196
- return invoke("throw", error, resolve, reject);
156
+ function AsyncIterator(t, e) {
157
+ function invoke(r, o, i, a) {
158
+ var c = tryCatch(t[r], t, o);
159
+ if ("throw" !== c.type) {
160
+ var u = c.arg,
161
+ h = u.value;
162
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
163
+ invoke("next", t, i, a);
164
+ }, function (t) {
165
+ invoke("throw", t, i, a);
166
+ }) : e.resolve(h).then(function (t) {
167
+ u.value = t, i(u);
168
+ }, function (t) {
169
+ return invoke("throw", t, i, a);
197
170
  });
198
171
  }
199
-
200
- reject(record.arg);
172
+ a(c.arg);
201
173
  }
202
-
203
- var previousPromise;
204
-
205
- this._invoke = function (method, arg) {
206
- function callInvokeWithMethodAndArg() {
207
- return new PromiseImpl(function (resolve, reject) {
208
- invoke(method, arg, resolve, reject);
209
- });
174
+ var r;
175
+ o(this, "_invoke", {
176
+ value: function (t, n) {
177
+ function callInvokeWithMethodAndArg() {
178
+ return new e(function (e, r) {
179
+ invoke(t, n, e, r);
180
+ });
181
+ }
182
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
210
183
  }
211
-
212
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
213
- };
184
+ });
214
185
  }
215
-
216
- function maybeInvokeDelegate(delegate, context) {
217
- var method = delegate.iterator[context.method];
218
-
219
- if (undefined === method) {
220
- if (context.delegate = null, "throw" === context.method) {
221
- if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
222
- context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
186
+ function makeInvokeMethod(e, r, n) {
187
+ var o = h;
188
+ return function (i, a) {
189
+ if (o === f) throw new Error("Generator is already running");
190
+ if (o === s) {
191
+ if ("throw" === i) throw a;
192
+ return {
193
+ value: t,
194
+ done: !0
195
+ };
223
196
  }
224
-
225
- return ContinueSentinel;
226
- }
227
-
228
- var record = tryCatch(method, delegate.iterator, context.arg);
229
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
230
- var info = record.arg;
231
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
197
+ for (n.method = i, n.arg = a;;) {
198
+ var c = n.delegate;
199
+ if (c) {
200
+ var u = maybeInvokeDelegate(c, n);
201
+ if (u) {
202
+ if (u === y) continue;
203
+ return u;
204
+ }
205
+ }
206
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
207
+ if (o === h) throw o = s, n.arg;
208
+ n.dispatchException(n.arg);
209
+ } else "return" === n.method && n.abrupt("return", n.arg);
210
+ o = f;
211
+ var p = tryCatch(e, r, n);
212
+ if ("normal" === p.type) {
213
+ if (o = n.done ? s : l, p.arg === y) continue;
214
+ return {
215
+ value: p.arg,
216
+ done: n.done
217
+ };
218
+ }
219
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
220
+ }
221
+ };
232
222
  }
233
-
234
- function pushTryEntry(locs) {
235
- var entry = {
236
- tryLoc: locs[0]
223
+ function maybeInvokeDelegate(e, r) {
224
+ var n = r.method,
225
+ o = e.iterator[n];
226
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
227
+ var i = tryCatch(o, e.iterator, r.arg);
228
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
229
+ var a = i.arg;
230
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
231
+ }
232
+ function pushTryEntry(t) {
233
+ var e = {
234
+ tryLoc: t[0]
237
235
  };
238
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
236
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
239
237
  }
240
-
241
- function resetTryEntry(entry) {
242
- var record = entry.completion || {};
243
- record.type = "normal", delete record.arg, entry.completion = record;
238
+ function resetTryEntry(t) {
239
+ var e = t.completion || {};
240
+ e.type = "normal", delete e.arg, t.completion = e;
244
241
  }
245
-
246
- function Context(tryLocsList) {
242
+ function Context(t) {
247
243
  this.tryEntries = [{
248
244
  tryLoc: "root"
249
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
245
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
250
246
  }
251
-
252
- function values(iterable) {
253
- if (iterable) {
254
- var iteratorMethod = iterable[iteratorSymbol];
255
- if (iteratorMethod) return iteratorMethod.call(iterable);
256
- if ("function" == typeof iterable.next) return iterable;
257
-
258
- if (!isNaN(iterable.length)) {
259
- var i = -1,
260
- next = function next() {
261
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
262
-
263
- return next.value = undefined, next.done = !0, next;
264
- };
265
-
266
- return next.next = next;
247
+ function values(e) {
248
+ if (e || "" === e) {
249
+ var r = e[a];
250
+ if (r) return r.call(e);
251
+ if ("function" == typeof e.next) return e;
252
+ if (!isNaN(e.length)) {
253
+ var o = -1,
254
+ i = function next() {
255
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
256
+ return next.value = t, next.done = !0, next;
257
+ };
258
+ return i.next = i;
267
259
  }
268
260
  }
269
-
270
- return {
271
- next: doneResult
272
- };
273
- }
274
-
275
- function doneResult() {
276
- return {
277
- value: undefined,
278
- done: !0
279
- };
261
+ throw new TypeError(typeof e + " is not iterable");
280
262
  }
281
-
282
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
283
- var ctor = "function" == typeof genFun && genFun.constructor;
284
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
285
- }, exports.mark = function (genFun) {
286
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
287
- }, exports.awrap = function (arg) {
263
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
264
+ value: GeneratorFunctionPrototype,
265
+ configurable: !0
266
+ }), o(GeneratorFunctionPrototype, "constructor", {
267
+ value: GeneratorFunction,
268
+ configurable: !0
269
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
270
+ var e = "function" == typeof t && t.constructor;
271
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
272
+ }, e.mark = function (t) {
273
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
274
+ }, e.awrap = function (t) {
288
275
  return {
289
- __await: arg
276
+ __await: t
290
277
  };
291
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
278
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
292
279
  return this;
293
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
294
- void 0 === PromiseImpl && (PromiseImpl = Promise);
295
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
296
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
297
- return result.done ? result.value : iter.next();
280
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
281
+ void 0 === i && (i = Promise);
282
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
283
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
284
+ return t.done ? t.value : a.next();
298
285
  });
299
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
286
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
300
287
  return this;
301
- }), define(Gp, "toString", function () {
288
+ }), define(g, "toString", function () {
302
289
  return "[object Generator]";
303
- }), exports.keys = function (object) {
304
- var keys = [];
305
-
306
- for (var key in object) keys.push(key);
307
-
308
- return keys.reverse(), function next() {
309
- for (; keys.length;) {
310
- var key = keys.pop();
311
- if (key in object) return next.value = key, next.done = !1, next;
290
+ }), e.keys = function (t) {
291
+ var e = Object(t),
292
+ r = [];
293
+ for (var n in e) r.push(n);
294
+ return r.reverse(), function next() {
295
+ for (; r.length;) {
296
+ var t = r.pop();
297
+ if (t in e) return next.value = t, next.done = !1, next;
312
298
  }
313
-
314
299
  return next.done = !0, next;
315
300
  };
316
- }, exports.values = values, Context.prototype = {
301
+ }, e.values = values, Context.prototype = {
317
302
  constructor: Context,
318
- reset: function (skipTempReset) {
319
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
303
+ reset: function (e) {
304
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
320
305
  },
321
306
  stop: function () {
322
307
  this.done = !0;
323
- var rootRecord = this.tryEntries[0].completion;
324
- if ("throw" === rootRecord.type) throw rootRecord.arg;
308
+ var t = this.tryEntries[0].completion;
309
+ if ("throw" === t.type) throw t.arg;
325
310
  return this.rval;
326
311
  },
327
- dispatchException: function (exception) {
328
- if (this.done) throw exception;
329
- var context = this;
330
-
331
- function handle(loc, caught) {
332
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
312
+ dispatchException: function (e) {
313
+ if (this.done) throw e;
314
+ var r = this;
315
+ function handle(n, o) {
316
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
333
317
  }
334
-
335
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
336
- var entry = this.tryEntries[i],
337
- record = entry.completion;
338
- if ("root" === entry.tryLoc) return handle("end");
339
-
340
- if (entry.tryLoc <= this.prev) {
341
- var hasCatch = hasOwn.call(entry, "catchLoc"),
342
- hasFinally = hasOwn.call(entry, "finallyLoc");
343
-
344
- if (hasCatch && hasFinally) {
345
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
346
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
347
- } else if (hasCatch) {
348
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
318
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
319
+ var i = this.tryEntries[o],
320
+ a = i.completion;
321
+ if ("root" === i.tryLoc) return handle("end");
322
+ if (i.tryLoc <= this.prev) {
323
+ var c = n.call(i, "catchLoc"),
324
+ u = n.call(i, "finallyLoc");
325
+ if (c && u) {
326
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
327
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
328
+ } else if (c) {
329
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
349
330
  } else {
350
- if (!hasFinally) throw new Error("try statement without catch or finally");
351
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
331
+ if (!u) throw new Error("try statement without catch or finally");
332
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
352
333
  }
353
334
  }
354
335
  }
355
336
  },
356
- abrupt: function (type, arg) {
357
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
358
- var entry = this.tryEntries[i];
359
-
360
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
361
- var finallyEntry = entry;
337
+ abrupt: function (t, e) {
338
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
339
+ var o = this.tryEntries[r];
340
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
341
+ var i = o;
362
342
  break;
363
343
  }
364
344
  }
365
-
366
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
367
- var record = finallyEntry ? finallyEntry.completion : {};
368
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
345
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
346
+ var a = i ? i.completion : {};
347
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
369
348
  },
370
- complete: function (record, afterLoc) {
371
- if ("throw" === record.type) throw record.arg;
372
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
349
+ complete: function (t, e) {
350
+ if ("throw" === t.type) throw t.arg;
351
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
373
352
  },
374
- finish: function (finallyLoc) {
375
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
376
- var entry = this.tryEntries[i];
377
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
353
+ finish: function (t) {
354
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
355
+ var r = this.tryEntries[e];
356
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
378
357
  }
379
358
  },
380
- catch: function (tryLoc) {
381
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
382
- var entry = this.tryEntries[i];
383
-
384
- if (entry.tryLoc === tryLoc) {
385
- var record = entry.completion;
386
-
387
- if ("throw" === record.type) {
388
- var thrown = record.arg;
389
- resetTryEntry(entry);
359
+ catch: function (t) {
360
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
361
+ var r = this.tryEntries[e];
362
+ if (r.tryLoc === t) {
363
+ var n = r.completion;
364
+ if ("throw" === n.type) {
365
+ var o = n.arg;
366
+ resetTryEntry(r);
390
367
  }
391
-
392
- return thrown;
368
+ return o;
393
369
  }
394
370
  }
395
-
396
371
  throw new Error("illegal catch attempt");
397
372
  },
398
- delegateYield: function (iterable, resultName, nextLoc) {
373
+ delegateYield: function (e, r, n) {
399
374
  return this.delegate = {
400
- iterator: values(iterable),
401
- resultName: resultName,
402
- nextLoc: nextLoc
403
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
375
+ iterator: values(e),
376
+ resultName: r,
377
+ nextLoc: n
378
+ }, "next" === this.method && (this.arg = t), y;
404
379
  }
405
- }, exports;
380
+ }, e;
406
381
  }
407
-
408
382
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
409
383
  try {
410
384
  var info = gen[key](arg);
@@ -413,35 +387,30 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
413
387
  reject(error);
414
388
  return;
415
389
  }
416
-
417
390
  if (info.done) {
418
391
  resolve(value);
419
392
  } else {
420
393
  Promise.resolve(value).then(_next, _throw);
421
394
  }
422
395
  }
423
-
424
396
  function _asyncToGenerator(fn) {
425
397
  return function () {
426
398
  var self = this,
427
- args = arguments;
399
+ args = arguments;
428
400
  return new Promise(function (resolve, reject) {
429
401
  var gen = fn.apply(self, args);
430
-
431
402
  function _next(value) {
432
403
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
433
404
  }
434
-
435
405
  function _throw(err) {
436
406
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
437
407
  }
438
-
439
408
  _next(undefined);
440
409
  });
441
410
  };
442
411
  }
443
-
444
412
  function _defineProperty(obj, key, value) {
413
+ key = _toPropertyKey(key);
445
414
  if (key in obj) {
446
415
  Object.defineProperty(obj, key, {
447
416
  value: value,
@@ -452,35 +421,26 @@ function _defineProperty(obj, key, value) {
452
421
  } else {
453
422
  obj[key] = value;
454
423
  }
455
-
456
424
  return obj;
457
425
  }
458
-
459
426
  function _objectWithoutPropertiesLoose(source, excluded) {
460
427
  if (source == null) return {};
461
428
  var target = {};
462
429
  var sourceKeys = Object.keys(source);
463
430
  var key, i;
464
-
465
431
  for (i = 0; i < sourceKeys.length; i++) {
466
432
  key = sourceKeys[i];
467
433
  if (excluded.indexOf(key) >= 0) continue;
468
434
  target[key] = source[key];
469
435
  }
470
-
471
436
  return target;
472
437
  }
473
-
474
438
  function _objectWithoutProperties(source, excluded) {
475
439
  if (source == null) return {};
476
-
477
440
  var target = _objectWithoutPropertiesLoose(source, excluded);
478
-
479
441
  var key, i;
480
-
481
442
  if (Object.getOwnPropertySymbols) {
482
443
  var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
483
-
484
444
  for (i = 0; i < sourceSymbolKeys.length; i++) {
485
445
  key = sourceSymbolKeys[i];
486
446
  if (excluded.indexOf(key) >= 0) continue;
@@ -488,60 +448,23 @@ function _objectWithoutProperties(source, excluded) {
488
448
  target[key] = source[key];
489
449
  }
490
450
  }
491
-
492
451
  return target;
493
452
  }
494
-
495
453
  function _slicedToArray(arr, i) {
496
454
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
497
455
  }
498
-
499
456
  function _toConsumableArray(arr) {
500
457
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
501
458
  }
502
-
503
459
  function _arrayWithoutHoles(arr) {
504
460
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
505
461
  }
506
-
507
462
  function _arrayWithHoles(arr) {
508
463
  if (Array.isArray(arr)) return arr;
509
464
  }
510
-
511
465
  function _iterableToArray(iter) {
512
466
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
513
467
  }
514
-
515
- function _iterableToArrayLimit(arr, i) {
516
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
517
-
518
- if (_i == null) return;
519
- var _arr = [];
520
- var _n = true;
521
- var _d = false;
522
-
523
- var _s, _e;
524
-
525
- try {
526
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
527
- _arr.push(_s.value);
528
-
529
- if (i && _arr.length === i) break;
530
- }
531
- } catch (err) {
532
- _d = true;
533
- _e = err;
534
- } finally {
535
- try {
536
- if (!_n && _i["return"] != null) _i["return"]();
537
- } finally {
538
- if (_d) throw _e;
539
- }
540
- }
541
-
542
- return _arr;
543
- }
544
-
545
468
  function _unsupportedIterableToArray(o, minLen) {
546
469
  if (!o) return;
547
470
  if (typeof o === "string") return _arrayLikeToArray(o, minLen);
@@ -550,35 +473,44 @@ function _unsupportedIterableToArray(o, minLen) {
550
473
  if (n === "Map" || n === "Set") return Array.from(o);
551
474
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
552
475
  }
553
-
554
476
  function _arrayLikeToArray(arr, len) {
555
477
  if (len == null || len > arr.length) len = arr.length;
556
-
557
478
  for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
558
-
559
479
  return arr2;
560
480
  }
561
-
562
481
  function _nonIterableSpread() {
563
482
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
564
483
  }
565
-
566
484
  function _nonIterableRest() {
567
485
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
568
486
  }
487
+ function _toPrimitive(input, hint) {
488
+ if (typeof input !== "object" || input === null) return input;
489
+ var prim = input[Symbol.toPrimitive];
490
+ if (prim !== undefined) {
491
+ var res = prim.call(input, hint || "default");
492
+ if (typeof res !== "object") return res;
493
+ throw new TypeError("@@toPrimitive must return a primitive value.");
494
+ }
495
+ return (hint === "string" ? String : Number)(input);
496
+ }
497
+ function _toPropertyKey(arg) {
498
+ var key = _toPrimitive(arg, "string");
499
+ return typeof key === "symbol" ? key : String(key);
500
+ }
569
501
 
570
502
  /* eslint-disable valid-jsdoc */
571
503
  // @ts-check
504
+
572
505
  var TRANSPARENT_GIF = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
506
+
573
507
  /**
574
508
  * Replace all text with emoji with an image html tag
575
509
  * @param {string} text
576
510
  * @return {string}
577
511
  */
578
-
579
512
  function replaceAllTextEmojis(text) {
580
513
  var allEmojis = getAllEmojisFromText(text);
581
-
582
514
  if (allEmojis) {
583
515
  allEmojis = _toConsumableArray(new Set(allEmojis)); // remove duplicates
584
516
 
@@ -586,9 +518,9 @@ function replaceAllTextEmojis(text) {
586
518
  text = replaceAll(text, emoji, getInputEmojiHTML(emoji));
587
519
  });
588
520
  }
589
-
590
521
  return text;
591
522
  }
523
+
592
524
  /**
593
525
  * Replace all occurrencies in a string
594
526
  * @param {string} str
@@ -596,77 +528,67 @@ function replaceAllTextEmojis(text) {
596
528
  * @param {string} replace
597
529
  * @return {string}
598
530
  */
599
-
600
531
  function replaceAll(str, find, replace) {
601
532
  return str.replace(new RegExp(find, "g"), replace);
602
533
  }
534
+
603
535
  /**
604
536
  * Get all emojis from the text
605
537
  * @param {string} text
606
538
  * @return {string[]}
607
539
  */
608
-
609
-
610
540
  function getAllEmojisFromText(text) {
611
541
  return text.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/g);
612
- } // eslint-disable-next-line valid-jsdoc
542
+ }
613
543
 
544
+ // eslint-disable-next-line valid-jsdoc
614
545
  /**
615
546
  *
616
547
  * @param { import("../types/types").EmojiMartItem } emoji
617
548
  * @return {string}
618
549
  */
619
-
620
-
621
550
  function getImageEmoji(emoji) {
622
551
  var _emojiPickerEl$shadow;
623
-
624
552
  /** @type {HTMLElement | null} */
625
553
  var emojiPickerEl = document.querySelector('em-emoji-picker');
626
-
627
554
  if (!emojiPickerEl) {
628
555
  return getInputEmojiNativeHTML(emoji["native"]);
629
556
  }
630
- /** @type {HTMLSpanElement | null=} */
631
-
632
-
633
- var emojiSpanEl = emojiPickerEl === null || emojiPickerEl === void 0 ? void 0 : (_emojiPickerEl$shadow = emojiPickerEl.shadowRoot) === null || _emojiPickerEl$shadow === void 0 ? void 0 : _emojiPickerEl$shadow.querySelector("[title=\"".concat(emoji.name, "\"] > span > span"));
634
557
 
558
+ /** @type {HTMLSpanElement | null=} */
559
+ var emojiSpanEl = emojiPickerEl === null || emojiPickerEl === void 0 || (_emojiPickerEl$shadow = emojiPickerEl.shadowRoot) === null || _emojiPickerEl$shadow === void 0 ? void 0 : _emojiPickerEl$shadow.querySelector("[title=\"".concat(emoji.name, "\"] > span > span"));
635
560
  if (!emojiSpanEl) {
636
561
  return getInputEmojiNativeHTML(emoji["native"]);
637
562
  }
638
-
639
563
  var style = replaceAll(emojiSpanEl.style.cssText, '"', "'");
640
564
  return getInputEmojiHTML(style, emoji["native"]);
641
- } // eslint-disable-next-line valid-jsdoc
565
+ }
642
566
 
567
+ // eslint-disable-next-line valid-jsdoc
643
568
  /**
644
569
  *
645
570
  * @param {string} style
646
571
  * @param {string} emoji
647
572
  * @returns
648
573
  */
649
-
650
574
  function getInputEmojiHTML(style, emoji) {
651
575
  return "<img style=\"".concat(style, "; display: inline-block\" data-emoji=\"").concat(emoji, "\" src=\"").concat(TRANSPARENT_GIF, "\" />");
652
576
  }
577
+
653
578
  /**
654
579
  *
655
580
  * @param {string} emoji
656
581
  * @returns
657
582
  */
658
-
659
-
660
583
  function getInputEmojiNativeHTML(emoji) {
661
584
  return "<span class=\"width: 18px; height: 18px; display: inline-block; margin: 0 1px;\">".concat(emoji, "</span>");
662
585
  }
586
+
663
587
  /**
664
588
  *
665
589
  * @param {string} html
666
590
  * @return {string}
667
591
  */
668
-
669
-
670
592
  function replaceAllTextEmojiToString(html) {
671
593
  var container = document.createElement("div");
672
594
  container.innerHTML = html;
@@ -678,37 +600,35 @@ function replaceAllTextEmojiToString(html) {
678
600
  }
679
601
 
680
602
  // @ts-check
603
+
681
604
  /**
682
605
  *
683
606
  * @param {string} html
684
607
  */
685
-
686
608
  function handlePasteHtmlAtCaret(html) {
687
609
  var sel;
688
610
  var range;
689
-
690
611
  if (window.getSelection) {
691
612
  // IE9 and non-IE
692
613
  sel = window.getSelection();
693
614
  if (sel === null) return;
694
-
695
615
  if (sel.getRangeAt && sel.rangeCount) {
696
616
  range = sel.getRangeAt(0);
697
- range.deleteContents(); // Range.createContextualFragment() would be useful here but is
698
- // non-standard and not supported in all browsers (IE9, for one)
617
+ range.deleteContents();
699
618
 
619
+ // Range.createContextualFragment() would be useful here but is
620
+ // non-standard and not supported in all browsers (IE9, for one)
700
621
  var el = document.createElement("div");
701
622
  el.innerHTML = html;
702
623
  var frag = document.createDocumentFragment();
703
624
  var node;
704
625
  var lastNode;
705
-
706
626
  while (node = el.firstChild) {
707
627
  lastNode = frag.appendChild(node);
708
628
  }
629
+ range.insertNode(frag);
709
630
 
710
- range.insertNode(frag); // Preserve the selection
711
-
631
+ // Preserve the selection
712
632
  if (lastNode) {
713
633
  range = range.cloneRange();
714
634
  range.setStartAfter(lastNode);
@@ -719,34 +639,32 @@ function handlePasteHtmlAtCaret(html) {
719
639
  }
720
640
  }
721
641
  }
642
+
722
643
  /**
723
644
  *
724
645
  * @param {{text: string, html: string}} props
725
646
  * @return {number}
726
647
  */
727
-
728
648
  function totalCharacters(_ref2) {
729
649
  var text = _ref2.text,
730
- html = _ref2.html;
650
+ html = _ref2.html;
731
651
  var textCount = text.length;
732
652
  var emojisCount = (html.match(/<img/g) || []).length;
733
653
  return textCount + emojisCount;
734
- } // eslint-disable-next-line valid-jsdoc
654
+ }
655
+
735
656
  /**
736
657
  * Set caret to the end of text value
737
658
  * @param {React.MutableRefObject<HTMLDivElement| null>} input
738
659
  */
739
-
740
660
  function moveCaretToEnd(input) {
741
661
  var range;
742
662
  var selection;
743
-
744
663
  if (document.createRange && input.current) {
745
664
  range = document.createRange();
746
665
  range.selectNodeContents(input.current);
747
666
  range.collapse(false);
748
667
  selection = window.getSelection();
749
-
750
668
  if (selection) {
751
669
  selection.removeAllRanges();
752
670
  selection.addRange(range);
@@ -758,39 +676,34 @@ function moveCaretToEnd(input) {
758
676
  * @param {HTMLDivElement} inputDiv
759
677
  * @return {string}
760
678
  */
761
-
762
679
  function removeHtmlExceptBr(inputDiv) {
763
680
  var temp = inputDiv.innerHTML.replace(/<br\s*\/?>/gi, '[BR]'); // temporarily replace <br> with placeholder
764
-
765
681
  var stripped = temp.replace(/<[^>]+>/g, ''); // strip all html tags
766
-
767
682
  var _final = stripped.replace(/\[BR\]/gi, '</br>'); // replace placeholders with <br>
768
-
769
-
770
683
  return _final;
771
684
  }
772
685
 
773
686
  // @ts-check
687
+
774
688
  /**
775
689
  * @typedef {import('../types/types').SanitizeFn} SanitizeFn
776
690
  */
777
- // eslint-disable-next-line valid-jsdoc
778
691
 
692
+ // eslint-disable-next-line valid-jsdoc
779
693
  /**
780
694
  * @param {boolean} shouldReturn
781
695
  */
782
-
783
696
  function useSanitize(shouldReturn) {
784
697
  /** @type {React.MutableRefObject<SanitizeFn[]>} */
785
698
  var sanitizeFnsRef = useRef([]);
786
699
  var sanitizedTextRef = useRef("");
787
- /** @type {(fn: SanitizeFn) => void} */
788
700
 
701
+ /** @type {(fn: SanitizeFn) => void} */
789
702
  var addSanitizeFn = useCallback(function (fn) {
790
703
  sanitizeFnsRef.current.push(fn);
791
704
  }, []);
792
- /** @type {(html: string) => string} */
793
705
 
706
+ /** @type {(html: string) => string} */
794
707
  var sanitize = useCallback(function (html) {
795
708
  var result = sanitizeFnsRef.current.reduce(function (acc, fn) {
796
709
  return fn(acc);
@@ -805,30 +718,30 @@ function useSanitize(shouldReturn) {
805
718
  sanitizedTextRef: sanitizedTextRef
806
719
  };
807
720
  }
721
+
808
722
  /**
809
723
  *
810
724
  * @param {string} html
811
725
  * @param {boolean} shouldReturn
812
726
  * @return {string}
813
727
  */
814
-
815
728
  function replaceAllHtmlToString(html, shouldReturn) {
816
729
  var container = document.createElement("div");
817
730
  container.innerHTML = html;
818
731
  var text;
819
-
820
732
  if (shouldReturn) {
821
733
  text = removeHtmlExceptBr(container);
822
734
  } else {
823
735
  text = container.innerText || "";
824
- } // remove all ↵ for safari
825
-
736
+ }
826
737
 
738
+ // remove all ↵ for safari
827
739
  text = text.replace(/\n/gi, "");
828
740
  return text;
829
741
  }
830
742
 
831
743
  // @ts-check
744
+
832
745
  /**
833
746
  * @typedef {Object} Props
834
747
  * @property {React.Ref<any>} ref
@@ -841,27 +754,22 @@ function replaceAllHtmlToString(html, shouldReturn) {
841
754
  *
842
755
  * @param {Props} props
843
756
  */
844
-
845
757
  function useExpose(_ref) {
846
758
  var ref = _ref.ref,
847
- textInputRef = _ref.textInputRef,
848
- setValue = _ref.setValue,
849
- emitChange = _ref.emitChange;
850
-
759
+ textInputRef = _ref.textInputRef,
760
+ setValue = _ref.setValue,
761
+ emitChange = _ref.emitChange;
851
762
  var _useSanitize = useSanitize(),
852
- sanitize = _useSanitize.sanitize,
853
- sanitizedTextRef = _useSanitize.sanitizedTextRef;
854
-
763
+ sanitize = _useSanitize.sanitize,
764
+ sanitizedTextRef = _useSanitize.sanitizedTextRef;
855
765
  useImperativeHandle(ref, function () {
856
766
  return {
857
767
  get value() {
858
768
  return sanitizedTextRef.current;
859
769
  },
860
-
861
770
  set value(value) {
862
771
  setValue(value);
863
772
  },
864
-
865
773
  focus: function focus() {
866
774
  if (textInputRef.current === null) return;
867
775
  textInputRef.current.focus();
@@ -870,7 +778,6 @@ function useExpose(_ref) {
870
778
  if (textInputRef.current !== null) {
871
779
  sanitize(textInputRef.current.html);
872
780
  }
873
-
874
781
  emitChange();
875
782
  }
876
783
  };
@@ -879,13 +786,13 @@ function useExpose(_ref) {
879
786
 
880
787
  // @ts-check
881
788
 
789
+ // eslint-disable-next-line valid-jsdoc
882
790
  /**
883
791
  * useEmit
884
792
  * @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef
885
793
  * @param {(size: {width: number, height: number}) => void} onResize
886
794
  * @param {(text: string) => void} onChange
887
795
  */
888
-
889
796
  function useEmit(textInputRef, onResize, onChange) {
890
797
  /** @type {React.MutableRefObject<{width: number; height: number} | null>} */
891
798
  var currentSizeRef = useRef(null);
@@ -894,11 +801,9 @@ function useEmit(textInputRef, onResize, onChange) {
894
801
  if (textInputRef.current !== null) {
895
802
  var currentSize = currentSizeRef.current;
896
803
  var nextSize = textInputRef.current.size;
897
-
898
804
  if ((!currentSize || currentSize.width !== nextSize.width || currentSize.height !== nextSize.height) && typeof onResize === "function") {
899
805
  onResize(nextSize);
900
806
  }
901
-
902
807
  currentSizeRef.current = nextSize;
903
808
  }
904
809
  }, [onResize, textInputRef]);
@@ -906,7 +811,6 @@ function useEmit(textInputRef, onResize, onChange) {
906
811
  if (typeof onChangeFn.current === "function") {
907
812
  onChangeFn.current(sanitizedText);
908
813
  }
909
-
910
814
  if (typeof onResize === "function") {
911
815
  checkAndEmitResize();
912
816
  }
@@ -920,6 +824,7 @@ function useEmit(textInputRef, onResize, onChange) {
920
824
  }
921
825
 
922
826
  var _excluded = ["placeholder", "style", "tabIndex", "className", "onChange"];
827
+
923
828
  /**
924
829
  * @typedef {Object} Props
925
830
  * @property {(event: React.KeyboardEvent) => void} onKeyDown
@@ -949,70 +854,59 @@ var _excluded = ["placeholder", "style", "tabIndex", "className", "onChange"];
949
854
  * focus: () => void;
950
855
  * }} Ref
951
856
  */
952
- // eslint-disable-next-line valid-jsdoc
953
857
 
858
+ // eslint-disable-next-line valid-jsdoc
954
859
  /** @type {React.ForwardRefRenderFunction<Ref, Props>} */
955
-
956
860
  var TextInput = function TextInput(_ref, ref) {
957
861
  var placeholder = _ref.placeholder,
958
- style = _ref.style,
959
- tabIndex = _ref.tabIndex,
960
- className = _ref.className,
961
- onChange = _ref.onChange,
962
- props = _objectWithoutProperties(_ref, _excluded);
963
-
862
+ style = _ref.style,
863
+ tabIndex = _ref.tabIndex,
864
+ className = _ref.className,
865
+ onChange = _ref.onChange,
866
+ props = _objectWithoutProperties(_ref, _excluded);
964
867
  useImperativeHandle(ref, function () {
965
868
  return {
966
869
  appendContent: function appendContent(html) {
967
870
  if (textInputRef.current) {
968
871
  textInputRef.current.focus();
969
872
  }
970
-
971
873
  handlePasteHtmlAtCaret(html);
972
-
973
874
  if (textInputRef.current) {
974
875
  textInputRef.current.focus();
975
876
  }
976
-
977
- if (textInputRef.current && placeholderRef.current && textInputRef.current.innerHTML.trim() === "") {
877
+ if (textInputRef.current && placeholderRef.current && replaceAllTextEmojiToString(textInputRef.current.innerHTML) === "") {
978
878
  placeholderRef.current.style.visibility = "visible";
979
879
  } else if (placeholderRef.current) {
980
880
  placeholderRef.current.style.visibility = "hidden";
981
881
  }
982
-
983
882
  if (textInputRef.current && typeof onChange === 'function') {
984
883
  onChange(textInputRef.current.innerHTML);
985
884
  }
986
885
  },
987
-
988
886
  set html(value) {
989
887
  if (textInputRef.current) {
990
888
  textInputRef.current.innerHTML = value;
991
889
  }
992
-
993
890
  if (placeholderRef.current) {
994
- if (value.trim() === "") {
891
+ var text = replaceAllTextEmojiToString(value);
892
+ if (text === "") {
995
893
  placeholderRef.current.style.visibility = "visible";
996
894
  } else {
997
895
  placeholderRef.current.style.visibility = "hidden";
998
896
  }
999
897
  }
1000
-
1001
898
  if (typeof onChange === 'function' && textInputRef.current) {
1002
899
  onChange(textInputRef.current.innerHTML);
1003
900
  }
1004
901
  },
1005
-
1006
902
  get html() {
1007
903
  if (!textInputRef.current) return '';
1008
904
  return textInputRef.current.innerHTML;
1009
905
  },
1010
-
1011
906
  get text() {
1012
907
  if (!textInputRef.current) return '';
1013
908
  return textInputRef.current.innerText;
1014
909
  },
1015
-
1016
910
  get size() {
1017
911
  if (!textInputRef.current) {
1018
912
  return {
@@ -1020,41 +914,36 @@ var TextInput = function TextInput(_ref, ref) {
1020
914
  height: 0
1021
915
  };
1022
916
  }
1023
-
1024
917
  return {
1025
918
  width: textInputRef.current.offsetWidth,
1026
919
  height: textInputRef.current.offsetHeight
1027
920
  };
1028
921
  },
1029
-
1030
922
  focus: function focus() {
1031
923
  if (!textInputRef.current) return;
1032
924
  textInputRef.current.focus();
1033
925
  }
1034
926
  };
1035
927
  });
1036
- /** @type {React.MutableRefObject<HTMLDivElement | null>} */
1037
928
 
929
+ /** @type {React.MutableRefObject<HTMLDivElement | null>} */
1038
930
  var placeholderRef = useRef(null);
1039
931
  /** @type {React.MutableRefObject<HTMLDivElement | null>} */
1040
-
1041
932
  var textInputRef = useRef(null);
933
+
1042
934
  /**
1043
935
  *
1044
936
  * @param {React.KeyboardEvent} event
1045
937
  */
1046
-
1047
938
  function handleKeyDown(event) {
1048
939
  if (event.key === "Enter" && (event.shiftKey === true || event.ctrlKey === true) && props.shouldReturn) {
1049
940
  event.preventDefault();
1050
-
1051
941
  if (textInputRef.current) {
1052
942
  textInputRef.current.innerHTML = "".concat(textInputRef.current.innerHTML, "</br></br>");
1053
943
  moveCaretToEnd(textInputRef);
1054
944
  return;
1055
945
  }
1056
946
  }
1057
-
1058
947
  if (event.key === "Enter") {
1059
948
  props.onEnter(event);
1060
949
  } else if (event.key === "ArrowUp") {
@@ -1066,40 +955,33 @@ var TextInput = function TextInput(_ref, ref) {
1066
955
  placeholderRef.current.style.visibility = "hidden";
1067
956
  }
1068
957
  }
1069
-
1070
958
  props.onKeyDown(event);
1071
959
  }
1072
- /** */
1073
-
1074
960
 
961
+ /** */
1075
962
  function handleClick() {
1076
963
  props.onFocus();
1077
964
  }
965
+
1078
966
  /**
1079
967
  *
1080
968
  * @param {React.KeyboardEvent} event
1081
969
  */
1082
-
1083
-
1084
970
  function handleKeyUp(event) {
1085
971
  props.onKeyUp(event);
1086
972
  var input = textInputRef.current;
1087
-
1088
- if (placeholderRef.current) {
1089
- var _input$innerText;
1090
-
1091
- if ((input === null || input === void 0 ? void 0 : (_input$innerText = input.innerText) === null || _input$innerText === void 0 ? void 0 : _input$innerText.trim()) === "") {
973
+ if (placeholderRef.current && input) {
974
+ var text = replaceAllTextEmojiToString(input.innerHTML);
975
+ if (text === "") {
1092
976
  placeholderRef.current.style.visibility = "visible";
1093
977
  } else {
1094
978
  placeholderRef.current.style.visibility = "hidden";
1095
979
  }
1096
980
  }
1097
-
1098
981
  if (typeof onChange === 'function' && textInputRef.current) {
1099
982
  onChange(textInputRef.current.innerHTML);
1100
983
  }
1101
984
  }
1102
-
1103
985
  return /*#__PURE__*/React.createElement("div", {
1104
986
  className: "react-input-emoji--container",
1105
987
  style: style
@@ -1122,7 +1004,6 @@ var TextInput = function TextInput(_ref, ref) {
1122
1004
  "data-testid": "react-input-emoji--input"
1123
1005
  })));
1124
1006
  };
1125
-
1126
1007
  var TextInputWithRef = /*#__PURE__*/forwardRef(TextInput);
1127
1008
 
1128
1009
  /**
@@ -1130,6 +1011,7 @@ var TextInputWithRef = /*#__PURE__*/forwardRef(TextInput);
1130
1011
  * @property {boolean} showPicker
1131
1012
  * @property {(event: React.MouseEvent) => void} toggleShowPicker
1132
1013
  * @property {HTMLDivElement=} buttonElement
1014
+ * @property {React.MutableRefObject=} buttonRef
1133
1015
  */
1134
1016
 
1135
1017
  /**
@@ -1137,28 +1019,28 @@ var TextInputWithRef = /*#__PURE__*/forwardRef(TextInput);
1137
1019
  * @param {Props} props
1138
1020
  * @return {JSX.Element}
1139
1021
  */
1140
-
1141
1022
  function EmojiPickerButton(_ref) {
1142
1023
  var showPicker = _ref.showPicker,
1143
- toggleShowPicker = _ref.toggleShowPicker,
1144
- buttonElement = _ref.buttonElement;
1145
- var buttonRef = useRef(null);
1146
-
1024
+ toggleShowPicker = _ref.toggleShowPicker,
1025
+ buttonElement = _ref.buttonElement,
1026
+ buttonRef = _ref.buttonRef;
1027
+ var localButtonRef = useRef(null);
1147
1028
  var _useState = useState(false),
1148
- _useState2 = _slicedToArray(_useState, 2),
1149
- showCustomButtonContent = _useState2[0],
1150
- setShowCustomButtonContent = _useState2[1];
1151
-
1029
+ _useState2 = _slicedToArray(_useState, 2),
1030
+ showCustomButtonContent = _useState2[0],
1031
+ setShowCustomButtonContent = _useState2[1];
1152
1032
  useEffect(function () {
1153
- var _buttonElement$childN, _buttonElement$childN2;
1154
-
1155
- if (((_buttonElement$childN = buttonElement === null || buttonElement === void 0 ? void 0 : (_buttonElement$childN2 = buttonElement.childNodes) === null || _buttonElement$childN2 === void 0 ? void 0 : _buttonElement$childN2.length) !== null && _buttonElement$childN !== void 0 ? _buttonElement$childN : 0) > 2) {
1156
- buttonRef.current.appendChild(buttonElement === null || buttonElement === void 0 ? void 0 : buttonElement.childNodes[0]);
1033
+ var _buttonRef$current$ch, _buttonRef$current, _buttonElement$childN, _buttonElement$childN2;
1034
+ if (((_buttonRef$current$ch = buttonRef === null || buttonRef === void 0 || (_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || (_buttonRef$current = _buttonRef$current.childNodes) === null || _buttonRef$current === void 0 ? void 0 : _buttonRef$current.length) !== null && _buttonRef$current$ch !== void 0 ? _buttonRef$current$ch : 0) > 2) {
1035
+ localButtonRef.current.appendChild(buttonRef.current.childNodes[0]);
1036
+ setShowCustomButtonContent(true);
1037
+ } else if (((_buttonElement$childN = buttonElement === null || buttonElement === void 0 || (_buttonElement$childN2 = buttonElement.childNodes) === null || _buttonElement$childN2 === void 0 ? void 0 : _buttonElement$childN2.length) !== null && _buttonElement$childN !== void 0 ? _buttonElement$childN : 0) > 2) {
1038
+ localButtonRef.current.appendChild(buttonElement === null || buttonElement === void 0 ? void 0 : buttonElement.childNodes[0]);
1157
1039
  setShowCustomButtonContent(true);
1158
1040
  }
1159
1041
  }, [buttonElement === null || buttonElement === void 0 ? void 0 : buttonElement.childNodes]);
1160
1042
  return /*#__PURE__*/React.createElement("button", {
1161
- ref: buttonRef,
1043
+ ref: localButtonRef,
1162
1044
  type: "button",
1163
1045
  className: "react-input-emoji--button".concat(showPicker ? " react-input-emoji--button__show" : ""),
1164
1046
  onClick: toggleShowPicker
@@ -1178,7 +1060,6 @@ function EmojiPickerButton(_ref) {
1178
1060
  function $parcel$interopDefault(a) {
1179
1061
  return a && a.__esModule ? a.default : a;
1180
1062
  }
1181
-
1182
1063
  function $c770c458706daa72$export$2e2bcd8739ae039(obj, key, value) {
1183
1064
  if (key in obj) Object.defineProperty(obj, key, {
1184
1065
  value: value,
@@ -1188,40 +1069,32 @@ function $c770c458706daa72$export$2e2bcd8739ae039(obj, key, value) {
1188
1069
  });else obj[key] = value;
1189
1070
  return obj;
1190
1071
  }
1191
-
1192
1072
  var $fb96b826c0c5f37a$var$n,
1193
- $fb96b826c0c5f37a$export$41c562ebe57d11e2,
1194
- $fb96b826c0c5f37a$var$u,
1195
- $fb96b826c0c5f37a$var$t,
1196
- $fb96b826c0c5f37a$var$r,
1197
- $fb96b826c0c5f37a$var$o,
1198
- $fb96b826c0c5f37a$var$e = {},
1199
- $fb96b826c0c5f37a$var$c = [],
1200
- $fb96b826c0c5f37a$var$s = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
1201
-
1073
+ $fb96b826c0c5f37a$export$41c562ebe57d11e2,
1074
+ $fb96b826c0c5f37a$var$u,
1075
+ $fb96b826c0c5f37a$var$t,
1076
+ $fb96b826c0c5f37a$var$r,
1077
+ $fb96b826c0c5f37a$var$o,
1078
+ $fb96b826c0c5f37a$var$e = {},
1079
+ $fb96b826c0c5f37a$var$c = [],
1080
+ $fb96b826c0c5f37a$var$s = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
1202
1081
  function $fb96b826c0c5f37a$var$a(n1, l1) {
1203
1082
  for (var u1 in l1) n1[u1] = l1[u1];
1204
-
1205
1083
  return n1;
1206
1084
  }
1207
-
1208
1085
  function $fb96b826c0c5f37a$var$h(n2) {
1209
1086
  var l2 = n2.parentNode;
1210
1087
  l2 && l2.removeChild(n2);
1211
1088
  }
1212
-
1213
1089
  function $fb96b826c0c5f37a$export$c8a8987d4410bf2d(l3, u2, i1) {
1214
1090
  var t1,
1215
- r1,
1216
- o1,
1217
- f1 = {};
1218
-
1091
+ r1,
1092
+ o1,
1093
+ f1 = {};
1219
1094
  for (o1 in u2) "key" == o1 ? t1 = u2[o1] : "ref" == o1 ? r1 = u2[o1] : f1[o1] = u2[o1];
1220
-
1221
1095
  if (arguments.length > 2 && (f1.children = arguments.length > 3 ? $fb96b826c0c5f37a$var$n.call(arguments, 2) : i1), "function" == typeof l3 && null != l3.defaultProps) for (o1 in l3.defaultProps) void 0 === f1[o1] && (f1[o1] = l3.defaultProps[o1]);
1222
1096
  return $fb96b826c0c5f37a$var$y(l3, f1, t1, r1, null);
1223
1097
  }
1224
-
1225
1098
  function $fb96b826c0c5f37a$var$y(n3, i2, t2, r2, o2) {
1226
1099
  var f2 = {
1227
1100
  type: n3,
@@ -1240,46 +1113,35 @@ function $fb96b826c0c5f37a$var$y(n3, i2, t2, r2, o2) {
1240
1113
  };
1241
1114
  return null == o2 && null != $fb96b826c0c5f37a$export$41c562ebe57d11e2.vnode && $fb96b826c0c5f37a$export$41c562ebe57d11e2.vnode(f2), f2;
1242
1115
  }
1243
-
1244
1116
  function $fb96b826c0c5f37a$export$7d1e3a5e95ceca43() {
1245
1117
  return {
1246
1118
  current: null
1247
1119
  };
1248
1120
  }
1249
-
1250
1121
  function $fb96b826c0c5f37a$export$ffb0004e005737fa(n4) {
1251
1122
  return n4.children;
1252
1123
  }
1253
-
1254
1124
  function $fb96b826c0c5f37a$export$16fa2f45be04daa8(n5, l4) {
1255
1125
  this.props = n5, this.context = l4;
1256
1126
  }
1257
-
1258
1127
  function $fb96b826c0c5f37a$var$k(n6, l5) {
1259
1128
  if (null == l5) return n6.__ ? $fb96b826c0c5f37a$var$k(n6.__, n6.__.__k.indexOf(n6) + 1) : null;
1260
-
1261
1129
  for (var u3; l5 < n6.__k.length; l5++) if (null != (u3 = n6.__k[l5]) && null != u3.__e) return u3.__e;
1262
-
1263
1130
  return "function" == typeof n6.type ? $fb96b826c0c5f37a$var$k(n6) : null;
1264
1131
  }
1265
-
1266
1132
  function $fb96b826c0c5f37a$var$b(n7) {
1267
1133
  var l6, u4;
1268
-
1269
1134
  if (null != (n7 = n7.__) && null != n7.__c) {
1270
1135
  for (n7.__e = n7.__c.base = null, l6 = 0; l6 < n7.__k.length; l6++) if (null != (u4 = n7.__k[l6]) && null != u4.__e) {
1271
1136
  n7.__e = n7.__c.base = u4.__e;
1272
1137
  break;
1273
1138
  }
1274
-
1275
1139
  return $fb96b826c0c5f37a$var$b(n7);
1276
1140
  }
1277
1141
  }
1278
-
1279
1142
  function $fb96b826c0c5f37a$var$m(n8) {
1280
1143
  (!n8.__d && (n8.__d = !0) && $fb96b826c0c5f37a$var$t.push(n8) && !$fb96b826c0c5f37a$var$g.__r++ || $fb96b826c0c5f37a$var$o !== $fb96b826c0c5f37a$export$41c562ebe57d11e2.debounceRendering) && (($fb96b826c0c5f37a$var$o = $fb96b826c0c5f37a$export$41c562ebe57d11e2.debounceRendering) || $fb96b826c0c5f37a$var$r)($fb96b826c0c5f37a$var$g);
1281
1144
  }
1282
-
1283
1145
  function $fb96b826c0c5f37a$var$g() {
1284
1146
  for (var n9; $fb96b826c0c5f37a$var$g.__r = $fb96b826c0c5f37a$var$t.length;) n9 = $fb96b826c0c5f37a$var$t.sort(function (n10, l7) {
1285
1147
  return n10.__v.__b - l7.__v.__b;
@@ -1288,18 +1150,16 @@ function $fb96b826c0c5f37a$var$g() {
1288
1150
  n11.__d && (r3 = (t3 = (l8 = n11).__v).__e, (o3 = l8.__P) && (u5 = [], (i3 = $fb96b826c0c5f37a$var$a({}, t3)).__v = t3.__v + 1, $fb96b826c0c5f37a$var$j(o3, t3, i3, l8.__n, void 0 !== o3.ownerSVGElement, null != t3.__h ? [r3] : null, u5, null == r3 ? $fb96b826c0c5f37a$var$k(t3) : r3, t3.__h), $fb96b826c0c5f37a$var$z(u5, t3), t3.__e != r3 && $fb96b826c0c5f37a$var$b(t3)));
1289
1151
  });
1290
1152
  }
1291
-
1292
1153
  function $fb96b826c0c5f37a$var$w(n12, l9, u6, i4, t4, r4, o4, f3, s1, a1) {
1293
1154
  var h1,
1294
- v1,
1295
- p1,
1296
- _1,
1297
- b1,
1298
- m1,
1299
- g1,
1300
- w1 = i4 && i4.__k || $fb96b826c0c5f37a$var$c,
1301
- A1 = w1.length;
1302
-
1155
+ v1,
1156
+ p1,
1157
+ _1,
1158
+ b1,
1159
+ m1,
1160
+ g1,
1161
+ w1 = i4 && i4.__k || $fb96b826c0c5f37a$var$c,
1162
+ A1 = w1.length;
1303
1163
  for (u6.__k = [], h1 = 0; h1 < l9.length; h1++) if (null != (_1 = u6.__k[h1] = null == (_1 = l9[h1]) || "boolean" == typeof _1 ? null : "string" == typeof _1 || "number" == typeof _1 || "bigint" == typeof _1 ? $fb96b826c0c5f37a$var$y(null, _1, null, null, _1) : Array.isArray(_1) ? $fb96b826c0c5f37a$var$y($fb96b826c0c5f37a$export$ffb0004e005737fa, {
1304
1164
  children: _1
1305
1165
  }, null, null, null) : _1.__b > 0 ? $fb96b826c0c5f37a$var$y(_1.type, _1.props, _1.key, null, _1.__v) : _1)) {
@@ -1308,54 +1168,40 @@ function $fb96b826c0c5f37a$var$w(n12, l9, u6, i4, t4, r4, o4, f3, s1, a1) {
1308
1168
  w1[v1] = void 0;
1309
1169
  break;
1310
1170
  }
1311
-
1312
1171
  p1 = null;
1313
1172
  }
1314
1173
  $fb96b826c0c5f37a$var$j(n12, _1, p1 = p1 || $fb96b826c0c5f37a$var$e, t4, r4, o4, f3, s1, a1), b1 = _1.__e, (v1 = _1.ref) && p1.ref != v1 && (g1 || (g1 = []), p1.ref && g1.push(p1.ref, null, _1), g1.push(v1, _1.__c || b1, _1)), null != b1 ? (null == m1 && (m1 = b1), "function" == typeof _1.type && _1.__k === p1.__k ? _1.__d = s1 = $fb96b826c0c5f37a$var$x(_1, s1, n12) : s1 = $fb96b826c0c5f37a$var$P(n12, _1, p1, w1, b1, s1), "function" == typeof u6.type && (u6.__d = s1)) : s1 && p1.__e == s1 && s1.parentNode != n12 && (s1 = $fb96b826c0c5f37a$var$k(p1));
1315
1174
  }
1316
-
1317
1175
  for (u6.__e = m1, h1 = A1; h1--;) null != w1[h1] && ("function" == typeof u6.type && null != w1[h1].__e && w1[h1].__e == u6.__d && (u6.__d = $fb96b826c0c5f37a$var$k(i4, h1 + 1)), $fb96b826c0c5f37a$var$N(w1[h1], w1[h1]));
1318
-
1319
1176
  if (g1) for (h1 = 0; h1 < g1.length; h1++) $fb96b826c0c5f37a$var$M(g1[h1], g1[++h1], g1[++h1]);
1320
1177
  }
1321
-
1322
1178
  function $fb96b826c0c5f37a$var$x(n13, l10, u7) {
1323
1179
  for (var i5, t5 = n13.__k, r5 = 0; t5 && r5 < t5.length; r5++) (i5 = t5[r5]) && (i5.__ = n13, l10 = "function" == typeof i5.type ? $fb96b826c0c5f37a$var$x(i5, l10, u7) : $fb96b826c0c5f37a$var$P(u7, i5, i5, t5, i5.__e, l10));
1324
-
1325
1180
  return l10;
1326
1181
  }
1327
-
1328
1182
  function $fb96b826c0c5f37a$export$47e4c5b300681277(n14, l11) {
1329
1183
  return l11 = l11 || [], null == n14 || "boolean" == typeof n14 || (Array.isArray(n14) ? n14.some(function (n15) {
1330
1184
  $fb96b826c0c5f37a$export$47e4c5b300681277(n15, l11);
1331
1185
  }) : l11.push(n14)), l11;
1332
1186
  }
1333
-
1334
1187
  function $fb96b826c0c5f37a$var$P(n16, l12, u8, i6, t6, r6) {
1335
1188
  var o5, f4, e1;
1336
1189
  if (void 0 !== l12.__d) o5 = l12.__d, l12.__d = void 0;else if (null == u8 || t6 != r6 || null == t6.parentNode) n: if (null == r6 || r6.parentNode !== n16) n16.appendChild(t6), o5 = null;else {
1337
1190
  for (f4 = r6, e1 = 0; (f4 = f4.nextSibling) && e1 < i6.length; e1 += 2) if (f4 == t6) break n;
1338
-
1339
1191
  n16.insertBefore(t6, r6), o5 = r6;
1340
1192
  }
1341
1193
  return void 0 !== o5 ? o5 : t6.nextSibling;
1342
1194
  }
1343
-
1344
1195
  function $fb96b826c0c5f37a$var$C(n17, l13, u9, i7, t7) {
1345
1196
  var r7;
1346
-
1347
1197
  for (r7 in u9) "children" === r7 || "key" === r7 || r7 in l13 || $fb96b826c0c5f37a$var$H(n17, r7, null, u9[r7], i7);
1348
-
1349
1198
  for (r7 in l13) t7 && "function" != typeof l13[r7] || "children" === r7 || "key" === r7 || "value" === r7 || "checked" === r7 || u9[r7] === l13[r7] || $fb96b826c0c5f37a$var$H(n17, r7, l13[r7], u9[r7], i7);
1350
1199
  }
1351
-
1352
1200
  function $fb96b826c0c5f37a$var$$(n18, l14, u10) {
1353
1201
  "-" === l14[0] ? n18.setProperty(l14, u10) : n18[l14] = null == u10 ? "" : "number" != typeof u10 || $fb96b826c0c5f37a$var$s.test(l14) ? u10 : u10 + "px";
1354
1202
  }
1355
-
1356
1203
  function $fb96b826c0c5f37a$var$H(n19, l15, u11, i8, t8) {
1357
1204
  var r8;
1358
-
1359
1205
  n: if ("style" === l15) {
1360
1206
  if ("string" == typeof u11) n19.style.cssText = u11;else {
1361
1207
  if ("string" == typeof i8 && (n19.style.cssText = i8 = ""), i8) for (l15 in i8) u11 && l15 in u11 || $fb96b826c0c5f37a$var$$(n19.style, l15, "");
@@ -1369,31 +1215,27 @@ function $fb96b826c0c5f37a$var$H(n19, l15, u11, i8, t8) {
1369
1215
  "function" == typeof u11 || (null != u11 && (!1 !== u11 || "a" === l15[0] && "r" === l15[1]) ? n19.setAttribute(l15, u11) : n19.removeAttribute(l15));
1370
1216
  }
1371
1217
  }
1372
-
1373
1218
  function $fb96b826c0c5f37a$var$I(n20) {
1374
1219
  this.l[n20.type + !1]($fb96b826c0c5f37a$export$41c562ebe57d11e2.event ? $fb96b826c0c5f37a$export$41c562ebe57d11e2.event(n20) : n20);
1375
1220
  }
1376
-
1377
1221
  function $fb96b826c0c5f37a$var$T(n21) {
1378
1222
  this.l[n21.type + !0]($fb96b826c0c5f37a$export$41c562ebe57d11e2.event ? $fb96b826c0c5f37a$export$41c562ebe57d11e2.event(n21) : n21);
1379
1223
  }
1380
-
1381
1224
  function $fb96b826c0c5f37a$var$j(n22, u12, i9, t9, r9, o6, f5, e2, c1) {
1382
1225
  var s2,
1383
- h2,
1384
- v2,
1385
- y1,
1386
- p2,
1387
- k1,
1388
- b2,
1389
- m2,
1390
- g2,
1391
- x1,
1392
- A2,
1393
- P1 = u12.type;
1226
+ h2,
1227
+ v2,
1228
+ y1,
1229
+ p2,
1230
+ k1,
1231
+ b2,
1232
+ m2,
1233
+ g2,
1234
+ x1,
1235
+ A2,
1236
+ P1 = u12.type;
1394
1237
  if (void 0 !== u12.constructor) return null;
1395
1238
  null != i9.__h && (c1 = i9.__h, e2 = u12.__e = i9.__e, u12.__h = null, o6 = [e2]), (s2 = $fb96b826c0c5f37a$export$41c562ebe57d11e2.__b) && s2(u12);
1396
-
1397
1239
  try {
1398
1240
  n: if ("function" == typeof P1) {
1399
1241
  if (m2 = u12.props, g2 = (s2 = P1.contextType) && t9[s2.__c], x1 = s2 ? g2 ? g2.props.value : s2.__ : t9, i9.__c ? b2 = (h2 = u12.__c = i9.__c).__ = h2.__E : ("prototype" in P1 && P1.prototype.render ? u12.__c = h2 = new P1(m2, x1) : (u12.__c = h2 = new $fb96b826c0c5f37a$export$16fa2f45be04daa8(m2, x1), h2.constructor = P1, h2.render = $fb96b826c0c5f37a$var$O), g2 && g2.sub(h2), h2.props = m2, h2.state || (h2.state = {}), h2.context = x1, h2.__n = t9, v2 = h2.__d = !0, h2.__h = []), null == h2.__s && (h2.__s = h2.state), null != P1.getDerivedStateFromProps && (h2.__s == h2.state && (h2.__s = $fb96b826c0c5f37a$var$a({}, h2.__s)), $fb96b826c0c5f37a$var$a(h2.__s, P1.getDerivedStateFromProps(m2, h2.__s))), y1 = h2.props, p2 = h2.state, v2) null == P1.getDerivedStateFromProps && null != h2.componentWillMount && h2.componentWillMount(), null != h2.componentDidMount && h2.__h.push(h2.componentDidMount);else {
@@ -1403,20 +1245,17 @@ function $fb96b826c0c5f37a$var$j(n22, u12, i9, t9, r9, o6, f5, e2, c1) {
1403
1245
  }), h2.__h.length && f5.push(h2);
1404
1246
  break n;
1405
1247
  }
1406
-
1407
1248
  null != h2.componentWillUpdate && h2.componentWillUpdate(m2, h2.__s, x1), null != h2.componentDidUpdate && h2.__h.push(function () {
1408
1249
  h2.componentDidUpdate(y1, p2, k1);
1409
1250
  });
1410
1251
  }
1411
1252
  h2.context = x1, h2.props = m2, h2.state = h2.__s, (s2 = $fb96b826c0c5f37a$export$41c562ebe57d11e2.__r) && s2(u12), h2.__d = !1, h2.__v = u12, h2.__P = n22, s2 = h2.render(h2.props, h2.state, h2.context), h2.state = h2.__s, null != h2.getChildContext && (t9 = $fb96b826c0c5f37a$var$a($fb96b826c0c5f37a$var$a({}, t9), h2.getChildContext())), v2 || null == h2.getSnapshotBeforeUpdate || (k1 = h2.getSnapshotBeforeUpdate(y1, p2)), A2 = null != s2 && s2.type === $fb96b826c0c5f37a$export$ffb0004e005737fa && null == s2.key ? s2.props.children : s2, $fb96b826c0c5f37a$var$w(n22, Array.isArray(A2) ? A2 : [A2], u12, i9, t9, r9, o6, f5, e2, c1), h2.base = u12.__e, u12.__h = null, h2.__h.length && f5.push(h2), b2 && (h2.__E = h2.__ = null), h2.__e = !1;
1412
1253
  } else null == o6 && u12.__v === i9.__v ? (u12.__k = i9.__k, u12.__e = i9.__e) : u12.__e = $fb96b826c0c5f37a$var$L(i9.__e, u12, i9, t9, r9, o6, f5, c1);
1413
-
1414
1254
  (s2 = $fb96b826c0c5f37a$export$41c562ebe57d11e2.diffed) && s2(u12);
1415
1255
  } catch (n24) {
1416
1256
  u12.__v = null, (c1 || null != o6) && (u12.__e = e2, u12.__h = !!c1, o6[o6.indexOf(e2)] = null), $fb96b826c0c5f37a$export$41c562ebe57d11e2.__e(n24, u12, i9);
1417
1257
  }
1418
1258
  }
1419
-
1420
1259
  function $fb96b826c0c5f37a$var$z(n25, u13) {
1421
1260
  $fb96b826c0c5f37a$export$41c562ebe57d11e2.__c && $fb96b826c0c5f37a$export$41c562ebe57d11e2.__c(u13, n25), n25.some(function (u14) {
1422
1261
  try {
@@ -1428,40 +1267,34 @@ function $fb96b826c0c5f37a$var$z(n25, u13) {
1428
1267
  }
1429
1268
  });
1430
1269
  }
1431
-
1432
1270
  function $fb96b826c0c5f37a$var$L(l16, u15, i10, t10, r10, o7, f6, c2) {
1433
1271
  var s3,
1434
- a2,
1435
- v3,
1436
- y2 = i10.props,
1437
- p3 = u15.props,
1438
- d1 = u15.type,
1439
- _2 = 0;
1440
-
1272
+ a2,
1273
+ v3,
1274
+ y2 = i10.props,
1275
+ p3 = u15.props,
1276
+ d1 = u15.type,
1277
+ _2 = 0;
1441
1278
  if ("svg" === d1 && (r10 = !0), null != o7) {
1442
1279
  for (; _2 < o7.length; _2++) if ((s3 = o7[_2]) && "setAttribute" in s3 == !!d1 && (d1 ? s3.localName === d1 : 3 === s3.nodeType)) {
1443
1280
  l16 = s3, o7[_2] = null;
1444
1281
  break;
1445
1282
  }
1446
1283
  }
1447
-
1448
1284
  if (null == l16) {
1449
1285
  if (null === d1) return document.createTextNode(p3);
1450
1286
  l16 = r10 ? document.createElementNS("http://www.w3.org/2000/svg", d1) : document.createElement(d1, p3.is && p3), o7 = null, c2 = !1;
1451
1287
  }
1452
-
1453
1288
  if (null === d1) y2 === p3 || c2 && l16.data === p3 || (l16.data = p3);else {
1454
1289
  if (o7 = o7 && $fb96b826c0c5f37a$var$n.call(l16.childNodes), a2 = (y2 = i10.props || $fb96b826c0c5f37a$var$e).dangerouslySetInnerHTML, v3 = p3.dangerouslySetInnerHTML, !c2) {
1455
1290
  if (null != o7) for (y2 = {}, _2 = 0; _2 < l16.attributes.length; _2++) y2[l16.attributes[_2].name] = l16.attributes[_2].value;
1456
1291
  (v3 || a2) && (v3 && (a2 && v3.__html == a2.__html || v3.__html === l16.innerHTML) || (l16.innerHTML = v3 && v3.__html || ""));
1457
1292
  }
1458
-
1459
1293
  if ($fb96b826c0c5f37a$var$C(l16, p3, y2, r10, c2), v3) u15.__k = [];else if (_2 = u15.props.children, $fb96b826c0c5f37a$var$w(l16, Array.isArray(_2) ? _2 : [_2], u15, i10, t10, r10 && "foreignObject" !== d1, o7, f6, o7 ? o7[0] : i10.__k && $fb96b826c0c5f37a$var$k(i10, 0), c2), null != o7) for (_2 = o7.length; _2--;) null != o7[_2] && $fb96b826c0c5f37a$var$h(o7[_2]);
1460
1294
  c2 || ("value" in p3 && void 0 !== (_2 = p3.value) && (_2 !== y2.value || _2 !== l16.value || "progress" === d1 && !_2) && $fb96b826c0c5f37a$var$H(l16, "value", _2, y2.value, !1), "checked" in p3 && void 0 !== (_2 = p3.checked) && _2 !== l16.checked && $fb96b826c0c5f37a$var$H(l16, "checked", _2, y2.checked, !1));
1461
1295
  }
1462
1296
  return l16;
1463
1297
  }
1464
-
1465
1298
  function $fb96b826c0c5f37a$var$M(n28, u16, i11) {
1466
1299
  try {
1467
1300
  "function" == typeof n28 ? n28(u16) : n28.current = u16;
@@ -1469,10 +1302,8 @@ function $fb96b826c0c5f37a$var$M(n28, u16, i11) {
1469
1302
  $fb96b826c0c5f37a$export$41c562ebe57d11e2.__e(n29, i11);
1470
1303
  }
1471
1304
  }
1472
-
1473
1305
  function $fb96b826c0c5f37a$var$N(n30, u17, i12) {
1474
1306
  var t11, r11;
1475
-
1476
1307
  if ($fb96b826c0c5f37a$export$41c562ebe57d11e2.unmount && $fb96b826c0c5f37a$export$41c562ebe57d11e2.unmount(n30), (t11 = n30.ref) && (t11.current && t11.current !== n30.__e || $fb96b826c0c5f37a$var$M(t11, null, u17)), null != (t11 = n30.__c)) {
1477
1308
  if (t11.componentWillUnmount) try {
1478
1309
  t11.componentWillUnmount();
@@ -1481,20 +1312,16 @@ function $fb96b826c0c5f37a$var$N(n30, u17, i12) {
1481
1312
  }
1482
1313
  t11.base = t11.__P = null;
1483
1314
  }
1484
-
1485
1315
  if (t11 = n30.__k) for (r11 = 0; r11 < t11.length; r11++) t11[r11] && $fb96b826c0c5f37a$var$N(t11[r11], u17, "function" != typeof n30.type);
1486
1316
  i12 || null == n30.__e || $fb96b826c0c5f37a$var$h(n30.__e), n30.__e = n30.__d = void 0;
1487
1317
  }
1488
-
1489
1318
  function $fb96b826c0c5f37a$var$O(n32, l, u18) {
1490
1319
  return this.constructor(n32, u18);
1491
1320
  }
1492
-
1493
1321
  function $fb96b826c0c5f37a$export$b3890eb0ae9dca99(u19, i13, t12) {
1494
1322
  var r12, o8, f7;
1495
1323
  $fb96b826c0c5f37a$export$41c562ebe57d11e2.__ && $fb96b826c0c5f37a$export$41c562ebe57d11e2.__(u19, i13), o8 = (r12 = "function" == typeof t12) ? null : t12 && t12.__k || i13.__k, f7 = [], $fb96b826c0c5f37a$var$j(i13, u19 = (!r12 && t12 || i13).__k = $fb96b826c0c5f37a$export$c8a8987d4410bf2d($fb96b826c0c5f37a$export$ffb0004e005737fa, null, [u19]), o8 || $fb96b826c0c5f37a$var$e, $fb96b826c0c5f37a$var$e, void 0 !== i13.ownerSVGElement, !r12 && t12 ? [t12] : o8 ? null : i13.firstChild ? $fb96b826c0c5f37a$var$n.call(i13.childNodes) : null, f7, !r12 && t12 ? t12 : o8 ? o8.__e : i13.firstChild, r12), $fb96b826c0c5f37a$var$z(f7, u19);
1496
1324
  }
1497
-
1498
1325
  $fb96b826c0c5f37a$var$n = $fb96b826c0c5f37a$var$c.slice, $fb96b826c0c5f37a$export$41c562ebe57d11e2 = {
1499
1326
  __e: function (n39, l22) {
1500
1327
  for (var u23, i16, t14; l22 = l22.__;) if ((u23 = l22.__c) && !u23.__) try {
@@ -1502,7 +1329,6 @@ $fb96b826c0c5f37a$var$n = $fb96b826c0c5f37a$var$c.slice, $fb96b826c0c5f37a$expor
1502
1329
  } catch (l23) {
1503
1330
  n39 = l23;
1504
1331
  }
1505
-
1506
1332
  throw n39;
1507
1333
  }
1508
1334
  }, $fb96b826c0c5f37a$var$u = 0, $fb96b826c0c5f37a$export$16fa2f45be04daa8.prototype.setState = function (n41, l24) {
@@ -1512,14 +1338,11 @@ $fb96b826c0c5f37a$var$n = $fb96b826c0c5f37a$var$c.slice, $fb96b826c0c5f37a$expor
1512
1338
  this.__v && (this.__e = !0, n42 && this.__h.push(n42), $fb96b826c0c5f37a$var$m(this));
1513
1339
  }, $fb96b826c0c5f37a$export$16fa2f45be04daa8.prototype.render = $fb96b826c0c5f37a$export$ffb0004e005737fa, $fb96b826c0c5f37a$var$t = [], $fb96b826c0c5f37a$var$r = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, $fb96b826c0c5f37a$var$g.__r = 0;
1514
1340
  var $bd9dd35321b03dd4$var$o = 0;
1515
-
1516
1341
  function $bd9dd35321b03dd4$export$34b9dba7ce09269b(_1, e1, n, t, f) {
1517
1342
  var l,
1518
- s,
1519
- u = {};
1520
-
1343
+ s,
1344
+ u = {};
1521
1345
  for (s in e1) "ref" == s ? l = e1[s] : u[s] = e1[s];
1522
-
1523
1346
  var a = {
1524
1347
  type: _1,
1525
1348
  props: u,
@@ -1540,20 +1363,17 @@ function $bd9dd35321b03dd4$export$34b9dba7ce09269b(_1, e1, n, t, f) {
1540
1363
  if ("function" == typeof _1 && (l = _1.defaultProps)) for (s in l) void 0 === u[s] && (u[s] = l[s]);
1541
1364
  return ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode && ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode(a), a;
1542
1365
  }
1543
-
1544
1366
  function $f72b75cf796873c7$var$set(key, value) {
1545
1367
  try {
1546
1368
  window.localStorage[`emoji-mart.${key}`] = JSON.stringify(value);
1547
1369
  } catch (error) {}
1548
1370
  }
1549
-
1550
1371
  function $f72b75cf796873c7$var$get(key) {
1551
1372
  try {
1552
1373
  const value = window.localStorage[`emoji-mart.${key}`];
1553
1374
  if (value) return JSON.parse(value);
1554
1375
  } catch (error) {}
1555
1376
  }
1556
-
1557
1377
  var $f72b75cf796873c7$export$2e2bcd8739ae039 = {
1558
1378
  set: $f72b75cf796873c7$var$set,
1559
1379
  get: $f72b75cf796873c7$var$get
@@ -1593,7 +1413,6 @@ const $c84d045dcc34faf5$var$VERSIONS = [{
1593
1413
  v: 1,
1594
1414
  emoji: "\uD83D\uDE43"
1595
1415
  }];
1596
-
1597
1416
  function $c84d045dcc34faf5$var$latestVersion() {
1598
1417
  for (const {
1599
1418
  v: v,
@@ -1602,76 +1421,68 @@ function $c84d045dcc34faf5$var$latestVersion() {
1602
1421
  if ($c84d045dcc34faf5$var$isSupported(emoji)) return v;
1603
1422
  }
1604
1423
  }
1605
-
1606
1424
  function $c84d045dcc34faf5$var$noCountryFlags() {
1607
1425
  if ($c84d045dcc34faf5$var$isSupported("\uD83C\uDDE8\uD83C\uDDE6")) return false;
1608
1426
  return true;
1609
1427
  }
1610
-
1611
1428
  function $c84d045dcc34faf5$var$isSupported(emoji) {
1612
1429
  if ($c84d045dcc34faf5$var$CACHE.has(emoji)) return $c84d045dcc34faf5$var$CACHE.get(emoji);
1613
1430
  const supported = $c84d045dcc34faf5$var$isEmojiSupported(emoji);
1614
1431
  $c84d045dcc34faf5$var$CACHE.set(emoji, supported);
1615
1432
  return supported;
1616
- } // https://github.com/koala-interactive/is-emoji-supported
1617
-
1618
-
1433
+ }
1434
+ // https://github.com/koala-interactive/is-emoji-supported
1619
1435
  const $c84d045dcc34faf5$var$isEmojiSupported = (() => {
1620
1436
  let ctx = null;
1621
-
1622
1437
  try {
1623
1438
  if (!navigator.userAgent.includes("jsdom")) ctx = document.createElement("canvas").getContext("2d", {
1624
1439
  willReadFrequently: true
1625
1440
  });
1626
- } catch {} // Not in browser env
1627
-
1628
-
1441
+ } catch {}
1442
+ // Not in browser env
1629
1443
  if (!ctx) return () => false;
1630
1444
  const CANVAS_HEIGHT = 25;
1631
1445
  const CANVAS_WIDTH = 20;
1632
- const textSize = Math.floor(CANVAS_HEIGHT / 2); // Initialize convas context
1633
-
1446
+ const textSize = Math.floor(CANVAS_HEIGHT / 2);
1447
+ // Initialize convas context
1634
1448
  ctx.font = textSize + "px Arial, Sans-Serif";
1635
1449
  ctx.textBaseline = "top";
1636
1450
  ctx.canvas.width = CANVAS_WIDTH * 2;
1637
1451
  ctx.canvas.height = CANVAS_HEIGHT;
1638
1452
  return unicode => {
1639
- ctx.clearRect(0, 0, CANVAS_WIDTH * 2, CANVAS_HEIGHT); // Draw in red on the left
1640
-
1453
+ ctx.clearRect(0, 0, CANVAS_WIDTH * 2, CANVAS_HEIGHT);
1454
+ // Draw in red on the left
1641
1455
  ctx.fillStyle = "#FF0000";
1642
- ctx.fillText(unicode, 0, 22); // Draw in blue on right
1643
-
1456
+ ctx.fillText(unicode, 0, 22);
1457
+ // Draw in blue on right
1644
1458
  ctx.fillStyle = "#0000FF";
1645
1459
  ctx.fillText(unicode, CANVAS_WIDTH, 22);
1646
1460
  const a = ctx.getImageData(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT).data;
1647
1461
  const count = a.length;
1648
- let i = 0; // Search the first visible pixel
1649
-
1650
- for (; i < count && !a[i + 3]; i += 4); // No visible pixel
1651
-
1652
-
1653
- if (i >= count) return false; // Emoji has immutable color, so we check the color of the emoji in two different colors
1462
+ let i = 0;
1463
+ // Search the first visible pixel
1464
+ for (; i < count && !a[i + 3]; i += 4);
1465
+ // No visible pixel
1466
+ if (i >= count) return false;
1467
+ // Emoji has immutable color, so we check the color of the emoji in two different colors
1654
1468
  // the result show be the same.
1655
-
1656
1469
  const x = CANVAS_WIDTH + i / 4 % CANVAS_WIDTH;
1657
1470
  const y = Math.floor(i / 4 / CANVAS_WIDTH);
1658
1471
  const b = ctx.getImageData(x, y, 1, 1).data;
1659
- if (a[i] !== b[0] || a[i + 2] !== b[2]) return false; // Some emojis are a contraction of different ones, so if it's not
1472
+ if (a[i] !== b[0] || a[i + 2] !== b[2]) return false;
1473
+ // Some emojis are a contraction of different ones, so if it's not
1660
1474
  // supported, it will show multiple characters
1661
-
1662
- if (ctx.measureText(unicode).width >= CANVAS_WIDTH) return false; // Supported
1663
-
1475
+ if (ctx.measureText(unicode).width >= CANVAS_WIDTH) return false;
1476
+ // Supported
1664
1477
  return true;
1665
1478
  };
1666
1479
  })();
1667
-
1668
1480
  var $c84d045dcc34faf5$export$2e2bcd8739ae039 = {
1669
1481
  latestVersion: $c84d045dcc34faf5$var$latestVersion,
1670
1482
  noCountryFlags: $c84d045dcc34faf5$var$noCountryFlags
1671
1483
  };
1672
1484
  const $b22cfd0a55410b4f$var$DEFAULTS = ["+1", "grinning", "kissing_heart", "heart_eyes", "laughing", "stuck_out_tongue_winking_eye", "sweat_smile", "joy", "scream", "disappointed", "unamused", "weary", "sob", "sunglasses", "heart"];
1673
1485
  let $b22cfd0a55410b4f$var$Index = null;
1674
-
1675
1486
  function $b22cfd0a55410b4f$var$add(emoji) {
1676
1487
  $b22cfd0a55410b4f$var$Index || ($b22cfd0a55410b4f$var$Index = ($f72b75cf796873c7$export$2e2bcd8739ae039).get("frequently") || {});
1677
1488
  const emojiId = emoji.id || emoji;
@@ -1681,7 +1492,6 @@ function $b22cfd0a55410b4f$var$add(emoji) {
1681
1492
  ($f72b75cf796873c7$export$2e2bcd8739ae039).set("last", emojiId);
1682
1493
  ($f72b75cf796873c7$export$2e2bcd8739ae039).set("frequently", $b22cfd0a55410b4f$var$Index);
1683
1494
  }
1684
-
1685
1495
  function $b22cfd0a55410b4f$var$get({
1686
1496
  maxFrequentRows: maxFrequentRows,
1687
1497
  perLine: perLine
@@ -1689,51 +1499,39 @@ function $b22cfd0a55410b4f$var$get({
1689
1499
  if (!maxFrequentRows) return [];
1690
1500
  $b22cfd0a55410b4f$var$Index || ($b22cfd0a55410b4f$var$Index = ($f72b75cf796873c7$export$2e2bcd8739ae039).get("frequently"));
1691
1501
  let emojiIds = [];
1692
-
1693
1502
  if (!$b22cfd0a55410b4f$var$Index) {
1694
1503
  $b22cfd0a55410b4f$var$Index = {};
1695
-
1696
1504
  for (let i in $b22cfd0a55410b4f$var$DEFAULTS.slice(0, perLine)) {
1697
1505
  const emojiId = $b22cfd0a55410b4f$var$DEFAULTS[i];
1698
1506
  $b22cfd0a55410b4f$var$Index[emojiId] = perLine - i;
1699
1507
  emojiIds.push(emojiId);
1700
1508
  }
1701
-
1702
1509
  return emojiIds;
1703
1510
  }
1704
-
1705
1511
  const max = maxFrequentRows * perLine;
1706
1512
  const last = ($f72b75cf796873c7$export$2e2bcd8739ae039).get("last");
1707
-
1708
1513
  for (let emojiId in $b22cfd0a55410b4f$var$Index) emojiIds.push(emojiId);
1709
-
1710
1514
  emojiIds.sort((a, b) => {
1711
1515
  const aScore = $b22cfd0a55410b4f$var$Index[b];
1712
1516
  const bScore = $b22cfd0a55410b4f$var$Index[a];
1713
1517
  if (aScore == bScore) return a.localeCompare(b);
1714
1518
  return aScore - bScore;
1715
1519
  });
1716
-
1717
1520
  if (emojiIds.length > max) {
1718
1521
  const removedIds = emojiIds.slice(max);
1719
1522
  emojiIds = emojiIds.slice(0, max);
1720
-
1721
1523
  for (let removedId of removedIds) {
1722
1524
  if (removedId == last) continue;
1723
1525
  delete $b22cfd0a55410b4f$var$Index[removedId];
1724
1526
  }
1725
-
1726
1527
  if (last && emojiIds.indexOf(last) == -1) {
1727
1528
  delete $b22cfd0a55410b4f$var$Index[emojiIds[emojiIds.length - 1]];
1728
1529
  emojiIds.splice(-1, 1, last);
1729
1530
  }
1730
-
1731
1531
  ($f72b75cf796873c7$export$2e2bcd8739ae039).set("frequently", $b22cfd0a55410b4f$var$Index);
1732
1532
  }
1733
-
1734
1533
  return emojiIds;
1735
1534
  }
1736
-
1737
1535
  var $b22cfd0a55410b4f$export$2e2bcd8739ae039 = {
1738
1536
  add: $b22cfd0a55410b4f$var$add,
1739
1537
  get: $b22cfd0a55410b4f$var$get,
@@ -1839,7 +1637,6 @@ var $b247ea80b67298d5$export$2e2bcd8739ae039 = {
1839
1637
  let $7adb23b0109cc36a$export$dbe3113d60765c1a = null;
1840
1638
  let $7adb23b0109cc36a$export$2d0294657ab35f1b = null;
1841
1639
  const $7adb23b0109cc36a$var$fetchCache = {};
1842
-
1843
1640
  async function $7adb23b0109cc36a$var$fetchJSON(src) {
1844
1641
  if ($7adb23b0109cc36a$var$fetchCache[src]) return $7adb23b0109cc36a$var$fetchCache[src];
1845
1642
  const response = await fetch(src);
@@ -1847,11 +1644,9 @@ async function $7adb23b0109cc36a$var$fetchJSON(src) {
1847
1644
  $7adb23b0109cc36a$var$fetchCache[src] = json;
1848
1645
  return json;
1849
1646
  }
1850
-
1851
1647
  let $7adb23b0109cc36a$var$promise = null;
1852
1648
  let $7adb23b0109cc36a$var$initCallback = null;
1853
1649
  let $7adb23b0109cc36a$var$initialized = false;
1854
-
1855
1650
  function $7adb23b0109cc36a$export$2cd8252107eb640b(options, {
1856
1651
  caller: caller
1857
1652
  } = {}) {
@@ -1861,7 +1656,6 @@ function $7adb23b0109cc36a$export$2cd8252107eb640b(options, {
1861
1656
  if (options) $7adb23b0109cc36a$var$_init(options);else if (caller && !$7adb23b0109cc36a$var$initialized) console.warn(`\`${caller}\` requires data to be initialized first. Promise will be pending until \`init\` is called.`);
1862
1657
  return $7adb23b0109cc36a$var$promise;
1863
1658
  }
1864
-
1865
1659
  async function $7adb23b0109cc36a$var$_init(props) {
1866
1660
  $7adb23b0109cc36a$var$initialized = true;
1867
1661
  let {
@@ -1872,7 +1666,6 @@ async function $7adb23b0109cc36a$var$_init(props) {
1872
1666
  emojiVersion || (emojiVersion = ($b247ea80b67298d5$export$2e2bcd8739ae039).emojiVersion.value);
1873
1667
  set || (set = ($b247ea80b67298d5$export$2e2bcd8739ae039).set.value);
1874
1668
  locale || (locale = ($b247ea80b67298d5$export$2e2bcd8739ae039).locale.value);
1875
-
1876
1669
  if (!$7adb23b0109cc36a$export$2d0294657ab35f1b) {
1877
1670
  $7adb23b0109cc36a$export$2d0294657ab35f1b = (typeof props.data === "function" ? await props.data() : props.data) || (await $7adb23b0109cc36a$var$fetchJSON(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/sets/${emojiVersion}/${set}.json`));
1878
1671
  $7adb23b0109cc36a$export$2d0294657ab35f1b.emoticons = {};
@@ -1881,7 +1674,6 @@ async function $7adb23b0109cc36a$var$_init(props) {
1881
1674
  id: "frequent",
1882
1675
  emojis: []
1883
1676
  });
1884
-
1885
1677
  for (const alias in $7adb23b0109cc36a$export$2d0294657ab35f1b.aliases) {
1886
1678
  const emojiId = $7adb23b0109cc36a$export$2d0294657ab35f1b.aliases[alias];
1887
1679
  const emoji = $7adb23b0109cc36a$export$2d0294657ab35f1b.emojis[emojiId];
@@ -1889,14 +1681,12 @@ async function $7adb23b0109cc36a$var$_init(props) {
1889
1681
  emoji.aliases || (emoji.aliases = []);
1890
1682
  emoji.aliases.push(alias);
1891
1683
  }
1892
-
1893
1684
  $7adb23b0109cc36a$export$2d0294657ab35f1b.originalCategories = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories;
1894
1685
  } else $7adb23b0109cc36a$export$2d0294657ab35f1b.categories = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories.filter(c => {
1895
1686
  const isCustom = !!c.name;
1896
1687
  if (!isCustom) return true;
1897
1688
  return false;
1898
1689
  });
1899
-
1900
1690
  $7adb23b0109cc36a$export$dbe3113d60765c1a = (typeof props.i18n === "function" ? await props.i18n() : props.i18n) || (locale == "en" ? (/*@__PURE__*/$parcel$interopDefault($8d50d93417ef682a$exports)) : await $7adb23b0109cc36a$var$fetchJSON(`https://cdn.jsdelivr.net/npm/@emoji-mart/data@latest/i18n/${locale}.json`));
1901
1691
  if (props.custom) for (let i in props.custom) {
1902
1692
  i = parseInt(i);
@@ -1907,7 +1697,6 @@ async function $7adb23b0109cc36a$var$_init(props) {
1907
1697
  category.name || (category.name = $7adb23b0109cc36a$export$dbe3113d60765c1a.categories.custom);
1908
1698
  if (prevCategory && !category.icon) category.target = prevCategory.target || prevCategory;
1909
1699
  $7adb23b0109cc36a$export$2d0294657ab35f1b.categories.push(category);
1910
-
1911
1700
  for (const emoji of category.emojis) $7adb23b0109cc36a$export$2d0294657ab35f1b.emojis[emoji.id] = emoji;
1912
1701
  }
1913
1702
  if (props.categories) $7adb23b0109cc36a$export$2d0294657ab35f1b.categories = $7adb23b0109cc36a$export$2d0294657ab35f1b.originalCategories.filter(c => {
@@ -1919,18 +1708,14 @@ async function $7adb23b0109cc36a$var$_init(props) {
1919
1708
  });
1920
1709
  let latestVersionSupport = null;
1921
1710
  let noCountryFlags = null;
1922
-
1923
1711
  if (set == "native") {
1924
1712
  latestVersionSupport = ($c84d045dcc34faf5$export$2e2bcd8739ae039).latestVersion();
1925
1713
  noCountryFlags = props.noCountryFlags || ($c84d045dcc34faf5$export$2e2bcd8739ae039).noCountryFlags();
1926
1714
  }
1927
-
1928
1715
  let categoryIndex = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories.length;
1929
1716
  let resetSearchIndex = false;
1930
-
1931
1717
  while (categoryIndex--) {
1932
1718
  const category = $7adb23b0109cc36a$export$2d0294657ab35f1b.categories[categoryIndex];
1933
-
1934
1719
  if (category.id == "frequent") {
1935
1720
  let {
1936
1721
  maxFrequentRows: maxFrequentRows,
@@ -1943,48 +1728,38 @@ async function $7adb23b0109cc36a$var$_init(props) {
1943
1728
  perLine: perLine
1944
1729
  });
1945
1730
  }
1946
-
1947
1731
  if (!category.emojis || !category.emojis.length) {
1948
1732
  $7adb23b0109cc36a$export$2d0294657ab35f1b.categories.splice(categoryIndex, 1);
1949
1733
  continue;
1950
1734
  }
1951
-
1952
1735
  const {
1953
1736
  categoryIcons: categoryIcons
1954
1737
  } = props;
1955
-
1956
1738
  if (categoryIcons) {
1957
1739
  const icon = categoryIcons[category.id];
1958
1740
  if (icon && !category.icon) category.icon = icon;
1959
1741
  }
1960
-
1961
1742
  let emojiIndex = category.emojis.length;
1962
-
1963
1743
  while (emojiIndex--) {
1964
1744
  const emojiId = category.emojis[emojiIndex];
1965
1745
  const emoji = emojiId.id ? emojiId : $7adb23b0109cc36a$export$2d0294657ab35f1b.emojis[emojiId];
1966
-
1967
1746
  const ignore = () => {
1968
1747
  category.emojis.splice(emojiIndex, 1);
1969
1748
  };
1970
-
1971
1749
  if (!emoji || props.exceptEmojis && props.exceptEmojis.includes(emoji.id)) {
1972
1750
  ignore();
1973
1751
  continue;
1974
1752
  }
1975
-
1976
1753
  if (latestVersionSupport && emoji.version > latestVersionSupport) {
1977
1754
  ignore();
1978
1755
  continue;
1979
1756
  }
1980
-
1981
1757
  if (noCountryFlags && category.id == "flags") {
1982
1758
  if (!($e6eae5155b87f591$export$bcb25aa587e9cb13).includes(emoji.id)) {
1983
1759
  ignore();
1984
1760
  continue;
1985
1761
  }
1986
1762
  }
1987
-
1988
1763
  if (!emoji.search) {
1989
1764
  resetSearchIndex = true;
1990
1765
  emoji.search = "," + [[emoji.id, false], [emoji.name, true], [emoji.keywords, false], [emoji.emoticons, false]].map(([strings, split]) => {
@@ -1998,65 +1773,51 @@ async function $7adb23b0109cc36a$var$_init(props) {
1998
1773
  $7adb23b0109cc36a$export$2d0294657ab35f1b.emoticons[emoticon] = emoji.id;
1999
1774
  }
2000
1775
  let skinIndex = 0;
2001
-
2002
1776
  for (const skin of emoji.skins) {
2003
1777
  if (!skin) continue;
2004
1778
  skinIndex++;
2005
1779
  const {
2006
1780
  native: native
2007
1781
  } = skin;
2008
-
2009
1782
  if (native) {
2010
1783
  $7adb23b0109cc36a$export$2d0294657ab35f1b.natives[native] = emoji.id;
2011
1784
  emoji.search += `,${native}`;
2012
1785
  }
2013
-
2014
1786
  const skinShortcodes = skinIndex == 1 ? "" : `:skin-tone-${skinIndex}:`;
2015
1787
  skin.shortcodes = `:${emoji.id}:${skinShortcodes}`;
2016
1788
  }
2017
1789
  }
2018
1790
  }
2019
1791
  }
2020
-
2021
1792
  if (resetSearchIndex) ($c4d155af13ad4d4b$export$2e2bcd8739ae039).reset();
2022
1793
  $7adb23b0109cc36a$var$initCallback();
2023
1794
  }
2024
-
2025
1795
  function $7adb23b0109cc36a$export$75fe5f91d452f94b(props, defaultProps, element) {
2026
1796
  props || (props = {});
2027
1797
  const _props = {};
2028
-
2029
1798
  for (let k in defaultProps) _props[k] = $7adb23b0109cc36a$export$88c9ddb45cea7241(k, props, defaultProps, element);
2030
-
2031
1799
  return _props;
2032
1800
  }
2033
-
2034
1801
  function $7adb23b0109cc36a$export$88c9ddb45cea7241(propName, props, defaultProps, element) {
2035
1802
  const defaults = defaultProps[propName];
2036
1803
  let value = element && element.getAttribute(propName) || (props[propName] != null && props[propName] != undefined ? props[propName] : null);
2037
1804
  if (!defaults) return value;
2038
-
2039
1805
  if (value != null && defaults.value && typeof defaults.value != typeof value) {
2040
1806
  if (typeof defaults.value == "boolean") value = value == "false" ? false : true;else value = defaults.value.constructor(value);
2041
1807
  }
2042
-
2043
1808
  if (defaults.transform && value) value = defaults.transform(value);
2044
1809
  if (value == null || defaults.choices && defaults.choices.indexOf(value) == -1) value = defaults.value;
2045
1810
  return value;
2046
1811
  }
2047
-
2048
1812
  const $c4d155af13ad4d4b$var$SHORTCODES_REGEX = /^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/;
2049
1813
  let $c4d155af13ad4d4b$var$Pool = null;
2050
-
2051
1814
  function $c4d155af13ad4d4b$var$get(emojiId) {
2052
1815
  if (emojiId.id) return emojiId;
2053
1816
  return ($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis[emojiId] || ($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis[($7adb23b0109cc36a$export$2d0294657ab35f1b).aliases[emojiId]] || ($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis[($7adb23b0109cc36a$export$2d0294657ab35f1b).natives[emojiId]];
2054
1817
  }
2055
-
2056
1818
  function $c4d155af13ad4d4b$var$reset() {
2057
1819
  $c4d155af13ad4d4b$var$Pool = null;
2058
1820
  }
2059
-
2060
1821
  async function $c4d155af13ad4d4b$var$search(value, {
2061
1822
  maxResults: maxResults,
2062
1823
  caller: caller
@@ -2072,12 +1833,10 @@ async function $c4d155af13ad4d4b$var$search(value, {
2072
1833
  if (!values.length) return;
2073
1834
  let pool = $c4d155af13ad4d4b$var$Pool || ($c4d155af13ad4d4b$var$Pool = Object.values(($7adb23b0109cc36a$export$2d0294657ab35f1b).emojis));
2074
1835
  let results, scores;
2075
-
2076
1836
  for (const value1 of values) {
2077
1837
  if (!pool.length) break;
2078
1838
  results = [];
2079
1839
  scores = {};
2080
-
2081
1840
  for (const emoji of pool) {
2082
1841
  if (!emoji.search) continue;
2083
1842
  const score = emoji.search.indexOf(`,${value1}`);
@@ -2086,10 +1845,8 @@ async function $c4d155af13ad4d4b$var$search(value, {
2086
1845
  scores[emoji.id] || (scores[emoji.id] = 0);
2087
1846
  scores[emoji.id] += emoji.id == value1 ? 0 : score + 1;
2088
1847
  }
2089
-
2090
1848
  pool = results;
2091
1849
  }
2092
-
2093
1850
  if (results.length < 2) return results;
2094
1851
  results.sort((a, b) => {
2095
1852
  const aScore = scores[a.id];
@@ -2100,7 +1857,6 @@ async function $c4d155af13ad4d4b$var$search(value, {
2100
1857
  if (results.length > maxResults) results = results.slice(0, maxResults);
2101
1858
  return results;
2102
1859
  }
2103
-
2104
1860
  var $c4d155af13ad4d4b$export$2e2bcd8739ae039 = {
2105
1861
  search: $c4d155af13ad4d4b$var$search,
2106
1862
  get: $c4d155af13ad4d4b$var$get,
@@ -2108,15 +1864,12 @@ var $c4d155af13ad4d4b$export$2e2bcd8739ae039 = {
2108
1864
  SHORTCODES_REGEX: $c4d155af13ad4d4b$var$SHORTCODES_REGEX
2109
1865
  };
2110
1866
  const $e6eae5155b87f591$export$bcb25aa587e9cb13 = ["checkered_flag", "crossed_flags", "pirate_flag", "rainbow-flag", "transgender_flag", "triangular_flag_on_post", "waving_black_flag", "waving_white_flag"];
2111
-
2112
1867
  function $693b183b0a78708f$export$9cb4719e2e525b7a(a, b) {
2113
1868
  return Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((val, index) => val == b[index]);
2114
1869
  }
2115
-
2116
1870
  async function $693b183b0a78708f$export$e772c8ff12451969(frames = 1) {
2117
1871
  for (let _ in [...Array(frames).keys()]) await new Promise(requestAnimationFrame);
2118
1872
  }
2119
-
2120
1873
  function $693b183b0a78708f$export$d10ac59fbe52a745(emoji, {
2121
1874
  skinIndex = 0
2122
1875
  } = {}) {
@@ -2124,7 +1877,6 @@ function $693b183b0a78708f$export$d10ac59fbe52a745(emoji, {
2124
1877
  skinIndex = 0;
2125
1878
  return emoji.skins[skinIndex];
2126
1879
  })();
2127
-
2128
1880
  const emojiData = {
2129
1881
  id: emoji.id,
2130
1882
  name: emoji.name,
@@ -2139,7 +1891,6 @@ function $693b183b0a78708f$export$d10ac59fbe52a745(emoji, {
2139
1891
  if (emoji.emoticons && emoji.emoticons.length) emojiData.emoticons = emoji.emoticons;
2140
1892
  return emojiData;
2141
1893
  }
2142
-
2143
1894
  const $fcccfb36ed0cde68$var$categories = {
2144
1895
  activity: {
2145
1896
  outline: /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("svg", {
@@ -2323,23 +2074,19 @@ var $fcccfb36ed0cde68$export$2e2bcd8739ae039 = {
2323
2074
  categories: $fcccfb36ed0cde68$var$categories,
2324
2075
  search: $fcccfb36ed0cde68$var$search
2325
2076
  };
2326
-
2327
2077
  function $254755d3f438722f$export$2e2bcd8739ae039(props) {
2328
2078
  let {
2329
2079
  id: id,
2330
2080
  skin: skin,
2331
2081
  emoji: emoji
2332
2082
  } = props;
2333
-
2334
2083
  if (props.shortcodes) {
2335
2084
  const matches = props.shortcodes.match(($c4d155af13ad4d4b$export$2e2bcd8739ae039).SHORTCODES_REGEX);
2336
-
2337
2085
  if (matches) {
2338
2086
  id = matches[1];
2339
2087
  if (matches[2]) skin = matches[2];
2340
2088
  }
2341
2089
  }
2342
-
2343
2090
  emoji || (emoji = ($c4d155af13ad4d4b$export$2e2bcd8739ae039).get(id || props.native));
2344
2091
  if (!emoji) return props.fallback;
2345
2092
  const emojiSkin = emoji.skins[skin - 1] || emoji.skins[0];
@@ -2374,18 +2121,14 @@ function $254755d3f438722f$export$2e2bcd8739ae039(props) {
2374
2121
  })
2375
2122
  });
2376
2123
  }
2377
-
2378
2124
  const $6f57cc9cd54c5aaa$var$WindowHTMLElement = typeof window !== "undefined" && window.HTMLElement ? window.HTMLElement : Object;
2379
-
2380
2125
  class $6f57cc9cd54c5aaa$export$2e2bcd8739ae039 extends $6f57cc9cd54c5aaa$var$WindowHTMLElement {
2381
2126
  static get observedAttributes() {
2382
2127
  return Object.keys(this.Props);
2383
2128
  }
2384
-
2385
2129
  update(props = {}) {
2386
2130
  for (let k in props) this.attributeChangedCallback(k, null, props[k]);
2387
2131
  }
2388
-
2389
2132
  attributeChangedCallback(attr, _, newValue) {
2390
2133
  if (!this.component) return;
2391
2134
  const value = ($7adb23b0109cc36a$export$88c9ddb45cea7241)(attr, {
@@ -2398,16 +2141,13 @@ class $6f57cc9cd54c5aaa$export$2e2bcd8739ae039 extends $6f57cc9cd54c5aaa$var$Win
2398
2141
  this.component.forceUpdate();
2399
2142
  }
2400
2143
  }
2401
-
2402
2144
  disconnectedCallback() {
2403
2145
  this.disconnected = true;
2404
2146
  if (this.component && this.component.unregister) this.component.unregister();
2405
2147
  }
2406
-
2407
2148
  constructor(props = {}) {
2408
2149
  super();
2409
2150
  this.props = props;
2410
-
2411
2151
  if (props.parent || props.ref) {
2412
2152
  let ref = null;
2413
2153
  const parent = props.parent || (ref = props.ref && props.ref.current);
@@ -2415,23 +2155,19 @@ class $6f57cc9cd54c5aaa$export$2e2bcd8739ae039 extends $6f57cc9cd54c5aaa$var$Win
2415
2155
  if (parent) parent.appendChild(this);
2416
2156
  }
2417
2157
  }
2418
-
2419
2158
  }
2420
-
2421
2159
  class $26f27c338a96b1a6$export$2e2bcd8739ae039 extends ($6f57cc9cd54c5aaa$export$2e2bcd8739ae039) {
2422
2160
  setShadow() {
2423
2161
  this.attachShadow({
2424
2162
  mode: "open"
2425
2163
  });
2426
2164
  }
2427
-
2428
2165
  injectStyles(styles) {
2429
2166
  if (!styles) return;
2430
2167
  const style = document.createElement("style");
2431
2168
  style.textContent = styles;
2432
2169
  this.shadowRoot.insertBefore(style, this.shadowRoot.firstChild);
2433
2170
  }
2434
-
2435
2171
  constructor(props, {
2436
2172
  styles: styles
2437
2173
  } = {}) {
@@ -2439,9 +2175,7 @@ class $26f27c338a96b1a6$export$2e2bcd8739ae039 extends ($6f57cc9cd54c5aaa$export
2439
2175
  this.setShadow();
2440
2176
  this.injectStyles(styles);
2441
2177
  }
2442
-
2443
2178
  }
2444
-
2445
2179
  var $3d90f6e46fb2dd47$export$2e2bcd8739ae039 = {
2446
2180
  fallback: "",
2447
2181
  id: "",
@@ -2459,41 +2193,34 @@ var $3d90f6e46fb2dd47$export$2e2bcd8739ae039 = {
2459
2193
  set: ($b247ea80b67298d5$export$2e2bcd8739ae039).set,
2460
2194
  skin: ($b247ea80b67298d5$export$2e2bcd8739ae039).skin
2461
2195
  };
2462
-
2463
2196
  class $331b4160623139bf$export$2e2bcd8739ae039 extends ($6f57cc9cd54c5aaa$export$2e2bcd8739ae039) {
2464
2197
  async connectedCallback() {
2465
2198
  const props = ($7adb23b0109cc36a$export$75fe5f91d452f94b)(this.props, ($3d90f6e46fb2dd47$export$2e2bcd8739ae039), this);
2466
2199
  props.element = this;
2467
-
2468
2200
  props.ref = component => {
2469
2201
  this.component = component;
2470
2202
  };
2471
-
2472
2203
  await ($7adb23b0109cc36a$export$2cd8252107eb640b)();
2473
2204
  if (this.disconnected) return;
2474
- ($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($254755d3f438722f$export$2e2bcd8739ae039), { ...props
2205
+ ($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($254755d3f438722f$export$2e2bcd8739ae039), {
2206
+ ...props
2475
2207
  }), this);
2476
2208
  }
2477
-
2478
2209
  constructor(props) {
2479
2210
  super(props);
2480
2211
  }
2481
-
2482
2212
  }
2483
-
2484
2213
  ($c770c458706daa72$export$2e2bcd8739ae039)($331b4160623139bf$export$2e2bcd8739ae039, "Props", ($3d90f6e46fb2dd47$export$2e2bcd8739ae039));
2485
2214
  if (typeof customElements !== "undefined" && !customElements.get("em-emoji")) customElements.define("em-emoji", $331b4160623139bf$export$2e2bcd8739ae039);
2486
2215
  var $1a9a8ef576b7773d$var$r,
2487
- $1a9a8ef576b7773d$var$i = [],
2488
- $1a9a8ef576b7773d$var$c = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b,
2489
- $1a9a8ef576b7773d$var$f = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r,
2490
- $1a9a8ef576b7773d$var$e = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).diffed,
2491
- $1a9a8ef576b7773d$var$a = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__c,
2492
- $1a9a8ef576b7773d$var$v = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount;
2493
-
2216
+ $1a9a8ef576b7773d$var$i = [],
2217
+ $1a9a8ef576b7773d$var$c = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b,
2218
+ $1a9a8ef576b7773d$var$f = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r,
2219
+ $1a9a8ef576b7773d$var$e = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).diffed,
2220
+ $1a9a8ef576b7773d$var$a = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__c,
2221
+ $1a9a8ef576b7773d$var$v = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount;
2494
2222
  function $1a9a8ef576b7773d$var$x() {
2495
2223
  var t6;
2496
-
2497
2224
  for ($1a9a8ef576b7773d$var$i.sort(function (n11, t7) {
2498
2225
  return n11.__v.__b - t7.__v.__b;
2499
2226
  }); t6 = $1a9a8ef576b7773d$var$i.pop();) if (t6.__P) try {
@@ -2502,7 +2229,6 @@ function $1a9a8ef576b7773d$var$x() {
2502
2229
  t6.__H.__h = [], ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e(u4, t6.__v);
2503
2230
  }
2504
2231
  }
2505
-
2506
2232
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b = function (n12) {
2507
2233
  $1a9a8ef576b7773d$var$c && $1a9a8ef576b7773d$var$c(n12);
2508
2234
  }, ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r = function (n13) {
@@ -2514,11 +2240,10 @@ function $1a9a8ef576b7773d$var$x() {
2514
2240
  var o6 = t8.__c;
2515
2241
  o6 && o6.__H && o6.__H.__h.length && (1 !== $1a9a8ef576b7773d$var$i.push(o6) && $1a9a8ef576b7773d$var$r === ($fb96b826c0c5f37a$export$41c562ebe57d11e2).requestAnimationFrame || (($1a9a8ef576b7773d$var$r = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).requestAnimationFrame) || function (n14) {
2516
2242
  var t9,
2517
- u5 = function () {
2518
- clearTimeout(r9), $1a9a8ef576b7773d$var$b && cancelAnimationFrame(t9), setTimeout(n14);
2519
- },
2520
- r9 = setTimeout(u5, 100);
2521
-
2243
+ u5 = function () {
2244
+ clearTimeout(r9), $1a9a8ef576b7773d$var$b && cancelAnimationFrame(t9), setTimeout(n14);
2245
+ },
2246
+ r9 = setTimeout(u5, 100);
2522
2247
  $1a9a8ef576b7773d$var$b && (t9 = requestAnimationFrame(u5));
2523
2248
  })($1a9a8ef576b7773d$var$x));
2524
2249
  }, ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__c = function (t10, u6) {
@@ -2536,7 +2261,7 @@ function $1a9a8ef576b7773d$var$x() {
2536
2261
  }, ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount = function (t12) {
2537
2262
  $1a9a8ef576b7773d$var$v && $1a9a8ef576b7773d$var$v(t12);
2538
2263
  var u7,
2539
- r11 = t12.__c;
2264
+ r11 = t12.__c;
2540
2265
  r11 && r11.__H && (r11.__H.__.forEach(function (n17) {
2541
2266
  try {
2542
2267
  $1a9a8ef576b7773d$var$g(n17);
@@ -2546,105 +2271,80 @@ function $1a9a8ef576b7773d$var$x() {
2546
2271
  }), u7 && ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e(u7, r11.__v));
2547
2272
  };
2548
2273
  var $1a9a8ef576b7773d$var$b = "function" == typeof requestAnimationFrame;
2549
-
2550
2274
  function $1a9a8ef576b7773d$var$g(n19) {
2551
2275
  var r12 = n19.__c;
2552
2276
  "function" == typeof r12 && (n19.__c = void 0, r12());
2553
2277
  }
2554
-
2555
2278
  function $1a9a8ef576b7773d$var$j(n20) {
2556
2279
  n20.__c = n20.__();
2557
2280
  }
2558
-
2559
2281
  function $dc040a17866866fa$var$S(n1, t1) {
2560
2282
  for (var e1 in t1) n1[e1] = t1[e1];
2561
-
2562
2283
  return n1;
2563
2284
  }
2564
-
2565
2285
  function $dc040a17866866fa$var$C(n2, t2) {
2566
2286
  for (var e2 in n2) if ("__source" !== e2 && !(e2 in t2)) return !0;
2567
-
2568
2287
  for (var r1 in t2) if ("__source" !== r1 && n2[r1] !== t2[r1]) return !0;
2569
-
2570
2288
  return !1;
2571
2289
  }
2572
-
2573
2290
  function $dc040a17866866fa$export$221d75b3f55bb0bd(n3) {
2574
2291
  this.props = n3;
2575
2292
  }
2576
-
2577
2293
  ($dc040a17866866fa$export$221d75b3f55bb0bd.prototype = new ($fb96b826c0c5f37a$export$16fa2f45be04daa8)()).isPureReactComponent = !0, $dc040a17866866fa$export$221d75b3f55bb0bd.prototype.shouldComponentUpdate = function (n6, t5) {
2578
2294
  return $dc040a17866866fa$var$C(this.props, n6) || $dc040a17866866fa$var$C(this.state, t5);
2579
2295
  };
2580
2296
  var $dc040a17866866fa$var$w = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b;
2581
-
2582
2297
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__b = function (n7) {
2583
2298
  n7.type && n7.type.__f && n7.ref && (n7.props.ref = n7.ref, n7.ref = null), $dc040a17866866fa$var$w && $dc040a17866866fa$var$w(n7);
2584
2299
  };
2585
-
2586
2300
  var $dc040a17866866fa$var$A = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e;
2587
-
2588
2301
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__e = function (n12, t10, e6) {
2589
2302
  if (n12.then) {
2590
2303
  for (var r5, u1 = t10; u1 = u1.__;) if ((r5 = u1.__c) && r5.__c) return null == t10.__e && (t10.__e = e6.__e, t10.__k = e6.__k), r5.__c(n12, t10);
2591
2304
  }
2592
-
2593
2305
  $dc040a17866866fa$var$A(n12, t10, e6);
2594
2306
  };
2595
-
2596
2307
  var $dc040a17866866fa$var$O = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount;
2597
-
2598
2308
  function $dc040a17866866fa$export$74bf444e3cd11ea5() {
2599
2309
  this.__u = 0, this.t = null, this.__b = null;
2600
2310
  }
2601
-
2602
2311
  function $dc040a17866866fa$var$U(n13) {
2603
2312
  var t11 = n13.__.__c;
2604
2313
  return t11 && t11.__e && t11.__e(n13);
2605
2314
  }
2606
-
2607
2315
  function $dc040a17866866fa$export$998bcd577473dd93() {
2608
2316
  this.u = null, this.o = null;
2609
2317
  }
2610
-
2611
2318
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).unmount = function (n17) {
2612
2319
  var t13 = n17.__c;
2613
2320
  t13 && t13.__R && t13.__R(), t13 && !0 === n17.__h && (n17.type = null), $dc040a17866866fa$var$O && $dc040a17866866fa$var$O(n17);
2614
2321
  }, ($dc040a17866866fa$export$74bf444e3cd11ea5.prototype = new ($fb96b826c0c5f37a$export$16fa2f45be04daa8)()).__c = function (n18, t14) {
2615
2322
  var e8 = t14.__c,
2616
- r7 = this;
2323
+ r7 = this;
2617
2324
  null == r7.t && (r7.t = []), r7.t.push(e8);
2618
-
2619
2325
  var u4 = $dc040a17866866fa$var$U(r7.__v),
2620
- o1 = !1,
2621
- i1 = function () {
2622
- o1 || (o1 = !0, e8.__R = null, u4 ? u4(l1) : l1());
2623
- };
2624
-
2326
+ o1 = !1,
2327
+ i1 = function () {
2328
+ o1 || (o1 = !0, e8.__R = null, u4 ? u4(l1) : l1());
2329
+ };
2625
2330
  e8.__R = i1;
2626
-
2627
2331
  var l1 = function () {
2628
- if (! --r7.__u) {
2629
- if (r7.state.__e) {
2630
- var n19 = r7.state.__e;
2631
-
2632
- r7.__v.__k[0] = function n22(t17, e9, r8) {
2633
- return t17 && (t17.__v = null, t17.__k = t17.__k && t17.__k.map(function (t18) {
2634
- return n22(t18, e9, r8);
2635
- }), t17.__c && t17.__c.__P === e9 && (t17.__e && r8.insertBefore(t17.__e, t17.__d), t17.__c.__e = !0, t17.__c.__P = r8)), t17;
2636
- }(n19, n19.__c.__P, n19.__c.__O);
2332
+ if (! --r7.__u) {
2333
+ if (r7.state.__e) {
2334
+ var n19 = r7.state.__e;
2335
+ r7.__v.__k[0] = function n22(t17, e9, r8) {
2336
+ return t17 && (t17.__v = null, t17.__k = t17.__k && t17.__k.map(function (t18) {
2337
+ return n22(t18, e9, r8);
2338
+ }), t17.__c && t17.__c.__P === e9 && (t17.__e && r8.insertBefore(t17.__e, t17.__d), t17.__c.__e = !0, t17.__c.__P = r8)), t17;
2339
+ }(n19, n19.__c.__P, n19.__c.__O);
2340
+ }
2341
+ var t15;
2342
+ for (r7.setState({
2343
+ __e: r7.__b = null
2344
+ }); t15 = r7.t.pop();) t15.forceUpdate();
2637
2345
  }
2638
-
2639
- var t15;
2640
-
2641
- for (r7.setState({
2642
- __e: r7.__b = null
2643
- }); t15 = r7.t.pop();) t15.forceUpdate();
2644
- }
2645
- },
2646
- c1 = !0 === t14.__h;
2647
-
2346
+ },
2347
+ c1 = !0 === t14.__h;
2648
2348
  r7.__u++ || c1 || r7.setState({
2649
2349
  __e: r7.__b = r7.__v.__k[0]
2650
2350
  }), n18.then(i1, i1);
@@ -2654,8 +2354,7 @@ function $dc040a17866866fa$export$998bcd577473dd93() {
2654
2354
  if (this.__b) {
2655
2355
  if (this.__v.__k) {
2656
2356
  var e10 = document.createElement("div"),
2657
- r9 = this.__v.__k[0].__c;
2658
-
2357
+ r9 = this.__v.__k[0].__c;
2659
2358
  this.__v.__k[0] = function n24(t20, e13, r12) {
2660
2359
  return t20 && (t20.__c && t20.__c.__H && (t20.__c.__H.__.forEach(function (n25) {
2661
2360
  "function" == typeof n25.__c && n25.__c();
@@ -2664,41 +2363,33 @@ function $dc040a17866866fa$export$998bcd577473dd93() {
2664
2363
  })), t20;
2665
2364
  }(this.__b, e10, r9.__O = r9.__P);
2666
2365
  }
2667
-
2668
2366
  this.__b = null;
2669
2367
  }
2670
-
2671
2368
  var u5 = t19.__e && ($fb96b826c0c5f37a$export$c8a8987d4410bf2d)(($fb96b826c0c5f37a$export$ffb0004e005737fa), null, n23.fallback);
2672
2369
  return u5 && (u5.__h = null), [($fb96b826c0c5f37a$export$c8a8987d4410bf2d)(($fb96b826c0c5f37a$export$ffb0004e005737fa), null, t19.__e ? null : n23.children), u5];
2673
2370
  };
2674
-
2675
2371
  var $dc040a17866866fa$var$T = function (n26, t22, e14) {
2676
2372
  if (++e14[1] === e14[0] && n26.o.delete(t22), n26.props.revealOrder && ("t" !== n26.props.revealOrder[0] || !n26.o.size)) for (e14 = n26.u; e14;) {
2677
2373
  for (; e14.length > 3;) e14.pop()();
2678
-
2679
2374
  if (e14[1] < e14[0]) break;
2680
2375
  n26.u = e14 = e14[2];
2681
2376
  }
2682
2377
  };
2683
-
2684
2378
  ($dc040a17866866fa$export$998bcd577473dd93.prototype = new ($fb96b826c0c5f37a$export$16fa2f45be04daa8)()).__e = function (n33) {
2685
2379
  var t25 = this,
2686
- e16 = $dc040a17866866fa$var$U(t25.__v),
2687
- r13 = t25.o.get(n33);
2380
+ e16 = $dc040a17866866fa$var$U(t25.__v),
2381
+ r13 = t25.o.get(n33);
2688
2382
  return r13[0]++, function (u6) {
2689
2383
  var o2 = function () {
2690
2384
  t25.props.revealOrder ? (r13.push(u6), $dc040a17866866fa$var$T(t25, n33, r13)) : u6();
2691
2385
  };
2692
-
2693
2386
  e16 ? e16(o2) : o2();
2694
2387
  };
2695
2388
  }, $dc040a17866866fa$export$998bcd577473dd93.prototype.render = function (n34) {
2696
2389
  this.u = null, this.o = new Map();
2697
2390
  var t26 = ($fb96b826c0c5f37a$export$47e4c5b300681277)(n34.children);
2698
2391
  n34.revealOrder && "b" === n34.revealOrder[0] && t26.reverse();
2699
-
2700
2392
  for (var e17 = t26.length; e17--;) this.o.set(t26[e17], this.u = [1, 0, this.u]);
2701
-
2702
2393
  return n34.children;
2703
2394
  }, $dc040a17866866fa$export$998bcd577473dd93.prototype.componentDidUpdate = $dc040a17866866fa$export$998bcd577473dd93.prototype.componentDidMount = function () {
2704
2395
  var n35 = this;
@@ -2706,14 +2397,12 @@ var $dc040a17866866fa$var$T = function (n26, t22, e14) {
2706
2397
  $dc040a17866866fa$var$T(n35, e18, t27);
2707
2398
  });
2708
2399
  };
2709
-
2710
2400
  var $dc040a17866866fa$var$j = "undefined" != typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103,
2711
- $dc040a17866866fa$var$P = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,
2712
- $dc040a17866866fa$var$V = "undefined" != typeof document,
2713
- $dc040a17866866fa$var$z = function (n36) {
2714
- return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/i : /fil|che|ra/i).test(n36);
2715
- };
2716
-
2401
+ $dc040a17866866fa$var$P = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,
2402
+ $dc040a17866866fa$var$V = "undefined" != typeof document,
2403
+ $dc040a17866866fa$var$z = function (n36) {
2404
+ return ("undefined" != typeof Symbol && "symbol" == typeof Symbol() ? /fil|che|rad/i : /fil|che|ra/i).test(n36);
2405
+ };
2717
2406
  ($fb96b826c0c5f37a$export$16fa2f45be04daa8).prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function (n39) {
2718
2407
  Object.defineProperty(($fb96b826c0c5f37a$export$16fa2f45be04daa8).prototype, n39, {
2719
2408
  configurable: !0,
@@ -2730,54 +2419,42 @@ var $dc040a17866866fa$var$j = "undefined" != typeof Symbol && Symbol.for && Symb
2730
2419
  });
2731
2420
  });
2732
2421
  var $dc040a17866866fa$var$H = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).event;
2733
-
2734
2422
  function $dc040a17866866fa$var$Z() {}
2735
-
2736
2423
  function $dc040a17866866fa$var$Y() {
2737
2424
  return this.cancelBubble;
2738
2425
  }
2739
-
2740
2426
  function $dc040a17866866fa$var$q() {
2741
2427
  return this.defaultPrevented;
2742
2428
  }
2743
-
2744
2429
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).event = function (n40) {
2745
2430
  return $dc040a17866866fa$var$H && (n40 = $dc040a17866866fa$var$H(n40)), n40.persist = $dc040a17866866fa$var$Z, n40.isPropagationStopped = $dc040a17866866fa$var$Y, n40.isDefaultPrevented = $dc040a17866866fa$var$q, n40.nativeEvent = n40;
2746
2431
  };
2747
-
2748
2432
  var $dc040a17866866fa$var$J = {
2749
- configurable: !0,
2750
- get: function () {
2751
- return this.class;
2752
- }
2753
- },
2754
- $dc040a17866866fa$var$K = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode;
2755
-
2433
+ configurable: !0,
2434
+ get: function () {
2435
+ return this.class;
2436
+ }
2437
+ },
2438
+ $dc040a17866866fa$var$K = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode;
2756
2439
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).vnode = function (n41) {
2757
2440
  var t31 = n41.type,
2758
- e21 = n41.props,
2759
- r14 = e21;
2760
-
2441
+ e21 = n41.props,
2442
+ r14 = e21;
2761
2443
  if ("string" == typeof t31) {
2762
2444
  var u7 = -1 === t31.indexOf("-");
2763
-
2764
2445
  for (var o3 in r14 = {}, e21) {
2765
2446
  var i2 = e21[o3];
2766
2447
  $dc040a17866866fa$var$V && "children" === o3 && "noscript" === t31 || "value" === o3 && "defaultValue" in e21 && null == i2 || ("defaultValue" === o3 && "value" in e21 && null == e21.value ? o3 = "value" : "download" === o3 && !0 === i2 ? i2 = "" : /ondoubleclick/i.test(o3) ? o3 = "ondblclick" : /^onchange(textarea|input)/i.test(o3 + t31) && !$dc040a17866866fa$var$z(e21.type) ? o3 = "oninput" : /^onfocus$/i.test(o3) ? o3 = "onfocusin" : /^onblur$/i.test(o3) ? o3 = "onfocusout" : /^on(Ani|Tra|Tou|BeforeInp)/.test(o3) ? o3 = o3.toLowerCase() : u7 && $dc040a17866866fa$var$P.test(o3) ? o3 = o3.replace(/[A-Z0-9]/, "-$&").toLowerCase() : null === i2 && (i2 = void 0), r14[o3] = i2);
2767
2448
  }
2768
-
2769
2449
  "select" == t31 && r14.multiple && Array.isArray(r14.value) && (r14.value = ($fb96b826c0c5f37a$export$47e4c5b300681277)(e21.children).forEach(function (n42) {
2770
2450
  n42.props.selected = -1 != r14.value.indexOf(n42.props.value);
2771
2451
  })), "select" == t31 && null != r14.defaultValue && (r14.value = ($fb96b826c0c5f37a$export$47e4c5b300681277)(e21.children).forEach(function (n43) {
2772
2452
  n43.props.selected = r14.multiple ? -1 != r14.defaultValue.indexOf(n43.props.value) : r14.defaultValue == n43.props.value;
2773
2453
  })), n41.props = r14, e21.class != e21.className && ($dc040a17866866fa$var$J.enumerable = "className" in e21, null != e21.className && (r14.class = e21.className), Object.defineProperty(r14, "className", $dc040a17866866fa$var$J));
2774
2454
  }
2775
-
2776
2455
  n41.$$typeof = $dc040a17866866fa$var$j, $dc040a17866866fa$var$K && $dc040a17866866fa$var$K(n41);
2777
2456
  };
2778
-
2779
2457
  var $dc040a17866866fa$var$Q = ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r;
2780
-
2781
2458
  ($fb96b826c0c5f37a$export$41c562ebe57d11e2).__r = function (n44) {
2782
2459
  $dc040a17866866fa$var$Q && $dc040a17866866fa$var$Q(n44), n44.__c;
2783
2460
  };
@@ -2785,13 +2462,11 @@ const $ec8c39fdad15601a$var$THEME_ICONS = {
2785
2462
  light: "outline",
2786
2463
  dark: "solid"
2787
2464
  };
2788
-
2789
2465
  class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export$221d75b3f55bb0bd) {
2790
2466
  renderIcon(category) {
2791
2467
  const {
2792
2468
  icon: icon
2793
2469
  } = category;
2794
-
2795
2470
  if (icon) {
2796
2471
  if (icon.svg) return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("span", {
2797
2472
  class: "flex",
@@ -2803,12 +2478,10 @@ class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export
2803
2478
  src: icon.src
2804
2479
  });
2805
2480
  }
2806
-
2807
2481
  const categoryIcons = ($fcccfb36ed0cde68$export$2e2bcd8739ae039).categories[category.id] || ($fcccfb36ed0cde68$export$2e2bcd8739ae039).categories.custom;
2808
2482
  const style = this.props.icons == "auto" ? $ec8c39fdad15601a$var$THEME_ICONS[this.props.theme] : this.props.icons;
2809
2483
  return categoryIcons[style] || categoryIcons;
2810
2484
  }
2811
-
2812
2485
  render() {
2813
2486
  let selectedCategoryIndex = null;
2814
2487
  return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("nav", {
@@ -2848,7 +2521,6 @@ class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export
2848
2521
  })
2849
2522
  });
2850
2523
  }
2851
-
2852
2524
  constructor() {
2853
2525
  super();
2854
2526
  this.categories = ($7adb23b0109cc36a$export$2d0294657ab35f1b).categories.filter(category => {
@@ -2858,29 +2530,22 @@ class $ec8c39fdad15601a$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export
2858
2530
  categoryId: this.categories[0].id
2859
2531
  };
2860
2532
  }
2861
-
2862
2533
  }
2863
-
2864
2534
  class $e0d4dda61265ff1e$export$2e2bcd8739ae039 extends ($dc040a17866866fa$export$221d75b3f55bb0bd) {
2865
2535
  shouldComponentUpdate(nextProps) {
2866
2536
  for (let k in nextProps) {
2867
2537
  if (k == "children") continue;
2868
2538
  if (nextProps[k] != this.props[k]) return true;
2869
2539
  }
2870
-
2871
2540
  return false;
2872
2541
  }
2873
-
2874
2542
  render() {
2875
2543
  return this.props.children;
2876
2544
  }
2877
-
2878
2545
  }
2879
-
2880
2546
  const $89bd6bb200cc8fef$var$Performance = {
2881
2547
  rowsPerRender: 10
2882
2548
  };
2883
-
2884
2549
  class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export$16fa2f45be04daa8) {
2885
2550
  getInitialState(props = this.props) {
2886
2551
  return {
@@ -2888,7 +2553,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
2888
2553
  theme: this.initTheme(props.theme)
2889
2554
  };
2890
2555
  }
2891
-
2892
2556
  componentWillMount() {
2893
2557
  this.dir = ($7adb23b0109cc36a$export$dbe3113d60765c1a).rtl ? "rtl" : "ltr";
2894
2558
  this.refs = {
@@ -2901,17 +2565,14 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
2901
2565
  skinToneRadio: ($fb96b826c0c5f37a$export$7d1e3a5e95ceca43)()
2902
2566
  };
2903
2567
  this.initGrid();
2904
-
2905
2568
  if (this.props.stickySearch == false && this.props.searchPosition == "sticky") {
2906
2569
  console.warn("[EmojiMart] Deprecation warning: `stickySearch` has been renamed `searchPosition`.");
2907
2570
  this.props.searchPosition = "static";
2908
2571
  }
2909
2572
  }
2910
-
2911
2573
  componentDidMount() {
2912
2574
  this.register();
2913
2575
  this.shadowRoot = this.base.parentNode;
2914
-
2915
2576
  if (this.props.autoFocus) {
2916
2577
  const {
2917
2578
  searchInput: searchInput
@@ -2919,32 +2580,25 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
2919
2580
  if (searchInput.current) searchInput.current.focus();
2920
2581
  }
2921
2582
  }
2922
-
2923
2583
  componentWillReceiveProps(nextProps) {
2924
2584
  this.nextState || (this.nextState = {});
2925
-
2926
2585
  for (const k1 in nextProps) this.nextState[k1] = nextProps[k1];
2927
-
2928
2586
  clearTimeout(this.nextStateTimer);
2929
2587
  this.nextStateTimer = setTimeout(() => {
2930
2588
  let requiresGridReset = false;
2931
-
2932
2589
  for (const k in this.nextState) {
2933
2590
  this.props[k] = this.nextState[k];
2934
2591
  if (k === "custom" || k === "categories") requiresGridReset = true;
2935
2592
  }
2936
-
2937
2593
  delete this.nextState;
2938
2594
  const nextState = this.getInitialState();
2939
2595
  if (requiresGridReset) return this.reset(nextState);
2940
2596
  this.setState(nextState);
2941
2597
  });
2942
2598
  }
2943
-
2944
2599
  componentWillUnmount() {
2945
2600
  this.unregister();
2946
2601
  }
2947
-
2948
2602
  async reset(nextState = {}) {
2949
2603
  await ($7adb23b0109cc36a$export$2cd8252107eb640b)(this.props);
2950
2604
  this.initGrid();
@@ -2954,35 +2608,28 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
2954
2608
  this.observeRows();
2955
2609
  });
2956
2610
  }
2957
-
2958
2611
  register() {
2959
2612
  document.addEventListener("click", this.handleClickOutside);
2960
2613
  this.observe();
2961
2614
  }
2962
-
2963
2615
  unregister() {
2964
2616
  document.removeEventListener("click", this.handleClickOutside);
2965
2617
  this.unobserve();
2966
2618
  }
2967
-
2968
2619
  observe() {
2969
2620
  this.observeCategories();
2970
2621
  this.observeRows();
2971
2622
  }
2972
-
2973
2623
  unobserve({
2974
2624
  except = []
2975
2625
  } = {}) {
2976
2626
  if (!Array.isArray(except)) except = [except];
2977
-
2978
2627
  for (const observer of this.observers) {
2979
2628
  if (except.includes(observer)) continue;
2980
2629
  observer.disconnect();
2981
2630
  }
2982
-
2983
2631
  this.observers = [].concat(except);
2984
2632
  }
2985
-
2986
2633
  initGrid() {
2987
2634
  const {
2988
2635
  categories: categories
@@ -2993,7 +2640,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
2993
2640
  this.navKey = navKey;
2994
2641
  this.grid = [];
2995
2642
  this.grid.setsize = 0;
2996
-
2997
2643
  const addRow = (rows, category) => {
2998
2644
  const row = [];
2999
2645
  row.__categoryId = category.id;
@@ -3006,27 +2652,22 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3006
2652
  rows.push(rowRef);
3007
2653
  return row;
3008
2654
  };
3009
-
3010
2655
  for (let category1 of categories) {
3011
2656
  const rows = [];
3012
2657
  let row = addRow(rows, category1);
3013
-
3014
2658
  for (let emoji of category1.emojis) {
3015
2659
  if (row.length == this.getPerLine()) row = addRow(rows, category1);
3016
2660
  this.grid.setsize += 1;
3017
2661
  row.push(emoji);
3018
2662
  }
3019
-
3020
2663
  this.refs.categories.set(category1.id, {
3021
2664
  root: ($fb96b826c0c5f37a$export$7d1e3a5e95ceca43)(),
3022
2665
  rows: rows
3023
2666
  });
3024
2667
  }
3025
2668
  }
3026
-
3027
2669
  initTheme(theme) {
3028
2670
  if (theme != "auto") return theme;
3029
-
3030
2671
  if (!this.darkMedia) {
3031
2672
  this.darkMedia = matchMedia("(prefers-color-scheme: dark)");
3032
2673
  if (this.darkMedia.media.match(/^not/)) return "light";
@@ -3037,24 +2678,20 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3037
2678
  });
3038
2679
  });
3039
2680
  }
3040
-
3041
2681
  return this.darkMedia.matches ? "dark" : "light";
3042
2682
  }
3043
-
3044
2683
  initDynamicPerLine(props = this.props) {
3045
2684
  if (!props.dynamicWidth) return;
3046
2685
  const {
3047
2686
  element: element,
3048
2687
  emojiButtonSize: emojiButtonSize
3049
2688
  } = props;
3050
-
3051
2689
  const calculatePerLine = () => {
3052
2690
  const {
3053
2691
  width: width
3054
2692
  } = element.getBoundingClientRect();
3055
2693
  return Math.floor(width / emojiButtonSize);
3056
2694
  };
3057
-
3058
2695
  const observer = new ResizeObserver(() => {
3059
2696
  this.unobserve({
3060
2697
  except: observer
@@ -3073,29 +2710,24 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3073
2710
  this.observers.push(observer);
3074
2711
  return calculatePerLine();
3075
2712
  }
3076
-
3077
2713
  getPerLine() {
3078
2714
  return this.state.perLine || this.props.perLine;
3079
2715
  }
3080
-
3081
2716
  getEmojiByPos([p1, p2]) {
3082
2717
  const grid = this.state.searchResults || this.grid;
3083
2718
  const emoji = grid[p1] && grid[p1][p2];
3084
2719
  if (!emoji) return;
3085
2720
  return ($c4d155af13ad4d4b$export$2e2bcd8739ae039).get(emoji);
3086
2721
  }
3087
-
3088
2722
  observeCategories() {
3089
2723
  const navigation = this.refs.navigation.current;
3090
2724
  if (!navigation) return;
3091
2725
  const visibleCategories = new Map();
3092
-
3093
2726
  const setFocusedCategory = categoryId => {
3094
2727
  if (categoryId != navigation.state.categoryId) navigation.setState({
3095
2728
  categoryId: categoryId
3096
2729
  });
3097
2730
  };
3098
-
3099
2731
  const observerOptions = {
3100
2732
  root: this.refs.scroll.current,
3101
2733
  threshold: [0.0, 1.0]
@@ -3105,31 +2737,26 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3105
2737
  const id = entry.target.dataset.id;
3106
2738
  visibleCategories.set(id, entry.intersectionRatio);
3107
2739
  }
3108
-
3109
2740
  const ratios = [...visibleCategories];
3110
-
3111
2741
  for (const [id, ratio] of ratios) if (ratio) {
3112
2742
  setFocusedCategory(id);
3113
2743
  break;
3114
2744
  }
3115
2745
  }, observerOptions);
3116
-
3117
2746
  for (const {
3118
2747
  root: root
3119
2748
  } of this.refs.categories.values()) observer.observe(root.current);
3120
-
3121
2749
  this.observers.push(observer);
3122
2750
  }
3123
-
3124
2751
  observeRows() {
3125
- const visibleRows = { ...this.state.visibleRows
2752
+ const visibleRows = {
2753
+ ...this.state.visibleRows
3126
2754
  };
3127
2755
  const observer = new IntersectionObserver(entries => {
3128
2756
  for (const entry of entries) {
3129
2757
  const index = parseInt(entry.target.dataset.index);
3130
2758
  if (entry.isIntersecting) visibleRows[index] = true;else delete visibleRows[index];
3131
2759
  }
3132
-
3133
2760
  this.setState({
3134
2761
  visibleRows: visibleRows
3135
2762
  });
@@ -3137,26 +2764,21 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3137
2764
  root: this.refs.scroll.current,
3138
2765
  rootMargin: `${this.props.emojiButtonSize * ($89bd6bb200cc8fef$var$Performance.rowsPerRender + 5)}px 0px ${this.props.emojiButtonSize * $89bd6bb200cc8fef$var$Performance.rowsPerRender}px`
3139
2766
  });
3140
-
3141
2767
  for (const {
3142
2768
  rows: rows
3143
2769
  } of this.refs.categories.values()) {
3144
2770
  for (const row of rows) if (row.current) observer.observe(row.current);
3145
2771
  }
3146
-
3147
2772
  this.observers.push(observer);
3148
2773
  }
3149
-
3150
2774
  preventDefault(e) {
3151
2775
  e.preventDefault();
3152
2776
  }
3153
-
3154
2777
  unfocusSearch() {
3155
2778
  const input = this.refs.searchInput.current;
3156
2779
  if (!input) return;
3157
2780
  input.blur();
3158
2781
  }
3159
-
3160
2782
  navigate({
3161
2783
  e: e,
3162
2784
  input: input,
@@ -3168,53 +2790,42 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3168
2790
  const grid = this.state.searchResults || this.grid;
3169
2791
  if (!grid.length) return;
3170
2792
  let [p1, p2] = this.state.pos;
3171
-
3172
2793
  const pos = (() => {
3173
2794
  if (p1 == 0) {
3174
2795
  if (p2 == 0 && !e.repeat && (left || up)) return null;
3175
2796
  }
3176
-
3177
2797
  if (p1 == -1) {
3178
2798
  if (!e.repeat && (right || down) && input.selectionStart == input.value.length) return [0, 0];
3179
2799
  return null;
3180
2800
  }
3181
-
3182
2801
  if (left || right) {
3183
2802
  let row = grid[p1];
3184
2803
  const increment = left ? -1 : 1;
3185
2804
  p2 += increment;
3186
-
3187
2805
  if (!row[p2]) {
3188
2806
  p1 += increment;
3189
2807
  row = grid[p1];
3190
-
3191
2808
  if (!row) {
3192
2809
  p1 = left ? 0 : grid.length - 1;
3193
2810
  p2 = left ? 0 : grid[p1].length - 1;
3194
2811
  return [p1, p2];
3195
2812
  }
3196
-
3197
2813
  p2 = left ? row.length - 1 : 0;
3198
2814
  }
3199
-
3200
2815
  return [p1, p2];
3201
2816
  }
3202
-
3203
2817
  if (up || down) {
3204
2818
  p1 += up ? -1 : 1;
3205
2819
  const row = grid[p1];
3206
-
3207
2820
  if (!row) {
3208
2821
  p1 = up ? 0 : grid.length - 1;
3209
2822
  p2 = up ? 0 : grid[p1].length - 1;
3210
2823
  return [p1, p2];
3211
2824
  }
3212
-
3213
2825
  if (!row[p2]) p2 = row.length - 1;
3214
2826
  return [p1, p2];
3215
2827
  }
3216
2828
  })();
3217
-
3218
2829
  if (pos) e.preventDefault();else {
3219
2830
  if (this.state.pos[0] > -1) this.setState({
3220
2831
  pos: [-1, -1]
@@ -3230,7 +2841,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3230
2841
  });
3231
2842
  });
3232
2843
  }
3233
-
3234
2844
  scrollTo({
3235
2845
  categoryId: categoryId,
3236
2846
  row: row
@@ -3241,13 +2851,11 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3241
2851
  const scrollRect = scroll.getBoundingClientRect();
3242
2852
  let scrollTop = 0;
3243
2853
  if (row >= 0) categoryId = grid[row].__categoryId;
3244
-
3245
2854
  if (categoryId) {
3246
2855
  const ref = this.refs[categoryId] || this.refs.categories.get(categoryId).root;
3247
2856
  const categoryRect = ref.current.getBoundingClientRect();
3248
2857
  scrollTop = categoryRect.top - (scrollRect.top - scroll.scrollTop) + 1;
3249
2858
  }
3250
-
3251
2859
  if (row >= 0) {
3252
2860
  if (!row) scrollTop = 0;else {
3253
2861
  const rowIndex = grid[row].__index;
@@ -3256,11 +2864,9 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3256
2864
  if (rowTop < scroll.scrollTop) scrollTop = rowTop;else if (rowBot > scroll.scrollTop + scrollRect.height) scrollTop = rowBot - scrollRect.height;else return;
3257
2865
  }
3258
2866
  }
3259
-
3260
2867
  this.ignoreMouse();
3261
2868
  scroll.scrollTop = scrollTop;
3262
2869
  }
3263
-
3264
2870
  ignoreMouse() {
3265
2871
  this.mouseIsIgnored = true;
3266
2872
  clearTimeout(this.ignoreMouseTimer);
@@ -3268,7 +2874,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3268
2874
  delete this.mouseIsIgnored;
3269
2875
  }, 100);
3270
2876
  }
3271
-
3272
2877
  handleEmojiOver(pos) {
3273
2878
  if (this.mouseIsIgnored || this.state.showSkins) return;
3274
2879
  this.setState({
@@ -3276,7 +2881,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3276
2881
  keyboard: false
3277
2882
  });
3278
2883
  }
3279
-
3280
2884
  handleEmojiClick({
3281
2885
  e: e,
3282
2886
  emoji: emoji,
@@ -3284,7 +2888,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3284
2888
  }) {
3285
2889
  if (!this.props.onEmojiSelect) return;
3286
2890
  if (!emoji && pos) emoji = this.getEmojiByPos(pos);
3287
-
3288
2891
  if (emoji) {
3289
2892
  const emojiData = ($693b183b0a78708f$export$d10ac59fbe52a745)(emoji, {
3290
2893
  skinIndex: this.state.skin - 1
@@ -3293,7 +2896,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3293
2896
  this.props.onEmojiSelect(emojiData, e);
3294
2897
  }
3295
2898
  }
3296
-
3297
2899
  closeSkins() {
3298
2900
  if (!this.state.showSkins) return;
3299
2901
  this.setState({
@@ -3303,13 +2905,11 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3303
2905
  this.base.removeEventListener("click", this.handleBaseClick);
3304
2906
  this.base.removeEventListener("keydown", this.handleBaseKeydown);
3305
2907
  }
3306
-
3307
2908
  handleSkinMouseOver(tempSkin) {
3308
2909
  this.setState({
3309
2910
  tempSkin: tempSkin
3310
2911
  });
3311
2912
  }
3312
-
3313
2913
  handleSkinClick(skin) {
3314
2914
  this.ignoreMouse();
3315
2915
  this.closeSkins();
@@ -3319,7 +2919,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3319
2919
  });
3320
2920
  ($f72b75cf796873c7$export$2e2bcd8739ae039).set("skin", skin);
3321
2921
  }
3322
-
3323
2922
  renderNav() {
3324
2923
  return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($ec8c39fdad15601a$export$2e2bcd8739ae039), {
3325
2924
  ref: this.refs.navigation,
@@ -3331,7 +2930,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3331
2930
  onClick: this.handleCategoryClick
3332
2931
  }, this.navKey);
3333
2932
  }
3334
-
3335
2933
  renderPreview() {
3336
2934
  const emoji = this.getEmojiByPos(this.state.pos);
3337
2935
  const noSearchResults = this.state.searchResults && !this.state.searchResults.length;
@@ -3376,7 +2974,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3376
2974
  }), !emoji && this.props.skinTonePosition == "preview" && this.renderSkinToneButton()]
3377
2975
  });
3378
2976
  }
3379
-
3380
2977
  renderEmojiButton(emoji, {
3381
2978
  pos: pos,
3382
2979
  posinset: posinset,
@@ -3432,7 +3029,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3432
3029
  })
3433
3030
  }, key);
3434
3031
  }
3435
-
3436
3032
  renderSearch() {
3437
3033
  const renderSkinTone = this.props.previewPosition == "none" || this.props.skinTonePosition == "search";
3438
3034
  return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("div", {
@@ -3466,7 +3062,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3466
3062
  })]
3467
3063
  });
3468
3064
  }
3469
-
3470
3065
  renderSearchResults() {
3471
3066
  const {
3472
3067
  searchResults: searchResults
@@ -3500,7 +3095,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3500
3095
  })]
3501
3096
  });
3502
3097
  }
3503
-
3504
3098
  renderCategories() {
3505
3099
  const {
3506
3100
  categories: categories
@@ -3567,7 +3161,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3567
3161
  })
3568
3162
  });
3569
3163
  }
3570
-
3571
3164
  renderSkinToneButton() {
3572
3165
  if (this.props.skinTonePosition == "none") return null;
3573
3166
  return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("div", {
@@ -3595,7 +3188,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3595
3188
  })
3596
3189
  });
3597
3190
  }
3598
-
3599
3191
  renderLiveRegion() {
3600
3192
  const emoji = this.getEmojiByPos(this.state.pos);
3601
3193
  const contents = emoji ? emoji.name : "";
@@ -3605,7 +3197,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3605
3197
  children: contents
3606
3198
  });
3607
3199
  }
3608
-
3609
3200
  renderSkins() {
3610
3201
  const skinToneButton = this.refs.skinToneButton.current;
3611
3202
  const skinToneButtonRect = skinToneButton.getBoundingClientRect();
@@ -3660,7 +3251,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3660
3251
  })
3661
3252
  });
3662
3253
  }
3663
-
3664
3254
  render() {
3665
3255
  const lineWidth = this.props.perLine * this.props.emojiButtonSize;
3666
3256
  return /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)("section", {
@@ -3689,14 +3279,12 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3689
3279
  }), this.props.navPosition == "bottom" && this.renderNav(), this.props.previewPosition == "bottom" && this.renderPreview(), this.state.showSkins && this.renderSkins(), this.renderLiveRegion()]
3690
3280
  });
3691
3281
  }
3692
-
3693
3282
  constructor(props) {
3694
3283
  super();
3695
3284
  ($c770c458706daa72$export$2e2bcd8739ae039)(this, "handleClickOutside", e => {
3696
3285
  const {
3697
3286
  element: element
3698
3287
  } = this.props;
3699
-
3700
3288
  if (e.target != element) {
3701
3289
  if (this.state.showSkins) this.closeSkins();
3702
3290
  if (this.props.onClickOutside) this.props.onClickOutside(e);
@@ -3704,7 +3292,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3704
3292
  });
3705
3293
  ($c770c458706daa72$export$2e2bcd8739ae039)(this, "handleBaseClick", e => {
3706
3294
  if (!this.state.showSkins) return;
3707
-
3708
3295
  if (!e.target.closest(".menu")) {
3709
3296
  e.preventDefault();
3710
3297
  e.stopImmediatePropagation();
@@ -3713,7 +3300,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3713
3300
  });
3714
3301
  ($c770c458706daa72$export$2e2bcd8739ae039)(this, "handleBaseKeydown", e => {
3715
3302
  if (!this.state.showSkins) return;
3716
-
3717
3303
  if (e.key == "Escape") {
3718
3304
  e.preventDefault();
3719
3305
  e.stopImmediatePropagation();
@@ -3734,12 +3320,10 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3734
3320
  value: value
3735
3321
  } = input;
3736
3322
  const searchResults = await ($c4d155af13ad4d4b$export$2e2bcd8739ae039).search(value);
3737
-
3738
3323
  const afterRender = () => {
3739
3324
  if (!this.refs.scroll.current) return;
3740
3325
  this.refs.scroll.current.scrollTop = 0;
3741
3326
  };
3742
-
3743
3327
  if (!searchResults) return this.setState({
3744
3328
  searchResults: searchResults,
3745
3329
  pos: [-1, -1]
@@ -3748,7 +3332,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3748
3332
  const grid = [];
3749
3333
  grid.setsize = searchResults.length;
3750
3334
  let row = null;
3751
-
3752
3335
  for (let emoji of searchResults) {
3753
3336
  if (!grid.length || row.length == this.getPerLine()) {
3754
3337
  row = [];
@@ -3756,10 +3339,8 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3756
3339
  row.__index = grid.length;
3757
3340
  grid.push(row);
3758
3341
  }
3759
-
3760
3342
  row.push(emoji);
3761
3343
  }
3762
-
3763
3344
  this.ignoreMouse();
3764
3345
  this.setState({
3765
3346
  searchResults: grid,
@@ -3770,7 +3351,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3770
3351
  // const specialKey = e.altKey || e.ctrlKey || e.metaKey
3771
3352
  const input = e.currentTarget;
3772
3353
  e.stopImmediatePropagation();
3773
-
3774
3354
  switch (e.key) {
3775
3355
  case "ArrowLeft":
3776
3356
  // if (specialKey) return
@@ -3781,7 +3361,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3781
3361
  left: true
3782
3362
  });
3783
3363
  break;
3784
-
3785
3364
  case "ArrowRight":
3786
3365
  // if (specialKey) return
3787
3366
  // e.preventDefault()
@@ -3791,7 +3370,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3791
3370
  right: true
3792
3371
  });
3793
3372
  break;
3794
-
3795
3373
  case "ArrowUp":
3796
3374
  // if (specialKey) return
3797
3375
  // e.preventDefault()
@@ -3801,7 +3379,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3801
3379
  up: true
3802
3380
  });
3803
3381
  break;
3804
-
3805
3382
  case "ArrowDown":
3806
3383
  // if (specialKey) return
3807
3384
  // e.preventDefault()
@@ -3811,7 +3388,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3811
3388
  down: true
3812
3389
  });
3813
3390
  break;
3814
-
3815
3391
  case "Enter":
3816
3392
  e.preventDefault();
3817
3393
  this.handleEmojiClick({
@@ -3819,7 +3395,6 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3819
3395
  pos: this.state.pos
3820
3396
  });
3821
3397
  break;
3822
-
3823
3398
  case "Escape":
3824
3399
  e.preventDefault();
3825
3400
  if (this.state.searchResults) this.clearSearch();else this.unfocusSearch();
@@ -3871,32 +3446,26 @@ class $89bd6bb200cc8fef$export$2e2bcd8739ae039 extends ($fb96b826c0c5f37a$export
3871
3446
  ...this.getInitialState(props)
3872
3447
  };
3873
3448
  }
3874
-
3875
3449
  }
3876
-
3877
3450
  class $efa000751917694d$export$2e2bcd8739ae039 extends ($26f27c338a96b1a6$export$2e2bcd8739ae039) {
3878
3451
  async connectedCallback() {
3879
3452
  const props = ($7adb23b0109cc36a$export$75fe5f91d452f94b)(this.props, ($b247ea80b67298d5$export$2e2bcd8739ae039), this);
3880
3453
  props.element = this;
3881
-
3882
3454
  props.ref = component => {
3883
3455
  this.component = component;
3884
3456
  };
3885
-
3886
3457
  await ($7adb23b0109cc36a$export$2cd8252107eb640b)(props);
3887
3458
  if (this.disconnected) return;
3888
- ($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($89bd6bb200cc8fef$export$2e2bcd8739ae039), { ...props
3459
+ ($fb96b826c0c5f37a$export$b3890eb0ae9dca99)( /*#__PURE__*/($bd9dd35321b03dd4$export$34b9dba7ce09269b)(($89bd6bb200cc8fef$export$2e2bcd8739ae039), {
3460
+ ...props
3889
3461
  }), this.shadowRoot);
3890
3462
  }
3891
-
3892
3463
  constructor(props) {
3893
3464
  super(props, {
3894
3465
  styles: (/*@__PURE__*/$parcel$interopDefault($329d53ba9fd7125f$exports))
3895
3466
  });
3896
3467
  }
3897
-
3898
3468
  }
3899
-
3900
3469
  ($c770c458706daa72$export$2e2bcd8739ae039)($efa000751917694d$export$2e2bcd8739ae039, "Props", ($b247ea80b67298d5$export$2e2bcd8739ae039));
3901
3470
  if (typeof customElements !== "undefined" && !customElements.get("em-emoji-picker")) customElements.define("em-emoji-picker", $efa000751917694d$export$2e2bcd8739ae039);
3902
3471
  var $329d53ba9fd7125f$exports = {};
@@ -3907,7 +3476,8 @@ function $e5534fc185f7111e$export$2e2bcd8739ae039(props) {
3907
3476
  const instance = (useRef)(null);
3908
3477
  if (instance.current) instance.current.update(props);
3909
3478
  (useEffect)(() => {
3910
- instance.current = new ($efa000751917694d$export$2e2bcd8739ae039)({ ...props,
3479
+ instance.current = new ($efa000751917694d$export$2e2bcd8739ae039)({
3480
+ ...props,
3911
3481
  ref: ref
3912
3482
  });
3913
3483
  return () => {
@@ -3933,23 +3503,20 @@ function $e5534fc185f7111e$export$2e2bcd8739ae039(props) {
3933
3503
  * @param {Props} props
3934
3504
  * @return {React.FC}
3935
3505
  */
3936
-
3937
3506
  function EmojiPicker(props) {
3938
3507
  var theme = props.theme,
3939
- onSelectEmoji = props.onSelectEmoji,
3940
- disableRecent = props.disableRecent,
3941
- customEmojis = props.customEmojis,
3942
- language = props.language;
3943
- /** @type {string[]} */
3508
+ onSelectEmoji = props.onSelectEmoji,
3509
+ disableRecent = props.disableRecent,
3510
+ customEmojis = props.customEmojis,
3511
+ language = props.language;
3944
3512
 
3513
+ /** @type {string[]} */
3945
3514
  var categories = useMemo(function () {
3946
3515
  /** @type {string[]} */
3947
3516
  var categoryies = [];
3948
-
3949
3517
  if (!disableRecent) {
3950
3518
  categoryies.push("frequent");
3951
3519
  }
3952
-
3953
3520
  categoryies = [].concat(_toConsumableArray(categoryies), ["people", "nature", "foods", "activity", "places", "objects", "symbols", "flags"]);
3954
3521
  return categoryies;
3955
3522
  }, [disableRecent]);
@@ -3957,7 +3524,6 @@ function EmojiPicker(props) {
3957
3524
  if (!language) {
3958
3525
  return undefined;
3959
3526
  }
3960
-
3961
3527
  return require("@emoji-mart/data/i18n/".concat(language !== null && language !== void 0 ? language : 'en', ".json"));
3962
3528
  }, [language]);
3963
3529
  return /*#__PURE__*/React.createElement($e5534fc185f7111e$export$2e2bcd8739ae039, {
@@ -3971,7 +3537,6 @@ function EmojiPicker(props) {
3971
3537
  i18n: i18n
3972
3538
  });
3973
3539
  }
3974
-
3975
3540
  var EmojiPicker$1 = /*#__PURE__*/memo(EmojiPicker);
3976
3541
 
3977
3542
  /**
@@ -3990,15 +3555,14 @@ var EmojiPicker$1 = /*#__PURE__*/memo(EmojiPicker);
3990
3555
  * @param {Props} props
3991
3556
  * @return {JSX.Element}
3992
3557
  */
3993
-
3994
3558
  function EmojiPickerContainer(_ref) {
3995
3559
  var showPicker = _ref.showPicker,
3996
- theme = _ref.theme,
3997
- handleSelectEmoji = _ref.handleSelectEmoji,
3998
- disableRecent = _ref.disableRecent,
3999
- customEmojis = _ref.customEmojis,
4000
- position = _ref.position,
4001
- language = _ref.language;
3560
+ theme = _ref.theme,
3561
+ handleSelectEmoji = _ref.handleSelectEmoji,
3562
+ disableRecent = _ref.disableRecent,
3563
+ customEmojis = _ref.customEmojis,
3564
+ position = _ref.position,
3565
+ language = _ref.language;
4002
3566
  return /*#__PURE__*/React.createElement("div", {
4003
3567
  className: "react-emoji-picker--container"
4004
3568
  }, showPicker && /*#__PURE__*/React.createElement("div", {
@@ -4021,6 +3585,7 @@ function EmojiPickerContainer(_ref) {
4021
3585
  }
4022
3586
 
4023
3587
  var EMOJI_PICKER_CONTAINER_HEIGHT = 435;
3588
+
4024
3589
  /**
4025
3590
  * @typedef {import('../types/types').SanitizeFn} SanitizeFn
4026
3591
  */
@@ -4039,42 +3604,37 @@ var EMOJI_PICKER_CONTAINER_HEIGHT = 435;
4039
3604
  * @property {(fn: PolluteFn) => void} addPolluteFn
4040
3605
  * @property {(html: string) => void} appendContent
4041
3606
  * @property {HTMLDivElement=} buttonElement
3607
+ * @property {React.MutableRefObject=} buttonRef
4042
3608
  * @property {import('../types/types').Languages=} language
4043
3609
  */
4044
- // eslint-disable-next-line valid-jsdoc
4045
3610
 
3611
+ // eslint-disable-next-line valid-jsdoc
4046
3612
  /** @type {React.FC<Props>} */
4047
-
4048
3613
  var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
4049
3614
  var theme = props.theme,
4050
- keepOpened = props.keepOpened,
4051
- disableRecent = props.disableRecent,
4052
- customEmojis = props.customEmojis,
4053
- addSanitizeFn = props.addSanitizeFn,
4054
- addPolluteFn = props.addPolluteFn,
4055
- appendContent = props.appendContent,
4056
- buttonElement = props.buttonElement,
4057
- language = props.language;
4058
-
3615
+ keepOpened = props.keepOpened,
3616
+ disableRecent = props.disableRecent,
3617
+ customEmojis = props.customEmojis,
3618
+ addSanitizeFn = props.addSanitizeFn,
3619
+ addPolluteFn = props.addPolluteFn,
3620
+ appendContent = props.appendContent,
3621
+ buttonElement = props.buttonElement,
3622
+ buttonRef = props.buttonRef,
3623
+ language = props.language;
4059
3624
  var _useState = useState(false),
4060
- _useState2 = _slicedToArray(_useState, 2),
4061
- showPicker = _useState2[0],
4062
- setShowPicker = _useState2[1];
3625
+ _useState2 = _slicedToArray(_useState, 2),
3626
+ showPicker = _useState2[0],
3627
+ setShowPicker = _useState2[1];
4063
3628
  /** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */
4064
-
4065
-
4066
3629
  var _useState3 = useState(),
4067
- _useState4 = _slicedToArray(_useState3, 2),
4068
- customButton = _useState4[0],
4069
- setCustomButton = _useState4[1];
3630
+ _useState4 = _slicedToArray(_useState3, 2),
3631
+ customButton = _useState4[0],
3632
+ setCustomButton = _useState4[1];
4070
3633
  /** @type {['above' | 'below' | undefined, React.Dispatch<React.SetStateAction<'above' | 'below' | undefined>>]} */
4071
-
4072
-
4073
3634
  var _useState5 = useState(),
4074
- _useState6 = _slicedToArray(_useState5, 2),
4075
- emojiPickerPosition = _useState6[0],
4076
- setEmojiPickerPosition = _useState6[1];
4077
-
3635
+ _useState6 = _slicedToArray(_useState5, 2),
3636
+ emojiPickerPosition = _useState6[0],
3637
+ setEmojiPickerPosition = _useState6[1];
4078
3638
  useEffect(function () {
4079
3639
  addSanitizeFn(replaceAllTextEmojiToString);
4080
3640
  }, [addSanitizeFn]);
@@ -4090,24 +3650,21 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
4090
3650
  /** @type {HTMLElement} */
4091
3651
  // @ts-ignore
4092
3652
  var element = event.target;
4093
-
4094
3653
  if (element.classList.contains("react-input-emoji--button") || element.classList.contains("react-input-emoji--button--icon")) {
4095
3654
  return;
4096
3655
  }
4097
-
4098
3656
  setShowPicker(false);
4099
3657
  }
4100
-
4101
3658
  document.addEventListener("click", checkClickOutside);
4102
3659
  return function () {
4103
3660
  document.removeEventListener("click", checkClickOutside);
4104
3661
  };
4105
3662
  }, []);
3663
+
4106
3664
  /**
4107
3665
  *
4108
3666
  * @param {React.MouseEvent} event
4109
3667
  */
4110
-
4111
3668
  function toggleShowPicker(event) {
4112
3669
  event.stopPropagation();
4113
3670
  event.preventDefault();
@@ -4116,18 +3673,18 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
4116
3673
  return !currentShowPicker;
4117
3674
  });
4118
3675
  }
3676
+
4119
3677
  /**
4120
3678
  *
4121
3679
  * @param {React.MouseEvent} event
4122
3680
  * @return {'above' | 'below'}
4123
3681
  */
4124
-
4125
-
4126
3682
  function calcTopPosition(event) {
4127
3683
  var btn = event.currentTarget;
4128
3684
  var btnRect = btn.getBoundingClientRect();
4129
- var popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT; // Decide to display above or below based on available space
3685
+ var popoverHeight = EMOJI_PICKER_CONTAINER_HEIGHT;
4130
3686
 
3687
+ // Decide to display above or below based on available space
4131
3688
  if (btnRect.top >= popoverHeight) {
4132
3689
  // Display above
4133
3690
  return 'above';
@@ -4135,30 +3692,31 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
4135
3692
  // Display below
4136
3693
  return 'below';
4137
3694
  }
4138
- } // eslint-disable-next-line valid-jsdoc
3695
+ }
4139
3696
 
3697
+ // eslint-disable-next-line valid-jsdoc
4140
3698
  /**
4141
3699
  *
4142
3700
  * @param {import("../types/types").EmojiMartItem} emoji
4143
3701
  */
4144
-
4145
-
4146
3702
  function handleSelectEmoji(emoji) {
4147
3703
  appendContent(getImageEmoji(emoji));
4148
-
4149
3704
  if (!keepOpened) {
4150
3705
  setShowPicker(function (currentShowPicker) {
4151
3706
  return !currentShowPicker;
4152
3707
  });
4153
3708
  }
4154
3709
  }
4155
-
4156
3710
  useEffect(function () {
4157
- if (buttonElement !== null && buttonElement !== void 0 && buttonElement.style) {
3711
+ var _buttonRef$current;
3712
+ if (buttonRef !== null && buttonRef !== void 0 && (_buttonRef$current = buttonRef.current) !== null && _buttonRef$current !== void 0 && _buttonRef$current.style) {
3713
+ buttonRef.current.style.position = "relative";
3714
+ setCustomButton(buttonRef.current);
3715
+ } else if (buttonElement !== null && buttonElement !== void 0 && buttonElement.style) {
4158
3716
  buttonElement.style.position = "relative";
4159
3717
  setCustomButton(buttonElement);
4160
3718
  }
4161
- }, [buttonElement]);
3719
+ }, [buttonRef, buttonElement]);
4162
3720
  return customButton ? /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EmojiPickerContainer, {
4163
3721
  showPicker: showPicker,
4164
3722
  theme: theme,
@@ -4170,7 +3728,8 @@ var EmojiPickerWrapper = function EmojiPickerWrapper(props) {
4170
3728
  }), /*#__PURE__*/React.createElement(EmojiPickerButton, {
4171
3729
  showPicker: showPicker,
4172
3730
  toggleShowPicker: toggleShowPicker,
4173
- buttonElement: customButton
3731
+ buttonElement: customButton,
3732
+ buttonRef: buttonRef
4174
3733
  })), customButton) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EmojiPickerContainer, {
4175
3734
  showPicker: showPicker,
4176
3735
  theme: theme,
@@ -4196,37 +3755,34 @@ function getTextFromAtToCaret() {
4196
3755
  if (!range) return null;
4197
3756
  var text = range.text.substring(range.begin, range.end);
4198
3757
  return text || null;
4199
- } // eslint-disable-next-line valid-jsdoc
3758
+ }
4200
3759
 
3760
+ // eslint-disable-next-line valid-jsdoc
4201
3761
  /** */
4202
-
4203
3762
  function deleteTextFromAtToCaret() {
4204
3763
  var range = getRangeFromAtToCaret();
4205
- if (!range) return; // @ts-ignore
3764
+ if (!range) return;
4206
3765
 
3766
+ // @ts-ignore
4207
3767
  range.element.deleteData(range.begin, range.end - range.begin);
4208
3768
  }
3769
+
4209
3770
  /**
4210
3771
  *
4211
3772
  * @return {{begin: number, end: number, text: string, element: Node} | null}
4212
3773
  */
4213
-
4214
3774
  function getRangeFromAtToCaret() {
4215
3775
  var elementWithFocus = getElementWithFocus();
4216
-
4217
3776
  if (!elementWithFocus) {
4218
3777
  return null;
4219
3778
  }
4220
-
4221
3779
  var element = elementWithFocus.element,
4222
- caretOffset = elementWithFocus.caretOffset;
3780
+ caretOffset = elementWithFocus.caretOffset;
4223
3781
  var text = element.textContent;
4224
3782
  var lastAt = text.lastIndexOf("@");
4225
-
4226
3783
  if (lastAt === -1 || lastAt >= caretOffset || lastAt !== 0 && text[lastAt - 1] !== " ") {
4227
3784
  return null;
4228
3785
  }
4229
-
4230
3786
  return {
4231
3787
  begin: lastAt,
4232
3788
  end: caretOffset,
@@ -4234,49 +3790,46 @@ function getRangeFromAtToCaret() {
4234
3790
  element: element
4235
3791
  };
4236
3792
  }
3793
+
4237
3794
  /**
4238
3795
  *
4239
3796
  * @return {{element: Node, caretOffset: number}}
4240
3797
  */
4241
-
4242
-
4243
3798
  function getElementWithFocus() {
4244
3799
  var element = getSelectionStart();
4245
-
4246
3800
  if (element === null) {
4247
3801
  return null;
4248
3802
  }
4249
-
4250
3803
  var caretOffset = 0;
4251
-
4252
3804
  if (typeof window.getSelection != "undefined") {
4253
3805
  var range = window.getSelection().getRangeAt(0);
4254
3806
  var preCaretRange = range.cloneRange();
4255
3807
  preCaretRange.selectNodeContents(element);
4256
3808
  preCaretRange.setEnd(range.endContainer, range.endOffset);
4257
3809
  caretOffset = preCaretRange.toString().length;
4258
- } else if ( // @ts-ignore
4259
- typeof document.selection != "undefined" && // @ts-ignore
3810
+ } else if (
3811
+ // @ts-ignore
3812
+ typeof document.selection != "undefined" &&
3813
+ // @ts-ignore
4260
3814
  document.selection.type != "Control") {
4261
3815
  // @ts-ignore
4262
- var textRange = document.selection.createRange(); // @ts-ignore
4263
-
3816
+ var textRange = document.selection.createRange();
3817
+ // @ts-ignore
4264
3818
  var preCaretTextRange = document.body.createTextRange();
4265
3819
  preCaretTextRange.moveToElementText(element);
4266
3820
  preCaretTextRange.setEndPoint("EndToEnd", textRange);
4267
3821
  caretOffset = preCaretTextRange.text.length;
4268
3822
  }
4269
-
4270
3823
  return {
4271
3824
  element: element,
4272
3825
  caretOffset: caretOffset
4273
3826
  };
4274
3827
  }
3828
+
4275
3829
  /**
4276
3830
  *
4277
3831
  * @return {Node | null}
4278
3832
  */
4279
-
4280
3833
  function getSelectionStart() {
4281
3834
  var node = document.getSelection().anchorNode;
4282
3835
  return (node === null || node === void 0 ? void 0 : node.nodeType) == 3 ? node : null;
@@ -4285,113 +3838,93 @@ function getSelectionStart() {
4285
3838
  /**
4286
3839
  * @typedef {import('../types/types').MentionUser} MentionUser
4287
3840
  */
4288
- // eslint-disable-next-line valid-jsdoc
4289
3841
 
3842
+ // eslint-disable-next-line valid-jsdoc
4290
3843
  /**
4291
3844
  *
4292
3845
  * @param {(text: string) => Promise<MentionUser[]>=} searchMention
4293
3846
  * @returns {{mentionSearchText: string | null, mentionUsers: MentionUser[], onKeyUp: (event: React.KeyboardEvent) => void, onFocus: () => void, onSelectUser: () => void, loading: boolean}}
4294
3847
  */
4295
-
4296
3848
  function useMention(searchMention) {
3849
+ var _ref2;
4297
3850
  var _useState = useState(false),
4298
- _useState2 = _slicedToArray(_useState, 2),
4299
- loading = _useState2[0],
4300
- setLoading = _useState2[1];
4301
- /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */
4302
-
3851
+ _useState2 = _slicedToArray(_useState, 2),
3852
+ loading = _useState2[0],
3853
+ setLoading = _useState2[1];
4303
3854
 
3855
+ /** @type {[MentionUser[], React.Dispatch<React.SetStateAction<MentionUser[]>>]} */
4304
3856
  var _useState3 = useState([]),
4305
- _useState4 = _slicedToArray(_useState3, 2),
4306
- mentionUsers = _useState4[0],
4307
- setMentionUsers = _useState4[1];
4308
- /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */
4309
-
3857
+ _useState4 = _slicedToArray(_useState3, 2),
3858
+ mentionUsers = _useState4[0],
3859
+ setMentionUsers = _useState4[1];
4310
3860
 
3861
+ /** @type {[string | null, React.Dispatch<React.SetStateAction<string | null>>]} */
4311
3862
  var _useState5 = useState(null),
4312
- _useState6 = _slicedToArray(_useState5, 2),
4313
- mentionSearchText = _useState6[0],
4314
- setMentionSearchText = _useState6[1];
4315
-
3863
+ _useState6 = _slicedToArray(_useState5, 2),
3864
+ mentionSearchText = _useState6[0],
3865
+ setMentionSearchText = _useState6[1];
4316
3866
  var onSelectUser = useCallback(function () {
4317
3867
  deleteTextFromAtToCaret();
4318
3868
  setMentionUsers([]);
4319
3869
  }, []);
4320
- /** */
4321
3870
 
3871
+ /** */
4322
3872
  var checkMentionText = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
4323
3873
  var metionText, users;
4324
3874
  return _regeneratorRuntime().wrap(function _callee$(_context) {
4325
- while (1) {
4326
- switch (_context.prev = _context.next) {
4327
- case 0:
4328
- metionText = getTextFromAtToCaret();
4329
- setMentionSearchText(metionText);
4330
-
4331
- if (!(metionText === null)) {
4332
- _context.next = 6;
4333
- break;
4334
- }
4335
-
4336
- setMentionUsers([]);
4337
- _context.next = 12;
3875
+ while (1) switch (_context.prev = _context.next) {
3876
+ case 0:
3877
+ metionText = getTextFromAtToCaret();
3878
+ setMentionSearchText(metionText);
3879
+ if (!(metionText === null)) {
3880
+ _context.next = 6;
4338
3881
  break;
4339
-
4340
- case 6:
4341
- setLoading(true);
4342
- _context.next = 9;
4343
- return searchMention(metionText);
4344
-
4345
- case 9:
4346
- users = _context.sent;
4347
- setLoading(false);
4348
- setMentionUsers(users);
4349
-
4350
- case 12:
4351
- case "end":
4352
- return _context.stop();
4353
- }
3882
+ }
3883
+ setMentionUsers([]);
3884
+ _context.next = 12;
3885
+ break;
3886
+ case 6:
3887
+ setLoading(true);
3888
+ _context.next = 9;
3889
+ return searchMention(metionText);
3890
+ case 9:
3891
+ users = _context.sent;
3892
+ setLoading(false);
3893
+ setMentionUsers(users);
3894
+ case 12:
3895
+ case "end":
3896
+ return _context.stop();
4354
3897
  }
4355
3898
  }, _callee);
4356
3899
  })), [searchMention]);
4357
- /** @type {(event: React.KeyboardEvent) => void} */
4358
3900
 
4359
- var onKeyUp = useCallback( /*#__PURE__*/function () {
4360
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
3901
+ /** @type {(event: React.KeyboardEvent) => void} */
3902
+ var onKeyUp = useCallback(function (_x) {
3903
+ return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(event) {
4361
3904
  var _getElementWithFocus;
4362
-
4363
3905
  var elementWithFocus;
4364
3906
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
4365
- while (1) {
4366
- switch (_context2.prev = _context2.next) {
4367
- case 0:
4368
- if (!(typeof searchMention !== "function")) {
4369
- _context2.next = 2;
4370
- break;
4371
- }
4372
-
4373
- return _context2.abrupt("return");
4374
-
4375
- case 2:
4376
- if (event.key === "Backspace" && (_getElementWithFocus = getElementWithFocus()) !== null && _getElementWithFocus !== void 0 && _getElementWithFocus.element.parentElement.hasAttribute("data-mention-id")) {
4377
- elementWithFocus = getElementWithFocus();
4378
- elementWithFocus.element.parentElement.remove();
4379
- } else if (!["ArrowUp", "ArrowDown", "Esc", "Escape"].includes(event.key)) {
4380
- checkMentionText();
4381
- }
4382
-
4383
- case 3:
4384
- case "end":
4385
- return _context2.stop();
4386
- }
3907
+ while (1) switch (_context2.prev = _context2.next) {
3908
+ case 0:
3909
+ if (!(typeof searchMention !== "function")) {
3910
+ _context2.next = 2;
3911
+ break;
3912
+ }
3913
+ return _context2.abrupt("return");
3914
+ case 2:
3915
+ if (event.key === "Backspace" && (_getElementWithFocus = getElementWithFocus()) !== null && _getElementWithFocus !== void 0 && _getElementWithFocus.element.parentElement.hasAttribute("data-mention-id")) {
3916
+ elementWithFocus = getElementWithFocus();
3917
+ elementWithFocus.element.parentElement.remove();
3918
+ } else if (!["ArrowUp", "ArrowDown", "Esc", "Escape"].includes(event.key)) {
3919
+ checkMentionText();
3920
+ }
3921
+ case 3:
3922
+ case "end":
3923
+ return _context2.stop();
4387
3924
  }
4388
3925
  }, _callee2);
4389
- }));
4390
-
4391
- return function (_x) {
4392
- return _ref2.apply(this, arguments);
4393
- };
4394
- }(), [checkMentionText, searchMention]);
3926
+ }))).apply(this, arguments);
3927
+ }, [checkMentionText, searchMention]);
4395
3928
  var onFocus = useCallback(function () {
4396
3929
  checkMentionText();
4397
3930
  }, [checkMentionText]);
@@ -4424,21 +3957,18 @@ function useMention(searchMention) {
4424
3957
  /**
4425
3958
  * @typedef {{prevUser: () => void; nextUser: () => void;}} Ref
4426
3959
  */
4427
- // eslint-disable-next-line valid-jsdoc
4428
3960
 
3961
+ // eslint-disable-next-line valid-jsdoc
4429
3962
  /** @type {React.ForwardRefRenderFunction<Ref, Props>} */
4430
-
4431
3963
  var MentionUserList = function MentionUserList(_ref, ref) {
4432
3964
  var users = _ref.users,
4433
- mentionSearchText = _ref.mentionSearchText,
4434
- onSelect = _ref.onSelect,
4435
- addEventListener = _ref.addEventListener;
4436
-
3965
+ mentionSearchText = _ref.mentionSearchText,
3966
+ onSelect = _ref.onSelect,
3967
+ addEventListener = _ref.addEventListener;
4437
3968
  var _useState = useState(0),
4438
- _useState2 = _slicedToArray(_useState, 2),
4439
- selectedUser = _useState2[0],
4440
- setSelectedUser = _useState2[1];
4441
-
3969
+ _useState2 = _slicedToArray(_useState, 2),
3970
+ selectedUser = _useState2[0],
3971
+ setSelectedUser = _useState2[1];
4442
3972
  useImperativeHandle(ref, function () {
4443
3973
  return {
4444
3974
  prevUser: function prevUser() {
@@ -4446,7 +3976,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4446
3976
  if (currentSelectedUser === 0) {
4447
3977
  return 0;
4448
3978
  }
4449
-
4450
3979
  return currentSelectedUser - 1;
4451
3980
  });
4452
3981
  },
@@ -4455,7 +3984,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4455
3984
  if (currentSelectedUser === users.length - 1) {
4456
3985
  return users.length - 1;
4457
3986
  }
4458
-
4459
3987
  return currentSelectedUser + 1;
4460
3988
  });
4461
3989
  }
@@ -4464,24 +3992,22 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4464
3992
  useEffect(function () {
4465
3993
  setSelectedUser(0);
4466
3994
  }, [users]);
3995
+
4467
3996
  /**
4468
3997
  *
4469
3998
  * @param {string} selectedText
4470
3999
  * @param {string} rest
4471
4000
  * @return {string}
4472
4001
  */
4473
-
4474
4002
  function getMentionSelectedNameEl(selectedText, rest) {
4475
4003
  return "<span class=\"react-input-emoji--mention--item--name__selected\" data-testid=\"metion-selected-word\">".concat(selectedText, "</span>").concat(rest);
4476
4004
  }
4477
- /** @type {(MentionUser & {nameHtml: string})[]} */
4478
-
4479
4005
 
4006
+ /** @type {(MentionUser & {nameHtml: string})[]} */
4480
4007
  var usersFiltered = useMemo(function () {
4481
4008
  var searchText = mentionSearchText ? mentionSearchText.substring(1).toLocaleLowerCase() : "";
4482
4009
  return users.map(function (user) {
4483
4010
  var nameHtml = user.name;
4484
-
4485
4011
  if (mentionSearchText && mentionSearchText.length > 1) {
4486
4012
  if (user.name.toLowerCase().startsWith(searchText)) {
4487
4013
  nameHtml = getMentionSelectedNameEl(user.name.substring(0, searchText.length), user.name.substring(searchText.length));
@@ -4491,24 +4017,22 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4491
4017
  if (name.toLocaleLowerCase().startsWith(searchText)) {
4492
4018
  return getMentionSelectedNameEl(name.substring(0, searchText.length), name.substring(searchText.length));
4493
4019
  }
4494
-
4495
4020
  return name;
4496
4021
  }).join(" ");
4497
4022
  }
4498
4023
  }
4499
-
4500
4024
  return _objectSpread2(_objectSpread2({}, user), {}, {
4501
4025
  nameHtml: nameHtml
4502
4026
  });
4503
4027
  });
4504
- }, [mentionSearchText, users]); // eslint-disable-next-line valid-jsdoc
4028
+ }, [mentionSearchText, users]);
4505
4029
 
4030
+ // eslint-disable-next-line valid-jsdoc
4506
4031
  /**
4507
4032
  *
4508
4033
  * @param {MentionUser} user
4509
4034
  * @returns {(event: React.MouseEvent) => void} event
4510
4035
  */
4511
-
4512
4036
  function handleClick(user) {
4513
4037
  return function (event) {
4514
4038
  event.stopPropagation();
@@ -4516,7 +4040,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4516
4040
  onSelect(user);
4517
4041
  };
4518
4042
  }
4519
-
4520
4043
  useEffect(function () {
4521
4044
  var unsubscribe = addEventListener("enter", function (event) {
4522
4045
  event.stopPropagation();
@@ -4551,7 +4074,6 @@ var MentionUserList = function MentionUserList(_ref, ref) {
4551
4074
  })));
4552
4075
  }));
4553
4076
  };
4554
-
4555
4077
  var MentionUserListWithRef = /*#__PURE__*/forwardRef(MentionUserList);
4556
4078
  MentionUserListWithRef.propTypes = {
4557
4079
  users: t.array.isRequired
@@ -4576,32 +4098,27 @@ MentionUserListWithRef.propTypes = {
4576
4098
  * @property {(html: string) => void} appendContent
4577
4099
  * @property {(fn: SanitizeFn) => void} addSanitizeFn
4578
4100
  */
4579
- // eslint-disable-next-line valid-jsdoc
4580
4101
 
4102
+ // eslint-disable-next-line valid-jsdoc
4581
4103
  /** @type {React.FC<Props>} */
4582
-
4583
4104
  var MentionWrapper = function MentionWrapper(_ref) {
4584
4105
  var searchMention = _ref.searchMention,
4585
- addEventListener = _ref.addEventListener,
4586
- appendContent = _ref.appendContent,
4587
- addSanitizeFn = _ref.addSanitizeFn;
4588
-
4106
+ addEventListener = _ref.addEventListener,
4107
+ appendContent = _ref.appendContent,
4108
+ addSanitizeFn = _ref.addSanitizeFn;
4589
4109
  /** @type {React.MutableRefObject<import('./mention-user-list').Ref | null>} */
4590
4110
  var metionUserListRef = useRef(null);
4591
-
4592
4111
  var _useState = useState(false),
4593
- _useState2 = _slicedToArray(_useState, 2),
4594
- showUserList = _useState2[0],
4595
- setShowUserList = _useState2[1];
4596
-
4112
+ _useState2 = _slicedToArray(_useState, 2),
4113
+ showUserList = _useState2[0],
4114
+ setShowUserList = _useState2[1];
4597
4115
  var _useMention = useMention(searchMention),
4598
- mentionSearchText = _useMention.mentionSearchText,
4599
- mentionUsers = _useMention.mentionUsers,
4600
- loading = _useMention.loading,
4601
- onKeyUp = _useMention.onKeyUp,
4602
- onFocus = _useMention.onFocus,
4603
- onSelectUser = _useMention.onSelectUser;
4604
-
4116
+ mentionSearchText = _useMention.mentionSearchText,
4117
+ mentionUsers = _useMention.mentionUsers,
4118
+ loading = _useMention.loading,
4119
+ onKeyUp = _useMention.onKeyUp,
4120
+ onFocus = _useMention.onFocus,
4121
+ onSelectUser = _useMention.onSelectUser;
4605
4122
  useEffect(function () {
4606
4123
  addSanitizeFn(function (html) {
4607
4124
  var container = document.createElement("div");
@@ -4621,7 +4138,6 @@ var MentionWrapper = function MentionWrapper(_ref) {
4621
4138
  function checkClickOutside() {
4622
4139
  setShowUserList(false);
4623
4140
  }
4624
-
4625
4141
  document.addEventListener("click", checkClickOutside);
4626
4142
  return function () {
4627
4143
  document.removeEventListener("click", checkClickOutside);
@@ -4641,13 +4157,11 @@ var MentionWrapper = function MentionWrapper(_ref) {
4641
4157
  function handleKeyDown(event) {
4642
4158
  switch (event.key) {
4643
4159
  case "Esc": // IE/Edge specific value
4644
-
4645
4160
  case "Escape":
4646
4161
  setShowUserList(false);
4647
4162
  break;
4648
4163
  }
4649
4164
  }
4650
-
4651
4165
  var unsubscribe = addEventListener("keyDown", handleKeyDown);
4652
4166
  return function () {
4653
4167
  unsubscribe();
@@ -4677,16 +4191,15 @@ var MentionWrapper = function MentionWrapper(_ref) {
4677
4191
  };
4678
4192
  }
4679
4193
  }, [addEventListener, showUserList]);
4194
+
4680
4195
  /**
4681
4196
  *
4682
4197
  * @param {MetionUser} user
4683
4198
  */
4684
-
4685
4199
  function handleSelect(user) {
4686
4200
  onSelectUser();
4687
4201
  appendContent("<span class=\"react-input-emoji--mention--text\" data-mention-id=\"".concat(user.id, "\" data-mention-name=\"").concat(user.name, "\">@").concat(user.name, "</span> "));
4688
4202
  }
4689
-
4690
4203
  return /*#__PURE__*/React.createElement(React.Fragment, null, loading ? /*#__PURE__*/React.createElement("div", {
4691
4204
  className: "react-input-emoji--mention--container"
4692
4205
  }, /*#__PURE__*/React.createElement("div", {
@@ -4708,8 +4221,8 @@ var MentionWrapper = function MentionWrapper(_ref) {
4708
4221
  };
4709
4222
 
4710
4223
  // @ts-check
4711
- // eslint-disable-next-line valid-jsdoc
4712
4224
 
4225
+ // eslint-disable-next-line valid-jsdoc
4713
4226
  /**
4714
4227
  * @template T
4715
4228
  * @returns {import('../types/types').ListenerObj<T>}
@@ -4731,22 +4244,20 @@ function createObserver() {
4731
4244
  return listener(event);
4732
4245
  });
4733
4246
  },
4734
-
4735
4247
  get currentListerners() {
4736
4248
  return listeners;
4737
4249
  }
4738
-
4739
4250
  };
4740
4251
  }
4741
4252
 
4742
4253
  // @ts-check
4254
+
4743
4255
  /**
4744
4256
  * @typedef {import('../types/types').TextInputListeners} TextInputListeners
4745
4257
  */
4746
- // eslint-disable-next-line valid-jsdoc
4747
4258
 
4259
+ // eslint-disable-next-line valid-jsdoc
4748
4260
  /** */
4749
-
4750
4261
  function useEventListeners() {
4751
4262
  /** @type {TextInputListeners} */
4752
4263
  var listeners = useMemo(function () {
@@ -4760,11 +4271,11 @@ function useEventListeners() {
4760
4271
  blur: createObserver()
4761
4272
  };
4762
4273
  }, []);
4274
+
4763
4275
  /**
4764
4276
  * @template {keyof TextInputListeners} T, K
4765
4277
  * @type {(event: keyof TextInputListeners, fn: import('../types/types').Listerner<any>) => () => void}
4766
4278
  */
4767
-
4768
4279
  var addEventListener = useCallback(function (event, fn) {
4769
4280
  return listeners[event].subscribe(fn);
4770
4281
  }, [listeners]);
@@ -4775,23 +4286,23 @@ function useEventListeners() {
4775
4286
  }
4776
4287
 
4777
4288
  // @ts-check
4289
+
4778
4290
  /**
4779
4291
  * @typedef {import('../types/types').PolluteFn} PolluteFn
4780
4292
  */
4781
- // eslint-disable-next-line valid-jsdoc
4782
4293
 
4294
+ // eslint-disable-next-line valid-jsdoc
4783
4295
  /** */
4784
-
4785
4296
  function usePollute() {
4786
4297
  /** @type {React.MutableRefObject<PolluteFn[]>} */
4787
4298
  var polluteFnsRef = useRef([]);
4788
- /** @type {(fn: PolluteFn) => void} */
4789
4299
 
4300
+ /** @type {(fn: PolluteFn) => void} */
4790
4301
  var addPolluteFn = useCallback(function (fn) {
4791
4302
  polluteFnsRef.current.push(fn);
4792
4303
  }, []);
4793
- /** @type {(html: string) => string} */
4794
4304
 
4305
+ /** @type {(html: string) => string} */
4795
4306
  var pollute = useCallback(function (text) {
4796
4307
  var result = polluteFnsRef.current.reduce(function (acc, fn) {
4797
4308
  return fn(acc);
@@ -4805,6 +4316,7 @@ function usePollute() {
4805
4316
  }
4806
4317
 
4807
4318
  // @ts-check
4319
+
4808
4320
  /**
4809
4321
  * @typedef {import('./types/types').MentionUser} MetionUser
4810
4322
  */
@@ -4841,6 +4353,7 @@ function usePollute() {
4841
4353
  * @property {import('./types/types').Languages=} language
4842
4354
  * @property {(text: string) => Promise<MetionUser[]>=} searchMention
4843
4355
  * @property {HTMLDivElement=} buttonElement
4356
+ * @property {React.MutableRefObject=} buttonRef
4844
4357
  */
4845
4358
 
4846
4359
  /**
@@ -4849,50 +4362,46 @@ function usePollute() {
4849
4362
  * @param {React.Ref<any>} ref
4850
4363
  * @return {JSX.Element}
4851
4364
  */
4852
-
4853
4365
  function InputEmoji(props, ref) {
4854
4366
  var onChange = props.onChange,
4855
- onEnter = props.onEnter,
4856
- shouldReturn = props.shouldReturn,
4857
- onResize = props.onResize,
4858
- onClick = props.onClick,
4859
- onFocus = props.onFocus,
4860
- onBlur = props.onBlur,
4861
- onKeyDown = props.onKeyDown,
4862
- theme = props.theme,
4863
- cleanOnEnter = props.cleanOnEnter,
4864
- placeholder = props.placeholder,
4865
- maxLength = props.maxLength,
4866
- keepOpened = props.keepOpened,
4867
- inputClass = props.inputClass,
4868
- disableRecent = props.disableRecent,
4869
- tabIndex = props.tabIndex,
4870
- value = props.value,
4871
- customEmojis = props.customEmojis,
4872
- language = props.language,
4873
- searchMention = props.searchMention,
4874
- buttonElement = props.buttonElement,
4875
- borderRadius = props.borderRadius,
4876
- borderColor = props.borderColor,
4877
- fontSize = props.fontSize,
4878
- fontFamily = props.fontFamily;
4879
- /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */
4367
+ onEnter = props.onEnter,
4368
+ shouldReturn = props.shouldReturn,
4369
+ onResize = props.onResize,
4370
+ onClick = props.onClick,
4371
+ onFocus = props.onFocus,
4372
+ onBlur = props.onBlur,
4373
+ onKeyDown = props.onKeyDown,
4374
+ theme = props.theme,
4375
+ cleanOnEnter = props.cleanOnEnter,
4376
+ placeholder = props.placeholder,
4377
+ maxLength = props.maxLength,
4378
+ keepOpened = props.keepOpened,
4379
+ inputClass = props.inputClass,
4380
+ disableRecent = props.disableRecent,
4381
+ tabIndex = props.tabIndex,
4382
+ value = props.value,
4383
+ customEmojis = props.customEmojis,
4384
+ language = props.language,
4385
+ searchMention = props.searchMention,
4386
+ buttonElement = props.buttonElement,
4387
+ buttonRef = props.buttonRef,
4388
+ borderRadius = props.borderRadius,
4389
+ borderColor = props.borderColor,
4390
+ fontSize = props.fontSize,
4391
+ fontFamily = props.fontFamily;
4880
4392
 
4393
+ /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */
4881
4394
  var textInputRef = useRef(null);
4882
-
4883
4395
  var _useEventListeners = useEventListeners(),
4884
- addEventListener = _useEventListeners.addEventListener,
4885
- listeners = _useEventListeners.listeners;
4886
-
4396
+ addEventListener = _useEventListeners.addEventListener,
4397
+ listeners = _useEventListeners.listeners;
4887
4398
  var _useSanitize = useSanitize(props.shouldReturn),
4888
- addSanitizeFn = _useSanitize.addSanitizeFn,
4889
- sanitize = _useSanitize.sanitize,
4890
- sanitizedTextRef = _useSanitize.sanitizedTextRef;
4891
-
4399
+ addSanitizeFn = _useSanitize.addSanitizeFn,
4400
+ sanitize = _useSanitize.sanitize,
4401
+ sanitizedTextRef = _useSanitize.sanitizedTextRef;
4892
4402
  var _usePollute = usePollute(),
4893
- addPolluteFn = _usePollute.addPolluteFn,
4894
- pollute = _usePollute.pollute;
4895
-
4403
+ addPolluteFn = _usePollute.addPolluteFn,
4404
+ pollute = _usePollute.pollute;
4896
4405
  var updateHTML = useCallback(function () {
4897
4406
  var nextValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
4898
4407
  if (textInputRef.current === null) return;
@@ -4918,7 +4427,9 @@ function InputEmoji(props, ref) {
4918
4427
  if (sanitizedTextRef.current !== value) {
4919
4428
  setValue(value);
4920
4429
  }
4921
- }, [sanitizedTextRef, setValue, value]); // useEffect(() => {
4430
+ }, [sanitizedTextRef, setValue, value]);
4431
+
4432
+ // useEffect(() => {
4922
4433
  // updateHTML();
4923
4434
  // }, [updateHTML]);
4924
4435
 
@@ -4932,34 +4443,26 @@ function InputEmoji(props, ref) {
4932
4443
  if (typeof maxLength !== "undefined" && event.key !== "Backspace" && textInputRef.current !== null && totalCharacters(textInputRef.current) >= maxLength) {
4933
4444
  event.preventDefault();
4934
4445
  }
4935
-
4936
4446
  if (event.key === "Enter" && textInputRef.current) {
4937
4447
  event.preventDefault();
4938
4448
  var text = sanitize(textInputRef.current.html);
4939
4449
  emitChange(sanitizedTextRef.current);
4940
-
4941
4450
  if (typeof onEnter === "function" && listeners.enter.currentListerners.length === 0) {
4942
4451
  onEnter(text);
4943
4452
  }
4944
-
4945
4453
  if (cleanOnEnter && listeners.enter.currentListerners.length === 0) {
4946
4454
  updateHTML("");
4947
4455
  }
4948
-
4949
4456
  if (typeof onKeyDown === "function") {
4950
4457
  onKeyDown(event.nativeEvent);
4951
4458
  }
4952
-
4953
4459
  return false;
4954
4460
  }
4955
-
4956
4461
  if (typeof onKeyDown === "function") {
4957
4462
  onKeyDown(event.nativeEvent);
4958
4463
  }
4959
-
4960
4464
  return true;
4961
4465
  }
4962
-
4963
4466
  var unsubscribe = addEventListener("keyDown", handleKeydown);
4964
4467
  return function () {
4965
4468
  unsubscribe();
@@ -4971,12 +4474,10 @@ function InputEmoji(props, ref) {
4971
4474
  if (typeof onClick === "function") {
4972
4475
  onClick();
4973
4476
  }
4974
-
4975
4477
  if (typeof onFocus === "function") {
4976
4478
  onFocus();
4977
4479
  }
4978
4480
  }
4979
-
4980
4481
  var unsubscribe = addEventListener("focus", handleFocus);
4981
4482
  return function () {
4982
4483
  unsubscribe();
@@ -4989,82 +4490,70 @@ function InputEmoji(props, ref) {
4989
4490
  onBlur();
4990
4491
  }
4991
4492
  }
4992
-
4993
4493
  var unsubscribe = addEventListener("blur", handleBlur);
4994
4494
  return function () {
4995
4495
  unsubscribe();
4996
4496
  };
4997
4497
  }, [addEventListener, onBlur]);
4498
+
4998
4499
  /**
4999
4500
  *
5000
4501
  * @param {string} html
5001
4502
  */
5002
-
5003
4503
  function handleTextInputChange(html) {
5004
4504
  sanitize(html);
5005
-
5006
4505
  if (value !== sanitizedTextRef.current) {
5007
4506
  emitChange(sanitizedTextRef.current);
5008
4507
  }
5009
4508
  }
4509
+
5010
4510
  /**
5011
4511
  *
5012
4512
  * @param {string} html
5013
4513
  */
5014
-
5015
-
5016
4514
  function appendContent(html) {
5017
4515
  if (typeof maxLength !== "undefined" && textInputRef.current !== null && totalCharacters(textInputRef.current) >= maxLength) {
5018
4516
  return;
5019
4517
  }
5020
-
5021
4518
  if (textInputRef.current !== null) {
5022
4519
  textInputRef.current.appendContent(html);
5023
4520
  }
5024
4521
  }
4522
+
5025
4523
  /**
5026
4524
  * Handle copy of current selected text
5027
4525
  * @param {React.ClipboardEvent} event
5028
4526
  */
5029
-
5030
-
5031
4527
  function handleCopy(event) {
5032
4528
  var selection = window.getSelection();
5033
-
5034
4529
  if (selection !== null) {
5035
4530
  var selectedText = '';
5036
-
5037
4531
  if (selection.anchorNode && selection.anchorNode.nodeType === Node.ELEMENT_NODE) {
5038
4532
  // @ts-ignore
5039
4533
  selectedText = selection.anchorNode.innerHTML;
5040
4534
  } else if (selection.anchorNode && selection.anchorNode.nodeType === Node.TEXT_NODE) {
5041
4535
  var _selection$anchorNode;
5042
-
5043
4536
  selectedText = (_selection$anchorNode = selection.anchorNode.textContent) !== null && _selection$anchorNode !== void 0 ? _selection$anchorNode : '';
5044
4537
  }
5045
-
5046
4538
  var text = replaceAllTextEmojiToString(selectedText);
5047
4539
  event.clipboardData.setData("text", text);
5048
4540
  event.preventDefault();
5049
4541
  }
5050
4542
  }
4543
+
5051
4544
  /**
5052
4545
  * Handle past on input
5053
4546
  * @param {React.ClipboardEvent} event
5054
4547
  */
5055
-
5056
-
5057
4548
  function handlePaste(event) {
5058
4549
  event.preventDefault();
5059
4550
  var content;
5060
-
5061
4551
  if (event.clipboardData) {
5062
4552
  content = event.clipboardData.getData("text/plain");
5063
4553
  content = pollute(content);
5064
4554
  document.execCommand("insertHTML", false, content);
5065
4555
  }
5066
4556
  }
5067
-
5068
4557
  return /*#__PURE__*/React.createElement("div", {
5069
4558
  className: "react-emoji"
5070
4559
  }, /*#__PURE__*/React.createElement(MentionWrapper, {
@@ -5103,15 +4592,13 @@ function InputEmoji(props, ref) {
5103
4592
  addPolluteFn: addPolluteFn,
5104
4593
  appendContent: appendContent,
5105
4594
  buttonElement: buttonElement,
4595
+ buttonRef: buttonRef,
5106
4596
  language: language
5107
4597
  }));
5108
4598
  }
5109
-
5110
4599
  var InputEmojiWithRef = /*#__PURE__*/forwardRef(InputEmoji);
5111
4600
  InputEmojiWithRef.defaultProps = {
5112
- theme:
5113
- /** @type {const} */
5114
- "auto",
4601
+ theme: /** @type {const} */"auto",
5115
4602
  height: 30,
5116
4603
  placeholder: "Type a message",
5117
4604
  borderRadius: 21,