/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/common/http"),require("@angular/core"),require("@angular/platform-browser"),require("rxjs"),require("rxjs/operators"),require("@angular/material/core"),require("@angular/cdk/coercion")):"function"==typeof define&&define.amd?define("@angular/material/icon",["exports","@angular/common","@angular/common/http","@angular/core","@angular/platform-browser","rxjs","rxjs/operators","@angular/material/core","@angular/cdk/coercion"],e):e((t.ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.icon={}),t.ng.common,t.ng.common.http,t.ng.core,t.ng.platformBrowser,t.rxjs,t.rxjs.operators,t.ng.material.core,t.ng.cdk.coercion)}(this,function(t,e,n,o,r,i,s,a,c){"use strict";function l(t,e){function n(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function u(t){return Error('Unable to find icon with the name "'+t+'"')}function p(){return Error("Could not find HttpClient provider for use with Angular Material icons. Please include the HttpClientModule from @angular/common/http in your app imports.")}function f(t){return Error("The URL provided to MatIconRegistry was not trusted as a resource URL via Angular's DomSanitizer. Attempted URL was \""+t+'".')}function h(t){return Error("The literal provided to MatIconRegistry was not trusted as safe HTML by Angular's DomSanitizer. Attempted literal was \""+t+'".')}function g(t,e,n,o){return t||new S(e,n,o)}function m(t){return t.cloneNode(!0)}function d(t,e){return t+":"+e}function v(){var t=o.inject(e.DOCUMENT),n=t?t.location:null;return{getPathname:function(){return n?n.pathname+n.search:""}}}var _=function(t,e){return(_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},y=function(){function t(t){t.nodeName?this.svgElement=t:this.url=t}return t}(),S=function(){function t(t,e,n){this._httpClient=t,this._sanitizer=e,this._svgIconConfigs=new Map,this._iconSetConfigs=new Map,this._cachedIconsByUrl=new Map,this._inProgressUrlFetches=new Map,this._fontCssClassesByAlias=new Map,this._defaultFontSetClass="material-icons",this._document=n}return t.prototype.addSvgIcon=function(t,e){return this.addSvgIconInNamespace("",t,e)},t.prototype.addSvgIconLiteral=function(t,e){return this.addSvgIconLiteralInNamespace("",t,e)},t.prototype.addSvgIconInNamespace=function(t,e,n){return this._addSvgIconConfig(t,e,new y(n))},t.prototype.addSvgIconLiteralInNamespace=function(t,e,n){var r=this._sanitizer.sanitize(o.SecurityContext.HTML,n);if(!r)throw h(n);var i=this._createSvgElementForSingleIcon(r);return this._addSvgIconConfig(t,e,new y(i))},t.prototype.addSvgIconSet=function(t){return this.addSvgIconSetInNamespace("",t)},t.prototype.addSvgIconSetLiteral=function(t){return this.addSvgIconSetLiteralInNamespace("",t)},t.prototype.addSvgIconSetInNamespace=function(t,e){return this._addSvgIconSetConfig(t,new y(e))},t.prototype.addSvgIconSetLiteralInNamespace=function(t,e){var n=this._sanitizer.sanitize(o.SecurityContext.HTML,e);if(!n)throw h(e);var r=this._svgElementFromString(n);return this._addSvgIconSetConfig(t,new y(r))},t.prototype.registerFontClassAlias=function(t,e){return void 0===e&&(e=t),this._fontCssClassesByAlias.set(t,e),this},t.prototype.classNameForFontAlias=function(t){return this._fontCssClassesByAlias.get(t)||t},t.prototype.setDefaultFontSetClass=function(t){return this._defaultFontSetClass=t,this},t.prototype.getDefaultFontSetClass=function(){return this._defaultFontSetClass},t.prototype.getSvgIconFromUrl=function(t){var e=this,n=this._sanitizer.sanitize(o.SecurityContext.RESOURCE_URL,t);if(!n)throw f(t);var r=this._cachedIconsByUrl.get(n);return r?i.of(m(r)):this._loadSvgIconFromConfig(new y(t)).pipe(s.tap(function(t){return e._cachedIconsByUrl.set(n,t)}),s.map(function(t){return m(t)}))},t.prototype.getNamedSvgIcon=function(t,e){void 0===e&&(e="");var n=d(e,t),o=this._svgIconConfigs.get(n);if(o)return this._getSvgFromConfig(o);var r=this._iconSetConfigs.get(e);return r?this._getSvgFromIconSetConfigs(t,r):i.throwError(u(n))},t.prototype.ngOnDestroy=function(){this._svgIconConfigs.clear(),this._iconSetConfigs.clear(),this._cachedIconsByUrl.clear()},t.prototype._getSvgFromConfig=function(t){return t.svgElement?i.of(m(t.svgElement)):this._loadSvgIconFromConfig(t).pipe(s.tap(function(e){return t.svgElement=e}),s.map(function(t){return m(t)}))},t.prototype._getSvgFromIconSetConfigs=function(t,e){var n=this,r=this._extractIconWithNameFromAnySet(t,e);if(r)return i.of(r);var a=e.filter(function(t){return!t.svgElement}).map(function(t){return n._loadSvgIconSetFromConfig(t).pipe(s.catchError(function(e){var r=n._sanitizer.sanitize(o.SecurityContext.RESOURCE_URL,t.url);return console.error("Loading icon set URL: "+r+" failed: "+e.message),i.of(null)}))});return i.forkJoin(a).pipe(s.map(function(){var o=n._extractIconWithNameFromAnySet(t,e);if(!o)throw u(t);return o}))},t.prototype._extractIconWithNameFromAnySet=function(t,e){for(var n=e.length-1;n>=0;n--){var o=e[n];if(o.svgElement){var r=this._extractSvgIconFromSet(o.svgElement,t);if(r)return r}}return null},t.prototype._loadSvgIconFromConfig=function(t){var e=this;return this._fetchUrl(t.url).pipe(s.map(function(t){return e._createSvgElementForSingleIcon(t)}))},t.prototype._loadSvgIconSetFromConfig=function(t){var e=this;return t.svgElement?i.of(t.svgElement):this._fetchUrl(t.url).pipe(s.map(function(n){return t.svgElement||(t.svgElement=e._svgElementFromString(n)),t.svgElement}))},t.prototype._createSvgElementForSingleIcon=function(t){var e=this._svgElementFromString(t);return this._setSvgAttributes(e),e},t.prototype._extractSvgIconFromSet=function(t,e){var n=t.querySelector('[id="'+e+'"]');if(!n)return null;var o=n.cloneNode(!0);if(o.removeAttribute("id"),"svg"===o.nodeName.toLowerCase())return this._setSvgAttributes(o);if("symbol"===o.nodeName.toLowerCase())return this._setSvgAttributes(this._toSvgElement(o));var r=this._svgElementFromString("");return r.appendChild(o),this._setSvgAttributes(r)},t.prototype._svgElementFromString=function(t){var e=this._document.createElement("DIV");e.innerHTML=t;var n=e.querySelector("svg");if(!n)throw Error("