public openTab(id?:string):QuickSidebarTabs {
            id = defined(id) ? util.str.lstrip(id, '#') : this.getFirst();
            var $tab:JQuery = this.getTabNav(id);
            var $tabContent:JQuery = this.getTabContent(id);

            // making sure we're not opening something already
            if (this.switching) {
                if (this.switchingTimeout = false) {
                    setTimeout(() => {
                        this.openTab(id);
                        this.switching = false
                    }, this.qs.config('quick_sidebar.transitionTime'));
                    this.switchingTimeout = true;
                }
                return;
            }

            this.closeTabs();
            $tab.ensureClass('active', true);
            $tabContent.ensureClass('active', true);
            this.$wrapper.jcarousel('scroll', $tab);
            if(id !== this.active) {
                this.previous = this.active;
                this.active = id;
            }

            this.switching = true;
            setTimeout(() => {
                this.initContentScroll($tabContent);
                this.switching = false;
            }, this.qs.config('quick_sidebar.transitionTime'));

            return this;
        }


public openPreviousTab():QuickSidebarTabs {
            this.openTab(this.getPrevious());
            return this;
        }


public openNextTab():QuickSidebarTabs {
            this.openTab(this.getNext());
            return this;
        }


public getActive():string {
            return this.active;
        }


public getPrevious():string {
            var previous:string = this.getTabContent(this.getActive()).parent().prev('.qs-content:not(.active)').attr('id');

            if(!previous && this.hasTab(this.previous)) {
                previous = this.previous;
            } else if(!previous) {
                previous = this.getLast();
            }

            return previous;
        }


public getNext():string {
            var next = this.getTabContent(this.getActive()).parent().next('.qs-content:not(.active)').attr('id');

            if(!this.hasTab(next)){
                next = this.getFirst();
            }
            return next;
        }


public getFirst():string {
            return this.find('.qs-content').first().attr('id');
        }


public getLast():string {
            return this.find('.qs-content').last().attr('id');
        }


public hasTab(id:string):boolean {
            return this.find('.qs-content#' + id).length > 0;
        }


public getTabNav(id:string):JQuery {
            return this.find('.qs-tabs .qs-tab[data-target="#' + id + '"]').first();
        }


public getTabContent(id:string):JQuery {
            return this.find('.qs-content#' + id).first();
        }


public init() {
            this.app.debug.log('QuickSidebarComponent init');
            this.app.on('booted', () => {
                debug.log('QuickSidebarComponent received event emitted from app: booted');
            });
        }


public boot() {
            debug.log('QuickSidebarComponent boot');
            if (!this.exists()) {
                debug.log('QuickSidebarComponent does not exist');
                return;
            }

            // init header button tooltips
            var ttOpts:any = _.merge(this.config('vendor.bootstrap.tooltip'), {
                placement: 'left',
                offset: '30px -40px',
                trigger: 'hover focus',
                selector: false
            });

            if (!isTouchDevice()) {
                this.$e.find('.qs-header .btn[data-quick-sidebar]').tooltip(ttOpts);
            }

            this.tabs = new QuickSidebarTabs(this);
            this._initBindings();
            this._initResizeHandler();
            this._initLayoutApiActions();

            if (!this.isClosed()) {
                this.openNextTab();
            }
        }


public find(find:any):JQuery {
            return this.$e.find(find);
        }


protected _initLayoutApiActions() {
            var self:QuickSidebarExtension = this;
            var apiActions:any = {
                'qs-toggle': (target?:string) => {
                    (self.isClosed() && self.show().openTab(target)) || self.hide();
                },
                'qs-show': () => {
                    self.show().openTab();
                },
                'qs-hide': () => {
                    self.hide();
                },
                'qs-open': (target?:string) => {
                    self.openTab(target);
                },
                'qs-close': () => {
                    self.hide();
                },
                'qs-togglepin': () => {
                    !self.isPinned() && self.pin() || self.unpin();
                },
                'qs-pin': () => {
                    self.pin();
                },
                'qs-unpin': () => {
                    self.unpin();
                },
                'qs-next': () => {
                    self.openNextTab();
                },
                'qs-prev': () => {
                    self.openPreviousTab();
                }
            };

            self.layout.setApiActions(apiActions);
        }


/**
         * Initialises event bindings
         * @private
         */
protected _initBindings() {
            var self:QuickSidebarExtension = this;

            // Blur the pressed header buttons automaticly
            $body.onClick('.quick-sidebar .qs-header button', function (e) {
                var $this = $(this);
                $this.blur();
            });

            $(document).onClick('.qs-shown', function (e) {
                if ($(e.target).closest('.quick-sidebar').length > 0) {
                    return;
                }
                if (self.isPinned()) {
                    return;
                }
                self.hide();
            });

            // check if mouse is over any .qs-content. detection is required to fix openTarget timeout that creates the slimScroll
            $body.on('mouseenter', '.quick-sidebar .qs-content', (e) => {
                this.mouseOverContent = true;
            }).on('mouseleave', '.quick-sidebar .qs-content', (e) => {
                this.mouseOverContent = false;
            })
        }


protected _initResizeHandler() {
            var self:QuickSidebarExtension = this;
            var resizeHandler = function () {
                if(self.isClosed()){
                    return;
                }
                self.refresh();
            };

            this.app
                .on('resize', resizeHandler)
                .on('layout:footer:fixed', resizeHandler)
                .on('layout:header:fixed', resizeHandler)
                .on('layout:page:fixed', resizeHandler)
                .on('layout:page:boxed', resizeHandler);
        }


public refresh():QuickSidebarExtension {
            if (this.isClosed()) {
                return;
            }
            this.tabs.refresh();
            this._emit('refresh');
            return this;
        }


protected _emit(name:string, ...args:any[]){
            this.app.emit('qs:' + name, [this].concat(args));
        }


public show():QuickSidebarExtension {
            if (!this.exists()) {
                return this;
            }
            $('body').ensureClass("qs-shown", true);
            this._emit('show');
            return this;
        }


public hide():QuickSidebarExtension {
            if (!this.exists()) {
                return;
            }
            if (this.isPinned()) {
                this.unpin();
            }
            $body.ensureClass("qs-shown", false);
            this._emit('hide');
            return this;
        }


public isClosed():boolean {
            return !$body.hasClass("qs-shown");
        }


public openTab(id?:string):QuickSidebarExtension {
            this.tabs.openTab(id);
            this._emit('open');
            return this;
        }


public openNextTab():QuickSidebarExtension {
            this.tabs.openNextTab();
            this._emit('next');
            return this;
        }


public openPreviousTab():QuickSidebarExtension {
            this.tabs.openPreviousTab();
            this._emit('prev');
            return this;
        }


/**
         * Pin the QS so it will not close when clicking elsewhere
         */
public pin():QuickSidebarExtension {
            $body.ensureClass('qs-pinned', true);
            this._emit('pin');
            return this;
        }


public unpin():QuickSidebarExtension {
            $body.removeClass('qs-pinned');
            this._emit('unpin');
            return this;
        }


public isPinned():boolean {
            return $body.hasClass('qs-pinned');

        }


/**
         * Checks if the quick sidebar is present in the DOM
         */
public exists():boolean {
            return this.$e.length > 0;
        }


(): void => {
    this.props.onChange({
      value: !this.props.variable.value,
      type: this.props.variable.type,
      name: this.props.variable.name,
    });
  }


class BooleanInput extends React.Component<IVariableProps, IVariableState> {
  public render() {
    return (
      <div>
        <input type="checkbox" checked={this.props.variable.value || false} onChange={this.extractValue} />
        {!this.props.variable.hideErrors && <VariableError errors={this.props.variable.errors} />}
      </div>
    );
  }

  private extractValue = (): void => {
    this.props.onChange({
      value: !this.props.variable.value,
      type: this.props.variable.type,
      name: this.props.variable.name,
    });
  };
}


export class BooleanInputBuilder implements IVariableInputBuilder {
  public handles(type: string): boolean {
    return type === 'boolean';
  }

  public getInput(variable: IVariable, onChange: (variable: IVariable) => void) {
    return <BooleanInput variable={variable} onChange={onChange} />;
  }
}


public render() {
    return (
      <div>
        <input type="checkbox" checked={this.props.variable.value || false} onChange={this.extractValue} />
        {!this.props.variable.hideErrors && <VariableError errors={this.props.variable.errors} />}
      </div>
    );
  }


public handles(type: string): boolean {
    return type === 'boolean';
  }


public getInput(variable: IVariable, onChange: (variable: IVariable) => void) {
    return <BooleanInput variable={variable} onChange={onChange} />;
  }


/**
Wait for any promise to be fulfilled.

@param input - An `Iterable` collection of promises/values to wait for.
@returns A [cancelable `Promise`](https://github.com/sindresorhus/p-cancelable) that is fulfilled when any promise from `input` is fulfilled. If all the input promises reject, it will reject with an [`AggregateError`](https://github.com/sindresorhus/aggregate-error) error.

@example
```
import pAny from 'p-any';
import got from 'got';

const first = await pAny([
	got.head('https://github.com').then(() => 'github'),
	got.head('https://google.com').then(() => 'google'),
	got.head('https://twitter.com').then(() => 'twitter'),
]);

console.log(first);
//=> 'google'
```
 */
export default function pAny<ValueType>(
	input: Iterable<Value<ValueType>>,
	options?: Options<ValueType>
): CancelablePromise<ValueType>;


export type Value<ValueType> = ValueType | PromiseLike<ValueType>;


export type Options<ValueType> = Omit<PSomeOptions<ValueType>, 'count'>;


export type CancelablePromise<ValueType> = PCancelable<ValueType>;


() => (Math.random() * 16) | 0


@Controller()
export class UploadController {
  @Post('upload')
  @UseInterceptors(
    FileInterceptor('image', {
      storage: diskStorage({
        destination: './uploads',
        filename(_, file, cb) {
          const randomName = Array(16)
            .fill(null)
            .map(() => (Math.random() * 16) | 0)
            .join('');
          return cb(null, `${randomName}${extname(file.originalname)}`);
        },
      }),
    }),
  )
  uploadFile(@UploadedFile() file) {
    return {
      url: `http://localhost:8000/api/${file.path}`,
    };
  }

  @Get('uploads/:path')
  async getImage(@Param('path') path, @Res() res: Response) {
    return res.sendFile(path, { root: 'uploads' });
  }
}


@Post('upload')
  @UseInterceptors(
    FileInterceptor('image', {
      storage: diskStorage({
        destination: './uploads',
        filename(_, file, cb) {
          const randomName = Array(16)
            .fill(null)
            .map(() => (Math.random() * 16) | 0)
            .join('');
          return cb(null, `${randomName}${extname(file.originalname)}`);
        },
      }),
    }),
  )
  uploadFile(@UploadedFile() file) {
    return {
      url: `http://localhost:8000/api/${file.path}`,
    };
  }


filename(_, file, cb) {
          const randomName = Array(16)
            .fill(null)
            .map(() => (Math.random() * 16) | 0)
            .join('');
          return cb(null, `${randomName}${extname(file.originalname)}`);
        }


@Get('uploads/:path')
  async getImage(@Param('path') path, @Res() res: Response) {
    return res.sendFile(path, { root: 'uploads' });
  }


(state) => ({
      ...state,
      loaded: false,
      loading: true,
      error: false,
      error_message: '',
    })


(
      _,
      { payload }: Action<SlackMessage[]>
    ) => ({
      messages: [...payload],
      loaded: true,
      loading: false,
      error: false,
      error_message: '',
    })


(
      state,
      { payload }: Action<SlackMessage[]>
    ) => ({
      ...state,
      ...payload,
      messages: [],
      loaded: false,
      loading: false,
    })


