/* * This file is part of the TYPO3 CMS project. * * It is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, either version 2 * of the License, or any later version. * * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * * The TYPO3 project - inspiring people to share! */ import{LitElement as d,html as c,nothing as m}from"lit";import{Task as u}from"@lit/task";import{property as a,customElement as y}from"lit/decorators.js";import{unsafeHTML as h}from"lit/directives/unsafe-html.js";import{Sizes as v,States as g,MarkupIdentifiers as z}from"@typo3/backend/enum/icon-types.js";import w,{IconStyles as S}from"@typo3/backend/icons.js";import"@typo3/backend/element/spinner-element.js";var n=function(l,t,r,o){var s=arguments.length,e=s<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(l,t,r,o);else for(var f=l.length-1;f>=0;f--)(p=l[f])&&(e=(s<3?p(e):s>3?p(t,r,e):p(t,r))||e);return s>3&&e&&Object.defineProperty(t,r,e),e};let i=class extends d{constructor(){super(...arguments),this.size=v.default,this.state=g.default,this.overlay=null,this.markup=z.inline,this.raw=null,this.iconTask=new u(this,{task:async([t,r,o,s,e],{signal:p})=>await w.getIcon(t,r,o,s,e,p),args:()=>[this.identifier,this.size,this.overlay,this.state,this.markup]})}static{this.styles=S.getStyles()}render(){return this.raw?c`${h(this.raw)}`:this.identifier?this.iconTask.render({pending:()=>c``,complete:t=>c`${h(t)}`,error:()=>c``}):m}};n([a({type:String,reflect:!0})],i.prototype,"identifier",void 0),n([a({type:String,reflect:!0})],i.prototype,"size",void 0),n([a({type:String})],i.prototype,"state",void 0),n([a({type:String})],i.prototype,"overlay",void 0),n([a({type:String})],i.prototype,"markup",void 0),n([a({type:String})],i.prototype,"raw",void 0),i=n([y("typo3-backend-icon")],i);export{i as IconElement};