WordPress/wp-includes/js/twemoji.min.js

1 line
14 KiB
JavaScript
Raw Normal View History

var twemoji=function(){"use strict";function a(a){return document.createTextNode(a)}function b(a){return a.replace(s,h)}function c(a,b){return"".concat(b.base,b.size,"/",a,b.ext)}function d(a,b){for(var c,e,f=a.childNodes,g=f.length;g--;)c=f[g],e=c.nodeType,3===e?b.push(c):1!==e||t.test(c.nodeName)||d(c,b);return b}function e(a,b){return o("\ufe0f"===b?a.slice(0,-1):3===a.length&&"\ufe0f"===a.charAt(1)?a.charAt(0)+a.charAt(2):a)}function f(b,c){for(var f,g,h,i,j,k,l,m,n,o,p,q,s,t,u=d(b,[]),v=u.length;v--;){for(h=!1,i=document.createDocumentFragment(),j=u[v],k=j.nodeValue,m=0;l=r.exec(k);){if(n=l.index,n!==m&&i.appendChild(a(k.slice(m,n))),p=l[0],q=l[1],s=l[2],m=n+p.length,"\ufe0e"!==s&&(t=c.callback(e(q,s),c,s))){o=new Image,o.onerror=c.onerror,o.setAttribute("draggable","false"),f=c.attributes(q,s);for(g in f)f.hasOwnProperty(g)&&0!==g.indexOf("on")&&!o.hasAttribute(g)&&o.setAttribute(g,f[g]);o.className=c.className,o.alt=p,o.src=t,h=!0,i.appendChild(o)}o||i.appendChild(a(p)),o=null}h&&(m<k.length&&i.appendChild(a(k.slice(m))),j.parentNode.replaceChild(i,j))}return b}function g(a,c){return m(a,function(a,d,f){var g,h,i,j=a;if("\ufe0e"!==f&&(i=c.callback(e(d,f),c,f))){j="<img ".concat('class="',c.className,'" ','draggable="false" ','alt="',a,'"',' src="',i,'"'),g=c.attributes(d,f);for(h in g)g.hasOwnProperty(h)&&0!==h.indexOf("on")&&-1===j.indexOf(" "+h+"=")&&(j=j.concat(" ",h,'="',b(g[h]),'"'));j=j.concat(">")}return j})}function h(a){return q[a]}function i(){return null}function j(a){return"number"==typeof a?a+"x"+a:a}function k(a){var b="string"==typeof a?parseInt(a,16):a;return 65536>b?u(b):(b-=65536,u(55296+(b>>10),56320+(1023&b)))}function l(a,b){return b&&"function"!=typeof b||(b={callback:b}),("string"==typeof a?g:f)(a,{callback:b.callback||c,attributes:"function"==typeof b.attributes?b.attributes:i,base:"string"==typeof b.base?b.base:p.base,ext:b.ext||p.ext,size:b.folder||j(b.size||p.size),className:b.className||p.className,onerror:b.onerror||p.onerror})}function m(a,b){return String(a).replace(r,b)}function n(a){r.lastIndex=0;var b=r.test(a);return r.lastIndex=0,b}function o(a,b){for(var c=[],d=0,e=0,f=0;f<a.length;)d=a.charCodeAt(f++),e?(c.push((65536+(e-55296<<10)+(d-56320)).toString(16)),e=0):d>=55296&&56319>=d?e=d:c.push(d.toString(16));return c.join(b||"-")}var p={base:("https:"===location.protocol?"https:":"http:")+"//twemoji.maxcdn.com/",ext:".png",size:"36x36",className:"emoji",convert:{fromCodePoint:k,toCodePoint:o},onerror:function(){this.parentNode&&this.parentNode.replaceChild(a(this.alt),this)},parse:l,replace:m,test:n},q={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"},r=/((?:\u0039\ufe0f\u20e3|\u0038\ufe0f\u20e3|\u0037\ufe0f\u20e3|\u0036\ufe0f\u20e3|\u0035\ufe0f\u20e3|\u0034\ufe0f\u20e3|\u0033\ufe0f\u20e3|\u0032\ufe0f\u20e3|\u0031\ufe0f\u20e3|\u0030\ufe0f\u20e3|\u0023\ufe0f\u20e3|\ud83c\uddea\ud83c\uddf8|\ud83c\uddeb\ud83c\uddf7|\ud83c\uddec\ud83c\udde7|\ud83c\uddee\ud83c\uddf9|\ud83c\uddef\ud83c\uddf5|\ud83c\uddf0\ud83c\uddf7|\ud83c\uddf7\ud83c\uddfa|\ud83c\uddfa\ud83c\uddf8|\ud83c\uddea\ud83c\udde8|\ud83c\udde9\ud83c\uddff|\ud83c\uddf9\ud83c\uddf7|\ud83c\udde8\ud83c\uddf7|\ud83c\uddfa\ud83c\uddfe|\ud83c\udde8\ud83c\udde6|\ud83c\uddf8\ud83c\uddec|\ud83c\udde7\ud83c\uddf7|\ud83c\uddf8\ud83c\udde6|\ud83c\udde6\ud83c\uddfa|\ud83c\uddf5\ud83c\uddf9|\ud83c\uddf2\ud83c\uddfd|\ud83c\uddee\ud83c\uddf7|\ud83c\uddee\ud83c\uddf3|\ud83c\udded\ud83c\uddf7|\ud83c\udde8\ud83c\uddf3|\ud83c\udde9\ud83c\uddea|\ud83c\udde6\ud83c\uddf7|\u0039\ufe0f?\u20e3|\u0038\ufe0f?\u20e3|\u0037\ufe0f?\u20e3|\u0036\ufe0f?\u20e3|\u0035\ufe0f?\u20e3|\u0034\ufe0f?\u20e3|\u0033\ufe0f?\u20e3|\u0032\ufe0f?\u20e3|\u0031\ufe0f?\u20e3|\u0030\ufe0f?\u20e3|\u0023\ufe0f?\u20e3|\u0039\ufe0f?\u20e3|\u0038\ufe0f?\u20e3|\u0037\ufe0f?\u20e3|\u0036\ufe0f?\u20e3|\u0035\ufe0f?\u20e3|\u0034\ufe0f?\u20e3|\u0033\ufe0f?\u20e3|\u0032\ufe0f?\u20e3|\u0031\ufe0f?\u20e3|\u0030\ufe0f?\u20e3|\u0023\ufe0f?\u20e3|\ud83d\ude1b|\ud83d\ude19|\ud83d\ude17|\ud83d\ude15|\ud83d\ude11|\ud83d\ude10|\ud83d\ude0e|\ud83d\ude08|\ud83d\ude07|\ud83d\ude00|\ud83d\