text: import{Base}from"../polymer/polymer-legacy.js";import"../iron-meta/iron-meta.js";import"../iron-flex-layout/iron-flex-layout.js";import{Polymer}from"../polymer/lib/legacy/polymer-fn.js";import{html}from"../polymer/lib/utils/html-tag.js";import{dom}from"../polymer/lib/legacy/polymer.dom.js";Polymer({_template:html`
      <style>
        :host {
          @apply --layout-inline;
          @apply --layout-center-center;
          position: relative;
  
          vertical-align: middle;
  
          fill: var(--iron-icon-fill-color, currentcolor);
          stroke: var(--iron-icon-stroke-color, none);
  
          width: var(--iron-icon-width, 24px);
          height: var(--iron-icon-height, 24px);
          @apply --iron-icon;
        }
  
        :host([hidden]) {
          display: none;
        }
      </style>
  `,is:"iron-icon",properties:{icon:{type:String},theme:{type:String},src:{type:String},_meta:{value:Base.create("iron-meta",{type:"iconset"})}},observers:["_updateIcon(_meta, isAttached)","_updateIcon(theme, isAttached)","_srcChanged(src, isAttached)","_iconChanged(icon, isAttached)"],_DEFAULT_ICONSET:"icons",_iconChanged:function(icon){var parts=(icon||"").split(":");this._iconName=parts.pop();this._iconsetName=parts.pop()||this._DEFAULT_ICONSET;this._updateIcon()},_srcChanged:function(){this._updateIcon()},_usesIconset:function(){return this.icon||!this.src},_updateIcon:function(){if(this._usesIconset()){if(this._img&&this._img.parentNode){dom(this.root).removeChild(this._img)}if(""===this._iconName){if(this._iconset){this._iconset.removeIcon(this)}}else if(this._iconsetName&&this._meta){this._iconset=this._meta.byKey(this._iconsetName);if(this._iconset){this._iconset.applyIcon(this,this._iconName,this.theme);this.unlisten(window,"iron-iconset-added","_updateIcon")}else{this.listen(window,"iron-iconset-added","_updateIcon")}}}else{if(this._iconset){this._iconset.removeIcon(this)}if(!this._img){this._img=document.createElement("img");this._img.style.width="100%";this._img.style.height="100%";this._img.draggable=!1}this._img.src=this.src;dom(this.root).appendChild(this._img)}}});