const ABC = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' . split ( '' ) ; /**
 * CSS Cache.
 */ export default class ShadowRootCSSCache { private original : string [ ] = [ ] ; private scoped : string [ ] = [ ] ; returns public getAllScoped ( ) { return this . scoped . concat ( ) ; } param original returns public getScoped ( original ) { const index = this . original . indexOf ( original ) ; if ( index !== - 1 ) { return this . scoped [ index ] ; } return null ; } param original param scopedCSS public setScoped ( original , scopedCSS ) { const index = this . original . indexOf ( original ) ; if ( index !== - 1 ) { this . original [ index ] = original ; this . scoped [ index ] = scopedCSS ; } else { this . original . push ( original ) ; this . scoped . push ( scopedCSS ) ; } } param original public removeScoped ( original ) { const index = this . original . indexOf ( original ) ; if ( index !== - 1 ) { this . original . splice ( index , 1 ) ; this . scoped . splice ( index , 1 ) ; } } param original returns public getScopeID ( original ) { const index = this . original . indexOf ( original ) ; if ( index !== - 1 ) { return this . getIdByIndex ( index ) ; } return this . getIdByIndex ( this . original . length ) ; } /**
     * Clears cache.
     */ public clear ( ) { this . original = [ ] ; this . scoped = [ ] ; } param index returns private getIdByIndex ( index ) { return ABC [ index ] !== undefined ? ABC [ index ] : 'a' + index ; } }