@iconify/iconify
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -26,3 +26,3 @@ /** | ||
config: {}, | ||
version: '1.0.5' | ||
version: '1.0.6' | ||
}; | ||
@@ -2044,3 +2044,3 @@ | ||
item = Iconify.getIcon(image.icon), | ||
svgObject, svgElement, temp, span, data, html, svgStyle, placeholderStyle, i, attr; | ||
svgObject, svgElement, temp, span, data, html, svgStyle, placeholderStyle, i, attr, attrValue; | ||
@@ -2055,7 +2055,11 @@ attributes[iconAttribute] = image.icon; | ||
Object.keys(data.attributes).forEach(function(attr) { | ||
attrValue = data.attributes[attr]; | ||
if (attr === 'style') { | ||
return; | ||
attrValue = image.element.getAttribute('style'); | ||
if (typeof attrValue !== 'string' || !attrValue.length) { | ||
return; | ||
} | ||
} | ||
try { | ||
temp.setAttribute(attr, data.attributes[attr]); | ||
temp.setAttribute(attr, attrValue); | ||
} catch (err) { | ||
@@ -2062,0 +2066,0 @@ } |
@@ -13,2 +13,2 @@ /** | ||
*/ | ||
"use strict";if(void 0===self.Iconify&&(self.Iconify={isReady:!1},self.SimpleSVG=self.Iconify,function(n,e){var t,i,r,o,s,a,c,l,u,d,f,h,p,v,g,b,m,y,w,_,x,A,O,j,I,E,k,C,L,M,S,F,T,N,P,H,R,V,G={config:{},version:"1.0.5"};function D(e,t){var i;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},(i=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}function Q(){document.removeEventListener("DOMContentLoaded",Q),window.removeEventListener("load",Q),r.DOMReadyCallback()}function z(t,i,e){var n=t;if("_"!==t.slice(0,1)){if(void 0===u[t]){if(!e||void 0===u["_"+t])return;n="_"+t}switch(n){case"API":case"SVGAttributes":Object.keys(i).forEach(function(e){null===i[t]?delete u[n][e]:u[n][e]=i[e]});break;default:u[n]=i}}}function q(e,t){return function(e,t){switch(e){case"rotate":return t=parseInt(t),isNaN(t)?null:t;case"width":case"height":case"inlineHeight":case"inlineTop":case"verticalAlign":return t=parseFloat(t),isNaN(t)?null:t;case"vFlip":case"hFlip":return!!t;case"body":case"parent":return"string"==typeof t?t:null}return t}("rotate",e+t)}function B(e,t){return!!e!=!!t}function Y(e){var i=Object.create(null);return(void 0===e._defaults?[e,v]:[e,e._defaults,v]).forEach(function(t){Object.keys(t).forEach(function(e){"object"!=typeof t[e]&&void 0===i[e]&&(i[e]=t[e])})}),void 0===i.inlineTop&&(i.inlineTop=i.top),void 0===i.inlineHeight&&(i.inlineHeight=i.height),void 0===i.verticalAlign&&(i.height%7==0&&i.height%8!=0?i.verticalAlign=-.143:i.verticalAlign=-.125),i}function W(){return this._icons=Object.create(null),this._aliases=Object.create(null),this._resolved=Object.create(null),this._add=function(e,t,i){var n=e?"_aliases":"_icons";void 0===this._resolved[t.prefix]?(this._resolved[t.prefix]=Object.create(null),this._icons[t.prefix]=Object.create(null),this._aliases[t.prefix]=Object.create(null)):(delete this._icons[t.prefix][t.icon],delete this._aliases[t.prefix][t.icon]),this._resolved[t.prefix][t.icon]=!1,this[n][t.prefix][t.icon]=i},this._resolveIcon=function(e){var t,i,n,r,o,s;if(void 0===this._resolved[e.prefix]||void 0===this._resolved[e.prefix][e.icon])return null;if(!1!==this._resolved[e.prefix][e.icon])return this._resolved[e.prefix][e.icon];if(void 0!==this._icons[e.prefix][e.icon])return this._resolved[e.prefix][e.icon]=Y(this._icons[e.prefix][e.icon]);for(i=0,t=this._aliases[e.prefix][e.icon],n=Object.create(null),Object.keys(t).forEach(function(e){"parent"!==e&&(n[e]=t[e])}),r=t.parent;;){if(5<++i||void 0===this._resolved[e.prefix][r])return this._resolved[e.prefix][e.icon]=null;if(o=void 0===this._icons[e.prefix][r],s=this[o?"_aliases":"_icons"][e.prefix][r],Object.keys(s).forEach(function(e){if(void 0!==n[e])switch(e){case"rotate":n[e]=q(n[e],s[e]);break;case"hFlip":case"vFlip":n[e]=B(n[e],s[e])}else"parent"!==e&&(n[e]=s[e])}),!o)break;r=s.parent}return this._resolved[e.prefix][e.icon]=Y(n)},this.addCollection=function(n){var r=this,o=Object.create(null);g.forEach(function(e){void 0!==n[e]?o[e]=n[e]:void 0!==v[e]&&(o[e]=v[e])}),void 0!==n.icons&&Object.keys(n.icons).forEach(function(e){var t=p(e,n.prefix),i=n.icons[e];void 0!==i.body&&(i._defaults=o,r._add(!1,t,i))}),void 0!==n.aliases&&Object.keys(n.aliases).forEach(function(e){var t=p(e,n.prefix),i=n.aliases[e];if(void 0!==i.parent){if(void 0===n.prefix){if(i.parent.slice(0,t.prefix.length)!==t.prefix)return;i.parent=i.parent.slice(t.prefix.length+1)}r._add(!0,t,i)}})},this.addIcon=function(e,t,i){var n=void 0!==t.parent,r=p(e,i);if(n&&void 0===i){if(t.parent.slice(0,r.prefix.length)!==r.prefix)return;t.parent=t.parent.slice(r.prefix.length+1)}this._add(n,r,t)},this.exists=function(e,t){var i=p(e,t);return void 0!==this._resolved[i.prefix]&&void 0!==this._resolved[i.prefix][i.icon]},this.getIcon=function(e,t){var i=p(e,t);return this._resolveIcon(i)},this.copyIcon=function(e,t){var i,n=this.getIcon(e,t);return null===n?null:(i=Object.create(null),Object.keys(n).forEach(function(e){i[e]=n[e]}),i)},this.list=function(e){var i,n;return void 0!==e?void 0===this._resolved[e]?[]:Object.keys(this._resolved[e]):(i=[],n=this._resolved,Object.keys(n).forEach(function(t){i=i.concat(Object.keys(n[t]).map(function(e){return""===t&&-1===e.indexOf("-")?e:t+":"+e}))}),i)},this}function $(){w&&(w=!1,m.scanDOM())}function J(e,t,i){var n,r,o,s,a;if(1===t)return e;if(i=void 0===i?100:i,"number"==typeof e)return Math.ceil(e*t*i)/i;if("string"!=typeof e)return e;if(null===(n=e.split(O))||!n.length)return e;for(r=[],o=n.shift(),s=j.test(o);;){if(s?(a=parseFloat(o),isNaN(a)?r.push(o):r.push(Math.ceil(a*t*i)/i)):r.push(o),void 0===(o=n.shift()))return r.join("");s=!s}}function K(e,t,i){var n,r,o;for(n=0;n<t.length;n++)if(void 0!==e[r=t[n]])switch(typeof(o=e[r])){case"boolean":return o;case"number":return!!o;case"string":switch(o.toLowerCase()){case"1":case"true":case r:return!0;case"0":case"false":case"":return!1}}return i}function U(e,t,i){var n,r;for(n=0;n<t.length;n++)if(void 0!==e[r=t[n]])return e[r];return i}function X(e,t){var i;return"<?"===e.slice(0,2)&&(i=e.indexOf(">"),e=e.slice(i+1)),e=-1!==(i=(e=e.replace("viewbox=","viewBox=").replace("preserveaspectratio=","preserveAspectRatio=")).indexOf("</"))?e.replace("</",t+"</"):e.replace("/>",">"+t+"</svg>")}t=G,"function"!=typeof window.CustomEvent&&(D.prototype=window.Event.prototype,window.CustomEvent=D),t.event=function(e,t){document.dispatchEvent(new CustomEvent(e,t))},i=n,o=(r=G).config,s=null,r.DOMReadyCallback=function(){r.domready=!0,r.nextInitItem()},r.initTimeout=function(e){function t(){if(null!==s){if(!1!==s.callback())return s.stop(),void r.nextInitItem();s.counter++,10!==s.counter&&25!==s.counter||(window.clearInterval(s.id),s.id=window.setInterval(t,10===s.counter?250:1e3))}}null!==s&&s.stop(),s={id:window.setInterval(t,100),counter:0,callback:e,stop:function(){window.clearInterval(s.id),s=null},nextTick:t}},r.domready=!1,r.ready=!1,r.initQueue=[],r.readyQueue=[],r.nextInitItem=function(){var e;if(!r.ready){if(r.initQueue.length)e=r.initQueue.shift();else{if(!r.domready)return void r.initTimeout(function(){return!r.domready&&document.body&&r.scanDOM(),r.domready});if(!r.readyQueue.length)return r.ready=i.isReady=!0,r.event(o._readyEvent),void r.scanDOM();e=r.readyQueue.shift()}!1!==e()&&r.nextInitItem()}},r.addStylesheet=function(e){var t;if(!document.head||!document.body)return!!r.domready||(e||r.initTimeout(r.addStylesheet.bind(null,!0)),!1);try{(t=document.createElement("style")).type="text/css",t.innerHTML="span.iconify, i.iconify, iconify-icon { display: inline-block; width: 1em; }",null!==document.head.firstChild?document.head.insertBefore(t,document.head.firstChild):document.head.appendChild(t)}catch(e){}return!0},r.initQueue.push(r.addStylesheet.bind(null,!1)),i.ready=function(e){i.isReady?window.setTimeout(e):document.addEventListener(o._readyEvent,e)},window.setTimeout(function(){"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?r.domready=!0:(document.addEventListener("DOMContentLoaded",Q),window.addEventListener("load",Q)),r.nextInitItem()}),(a=G.config).SVGAttributes=Object.create(null),a._imageClass="iconify",a._loadingClass="svg-loading",a._iconAttribute="data-icon",a._rotateAttribute="data-rotate",a._flipAttribute="data-flip",a._inlineModeAttribute="data-inline",a._alignAttribute="data-align",a._appendAttribute="data-icon-append",a._appendedClass="svg-appended",a._readyEvent="IconifyReady",a._webComponentsPolyfill="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents-lite.min.js",a._classListPolyfill="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20150312/classList.min.js",c=n,l=e,u=G.config,c.setConfig=function(e,t){z(e,t,!1)},c.setCustomAPI=function(e,t){switch(typeof e){case"string":0;break;case"object":if(e instanceof Array){0;break}default:return}e.forEach(function(e){null===t?delete u.API[e]:u.API[e]=t})},c.getConfig=function(e){return void 0===u[e]?void 0===u["_"+e]?null:u["_"+e]:u[e]},["SimpleSVG","Iconify"].forEach(function(e){var t;void 0!==l[e+"Config"]&&"object"==typeof l[e+"Config"]&&(t=l[e+"Config"],Object.keys(t).forEach(function(e){z(e,t[e],!0)}))}),f=(d=G).config,h=e,d.initQueue.push(function(){var e={observer:!1,classList:!1},t={observer:!1,classList:!1};function i(e){var t;return!e.length||(document.head?((t=document.createElement("script")).setAttribute("src",e),t.setAttribute("type","text/javascript"),document.head.appendChild(t),!0):d.domready)}function n(){if("classList"in document.createElement("div"))return 1;t.classList||(t.classList=i(f._classListPolyfill))}function r(){return h.MutationObserver&&h.WeakMap||t.observer||(t.observer=i(f._webComponentsPolyfill)),1}return e.classList=!n(),e.observer=!r(),!e.classList&&!e.observer||(d.initTimeout(function(){return!(e.observer&&!r()||e.classList&&!n())}),!1)}),G.getPrefix=function(e,t){var i;return"string"==typeof t&&""!==t?{prefix:t,icon:e}:2===(i=e.split(":")).length?{prefix:i[0],icon:i[1]}:1<(i=e.split("-")).length?{prefix:t=i.shift(),icon:i.join("-")}:{prefix:"",icon:e}},p=G.getPrefix,v={left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1},g=["left","top","width","height","body","rotate","vFlip","hFlip","inlineTop","inlineHeight","verticalAlign"],W.mergeFlip=B,W.mergeRotation=q,W.blankIcon=function(){return Y({body:"",width:16,height:16})},G.Storage=W,b=n,y=e,w=!1,_=new(m=G).Storage,b.addCollection=function(e,t){_.addCollection(e),w||!0===t||(w=!0,window.setTimeout($,0))},b.addIcon=function(e,t,i){_.addIcon(e,t),w||!0===i||(w=!0,window.setTimeout($,0))},b.iconExists=_.exists.bind(_),b.getIcon=_.copyIcon.bind(_),b.listIcons=_.list.bind(_),["SimpleSVG","Iconify"].forEach(function(e){void 0!==y[e+"Preload"]&&y[e+"Preload"]instanceof Array&&y[e+"Preload"].forEach(function(e){"object"==typeof e&&void 0!==e.icons&&b.addCollection(e)})}),x=G.Storage,A=G.config,O=/(-?[0-9.]*[0-9]+[0-9.]*)/g,j=/^-?[0-9.]*[0-9]+[0-9.]*$/g,I=["width","height","inline"],E=["title"],k=0,G.SVG=function(_){return _=_||x.blankIcon(),this.item=_,this.height=function(e,t,i){return void 0===e?t?this.item.inlineHeight:this.item.height:J(e,(t?this.item.inlineHeight:this.item.height)/this.item.width,i)},this.width=function(e,t,i){return void 0===e?this.item.width:J(e,this.item.width/(t?this.item.inlineHeight:this.item.height),i)},this.defaultAttributes=function(){return{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",focusable:"false"}},this.preserveAspectRatio=function(e,t,i){var n="";switch(e){case"left":n+="xMin";break;case"right":n+="xMax";break;default:n+="xMid"}switch(t){case"top":n+="YMin";break;case"bottom":n+="YMax";break;default:n+="YMid"}return n+=!0===i?" slice":" meet"},this.htmlspecialchars=function(e){switch(typeof e){case"boolean":case"number":return e+"";case"string":return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return""},this.attributes=function(t){var e,i,n,r,o,s,a,c,l,u,d,f,h,p,v=this,g={horizontal:"center",vertical:"middle",crop:!1},b={rotate:_.rotate,hFlip:_.hFlip,vFlip:_.vFlip},m="",y=this.defaultAttributes(),w=[];if(s=K(t="object"==typeof t?t:Object.create(null),[A._inlineModeAttribute,"inline"],!0),u=K(t,[A._appendAttribute],!1),e={left:_.left,top:s?_.inlineTop:_.top,width:_.width,height:s?_.inlineHeight:_.height},"string"==typeof t[A._flipAttribute]&&t[A._flipAttribute].split(/[\s,]+/).forEach(function(e){switch(e=e.toLowerCase()){case"horizontal":b.hFlip=!b.hFlip;break;case"vertical":b.vFlip=!b.vFlip}}),void 0!==t[A._rotateAttribute])if("number"==typeof(c=t[A._rotateAttribute]))b.rotate+=c;else if("string"==typeof c)if(""===(d=c.replace(/^-?[0-9.]*/,"")))c=parseInt(c),isNaN(c)||(b.rotate+=c);else if(d!==c){switch(l=!1,d){case"%":l=25;break;case"deg":l=90}l&&(c=parseInt(c.slice(0,c.length-d.length)),isNaN(c)||(b.rotate+=Math.round(c/l)))}switch(b.hFlip?b.vFlip?b.rotate+=2:(w.push("translate("+(e.width+e.left)+" "+(0-e.top)+")"),w.push("scale(-1 1)"),e.top=e.left=0):b.vFlip&&(w.push("translate("+(0-e.left)+" "+(e.height+e.top)+")"),w.push("scale(1 -1)"),e.top=e.left=0),b.rotate%4){case 1:p=e.height/2+e.top,w.unshift("rotate(90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p);break;case 2:w.unshift("rotate(180 "+(e.width/2+e.left)+" "+(e.height/2+e.top)+")");break;case 3:p=e.width/2+e.left,w.unshift("rotate(-90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p)}return i=U(t,["data-width","width"],null),n=U(t,["data-height","height"],null),null===i&&null===n&&(n="1em"),null!==i&&null!==n?(r=i,o=n):null!==i?o=J(r=i,e.height/e.width):r=J(o=n,e.width/e.height),!1!==r&&(y.width="auto"===r?e.width:r),!1!==o&&(y.height="auto"===o?e.height:o),s&&0!==_.verticalAlign?m+="vertical-align: "+(h=_.verticalAlign+"em")+";":h="","string"==typeof t[A._alignAttribute]&&t[A._alignAttribute].toLowerCase().split(/[\s,]+/).forEach(function(e){switch(e){case"left":case"right":case"center":g.horizontal=e;break;case"top":case"bottom":case"middle":g.vertical=e;break;case"crop":g.crop=!0;break;case"meet":g.crop=!1}}),m+="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);",y.style=m+(void 0===t.style?"":t.style),y.preserveAspectRatio=this.preserveAspectRatio(g.horizontal,g.vertical,g.crop),y.viewBox=e.left+" "+e.top+" "+e.width+" "+e.height,a=function(i){var e,n,t=/\sid="(\S+)"/g,r=[];function o(e,t,i){for(var n=0;-1!==(n=i.indexOf(e,n));)i=i.slice(0,n)+t+i.slice(n+e.length),n+=t.length;return i}for(;e=t.exec(i);)r.push(e[1]);return r.length&&(n="IconifyId-"+Date.now().toString(16)+"-"+(16777216*Math.random()|0).toString(16)+"-",r.forEach(function(e){var t=n+k;k++,i=o('="'+e+'"','="'+t+'"',i),i=o('="#'+e+'"','="#'+t+'"',i),i=o("(#"+e+")","(#"+t+")",i)})),i}(this.item.body),w.length&&(a='<g transform="'+w.join(" ")+'">'+a+"</g>"),f=Object.create(null),Object.keys(t).forEach(function(e){void 0===y[e]&&(-1!==E.indexOf(e)?a="<"+e+">"+v.htmlspecialchars(t[e])+"</"+e+">"+a:-1===I.indexOf(e)&&(f[e]=t[e]))}),{attributes:y,elementAttributes:f,body:a,append:u,verticalAlign:h}},this},L=(C=G).config._loadingClass,C.newImage=function(e,t,i){return{element:e,icon:t,parser:i,loading:e.classList.contains(L)}},C.parsedImage=function(e,t){return{element:e,icon:t}},C.getImageAttributes=function(t){var e,i,n=Object.create(null);if(!t.element.hasAttributes())return n;for(e=0;e<t.element.attributes.length;e++)i=t.element.attributes[e],n[i.name]=i.value;return t.parser&&void 0!==t.parser.filterAttributes&&(n=t.parser.filterAttributes(t,n)),void 0!==n.class&&(n.class=n.class.split(" ").filter(function(e){return e!==L}),t.parser&&void 0!==t.parser.filterClasses&&(n.class=t.parser.filterClasses(t,n.class)),n.class=n.class.join(" ")),void 0!==t.attributes&&Object.keys(t.attributes).forEach(function(e){n[e]=t.attributes[e]}),n},function(n,f,e){var s=e._imageClass,t=e._loadingClass,i=e._appendedClass,a=e._iconAttribute,r=e._inlineModeAttribute,o=":not(svg):not(."+i+")",c=":not(."+t+")",l="."+t,h={iconify:{selector:"."+s,selectorAll:"."+s+o,selectorNew:"."+s+o+c,selectorLoading:"."+s+o+l,icon:function(e){var t,i=e.getAttribute(a);if("string"==typeof i)return i;for(var n=0;n<e.classList.length;n++)if(5<(t=e.classList[n]).length&&"icon:"===t.slice(0,5))return t.slice(5);return""},filterClasses:function(e,t){var i,n,r;for(n=0;n<t.length;n++)"icon-"===(i=t[n]).slice(0,5)&&2===(i=i.slice(5).split(":")).length&&(r="data-"+i[0],void 0===e.attributes&&(e.attributes=Object.create(null)),e.attributes[r]=i[1]);return t}}},p=Object.keys(h);n.addFinder=function(e,t){void 0===t.selectorAll&&(t.selectorAll=t.selector+o),void 0===t.selectorNew&&(t.selectorNew=t.selector+o+c),void 0===t.selectorLoading&&(t.selectorLoading=t.selector+o+l),h[e]=t,p=Object.keys(h),n.isReady&&n.scanDOM()},n.addTag=function(e,i,t){n.addFinder("tag-"+e,{selector:e,icon:null==t?h.iconify.icon:t,filterAttributes:function(e,t){return void 0===t[r]&&(t[r]=i),t},filterClasses:h.iconify.filterClasses})};try{"object"==typeof Reflect&&"object"==typeof customElements&&Object.setPrototypeOf&&(Object.setPrototypeOf(u.prototype,HTMLElement.prototype),Object.setPrototypeOf(u,HTMLElement),customElements.define("iconify-icon",u))}catch(e){}function u(){return Reflect.construct(HTMLElement,[],u)}n.addTag("iconify-icon",!1),f.findNewImages=function(c,l){var u=[],d=[];return(c=void 0===c?void 0===e._root?document.body:e._root:c)&&p.forEach(function(e){var t,i,n,r,o=h[e],s=!0===l?o.selectorLoading:!1===l?o.selectorNew:o.selectorAll,a=c.querySelectorAll(s);for(t=0;t<a.length;t++)i=a[t],(n=o.icon(i))&&-1===d.indexOf(i)&&(d.push(i),r=f.newImage(i,n,o),u.push(r))}),u},f.findParsedImages=function(e){var t,i,n,r=[],o=e.querySelectorAll("svg."+s);for(t=0;t<o.length;t++)(n=(i=o[t]).getAttribute(a))&&r.push(f.parsedImage(i,n));return r}}(n,G,G.config),G.loadImage=function(e,t){var i=G.getPrefix(e.icon);return n.iconExists(i.icon,i.prefix)},n.pauseObserving=function(){},n.resumeObserving=function(){},M=n,F=(S=G).config,T=F._iconAttribute,N=F._loadingClass,P=F._imageClass,H=F._appendedClass,S.renderSVG=function(t){var e,i,n,r,o,s,a,c,l,u,d=S.getImageAttributes(t),f=M.getIcon(t.icon);for(d[T]=t.icon,e=new S.SVG(f),n=document.createElement("svg"),o=e.attributes(d),Object.keys(o.attributes).forEach(function(e){if("style"!==e)try{n.setAttribute(e,o.attributes[e])}catch(e){}}),Object.keys(o.elementAttributes).forEach(function(e){try{(o.append?t.element:n).setAttribute(e,o.elementAttributes[e])}catch(e){}}),t.loading&&(n.classList.remove(N),o.append&&t.element.classList.remove(N)),n.classList.add(P),s=X(n.outerHTML,o.body),(r=document.createElement("span")).innerHTML=s,i=r.childNodes[0],o.append?(t.element.classList.add(H),t.element.appendChild(i)):(t.element.parentNode.replaceChild(i,t.element),t.element=i),a=i.style,c=t.element.style,o.verticalAlign&&(a.verticalAlign=o.verticalAlign),a.transform="rotate(360deg)",l=0;l<c.length;l++)a[u=c[l]]=c[u];delete t.parser,delete t.loading},M.getSVGObject=function(e,t){return!!M.iconExists(e)&&new S.SVG(M.getIcon(e)).attributes(t,!1)},M.getSVG=function(e,t){var i,n;return!1!==(n=M.getSVGObject(e,t))&&(i=document.createElement("svg"),Object.keys(n.attributes).forEach(function(e){try{i.setAttribute(e,n.attributes[e])}catch(e){}}),X(i.outerHTML,n.body))},R=n,(V=G).scanDOM=function(){var t=!1;function e(){V.findNewImages().forEach(function(e){V.loadImage(e)&&(t||(t=!0,R.pauseObserving()),V.renderSVG(e))})}if(V.ready)e();else try{e()}catch(e){}t&&R.resumeObserving()},R.scanDOM=V.scanDOM,R.getVersion=function(){return V.version}}(self.Iconify,self)),"object"==typeof exports)try{exports.__esModule=!0,exports.default=self.Iconify}catch(e){} | ||
"use strict";if(void 0===self.Iconify&&(self.Iconify={isReady:!1},self.SimpleSVG=self.Iconify,function(n,e){var t,i,r,o,s,a,c,l,u,d,f,h,p,v,g,b,m,y,w,_,x,A,O,j,I,E,k,C,L,M,S,F,T,N,P,H,R,V,G={config:{},version:"1.0.6"};function D(e,t){var i;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},(i=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}function Q(){document.removeEventListener("DOMContentLoaded",Q),window.removeEventListener("load",Q),r.DOMReadyCallback()}function z(t,i,e){var n=t;if("_"!==t.slice(0,1)){if(void 0===u[t]){if(!e||void 0===u["_"+t])return;n="_"+t}switch(n){case"API":case"SVGAttributes":Object.keys(i).forEach(function(e){null===i[t]?delete u[n][e]:u[n][e]=i[e]});break;default:u[n]=i}}}function q(e,t){return function(e,t){switch(e){case"rotate":return t=parseInt(t),isNaN(t)?null:t;case"width":case"height":case"inlineHeight":case"inlineTop":case"verticalAlign":return t=parseFloat(t),isNaN(t)?null:t;case"vFlip":case"hFlip":return!!t;case"body":case"parent":return"string"==typeof t?t:null}return t}("rotate",e+t)}function B(e,t){return!!e!=!!t}function Y(e){var i=Object.create(null);return(void 0===e._defaults?[e,v]:[e,e._defaults,v]).forEach(function(t){Object.keys(t).forEach(function(e){"object"!=typeof t[e]&&void 0===i[e]&&(i[e]=t[e])})}),void 0===i.inlineTop&&(i.inlineTop=i.top),void 0===i.inlineHeight&&(i.inlineHeight=i.height),void 0===i.verticalAlign&&(i.height%7==0&&i.height%8!=0?i.verticalAlign=-.143:i.verticalAlign=-.125),i}function W(){return this._icons=Object.create(null),this._aliases=Object.create(null),this._resolved=Object.create(null),this._add=function(e,t,i){var n=e?"_aliases":"_icons";void 0===this._resolved[t.prefix]?(this._resolved[t.prefix]=Object.create(null),this._icons[t.prefix]=Object.create(null),this._aliases[t.prefix]=Object.create(null)):(delete this._icons[t.prefix][t.icon],delete this._aliases[t.prefix][t.icon]),this._resolved[t.prefix][t.icon]=!1,this[n][t.prefix][t.icon]=i},this._resolveIcon=function(e){var t,i,n,r,o,s;if(void 0===this._resolved[e.prefix]||void 0===this._resolved[e.prefix][e.icon])return null;if(!1!==this._resolved[e.prefix][e.icon])return this._resolved[e.prefix][e.icon];if(void 0!==this._icons[e.prefix][e.icon])return this._resolved[e.prefix][e.icon]=Y(this._icons[e.prefix][e.icon]);for(i=0,t=this._aliases[e.prefix][e.icon],n=Object.create(null),Object.keys(t).forEach(function(e){"parent"!==e&&(n[e]=t[e])}),r=t.parent;;){if(5<++i||void 0===this._resolved[e.prefix][r])return this._resolved[e.prefix][e.icon]=null;if(o=void 0===this._icons[e.prefix][r],s=this[o?"_aliases":"_icons"][e.prefix][r],Object.keys(s).forEach(function(e){if(void 0!==n[e])switch(e){case"rotate":n[e]=q(n[e],s[e]);break;case"hFlip":case"vFlip":n[e]=B(n[e],s[e])}else"parent"!==e&&(n[e]=s[e])}),!o)break;r=s.parent}return this._resolved[e.prefix][e.icon]=Y(n)},this.addCollection=function(n){var r=this,o=Object.create(null);g.forEach(function(e){void 0!==n[e]?o[e]=n[e]:void 0!==v[e]&&(o[e]=v[e])}),void 0!==n.icons&&Object.keys(n.icons).forEach(function(e){var t=p(e,n.prefix),i=n.icons[e];void 0!==i.body&&(i._defaults=o,r._add(!1,t,i))}),void 0!==n.aliases&&Object.keys(n.aliases).forEach(function(e){var t=p(e,n.prefix),i=n.aliases[e];if(void 0!==i.parent){if(void 0===n.prefix){if(i.parent.slice(0,t.prefix.length)!==t.prefix)return;i.parent=i.parent.slice(t.prefix.length+1)}r._add(!0,t,i)}})},this.addIcon=function(e,t,i){var n=void 0!==t.parent,r=p(e,i);if(n&&void 0===i){if(t.parent.slice(0,r.prefix.length)!==r.prefix)return;t.parent=t.parent.slice(r.prefix.length+1)}this._add(n,r,t)},this.exists=function(e,t){var i=p(e,t);return void 0!==this._resolved[i.prefix]&&void 0!==this._resolved[i.prefix][i.icon]},this.getIcon=function(e,t){var i=p(e,t);return this._resolveIcon(i)},this.copyIcon=function(e,t){var i,n=this.getIcon(e,t);return null===n?null:(i=Object.create(null),Object.keys(n).forEach(function(e){i[e]=n[e]}),i)},this.list=function(e){var i,n;return void 0!==e?void 0===this._resolved[e]?[]:Object.keys(this._resolved[e]):(i=[],n=this._resolved,Object.keys(n).forEach(function(t){i=i.concat(Object.keys(n[t]).map(function(e){return""===t&&-1===e.indexOf("-")?e:t+":"+e}))}),i)},this}function $(){w&&(w=!1,m.scanDOM())}function J(e,t,i){var n,r,o,s,a;if(1===t)return e;if(i=void 0===i?100:i,"number"==typeof e)return Math.ceil(e*t*i)/i;if("string"!=typeof e)return e;if(null===(n=e.split(O))||!n.length)return e;for(r=[],o=n.shift(),s=j.test(o);;){if(s?(a=parseFloat(o),isNaN(a)?r.push(o):r.push(Math.ceil(a*t*i)/i)):r.push(o),void 0===(o=n.shift()))return r.join("");s=!s}}function K(e,t,i){var n,r,o;for(n=0;n<t.length;n++)if(void 0!==e[r=t[n]])switch(typeof(o=e[r])){case"boolean":return o;case"number":return!!o;case"string":switch(o.toLowerCase()){case"1":case"true":case r:return!0;case"0":case"false":case"":return!1}}return i}function U(e,t,i){var n,r;for(n=0;n<t.length;n++)if(void 0!==e[r=t[n]])return e[r];return i}function X(e,t){var i;return"<?"===e.slice(0,2)&&(i=e.indexOf(">"),e=e.slice(i+1)),e=-1!==(i=(e=e.replace("viewbox=","viewBox=").replace("preserveaspectratio=","preserveAspectRatio=")).indexOf("</"))?e.replace("</",t+"</"):e.replace("/>",">"+t+"</svg>")}t=G,"function"!=typeof window.CustomEvent&&(D.prototype=window.Event.prototype,window.CustomEvent=D),t.event=function(e,t){document.dispatchEvent(new CustomEvent(e,t))},i=n,o=(r=G).config,s=null,r.DOMReadyCallback=function(){r.domready=!0,r.nextInitItem()},r.initTimeout=function(e){function t(){if(null!==s){if(!1!==s.callback())return s.stop(),void r.nextInitItem();s.counter++,10!==s.counter&&25!==s.counter||(window.clearInterval(s.id),s.id=window.setInterval(t,10===s.counter?250:1e3))}}null!==s&&s.stop(),s={id:window.setInterval(t,100),counter:0,callback:e,stop:function(){window.clearInterval(s.id),s=null},nextTick:t}},r.domready=!1,r.ready=!1,r.initQueue=[],r.readyQueue=[],r.nextInitItem=function(){var e;if(!r.ready){if(r.initQueue.length)e=r.initQueue.shift();else{if(!r.domready)return void r.initTimeout(function(){return!r.domready&&document.body&&r.scanDOM(),r.domready});if(!r.readyQueue.length)return r.ready=i.isReady=!0,r.event(o._readyEvent),void r.scanDOM();e=r.readyQueue.shift()}!1!==e()&&r.nextInitItem()}},r.addStylesheet=function(e){var t;if(!document.head||!document.body)return!!r.domready||(e||r.initTimeout(r.addStylesheet.bind(null,!0)),!1);try{(t=document.createElement("style")).type="text/css",t.innerHTML="span.iconify, i.iconify, iconify-icon { display: inline-block; width: 1em; }",null!==document.head.firstChild?document.head.insertBefore(t,document.head.firstChild):document.head.appendChild(t)}catch(e){}return!0},r.initQueue.push(r.addStylesheet.bind(null,!1)),i.ready=function(e){i.isReady?window.setTimeout(e):document.addEventListener(o._readyEvent,e)},window.setTimeout(function(){"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?r.domready=!0:(document.addEventListener("DOMContentLoaded",Q),window.addEventListener("load",Q)),r.nextInitItem()}),(a=G.config).SVGAttributes=Object.create(null),a._imageClass="iconify",a._loadingClass="svg-loading",a._iconAttribute="data-icon",a._rotateAttribute="data-rotate",a._flipAttribute="data-flip",a._inlineModeAttribute="data-inline",a._alignAttribute="data-align",a._appendAttribute="data-icon-append",a._appendedClass="svg-appended",a._readyEvent="IconifyReady",a._webComponentsPolyfill="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents-lite.min.js",a._classListPolyfill="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20150312/classList.min.js",c=n,l=e,u=G.config,c.setConfig=function(e,t){z(e,t,!1)},c.setCustomAPI=function(e,t){switch(typeof e){case"string":0;break;case"object":if(e instanceof Array){0;break}default:return}e.forEach(function(e){null===t?delete u.API[e]:u.API[e]=t})},c.getConfig=function(e){return void 0===u[e]?void 0===u["_"+e]?null:u["_"+e]:u[e]},["SimpleSVG","Iconify"].forEach(function(e){var t;void 0!==l[e+"Config"]&&"object"==typeof l[e+"Config"]&&(t=l[e+"Config"],Object.keys(t).forEach(function(e){z(e,t[e],!0)}))}),f=(d=G).config,h=e,d.initQueue.push(function(){var e={observer:!1,classList:!1},t={observer:!1,classList:!1};function i(e){var t;return!e.length||(document.head?((t=document.createElement("script")).setAttribute("src",e),t.setAttribute("type","text/javascript"),document.head.appendChild(t),!0):d.domready)}function n(){if("classList"in document.createElement("div"))return 1;t.classList||(t.classList=i(f._classListPolyfill))}function r(){return h.MutationObserver&&h.WeakMap||t.observer||(t.observer=i(f._webComponentsPolyfill)),1}return e.classList=!n(),e.observer=!r(),!e.classList&&!e.observer||(d.initTimeout(function(){return!(e.observer&&!r()||e.classList&&!n())}),!1)}),G.getPrefix=function(e,t){var i;return"string"==typeof t&&""!==t?{prefix:t,icon:e}:2===(i=e.split(":")).length?{prefix:i[0],icon:i[1]}:1<(i=e.split("-")).length?{prefix:t=i.shift(),icon:i.join("-")}:{prefix:"",icon:e}},p=G.getPrefix,v={left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1},g=["left","top","width","height","body","rotate","vFlip","hFlip","inlineTop","inlineHeight","verticalAlign"],W.mergeFlip=B,W.mergeRotation=q,W.blankIcon=function(){return Y({body:"",width:16,height:16})},G.Storage=W,b=n,y=e,w=!1,_=new(m=G).Storage,b.addCollection=function(e,t){_.addCollection(e),w||!0===t||(w=!0,window.setTimeout($,0))},b.addIcon=function(e,t,i){_.addIcon(e,t),w||!0===i||(w=!0,window.setTimeout($,0))},b.iconExists=_.exists.bind(_),b.getIcon=_.copyIcon.bind(_),b.listIcons=_.list.bind(_),["SimpleSVG","Iconify"].forEach(function(e){void 0!==y[e+"Preload"]&&y[e+"Preload"]instanceof Array&&y[e+"Preload"].forEach(function(e){"object"==typeof e&&void 0!==e.icons&&b.addCollection(e)})}),x=G.Storage,A=G.config,O=/(-?[0-9.]*[0-9]+[0-9.]*)/g,j=/^-?[0-9.]*[0-9]+[0-9.]*$/g,I=["width","height","inline"],E=["title"],k=0,G.SVG=function(_){return _=_||x.blankIcon(),this.item=_,this.height=function(e,t,i){return void 0===e?t?this.item.inlineHeight:this.item.height:J(e,(t?this.item.inlineHeight:this.item.height)/this.item.width,i)},this.width=function(e,t,i){return void 0===e?this.item.width:J(e,this.item.width/(t?this.item.inlineHeight:this.item.height),i)},this.defaultAttributes=function(){return{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",focusable:"false"}},this.preserveAspectRatio=function(e,t,i){var n="";switch(e){case"left":n+="xMin";break;case"right":n+="xMax";break;default:n+="xMid"}switch(t){case"top":n+="YMin";break;case"bottom":n+="YMax";break;default:n+="YMid"}return n+=!0===i?" slice":" meet"},this.htmlspecialchars=function(e){switch(typeof e){case"boolean":case"number":return e+"";case"string":return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return""},this.attributes=function(t){var e,i,n,r,o,s,a,c,l,u,d,f,h,p,v=this,g={horizontal:"center",vertical:"middle",crop:!1},b={rotate:_.rotate,hFlip:_.hFlip,vFlip:_.vFlip},m="",y=this.defaultAttributes(),w=[];if(s=K(t="object"==typeof t?t:Object.create(null),[A._inlineModeAttribute,"inline"],!0),u=K(t,[A._appendAttribute],!1),e={left:_.left,top:s?_.inlineTop:_.top,width:_.width,height:s?_.inlineHeight:_.height},"string"==typeof t[A._flipAttribute]&&t[A._flipAttribute].split(/[\s,]+/).forEach(function(e){switch(e=e.toLowerCase()){case"horizontal":b.hFlip=!b.hFlip;break;case"vertical":b.vFlip=!b.vFlip}}),void 0!==t[A._rotateAttribute])if("number"==typeof(c=t[A._rotateAttribute]))b.rotate+=c;else if("string"==typeof c)if(""===(d=c.replace(/^-?[0-9.]*/,"")))c=parseInt(c),isNaN(c)||(b.rotate+=c);else if(d!==c){switch(l=!1,d){case"%":l=25;break;case"deg":l=90}l&&(c=parseInt(c.slice(0,c.length-d.length)),isNaN(c)||(b.rotate+=Math.round(c/l)))}switch(b.hFlip?b.vFlip?b.rotate+=2:(w.push("translate("+(e.width+e.left)+" "+(0-e.top)+")"),w.push("scale(-1 1)"),e.top=e.left=0):b.vFlip&&(w.push("translate("+(0-e.left)+" "+(e.height+e.top)+")"),w.push("scale(1 -1)"),e.top=e.left=0),b.rotate%4){case 1:p=e.height/2+e.top,w.unshift("rotate(90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p);break;case 2:w.unshift("rotate(180 "+(e.width/2+e.left)+" "+(e.height/2+e.top)+")");break;case 3:p=e.width/2+e.left,w.unshift("rotate(-90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p)}return i=U(t,["data-width","width"],null),n=U(t,["data-height","height"],null),null===i&&null===n&&(n="1em"),null!==i&&null!==n?(r=i,o=n):null!==i?o=J(r=i,e.height/e.width):r=J(o=n,e.width/e.height),!1!==r&&(y.width="auto"===r?e.width:r),!1!==o&&(y.height="auto"===o?e.height:o),s&&0!==_.verticalAlign?m+="vertical-align: "+(h=_.verticalAlign+"em")+";":h="","string"==typeof t[A._alignAttribute]&&t[A._alignAttribute].toLowerCase().split(/[\s,]+/).forEach(function(e){switch(e){case"left":case"right":case"center":g.horizontal=e;break;case"top":case"bottom":case"middle":g.vertical=e;break;case"crop":g.crop=!0;break;case"meet":g.crop=!1}}),m+="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);",y.style=m+(void 0===t.style?"":t.style),y.preserveAspectRatio=this.preserveAspectRatio(g.horizontal,g.vertical,g.crop),y.viewBox=e.left+" "+e.top+" "+e.width+" "+e.height,a=function(i){var e,n,t=/\sid="(\S+)"/g,r=[];function o(e,t,i){for(var n=0;-1!==(n=i.indexOf(e,n));)i=i.slice(0,n)+t+i.slice(n+e.length),n+=t.length;return i}for(;e=t.exec(i);)r.push(e[1]);return r.length&&(n="IconifyId-"+Date.now().toString(16)+"-"+(16777216*Math.random()|0).toString(16)+"-",r.forEach(function(e){var t=n+k;k++,i=o('="'+e+'"','="'+t+'"',i),i=o('="#'+e+'"','="#'+t+'"',i),i=o("(#"+e+")","(#"+t+")",i)})),i}(this.item.body),w.length&&(a='<g transform="'+w.join(" ")+'">'+a+"</g>"),f=Object.create(null),Object.keys(t).forEach(function(e){void 0===y[e]&&(-1!==E.indexOf(e)?a="<"+e+">"+v.htmlspecialchars(t[e])+"</"+e+">"+a:-1===I.indexOf(e)&&(f[e]=t[e]))}),{attributes:y,elementAttributes:f,body:a,append:u,verticalAlign:h}},this},L=(C=G).config._loadingClass,C.newImage=function(e,t,i){return{element:e,icon:t,parser:i,loading:e.classList.contains(L)}},C.parsedImage=function(e,t){return{element:e,icon:t}},C.getImageAttributes=function(t){var e,i,n=Object.create(null);if(!t.element.hasAttributes())return n;for(e=0;e<t.element.attributes.length;e++)i=t.element.attributes[e],n[i.name]=i.value;return t.parser&&void 0!==t.parser.filterAttributes&&(n=t.parser.filterAttributes(t,n)),void 0!==n.class&&(n.class=n.class.split(" ").filter(function(e){return e!==L}),t.parser&&void 0!==t.parser.filterClasses&&(n.class=t.parser.filterClasses(t,n.class)),n.class=n.class.join(" ")),void 0!==t.attributes&&Object.keys(t.attributes).forEach(function(e){n[e]=t.attributes[e]}),n},function(n,f,e){var s=e._imageClass,t=e._loadingClass,i=e._appendedClass,a=e._iconAttribute,r=e._inlineModeAttribute,o=":not(svg):not(."+i+")",c=":not(."+t+")",l="."+t,h={iconify:{selector:"."+s,selectorAll:"."+s+o,selectorNew:"."+s+o+c,selectorLoading:"."+s+o+l,icon:function(e){var t,i=e.getAttribute(a);if("string"==typeof i)return i;for(var n=0;n<e.classList.length;n++)if(5<(t=e.classList[n]).length&&"icon:"===t.slice(0,5))return t.slice(5);return""},filterClasses:function(e,t){var i,n,r;for(n=0;n<t.length;n++)"icon-"===(i=t[n]).slice(0,5)&&2===(i=i.slice(5).split(":")).length&&(r="data-"+i[0],void 0===e.attributes&&(e.attributes=Object.create(null)),e.attributes[r]=i[1]);return t}}},p=Object.keys(h);n.addFinder=function(e,t){void 0===t.selectorAll&&(t.selectorAll=t.selector+o),void 0===t.selectorNew&&(t.selectorNew=t.selector+o+c),void 0===t.selectorLoading&&(t.selectorLoading=t.selector+o+l),h[e]=t,p=Object.keys(h),n.isReady&&n.scanDOM()},n.addTag=function(e,i,t){n.addFinder("tag-"+e,{selector:e,icon:null==t?h.iconify.icon:t,filterAttributes:function(e,t){return void 0===t[r]&&(t[r]=i),t},filterClasses:h.iconify.filterClasses})};try{"object"==typeof Reflect&&"object"==typeof customElements&&Object.setPrototypeOf&&(Object.setPrototypeOf(u.prototype,HTMLElement.prototype),Object.setPrototypeOf(u,HTMLElement),customElements.define("iconify-icon",u))}catch(e){}function u(){return Reflect.construct(HTMLElement,[],u)}n.addTag("iconify-icon",!1),f.findNewImages=function(c,l){var u=[],d=[];return(c=void 0===c?void 0===e._root?document.body:e._root:c)&&p.forEach(function(e){var t,i,n,r,o=h[e],s=!0===l?o.selectorLoading:!1===l?o.selectorNew:o.selectorAll,a=c.querySelectorAll(s);for(t=0;t<a.length;t++)i=a[t],(n=o.icon(i))&&-1===d.indexOf(i)&&(d.push(i),r=f.newImage(i,n,o),u.push(r))}),u},f.findParsedImages=function(e){var t,i,n,r=[],o=e.querySelectorAll("svg."+s);for(t=0;t<o.length;t++)(n=(i=o[t]).getAttribute(a))&&r.push(f.parsedImage(i,n));return r}}(n,G,G.config),G.loadImage=function(e,t){var i=G.getPrefix(e.icon);return n.iconExists(i.icon,i.prefix)},n.pauseObserving=function(){},n.resumeObserving=function(){},M=n,F=(S=G).config,T=F._iconAttribute,N=F._loadingClass,P=F._imageClass,H=F._appendedClass,S.renderSVG=function(t){var e,i,n,r,o,s,a,c,l,u,d,f=S.getImageAttributes(t),h=M.getIcon(t.icon);for(f[T]=t.icon,e=new S.SVG(h),n=document.createElement("svg"),o=e.attributes(f),Object.keys(o.attributes).forEach(function(e){if(d=o.attributes[e],"style"!==e||"string"==typeof(d=t.element.getAttribute("style"))&&d.length)try{n.setAttribute(e,d)}catch(e){}}),Object.keys(o.elementAttributes).forEach(function(e){try{(o.append?t.element:n).setAttribute(e,o.elementAttributes[e])}catch(e){}}),t.loading&&(n.classList.remove(N),o.append&&t.element.classList.remove(N)),n.classList.add(P),s=X(n.outerHTML,o.body),(r=document.createElement("span")).innerHTML=s,i=r.childNodes[0],o.append?(t.element.classList.add(H),t.element.appendChild(i)):(t.element.parentNode.replaceChild(i,t.element),t.element=i),a=i.style,c=t.element.style,o.verticalAlign&&(a.verticalAlign=o.verticalAlign),a.transform="rotate(360deg)",l=0;l<c.length;l++)a[u=c[l]]=c[u];delete t.parser,delete t.loading},M.getSVGObject=function(e,t){return!!M.iconExists(e)&&new S.SVG(M.getIcon(e)).attributes(t,!1)},M.getSVG=function(e,t){var i,n;return!1!==(n=M.getSVGObject(e,t))&&(i=document.createElement("svg"),Object.keys(n.attributes).forEach(function(e){try{i.setAttribute(e,n.attributes[e])}catch(e){}}),X(i.outerHTML,n.body))},R=n,(V=G).scanDOM=function(){var t=!1;function e(){V.findNewImages().forEach(function(e){V.loadImage(e)&&(t||(t=!0,R.pauseObserving()),V.renderSVG(e))})}if(V.ready)e();else try{e()}catch(e){}t&&R.resumeObserving()},R.scanDOM=V.scanDOM,R.getVersion=function(){return V.version}}(self.Iconify,self)),"object"==typeof exports)try{exports.__esModule=!0,exports.default=self.Iconify}catch(e){} |
@@ -13,2 +13,2 @@ /** | ||
*/ | ||
"use strict";if(void 0===self.Iconify&&(self.Iconify={isReady:!1},self.SimpleSVG=self.Iconify,function(e,t){var i,n,o,r,a,s,c,l,u,d,f,h,p,v,g,b,m,y,w,_,x,O,j,A,I,E,k,C,M,L,S,N,P,T,F,R,D,H,V,G,Q,z,B,q,Y,J,U,W,$,K,X,Z,ee,te,ie,ne,oe,re={config:{},version:"1.0.5"};function ae(e,t){var i;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},(i=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}function se(){document.removeEventListener("DOMContentLoaded",se),window.removeEventListener("load",se),o.DOMReadyCallback()}function ce(t,i,e){var n=t;if("_"!==t.slice(0,1)){if(void 0===u[t]){if(!e||void 0===u["_"+t])return;n="_"+t}switch(n){case"API":case"SVGAttributes":Object.keys(i).forEach(function(e){null===i[t]?delete u[n][e]:u[n][e]=i[e]});break;default:u[n]=i}}}function le(e,t){return function(e,t){switch(e){case"rotate":return t=parseInt(t),isNaN(t)?null:t;case"width":case"height":case"inlineHeight":case"inlineTop":case"verticalAlign":return t=parseFloat(t),isNaN(t)?null:t;case"vFlip":case"hFlip":return!!t;case"body":case"parent":return"string"==typeof t?t:null}return t}("rotate",e+t)}function ue(e,t){return!!e!=!!t}function de(e){var i=Object.create(null);return(void 0===e._defaults?[e,v]:[e,e._defaults,v]).forEach(function(t){Object.keys(t).forEach(function(e){"object"!=typeof t[e]&&void 0===i[e]&&(i[e]=t[e])})}),void 0===i.inlineTop&&(i.inlineTop=i.top),void 0===i.inlineHeight&&(i.inlineHeight=i.height),void 0===i.verticalAlign&&(i.height%7==0&&i.height%8!=0?i.verticalAlign=-.143:i.verticalAlign=-.125),i}function fe(){return this._icons=Object.create(null),this._aliases=Object.create(null),this._resolved=Object.create(null),this._add=function(e,t,i){var n=e?"_aliases":"_icons";void 0===this._resolved[t.prefix]?(this._resolved[t.prefix]=Object.create(null),this._icons[t.prefix]=Object.create(null),this._aliases[t.prefix]=Object.create(null)):(delete this._icons[t.prefix][t.icon],delete this._aliases[t.prefix][t.icon]),this._resolved[t.prefix][t.icon]=!1,this[n][t.prefix][t.icon]=i},this._resolveIcon=function(e){var t,i,n,o,r,a;if(void 0===this._resolved[e.prefix]||void 0===this._resolved[e.prefix][e.icon])return null;if(!1!==this._resolved[e.prefix][e.icon])return this._resolved[e.prefix][e.icon];if(void 0!==this._icons[e.prefix][e.icon])return this._resolved[e.prefix][e.icon]=de(this._icons[e.prefix][e.icon]);for(i=0,t=this._aliases[e.prefix][e.icon],n=Object.create(null),Object.keys(t).forEach(function(e){"parent"!==e&&(n[e]=t[e])}),o=t.parent;;){if(5<++i||void 0===this._resolved[e.prefix][o])return this._resolved[e.prefix][e.icon]=null;if(r=void 0===this._icons[e.prefix][o],a=this[r?"_aliases":"_icons"][e.prefix][o],Object.keys(a).forEach(function(e){if(void 0!==n[e])switch(e){case"rotate":n[e]=le(n[e],a[e]);break;case"hFlip":case"vFlip":n[e]=ue(n[e],a[e])}else"parent"!==e&&(n[e]=a[e])}),!r)break;o=a.parent}return this._resolved[e.prefix][e.icon]=de(n)},this.addCollection=function(n){var o=this,r=Object.create(null);g.forEach(function(e){void 0!==n[e]?r[e]=n[e]:void 0!==v[e]&&(r[e]=v[e])}),void 0!==n.icons&&Object.keys(n.icons).forEach(function(e){var t=p(e,n.prefix),i=n.icons[e];void 0!==i.body&&(i._defaults=r,o._add(!1,t,i))}),void 0!==n.aliases&&Object.keys(n.aliases).forEach(function(e){var t=p(e,n.prefix),i=n.aliases[e];if(void 0!==i.parent){if(void 0===n.prefix){if(i.parent.slice(0,t.prefix.length)!==t.prefix)return;i.parent=i.parent.slice(t.prefix.length+1)}o._add(!0,t,i)}})},this.addIcon=function(e,t,i){var n=void 0!==t.parent,o=p(e,i);if(n&&void 0===i){if(t.parent.slice(0,o.prefix.length)!==o.prefix)return;t.parent=t.parent.slice(o.prefix.length+1)}this._add(n,o,t)},this.exists=function(e,t){var i=p(e,t);return void 0!==this._resolved[i.prefix]&&void 0!==this._resolved[i.prefix][i.icon]},this.getIcon=function(e,t){var i=p(e,t);return this._resolveIcon(i)},this.copyIcon=function(e,t){var i,n=this.getIcon(e,t);return null===n?null:(i=Object.create(null),Object.keys(n).forEach(function(e){i[e]=n[e]}),i)},this.list=function(e){var i,n;return void 0!==e?void 0===this._resolved[e]?[]:Object.keys(this._resolved[e]):(i=[],n=this._resolved,Object.keys(n).forEach(function(t){i=i.concat(Object.keys(n[t]).map(function(e){return""===t&&-1===e.indexOf("-")?e:t+":"+e}))}),i)},this}function he(){w&&(w=!1,m.scanDOM())}function pe(e,t,i){var n,o,r,a,s;if(1===t)return e;if(i=void 0===i?100:i,"number"==typeof e)return Math.ceil(e*t*i)/i;if("string"!=typeof e)return e;if(null===(n=e.split(j))||!n.length)return e;for(o=[],r=n.shift(),a=A.test(r);;){if(a?(s=parseFloat(r),isNaN(s)?o.push(r):o.push(Math.ceil(s*t*i)/i)):o.push(r),void 0===(r=n.shift()))return o.join("");a=!a}}function ve(e,t,i){var n,o,r;for(n=0;n<t.length;n++)if(void 0!==e[o=t[n]])switch(typeof(r=e[o])){case"boolean":return r;case"number":return!!r;case"string":switch(r.toLowerCase()){case"1":case"true":case o:return!0;case"0":case"false":case"":return!1}}return i}function ge(e,t,i){var n,o;for(n=0;n<t.length;n++)if(void 0!==e[o=t[n]])return e[o];return i}function be(){var a=N.loaderMaxURLSize,o=Object.create(null);function s(e,t){var i,n=o[e];"function"!=typeof n?(n=n.replace("{icons}",t.join(",")),(i=document.createElement("script")).setAttribute("type","text/javascript"),i.setAttribute("src",n),i.setAttribute("async",!0),document.head.appendChild(i)):n.call(L,e,t)}function c(e){var t=void 0===N.API[e]?N.defaultAPI:N.API[e];return"function"==typeof t?(o[e]=t,!1):-1===t.indexOf("{icons}")?(o[e]=t,null):(t=t.replace("{prefix}",e).replace("{callback}","Iconify._loaderCallback"),(o[e]=t).replace("{icons}","").length)}Object.keys(T).forEach(function(i){var n=c(i),o=!1===n,r=[];if(null===n)return s(i,[]),void(F[i]=!0);T[i].forEach(function(e,t){o||(n+=e.length+1,a<=n&&(s(i,r),r=[],n=c(i)+e.length+1)),r.push(e)}),r.length&&s(i,r),F[i]=void 0===F[i]?T[i]:F[i].concat(T[i]),delete T[i]}),D=!1}function me(e,t,i){return i||S.domready||N.loadBeforeDOMReady?(void 0===T[e]||-1===T[e].indexOf(t))&&(void 0===F[e]||!0!==F[e]&&-1===F[e].indexOf(t))&&(void 0===T[e]&&(T[e]=[]),T[e].push(t),D||(D=!0,window.setTimeout(be,0)),1):(o=t,void 0===R[n=e]&&(R[n]=Object.create(null)),R[n][o]=!0,void 0===S._loaderDOMReady&&(S._loaderDOMReady=S.DOMReadyCallback,S.DOMReadyCallback=function(){S._loaderDOMReady(),Object.keys(R).forEach(function(t){Object.keys(R[t]).forEach(function(e){L.iconExists(e,t)||me(t,e,!0)})})}),1);var n,o}function ye(){var e;!1!==U&&U.length?(e=U,U=!1,Q.scanDOM(e)):U=!1}function we(e){e.forEach(function(e){var t;if(!1===U&&(U=[],window.setTimeout(ye,0)),e.addedNodes)for(t=0;t<e.addedNodes.length;t++)U.push(e.addedNodes[t])})}function _e(){q.observe(void 0===z._root?document.querySelector("body"):z._root,W)}function xe(e,t){var i;return"<?"===e.slice(0,2)&&(i=e.indexOf(">"),e=e.slice(i+1)),e=-1!==(i=(e=e.replace("viewbox=","viewBox=").replace("preserveaspectratio=","preserveAspectRatio=")).indexOf("</"))?e.replace("</",t+"</"):e.replace("/>",">"+t+"</svg>")}i=re,"function"!=typeof window.CustomEvent&&(ae.prototype=window.Event.prototype,window.CustomEvent=ae),i.event=function(e,t){document.dispatchEvent(new CustomEvent(e,t))},n=e,r=(o=re).config,a=null,o.DOMReadyCallback=function(){o.domready=!0,o.nextInitItem()},o.initTimeout=function(e){function t(){if(null!==a){if(!1!==a.callback())return a.stop(),void o.nextInitItem();a.counter++,10!==a.counter&&25!==a.counter||(window.clearInterval(a.id),a.id=window.setInterval(t,10===a.counter?250:1e3))}}null!==a&&a.stop(),a={id:window.setInterval(t,100),counter:0,callback:e,stop:function(){window.clearInterval(a.id),a=null},nextTick:t}},o.domready=!1,o.ready=!1,o.initQueue=[],o.readyQueue=[],o.nextInitItem=function(){var e;if(!o.ready){if(o.initQueue.length)e=o.initQueue.shift();else{if(!o.domready)return void o.initTimeout(function(){return!o.domready&&document.body&&o.scanDOM(),o.domready});if(!o.readyQueue.length)return o.ready=n.isReady=!0,o.event(r._readyEvent),void o.scanDOM();e=o.readyQueue.shift()}!1!==e()&&o.nextInitItem()}},o.addStylesheet=function(e){var t;if(!document.head||!document.body)return!!o.domready||(e||o.initTimeout(o.addStylesheet.bind(null,!0)),!1);try{(t=document.createElement("style")).type="text/css",t.innerHTML="span.iconify, i.iconify, iconify-icon { display: inline-block; width: 1em; }",null!==document.head.firstChild?document.head.insertBefore(t,document.head.firstChild):document.head.appendChild(t)}catch(e){}return!0},o.initQueue.push(o.addStylesheet.bind(null,!1)),n.ready=function(e){n.isReady?window.setTimeout(e):document.addEventListener(r._readyEvent,e)},window.setTimeout(function(){"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?o.domready=!0:(document.addEventListener("DOMContentLoaded",se),window.addEventListener("load",se)),o.nextInitItem()}),(s=re.config).SVGAttributes=Object.create(null),s._imageClass="iconify",s._loadingClass="svg-loading",s._iconAttribute="data-icon",s._rotateAttribute="data-rotate",s._flipAttribute="data-flip",s._inlineModeAttribute="data-inline",s._alignAttribute="data-align",s._appendAttribute="data-icon-append",s._appendedClass="svg-appended",s._readyEvent="IconifyReady",s._webComponentsPolyfill="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents-lite.min.js",s._classListPolyfill="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20150312/classList.min.js",function(t){t.defaultAPI="https://api.iconify.design/{prefix}.js?icons={icons}",t.API=Object.create(null),t.loaderMaxURLSize=500,t.loadBeforeDOMReady=!(document&&document.body),t._loaderEvent="IconifyAddedIcons",t.sessionStorage=!0;try{t.localStorage=!!(window&&window.localStorage&&window.localStorage.length)}catch(e){t.localStorage=!1}}(re.config),c=e,l=t,u=re.config,c.setConfig=function(e,t){ce(e,t,!1)},c.setCustomAPI=function(e,t){switch(typeof e){case"string":0;break;case"object":if(e instanceof Array){0;break}default:return}e.forEach(function(e){null===t?delete u.API[e]:u.API[e]=t})},c.getConfig=function(e){return void 0===u[e]?void 0===u["_"+e]?null:u["_"+e]:u[e]},["SimpleSVG","Iconify"].forEach(function(e){var t;void 0!==l[e+"Config"]&&"object"==typeof l[e+"Config"]&&(t=l[e+"Config"],Object.keys(t).forEach(function(e){ce(e,t[e],!0)}))}),f=(d=re).config,h=t,d.initQueue.push(function(){var e={observer:!1,classList:!1},t={observer:!1,classList:!1};function i(e){var t;return!e.length||(document.head?((t=document.createElement("script")).setAttribute("src",e),t.setAttribute("type","text/javascript"),document.head.appendChild(t),!0):d.domready)}function n(){if("classList"in document.createElement("div"))return 1;t.classList||(t.classList=i(f._classListPolyfill))}function o(){return h.MutationObserver&&h.WeakMap||t.observer||(t.observer=i(f._webComponentsPolyfill)),1}return e.classList=!n(),e.observer=!o(),!e.classList&&!e.observer||(d.initTimeout(function(){return!(e.observer&&!o()||e.classList&&!n())}),!1)}),re.getPrefix=function(e,t){var i;return"string"==typeof t&&""!==t?{prefix:t,icon:e}:2===(i=e.split(":")).length?{prefix:i[0],icon:i[1]}:1<(i=e.split("-")).length?{prefix:t=i.shift(),icon:i.join("-")}:{prefix:"",icon:e}},p=re.getPrefix,v={left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1},g=["left","top","width","height","body","rotate","vFlip","hFlip","inlineTop","inlineHeight","verticalAlign"],fe.mergeFlip=ue,fe.mergeRotation=le,fe.blankIcon=function(){return de({body:"",width:16,height:16})},re.Storage=fe,b=e,y=t,w=!1,_=new(m=re).Storage,b.addCollection=function(e,t){_.addCollection(e),w||!0===t||(w=!0,window.setTimeout(he,0))},b.addIcon=function(e,t,i){_.addIcon(e,t),w||!0===i||(w=!0,window.setTimeout(he,0))},b.iconExists=_.exists.bind(_),b.getIcon=_.copyIcon.bind(_),b.listIcons=_.list.bind(_),["SimpleSVG","Iconify"].forEach(function(e){void 0!==y[e+"Preload"]&&y[e+"Preload"]instanceof Array&&y[e+"Preload"].forEach(function(e){"object"==typeof e&&void 0!==e.icons&&b.addCollection(e)})}),x=re.Storage,O=re.config,j=/(-?[0-9.]*[0-9]+[0-9.]*)/g,A=/^-?[0-9.]*[0-9]+[0-9.]*$/g,I=["width","height","inline"],E=["title"],k=0,re.SVG=function(_){return _=_||x.blankIcon(),this.item=_,this.height=function(e,t,i){return void 0===e?t?this.item.inlineHeight:this.item.height:pe(e,(t?this.item.inlineHeight:this.item.height)/this.item.width,i)},this.width=function(e,t,i){return void 0===e?this.item.width:pe(e,this.item.width/(t?this.item.inlineHeight:this.item.height),i)},this.defaultAttributes=function(){return{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",focusable:"false"}},this.preserveAspectRatio=function(e,t,i){var n="";switch(e){case"left":n+="xMin";break;case"right":n+="xMax";break;default:n+="xMid"}switch(t){case"top":n+="YMin";break;case"bottom":n+="YMax";break;default:n+="YMid"}return n+=!0===i?" slice":" meet"},this.htmlspecialchars=function(e){switch(typeof e){case"boolean":case"number":return e+"";case"string":return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return""},this.attributes=function(t){var e,i,n,o,r,a,s,c,l,u,d,f,h,p,v=this,g={horizontal:"center",vertical:"middle",crop:!1},b={rotate:_.rotate,hFlip:_.hFlip,vFlip:_.vFlip},m="",y=this.defaultAttributes(),w=[];if(a=ve(t="object"==typeof t?t:Object.create(null),[O._inlineModeAttribute,"inline"],!0),u=ve(t,[O._appendAttribute],!1),e={left:_.left,top:a?_.inlineTop:_.top,width:_.width,height:a?_.inlineHeight:_.height},"string"==typeof t[O._flipAttribute]&&t[O._flipAttribute].split(/[\s,]+/).forEach(function(e){switch(e=e.toLowerCase()){case"horizontal":b.hFlip=!b.hFlip;break;case"vertical":b.vFlip=!b.vFlip}}),void 0!==t[O._rotateAttribute])if("number"==typeof(c=t[O._rotateAttribute]))b.rotate+=c;else if("string"==typeof c)if(""===(d=c.replace(/^-?[0-9.]*/,"")))c=parseInt(c),isNaN(c)||(b.rotate+=c);else if(d!==c){switch(l=!1,d){case"%":l=25;break;case"deg":l=90}l&&(c=parseInt(c.slice(0,c.length-d.length)),isNaN(c)||(b.rotate+=Math.round(c/l)))}switch(b.hFlip?b.vFlip?b.rotate+=2:(w.push("translate("+(e.width+e.left)+" "+(0-e.top)+")"),w.push("scale(-1 1)"),e.top=e.left=0):b.vFlip&&(w.push("translate("+(0-e.left)+" "+(e.height+e.top)+")"),w.push("scale(1 -1)"),e.top=e.left=0),b.rotate%4){case 1:p=e.height/2+e.top,w.unshift("rotate(90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p);break;case 2:w.unshift("rotate(180 "+(e.width/2+e.left)+" "+(e.height/2+e.top)+")");break;case 3:p=e.width/2+e.left,w.unshift("rotate(-90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p)}return i=ge(t,["data-width","width"],null),n=ge(t,["data-height","height"],null),null===i&&null===n&&(n="1em"),null!==i&&null!==n?(o=i,r=n):null!==i?r=pe(o=i,e.height/e.width):o=pe(r=n,e.width/e.height),!1!==o&&(y.width="auto"===o?e.width:o),!1!==r&&(y.height="auto"===r?e.height:r),a&&0!==_.verticalAlign?m+="vertical-align: "+(h=_.verticalAlign+"em")+";":h="","string"==typeof t[O._alignAttribute]&&t[O._alignAttribute].toLowerCase().split(/[\s,]+/).forEach(function(e){switch(e){case"left":case"right":case"center":g.horizontal=e;break;case"top":case"bottom":case"middle":g.vertical=e;break;case"crop":g.crop=!0;break;case"meet":g.crop=!1}}),m+="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);",y.style=m+(void 0===t.style?"":t.style),y.preserveAspectRatio=this.preserveAspectRatio(g.horizontal,g.vertical,g.crop),y.viewBox=e.left+" "+e.top+" "+e.width+" "+e.height,s=function(i){var e,n,t=/\sid="(\S+)"/g,o=[];function r(e,t,i){for(var n=0;-1!==(n=i.indexOf(e,n));)i=i.slice(0,n)+t+i.slice(n+e.length),n+=t.length;return i}for(;e=t.exec(i);)o.push(e[1]);return o.length&&(n="IconifyId-"+Date.now().toString(16)+"-"+(16777216*Math.random()|0).toString(16)+"-",o.forEach(function(e){var t=n+k;k++,i=r('="'+e+'"','="'+t+'"',i),i=r('="#'+e+'"','="#'+t+'"',i),i=r("(#"+e+")","(#"+t+")",i)})),i}(this.item.body),w.length&&(s='<g transform="'+w.join(" ")+'">'+s+"</g>"),f=Object.create(null),Object.keys(t).forEach(function(e){void 0===y[e]&&(-1!==E.indexOf(e)?s="<"+e+">"+v.htmlspecialchars(t[e])+"</"+e+">"+s:-1===I.indexOf(e)&&(f[e]=t[e]))}),{attributes:y,elementAttributes:f,body:s,append:u,verticalAlign:h}},this},M=(C=re).config._loadingClass,C.newImage=function(e,t,i){return{element:e,icon:t,parser:i,loading:e.classList.contains(M)}},C.parsedImage=function(e,t){return{element:e,icon:t}},C.getImageAttributes=function(t){var e,i,n=Object.create(null);if(!t.element.hasAttributes())return n;for(e=0;e<t.element.attributes.length;e++)i=t.element.attributes[e],n[i.name]=i.value;return t.parser&&void 0!==t.parser.filterAttributes&&(n=t.parser.filterAttributes(t,n)),void 0!==n.class&&(n.class=n.class.split(" ").filter(function(e){return e!==M}),t.parser&&void 0!==t.parser.filterClasses&&(n.class=t.parser.filterClasses(t,n.class)),n.class=n.class.join(" ")),void 0!==t.attributes&&Object.keys(t.attributes).forEach(function(e){n[e]=t.attributes[e]}),n},function(n,f,e){var a=e._imageClass,t=e._loadingClass,i=e._appendedClass,s=e._iconAttribute,o=e._inlineModeAttribute,r=":not(svg):not(."+i+")",c=":not(."+t+")",l="."+t,h={iconify:{selector:"."+a,selectorAll:"."+a+r,selectorNew:"."+a+r+c,selectorLoading:"."+a+r+l,icon:function(e){var t,i=e.getAttribute(s);if("string"==typeof i)return i;for(var n=0;n<e.classList.length;n++)if(5<(t=e.classList[n]).length&&"icon:"===t.slice(0,5))return t.slice(5);return""},filterClasses:function(e,t){var i,n,o;for(n=0;n<t.length;n++)"icon-"===(i=t[n]).slice(0,5)&&2===(i=i.slice(5).split(":")).length&&(o="data-"+i[0],void 0===e.attributes&&(e.attributes=Object.create(null)),e.attributes[o]=i[1]);return t}}},p=Object.keys(h);n.addFinder=function(e,t){void 0===t.selectorAll&&(t.selectorAll=t.selector+r),void 0===t.selectorNew&&(t.selectorNew=t.selector+r+c),void 0===t.selectorLoading&&(t.selectorLoading=t.selector+r+l),h[e]=t,p=Object.keys(h),n.isReady&&n.scanDOM()},n.addTag=function(e,i,t){n.addFinder("tag-"+e,{selector:e,icon:null==t?h.iconify.icon:t,filterAttributes:function(e,t){return void 0===t[o]&&(t[o]=i),t},filterClasses:h.iconify.filterClasses})};try{"object"==typeof Reflect&&"object"==typeof customElements&&Object.setPrototypeOf&&(Object.setPrototypeOf(u.prototype,HTMLElement.prototype),Object.setPrototypeOf(u,HTMLElement),customElements.define("iconify-icon",u))}catch(e){}function u(){return Reflect.construct(HTMLElement,[],u)}n.addTag("iconify-icon",!1),f.findNewImages=function(c,l){var u=[],d=[];return(c=void 0===c?void 0===e._root?document.body:e._root:c)&&p.forEach(function(e){var t,i,n,o,r=h[e],a=!0===l?r.selectorLoading:!1===l?r.selectorNew:r.selectorAll,s=c.querySelectorAll(a);for(t=0;t<s.length;t++)i=s[t],(n=r.icon(i))&&-1===d.indexOf(i)&&(d.push(i),o=f.newImage(i,n,r),u.push(o))}),u},f.findParsedImages=function(e){var t,i,n,o=[],r=e.querySelectorAll("svg."+a);for(t=0;t<r.length;t++)(n=(i=r[t]).getAttribute(s))&&o.push(f.parsedImage(i,n));return o}}(e,re,re.config),L=e,N=(S=re).config,P=t,T=Object.create(null),F=Object.create(null),R=Object.create(null),H={session:!(D=!1),local:!0},V={session:0,local:0},L._loaderCallback=function(i){var n=!1;"object"==typeof i&&(["local","session"].forEach(function(t){var e;if(!n&&H[t]&&N[t+"Storage"]){e=P[t+"Storage"];try{V[t]||e.setItem("iconify-version",S.version),e.setItem("iconify"+V[t],JSON.stringify(i)),n=!0,V[t]++,e.setItem("iconify-count",V[t])}catch(e){H[t]=!1}}}),L.addCollection(i),S.event(N._loaderEvent))},S.loadImage=function(e,t){var i=S.getPrefix(e.icon);return!!L.iconExists(i.icon,i.prefix)||(!1!==t&&me(i.prefix,i.icon,!1)&&e.element.classList.add(N._loadingClass),!1)},L.preloadImages=function(e){var t,i=!1;return e.forEach(function(e){t=S.getPrefix(e),L.iconExists(t.icon,t.prefix)||(me(t.prefix,t.icon,!0),i=!0)}),i},["local","session"].forEach(function(t){var e,i,n;try{if("object"!=typeof(e=P[t+"Storage"]))return void(H[t]=!1);if(e.getItem("iconify-version")!==S.version)return;if("number"!=typeof(n=parseInt(e.getItem("iconify-count")))||isNaN(n))return;for(;;){if(V[t]>=n)return;if("string"!=typeof(i=e.getItem("iconify"+V[t])))return;"object"==typeof(i=JSON.parse(i))&&L.addCollection(i),V[t]++}}catch(e){H[t]=!1}}),G=e,z=(Q=re).config,B=t,Y=0,W={childList:!(U=!1),subtree:!(J=q=null)},G.pauseObserving=function(){null!==q&&(Y||(J=q.takeRecords(),q.disconnect())),Y++},G.resumeObserving=function(){null!==q?Y&&(--Y||(_e(),null!==J&&J.length&&we(J))):Y--},G.isObserverPaused=function(){return null===q||!!Y},Q.readyQueue.push(function(){return q=new B.MutationObserver(we),Y||_e(),!0}),$=e,X=(K=re).config,Z=X._iconAttribute,ee=X._loadingClass,te=X._imageClass,ie=X._appendedClass,K.renderSVG=function(t){var e,i,n,o,r,a,s,c,l,u,d=K.getImageAttributes(t),f=$.getIcon(t.icon);for(d[Z]=t.icon,e=new K.SVG(f),n=document.createElement("svg"),r=e.attributes(d),Object.keys(r.attributes).forEach(function(e){if("style"!==e)try{n.setAttribute(e,r.attributes[e])}catch(e){}}),Object.keys(r.elementAttributes).forEach(function(e){try{(r.append?t.element:n).setAttribute(e,r.elementAttributes[e])}catch(e){}}),t.loading&&(n.classList.remove(ee),r.append&&t.element.classList.remove(ee)),n.classList.add(te),a=xe(n.outerHTML,r.body),(o=document.createElement("span")).innerHTML=a,i=o.childNodes[0],r.append?(t.element.classList.add(ie),t.element.appendChild(i)):(t.element.parentNode.replaceChild(i,t.element),t.element=i),s=i.style,c=t.element.style,r.verticalAlign&&(s.verticalAlign=r.verticalAlign),s.transform="rotate(360deg)",l=0;l<c.length;l++)s[u=c[l]]=c[u];delete t.parser,delete t.loading},$.getSVGObject=function(e,t){return!!$.iconExists(e)&&new K.SVG($.getIcon(e)).attributes(t,!1)},$.getSVG=function(e,t){var i,n;return!1!==(n=$.getSVGObject(e,t))&&(i=document.createElement("svg"),Object.keys(n.attributes).forEach(function(e){try{i.setAttribute(e,n.attributes[e])}catch(e){}}),xe(i.outerHTML,n.body))},ne=e,(oe=re).scanDOM=function(){var t=!1;function e(){oe.findNewImages().forEach(function(e){oe.loadImage(e)&&(t||(t=!0,ne.pauseObserving()),oe.renderSVG(e))})}if(oe.ready)e();else try{e()}catch(e){}t&&ne.resumeObserving()},ne.scanDOM=oe.scanDOM,ne.getVersion=function(){return oe.version}}(self.Iconify,self)),"object"==typeof exports)try{exports.__esModule=!0,exports.default=self.Iconify}catch(e){} | ||
"use strict";if(void 0===self.Iconify&&(self.Iconify={isReady:!1},self.SimpleSVG=self.Iconify,function(e,t){var i,n,o,r,s,a,c,l,u,d,f,h,p,v,g,b,m,y,w,_,x,O,A,j,I,E,k,C,M,L,S,N,P,T,F,R,D,H,V,G,Q,z,B,q,Y,J,U,W,$,K,X,Z,ee,te,ie,ne,oe,re={config:{},version:"1.0.6"};function se(e,t){var i;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},(i=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}function ae(){document.removeEventListener("DOMContentLoaded",ae),window.removeEventListener("load",ae),o.DOMReadyCallback()}function ce(t,i,e){var n=t;if("_"!==t.slice(0,1)){if(void 0===u[t]){if(!e||void 0===u["_"+t])return;n="_"+t}switch(n){case"API":case"SVGAttributes":Object.keys(i).forEach(function(e){null===i[t]?delete u[n][e]:u[n][e]=i[e]});break;default:u[n]=i}}}function le(e,t){return function(e,t){switch(e){case"rotate":return t=parseInt(t),isNaN(t)?null:t;case"width":case"height":case"inlineHeight":case"inlineTop":case"verticalAlign":return t=parseFloat(t),isNaN(t)?null:t;case"vFlip":case"hFlip":return!!t;case"body":case"parent":return"string"==typeof t?t:null}return t}("rotate",e+t)}function ue(e,t){return!!e!=!!t}function de(e){var i=Object.create(null);return(void 0===e._defaults?[e,v]:[e,e._defaults,v]).forEach(function(t){Object.keys(t).forEach(function(e){"object"!=typeof t[e]&&void 0===i[e]&&(i[e]=t[e])})}),void 0===i.inlineTop&&(i.inlineTop=i.top),void 0===i.inlineHeight&&(i.inlineHeight=i.height),void 0===i.verticalAlign&&(i.height%7==0&&i.height%8!=0?i.verticalAlign=-.143:i.verticalAlign=-.125),i}function fe(){return this._icons=Object.create(null),this._aliases=Object.create(null),this._resolved=Object.create(null),this._add=function(e,t,i){var n=e?"_aliases":"_icons";void 0===this._resolved[t.prefix]?(this._resolved[t.prefix]=Object.create(null),this._icons[t.prefix]=Object.create(null),this._aliases[t.prefix]=Object.create(null)):(delete this._icons[t.prefix][t.icon],delete this._aliases[t.prefix][t.icon]),this._resolved[t.prefix][t.icon]=!1,this[n][t.prefix][t.icon]=i},this._resolveIcon=function(e){var t,i,n,o,r,s;if(void 0===this._resolved[e.prefix]||void 0===this._resolved[e.prefix][e.icon])return null;if(!1!==this._resolved[e.prefix][e.icon])return this._resolved[e.prefix][e.icon];if(void 0!==this._icons[e.prefix][e.icon])return this._resolved[e.prefix][e.icon]=de(this._icons[e.prefix][e.icon]);for(i=0,t=this._aliases[e.prefix][e.icon],n=Object.create(null),Object.keys(t).forEach(function(e){"parent"!==e&&(n[e]=t[e])}),o=t.parent;;){if(5<++i||void 0===this._resolved[e.prefix][o])return this._resolved[e.prefix][e.icon]=null;if(r=void 0===this._icons[e.prefix][o],s=this[r?"_aliases":"_icons"][e.prefix][o],Object.keys(s).forEach(function(e){if(void 0!==n[e])switch(e){case"rotate":n[e]=le(n[e],s[e]);break;case"hFlip":case"vFlip":n[e]=ue(n[e],s[e])}else"parent"!==e&&(n[e]=s[e])}),!r)break;o=s.parent}return this._resolved[e.prefix][e.icon]=de(n)},this.addCollection=function(n){var o=this,r=Object.create(null);g.forEach(function(e){void 0!==n[e]?r[e]=n[e]:void 0!==v[e]&&(r[e]=v[e])}),void 0!==n.icons&&Object.keys(n.icons).forEach(function(e){var t=p(e,n.prefix),i=n.icons[e];void 0!==i.body&&(i._defaults=r,o._add(!1,t,i))}),void 0!==n.aliases&&Object.keys(n.aliases).forEach(function(e){var t=p(e,n.prefix),i=n.aliases[e];if(void 0!==i.parent){if(void 0===n.prefix){if(i.parent.slice(0,t.prefix.length)!==t.prefix)return;i.parent=i.parent.slice(t.prefix.length+1)}o._add(!0,t,i)}})},this.addIcon=function(e,t,i){var n=void 0!==t.parent,o=p(e,i);if(n&&void 0===i){if(t.parent.slice(0,o.prefix.length)!==o.prefix)return;t.parent=t.parent.slice(o.prefix.length+1)}this._add(n,o,t)},this.exists=function(e,t){var i=p(e,t);return void 0!==this._resolved[i.prefix]&&void 0!==this._resolved[i.prefix][i.icon]},this.getIcon=function(e,t){var i=p(e,t);return this._resolveIcon(i)},this.copyIcon=function(e,t){var i,n=this.getIcon(e,t);return null===n?null:(i=Object.create(null),Object.keys(n).forEach(function(e){i[e]=n[e]}),i)},this.list=function(e){var i,n;return void 0!==e?void 0===this._resolved[e]?[]:Object.keys(this._resolved[e]):(i=[],n=this._resolved,Object.keys(n).forEach(function(t){i=i.concat(Object.keys(n[t]).map(function(e){return""===t&&-1===e.indexOf("-")?e:t+":"+e}))}),i)},this}function he(){w&&(w=!1,m.scanDOM())}function pe(e,t,i){var n,o,r,s,a;if(1===t)return e;if(i=void 0===i?100:i,"number"==typeof e)return Math.ceil(e*t*i)/i;if("string"!=typeof e)return e;if(null===(n=e.split(A))||!n.length)return e;for(o=[],r=n.shift(),s=j.test(r);;){if(s?(a=parseFloat(r),isNaN(a)?o.push(r):o.push(Math.ceil(a*t*i)/i)):o.push(r),void 0===(r=n.shift()))return o.join("");s=!s}}function ve(e,t,i){var n,o,r;for(n=0;n<t.length;n++)if(void 0!==e[o=t[n]])switch(typeof(r=e[o])){case"boolean":return r;case"number":return!!r;case"string":switch(r.toLowerCase()){case"1":case"true":case o:return!0;case"0":case"false":case"":return!1}}return i}function ge(e,t,i){var n,o;for(n=0;n<t.length;n++)if(void 0!==e[o=t[n]])return e[o];return i}function be(){var s=N.loaderMaxURLSize,o=Object.create(null);function a(e,t){var i,n=o[e];"function"!=typeof n?(n=n.replace("{icons}",t.join(",")),(i=document.createElement("script")).setAttribute("type","text/javascript"),i.setAttribute("src",n),i.setAttribute("async",!0),document.head.appendChild(i)):n.call(L,e,t)}function c(e){var t=void 0===N.API[e]?N.defaultAPI:N.API[e];return"function"==typeof t?(o[e]=t,!1):-1===t.indexOf("{icons}")?(o[e]=t,null):(t=t.replace("{prefix}",e).replace("{callback}","Iconify._loaderCallback"),(o[e]=t).replace("{icons}","").length)}Object.keys(T).forEach(function(i){var n=c(i),o=!1===n,r=[];if(null===n)return a(i,[]),void(F[i]=!0);T[i].forEach(function(e,t){o||(n+=e.length+1,s<=n&&(a(i,r),r=[],n=c(i)+e.length+1)),r.push(e)}),r.length&&a(i,r),F[i]=void 0===F[i]?T[i]:F[i].concat(T[i]),delete T[i]}),D=!1}function me(e,t,i){return i||S.domready||N.loadBeforeDOMReady?(void 0===T[e]||-1===T[e].indexOf(t))&&(void 0===F[e]||!0!==F[e]&&-1===F[e].indexOf(t))&&(void 0===T[e]&&(T[e]=[]),T[e].push(t),D||(D=!0,window.setTimeout(be,0)),1):(o=t,void 0===R[n=e]&&(R[n]=Object.create(null)),R[n][o]=!0,void 0===S._loaderDOMReady&&(S._loaderDOMReady=S.DOMReadyCallback,S.DOMReadyCallback=function(){S._loaderDOMReady(),Object.keys(R).forEach(function(t){Object.keys(R[t]).forEach(function(e){L.iconExists(e,t)||me(t,e,!0)})})}),1);var n,o}function ye(){var e;!1!==U&&U.length?(e=U,U=!1,Q.scanDOM(e)):U=!1}function we(e){e.forEach(function(e){var t;if(!1===U&&(U=[],window.setTimeout(ye,0)),e.addedNodes)for(t=0;t<e.addedNodes.length;t++)U.push(e.addedNodes[t])})}function _e(){q.observe(void 0===z._root?document.querySelector("body"):z._root,W)}function xe(e,t){var i;return"<?"===e.slice(0,2)&&(i=e.indexOf(">"),e=e.slice(i+1)),e=-1!==(i=(e=e.replace("viewbox=","viewBox=").replace("preserveaspectratio=","preserveAspectRatio=")).indexOf("</"))?e.replace("</",t+"</"):e.replace("/>",">"+t+"</svg>")}i=re,"function"!=typeof window.CustomEvent&&(se.prototype=window.Event.prototype,window.CustomEvent=se),i.event=function(e,t){document.dispatchEvent(new CustomEvent(e,t))},n=e,r=(o=re).config,s=null,o.DOMReadyCallback=function(){o.domready=!0,o.nextInitItem()},o.initTimeout=function(e){function t(){if(null!==s){if(!1!==s.callback())return s.stop(),void o.nextInitItem();s.counter++,10!==s.counter&&25!==s.counter||(window.clearInterval(s.id),s.id=window.setInterval(t,10===s.counter?250:1e3))}}null!==s&&s.stop(),s={id:window.setInterval(t,100),counter:0,callback:e,stop:function(){window.clearInterval(s.id),s=null},nextTick:t}},o.domready=!1,o.ready=!1,o.initQueue=[],o.readyQueue=[],o.nextInitItem=function(){var e;if(!o.ready){if(o.initQueue.length)e=o.initQueue.shift();else{if(!o.domready)return void o.initTimeout(function(){return!o.domready&&document.body&&o.scanDOM(),o.domready});if(!o.readyQueue.length)return o.ready=n.isReady=!0,o.event(r._readyEvent),void o.scanDOM();e=o.readyQueue.shift()}!1!==e()&&o.nextInitItem()}},o.addStylesheet=function(e){var t;if(!document.head||!document.body)return!!o.domready||(e||o.initTimeout(o.addStylesheet.bind(null,!0)),!1);try{(t=document.createElement("style")).type="text/css",t.innerHTML="span.iconify, i.iconify, iconify-icon { display: inline-block; width: 1em; }",null!==document.head.firstChild?document.head.insertBefore(t,document.head.firstChild):document.head.appendChild(t)}catch(e){}return!0},o.initQueue.push(o.addStylesheet.bind(null,!1)),n.ready=function(e){n.isReady?window.setTimeout(e):document.addEventListener(r._readyEvent,e)},window.setTimeout(function(){"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?o.domready=!0:(document.addEventListener("DOMContentLoaded",ae),window.addEventListener("load",ae)),o.nextInitItem()}),(a=re.config).SVGAttributes=Object.create(null),a._imageClass="iconify",a._loadingClass="svg-loading",a._iconAttribute="data-icon",a._rotateAttribute="data-rotate",a._flipAttribute="data-flip",a._inlineModeAttribute="data-inline",a._alignAttribute="data-align",a._appendAttribute="data-icon-append",a._appendedClass="svg-appended",a._readyEvent="IconifyReady",a._webComponentsPolyfill="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents-lite.min.js",a._classListPolyfill="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20150312/classList.min.js",function(t){t.defaultAPI="https://api.iconify.design/{prefix}.js?icons={icons}",t.API=Object.create(null),t.loaderMaxURLSize=500,t.loadBeforeDOMReady=!(document&&document.body),t._loaderEvent="IconifyAddedIcons",t.sessionStorage=!0;try{t.localStorage=!!(window&&window.localStorage&&window.localStorage.length)}catch(e){t.localStorage=!1}}(re.config),c=e,l=t,u=re.config,c.setConfig=function(e,t){ce(e,t,!1)},c.setCustomAPI=function(e,t){switch(typeof e){case"string":0;break;case"object":if(e instanceof Array){0;break}default:return}e.forEach(function(e){null===t?delete u.API[e]:u.API[e]=t})},c.getConfig=function(e){return void 0===u[e]?void 0===u["_"+e]?null:u["_"+e]:u[e]},["SimpleSVG","Iconify"].forEach(function(e){var t;void 0!==l[e+"Config"]&&"object"==typeof l[e+"Config"]&&(t=l[e+"Config"],Object.keys(t).forEach(function(e){ce(e,t[e],!0)}))}),f=(d=re).config,h=t,d.initQueue.push(function(){var e={observer:!1,classList:!1},t={observer:!1,classList:!1};function i(e){var t;return!e.length||(document.head?((t=document.createElement("script")).setAttribute("src",e),t.setAttribute("type","text/javascript"),document.head.appendChild(t),!0):d.domready)}function n(){if("classList"in document.createElement("div"))return 1;t.classList||(t.classList=i(f._classListPolyfill))}function o(){return h.MutationObserver&&h.WeakMap||t.observer||(t.observer=i(f._webComponentsPolyfill)),1}return e.classList=!n(),e.observer=!o(),!e.classList&&!e.observer||(d.initTimeout(function(){return!(e.observer&&!o()||e.classList&&!n())}),!1)}),re.getPrefix=function(e,t){var i;return"string"==typeof t&&""!==t?{prefix:t,icon:e}:2===(i=e.split(":")).length?{prefix:i[0],icon:i[1]}:1<(i=e.split("-")).length?{prefix:t=i.shift(),icon:i.join("-")}:{prefix:"",icon:e}},p=re.getPrefix,v={left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1},g=["left","top","width","height","body","rotate","vFlip","hFlip","inlineTop","inlineHeight","verticalAlign"],fe.mergeFlip=ue,fe.mergeRotation=le,fe.blankIcon=function(){return de({body:"",width:16,height:16})},re.Storage=fe,b=e,y=t,w=!1,_=new(m=re).Storage,b.addCollection=function(e,t){_.addCollection(e),w||!0===t||(w=!0,window.setTimeout(he,0))},b.addIcon=function(e,t,i){_.addIcon(e,t),w||!0===i||(w=!0,window.setTimeout(he,0))},b.iconExists=_.exists.bind(_),b.getIcon=_.copyIcon.bind(_),b.listIcons=_.list.bind(_),["SimpleSVG","Iconify"].forEach(function(e){void 0!==y[e+"Preload"]&&y[e+"Preload"]instanceof Array&&y[e+"Preload"].forEach(function(e){"object"==typeof e&&void 0!==e.icons&&b.addCollection(e)})}),x=re.Storage,O=re.config,A=/(-?[0-9.]*[0-9]+[0-9.]*)/g,j=/^-?[0-9.]*[0-9]+[0-9.]*$/g,I=["width","height","inline"],E=["title"],k=0,re.SVG=function(_){return _=_||x.blankIcon(),this.item=_,this.height=function(e,t,i){return void 0===e?t?this.item.inlineHeight:this.item.height:pe(e,(t?this.item.inlineHeight:this.item.height)/this.item.width,i)},this.width=function(e,t,i){return void 0===e?this.item.width:pe(e,this.item.width/(t?this.item.inlineHeight:this.item.height),i)},this.defaultAttributes=function(){return{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",focusable:"false"}},this.preserveAspectRatio=function(e,t,i){var n="";switch(e){case"left":n+="xMin";break;case"right":n+="xMax";break;default:n+="xMid"}switch(t){case"top":n+="YMin";break;case"bottom":n+="YMax";break;default:n+="YMid"}return n+=!0===i?" slice":" meet"},this.htmlspecialchars=function(e){switch(typeof e){case"boolean":case"number":return e+"";case"string":return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return""},this.attributes=function(t){var e,i,n,o,r,s,a,c,l,u,d,f,h,p,v=this,g={horizontal:"center",vertical:"middle",crop:!1},b={rotate:_.rotate,hFlip:_.hFlip,vFlip:_.vFlip},m="",y=this.defaultAttributes(),w=[];if(s=ve(t="object"==typeof t?t:Object.create(null),[O._inlineModeAttribute,"inline"],!0),u=ve(t,[O._appendAttribute],!1),e={left:_.left,top:s?_.inlineTop:_.top,width:_.width,height:s?_.inlineHeight:_.height},"string"==typeof t[O._flipAttribute]&&t[O._flipAttribute].split(/[\s,]+/).forEach(function(e){switch(e=e.toLowerCase()){case"horizontal":b.hFlip=!b.hFlip;break;case"vertical":b.vFlip=!b.vFlip}}),void 0!==t[O._rotateAttribute])if("number"==typeof(c=t[O._rotateAttribute]))b.rotate+=c;else if("string"==typeof c)if(""===(d=c.replace(/^-?[0-9.]*/,"")))c=parseInt(c),isNaN(c)||(b.rotate+=c);else if(d!==c){switch(l=!1,d){case"%":l=25;break;case"deg":l=90}l&&(c=parseInt(c.slice(0,c.length-d.length)),isNaN(c)||(b.rotate+=Math.round(c/l)))}switch(b.hFlip?b.vFlip?b.rotate+=2:(w.push("translate("+(e.width+e.left)+" "+(0-e.top)+")"),w.push("scale(-1 1)"),e.top=e.left=0):b.vFlip&&(w.push("translate("+(0-e.left)+" "+(e.height+e.top)+")"),w.push("scale(1 -1)"),e.top=e.left=0),b.rotate%4){case 1:p=e.height/2+e.top,w.unshift("rotate(90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p);break;case 2:w.unshift("rotate(180 "+(e.width/2+e.left)+" "+(e.height/2+e.top)+")");break;case 3:p=e.width/2+e.left,w.unshift("rotate(-90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p)}return i=ge(t,["data-width","width"],null),n=ge(t,["data-height","height"],null),null===i&&null===n&&(n="1em"),null!==i&&null!==n?(o=i,r=n):null!==i?r=pe(o=i,e.height/e.width):o=pe(r=n,e.width/e.height),!1!==o&&(y.width="auto"===o?e.width:o),!1!==r&&(y.height="auto"===r?e.height:r),s&&0!==_.verticalAlign?m+="vertical-align: "+(h=_.verticalAlign+"em")+";":h="","string"==typeof t[O._alignAttribute]&&t[O._alignAttribute].toLowerCase().split(/[\s,]+/).forEach(function(e){switch(e){case"left":case"right":case"center":g.horizontal=e;break;case"top":case"bottom":case"middle":g.vertical=e;break;case"crop":g.crop=!0;break;case"meet":g.crop=!1}}),m+="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);",y.style=m+(void 0===t.style?"":t.style),y.preserveAspectRatio=this.preserveAspectRatio(g.horizontal,g.vertical,g.crop),y.viewBox=e.left+" "+e.top+" "+e.width+" "+e.height,a=function(i){var e,n,t=/\sid="(\S+)"/g,o=[];function r(e,t,i){for(var n=0;-1!==(n=i.indexOf(e,n));)i=i.slice(0,n)+t+i.slice(n+e.length),n+=t.length;return i}for(;e=t.exec(i);)o.push(e[1]);return o.length&&(n="IconifyId-"+Date.now().toString(16)+"-"+(16777216*Math.random()|0).toString(16)+"-",o.forEach(function(e){var t=n+k;k++,i=r('="'+e+'"','="'+t+'"',i),i=r('="#'+e+'"','="#'+t+'"',i),i=r("(#"+e+")","(#"+t+")",i)})),i}(this.item.body),w.length&&(a='<g transform="'+w.join(" ")+'">'+a+"</g>"),f=Object.create(null),Object.keys(t).forEach(function(e){void 0===y[e]&&(-1!==E.indexOf(e)?a="<"+e+">"+v.htmlspecialchars(t[e])+"</"+e+">"+a:-1===I.indexOf(e)&&(f[e]=t[e]))}),{attributes:y,elementAttributes:f,body:a,append:u,verticalAlign:h}},this},M=(C=re).config._loadingClass,C.newImage=function(e,t,i){return{element:e,icon:t,parser:i,loading:e.classList.contains(M)}},C.parsedImage=function(e,t){return{element:e,icon:t}},C.getImageAttributes=function(t){var e,i,n=Object.create(null);if(!t.element.hasAttributes())return n;for(e=0;e<t.element.attributes.length;e++)i=t.element.attributes[e],n[i.name]=i.value;return t.parser&&void 0!==t.parser.filterAttributes&&(n=t.parser.filterAttributes(t,n)),void 0!==n.class&&(n.class=n.class.split(" ").filter(function(e){return e!==M}),t.parser&&void 0!==t.parser.filterClasses&&(n.class=t.parser.filterClasses(t,n.class)),n.class=n.class.join(" ")),void 0!==t.attributes&&Object.keys(t.attributes).forEach(function(e){n[e]=t.attributes[e]}),n},function(n,f,e){var s=e._imageClass,t=e._loadingClass,i=e._appendedClass,a=e._iconAttribute,o=e._inlineModeAttribute,r=":not(svg):not(."+i+")",c=":not(."+t+")",l="."+t,h={iconify:{selector:"."+s,selectorAll:"."+s+r,selectorNew:"."+s+r+c,selectorLoading:"."+s+r+l,icon:function(e){var t,i=e.getAttribute(a);if("string"==typeof i)return i;for(var n=0;n<e.classList.length;n++)if(5<(t=e.classList[n]).length&&"icon:"===t.slice(0,5))return t.slice(5);return""},filterClasses:function(e,t){var i,n,o;for(n=0;n<t.length;n++)"icon-"===(i=t[n]).slice(0,5)&&2===(i=i.slice(5).split(":")).length&&(o="data-"+i[0],void 0===e.attributes&&(e.attributes=Object.create(null)),e.attributes[o]=i[1]);return t}}},p=Object.keys(h);n.addFinder=function(e,t){void 0===t.selectorAll&&(t.selectorAll=t.selector+r),void 0===t.selectorNew&&(t.selectorNew=t.selector+r+c),void 0===t.selectorLoading&&(t.selectorLoading=t.selector+r+l),h[e]=t,p=Object.keys(h),n.isReady&&n.scanDOM()},n.addTag=function(e,i,t){n.addFinder("tag-"+e,{selector:e,icon:null==t?h.iconify.icon:t,filterAttributes:function(e,t){return void 0===t[o]&&(t[o]=i),t},filterClasses:h.iconify.filterClasses})};try{"object"==typeof Reflect&&"object"==typeof customElements&&Object.setPrototypeOf&&(Object.setPrototypeOf(u.prototype,HTMLElement.prototype),Object.setPrototypeOf(u,HTMLElement),customElements.define("iconify-icon",u))}catch(e){}function u(){return Reflect.construct(HTMLElement,[],u)}n.addTag("iconify-icon",!1),f.findNewImages=function(c,l){var u=[],d=[];return(c=void 0===c?void 0===e._root?document.body:e._root:c)&&p.forEach(function(e){var t,i,n,o,r=h[e],s=!0===l?r.selectorLoading:!1===l?r.selectorNew:r.selectorAll,a=c.querySelectorAll(s);for(t=0;t<a.length;t++)i=a[t],(n=r.icon(i))&&-1===d.indexOf(i)&&(d.push(i),o=f.newImage(i,n,r),u.push(o))}),u},f.findParsedImages=function(e){var t,i,n,o=[],r=e.querySelectorAll("svg."+s);for(t=0;t<r.length;t++)(n=(i=r[t]).getAttribute(a))&&o.push(f.parsedImage(i,n));return o}}(e,re,re.config),L=e,N=(S=re).config,P=t,T=Object.create(null),F=Object.create(null),R=Object.create(null),H={session:!(D=!1),local:!0},V={session:0,local:0},L._loaderCallback=function(i){var n=!1;"object"==typeof i&&(["local","session"].forEach(function(t){var e;if(!n&&H[t]&&N[t+"Storage"]){e=P[t+"Storage"];try{V[t]||e.setItem("iconify-version",S.version),e.setItem("iconify"+V[t],JSON.stringify(i)),n=!0,V[t]++,e.setItem("iconify-count",V[t])}catch(e){H[t]=!1}}}),L.addCollection(i),S.event(N._loaderEvent))},S.loadImage=function(e,t){var i=S.getPrefix(e.icon);return!!L.iconExists(i.icon,i.prefix)||(!1!==t&&me(i.prefix,i.icon,!1)&&e.element.classList.add(N._loadingClass),!1)},L.preloadImages=function(e){var t,i=!1;return e.forEach(function(e){t=S.getPrefix(e),L.iconExists(t.icon,t.prefix)||(me(t.prefix,t.icon,!0),i=!0)}),i},["local","session"].forEach(function(t){var e,i,n;try{if("object"!=typeof(e=P[t+"Storage"]))return void(H[t]=!1);if(e.getItem("iconify-version")!==S.version)return;if("number"!=typeof(n=parseInt(e.getItem("iconify-count")))||isNaN(n))return;for(;;){if(V[t]>=n)return;if("string"!=typeof(i=e.getItem("iconify"+V[t])))return;"object"==typeof(i=JSON.parse(i))&&L.addCollection(i),V[t]++}}catch(e){H[t]=!1}}),G=e,z=(Q=re).config,B=t,Y=0,W={childList:!(U=!1),subtree:!(J=q=null)},G.pauseObserving=function(){null!==q&&(Y||(J=q.takeRecords(),q.disconnect())),Y++},G.resumeObserving=function(){null!==q?Y&&(--Y||(_e(),null!==J&&J.length&&we(J))):Y--},G.isObserverPaused=function(){return null===q||!!Y},Q.readyQueue.push(function(){return q=new B.MutationObserver(we),Y||_e(),!0}),$=e,X=(K=re).config,Z=X._iconAttribute,ee=X._loadingClass,te=X._imageClass,ie=X._appendedClass,K.renderSVG=function(t){var e,i,n,o,r,s,a,c,l,u,d,f=K.getImageAttributes(t),h=$.getIcon(t.icon);for(f[Z]=t.icon,e=new K.SVG(h),n=document.createElement("svg"),r=e.attributes(f),Object.keys(r.attributes).forEach(function(e){if(d=r.attributes[e],"style"!==e||"string"==typeof(d=t.element.getAttribute("style"))&&d.length)try{n.setAttribute(e,d)}catch(e){}}),Object.keys(r.elementAttributes).forEach(function(e){try{(r.append?t.element:n).setAttribute(e,r.elementAttributes[e])}catch(e){}}),t.loading&&(n.classList.remove(ee),r.append&&t.element.classList.remove(ee)),n.classList.add(te),s=xe(n.outerHTML,r.body),(o=document.createElement("span")).innerHTML=s,i=o.childNodes[0],r.append?(t.element.classList.add(ie),t.element.appendChild(i)):(t.element.parentNode.replaceChild(i,t.element),t.element=i),a=i.style,c=t.element.style,r.verticalAlign&&(a.verticalAlign=r.verticalAlign),a.transform="rotate(360deg)",l=0;l<c.length;l++)a[u=c[l]]=c[u];delete t.parser,delete t.loading},$.getSVGObject=function(e,t){return!!$.iconExists(e)&&new K.SVG($.getIcon(e)).attributes(t,!1)},$.getSVG=function(e,t){var i,n;return!1!==(n=$.getSVGObject(e,t))&&(i=document.createElement("svg"),Object.keys(n.attributes).forEach(function(e){try{i.setAttribute(e,n.attributes[e])}catch(e){}}),xe(i.outerHTML,n.body))},ne=e,(oe=re).scanDOM=function(){var t=!1;function e(){oe.findNewImages().forEach(function(e){oe.loadImage(e)&&(t||(t=!0,ne.pauseObserving()),oe.renderSVG(e))})}if(oe.ready)e();else try{e()}catch(e){}t&&ne.resumeObserving()},ne.scanDOM=oe.scanDOM,ne.getVersion=function(){return oe.version}}(self.Iconify,self)),"object"==typeof exports)try{exports.__esModule=!0,exports.default=self.Iconify}catch(e){} |
@@ -13,2 +13,2 @@ /** | ||
*/ | ||
"use strict";if(void 0===self.Iconify&&(self.Iconify={isReady:!1},self.SimpleSVG=self.Iconify,function(e,t){var i,n,o,r,a,s,c,l,u,d,f,h,p,v,g,b,m,y,w,x,_,O,j,A,I,E,k,C,M,L,S,F,P,T,R,N,D,H,V,G,Q,z,B,q,Y,J,U,W,$={config:{},version:"1.0.5"};function K(e,t){var i;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},(i=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}function X(){document.removeEventListener("DOMContentLoaded",X),window.removeEventListener("load",X),o.DOMReadyCallback()}function Z(t,i,e){var n=t;if("_"!==t.slice(0,1)){if(void 0===u[t]){if(!e||void 0===u["_"+t])return;n="_"+t}switch(n){case"API":case"SVGAttributes":Object.keys(i).forEach(function(e){null===i[t]?delete u[n][e]:u[n][e]=i[e]});break;default:u[n]=i}}}function ee(e,t){return function(e,t){switch(e){case"rotate":return t=parseInt(t),isNaN(t)?null:t;case"width":case"height":case"inlineHeight":case"inlineTop":case"verticalAlign":return t=parseFloat(t),isNaN(t)?null:t;case"vFlip":case"hFlip":return!!t;case"body":case"parent":return"string"==typeof t?t:null}return t}("rotate",e+t)}function te(e,t){return!!e!=!!t}function ie(e){var i=Object.create(null);return(void 0===e._defaults?[e,v]:[e,e._defaults,v]).forEach(function(t){Object.keys(t).forEach(function(e){"object"!=typeof t[e]&&void 0===i[e]&&(i[e]=t[e])})}),void 0===i.inlineTop&&(i.inlineTop=i.top),void 0===i.inlineHeight&&(i.inlineHeight=i.height),void 0===i.verticalAlign&&(i.height%7==0&&i.height%8!=0?i.verticalAlign=-.143:i.verticalAlign=-.125),i}function ne(){return this._icons=Object.create(null),this._aliases=Object.create(null),this._resolved=Object.create(null),this._add=function(e,t,i){var n=e?"_aliases":"_icons";void 0===this._resolved[t.prefix]?(this._resolved[t.prefix]=Object.create(null),this._icons[t.prefix]=Object.create(null),this._aliases[t.prefix]=Object.create(null)):(delete this._icons[t.prefix][t.icon],delete this._aliases[t.prefix][t.icon]),this._resolved[t.prefix][t.icon]=!1,this[n][t.prefix][t.icon]=i},this._resolveIcon=function(e){var t,i,n,o,r,a;if(void 0===this._resolved[e.prefix]||void 0===this._resolved[e.prefix][e.icon])return null;if(!1!==this._resolved[e.prefix][e.icon])return this._resolved[e.prefix][e.icon];if(void 0!==this._icons[e.prefix][e.icon])return this._resolved[e.prefix][e.icon]=ie(this._icons[e.prefix][e.icon]);for(i=0,t=this._aliases[e.prefix][e.icon],n=Object.create(null),Object.keys(t).forEach(function(e){"parent"!==e&&(n[e]=t[e])}),o=t.parent;;){if(5<++i||void 0===this._resolved[e.prefix][o])return this._resolved[e.prefix][e.icon]=null;if(r=void 0===this._icons[e.prefix][o],a=this[r?"_aliases":"_icons"][e.prefix][o],Object.keys(a).forEach(function(e){if(void 0!==n[e])switch(e){case"rotate":n[e]=ee(n[e],a[e]);break;case"hFlip":case"vFlip":n[e]=te(n[e],a[e])}else"parent"!==e&&(n[e]=a[e])}),!r)break;o=a.parent}return this._resolved[e.prefix][e.icon]=ie(n)},this.addCollection=function(n){var o=this,r=Object.create(null);g.forEach(function(e){void 0!==n[e]?r[e]=n[e]:void 0!==v[e]&&(r[e]=v[e])}),void 0!==n.icons&&Object.keys(n.icons).forEach(function(e){var t=p(e,n.prefix),i=n.icons[e];void 0!==i.body&&(i._defaults=r,o._add(!1,t,i))}),void 0!==n.aliases&&Object.keys(n.aliases).forEach(function(e){var t=p(e,n.prefix),i=n.aliases[e];if(void 0!==i.parent){if(void 0===n.prefix){if(i.parent.slice(0,t.prefix.length)!==t.prefix)return;i.parent=i.parent.slice(t.prefix.length+1)}o._add(!0,t,i)}})},this.addIcon=function(e,t,i){var n=void 0!==t.parent,o=p(e,i);if(n&&void 0===i){if(t.parent.slice(0,o.prefix.length)!==o.prefix)return;t.parent=t.parent.slice(o.prefix.length+1)}this._add(n,o,t)},this.exists=function(e,t){var i=p(e,t);return void 0!==this._resolved[i.prefix]&&void 0!==this._resolved[i.prefix][i.icon]},this.getIcon=function(e,t){var i=p(e,t);return this._resolveIcon(i)},this.copyIcon=function(e,t){var i,n=this.getIcon(e,t);return null===n?null:(i=Object.create(null),Object.keys(n).forEach(function(e){i[e]=n[e]}),i)},this.list=function(e){var i,n;return void 0!==e?void 0===this._resolved[e]?[]:Object.keys(this._resolved[e]):(i=[],n=this._resolved,Object.keys(n).forEach(function(t){i=i.concat(Object.keys(n[t]).map(function(e){return""===t&&-1===e.indexOf("-")?e:t+":"+e}))}),i)},this}function oe(){w&&(w=!1,m.scanDOM())}function re(e,t,i){var n,o,r,a,s;if(1===t)return e;if(i=void 0===i?100:i,"number"==typeof e)return Math.ceil(e*t*i)/i;if("string"!=typeof e)return e;if(null===(n=e.split(j))||!n.length)return e;for(o=[],r=n.shift(),a=A.test(r);;){if(a?(s=parseFloat(r),isNaN(s)?o.push(r):o.push(Math.ceil(s*t*i)/i)):o.push(r),void 0===(r=n.shift()))return o.join("");a=!a}}function ae(e,t,i){var n,o,r;for(n=0;n<t.length;n++)if(void 0!==e[o=t[n]])switch(typeof(r=e[o])){case"boolean":return r;case"number":return!!r;case"string":switch(r.toLowerCase()){case"1":case"true":case o:return!0;case"0":case"false":case"":return!1}}return i}function se(e,t,i){var n,o;for(n=0;n<t.length;n++)if(void 0!==e[o=t[n]])return e[o];return i}function ce(){var a=F.loaderMaxURLSize,o=Object.create(null);function s(e,t){var i,n=o[e];"function"!=typeof n?(n=n.replace("{icons}",t.join(",")),(i=document.createElement("script")).setAttribute("type","text/javascript"),i.setAttribute("src",n),i.setAttribute("async",!0),document.head.appendChild(i)):n.call(L,e,t)}function c(e){var t=void 0===F.API[e]?F.defaultAPI:F.API[e];return"function"==typeof t?(o[e]=t,!1):-1===t.indexOf("{icons}")?(o[e]=t,null):(t=t.replace("{prefix}",e).replace("{callback}","Iconify._loaderCallback"),(o[e]=t).replace("{icons}","").length)}Object.keys(T).forEach(function(i){var n=c(i),o=!1===n,r=[];if(null===n)return s(i,[]),void(R[i]=!0);T[i].forEach(function(e,t){o||(n+=e.length+1,a<=n&&(s(i,r),r=[],n=c(i)+e.length+1)),r.push(e)}),r.length&&s(i,r),R[i]=void 0===R[i]?T[i]:R[i].concat(T[i]),delete T[i]}),D=!1}function le(e,t,i){return i||S.domready||F.loadBeforeDOMReady?(void 0===T[e]||-1===T[e].indexOf(t))&&(void 0===R[e]||!0!==R[e]&&-1===R[e].indexOf(t))&&(void 0===T[e]&&(T[e]=[]),T[e].push(t),D||(D=!0,window.setTimeout(ce,0)),1):(o=t,void 0===N[n=e]&&(N[n]=Object.create(null)),N[n][o]=!0,void 0===S._loaderDOMReady&&(S._loaderDOMReady=S.DOMReadyCallback,S.DOMReadyCallback=function(){S._loaderDOMReady(),Object.keys(N).forEach(function(t){Object.keys(N[t]).forEach(function(e){L.iconExists(e,t)||le(t,e,!0)})})}),1);var n,o}function ue(e,t){var i;return"<?"===e.slice(0,2)&&(i=e.indexOf(">"),e=e.slice(i+1)),e=-1!==(i=(e=e.replace("viewbox=","viewBox=").replace("preserveaspectratio=","preserveAspectRatio=")).indexOf("</"))?e.replace("</",t+"</"):e.replace("/>",">"+t+"</svg>")}i=$,"function"!=typeof window.CustomEvent&&(K.prototype=window.Event.prototype,window.CustomEvent=K),i.event=function(e,t){document.dispatchEvent(new CustomEvent(e,t))},n=e,r=(o=$).config,a=null,o.DOMReadyCallback=function(){o.domready=!0,o.nextInitItem()},o.initTimeout=function(e){function t(){if(null!==a){if(!1!==a.callback())return a.stop(),void o.nextInitItem();a.counter++,10!==a.counter&&25!==a.counter||(window.clearInterval(a.id),a.id=window.setInterval(t,10===a.counter?250:1e3))}}null!==a&&a.stop(),a={id:window.setInterval(t,100),counter:0,callback:e,stop:function(){window.clearInterval(a.id),a=null},nextTick:t}},o.domready=!1,o.ready=!1,o.initQueue=[],o.readyQueue=[],o.nextInitItem=function(){var e;if(!o.ready){if(o.initQueue.length)e=o.initQueue.shift();else{if(!o.domready)return void o.initTimeout(function(){return!o.domready&&document.body&&o.scanDOM(),o.domready});if(!o.readyQueue.length)return o.ready=n.isReady=!0,o.event(r._readyEvent),void o.scanDOM();e=o.readyQueue.shift()}!1!==e()&&o.nextInitItem()}},o.addStylesheet=function(e){var t;if(!document.head||!document.body)return!!o.domready||(e||o.initTimeout(o.addStylesheet.bind(null,!0)),!1);try{(t=document.createElement("style")).type="text/css",t.innerHTML="span.iconify, i.iconify, iconify-icon { display: inline-block; width: 1em; }",null!==document.head.firstChild?document.head.insertBefore(t,document.head.firstChild):document.head.appendChild(t)}catch(e){}return!0},o.initQueue.push(o.addStylesheet.bind(null,!1)),n.ready=function(e){n.isReady?window.setTimeout(e):document.addEventListener(r._readyEvent,e)},window.setTimeout(function(){"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?o.domready=!0:(document.addEventListener("DOMContentLoaded",X),window.addEventListener("load",X)),o.nextInitItem()}),(s=$.config).SVGAttributes=Object.create(null),s._imageClass="iconify",s._loadingClass="svg-loading",s._iconAttribute="data-icon",s._rotateAttribute="data-rotate",s._flipAttribute="data-flip",s._inlineModeAttribute="data-inline",s._alignAttribute="data-align",s._appendAttribute="data-icon-append",s._appendedClass="svg-appended",s._readyEvent="IconifyReady",s._webComponentsPolyfill="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents-lite.min.js",s._classListPolyfill="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20150312/classList.min.js",function(t){t.defaultAPI="https://api.iconify.design/{prefix}.js?icons={icons}",t.API=Object.create(null),t.loaderMaxURLSize=500,t.loadBeforeDOMReady=!(document&&document.body),t._loaderEvent="IconifyAddedIcons",t.sessionStorage=!0;try{t.localStorage=!!(window&&window.localStorage&&window.localStorage.length)}catch(e){t.localStorage=!1}}($.config),c=e,l=t,u=$.config,c.setConfig=function(e,t){Z(e,t,!1)},c.setCustomAPI=function(e,t){switch(typeof e){case"string":0;break;case"object":if(e instanceof Array){0;break}default:return}e.forEach(function(e){null===t?delete u.API[e]:u.API[e]=t})},c.getConfig=function(e){return void 0===u[e]?void 0===u["_"+e]?null:u["_"+e]:u[e]},["SimpleSVG","Iconify"].forEach(function(e){var t;void 0!==l[e+"Config"]&&"object"==typeof l[e+"Config"]&&(t=l[e+"Config"],Object.keys(t).forEach(function(e){Z(e,t[e],!0)}))}),f=(d=$).config,h=t,d.initQueue.push(function(){var e={observer:!1,classList:!1},t={observer:!1,classList:!1};function i(e){var t;return!e.length||(document.head?((t=document.createElement("script")).setAttribute("src",e),t.setAttribute("type","text/javascript"),document.head.appendChild(t),!0):d.domready)}function n(){if("classList"in document.createElement("div"))return 1;t.classList||(t.classList=i(f._classListPolyfill))}function o(){return h.MutationObserver&&h.WeakMap||t.observer||(t.observer=i(f._webComponentsPolyfill)),1}return e.classList=!n(),e.observer=!o(),!e.classList&&!e.observer||(d.initTimeout(function(){return!(e.observer&&!o()||e.classList&&!n())}),!1)}),$.getPrefix=function(e,t){var i;return"string"==typeof t&&""!==t?{prefix:t,icon:e}:2===(i=e.split(":")).length?{prefix:i[0],icon:i[1]}:1<(i=e.split("-")).length?{prefix:t=i.shift(),icon:i.join("-")}:{prefix:"",icon:e}},p=$.getPrefix,v={left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1},g=["left","top","width","height","body","rotate","vFlip","hFlip","inlineTop","inlineHeight","verticalAlign"],ne.mergeFlip=te,ne.mergeRotation=ee,ne.blankIcon=function(){return ie({body:"",width:16,height:16})},$.Storage=ne,b=e,y=t,w=!1,x=new(m=$).Storage,b.addCollection=function(e,t){x.addCollection(e),w||!0===t||(w=!0,window.setTimeout(oe,0))},b.addIcon=function(e,t,i){x.addIcon(e,t),w||!0===i||(w=!0,window.setTimeout(oe,0))},b.iconExists=x.exists.bind(x),b.getIcon=x.copyIcon.bind(x),b.listIcons=x.list.bind(x),["SimpleSVG","Iconify"].forEach(function(e){void 0!==y[e+"Preload"]&&y[e+"Preload"]instanceof Array&&y[e+"Preload"].forEach(function(e){"object"==typeof e&&void 0!==e.icons&&b.addCollection(e)})}),_=$.Storage,O=$.config,j=/(-?[0-9.]*[0-9]+[0-9.]*)/g,A=/^-?[0-9.]*[0-9]+[0-9.]*$/g,I=["width","height","inline"],E=["title"],k=0,$.SVG=function(x){return x=x||_.blankIcon(),this.item=x,this.height=function(e,t,i){return void 0===e?t?this.item.inlineHeight:this.item.height:re(e,(t?this.item.inlineHeight:this.item.height)/this.item.width,i)},this.width=function(e,t,i){return void 0===e?this.item.width:re(e,this.item.width/(t?this.item.inlineHeight:this.item.height),i)},this.defaultAttributes=function(){return{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",focusable:"false"}},this.preserveAspectRatio=function(e,t,i){var n="";switch(e){case"left":n+="xMin";break;case"right":n+="xMax";break;default:n+="xMid"}switch(t){case"top":n+="YMin";break;case"bottom":n+="YMax";break;default:n+="YMid"}return n+=!0===i?" slice":" meet"},this.htmlspecialchars=function(e){switch(typeof e){case"boolean":case"number":return e+"";case"string":return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return""},this.attributes=function(t){var e,i,n,o,r,a,s,c,l,u,d,f,h,p,v=this,g={horizontal:"center",vertical:"middle",crop:!1},b={rotate:x.rotate,hFlip:x.hFlip,vFlip:x.vFlip},m="",y=this.defaultAttributes(),w=[];if(a=ae(t="object"==typeof t?t:Object.create(null),[O._inlineModeAttribute,"inline"],!0),u=ae(t,[O._appendAttribute],!1),e={left:x.left,top:a?x.inlineTop:x.top,width:x.width,height:a?x.inlineHeight:x.height},"string"==typeof t[O._flipAttribute]&&t[O._flipAttribute].split(/[\s,]+/).forEach(function(e){switch(e=e.toLowerCase()){case"horizontal":b.hFlip=!b.hFlip;break;case"vertical":b.vFlip=!b.vFlip}}),void 0!==t[O._rotateAttribute])if("number"==typeof(c=t[O._rotateAttribute]))b.rotate+=c;else if("string"==typeof c)if(""===(d=c.replace(/^-?[0-9.]*/,"")))c=parseInt(c),isNaN(c)||(b.rotate+=c);else if(d!==c){switch(l=!1,d){case"%":l=25;break;case"deg":l=90}l&&(c=parseInt(c.slice(0,c.length-d.length)),isNaN(c)||(b.rotate+=Math.round(c/l)))}switch(b.hFlip?b.vFlip?b.rotate+=2:(w.push("translate("+(e.width+e.left)+" "+(0-e.top)+")"),w.push("scale(-1 1)"),e.top=e.left=0):b.vFlip&&(w.push("translate("+(0-e.left)+" "+(e.height+e.top)+")"),w.push("scale(1 -1)"),e.top=e.left=0),b.rotate%4){case 1:p=e.height/2+e.top,w.unshift("rotate(90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p);break;case 2:w.unshift("rotate(180 "+(e.width/2+e.left)+" "+(e.height/2+e.top)+")");break;case 3:p=e.width/2+e.left,w.unshift("rotate(-90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p)}return i=se(t,["data-width","width"],null),n=se(t,["data-height","height"],null),null===i&&null===n&&(n="1em"),null!==i&&null!==n?(o=i,r=n):null!==i?r=re(o=i,e.height/e.width):o=re(r=n,e.width/e.height),!1!==o&&(y.width="auto"===o?e.width:o),!1!==r&&(y.height="auto"===r?e.height:r),a&&0!==x.verticalAlign?m+="vertical-align: "+(h=x.verticalAlign+"em")+";":h="","string"==typeof t[O._alignAttribute]&&t[O._alignAttribute].toLowerCase().split(/[\s,]+/).forEach(function(e){switch(e){case"left":case"right":case"center":g.horizontal=e;break;case"top":case"bottom":case"middle":g.vertical=e;break;case"crop":g.crop=!0;break;case"meet":g.crop=!1}}),m+="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);",y.style=m+(void 0===t.style?"":t.style),y.preserveAspectRatio=this.preserveAspectRatio(g.horizontal,g.vertical,g.crop),y.viewBox=e.left+" "+e.top+" "+e.width+" "+e.height,s=function(i){var e,n,t=/\sid="(\S+)"/g,o=[];function r(e,t,i){for(var n=0;-1!==(n=i.indexOf(e,n));)i=i.slice(0,n)+t+i.slice(n+e.length),n+=t.length;return i}for(;e=t.exec(i);)o.push(e[1]);return o.length&&(n="IconifyId-"+Date.now().toString(16)+"-"+(16777216*Math.random()|0).toString(16)+"-",o.forEach(function(e){var t=n+k;k++,i=r('="'+e+'"','="'+t+'"',i),i=r('="#'+e+'"','="#'+t+'"',i),i=r("(#"+e+")","(#"+t+")",i)})),i}(this.item.body),w.length&&(s='<g transform="'+w.join(" ")+'">'+s+"</g>"),f=Object.create(null),Object.keys(t).forEach(function(e){void 0===y[e]&&(-1!==E.indexOf(e)?s="<"+e+">"+v.htmlspecialchars(t[e])+"</"+e+">"+s:-1===I.indexOf(e)&&(f[e]=t[e]))}),{attributes:y,elementAttributes:f,body:s,append:u,verticalAlign:h}},this},M=(C=$).config._loadingClass,C.newImage=function(e,t,i){return{element:e,icon:t,parser:i,loading:e.classList.contains(M)}},C.parsedImage=function(e,t){return{element:e,icon:t}},C.getImageAttributes=function(t){var e,i,n=Object.create(null);if(!t.element.hasAttributes())return n;for(e=0;e<t.element.attributes.length;e++)i=t.element.attributes[e],n[i.name]=i.value;return t.parser&&void 0!==t.parser.filterAttributes&&(n=t.parser.filterAttributes(t,n)),void 0!==n.class&&(n.class=n.class.split(" ").filter(function(e){return e!==M}),t.parser&&void 0!==t.parser.filterClasses&&(n.class=t.parser.filterClasses(t,n.class)),n.class=n.class.join(" ")),void 0!==t.attributes&&Object.keys(t.attributes).forEach(function(e){n[e]=t.attributes[e]}),n},function(n,f,e){var a=e._imageClass,t=e._loadingClass,i=e._appendedClass,s=e._iconAttribute,o=e._inlineModeAttribute,r=":not(svg):not(."+i+")",c=":not(."+t+")",l="."+t,h={iconify:{selector:"."+a,selectorAll:"."+a+r,selectorNew:"."+a+r+c,selectorLoading:"."+a+r+l,icon:function(e){var t,i=e.getAttribute(s);if("string"==typeof i)return i;for(var n=0;n<e.classList.length;n++)if(5<(t=e.classList[n]).length&&"icon:"===t.slice(0,5))return t.slice(5);return""},filterClasses:function(e,t){var i,n,o;for(n=0;n<t.length;n++)"icon-"===(i=t[n]).slice(0,5)&&2===(i=i.slice(5).split(":")).length&&(o="data-"+i[0],void 0===e.attributes&&(e.attributes=Object.create(null)),e.attributes[o]=i[1]);return t}}},p=Object.keys(h);n.addFinder=function(e,t){void 0===t.selectorAll&&(t.selectorAll=t.selector+r),void 0===t.selectorNew&&(t.selectorNew=t.selector+r+c),void 0===t.selectorLoading&&(t.selectorLoading=t.selector+r+l),h[e]=t,p=Object.keys(h),n.isReady&&n.scanDOM()},n.addTag=function(e,i,t){n.addFinder("tag-"+e,{selector:e,icon:null==t?h.iconify.icon:t,filterAttributes:function(e,t){return void 0===t[o]&&(t[o]=i),t},filterClasses:h.iconify.filterClasses})};try{"object"==typeof Reflect&&"object"==typeof customElements&&Object.setPrototypeOf&&(Object.setPrototypeOf(u.prototype,HTMLElement.prototype),Object.setPrototypeOf(u,HTMLElement),customElements.define("iconify-icon",u))}catch(e){}function u(){return Reflect.construct(HTMLElement,[],u)}n.addTag("iconify-icon",!1),f.findNewImages=function(c,l){var u=[],d=[];return(c=void 0===c?void 0===e._root?document.body:e._root:c)&&p.forEach(function(e){var t,i,n,o,r=h[e],a=!0===l?r.selectorLoading:!1===l?r.selectorNew:r.selectorAll,s=c.querySelectorAll(a);for(t=0;t<s.length;t++)i=s[t],(n=r.icon(i))&&-1===d.indexOf(i)&&(d.push(i),o=f.newImage(i,n,r),u.push(o))}),u},f.findParsedImages=function(e){var t,i,n,o=[],r=e.querySelectorAll("svg."+a);for(t=0;t<r.length;t++)(n=(i=r[t]).getAttribute(s))&&o.push(f.parsedImage(i,n));return o}}(e,$,$.config),L=e,F=(S=$).config,P=t,T=Object.create(null),R=Object.create(null),N=Object.create(null),H={session:!(D=!1),local:!0},V={session:0,local:0},L._loaderCallback=function(i){var n=!1;"object"==typeof i&&(["local","session"].forEach(function(t){var e;if(!n&&H[t]&&F[t+"Storage"]){e=P[t+"Storage"];try{V[t]||e.setItem("iconify-version",S.version),e.setItem("iconify"+V[t],JSON.stringify(i)),n=!0,V[t]++,e.setItem("iconify-count",V[t])}catch(e){H[t]=!1}}}),L.addCollection(i),S.event(F._loaderEvent))},S.loadImage=function(e,t){var i=S.getPrefix(e.icon);return!!L.iconExists(i.icon,i.prefix)||(!1!==t&&le(i.prefix,i.icon,!1)&&e.element.classList.add(F._loadingClass),!1)},L.preloadImages=function(e){var t,i=!1;return e.forEach(function(e){t=S.getPrefix(e),L.iconExists(t.icon,t.prefix)||(le(t.prefix,t.icon,!0),i=!0)}),i},["local","session"].forEach(function(t){var e,i,n;try{if("object"!=typeof(e=P[t+"Storage"]))return void(H[t]=!1);if(e.getItem("iconify-version")!==S.version)return;if("number"!=typeof(n=parseInt(e.getItem("iconify-count")))||isNaN(n))return;for(;;){if(V[t]>=n)return;if("string"!=typeof(i=e.getItem("iconify"+V[t])))return;"object"==typeof(i=JSON.parse(i))&&L.addCollection(i),V[t]++}}catch(e){H[t]=!1}}),e.pauseObserving=function(){},e.resumeObserving=function(){},G=e,z=(Q=$).config,B=z._iconAttribute,q=z._loadingClass,Y=z._imageClass,J=z._appendedClass,Q.renderSVG=function(t){var e,i,n,o,r,a,s,c,l,u,d=Q.getImageAttributes(t),f=G.getIcon(t.icon);for(d[B]=t.icon,e=new Q.SVG(f),n=document.createElement("svg"),r=e.attributes(d),Object.keys(r.attributes).forEach(function(e){if("style"!==e)try{n.setAttribute(e,r.attributes[e])}catch(e){}}),Object.keys(r.elementAttributes).forEach(function(e){try{(r.append?t.element:n).setAttribute(e,r.elementAttributes[e])}catch(e){}}),t.loading&&(n.classList.remove(q),r.append&&t.element.classList.remove(q)),n.classList.add(Y),a=ue(n.outerHTML,r.body),(o=document.createElement("span")).innerHTML=a,i=o.childNodes[0],r.append?(t.element.classList.add(J),t.element.appendChild(i)):(t.element.parentNode.replaceChild(i,t.element),t.element=i),s=i.style,c=t.element.style,r.verticalAlign&&(s.verticalAlign=r.verticalAlign),s.transform="rotate(360deg)",l=0;l<c.length;l++)s[u=c[l]]=c[u];delete t.parser,delete t.loading},G.getSVGObject=function(e,t){return!!G.iconExists(e)&&new Q.SVG(G.getIcon(e)).attributes(t,!1)},G.getSVG=function(e,t){var i,n;return!1!==(n=G.getSVGObject(e,t))&&(i=document.createElement("svg"),Object.keys(n.attributes).forEach(function(e){try{i.setAttribute(e,n.attributes[e])}catch(e){}}),ue(i.outerHTML,n.body))},U=e,(W=$).scanDOM=function(){var t=!1;function e(){W.findNewImages().forEach(function(e){W.loadImage(e)&&(t||(t=!0,U.pauseObserving()),W.renderSVG(e))})}if(W.ready)e();else try{e()}catch(e){}t&&U.resumeObserving()},U.scanDOM=W.scanDOM,U.getVersion=function(){return W.version}}(self.Iconify,self)),"object"==typeof exports)try{exports.__esModule=!0,exports.default=self.Iconify}catch(e){} | ||
"use strict";if(void 0===self.Iconify&&(self.Iconify={isReady:!1},self.SimpleSVG=self.Iconify,function(e,t){var i,n,o,r,a,s,c,l,u,d,f,h,p,v,g,b,m,y,w,x,_,O,A,j,I,E,k,C,M,L,S,F,P,T,R,N,D,H,V,G,Q,z,B,q,Y,J,U,W,$={config:{},version:"1.0.6"};function K(e,t){var i;return t=t||{bubbles:!1,cancelable:!1,detail:void 0},(i=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),i}function X(){document.removeEventListener("DOMContentLoaded",X),window.removeEventListener("load",X),o.DOMReadyCallback()}function Z(t,i,e){var n=t;if("_"!==t.slice(0,1)){if(void 0===u[t]){if(!e||void 0===u["_"+t])return;n="_"+t}switch(n){case"API":case"SVGAttributes":Object.keys(i).forEach(function(e){null===i[t]?delete u[n][e]:u[n][e]=i[e]});break;default:u[n]=i}}}function ee(e,t){return function(e,t){switch(e){case"rotate":return t=parseInt(t),isNaN(t)?null:t;case"width":case"height":case"inlineHeight":case"inlineTop":case"verticalAlign":return t=parseFloat(t),isNaN(t)?null:t;case"vFlip":case"hFlip":return!!t;case"body":case"parent":return"string"==typeof t?t:null}return t}("rotate",e+t)}function te(e,t){return!!e!=!!t}function ie(e){var i=Object.create(null);return(void 0===e._defaults?[e,v]:[e,e._defaults,v]).forEach(function(t){Object.keys(t).forEach(function(e){"object"!=typeof t[e]&&void 0===i[e]&&(i[e]=t[e])})}),void 0===i.inlineTop&&(i.inlineTop=i.top),void 0===i.inlineHeight&&(i.inlineHeight=i.height),void 0===i.verticalAlign&&(i.height%7==0&&i.height%8!=0?i.verticalAlign=-.143:i.verticalAlign=-.125),i}function ne(){return this._icons=Object.create(null),this._aliases=Object.create(null),this._resolved=Object.create(null),this._add=function(e,t,i){var n=e?"_aliases":"_icons";void 0===this._resolved[t.prefix]?(this._resolved[t.prefix]=Object.create(null),this._icons[t.prefix]=Object.create(null),this._aliases[t.prefix]=Object.create(null)):(delete this._icons[t.prefix][t.icon],delete this._aliases[t.prefix][t.icon]),this._resolved[t.prefix][t.icon]=!1,this[n][t.prefix][t.icon]=i},this._resolveIcon=function(e){var t,i,n,o,r,a;if(void 0===this._resolved[e.prefix]||void 0===this._resolved[e.prefix][e.icon])return null;if(!1!==this._resolved[e.prefix][e.icon])return this._resolved[e.prefix][e.icon];if(void 0!==this._icons[e.prefix][e.icon])return this._resolved[e.prefix][e.icon]=ie(this._icons[e.prefix][e.icon]);for(i=0,t=this._aliases[e.prefix][e.icon],n=Object.create(null),Object.keys(t).forEach(function(e){"parent"!==e&&(n[e]=t[e])}),o=t.parent;;){if(5<++i||void 0===this._resolved[e.prefix][o])return this._resolved[e.prefix][e.icon]=null;if(r=void 0===this._icons[e.prefix][o],a=this[r?"_aliases":"_icons"][e.prefix][o],Object.keys(a).forEach(function(e){if(void 0!==n[e])switch(e){case"rotate":n[e]=ee(n[e],a[e]);break;case"hFlip":case"vFlip":n[e]=te(n[e],a[e])}else"parent"!==e&&(n[e]=a[e])}),!r)break;o=a.parent}return this._resolved[e.prefix][e.icon]=ie(n)},this.addCollection=function(n){var o=this,r=Object.create(null);g.forEach(function(e){void 0!==n[e]?r[e]=n[e]:void 0!==v[e]&&(r[e]=v[e])}),void 0!==n.icons&&Object.keys(n.icons).forEach(function(e){var t=p(e,n.prefix),i=n.icons[e];void 0!==i.body&&(i._defaults=r,o._add(!1,t,i))}),void 0!==n.aliases&&Object.keys(n.aliases).forEach(function(e){var t=p(e,n.prefix),i=n.aliases[e];if(void 0!==i.parent){if(void 0===n.prefix){if(i.parent.slice(0,t.prefix.length)!==t.prefix)return;i.parent=i.parent.slice(t.prefix.length+1)}o._add(!0,t,i)}})},this.addIcon=function(e,t,i){var n=void 0!==t.parent,o=p(e,i);if(n&&void 0===i){if(t.parent.slice(0,o.prefix.length)!==o.prefix)return;t.parent=t.parent.slice(o.prefix.length+1)}this._add(n,o,t)},this.exists=function(e,t){var i=p(e,t);return void 0!==this._resolved[i.prefix]&&void 0!==this._resolved[i.prefix][i.icon]},this.getIcon=function(e,t){var i=p(e,t);return this._resolveIcon(i)},this.copyIcon=function(e,t){var i,n=this.getIcon(e,t);return null===n?null:(i=Object.create(null),Object.keys(n).forEach(function(e){i[e]=n[e]}),i)},this.list=function(e){var i,n;return void 0!==e?void 0===this._resolved[e]?[]:Object.keys(this._resolved[e]):(i=[],n=this._resolved,Object.keys(n).forEach(function(t){i=i.concat(Object.keys(n[t]).map(function(e){return""===t&&-1===e.indexOf("-")?e:t+":"+e}))}),i)},this}function oe(){w&&(w=!1,m.scanDOM())}function re(e,t,i){var n,o,r,a,s;if(1===t)return e;if(i=void 0===i?100:i,"number"==typeof e)return Math.ceil(e*t*i)/i;if("string"!=typeof e)return e;if(null===(n=e.split(A))||!n.length)return e;for(o=[],r=n.shift(),a=j.test(r);;){if(a?(s=parseFloat(r),isNaN(s)?o.push(r):o.push(Math.ceil(s*t*i)/i)):o.push(r),void 0===(r=n.shift()))return o.join("");a=!a}}function ae(e,t,i){var n,o,r;for(n=0;n<t.length;n++)if(void 0!==e[o=t[n]])switch(typeof(r=e[o])){case"boolean":return r;case"number":return!!r;case"string":switch(r.toLowerCase()){case"1":case"true":case o:return!0;case"0":case"false":case"":return!1}}return i}function se(e,t,i){var n,o;for(n=0;n<t.length;n++)if(void 0!==e[o=t[n]])return e[o];return i}function ce(){var a=F.loaderMaxURLSize,o=Object.create(null);function s(e,t){var i,n=o[e];"function"!=typeof n?(n=n.replace("{icons}",t.join(",")),(i=document.createElement("script")).setAttribute("type","text/javascript"),i.setAttribute("src",n),i.setAttribute("async",!0),document.head.appendChild(i)):n.call(L,e,t)}function c(e){var t=void 0===F.API[e]?F.defaultAPI:F.API[e];return"function"==typeof t?(o[e]=t,!1):-1===t.indexOf("{icons}")?(o[e]=t,null):(t=t.replace("{prefix}",e).replace("{callback}","Iconify._loaderCallback"),(o[e]=t).replace("{icons}","").length)}Object.keys(T).forEach(function(i){var n=c(i),o=!1===n,r=[];if(null===n)return s(i,[]),void(R[i]=!0);T[i].forEach(function(e,t){o||(n+=e.length+1,a<=n&&(s(i,r),r=[],n=c(i)+e.length+1)),r.push(e)}),r.length&&s(i,r),R[i]=void 0===R[i]?T[i]:R[i].concat(T[i]),delete T[i]}),D=!1}function le(e,t,i){return i||S.domready||F.loadBeforeDOMReady?(void 0===T[e]||-1===T[e].indexOf(t))&&(void 0===R[e]||!0!==R[e]&&-1===R[e].indexOf(t))&&(void 0===T[e]&&(T[e]=[]),T[e].push(t),D||(D=!0,window.setTimeout(ce,0)),1):(o=t,void 0===N[n=e]&&(N[n]=Object.create(null)),N[n][o]=!0,void 0===S._loaderDOMReady&&(S._loaderDOMReady=S.DOMReadyCallback,S.DOMReadyCallback=function(){S._loaderDOMReady(),Object.keys(N).forEach(function(t){Object.keys(N[t]).forEach(function(e){L.iconExists(e,t)||le(t,e,!0)})})}),1);var n,o}function ue(e,t){var i;return"<?"===e.slice(0,2)&&(i=e.indexOf(">"),e=e.slice(i+1)),e=-1!==(i=(e=e.replace("viewbox=","viewBox=").replace("preserveaspectratio=","preserveAspectRatio=")).indexOf("</"))?e.replace("</",t+"</"):e.replace("/>",">"+t+"</svg>")}i=$,"function"!=typeof window.CustomEvent&&(K.prototype=window.Event.prototype,window.CustomEvent=K),i.event=function(e,t){document.dispatchEvent(new CustomEvent(e,t))},n=e,r=(o=$).config,a=null,o.DOMReadyCallback=function(){o.domready=!0,o.nextInitItem()},o.initTimeout=function(e){function t(){if(null!==a){if(!1!==a.callback())return a.stop(),void o.nextInitItem();a.counter++,10!==a.counter&&25!==a.counter||(window.clearInterval(a.id),a.id=window.setInterval(t,10===a.counter?250:1e3))}}null!==a&&a.stop(),a={id:window.setInterval(t,100),counter:0,callback:e,stop:function(){window.clearInterval(a.id),a=null},nextTick:t}},o.domready=!1,o.ready=!1,o.initQueue=[],o.readyQueue=[],o.nextInitItem=function(){var e;if(!o.ready){if(o.initQueue.length)e=o.initQueue.shift();else{if(!o.domready)return void o.initTimeout(function(){return!o.domready&&document.body&&o.scanDOM(),o.domready});if(!o.readyQueue.length)return o.ready=n.isReady=!0,o.event(r._readyEvent),void o.scanDOM();e=o.readyQueue.shift()}!1!==e()&&o.nextInitItem()}},o.addStylesheet=function(e){var t;if(!document.head||!document.body)return!!o.domready||(e||o.initTimeout(o.addStylesheet.bind(null,!0)),!1);try{(t=document.createElement("style")).type="text/css",t.innerHTML="span.iconify, i.iconify, iconify-icon { display: inline-block; width: 1em; }",null!==document.head.firstChild?document.head.insertBefore(t,document.head.firstChild):document.head.appendChild(t)}catch(e){}return!0},o.initQueue.push(o.addStylesheet.bind(null,!1)),n.ready=function(e){n.isReady?window.setTimeout(e):document.addEventListener(r._readyEvent,e)},window.setTimeout(function(){"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?o.domready=!0:(document.addEventListener("DOMContentLoaded",X),window.addEventListener("load",X)),o.nextInitItem()}),(s=$.config).SVGAttributes=Object.create(null),s._imageClass="iconify",s._loadingClass="svg-loading",s._iconAttribute="data-icon",s._rotateAttribute="data-rotate",s._flipAttribute="data-flip",s._inlineModeAttribute="data-inline",s._alignAttribute="data-align",s._appendAttribute="data-icon-append",s._appendedClass="svg-appended",s._readyEvent="IconifyReady",s._webComponentsPolyfill="https://cdnjs.cloudflare.com/ajax/libs/webcomponentsjs/0.7.24/webcomponents-lite.min.js",s._classListPolyfill="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20150312/classList.min.js",function(t){t.defaultAPI="https://api.iconify.design/{prefix}.js?icons={icons}",t.API=Object.create(null),t.loaderMaxURLSize=500,t.loadBeforeDOMReady=!(document&&document.body),t._loaderEvent="IconifyAddedIcons",t.sessionStorage=!0;try{t.localStorage=!!(window&&window.localStorage&&window.localStorage.length)}catch(e){t.localStorage=!1}}($.config),c=e,l=t,u=$.config,c.setConfig=function(e,t){Z(e,t,!1)},c.setCustomAPI=function(e,t){switch(typeof e){case"string":0;break;case"object":if(e instanceof Array){0;break}default:return}e.forEach(function(e){null===t?delete u.API[e]:u.API[e]=t})},c.getConfig=function(e){return void 0===u[e]?void 0===u["_"+e]?null:u["_"+e]:u[e]},["SimpleSVG","Iconify"].forEach(function(e){var t;void 0!==l[e+"Config"]&&"object"==typeof l[e+"Config"]&&(t=l[e+"Config"],Object.keys(t).forEach(function(e){Z(e,t[e],!0)}))}),f=(d=$).config,h=t,d.initQueue.push(function(){var e={observer:!1,classList:!1},t={observer:!1,classList:!1};function i(e){var t;return!e.length||(document.head?((t=document.createElement("script")).setAttribute("src",e),t.setAttribute("type","text/javascript"),document.head.appendChild(t),!0):d.domready)}function n(){if("classList"in document.createElement("div"))return 1;t.classList||(t.classList=i(f._classListPolyfill))}function o(){return h.MutationObserver&&h.WeakMap||t.observer||(t.observer=i(f._webComponentsPolyfill)),1}return e.classList=!n(),e.observer=!o(),!e.classList&&!e.observer||(d.initTimeout(function(){return!(e.observer&&!o()||e.classList&&!n())}),!1)}),$.getPrefix=function(e,t){var i;return"string"==typeof t&&""!==t?{prefix:t,icon:e}:2===(i=e.split(":")).length?{prefix:i[0],icon:i[1]}:1<(i=e.split("-")).length?{prefix:t=i.shift(),icon:i.join("-")}:{prefix:"",icon:e}},p=$.getPrefix,v={left:0,top:0,width:16,height:16,rotate:0,vFlip:!1,hFlip:!1},g=["left","top","width","height","body","rotate","vFlip","hFlip","inlineTop","inlineHeight","verticalAlign"],ne.mergeFlip=te,ne.mergeRotation=ee,ne.blankIcon=function(){return ie({body:"",width:16,height:16})},$.Storage=ne,b=e,y=t,w=!1,x=new(m=$).Storage,b.addCollection=function(e,t){x.addCollection(e),w||!0===t||(w=!0,window.setTimeout(oe,0))},b.addIcon=function(e,t,i){x.addIcon(e,t),w||!0===i||(w=!0,window.setTimeout(oe,0))},b.iconExists=x.exists.bind(x),b.getIcon=x.copyIcon.bind(x),b.listIcons=x.list.bind(x),["SimpleSVG","Iconify"].forEach(function(e){void 0!==y[e+"Preload"]&&y[e+"Preload"]instanceof Array&&y[e+"Preload"].forEach(function(e){"object"==typeof e&&void 0!==e.icons&&b.addCollection(e)})}),_=$.Storage,O=$.config,A=/(-?[0-9.]*[0-9]+[0-9.]*)/g,j=/^-?[0-9.]*[0-9]+[0-9.]*$/g,I=["width","height","inline"],E=["title"],k=0,$.SVG=function(x){return x=x||_.blankIcon(),this.item=x,this.height=function(e,t,i){return void 0===e?t?this.item.inlineHeight:this.item.height:re(e,(t?this.item.inlineHeight:this.item.height)/this.item.width,i)},this.width=function(e,t,i){return void 0===e?this.item.width:re(e,this.item.width/(t?this.item.inlineHeight:this.item.height),i)},this.defaultAttributes=function(){return{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":"true",focusable:"false"}},this.preserveAspectRatio=function(e,t,i){var n="";switch(e){case"left":n+="xMin";break;case"right":n+="xMax";break;default:n+="xMid"}switch(t){case"top":n+="YMin";break;case"bottom":n+="YMax";break;default:n+="YMid"}return n+=!0===i?" slice":" meet"},this.htmlspecialchars=function(e){switch(typeof e){case"boolean":case"number":return e+"";case"string":return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}return""},this.attributes=function(t){var e,i,n,o,r,a,s,c,l,u,d,f,h,p,v=this,g={horizontal:"center",vertical:"middle",crop:!1},b={rotate:x.rotate,hFlip:x.hFlip,vFlip:x.vFlip},m="",y=this.defaultAttributes(),w=[];if(a=ae(t="object"==typeof t?t:Object.create(null),[O._inlineModeAttribute,"inline"],!0),u=ae(t,[O._appendAttribute],!1),e={left:x.left,top:a?x.inlineTop:x.top,width:x.width,height:a?x.inlineHeight:x.height},"string"==typeof t[O._flipAttribute]&&t[O._flipAttribute].split(/[\s,]+/).forEach(function(e){switch(e=e.toLowerCase()){case"horizontal":b.hFlip=!b.hFlip;break;case"vertical":b.vFlip=!b.vFlip}}),void 0!==t[O._rotateAttribute])if("number"==typeof(c=t[O._rotateAttribute]))b.rotate+=c;else if("string"==typeof c)if(""===(d=c.replace(/^-?[0-9.]*/,"")))c=parseInt(c),isNaN(c)||(b.rotate+=c);else if(d!==c){switch(l=!1,d){case"%":l=25;break;case"deg":l=90}l&&(c=parseInt(c.slice(0,c.length-d.length)),isNaN(c)||(b.rotate+=Math.round(c/l)))}switch(b.hFlip?b.vFlip?b.rotate+=2:(w.push("translate("+(e.width+e.left)+" "+(0-e.top)+")"),w.push("scale(-1 1)"),e.top=e.left=0):b.vFlip&&(w.push("translate("+(0-e.left)+" "+(e.height+e.top)+")"),w.push("scale(1 -1)"),e.top=e.left=0),b.rotate%4){case 1:p=e.height/2+e.top,w.unshift("rotate(90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p);break;case 2:w.unshift("rotate(180 "+(e.width/2+e.left)+" "+(e.height/2+e.top)+")");break;case 3:p=e.width/2+e.left,w.unshift("rotate(-90 "+p+" "+p+")"),0===e.left&&0===e.top||(p=e.left,e.left=e.top,e.top=p),e.width!==e.height&&(p=e.width,e.width=e.height,e.height=p)}return i=se(t,["data-width","width"],null),n=se(t,["data-height","height"],null),null===i&&null===n&&(n="1em"),null!==i&&null!==n?(o=i,r=n):null!==i?r=re(o=i,e.height/e.width):o=re(r=n,e.width/e.height),!1!==o&&(y.width="auto"===o?e.width:o),!1!==r&&(y.height="auto"===r?e.height:r),a&&0!==x.verticalAlign?m+="vertical-align: "+(h=x.verticalAlign+"em")+";":h="","string"==typeof t[O._alignAttribute]&&t[O._alignAttribute].toLowerCase().split(/[\s,]+/).forEach(function(e){switch(e){case"left":case"right":case"center":g.horizontal=e;break;case"top":case"bottom":case"middle":g.vertical=e;break;case"crop":g.crop=!0;break;case"meet":g.crop=!1}}),m+="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);",y.style=m+(void 0===t.style?"":t.style),y.preserveAspectRatio=this.preserveAspectRatio(g.horizontal,g.vertical,g.crop),y.viewBox=e.left+" "+e.top+" "+e.width+" "+e.height,s=function(i){var e,n,t=/\sid="(\S+)"/g,o=[];function r(e,t,i){for(var n=0;-1!==(n=i.indexOf(e,n));)i=i.slice(0,n)+t+i.slice(n+e.length),n+=t.length;return i}for(;e=t.exec(i);)o.push(e[1]);return o.length&&(n="IconifyId-"+Date.now().toString(16)+"-"+(16777216*Math.random()|0).toString(16)+"-",o.forEach(function(e){var t=n+k;k++,i=r('="'+e+'"','="'+t+'"',i),i=r('="#'+e+'"','="#'+t+'"',i),i=r("(#"+e+")","(#"+t+")",i)})),i}(this.item.body),w.length&&(s='<g transform="'+w.join(" ")+'">'+s+"</g>"),f=Object.create(null),Object.keys(t).forEach(function(e){void 0===y[e]&&(-1!==E.indexOf(e)?s="<"+e+">"+v.htmlspecialchars(t[e])+"</"+e+">"+s:-1===I.indexOf(e)&&(f[e]=t[e]))}),{attributes:y,elementAttributes:f,body:s,append:u,verticalAlign:h}},this},M=(C=$).config._loadingClass,C.newImage=function(e,t,i){return{element:e,icon:t,parser:i,loading:e.classList.contains(M)}},C.parsedImage=function(e,t){return{element:e,icon:t}},C.getImageAttributes=function(t){var e,i,n=Object.create(null);if(!t.element.hasAttributes())return n;for(e=0;e<t.element.attributes.length;e++)i=t.element.attributes[e],n[i.name]=i.value;return t.parser&&void 0!==t.parser.filterAttributes&&(n=t.parser.filterAttributes(t,n)),void 0!==n.class&&(n.class=n.class.split(" ").filter(function(e){return e!==M}),t.parser&&void 0!==t.parser.filterClasses&&(n.class=t.parser.filterClasses(t,n.class)),n.class=n.class.join(" ")),void 0!==t.attributes&&Object.keys(t.attributes).forEach(function(e){n[e]=t.attributes[e]}),n},function(n,f,e){var a=e._imageClass,t=e._loadingClass,i=e._appendedClass,s=e._iconAttribute,o=e._inlineModeAttribute,r=":not(svg):not(."+i+")",c=":not(."+t+")",l="."+t,h={iconify:{selector:"."+a,selectorAll:"."+a+r,selectorNew:"."+a+r+c,selectorLoading:"."+a+r+l,icon:function(e){var t,i=e.getAttribute(s);if("string"==typeof i)return i;for(var n=0;n<e.classList.length;n++)if(5<(t=e.classList[n]).length&&"icon:"===t.slice(0,5))return t.slice(5);return""},filterClasses:function(e,t){var i,n,o;for(n=0;n<t.length;n++)"icon-"===(i=t[n]).slice(0,5)&&2===(i=i.slice(5).split(":")).length&&(o="data-"+i[0],void 0===e.attributes&&(e.attributes=Object.create(null)),e.attributes[o]=i[1]);return t}}},p=Object.keys(h);n.addFinder=function(e,t){void 0===t.selectorAll&&(t.selectorAll=t.selector+r),void 0===t.selectorNew&&(t.selectorNew=t.selector+r+c),void 0===t.selectorLoading&&(t.selectorLoading=t.selector+r+l),h[e]=t,p=Object.keys(h),n.isReady&&n.scanDOM()},n.addTag=function(e,i,t){n.addFinder("tag-"+e,{selector:e,icon:null==t?h.iconify.icon:t,filterAttributes:function(e,t){return void 0===t[o]&&(t[o]=i),t},filterClasses:h.iconify.filterClasses})};try{"object"==typeof Reflect&&"object"==typeof customElements&&Object.setPrototypeOf&&(Object.setPrototypeOf(u.prototype,HTMLElement.prototype),Object.setPrototypeOf(u,HTMLElement),customElements.define("iconify-icon",u))}catch(e){}function u(){return Reflect.construct(HTMLElement,[],u)}n.addTag("iconify-icon",!1),f.findNewImages=function(c,l){var u=[],d=[];return(c=void 0===c?void 0===e._root?document.body:e._root:c)&&p.forEach(function(e){var t,i,n,o,r=h[e],a=!0===l?r.selectorLoading:!1===l?r.selectorNew:r.selectorAll,s=c.querySelectorAll(a);for(t=0;t<s.length;t++)i=s[t],(n=r.icon(i))&&-1===d.indexOf(i)&&(d.push(i),o=f.newImage(i,n,r),u.push(o))}),u},f.findParsedImages=function(e){var t,i,n,o=[],r=e.querySelectorAll("svg."+a);for(t=0;t<r.length;t++)(n=(i=r[t]).getAttribute(s))&&o.push(f.parsedImage(i,n));return o}}(e,$,$.config),L=e,F=(S=$).config,P=t,T=Object.create(null),R=Object.create(null),N=Object.create(null),H={session:!(D=!1),local:!0},V={session:0,local:0},L._loaderCallback=function(i){var n=!1;"object"==typeof i&&(["local","session"].forEach(function(t){var e;if(!n&&H[t]&&F[t+"Storage"]){e=P[t+"Storage"];try{V[t]||e.setItem("iconify-version",S.version),e.setItem("iconify"+V[t],JSON.stringify(i)),n=!0,V[t]++,e.setItem("iconify-count",V[t])}catch(e){H[t]=!1}}}),L.addCollection(i),S.event(F._loaderEvent))},S.loadImage=function(e,t){var i=S.getPrefix(e.icon);return!!L.iconExists(i.icon,i.prefix)||(!1!==t&&le(i.prefix,i.icon,!1)&&e.element.classList.add(F._loadingClass),!1)},L.preloadImages=function(e){var t,i=!1;return e.forEach(function(e){t=S.getPrefix(e),L.iconExists(t.icon,t.prefix)||(le(t.prefix,t.icon,!0),i=!0)}),i},["local","session"].forEach(function(t){var e,i,n;try{if("object"!=typeof(e=P[t+"Storage"]))return void(H[t]=!1);if(e.getItem("iconify-version")!==S.version)return;if("number"!=typeof(n=parseInt(e.getItem("iconify-count")))||isNaN(n))return;for(;;){if(V[t]>=n)return;if("string"!=typeof(i=e.getItem("iconify"+V[t])))return;"object"==typeof(i=JSON.parse(i))&&L.addCollection(i),V[t]++}}catch(e){H[t]=!1}}),e.pauseObserving=function(){},e.resumeObserving=function(){},G=e,z=(Q=$).config,B=z._iconAttribute,q=z._loadingClass,Y=z._imageClass,J=z._appendedClass,Q.renderSVG=function(t){var e,i,n,o,r,a,s,c,l,u,d,f=Q.getImageAttributes(t),h=G.getIcon(t.icon);for(f[B]=t.icon,e=new Q.SVG(h),n=document.createElement("svg"),r=e.attributes(f),Object.keys(r.attributes).forEach(function(e){if(d=r.attributes[e],"style"!==e||"string"==typeof(d=t.element.getAttribute("style"))&&d.length)try{n.setAttribute(e,d)}catch(e){}}),Object.keys(r.elementAttributes).forEach(function(e){try{(r.append?t.element:n).setAttribute(e,r.elementAttributes[e])}catch(e){}}),t.loading&&(n.classList.remove(q),r.append&&t.element.classList.remove(q)),n.classList.add(Y),a=ue(n.outerHTML,r.body),(o=document.createElement("span")).innerHTML=a,i=o.childNodes[0],r.append?(t.element.classList.add(J),t.element.appendChild(i)):(t.element.parentNode.replaceChild(i,t.element),t.element=i),s=i.style,c=t.element.style,r.verticalAlign&&(s.verticalAlign=r.verticalAlign),s.transform="rotate(360deg)",l=0;l<c.length;l++)s[u=c[l]]=c[u];delete t.parser,delete t.loading},G.getSVGObject=function(e,t){return!!G.iconExists(e)&&new Q.SVG(G.getIcon(e)).attributes(t,!1)},G.getSVG=function(e,t){var i,n;return!1!==(n=G.getSVGObject(e,t))&&(i=document.createElement("svg"),Object.keys(n.attributes).forEach(function(e){try{i.setAttribute(e,n.attributes[e])}catch(e){}}),ue(i.outerHTML,n.body))},U=e,(W=$).scanDOM=function(){var t=!1;function e(){W.findNewImages().forEach(function(e){W.loadImage(e)&&(t||(t=!0,U.pauseObserving()),W.renderSVG(e))})}if(W.ready)e();else try{e()}catch(e){}t&&U.resumeObserving()},U.scanDOM=W.scanDOM,U.getVersion=function(){return W.version}}(self.Iconify,self)),"object"==typeof exports)try{exports.__esModule=!0,exports.default=self.Iconify}catch(e){} |
@@ -5,3 +5,3 @@ { | ||
"author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"license": "(Apache-2.0 OR GPL-2.0)", | ||
@@ -34,4 +34,4 @@ "keywords": [ | ||
"mocha": "^5.2.0", | ||
"uglify-js": "^3.8.1" | ||
"uglify-js": "^3.9.1" | ||
} | ||
} |
146
README.md
# What is Iconify? | ||
Iconify project makes it easy to add SVG icons to websites and offers over 40,000 icons to choose from. | ||
Iconify project makes it easy to add SVG icons to websites and offers over 50,000 icons to choose from. | ||
@@ -9,4 +9,4 @@ There are many fonts and SVG sets available, but they all have one thing in common: using any font or SVG set limits you | ||
Iconify project uses new innovative approach to loading icons. Unlike fonts and SVG frameworks, Iconify only loads | ||
icons that are used on page instead of loading entire fonts. How is it done? By serving icons dynamically from publicly | ||
Iconify project uses a new innovative approach to loading icons. Unlike fonts and SVG frameworks, Iconify only loads | ||
icons that are used on the page instead of loading entire fonts. How is it done? By serving icons dynamically from publicly | ||
available JSON API (you can make a copy of script and API if you prefer to keep everything on your servers). | ||
@@ -18,11 +18,11 @@ | ||
```html | ||
<script src="https://code.iconify.design/1/1.0.6/iconify.min.js"></script> | ||
``` | ||
<script src="https://code.iconify.design/1/1.0.4/iconify.min.js"></script> | ||
``` | ||
or | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/@iconify/iconify@1.0.6/dist/iconify.min.js"></script> | ||
``` | ||
<script src="https://cdn.jsdelivr.net/npm/@iconify/iconify@1.0.4/dist/iconify.min.js"></script> | ||
``` | ||
or if you are building project with something like WebPack, you can include script by installing @iconify/iconify as dependency and importing it in your project: | ||
``` | ||
or if you are building project with something like WebPack, you can include script by installing `@iconify/iconify` as dependency and importing it in your project: | ||
```js | ||
import Iconify from '@iconify/iconify'; | ||
@@ -34,7 +34,7 @@ ``` | ||
``` | ||
```html | ||
<span class="iconify" data-icon="fa-home"></span> | ||
``` | ||
or this: | ||
``` | ||
```html | ||
<iconify-icon class="iconify" data-icon="mdi-home"></iconify-icon> | ||
@@ -47,27 +47,27 @@ ``` | ||
That is it. Change data-icon value to name of icon you want to use. There are over 50,000 premade icons to choose from, | ||
including FontAwesome, Material Design Icons, Entypo+ and even several emoji sets. | ||
That is it. Change `data-icon` value to the name of the icon you want to use. There are over 50,000 premade icons to choose from, | ||
including FontAwesome, Material Design Icons, Entypo+, Box Icons, Unicons and even several emoji sets. | ||
Do you want to make your own icon sets? Tools for making custom icon sets are available on GitHub. See documentation. | ||
## Customizing color, dimensions, transformations | ||
## Customizing colour, dimensions, transformations | ||
### Color | ||
There are 2 types of icons: monotone and colored. | ||
There are 2 types of icons: monotone and coloured. | ||
* Monotone icons are icons that use only 1 color. All icons from glyph fonts fall into this category: FontAwesome, | ||
* Monotone icons are icons that use only 1 colour. All icons from glyph fonts fall into this category: FontAwesome, | ||
GlyphIcons, Material Design Icons, etc. | ||
* Colored icons are icons that use preset palette. Most emoji icons fall into this category: Noto Emoji, Emoji One, | ||
etc. You cannot change palette for those icons. | ||
etc. You cannot change the palette for those icons. | ||
Monotone icons use font color, just like glyph fonts. To change color you can do this: | ||
Monotone icons use font colour, just like glyph fonts. To change colour, you can do this: | ||
``` | ||
```html | ||
<span class="iconify icon-bell" data-icon="vaadin-bell"></span> | ||
``` | ||
and add this to css: | ||
and add this to CSS: | ||
``` | ||
```css | ||
.icon-bell { | ||
@@ -90,3 +90,3 @@ color: #f80; | ||
``` | ||
```html | ||
<span class="iconify icon-clipboard" data-icon="emojione-clipboard"></span> | ||
@@ -97,3 +97,3 @@ ``` | ||
``` | ||
```css | ||
.icon-clipboard { | ||
@@ -111,3 +111,3 @@ font-size: 32px; | ||
``` | ||
```css | ||
.icon-clipboard { | ||
@@ -119,5 +119,5 @@ font-size: 32px; | ||
You can also set custom dimensions using data-width and data-height attributes: | ||
You can also set custom dimensions using `data-width` and `data-height` attributes: | ||
``` | ||
```html | ||
<span data-icon="twemoji-ice-cream" data-width="32" data-height="32" class="iconify"></span> | ||
@@ -133,4 +133,4 @@ ``` | ||
Trouble with using images in text is they are aligned at baseline. Glyph fonts don't have that issue because | ||
they are rendered as fonts, vertically centered slightly below baseline so they look nicely aligned in text. | ||
The trouble with using images in the text is they are aligned at baseline. Glyph fonts don't have that issue because | ||
they are rendered as fonts, vertically centred slightly below baseline so they look nicely aligned in text. | ||
@@ -140,19 +140,19 @@ To solve that issue Iconify adds vertical alignment to all icons, placing them below baseline, so icons behave | ||
But what if you don't want that behavior? What if you want Iconify icons to behave like images? There are several | ||
But what if you don't want that behaviour? What if you want Iconify icons to behave like images? There are several | ||
solutions, use whichever you prefer: | ||
1. Using iconify-icon tag instead of span: | ||
``` | ||
1. Using `iconify-icon` tag instead of `span`: | ||
```html | ||
<iconify-icon data-icon="noto-frog-face"></iconify-icon> | ||
``` | ||
iconify-icon tag is equal to using class="iconify" on any other element, but by default inline mode is disabled, so icon | ||
will not have preset vertical-alignment style, behaving like normal image. | ||
will not have preset vertical-alignment style, behaving like a normal image. | ||
2. Adding data-inline attribute: | ||
``` | ||
2. Adding `data-inline` attribute: | ||
```html | ||
<span class="iconify" data-icon="noto-frog-face" data-inline="false"></span> | ||
``` | ||
3. Removing vertical-alignment via css: | ||
``` | ||
3. Removing vertical-alignment via CSS: | ||
```css | ||
.iconify { | ||
@@ -170,5 +170,5 @@ vertical-align: baseline !important; | ||
You can rotate and flip icon by adding data-flip and data-rotate attributes: | ||
You can rotate and flip icon by adding `data-flip` and `data-rotate` attributes: | ||
``` | ||
```html | ||
<span data-icon="twemoji-helicopter" class="iconify" data-flip="horizontal"></span> | ||
@@ -178,13 +178,13 @@ <span data-icon="twemoji-helicopter" class="iconify" data-rotate="90deg"></span> | ||
Possible values for data-flip: horizontal, vertical. | ||
Possible values for data-rotate: 90deg, 180deg, 270deg. | ||
Possible values for `data-flip`: horizontal, vertical. | ||
Possible values for `data-rotate`: 90deg, 180deg, 270deg. | ||
If you use both flip and rotation, icon is flipped first, then rotated. | ||
If you use both flip and rotation, the icon is flipped first, then rotated. | ||
To use custom transformations use css transform rule. Add !important after rule to override svg style. | ||
To use custom transformations use CSS transform rule. Add `!important` after rule to override SVG style. | ||
``` | ||
```html | ||
<span data-icon="twemoji-helicopter" class="iconify icon-helicopter"></span> | ||
``` | ||
``` | ||
```css | ||
.icon-helicopter { | ||
@@ -202,5 +202,5 @@ transform: 45deg !important; | ||
One useful feature of glyph fonts is ease of use in stylesheets. Usually it is done by adding pseudo selector like this: | ||
One useful feature of glyph fonts is the ease of use in stylesheets. Usually, it is done by adding a pseudo selector like this: | ||
``` | ||
```css | ||
.foo:after { | ||
@@ -214,7 +214,7 @@ content: '\f030'; | ||
* Using SVG as pseudo element's content | ||
* Using SVG as background image | ||
* Using SVG as a background image | ||
Both options use external image generated by Iconify API. Iconify API can create SVG for any image in collection. You can use it like this: | ||
Both options use an external icon generated by Iconify API. Iconify API can create SVG for any available icon. You can use it like this: | ||
``` | ||
```css | ||
.foo { | ||
@@ -226,3 +226,3 @@ background: url('https://api.iconify.design/emojione-ice-skate.svg') no-repeat center center / contain; | ||
or like this: | ||
``` | ||
```css | ||
.bar:after { | ||
@@ -233,7 +233,7 @@ content: url('https://api.iconify.design/emojione-ice-skate.svg?height=16'); | ||
Notice "height" attribute in second example. You must specify height if you are using SVG as psedo element's content, that's the only way to resize it. You can also set width parameter, but its not needed because if you set height, width will be calculated by Iconify API using original icon's width/height ratio. | ||
Notice "height" attribute in the second example. You must specify height if you are using SVG as pseudo element's content, that's the only way to resize it. You can also set width parameter, but it is not needed because if you set height, the width will be calculated by Iconify API using original icon's width to height ratio. | ||
Examples above use emoji that has preset color palette. What about monotone icons? SVG cannot inherit color from DOM when used as external resource. That means you need to specify color value. To specify color, add color parameter: | ||
Examples above use emoji that has a preset colour palette. What about monotone icons? SVG cannot inherit colour from DOM when used as an external resource. That means you need to specify the colour value. To specify the colour, add `color` parameter: | ||
``` | ||
```css | ||
.foo { | ||
@@ -248,7 +248,7 @@ background: url("https://api.iconify.design/mdi-account.svg?color=red") no-repeat center center / contain; | ||
Where %23FF8040 is URL version of #FF8040. You cannot use # in URL, so you need to replace it with %23 | ||
Where `%23FF8040` is URL version of `#FF8040`. You cannot use `#` in URL, so you need to replace it with `%23`. | ||
Optional parameters: | ||
* width and height - width and height in pixels. If you set it to "auto", original SVG dimensions will be used. It is enough to set only 1 dimension to "auto", other dimension will be set to "auto" automatically: | ||
* width and height - width and height in pixels. If you set it to "auto", original SVG dimensions will be used. It is enough to set only 1 dimension to "auto", another dimension will be set to "auto" automatically: | ||
@@ -261,3 +261,3 @@ ``` | ||
same as in data-align attribute mentioned above. | ||
* flip, rotate - transformations. Same as data-flip and data-rotate mentioned above. | ||
* flip, rotate - transformations. Same as `data-flip` and `data-rotate` mentioned above. | ||
@@ -267,12 +267,12 @@ | ||
There are over 40,000 icons to choose from. | ||
There are over 50,000 icons to choose from. | ||
General collections (monotone icons): | ||
* [Material Design Icons](https://iconify.design/icon-sets/mdi/) (3000+ icons) | ||
* [Material Design Icons](https://iconify.design/icon-sets/mdi/) (5000+ icons) | ||
* [Unicons](https://iconify.design/icon-sets/uil/) (1000+ icons) | ||
* [Jam Icons](https://iconify.design/icon-sets/jam/) (900 icons) | ||
* [IonIcons](https://iconify.design/icon-sets/ion/) (700+ icons) | ||
* [IonIcons](https://iconify.design/icon-sets/ion/) (1200+ icons) | ||
* [FontAwesome 4](https://iconify.design/icon-sets/fa/) and [FontAwesome 5](https://iconify.design/icon-sets/fa-solid/) (2000+ icons) | ||
* [Vaadin Icons](https://iconify.design/icon-sets/vaadin/) (600+ icons) | ||
* [Feather Icon(s)](https://iconify.design/icon-sets/feather/) (600+ icons) | ||
* [Feather Icon(s)](https://iconify.design/icon-sets/feather/) (500+ icons) | ||
* [IcoMoon Free](https://iconify.design/icon-sets/icomoon-free/) (400+ icons) | ||
@@ -288,7 +288,7 @@ * [Dashicons](https://iconify.design/icon-sets/dashicons/) (300 icons) | ||
Also there are several thematic collections, such as weather icons, map icons, etc. | ||
Also, there are several thematic collections, such as weather icons, map icons, etc. | ||
You can use browse or search available icons on Iconify website: https://iconify.design/icon-sets/ | ||
You can use browse or search available icons on the Iconify website: https://iconify.design/icon-sets/ | ||
Click any icon to get HTML code. | ||
Click an icon to get HTML code. | ||
@@ -306,15 +306,21 @@ | ||
Some icon sets used in Iconify are imported from glyph fonts. Iconify includes plugins for some of those collections | ||
that make it easier to migrate from font library. | ||
that make it easier to migrate from the font library. | ||
By default Iconify is searching for items with "iconify" class and uses data-icon attribute to get icon name: | ||
<span class="iconify" data-icon="mdi-home"></span> | ||
```html | ||
<span class="iconify" data-icon="mdi-home"></span> | ||
``` | ||
Plugins make Iconify search for other selectors, so you can keep using old library syntax: | ||
<i class="fa fa-arrow-left"></i> | ||
```html | ||
<i class="fa fa-arrow-left"></i> | ||
``` | ||
How to use plugins? Include plugin script: | ||
<script src="https://code.iconify.design/1/1.0.4/plugin-fa.min.js"></script> | ||
```html | ||
<script src="https://code.iconify.design/1/1.0.6/plugin-fa.min.js"></script> | ||
``` | ||
@@ -324,3 +330,3 @@ Replace link to FontAwesome with link to Iconify and link to FontAwesome plugin and you can keep using old FontAwesome | ||
However it is better to not use plugins for cleaner code. | ||
However, it is better to not use plugins for cleaner code. | ||
@@ -346,5 +352,5 @@ | ||
This license does not apply to icons. Icons are released under different licenses, see each icons set for details. | ||
Icons available by default are all licensed under some kind of open source or free license. | ||
This license does not apply to icons. Icons are released under different licenses, see each icon set for details. | ||
Icons available by default are all licensed under some kind of open-source or free license. | ||
© 2016 - 2020 Vjacheslav Trushkin |
@@ -67,3 +67,3 @@ /** | ||
item = Iconify.getIcon(image.icon), | ||
svgObject, svgElement, temp, span, data, html, svgStyle, placeholderStyle, i, attr; | ||
svgObject, svgElement, temp, span, data, html, svgStyle, placeholderStyle, i, attr, attrValue; | ||
@@ -78,7 +78,11 @@ attributes[iconAttribute] = image.icon; | ||
Object.keys(data.attributes).forEach(function(attr) { | ||
attrValue = data.attributes[attr]; | ||
if (attr === 'style') { | ||
return; | ||
attrValue = image.element.getAttribute('style'); | ||
if (typeof attrValue !== 'string' || !attrValue.length) { | ||
return; | ||
} | ||
} | ||
try { | ||
temp.setAttribute(attr, data.attributes[attr]); | ||
temp.setAttribute(attr, attrValue); | ||
} catch (err) { | ||
@@ -85,0 +89,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
469086
11576
334