(resolve, reject) => {
      const aulaDupla = dados['aula_dupla'];
      const registroDiario = new RegistroDiario();
      registroDiario.dip_id = dados['dip_id']
      registroDiario.data_registro = new Date(dados['data'] + ' 00:00:00');
      registroDiario.data_gravacao = new Date();
      registroDiario.registro_conteudo = dados['conteudo'];
      let contaInseridos = 0;
      this.registroDiarioRepository.save(registroDiario).then((novoRegistroDiario: RegistroDiario) => {
        const rdi_id = novoRegistroDiario.id;
        const quantidade = aulaDupla == true ? 2 : 1;
        const arrayRegistroFrequencia = new Array<RegistroFrequencia>()
        for (let i = 0; i < quantidade; i++) {
          const dadosFrequenciaEstudantes = <any[]>dados['arrayOfDadosFrequenciaEstudantes'];
          dadosFrequenciaEstudantes.forEach(dadoFrequenciaEstudante => {
            const valorFrequenciaRegistrada = dadoFrequenciaEstudante['frequenciaRegistrada'];
            const estId = dadoFrequenciaEstudante['est_id'];
            const registroFrequencia = new RegistroFrequencia();
            registroFrequencia.rdi_id = rdi_id;
            registroFrequencia.presente = valorFrequenciaRegistrada;
            registroFrequencia.data_hora = registroDiario.data_registro;
            registroFrequencia.status_push = 0;
            registroFrequencia.est_id = estId;
            arrayRegistroFrequencia.push(registroFrequencia);
          });
        }
        this.registroFrequenciaRepository.save(arrayRegistroFrequencia).then((novosRegistrosFrequencia: RegistroFrequencia[]) => {
          resolve();
        }).catch(reason => {
          reject(reason);
        })
      }).catch(reason => {
        reject(reason);
      })
    }


(novoRegistroDiario: RegistroDiario) => {
        const rdi_id = novoRegistroDiario.id;
        const quantidade = aulaDupla == true ? 2 : 1;
        const arrayRegistroFrequencia = new Array<RegistroFrequencia>()
        for (let i = 0; i < quantidade; i++) {
          const dadosFrequenciaEstudantes = <any[]>dados['arrayOfDadosFrequenciaEstudantes'];
          dadosFrequenciaEstudantes.forEach(dadoFrequenciaEstudante => {
            const valorFrequenciaRegistrada = dadoFrequenciaEstudante['frequenciaRegistrada'];
            const estId = dadoFrequenciaEstudante['est_id'];
            const registroFrequencia = new RegistroFrequencia();
            registroFrequencia.rdi_id = rdi_id;
            registroFrequencia.presente = valorFrequenciaRegistrada;
            registroFrequencia.data_hora = registroDiario.data_registro;
            registroFrequencia.status_push = 0;
            registroFrequencia.est_id = estId;
            arrayRegistroFrequencia.push(registroFrequencia);
          });
        }
        this.registroFrequenciaRepository.save(arrayRegistroFrequencia).then((novosRegistrosFrequencia: RegistroFrequencia[]) => {
          resolve();
        }).catch(reason => {
          reject(reason);
        })
      }


dadoFrequenciaEstudante => {
            const valorFrequenciaRegistrada = dadoFrequenciaEstudante['frequenciaRegistrada'];
            const estId = dadoFrequenciaEstudante['est_id'];
            const registroFrequencia = new RegistroFrequencia();
            registroFrequencia.rdi_id = rdi_id;
            registroFrequencia.presente = valorFrequenciaRegistrada;
            registroFrequencia.data_hora = registroDiario.data_registro;
            registroFrequencia.status_push = 0;
            registroFrequencia.est_id = estId;
            arrayRegistroFrequencia.push(registroFrequencia);
          }


(novosRegistrosFrequencia: RegistroFrequencia[]) => {
          resolve();
        }


reason => {
          reject(reason);
        }


reason => {
        reject(reason);
      }


(resolve, reject) => {
      const campos = [
        'rdi_id_int as rdi_id', 'dip_id_int as dip_id',
        'rdi_registro_conteudo_txt as conteudo', 'date(rdi_data_registro_dte) as data_registro',
        'date(rdi_data_gravacao_dte) as data_gravacao'
      ];
      this.registroDiarioRepository.createQueryBuilder('rdi').select(campos)
        .where('dip_id_int = :dip_id', { dip_id: dip_id })
        .orderBy('rdi_data_registro_dte', 'DESC')
        .execute()
        .then(registrosDiadios => {
          resolve(registrosDiadios)
        }).catch(reason => {
          reject(reason)
        });
    }


registrosDiadios => {
          resolve(registrosDiadios)
        }


reason => {
          reject(reason)
        }


(resolve, reject) => {
      const registroDiario = new RegistroDiario();
      registroDiario.id = dados['rdi_id']
      registroDiario.registro_conteudo = dados['conteudo'];
      registroDiario.data_registro = new Date(dados['data_registro'] + ' 00:00:00');
      this.registroDiarioRepository.save(registroDiario).then(updateResult => {
        resolve();
      }).catch(reason => {
        reject(reason)
      })
    }


updateResult => {
        resolve();
      }


reason => {
        reject(reason)
      }


@Injectable()
export class RegistroDiarioService {
  constructor(
    @InjectRepository(RegistroDiarioRepository) private registroDiarioRepository: RegistroDiarioRepository,
    @InjectRepository(RegistroFrequenciaRepository) private registroFrequenciaRepository: RegistroFrequenciaRepository,
  ) { }

  public inserir(dados: any[]): Promise<void> {
    return new Promise((resolve, reject) => {
      const aulaDupla = dados['aula_dupla'];
      const registroDiario = new RegistroDiario();
      registroDiario.dip_id = dados['dip_id']
      registroDiario.data_registro = new Date(dados['data'] + ' 00:00:00');
      registroDiario.data_gravacao = new Date();
      registroDiario.registro_conteudo = dados['conteudo'];
      let contaInseridos = 0;
      this.registroDiarioRepository.save(registroDiario).then((novoRegistroDiario: RegistroDiario) => {
        const rdi_id = novoRegistroDiario.id;
        const quantidade = aulaDupla == true ? 2 : 1;
        const arrayRegistroFrequencia = new Array<RegistroFrequencia>()
        for (let i = 0; i < quantidade; i++) {
          const dadosFrequenciaEstudantes = <any[]>dados['arrayOfDadosFrequenciaEstudantes'];
          dadosFrequenciaEstudantes.forEach(dadoFrequenciaEstudante => {
            const valorFrequenciaRegistrada = dadoFrequenciaEstudante['frequenciaRegistrada'];
            const estId = dadoFrequenciaEstudante['est_id'];
            const registroFrequencia = new RegistroFrequencia();
            registroFrequencia.rdi_id = rdi_id;
            registroFrequencia.presente = valorFrequenciaRegistrada;
            registroFrequencia.data_hora = registroDiario.data_registro;
            registroFrequencia.status_push = 0;
            registroFrequencia.est_id = estId;
            arrayRegistroFrequencia.push(registroFrequencia);
          });
        }
        this.registroFrequenciaRepository.save(arrayRegistroFrequencia).then((novosRegistrosFrequencia: RegistroFrequencia[]) => {
          resolve();
        }).catch(reason => {
          reject(reason);
        })
      }).catch(reason => {
        reject(reason);
      })
    })
  }

  public listar(dip_id: number): Promise<any[]> {
    return new Promise((resolve, reject) => {
      const campos = [
        'rdi_id_int as rdi_id', 'dip_id_int as dip_id',
        'rdi_registro_conteudo_txt as conteudo', 'date(rdi_data_registro_dte) as data_registro',
        'date(rdi_data_gravacao_dte) as data_gravacao'
      ];
      this.registroDiarioRepository.createQueryBuilder('rdi').select(campos)
        .where('dip_id_int = :dip_id', { dip_id: dip_id })
        .orderBy('rdi_data_registro_dte', 'DESC')
        .execute()
        .then(registrosDiadios => {
          resolve(registrosDiadios)
        }).catch(reason => {
          reject(reason)
        });
    })
  }

  public alterar(dados: any): Promise<void> {
    return new Promise((resolve, reject) => {
      const registroDiario = new RegistroDiario();
      registroDiario.id = dados['rdi_id']
      registroDiario.registro_conteudo = dados['conteudo'];
      registroDiario.data_registro = new Date(dados['data_registro'] + ' 00:00:00');
      this.registroDiarioRepository.save(registroDiario).then(updateResult => {
        resolve();
      }).catch(reason => {
        reject(reason)
      })
    })
  }
}


public inserir(dados: any[]): Promise<void> {
    return new Promise((resolve, reject) => {
      const aulaDupla = dados['aula_dupla'];
      const registroDiario = new RegistroDiario();
      registroDiario.dip_id = dados['dip_id']
      registroDiario.data_registro = new Date(dados['data'] + ' 00:00:00');
      registroDiario.data_gravacao = new Date();
      registroDiario.registro_conteudo = dados['conteudo'];
      let contaInseridos = 0;
      this.registroDiarioRepository.save(registroDiario).then((novoRegistroDiario: RegistroDiario) => {
        const rdi_id = novoRegistroDiario.id;
        const quantidade = aulaDupla == true ? 2 : 1;
        const arrayRegistroFrequencia = new Array<RegistroFrequencia>()
        for (let i = 0; i < quantidade; i++) {
          const dadosFrequenciaEstudantes = <any[]>dados['arrayOfDadosFrequenciaEstudantes'];
          dadosFrequenciaEstudantes.forEach(dadoFrequenciaEstudante => {
            const valorFrequenciaRegistrada = dadoFrequenciaEstudante['frequenciaRegistrada'];
            const estId = dadoFrequenciaEstudante['est_id'];
            const registroFrequencia = new RegistroFrequencia();
            registroFrequencia.rdi_id = rdi_id;
            registroFrequencia.presente = valorFrequenciaRegistrada;
            registroFrequencia.data_hora = registroDiario.data_registro;
            registroFrequencia.status_push = 0;
            registroFrequencia.est_id = estId;
            arrayRegistroFrequencia.push(registroFrequencia);
          });
        }
        this.registroFrequenciaRepository.save(arrayRegistroFrequencia).then((novosRegistrosFrequencia: RegistroFrequencia[]) => {
          resolve();
        }).catch(reason => {
          reject(reason);
        })
      }).catch(reason => {
        reject(reason);
      })
    })
  }


public listar(dip_id: number): Promise<any[]> {
    return new Promise((resolve, reject) => {
      const campos = [
        'rdi_id_int as rdi_id', 'dip_id_int as dip_id',
        'rdi_registro_conteudo_txt as conteudo', 'date(rdi_data_registro_dte) as data_registro',
        'date(rdi_data_gravacao_dte) as data_gravacao'
      ];
      this.registroDiarioRepository.createQueryBuilder('rdi').select(campos)
        .where('dip_id_int = :dip_id', { dip_id: dip_id })
        .orderBy('rdi_data_registro_dte', 'DESC')
        .execute()
        .then(registrosDiadios => {
          resolve(registrosDiadios)
        }).catch(reason => {
          reject(reason)
        });
    })
  }


public alterar(dados: any): Promise<void> {
    return new Promise((resolve, reject) => {
      const registroDiario = new RegistroDiario();
      registroDiario.id = dados['rdi_id']
      registroDiario.registro_conteudo = dados['conteudo'];
      registroDiario.data_registro = new Date(dados['data_registro'] + ' 00:00:00');
      this.registroDiarioRepository.save(registroDiario).then(updateResult => {
        resolve();
      }).catch(reason => {
        reject(reason)
      })
    })
  }


export function browsePackages() {
	let workDir = '';
	let selectedText = '';
	const editor = vscode.window.activeTextEditor;
	if (editor) {
		const currentUri = editor.document.uri;
		workDir = path.dirname(currentUri.fsPath);
		const selection = editor.selection;
		if (!selection.isEmpty) {
			// get selected text
			selectedText = editor.document.getText(selection);
		} else {
			// if selection is empty, then get the whole line the cursor is currently on.
			selectedText = editor.document.lineAt(selection.active.line).text;
		}
		selectedText = getImportPath(selectedText) || selectedText.trim();
	} else if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length === 1) {
		const currentUri = vscode.workspace.workspaceFolders[0].uri;
		workDir = currentUri.fsPath;
	}

	showPackageFiles(selectedText, true, workDir);
}


