sagacity/script/fontawesome/svg-with-js/js/fontawesome.min.js

5 lines
27 KiB
JavaScript
Raw Normal View History

2018-07-26 08:33:50 -04:00
/*!
* Font Awesome Free 5.0.2 by @fontawesome - http://fontawesome.com
* License - http://fontawesome.com/license (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
!function(){"use strict";function t(t){var e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).asNewDefault,n=void 0!==e&&e,r=Object.keys(yt),i=n?function(t){return~r.indexOf(t)&&!~vt.indexOf(t)}:function(t){return~r.indexOf(t)};Object.keys(t).forEach(function(e){i(e)&&(yt[e]=t[e])})}function e(e){t({autoReplaceSvg:e,observeMutations:e})}function n(t){return~ct.indexOf(t)}function r(t){if(t&&void 0!==Q.createElement){var e=Q.createElement("style");e.setAttribute("type","text/css"),e.innerHTML=t;for(var n=Q.head.childNodes,r=null,i=n.length-1;i>-1;i--){var a=n[i],o=(a.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(o)>-1&&(r=a)}return Q.head.insertBefore(e,r),t}}function i(){return++Ct}function a(t){for(var e=[],n=(t||[]).length>>>0;n--;)e[n]=t[n];return e}function o(t){return t.classList?a(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(t){return t})}function s(t,e){var r=e.split("-"),i=r[0],a=r.slice(1).join("-");return i!==t||""===a||n(a)?null:a}function f(t){return(""+t).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function l(t){return Object.keys(t||{}).reduce(function(e,n){return e+(n+'="')+f(t[n])+'" '},"").trim()}function c(t){return Object.keys(t||{}).reduce(function(e,n){return e+(n+": ")+t[n]+";"},"")}function u(t){return t.size!==At.size||t.x!==At.x||t.y!==At.y||t.rotate!==At.rotate||t.flipX||t.flipY}function m(t){var e=t.transform,n=t.containerWidth,r=t.iconWidth;return{outer:{transform:"translate("+n/2+" 256)"},inner:{transform:"translate("+32*e.x+", "+32*e.y+") "+" "+("scale("+e.size/16*(e.flipX?-1:1)+", "+e.size/16*(e.flipY?-1:1)+") ")+" "+("rotate("+e.rotate+" 0 0)")},path:{transform:"translate("+r/2*-1+" -256)"}}}function d(t){var e=t.transform,n=t.width,r=void 0===n?nt:n,i=t.height,a=void 0===i?nt:i,o=t.startCentered,s=void 0!==o&&o,f="";return f+=s&&et?"translate("+(e.x/Nt-r/2)+"em, "+(e.y/Nt-a/2)+"em) ":s?"translate(calc(-50% + "+e.x/Nt+"em), calc(-50% + "+e.y/Nt+"em)) ":"translate("+e.x/Nt+"em, "+e.y/Nt+"em) ",f+="scale("+e.size/Nt*(e.flipX?-1:1)+", "+e.size/Nt*(e.flipY?-1:1)+") ",f+="rotate("+e.rotate+"deg) "}function g(t){var e,n=t.icons,r=n.main,a=n.mask,o=t.prefix,s=t.iconName,f=t.transform,l=t.symbol,c=t.title,u=t.extra,m=a.found?a:r,d=m.width,g=m.height,h="fa-w-"+Math.ceil(d/g*16),p=[yt.replacementClass,s?yt.familyPrefix+"-"+s:"",h].concat(u.classes).join(" "),v={children:[],attributes:gt({},u.attributes,(e={},dt(e,rt,""),dt(e,"data-prefix",o),dt(e,"data-icon",s),dt(e,"class",p),dt(e,"role","img"),dt(e,"xmlns","http://www.w3.org/2000/svg"),dt(e,"viewBox","0 0 "+d+" "+g),e))};c&&v.children.push({tag:"title",attributes:{id:v.attributes["aria-labelledby"]||"title-"+i()},children:[c]});var b=gt({},v,{prefix:o,iconName:s,main:r,mask:a,transform:f,symbol:l,styles:u.styles}),y=a.found&&r.found?Mt(b):zt(b),w=y.children,x=y.attributes;return b.children=w,b.attributes=x,l?Lt(b):St(b)}function h(t){var e,n=t.content,r=t.width,i=t.height,a=t.transform,o=t.title,s=t.extra,f=gt({},s.attributes,o?{title:o}:{},(e={},dt(e,rt,""),dt(e,"class",s.classes.join(" ")),e)),l=gt({},s.styles);u(a)&&(l.transform=d({transform:a,startCentered:!0,width:r,height:i}),l["-webkit-transform"]=l.transform);var m=c(l);m.length>0&&(f.style=m);var g=[];return g.push({tag:"span",attributes:f,children:[n]}),o&&g.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),g}function p(t,e){return Bt[t][e]}function v(t,e){return Dt[t][e]}function b(t){return Xt[t]||{prefix:null,iconName:null}}function y(t){return t.reduce(function(t,e){var n=s(yt.familyPrefix,e);if(Ut[e])t.prefix=e;else if(n){var r="fa"===t.prefix?b(n):{};t.iconName=r.iconName||n,t.prefix=r.prefix||t.prefix}else e!==yt.replacementClass&&0!==e.indexOf("fa-w-")&&t.rest.push(e);return t},Vt())}function w(t,e,n){if(t&&t[e]&&t[e][n])return{prefix:e,iconName:n,icon:t[e][n]}}function x(t){var e=t.tag,n=t.attributes,r=void 0===n?{}:n,i=t.children,a=void 0===i?[]:i;return"string"==typeof t?f(t):"<"+e+" "+l(r)+">"+a.map(x).join("")+"</"+e+">"}function k(t){var e=t.getAttribute?t.