import { DOCUMENT } from '@angular/common'; import { Inject, Injectable, Renderer2, RendererFactory2 } from '@angular/core'; import { Observable, Observer } from 'rxjs'; import { shareReplay } from 'rxjs/operators'; import { Attribute } from 'ish-core/models/attribute/attribute.model'; /** * Represents a script that has been loaded or is being loaded. */ export interface ScriptType { /** The source URL of the script */ src: string; /** Indicates whether the script has successfully been loaded */ loaded: boolean; } /** * Configuration options for loading a script element. */ interface ScriptLoaderOption { /** Type if it is not a classic Javascript file, e.g. 'module' */ type?: string; /** Integrity hash and crossOrigin to 'anonymous' (parameter 'crossorigin' ignored in that case) */ integrity?: string; /** Value for crossOrigin attribute in script tag */ crossorigin?: string; /** Script html element (data) attributes, e.g.