function showPackageFiles(pkg: string, showAllPkgsIfPkgNotFound: boolean, workDir: string) {
	const goRuntimePath = getBinPath('go');
	if (!goRuntimePath) {
		return vscode.window.showErrorMessage(
			`Failed to run "go list" to fetch packages as the "go" binary cannot be found in either GOROOT(${getCurrentGoRoot()}) or PATH(${envPath})`
		);
	}

	if (!pkg && showAllPkgsIfPkgNotFound) {
		return showPackageList(workDir);
	}

	const options: { [key: string]: any } = {
		env: Object.assign({}, process.env, { GOPATH: getCurrentGoPath() })
	};

	if (workDir) {
		options['cwd'] = workDir;
	}

	cp.execFile(
		goRuntimePath,
		['list', '-f', '{{.Dir}}:{{.GoFiles}}:{{.TestGoFiles}}:{{.XTestGoFiles}}', pkg],
		options,
		(err, stdout, stderr) => {
			if (!stdout || stdout.indexOf(':') === -1) {
				if (showAllPkgsIfPkgNotFound) {
					return showPackageList(workDir);
				}

				return;
			}

			const matches = stdout && stdout.match(/(.*):\[(.*)\]:\[(.*)\]:\[(.*)\]/);
			if (matches) {
				const dir = matches[1];
				let files = matches[2] ? matches[2].split(' ') : [];
				const testfiles = matches[3] ? matches[3].split(' ') : [];
				const xtestfiles = matches[4] ? matches[4].split(' ') : [];
				files = files.concat(testfiles);
				files = files.concat(xtestfiles);
				vscode.window.showQuickPick(files, { placeHolder: `Below are Go files from ${pkg}` }).then((file) => {
					// if user abandoned list, file will be null and path.join will error out.
					// therefore return.
					if (!file) {
						return;
					}

					vscode.workspace.openTextDocument(path.join(dir, file)).then((document) => {
						vscode.window.showTextDocument(document);
					});
				});
			}
		}
	);
}


function showPackageList(workDir: string) {
	return getAllPackages(workDir).then((pkgMap) => {
		const pkgs: string[] = Array.from(pkgMap.keys());
		if (pkgs.length === 0) {
			return vscode.window.showErrorMessage(
				'Could not find packages. Ensure `gopkgs -format {{.Name}};{{.ImportPath}}` runs successfully.'
			);
		}

		vscode.window
			.showQuickPick(pkgs.sort(), { placeHolder: 'Select a package to browse' })
			.then((pkgFromDropdown) => {
				if (!pkgFromDropdown) {
					return;
				}
				showPackageFiles(pkgFromDropdown, false, workDir);
			});
	});
}


(err, stdout, stderr) => {
			if (!stdout || stdout.indexOf(':') === -1) {
				if (showAllPkgsIfPkgNotFound) {
					return showPackageList(workDir);
				}

				return;
			}

			const matches = stdout && stdout.match(/(.*):\[(.*)\]:\[(.*)\]:\[(.*)\]/);
			if (matches) {
				const dir = matches[1];
				let files = matches[2] ? matches[2].split(' ') : [];
				const testfiles = matches[3] ? matches[3].split(' ') : [];
				const xtestfiles = matches[4] ? matches[4].split(' ') : [];
				files = files.concat(testfiles);
				files = files.concat(xtestfiles);
				vscode.window.showQuickPick(files, { placeHolder: `Below are Go files from ${pkg}` }).then((file) => {
					// if user abandoned list, file will be null and path.join will error out.
					// therefore return.
					if (!file) {
						return;
					}

					vscode.workspace.openTextDocument(path.join(dir, file)).then((document) => {
						vscode.window.showTextDocument(document);
					});
				});
			}
		}


(file) => {
					// if user abandoned list, file will be null and path.join will error out.
					// therefore return.
					if (!file) {
						return;
					}

					vscode.workspace.openTextDocument(path.join(dir, file)).then((document) => {
						vscode.window.showTextDocument(document);
					});
				}


(document) => {
						vscode.window.showTextDocument(document);
					}


(pkgMap) => {
		const pkgs: string[] = Array.from(pkgMap.keys());
		if (pkgs.length === 0) {
			return vscode.window.showErrorMessage(
				'Could not find packages. Ensure `gopkgs -format {{.Name}};{{.ImportPath}}` runs successfully.'
			);
		}

		vscode.window
			.showQuickPick(pkgs.sort(), { placeHolder: 'Select a package to browse' })
			.then((pkgFromDropdown) => {
				if (!pkgFromDropdown) {
					return;
				}
				showPackageFiles(pkgFromDropdown, false, workDir);
			});
	}


(pkgFromDropdown) => {
				if (!pkgFromDropdown) {
					return;
				}
				showPackageFiles(pkgFromDropdown, false, workDir);
			}


@NgModule({
  imports: [
    BrowserModule,
    HttpClientModule,
    AppRoutingModule,
    BrowserAnimationsModule,
    AgGridModule.withComponents([]),
    MatTabsModule,
  ],
  declarations: [
    AppComponent,
    MenuComponent,
    NetworksComponent,
    Table2Component,
    Table3Component,
    Table4Component,
    Table5Component,
  ],
  providers: [NetworksService],
  bootstrap: [AppComponent],
})
export class AppModule {}


() => (

    {features.map(({ text, icon: Icon }) => (

        {Icon && <Icon height={24} width={24} />}

{text}


({ text, icon: Icon }) => (
      <div className="feature"


() => OrderItem


() => table


@Table({ tableName: 'order', timestamps: true })
export class Order extends Model {
  @Column({ type: DataType.DECIMAL(6, 2) })
  price: number;

  @Column({ type: DataType.STRING })
  state: string;

  @Column({ type: DataType.INTEGER })
  userId: number;

  @Column({ type: DataType.INTEGER })
  tableId: number;

  @Column({ type: DataType.STRING })
  out_trade_no: string;

  @Column({ type: DataType.JSON })
  remark: any;

  @HasMany(() => OrderItem, 'orderId')
  Items: OrderItem[];

  @BelongsTo(() => User, 'userId')
  User: User;

  @BelongsTo(() => table, 'tableId')
  Table: table;

  @BeforeUpdate
  @BeforeCreate
  static beforeSaving(instance: Order, options: any) {
    LogHelper.beforeSave(instance, options);
  }

  @AfterUpdate
  @AfterCreate
  static async afterSaving(instance: Order, options: any) {
    await LogHelper.afterSave(instance, options);
  }

  @BeforeDestroy
  static beforeDeleting(instance: Order, options: any) {
    return LogHelper.beforeDestroy(instance, options);
  }

  @AfterDestroy
  static async afterDeleting(instance: Order, options: any) {
    await LogHelper.afterDestroy(instance, options);
  }

  getModalType(): typeof Order {
    return Order;
  }
}


@BeforeUpdate
  @BeforeCreate
  static beforeSaving(instance: Order, options: any) {
    LogHelper.beforeSave(instance, options);
  }


@AfterUpdate
  @AfterCreate
  static async afterSaving(instance: Order, options: any) {
    await LogHelper.afterSave(instance, options);
  }


@BeforeDestroy
  static beforeDeleting(instance: Order, options: any) {
    return LogHelper.beforeDestroy(instance, options);
  }


@AfterDestroy
  static async afterDeleting(instance: Order, options: any) {
    await LogHelper.afterDestroy(instance, options);
  }


getModalType(): typeof Order {
    return Order;
  }


/**
 * AWS Ground Station Mission Profile resource type for CloudFormation.
 */
export class MissionProfile extends pulumi.CustomResource {
    /**
     * Get an existing MissionProfile resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): MissionProfile {
        return new MissionProfile(name, undefined as any, { ...opts, id: id });
    }

    /** @internal */
    public static readonly __pulumiType = 'aws-native:groundstation:MissionProfile';

    /**
     * Returns true if the given object is an instance of MissionProfile.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    public static isInstance(obj: any): obj is MissionProfile {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === MissionProfile.__pulumiType;
    }

    public /*out*/ readonly arn!: pulumi.Output<string>;
    /**
     * Post-pass time needed after the contact.
     */
    public readonly contactPostPassDurationSeconds!: pulumi.Output<number | undefined>;
    /**
     * Pre-pass time needed before the contact.
     */
    public readonly contactPrePassDurationSeconds!: pulumi.Output<number | undefined>;
    public readonly dataflowEdges!: pulumi.Output<outputs.groundstation.MissionProfileDataflowEdge[]>;
    /**
     * Visibilities with shorter duration than the specified minimum viable contact duration will be ignored when searching for available contacts.
     */
    public readonly minimumViableContactDurationSeconds!: pulumi.Output<number>;
    /**
     * A name used to identify a mission profile.
     */
    public readonly name!: pulumi.Output<string>;
    public /*out*/ readonly region!: pulumi.Output<string>;
    public readonly tags!: pulumi.Output<outputs.groundstation.MissionProfileTag[] | undefined>;
    public readonly trackingConfigArn!: pulumi.Output<string>;

    /**
     * Create a MissionProfile resource with the given unique name, arguments, and options.
     *
     * @param name The _unique_ name of the resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param opts A bag of options that control this resource's behavior.
     */
    constructor(name: string, args: MissionProfileArgs, opts?: pulumi.CustomResourceOptions) {
        let inputs: pulumi.Inputs = {};
        opts = opts || {};
        if (!opts.id) {
            if ((!args || args.dataflowEdges === undefined) && !opts.urn) {
                throw new Error("Missing required property 'dataflowEdges'");
            }
            if ((!args || args.minimumViableContactDurationSeconds === undefined) && !opts.urn) {
                throw new Error("Missing required property 'minimumViableContactDurationSeconds'");
            }
            if ((!args || args.trackingConfigArn === undefined) && !opts.urn) {
                throw new Error("Missing required property 'trackingConfigArn'");
            }
            inputs["contactPostPassDurationSeconds"] = args ? args.contactPostPassDurationSeconds : undefined;
            inputs["contactPrePassDurationSeconds"] = args ? args.contactPrePassDurationSeconds : undefined;
            inputs["dataflowEdges"] = args ? args.dataflowEdges : undefined;
            inputs["minimumViableContactDurationSeconds"] = args ? args.minimumViableContactDurationSeconds : undefined;
            inputs["name"] = args ? args.name : undefined;
            inputs["tags"] = args ? args.tags : undefined;
            inputs["trackingConfigArn"] = args ? args.trackingConfigArn : undefined;
            inputs["arn"] = undefined /*out*/;
            inputs["region"] = undefined /*out*/;
        } else {
            inputs["arn"] = undefined /*out*/;
            inputs["contactPostPassDurationSeconds"] = undefined /*out*/;
            inputs["contactPrePassDurationSeconds"] = undefined /*out*/;
            inputs["dataflowEdges"] = undefined /*out*/;
            inputs["minimumViableContactDurationSeconds"] = undefined /*out*/;
            inputs["name"] = undefined /*out*/;
            inputs["region"] = undefined /*out*/;
            inputs["tags"] = undefined /*out*/;
            inputs["trackingConfigArn"] = undefined /*out*/;
        }
        if (!opts.version) {
            opts = pulumi.mergeOptions(opts, { version: utilities.getVersion()});
        }
        super(MissionProfile.__pulumiType, name, inputs, opts);
    }
}


/**
 * The set of arguments for constructing a MissionProfile resource.
 */
export interface MissionProfileArgs {
    /**
     * Post-pass time needed after the contact.
     */
    contactPostPassDurationSeconds?: pulumi.Input<number>;
    /**
     * Pre-pass time needed before the contact.
     */
    contactPrePassDurationSeconds?: pulumi.Input<number>;
    dataflowEdges: pulumi.Input<pulumi.Input<inputs.groundstation.MissionProfileDataflowEdgeArgs>[]>;
    /**
     * Visibilities with shorter duration than the specified minimum viable contact duration will be ignored when searching for available contacts.
     */
    minimumViableContactDurationSeconds: pulumi.Input<number>;
    /**
     * A name used to identify a mission profile.
     */
    name?: pulumi.Input<string>;
    tags?: pulumi.Input<pulumi.Input<inputs.groundstation.MissionProfileTagArgs>[]>;
    trackingConfigArn: pulumi.Input<string>;
}


/**
     * Get an existing MissionProfile resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
public static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): MissionProfile {
        return new MissionProfile(name, undefined as any, { ...opts, id: id });
    }


/**
     * Returns true if the given object is an instance of MissionProfile.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
public static isInstance(obj: any): obj is MissionProfile {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === MissionProfile.__pulumiType;
    }


/**
 *
AWS Amplify Admin API

 */
export class AmplifyBackendClient extends __Client<
  __HttpHandlerOptions,
  ServiceInputTypes,
  ServiceOutputTypes,
  AmplifyBackendClientResolvedConfig
> {
  /**
   * The resolved configuration of AmplifyBackendClient class. This is resolved and normalized from the {@link AmplifyBackendClientConfig | constructor configuration interface}.
   */
  readonly config: AmplifyBackendClientResolvedConfig;

  constructor(configuration: AmplifyBackendClientConfig) {
    let _config_0 = {
      ...__ClientDefaultValues,
      ...configuration,
    };
    let _config_1 = resolveRegionConfig(_config_0);
    let _config_2 = resolveEndpointsConfig(_config_1);
    let _config_3 = resolveRetryConfig(_config_2);
    let _config_4 = resolveHostHeaderConfig(_config_3);
    let _config_5 = resolveAwsAuthConfig(_config_4);
    let _config_6 = resolveUserAgentConfig(_config_5);
    super(_config_6);
    this.config = _config_6;
    this.middlewareStack.use(getRetryPlugin(this.config));
    this.middlewareStack.use(getContentLengthPlugin(this.config));
    this.middlewareStack.use(getHostHeaderPlugin(this.config));
    this.middlewareStack.use(getLoggerPlugin(this.config));
    this.middlewareStack.use(getAwsAuthPlugin(this.config));
    this.middlewareStack.use(getUserAgentPlugin(this.config));
  }

  /**
   * Destroy underlying resources, like sockets. It's usually not necessary to do this.
   * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
   * Otherwise, sockets might stay open for quite a long time before the server terminates them.
   */
  destroy(): void {
    super.destroy();
  }
}


export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
  /**
   * The HTTP handler to use. Fetch in browser and Https in Nodejs.
   */
  requestHandler?: __HttpHandler;

  /**
   * A constructor for a class implementing the @aws-sdk/types.Hash interface
   * that computes the SHA-256 HMAC or checksum of a string or binary buffer.
   * @internal
   */
  sha256?: __HashConstructor;

  /**
   * The function that will be used to convert strings into HTTP endpoints.
   * @internal
   */
  urlParser?: __UrlParser;

  /**
   * A function that can calculate the length of a request body.
   * @internal
   */
  bodyLengthChecker?: (body: any) => number | undefined;

  /**
   * A function that converts a stream into an array of bytes.
   * @internal
   */
  streamCollector?: __StreamCollector;

  /**
   * The function that will be used to convert a base64-encoded string to a byte array.
   * @internal
   */
  base64Decoder?: __Decoder;

  /**
   * The function that will be used to convert binary data to a base64-encoded string.
   * @internal
   */
  base64Encoder?: __Encoder;

  /**
   * The function that will be used to convert a UTF8-encoded string to a byte array.
   * @internal
   */
  utf8Decoder?: __Decoder;

  /**
   * The function that will be used to convert binary data to a UTF-8 encoded string.
   * @internal
   */
  utf8Encoder?: __Encoder;

  /**
   * The runtime environment.
   * @internal
   */
  runtime?: string;

  /**
   * Disable dyanamically changing the endpoint of the client based on the hostPrefix
   * trait of an operation.
   */
  disableHostPrefix?: boolean;

  /**
   * Unique service identifier.
   * @internal
   */
  serviceId?: string;

  /**
   * The AWS region to which this client will send requests
   */
  region?: string | __Provider<string>;

  /**
   * Value for how many times a request will be made at most in case of retry.
   */
  maxAttempts?: number | __Provider<number>;

  /**
   * Specifies provider for retry algorithm to use.
   * @internal
   */
  retryModeProvider?: __Provider<string>;

  /**
   * Optional logger for logging debug/info/warn/error.
   */
  logger?: __Logger;

  /**
   * Default credentials provider; Not available in browser runtime.
   * @internal
   */
  credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;

  /**
   * Fetch related hostname, signing name or signing region with given region.
   * @internal
   */
  regionInfoProvider?: RegionInfoProvider;

  /**
   * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
   * @internal
   */
  defaultUserAgentProvider?: Provider<__UserAgent>;
}


/**
 * The configuration interface of AmplifyBackendClient class constructor that set the region, credentials and other options.
 */
export interface AmplifyBackendClientConfig extends AmplifyBackendClientConfigType {}


/**
 * The resolved configuration interface of AmplifyBackendClient class. This is resolved and normalized from the {@link AmplifyBackendClientConfig | constructor configuration interface}.
 */
export interface AmplifyBackendClientResolvedConfig extends AmplifyBackendClientResolvedConfigType {}


export type ServiceInputTypes =
  | CloneBackendCommandInput
  | CreateBackendAPICommandInput
  | CreateBackendAuthCommandInput
  | CreateBackendCommandInput
  | CreateBackendConfigCommandInput
  | CreateTokenCommandInput
  | DeleteBackendAPICommandInput
  | DeleteBackendAuthCommandInput
  | DeleteBackendCommandInput
  | DeleteTokenCommandInput
  | GenerateBackendAPIModelsCommandInput
  | GetBackendAPICommandInput
  | GetBackendAPIModelsCommandInput
  | GetBackendAuthCommandInput
  | GetBackendCommandInput
  | GetBackendJobCommandInput
  | GetTokenCommandInput
  | ListBackendJobsCommandInput
  | RemoveAllBackendsCommandInput
  | RemoveBackendConfigCommandInput
  | UpdateBackendAPICommandInput
  | UpdateBackendAuthCommandInput
  | UpdateBackendConfigCommandInput
  | UpdateBackendJobCommandInput;


export type ServiceOutputTypes =
  | CloneBackendCommandOutput
  | CreateBackendAPICommandOutput
  | CreateBackendAuthCommandOutput
  | CreateBackendCommandOutput
  | CreateBackendConfigCommandOutput
  | CreateTokenCommandOutput
  | DeleteBackendAPICommandOutput
  | DeleteBackendAuthCommandOutput
  | DeleteBackendCommandOutput
  | DeleteTokenCommandOutput
  | GenerateBackendAPIModelsCommandOutput
  | GetBackendAPICommandOutput
  | GetBackendAPIModelsCommandOutput
  | GetBackendAuthCommandOutput
  | GetBackendCommandOutput
  | GetBackendJobCommandOutput
  | GetTokenCommandOutput
  | ListBackendJobsCommandOutput
  | RemoveAllBackendsCommandOutput
  | RemoveBackendConfigCommandOutput
  | UpdateBackendAPICommandOutput
  | UpdateBackendAuthCommandOutput
  | UpdateBackendConfigCommandOutput
  | UpdateBackendJobCommandOutput;


type AmplifyBackendClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> &
  ClientDefaults &
  RegionInputConfig &
  EndpointsInputConfig &
  RetryInputConfig &
  HostHeaderInputConfig &
  AwsAuthInputConfig &
  UserAgentInputConfig;


type AmplifyBackendClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> &
  Required<ClientDefaults> &
  RegionResolvedConfig &
  EndpointsResolvedConfig &
  RetryResolvedConfig &
  HostHeaderResolvedConfig &
  AwsAuthResolvedConfig &
  UserAgentResolvedConfig;


/**
   * Destroy underlying resources, like sockets. It's usually not necessary to do this.
   * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
   * Otherwise, sockets might stay open for quite a long time before the server terminates them.
   */
destroy(): void {
    super.destroy();
  }


@Component({
  selector: "app-maestro",
  templateUrl: "./form-maestro.component.html",
})
export class FormMaestroComponent {
  model: any;
}


(resolve, reject) => {
      try {

        const geoStylerStyle: Style = this.olStyleToGeoStylerStyle(olStyle);
        resolve(geoStylerStyle);

      } catch (error) {
        reject(error);
      }
    }


(resolve, reject) => {
      try {

        const olStyles = this.geoStylerStyleToOlStyle(geoStylerStyle);
        resolve(olStyles);

      } catch (error) {
        reject(error);
      }
    }


(rule: Rule) => {
      symbArr.push(this.getOlSymbolizerFromSymbolizer(rule.symbolizer));
    }


(feature: ol.Feature, res: number) => {

      const text = new ol.style.Text({
        font: OlStyleUtil.getTextFont(symbolizer),
        text: feature.get(symbolizer.field || '') + '',
        fill: new ol.style.Fill({
          color: (symbolizer.color && symbolizer.opacity) ?
            OlStyleUtil.getRgbaColor(symbolizer.color, symbolizer.opacity) : symbolizer.color
        }),
        stroke: new ol.style.Stroke({
          color: (symbolizer.color && symbolizer.opacity) ?
            OlStyleUtil.getRgbaColor(symbolizer.color, symbolizer.opacity) : symbolizer.color
        }),
        offsetX: symbolizer.offset ? symbolizer.offset[0] : 0,
        offsetY: symbolizer.offset ? symbolizer.offset[1] : 0,
        // TODO check why props match
        // textAlign: symbolizer.pitchAlignment,
        // textBaseline: symbolizer.anchor
      });

      const style = new ol.style.Style({
        text: text
      });

      return style;
    }


/**
   * Get the GeoStyler-Style PointSymbolizer from an OpenLayers Style object.
   *
   * @param {object} olStyle The OpenLayers Style object
   * @return {PointSymbolizer} The GeoStyler-Style PointSymbolizer
   */
getPointSymbolizerFromOlStyle(olStyle: ol.style.Style): PointSymbolizer {
    const olCircleStyle = olStyle.getImage() as ol.style.Circle;
    const olFillStyle = olCircleStyle.getFill();
    const olStrokeStyle = olCircleStyle.getStroke();

    return {
      kind: 'Circle',
      color: olFillStyle ? OlStyleUtil.getHexColor(olFillStyle.getColor() as string) : undefined,
      opacity: olFillStyle ? OlStyleUtil.getOpacity(olFillStyle.getColor() as string) : undefined,
      radius: isNumber(olCircleStyle.getRadius()) ? olCircleStyle.getRadius() : 5,
      strokeColor: olStrokeStyle ? olStrokeStyle.getColor() as string : undefined,
      strokeOpacity: olStrokeStyle ? OlStyleUtil.getOpacity(olStrokeStyle.getColor() as string) : undefined,
      strokeWidth: olStrokeStyle ? olStrokeStyle.getWidth() : undefined
    };
  }


/**
   * Get the GeoStyler-Style LineSymbolizer from an OpenLayers Style object.
   *
   * @param {object} olStyle The OpenLayers Style object
   * @return {LineSymbolizer} The GeoStyler-Style LineSymbolizer
   */
getLineSymbolizerFromOlStyle(olStyle: ol.style.Style): LineSymbolizer {
    const olStrokeStyle = olStyle.getStroke() as ol.style.Stroke;

    return {
      kind: 'Line',
      color: olStrokeStyle ? OlStyleUtil.getHexColor(olStrokeStyle.getColor() as string) as string : undefined,
      opacity: olStrokeStyle ? OlStyleUtil.getOpacity(olStrokeStyle.getColor() as string) : undefined,
      width: olStrokeStyle ? olStrokeStyle.getWidth() : undefined,
      dasharray: olStrokeStyle ? olStrokeStyle.getLineDash() : undefined
    };
  }


/**
   * Get the GeoStyler-Style FillSymbolizer from an OpenLayers Style object.
   *
   * PolygonSymbolizer Stroke is just partially supported.
   *
   * @param {ol.style.Style} olStyle The OpenLayers Style object
   * @return {FillSymbolizer} The GeoStyler-Style FillSymbolizer
   */
getFillSymbolizerFromOlStyle(olStyle: ol.style.Style): FillSymbolizer {
    const olFillStyle = olStyle.getFill() as ol.style.Fill;
    const olStrokeStyle = olStyle.getStroke() as ol.style.Stroke;

    return {
      kind: 'Fill',
      color: olFillStyle ? OlStyleUtil.getHexColor(olFillStyle.getColor() as string) : undefined,
      opacity: olFillStyle ? OlStyleUtil.getOpacity(olFillStyle.getColor() as string) : undefined,
      outlineColor: olStrokeStyle ? olStrokeStyle.getColor() as string : undefined
    };
  }


/**
   * Get the GeoStyler-Style Symbolizer from an OpenLayers Style object.
   *
   * Currently only one symbolizer per rule is supported.
   *
   * @param {ol.style.Style} olStyle The OpenLayers Style object
   * @return {Symbolizer} The GeoStyler-Style Symbolizer
   */
getSymbolizerFromOlStyle(olStyle: ol.style.Style): Symbolizer {
    let symbolizer: Symbolizer = <Symbolizer> {};
    const symbType = this.getStyleTypeFromOlStyle(olStyle);

    switch (symbType) {
      case 'Point':
        symbolizer = this.getPointSymbolizerFromOlStyle(olStyle);
        break;
      case 'Line':
        symbolizer = this.getLineSymbolizerFromOlStyle(olStyle);
        break;
      // case 'TextSymbolizer':
      //   symbolizer = this.getTextSymbolizerFromOlStyle(olStyle);
      //   break;
      case 'Fill':
        symbolizer = this.getFillSymbolizerFromOlStyle(olStyle);
        break;
      default:
        throw new Error('Failed to parse SymbolizerKind from OpenLayers Style');
    }

    return symbolizer;
  }


/**
   * Get the GeoStyler-Style Rule from an OpenLayers Style object.
   *
   * Currently only one symbolizer per rule is supported.
   *
   * @param {ol.style.Style} olStyle The OpenLayers Style object
   * @return {Rule} The GeoStyler-Style Rule
   */
getRulesFromOlStyle(olStyle: ol.style.Style): Rule[] {
    const symbolizer: Symbolizer = this.getSymbolizerFromOlStyle(olStyle);
    const name = 'OL Style Rule';
    let rule = {
      name,
      symbolizer
    };
    let rules: Rule[] = [rule];

    return rules;
  }


/**
   * Get the GeoStyler-Style Symbolizer from an OpenLayers Style object.
   *
   * @param {ol.style.Style} olStyle The OpenLayers Style object
   * @return {Symbolizer} The GeoStyler-Style Symbolizer
   */
getStyleTypeFromOlStyle(olStyle: ol.style.Style): StyleType {
    let styleType: StyleType;

    if (olStyle.getImage() instanceof ol.style.Image) {
      styleType = 'Point';
    } else if (olStyle.getFill() instanceof ol.style.Fill) {
      styleType = 'Fill';
    } else if (olStyle.getStroke() && !olStyle.getFill()) {
      styleType = 'Line';
    } else {
      throw new Error('StyleType could not be detected');
    }

    return styleType;
  }


/**
   * Get the GeoStyler-Style Style from an OpenLayers Style object.
   *
   * @param {object} olStyle The OpenLayers Style object
   * @return {Style} The GeoStyler-Style Style
   */
olStyleToGeoStylerStyle(olStyle: ol.style.Style): Style {
    const name = 'OL Style';
    const type = this.getStyleTypeFromOlStyle(olStyle);
    const rules = this.getRulesFromOlStyle(olStyle);
    return {
      name,
      type,
      rules
    };
  }


/**
   * The readStyle implementation of the GeoStyler-Style StyleParser interface.
   * It reads an OpenLayers style instance and returns a Promise.
   * The Promise itself resolves with a GeoStyler-Style Style.
   *
   * @param {string} olStyle An OpenLayers style instance
   * @return {Promise} The Promise resolving with the GeoStyler-Style Style
   */
readStyle(olStyle: ol.style.Style): Promise<Style> {
    return new Promise<Style>((resolve, reject) => {
      try {

        const geoStylerStyle: Style = this.olStyleToGeoStylerStyle(olStyle);
        resolve(geoStylerStyle);

      } catch (error) {
        reject(error);
      }
    });
  }


/**
   * The writeStyle implementation of the GeoStyler-Style StyleParser interface.
   * It reads a GeoStyler-Style Style and returns a Promise.
   * The Promise itself resolves with an OpenLayers style object.
   *
   * @param {Style} geoStylerStyle A GeoStyler-Style Style.
   * @return {Promise} The Promise resolving with an OpenLayers style instance.
   */
writeStyle(geoStylerStyle: Style): Promise<ol.style.Style[]> {
    return new Promise<any>((resolve, reject) => {
      try {

        const olStyles = this.geoStylerStyleToOlStyle(geoStylerStyle);
        resolve(olStyles);

      } catch (error) {
        reject(error);
      }
    });
  }


/**
   * Get the OpenLayers Style object from an GeoStyler-Style Style
   *
   * @param {Style} geoStylerStyle A GeoStyler-Style Style.
   * @return {ol.style.Style} An OpenLayers style instance
   */
geoStylerStyleToOlStyle(geoStylerStyle: Style): any {

    const rules = geoStylerStyle.rules;

    let symbArr: any[] = [];
    rules.forEach((rule: Rule) => {
      symbArr.push(this.getOlSymbolizerFromSymbolizer(rule.symbolizer));
    });

    return symbArr;
  }


/**
   * Get the OpenLayers Style object or an OL StyleFunction from an
   * GeoStyler-Style Symbolizer.
   *
   * @param {Symbolizer} symbolizer A GeoStyler-Style Symbolizer.
   * @return {object} The OpenLayers Style object or a StyleFunction
   */
getOlSymbolizerFromSymbolizer(symbolizer: Symbolizer): any {
    let olSymbolizer: ol.style.Style | ol.StyleFunction;
    switch (symbolizer.kind) {
      case 'Circle':
        olSymbolizer = this.getOlPointSymbolizerFromCircleSymbolizer(symbolizer);
        break;
      case 'Icon':
        olSymbolizer = this.getOlIconSymbolizerFromIconSymbolizer(symbolizer);
        break;
      case 'Text':
        olSymbolizer = this.getOlTextSymbolizerFromTextSymbolizer(symbolizer);
        break;
      case 'Line':
        olSymbolizer = this.getOlLineSymbolizerFromLineSymbolizer(symbolizer);
        break;
      case 'Fill':
        olSymbolizer = this.getOlPolygonSymbolizerFromFillSymbolizer(symbolizer);
        break;
      default:
        // Return the OL default style since the TS type binding does not allow
        // us to set olSymbolizer to undefined
        var fill = new ol.style.Fill({
          color: 'rgba(255,255,255,0.4)'
        });
        var stroke = new ol.style.Stroke({
          color: '#3399CC',
          width: 1.25
        });
        olSymbolizer = new ol.style.Style({
          image: new ol.style.Circle({
            fill: fill,
            stroke: stroke,
            radius: 5
          }),
          fill: fill,
          stroke: stroke
        });
        break;
    }
    return olSymbolizer;
  }


/**
   * Get the OL Style object  from an GeoStyler-Style CircleSymbolizer.
   *
   * @param {CircleSymbolizer} circleSymbolizer A GeoStyler-Style CircleSymbolizer.
   * @return {object} The OL Style object
   */
getOlPointSymbolizerFromCircleSymbolizer(symbolizer: CircleSymbolizer): ol.style.Style {
    let stroke;
    if (symbolizer.strokeColor) {
      stroke = new ol.style.Stroke({
        color: symbolizer.strokeColor,
        width: symbolizer.strokeWidth
      });
    }

    return new ol.style.Style({
      image: new ol.style.Circle({
        radius: symbolizer.radius || 5,
        fill: new ol.style.Fill({
          color: (symbolizer.color && symbolizer.opacity) ?
            OlStyleUtil.getRgbaColor(symbolizer.color, symbolizer.opacity) : symbolizer.color
        }),
        stroke: stroke
      })
    });
  }


/**
   * Get the OL Style object  from an GeoStyler-Style IconSymbolizer.
   *
   * @param {IconSymbolizer} symbolizer  A GeoStyler-Style IconSymbolizer.
   * @return {object} The OL Style object
   */
getOlIconSymbolizerFromIconSymbolizer(symbolizer: IconSymbolizer) {
    return new ol.style.Style({
      image: new ol.style.Icon({
        src: symbolizer.image,
        crossOrigin: 'anonymous',
        opacity: symbolizer.opacity,
        scale: symbolizer.size || 1,
        // Rotation in openlayers is radians while we use degree
        rotation: symbolizer.rotate ? symbolizer.rotate * Math.PI / 180 : undefined
      })
    });
  }


/**
   * Get the OL Style object from an GeoStyler-Style LineSymbolizer.
   *
   * @param {LineSymbolizer} lineSymbolizer A GeoStyler-Style LineSymbolizer.
   * @return {object} The OL Style object
   */
getOlLineSymbolizerFromLineSymbolizer(symbolizer: LineSymbolizer) {
    return new ol.style.Style({
      stroke: new ol.style.Stroke({
        color: (symbolizer.color && symbolizer.opacity) ?
          OlStyleUtil.getRgbaColor(symbolizer.color, symbolizer.opacity) : symbolizer.color,
        width: symbolizer.width,
        lineDash: symbolizer.dasharray
      })
    });
  }


/**
   * Get the OL Style object from an GeoStyler-Style FillSymbolizer.
   *
   * @param {FillSymbolizer} fillSymbolizer A GeoStyler-Style FillSymbolizer.
   * @return {object} The OL Style object
   */
getOlPolygonSymbolizerFromFillSymbolizer(symbolizer: FillSymbolizer) {
    return new ol.style.Style({
      stroke: new ol.style.Stroke({
        color: symbolizer.outlineColor
      }),
      fill: new ol.style.Fill({
        color: (symbolizer.color && symbolizer.opacity) ?
          OlStyleUtil.getRgbaColor(symbolizer.color, symbolizer.opacity) : symbolizer.color
      })
    });
  }


/**
   * Get the OL StyleFunction object from an GeoStyler-Style TextSymbolizer.
   *
   * @param {TextSymbolizer} textSymbolizer A GeoStyler-Style TextSymbolizer.
   * @return {object} The OL StyleFunction
   */
getOlTextSymbolizerFromTextSymbolizer(symbolizer: TextSymbolizer): ol.StyleFunction {

    const olPointStyledLabelFn = (feature: ol.Feature, res: number) => {

      const text = new ol.style.Text({
        font: OlStyleUtil.getTextFont(symbolizer),
        text: feature.get(symbolizer.field || '') + '',
        fill: new ol.style.Fill({
          color: (symbolizer.color && symbolizer.opacity) ?
            OlStyleUtil.getRgbaColor(symbolizer.color, symbolizer.opacity) : symbolizer.color
        }),
        stroke: new ol.style.Stroke({
          color: (symbolizer.color && symbolizer.opacity) ?
            OlStyleUtil.getRgbaColor(symbolizer.color, symbolizer.opacity) : symbolizer.color
        }),
        offsetX: symbolizer.offset ? symbolizer.offset[0] : 0,
        offsetY: symbolizer.offset ? symbolizer.offset[1] : 0,
        // TODO check why props match
        // textAlign: symbolizer.pitchAlignment,
        // textBaseline: symbolizer.anchor
      });

      const style = new ol.style.Style({
        text: text
      });

      return style;
    };

    return olPointStyledLabelFn;
  }


() => {
        wizard = TestData.buildDefaultAuror();
        enemy = TestData.buildDefaultEnemy();
    }


export default function StatelessModal(props: Props) {
  const overlayStateClassName = !props.overlayOpen ? "hidden" : "";
  return (
    <div class={`modal ${props.className || ""}`}


interface Props {
  className?: string;
  header: JSX.Element;
  preface: JSX.Element;
  overlayContents: JSX.Element[];
  acceptButton?: JSX.Element;
  overlayOpen: boolean;
  onClose: () => void;
  onOverlayBack: () => void;
}


() => {
	//1) setup the diagram engine
	var engine = createEngine();

	//2) setup the diagram model
	var model = new DiagramModel();

	//3-A) create a default node
	var node1 = new DefaultNodeModel('Node 1', 'rgb(0,192,255)');
	var port1 = node1.addOutPort('Out');
	node1.setPosition(100, 100);

	//3-B) create another default node
	var node2 = new DefaultNodeModel('Node 2', 'rgb(192,255,0)');
	var port2 = node2.addInPort('In');
	node2.setPosition(400, 100);

	//3-C) create another default node
	var node3 = new DefaultNodeModel('Node 3', 'rgb(192,255,0)');
	node2.setPosition(200, 300);

	//3-D) create another default node
	var node4 = new DefaultNodeModel('Node 4', 'rgb(192,255,0)');
	node2.setPosition(400, 400);

	//3-C) link the 2 nodes together
	var link1 = port1.link(port2);

	//4) add the models to the root graph
	model.addAll(node1, node2, link1, node3, node4);

	//5) load model into engine
	engine.setModel(model);

	var interval = setInterval(() => {
		[node1, node2, node3, node4].map(node => {
			var obj = { x: 0, y: 0 };
			gsap.fromTo(
				obj,
				{
					x: node.getPosition().x,
					y: node.getPosition().y
				},
				{
					x: Math.floor(Math.random() * 500),
					y: Math.floor(Math.random() * 500),
					duration: 0.8,
					onUpdate: () => {
						node.setPosition(obj.x, obj.y);
						engine.repaintCanvas();
					}
				}
			);
		});
	}, 2000);

	//6) render the diagram!
	return <NodeDelayedPosition engine={engine} model={model} />;
}


() => {
		[node1, node2, node3, node4].map(node => {
			var obj = { x: 0, y: 0 };
			gsap.fromTo(
				obj,
				{
					x: node.getPosition().x,
					y: node.getPosition().y
				},
				{
					x: Math.floor(Math.random() * 500),
					y: Math.floor(Math.random() * 500),
					duration: 0.8,
					onUpdate: () => {
						node.setPosition(obj.x, obj.y);
						engine.repaintCanvas();
					}
				}
			);
		});
	}


node => {
			var obj = { x: 0, y: 0 };
			gsap.fromTo(
				obj,
				{
					x: node.getPosition().x,
					y: node.getPosition().y
				},
				{
					x: Math.floor(Math.random() * 500),
					y: Math.floor(Math.random() * 500),
					duration: 0.8,
					onUpdate: () => {
						node.setPosition(obj.x, obj.y);
						engine.repaintCanvas();
					}
				}
			);
		}


() => {
						node.setPosition(obj.x, obj.y);
						engine.repaintCanvas();
					}


/**
 * Tests the grid size
 */
class NodeDelayedPosition extends React.Component<any, any> {
	constructor(props) {
		super(props);
	}

	render() {
		const { engine } = this.props;
		return (
			<DemoWorkspaceWidget>
				<DemoCanvasWidget>
					<CanvasWidget engine={engine} />
				</DemoCanvasWidget>
			</DemoWorkspaceWidget>
		);
	}
}


render() {
		const { engine } = this.props;
		return (
			<DemoWorkspaceWidget>
				<DemoCanvasWidget>
					<CanvasWidget engine={engine} />
				</DemoCanvasWidget>
			</DemoWorkspaceWidget>
		);
	}


({
  element,
  editAccess,
  selected,
  onSelect,
  onContextMenu,
  contextMenuOpen,
  dndDropRef,
}) => {
  const [hover, hoverRef] = useHover();
  const [innerHover, innerHoverRef] = useHover();
  const [{ dragging }, dragNodeRef] = useDragNode(noRegroupDragSourceSpec);
  const [{ dragging: labelDragging }, dragLabelRef] = useDragNode(noRegroupDragSourceSpec);
  const nodeRefs = useCombineRefs(innerHoverRef, dragNodeRef);
  const [filtered] = useSearchFilter(element.getLabel());
  const displayFilters = useDisplayFilters();
  const showLabelsFilter = getFilterById(SHOW_LABELS_FILTER_ID, displayFilters);
  const showLabels = showLabelsFilter?.value || hover || innerHover;
  const hasChildren = element.getChildren()?.length > 0;
  const { x, y, width, height } = element.getBounds();

  return (
    <g
      ref={hoverRef}
      onClick={onSelect}
      onContextMenu={editAccess ? onContextMenu : null}
      className={classNames('odc-helm-release', {
        'is-dragging': dragging || labelDragging,
        'is-filtered': filtered,
      }


type HelmReleaseGroupProps = {
  element: Node;
  editAccess: boolean;
} & WithSelectionProps &
  WithContextMenuProps &
  WithDndDropProps;


classNames('odc-helm-release', {
        'is-dragging': dragging


classNames('odc-helm-release', {
            'is-selected': selected,
            'is-dragging': dragging


createSvgIdUrl(
              hover


/**
* DeploymentList is a list of Deployments.
*/
export declare class V1DeploymentList {
    /**
    * APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    */
    'apiVersion'?: string;
    /**
    * Items is the list of Deployments.
    */
    'items': Array<V1Deployment>;
    /**
    * Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    */
    'kind'?: string;
    'metadata'?: V1ListMeta;
    static discriminator: string | undefined;
    static attributeTypeMap: Array<{
        name: string;
        baseName: string;
        type: string;
    }>;
    static getAttributeTypeMap(): {
        name: string;
        baseName: string;
        type: string;
    }[];
}


_type => NotificationWhereUniqueInput


_type => NotificationUpdateWithoutUserInput


@TypeGraphQL.InputType({
  isAbstract: true
})
export class NotificationUpdateWithWhereUniqueWithoutUserInput {
  @TypeGraphQL.Field(_type => NotificationWhereUniqueInput, {
    nullable: false
  })
  where!: NotificationWhereUniqueInput;

  @TypeGraphQL.Field(_type => NotificationUpdateWithoutUserInput, {
    nullable: false
  })
  data!: NotificationUpdateWithoutUserInput;
}


export default class Interface extends Component implements ComponentI {
    public readonly componentType: ComponentType = ComponentType.INTERFACE;

    public extends: string | undefined;

    constructor(name: string, extend?: string) {
        super(name);

        this.extends = extend;
    }
}


export interface IParticleSpin {
    acceleration: number;
    angle: number;
    direction: RotateDirection;
    radius: number;
    center: ICoordinates;
}


(predefinito: 127.0.0.1)


(predefinita: 100)


export function Debounce(delay: number = 250): MethodDecorator
{
    let timeoutReference: Timeout | undefined = undefined

    return (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>) => {
        const original = descriptor.value;
        descriptor.value = function (...args: any) {
            if (null != timeoutReference) clearTimeout(timeoutReference);
            timeoutReference = setTimeout(() => original.apply(this, args), delay);
        };

        return descriptor;
    };
}


(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>) => {
        const original = descriptor.value;
        descriptor.value = function (...args: any) {
            if (null != timeoutReference) clearTimeout(timeoutReference);
            timeoutReference = setTimeout(() => original.apply(this, args), delay);
        };

        return descriptor;
    }


() => original.apply(this, args)


(standaard:


(props, ref) => {
    const {
      onDropDownOpen,
      valueOption,
      onTermChange,
      icon,
      dropDownVisible,
      className,
      style,
      searchTerm,
      isLoading,
      disabled,
    } = props
    const initialText = typeof valueOption?.label === 'string' ? valueOption?.label : valueOption?.searchLabel
    const [text, setText] = useState(initialText)

    const onChange = useCallback(
      (value: string) => {
        setText(value)
        onTermChange(value)
        onDropDownOpen()
      },
      [onTermChange, setText, onDropDownOpen],
    )

    useEffect(() => {
      if (typeof searchTerm !== 'undefined') {
        setText(searchTerm)
      } else if (valueOption) {
        setText(initialText)
      }
    }, [valueOption, setText, initialText, searchTerm])

    return (
      <Box>
        <Input
          disabled={disabled}
          showClearButton={false}
          onFocus={onDropDownOpen}
          value={searchTerm || text}


(value: string) => {
        setText(value)
        onTermChange(value)
        onDropDownOpen()
      }


() => {
      if (typeof searchTerm !== 'undefined') {
        setText(searchTerm)
      } else if (valueOption) {
        setText(initialText)
      }
    }


(props) => (
  <Suspense fallback={<></>}>
    <InternalTokenLogo


({ address, name }) => {
  const { src } = useImage({
    srcList: [
      `http://localhost:3002/${address}/logo.png`,
      "/eth-diamond-black.png",
    ],
  });

  return (

      <img className="max-w-full max-h-full" src={src} alt={`${name} logo`}


type TokenLogoProps = {
  address: string;
  name: string;
};


@Directive({
  // eslint-disable-next-line @angular-eslint/directive-selector
    selector: '[requireFile]',
    providers: [
        { provide: NG_VALIDATORS, useExisting: FileValidator, multi: true },
    ]
})
/**
 * Validator directive to validate if a file is selected
 */
export class FileValidator implements Validator {
    static validate(c: FormControl): {[key: string]: any} {
      return c.value == null || c.value.length === 0 ? { required : true } : null;
    }

    validate(c: FormControl): {[key: string]: any} {
      return FileValidator.validate(c);
    }
}


static validate(c: FormControl): {[key: string]: any} {
      return c.value == null || c.value.length === 0 ? { required : true } : null;
    }


validate(c: FormControl): {[key: string]: any} {
      return FileValidator.validate(c);
    }


class DiskStorageProvider implements IStorageProvider {
  private client: S3;

  constructor() {
    this.client = new aws.S3({
      region: 'us-east-1',
    });
  }
  public async saveFile(file: string): Promise<string> {
    const originalPath = path.resolve(uploadConfig.tmpFolder, file);

    const ContentType = mime.getType(originalPath);

    if (!ContentType) {
      throw new Error('File not found');
    }

    const fileContent = await fs.promises.readFile(originalPath);

    await this.client
      .putObject({
        Bucket: uploadConfig.config.aws.bucket,
        Key: file,
        ACL: 'public-read',
        Body: fileContent,
        ContentType,
        ContentDisposition: `inline; filename=${file}`,
      })
      .promise();

    await fs.promises.unlink(originalPath);

    return file;
  }

  public async deleteFile(file: string): Promise<void> {
    await this.client
      .deleteObject({
        Bucket: uploadConfig.config.aws.bucket,
        Key: file,
      })
      .promise();
  }
}


public async saveFile(file: string): Promise<string> {
    const originalPath = path.resolve(uploadConfig.tmpFolder, file);

    const ContentType = mime.getType(originalPath);

    if (!ContentType) {
      throw new Error('File not found');
    }

    const fileContent = await fs.promises.readFile(originalPath);

    await this.client
      .putObject({
        Bucket: uploadConfig.config.aws.bucket,
        Key: file,
        ACL: 'public-read',
        Body: fileContent,
        ContentType,
        ContentDisposition: `inline; filename=${file}`,
      })
      .promise();

    await fs.promises.unlink(originalPath);

    return file;
  }


public async deleteFile(file: string): Promise<void> {
    await this.client
      .deleteObject({
        Bucket: uploadConfig.config.aws.bucket,
        Key: file,
      })
      .promise();
  }


(
  pkg: ConsolePackageJSON,
  description = 'package.json',
) => {
  const schema = loadSchema('plugin-package');
  const validator = new SchemaValidator(description);

  if (pkg.consolePlugin) {
    validator.validate(schema, pkg.consolePlugin, 'pkg.consolePlugin');

    validator.assert.validDNSSubdomainName(pkg.consolePlugin.name, 'pkg.consolePlugin.name');
    validator.assert.validSemverString(pkg.consolePlugin.version, 'pkg.consolePlugin.version');

    if (_.isPlainObject(pkg.consolePlugin.dependencies)) {
      Object.entries(pkg.consolePlugin.dependencies).forEach(([depName, versionRange]) => {
        validator.assert.validSemverRangeString(
          versionRange,
          `pkg.consolePlugin.dependencies['${depName}']`,
        );
      });
    }
  } else {
    validator.result.addError('pkg.consolePlugin object is missing');
  }

  return validator.result;
}


([depName, versionRange]) => {
        validator.assert.validSemverRangeString(
          versionRange,
          `pkg.consolePlugin.dependencies['${depName}']`,
        );
      }


() => {
      new webpack.container.ContainerPlugin({
        name: this.pkg.consolePlugin.name,
        library: { type: remoteEntryLibraryType, name: remoteEntryCallback },
        filename: remoteEntryFile,
        exposes: this.pkg.consolePlugin.exposedModules || {},
        overridables: sharedPluginModules.filter((m) => {
          // ContainerPlugin throws 'module not found' error if an overridable cannot be resolved.
          // All shared plugin modules are mandatory *except* the Console internal API module.
          return m !== '@openshift-console/dynamic-plugin-sdk-internal'
            ? true
            : !!{ ...this.pkg.devDependencies, ...this.pkg.dependencies }[m];
        }),
      }).apply(compiler);

      // Generate additional Console plugin assets
      new ConsoleAssetPlugin(this.pkg).apply(compiler);

      // Ignore require calls for modules that reside in Console monorepo packages
      new webpack.IgnorePlugin({
        resourceRegExp: /^@console\//,
        contextRegExp: /node_modules\/@openshift-console\/dynamic-plugin-sdk/,
      }).apply(compiler);
    }


(m) => {
          // ContainerPlugin throws 'module not found' error if an overridable cannot be resolved.
          // All shared plugin modules are mandatory *except* the Console internal API module.
          return m !== '@openshift-console/dynamic-plugin-sdk-internal'
            ? true
            : !!{ ...this.pkg.devDependencies, ...this.pkg.dependencies }[m];
        }


(compilation) => {
      compilation.updateAsset(remoteEntryFile, (source) => {
        const newSource = new ReplaceSource(source as any);
        newSource.insert(
          remoteEntryCallback.length + 1,
          `'${this.pkg.consolePlugin.name}@${this.pkg.consolePlugin.version}',`,
        );
        return newSource;
      });
    }


(source) => {
        const newSource = new ReplaceSource(source as any);
        newSource.insert(
          remoteEntryCallback.length + 1,
          `'${this.pkg.consolePlugin.name}@${this.pkg.consolePlugin.version}',`,
        );
        return newSource;
      }


() => {
        return true;
      }


(compilation) => {
        compilation.mainTemplate.hooks.requireExtensions.tap(ConsoleRemotePlugin.name, () => {
          const pluginBaseURL = `/api/plugins/${this.pkg.consolePlugin.name}/`;
          return `${webpack.RuntimeGlobals.publicPath} = "${pluginBaseURL}";`;
        });
      }


() => {
          const pluginBaseURL = `/api/plugins/${this.pkg.consolePlugin.name}/`;
          return `${webpack.RuntimeGlobals.publicPath} = "${pluginBaseURL}";`;
        }


export class ConsoleRemotePlugin {
  private readonly pkg: ConsolePackageJSON;

  constructor() {
    this.pkg = readPkg.sync({ normalize: false }) as ConsolePackageJSON;
    validatePackageFileSchema(this.pkg).report();
  }

  apply(compiler: webpack.Compiler) {
    if (!compiler.options.output.enabledLibraryTypes.includes(remoteEntryLibraryType)) {
      compiler.options.output.enabledLibraryTypes.push(remoteEntryLibraryType);
    }

    // Apply relevant webpack plugins
    compiler.hooks.afterPlugins.tap(ConsoleRemotePlugin.name, () => {
      new webpack.container.ContainerPlugin({
        name: this.pkg.consolePlugin.name,
        library: { type: remoteEntryLibraryType, name: remoteEntryCallback },
        filename: remoteEntryFile,
        exposes: this.pkg.consolePlugin.exposedModules || {},
        overridables: sharedPluginModules.filter((m) => {
          // ContainerPlugin throws 'module not found' error if an overridable cannot be resolved.
          // All shared plugin modules are mandatory *except* the Console internal API module.
          return m !== '@openshift-console/dynamic-plugin-sdk-internal'
            ? true
            : !!{ ...this.pkg.devDependencies, ...this.pkg.dependencies }[m];
        }),
      }).apply(compiler);

      // Generate additional Console plugin assets
      new ConsoleAssetPlugin(this.pkg).apply(compiler);

      // Ignore require calls for modules that reside in Console monorepo packages
      new webpack.IgnorePlugin({
        resourceRegExp: /^@console\//,
        contextRegExp: /node_modules\/@openshift-console\/dynamic-plugin-sdk/,
      }).apply(compiler);
    });

    // Post-process generated remote entry source
    // TODO(vojtech): fix 'webpack-sources' type incompatibility when updating to latest webpack 5
    compiler.hooks.emit.tap(ConsoleRemotePlugin.name, (compilation) => {
      compilation.updateAsset(remoteEntryFile, (source) => {
        const newSource = new ReplaceSource(source as any);
        newSource.insert(
          remoteEntryCallback.length + 1,
          `'${this.pkg.consolePlugin.name}@${this.pkg.consolePlugin.version}',`,
        );
        return newSource;
      });
    });

    // Skip processing entry option if it's missing or empty
    // TODO(vojtech): latest webpack 5 allows `entry: {}` so use that & remove following code
    if (_.isPlainObject(compiler.options.entry) && _.isEmpty(compiler.options.entry)) {
      compiler.hooks.entryOption.tap(ConsoleRemotePlugin.name, () => {
        return true;
      });
    }

    // Set default publicPath if output.publicPath option is missing or empty
    // TODO(vojtech): mainTemplate is deprecated in latest webpack 5, adapt code accordingly
    if (_.isEmpty(compiler.options.output.publicPath)) {
      compiler.hooks.thisCompilation.tap(ConsoleRemotePlugin.name, (compilation) => {
        compilation.mainTemplate.hooks.requireExtensions.tap(ConsoleRemotePlugin.name, () => {
          const pluginBaseURL = `/api/plugins/${this.pkg.consolePlugin.name}/`;
          return `${webpack.RuntimeGlobals.publicPath} = "${pluginBaseURL}";`;
        });
      });
    }
  }
}


apply(compiler: webpack.Compiler) {
    if (!compiler.options.output.enabledLibraryTypes.includes(remoteEntryLibraryType)) {
      compiler.options.output.enabledLibraryTypes.push(remoteEntryLibraryType);
    }

    // Apply relevant webpack plugins
    compiler.hooks.afterPlugins.tap(ConsoleRemotePlugin.name, () => {
      new webpack.container.ContainerPlugin({
        name: this.pkg.consolePlugin.name,
        library: { type: remoteEntryLibraryType, name: remoteEntryCallback },
        filename: remoteEntryFile,
        exposes: this.pkg.consolePlugin.exposedModules || {},
        overridables: sharedPluginModules.filter((m) => {
          // ContainerPlugin throws 'module not found' error if an overridable cannot be resolved.
          // All shared plugin modules are mandatory *except* the Console internal API module.
          return m !== '@openshift-console/dynamic-plugin-sdk-internal'
            ? true
            : !!{ ...this.pkg.devDependencies, ...this.pkg.dependencies }[m];
        }),
      }).apply(compiler);

      // Generate additional Console plugin assets
      new ConsoleAssetPlugin(this.pkg).apply(compiler);

      // Ignore require calls for modules that reside in Console monorepo packages
      new webpack.IgnorePlugin({
        resourceRegExp: /^@console\//,
        contextRegExp: /node_modules\/@openshift-console\/dynamic-plugin-sdk/,
      }).apply(compiler);
    });

    // Post-process generated remote entry source
    // TODO(vojtech): fix 'webpack-sources' type incompatibility when updating to latest webpack 5
    compiler.hooks.emit.tap(ConsoleRemotePlugin.name, (compilation) => {
      compilation.updateAsset(remoteEntryFile, (source) => {
        const newSource = new ReplaceSource(source as any);
        newSource.insert(
          remoteEntryCallback.length + 1,
          `'${this.pkg.consolePlugin.name}@${this.pkg.consolePlugin.version}',`,
        );
        return newSource;
      });
    });

    // Skip processing entry option if it's missing or empty
    // TODO(vojtech): latest webpack 5 allows `entry: {}` so use that & remove following code
    if (_.isPlainObject(compiler.options.entry) && _.isEmpty(compiler.options.entry)) {
      compiler.hooks.entryOption.tap(ConsoleRemotePlugin.name, () => {
        return true;
      });
    }

    // Set default publicPath if output.publicPath option is missing or empty
    // TODO(vojtech): mainTemplate is deprecated in latest webpack 5, adapt code accordingly
    if (_.isEmpty(compiler.options.output.publicPath)) {
      compiler.hooks.thisCompilation.tap(ConsoleRemotePlugin.name, (compilation) => {
        compilation.mainTemplate.hooks.requireExtensions.tap(ConsoleRemotePlugin.name, () => {
          const pluginBaseURL = `/api/plugins/${this.pkg.consolePlugin.name}/`;
          return `${webpack.RuntimeGlobals.publicPath} = "${pluginBaseURL}";`;
        });
      });
    }
  }


(message: string | null, params: any = notificationTypes.info) => {
	Notification.open({
		duration: 5000,
		message,
		type: 'is-success',
		position: 'is-top-right',
		actionText: 'OK',
		queue: false,
		...params,
	});
}


export type NotificationType = { type: string, actionText: string }


export type NotificationList = Record<string, NotificationType>


async () => {
		const [, minter] = await ethers.getSigners();

		const ShibuiContract = (await ethers.getContractFactory('Shibui')) as Shibui__factory;
		shibui = await ShibuiContract.deploy();
		await shibui.deployed();

		await shibui.mintFull(minter.address);
		expect(await shibui.balanceOf(minter.address)).to.eql(TOTAL_SUPPLY);
	}


() => {
		it('has given name', async () => {
			expect(await shibui.name()).to.equal(NAME);
		});

		it('has given symbol', async () => {
			expect(await shibui.symbol()).to.equal(SYMBOL);
		});
	}


async () => {
			expect(await shibui.name()).to.equal(NAME);
		}


async () => {
			expect(await shibui.symbol()).to.equal(SYMBOL);
		}


() => {
		it('grants to initial account', async () => {
			const [, minter] = await ethers.getSigners();
			const minterBalance = await shibui.balanceOf(minter.address);

			expect(minterBalance).to.eql(TOTAL_SUPPLY);
		});
	}


async () => {
			const [, minter] = await ethers.getSigners();
			const minterBalance = await shibui.balanceOf(minter.address);

			expect(minterBalance).to.eql(TOTAL_SUPPLY);
		}


() => {
		it('should fail to mint after full again', async () => {
			const [, minter] = await ethers.getSigners();

			await expect(shibui.mintFull(minter.address)).to.be.revertedWith('MINT_EXECUTED');
		});
	}


async () => {
			const [, minter] = await ethers.getSigners();

			await expect(shibui.mintFull(minter.address)).to.be.revertedWith('MINT_EXECUTED');
		}


() => {
		it('should swap ownership', async () => {
			const [deployer, , a0] = await ethers.getSigners();

			await expect(shibui.transferOwnership(a0.address)) //
				.to.emit(shibui, 'OwnershipTransferred')
				.withArgs(deployer.address, a0.address);
			const owner = await shibui.owner();

			expect(owner).to.equal(a0.address);
		});

		it('should fail to swap ownership', async () => {
			const [, , a0] = await ethers.getSigners();

			await expect(shibui.connect(a0).transferOwnership(a0.address)).to.be.revertedWith('Ownable: caller is not the owner');
		});

		it('should renounce ownership', async () => {
			const [deployer, , a0] = await ethers.getSigners();

			await expect(shibui.renounceOwnership()) //
				.to.emit(shibui, 'OwnershipTransferred')
				.withArgs(deployer.address, ZERO_ADDRESS);
			const owner = await shibui.owner();

			expect(owner).to.equal(ZERO_ADDRESS);
			await expect(shibui.transferOwnership(a0.address)).to.be.revertedWith('Ownable: caller is not the owner');
		});
	}


async () => {
			const [deployer, , a0] = await ethers.getSigners();

			await expect(shibui.transferOwnership(a0.address)) //
				.to.emit(shibui, 'OwnershipTransferred')
				.withArgs(deployer.address, a0.address);
			const owner = await shibui.owner();

			expect(owner).to.equal(a0.address);
		}


async () => {
			const [, , a0] = await ethers.getSigners();

			await expect(shibui.connect(a0).transferOwnership(a0.address)).to.be.revertedWith('Ownable: caller is not the owner');
		}


async () => {
			const [deployer, , a0] = await ethers.getSigners();

			await expect(shibui.renounceOwnership()) //
				.to.emit(shibui, 'OwnershipTransferred')
				.withArgs(deployer.address, ZERO_ADDRESS);
			const owner = await shibui.owner();

			expect(owner).to.equal(ZERO_ADDRESS);
			await expect(shibui.transferOwnership(a0.address)).to.be.revertedWith('Ownable: caller is not the owner');
		}


() => {
		const nonce = BigNumber.from(0);

		const EIP712Domain = [
			{ name: 'name', type: 'string' },
			{ name: 'version', type: 'string' },
			{ name: 'chainId', type: 'uint256' },
			{ name: 'verifyingContract', type: 'address' }
		];

		const Delegation = [
			{ name: 'delegatee', type: 'address' },
			{ name: 'nonce', type: 'uint256' },
			{ name: 'expiry', type: 'uint256' }
		];

		const buildData = (chainId: number, verifyingContract: string, message: any) => ({
			data: {
				primaryType: 'Delegation' as const,
				types: { EIP712Domain, Delegation },
				domain: { name: NAME, version: '1', chainId, verifyingContract },
				message
			}
		});

		it('reverts if the signatory is invalid', async () => {
			const [, minter, a0] = await ethers.getSigners();
			const expiry = BigNumber.from(0);

			await expect(shibui.connect(minter).delegateBySig(a0.address, nonce, expiry, 0, randomBytes(32), randomBytes(32))).to.be.reverted;
		});

		it('reverts if the nonce is bad', async () => {
			const [, minter, a0] = getSignersWithPrivateKeys(await ethers.getSigners());
			const badNonce = BigNumber.from(nonce).add(1);

			const { v, r, s } = fromRpcSig(
				ethSigUtil.signTypedMessage(
					Buffer.from(minter.privateKey, 'hex'),
					buildData(await minter.getChainId(), shibui.address, {
						delegatee: a0.address,
						nonce: badNonce.toNumber(),
						expiry: MAX_JS_NUMBER
					})
				)
			);

			await expect(shibui.delegateBySig(a0.address, badNonce, BigNumber.from(MAX_JS_NUMBER.toString()), v, r, s)) //
				.to.be.revertedWith('DELEGATE_SIG_INVALID_NONCE');
		});

		it('reverts if the signature has expired', async () => {
			const [, minter, a0] = getSignersWithPrivateKeys(await ethers.getSigners());
			const badExpire = 0;

			const { v, r, s } = fromRpcSig(
				ethSigUtil.signTypedMessage(
					Buffer.from(minter.privateKey, 'hex'),
					buildData(await minter.getChainId(), shibui.address, {
						delegatee: a0.address,
						nonce: nonce.toNumber(),
						expiry: badExpire
					})
				)
			);

			await expect(shibui.delegateBySig(a0.address, nonce, BigNumber.from(badExpire), v, r, s)) //
				.to.be.revertedWith('DELEGATE_SIG_EXPIRED');
		});

		it('delegates on behalf of the signatory', async () => {
			const [, minter, a0] = getSignersWithPrivateKeys(await ethers.getSigners());

			const { v, r, s } = fromRpcSig(
				ethSigUtil.signTypedMessage(
					Buffer.from(minter.privateKey, 'hex'),
					buildData(await minter.getChainId(), shibui.address, {
						delegatee: a0.address,
						nonce: nonce.toNumber(),
						expiry: MAX_JS_NUMBER
					})
				)
			);

			await expect(shibui.delegateBySig(a0.address, nonce, BigNumber.from(MAX_JS_NUMBER.toString()), v, r, s))
				.to.emit(shibui, 'DelegateChanged')
				.withArgs(minter.address, ZERO_ADDRESS, a0.address)
				.and //
				.to.emit(shibui, 'DelegateVotesChanged')
				.withArgs(a0.address, BigNumber.from(0), TOTAL_SUPPLY);
			expect(await shibui.getCurrentVotes(a0.address)).to.eql(TOTAL_SUPPLY);
			expect(await shibui.delegates(minter.address)).to.equal(a0.address);
		});
	}


(chainId: number, verifyingContract: string, message: any) => ({
			data: {
				primaryType: 'Delegation' as const,
				types: { EIP712Domain, Delegation },
				domain: { name: NAME, version: '1', chainId, verifyingContract },
				message
			}
		})


async () => {
			const [, minter, a0] = await ethers.getSigners();
			const expiry = BigNumber.from(0);

			await expect(shibui.connect(minter).delegateBySig(a0.address, nonce, expiry, 0, randomBytes(32), randomBytes(32))).to.be.reverted;
		}


async () => {
			const [, minter, a0] = getSignersWithPrivateKeys(await ethers.getSigners());
			const badNonce = BigNumber.from(nonce).add(1);

			const { v, r, s } = fromRpcSig(
				ethSigUtil.signTypedMessage(
					Buffer.from(minter.privateKey, 'hex'),
					buildData(await minter.getChainId(), shibui.address, {
						delegatee: a0.address,
						nonce: badNonce.toNumber(),
						expiry: MAX_JS_NUMBER
					})
				)
			);

			await expect(shibui.delegateBySig(a0.address, badNonce, BigNumber.from(MAX_JS_NUMBER.toString()), v, r, s)) //
				.to.be.revertedWith('DELEGATE_SIG_INVALID_NONCE');
		}


async () => {
			const [, minter, a0] = getSignersWithPrivateKeys(await ethers.getSigners());
			const badExpire = 0;

			const { v, r, s } = fromRpcSig(
				ethSigUtil.signTypedMessage(
					Buffer.from(minter.privateKey, 'hex'),
					buildData(await minter.getChainId(), shibui.address, {
						delegatee: a0.address,
						nonce: nonce.toNumber(),
						expiry: badExpire
					})
				)
			);

			await expect(shibui.delegateBySig(a0.address, nonce, BigNumber.from(badExpire), v, r, s)) //
				.to.be.revertedWith('DELEGATE_SIG_EXPIRED');
		}


async () => {
			const [, minter, a0] = getSignersWithPrivateKeys(await ethers.getSigners());

			const { v, r, s } = fromRpcSig(
				ethSigUtil.signTypedMessage(
					Buffer.from(minter.privateKey, 'hex'),
					buildData(await minter.getChainId(), shibui.address, {
						delegatee: a0.address,
						nonce: nonce.toNumber(),
						expiry: MAX_JS_NUMBER
					})
				)
			);

			await expect(shibui.delegateBySig(a0.address, nonce, BigNumber.from(MAX_JS_NUMBER.toString()), v, r, s))
				.to.emit(shibui, 'DelegateChanged')
				.withArgs(minter.address, ZERO_ADDRESS, a0.address)
				.and //
				.to.emit(shibui, 'DelegateVotesChanged')
				.withArgs(a0.address, BigNumber.from(0), TOTAL_SUPPLY);
			expect(await shibui.getCurrentVotes(a0.address)).to.eql(TOTAL_SUPPLY);
			expect(await shibui.delegates(minter.address)).to.equal(a0.address);
		}


() => {
		it('returns the number of checkpoints for a delegate', async () => {
			const [, minter, a0, a1, a2] = await ethers.getSigners();
			await shibui.connect(minter).transfer(a0.address, 100);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(0);

			const t1 = await shibui.connect(a0).delegate(a1.address);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(1);

			const t2 = await shibui.connect(a0).transfer(a2.address, 10);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(2);

			const t3 = await shibui.connect(a0).transfer(a2.address, 10);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(3);

			const t4 = await shibui.connect(minter).transfer(a0.address, 20);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(4);

			expect(await shibui.checkpoints(a1.address, 0)).to.eql([t1.blockNumber, BigNumber.from(100)]);
			expect(await shibui.checkpoints(a1.address, 1)).to.eql([t2.blockNumber, BigNumber.from(90)]);
			expect(await shibui.checkpoints(a1.address, 2)).to.eql([t3.blockNumber, BigNumber.from(80)]);
			expect(await shibui.checkpoints(a1.address, 3)).to.eql([t4.blockNumber, BigNumber.from(100)]);
		});

		it('does not add more than one checkpoint in a block', async () => {
			const [, minter, a0, a1, a2] = await ethers.getSigners();

			await shibui.connect(minter).transfer(a0.address, 100);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(0);

			const [t1] = await batchInBlock([
				() => shibui.connect(a0).delegate(a1.address),
				() => shibui.connect(a0).transfer(a2.address, 10),
				() => shibui.connect(a0).transfer(a2.address, 10)
			]);

			expect(await shibui.numCheckpoints(a1.address)).to.equal(1);

			expect(await shibui.checkpoints(a1.address, 0)).to.eql([t1.blockNumber, BigNumber.from(80)]);
			expect(await shibui.checkpoints(a1.address, 1)).to.eql([0, BigNumber.from(0)]);
			expect(await shibui.checkpoints(a1.address, 2)).to.eql([0, BigNumber.from(0)]);

			const t4 = await shibui.connect(minter).transfer(a0.address, 20);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(2);
			expect(await shibui.checkpoints(a1.address, 1)).to.eql([t4.blockNumber, BigNumber.from(100)]);
		});
	}


async () => {
			const [, minter, a0, a1, a2] = await ethers.getSigners();
			await shibui.connect(minter).transfer(a0.address, 100);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(0);

			const t1 = await shibui.connect(a0).delegate(a1.address);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(1);

			const t2 = await shibui.connect(a0).transfer(a2.address, 10);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(2);

			const t3 = await shibui.connect(a0).transfer(a2.address, 10);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(3);

			const t4 = await shibui.connect(minter).transfer(a0.address, 20);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(4);

			expect(await shibui.checkpoints(a1.address, 0)).to.eql([t1.blockNumber, BigNumber.from(100)]);
			expect(await shibui.checkpoints(a1.address, 1)).to.eql([t2.blockNumber, BigNumber.from(90)]);
			expect(await shibui.checkpoints(a1.address, 2)).to.eql([t3.blockNumber, BigNumber.from(80)]);
			expect(await shibui.checkpoints(a1.address, 3)).to.eql([t4.blockNumber, BigNumber.from(100)]);
		}


async () => {
			const [, minter, a0, a1, a2] = await ethers.getSigners();

			await shibui.connect(minter).transfer(a0.address, 100);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(0);

			const [t1] = await batchInBlock([
				() => shibui.connect(a0).delegate(a1.address),
				() => shibui.connect(a0).transfer(a2.address, 10),
				() => shibui.connect(a0).transfer(a2.address, 10)
			]);

			expect(await shibui.numCheckpoints(a1.address)).to.equal(1);

			expect(await shibui.checkpoints(a1.address, 0)).to.eql([t1.blockNumber, BigNumber.from(80)]);
			expect(await shibui.checkpoints(a1.address, 1)).to.eql([0, BigNumber.from(0)]);
			expect(await shibui.checkpoints(a1.address, 2)).to.eql([0, BigNumber.from(0)]);

			const t4 = await shibui.connect(minter).transfer(a0.address, 20);
			expect(await shibui.numCheckpoints(a1.address)).to.equal(2);
			expect(await shibui.checkpoints(a1.address, 1)).to.eql([t4.blockNumber, BigNumber.from(100)]);
		}


() => shibui.connect(a0).delegate(a1.address)


() => shibui.connect(a0).transfer(a2.address, 10)