() => {
  let component: CreateButtonComponent;
  let fixture: ComponentFixture<CreateButtonComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ CreateButtonComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(CreateButtonComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should be created', () => {
    expect(component).toBeTruthy();
  });
}


() => {
    TestBed.configureTestingModule({
      declarations: [ CreateButtonComponent ]
    })
    .compileComponents();
  }


() => {
    fixture = TestBed.createComponent(CreateButtonComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  }


export interface CreateVolumeGroupRequest {
  /**
   * Request to create a new volume group.
   */
  "createVolumeGroupDetails": model.CreateVolumeGroupDetails;
  /**
   * A token that uniquely identifies a request so it can be retried in case of a timeout or
   * server error without risk of executing that same action again. Retry tokens expire after 24
   * hours, but can be invalidated before then due to conflicting operations (for example, if a resource
   * has been deleted and purged from the system, then a retry of the original creation request
   * may be rejected).
   *
   */
  "opcRetryToken"?: string;
}


export class AmountEditTips implements m.Component {
    view({ attrs } : m.Vnode<AmountEditTipsAttrs>) {

        const show = attrs.show

        return (
            <div class='dashboard-column-tips amount' style={`display: ${show ? 'block' : 'none'}`}


type AmountEditTipsAttrs = {
    show: boolean
}


view({ attrs } : m.Vnode<AmountEditTipsAttrs>) {

        const show = attrs.show

        return (
            <div class='dashboard-column-tips amount' style={`display: ${show ? 'block' : 'none'}`}


@Component({

})
class QuxComponent {}


@NgModule({
  declarations: [QuxComponent],
  imports: [RouterModule.forChild([
    {
      path: '',
      component: QuxComponent,
      pathMatch: 'full'
    }
  ])],
  bootstrap: [QuxComponent]
})
export class QuxModule {}


@Controller()
export class UserController {
  constructor(private readonly userService: UserService) {}

  @Post('login')
  @Public()
  login(@Body() { email, password }: LoginUserDto) {
    return this.userService.login(email, password);
  }

  @Post('signup')
  @Public()
  signup(@Body() body: SignupDto) {
    return this.userService.signup(body);
  }

  @Get('users')
  @Roles(RoleStatus.ADMIN)
  getUsers() {
    return this.userService.getAllUsers();
  }

  @Get('users/:userId')
  @Public()
  getOneUserById(@Param('userId', ParseIntPipe) userId: number) {
    return this.userService.getUserById(userId);
  }

  @Delete('users/:userId')
  @Roles(RoleStatus.ADMIN)
  deleteOneUserById(@Param('userId', ParseIntPipe) userId: number) {
    return this.userService.deleteUserById(userId);
  }
}


@Post('login')
  @Public()
  login(@Body() { email, password }: LoginUserDto) {
    return this.userService.login(email, password);
  }


@Post('signup')
  @Public()
  signup(@Body() body: SignupDto) {
    return this.userService.signup(body);
  }


@Get('users')
  @Roles(RoleStatus.ADMIN)
  getUsers() {
    return this.userService.getAllUsers();
  }


@Get('users/:userId')
  @Public()
  getOneUserById(@Param('userId', ParseIntPipe) userId: number) {
    return this.userService.getUserById(userId);
  }


@Delete('users/:userId')
  @Roles(RoleStatus.ADMIN)
  deleteOneUserById(@Param('userId', ParseIntPipe) userId: number) {
    return this.userService.deleteUserById(userId);
  }


@Injectable({
  providedIn: 'root'
})
export class CategoriesService {
  public apiUrl = environment.apiUrl;

  constructor(private http: HttpClient) { }

  getCategories() {
    return this.http.get(`${this.apiUrl}api/c/categories`);
  }

  deleteCategory(id) {
    return this.http.delete(`${this.apiUrl}api/c/categories/${id}`);
  }
  postCategory(payload){
    return this.http.post(`${this.apiUrl}api/c/categories/create`, payload);
  }
}


getCategories() {
    return this.http.get(`${this.apiUrl}api/c/categories`);
  }


deleteCategory(id) {
    return this.http.delete(`${this.apiUrl}api/c/categories/${id}`);
  }


postCategory(payload){
    return this.http.post(`${this.apiUrl}api/c/categories/create`, payload);
  }


() => <BasicDemo />;


/**
 * Get @deno-types hint comments from a Document
 * @param document
 */
export function getDenoTypesHintsFromDocument(
  document: TextDocument
): CompileHint[] {
  const uri = URI.parse(document.uri);

  const sourceFile = ts.createSourceFile(
    uri.fsPath,
    document.getText(),
    ts.ScriptTarget.ESNext,
    true,
    ts.ScriptKind.TSX
  );

  return getDenoCompileHint(ts)(sourceFile);
}


export interface Member {
  id: string;
  avatarUrl?: string;
  name: string;
  bot: boolean;
}


export interface ClientUser extends Member {
}


export interface GatewayResponse {
  token: string;
  user: ClientUser;
  members: Array<Member>;
}


export type Events =
  | "ready"
  | "login"
  | "message:create"
  | "message:delete"
  | "message:update"
  | "user:join"
  | "user:leave"
  | "user:typing"
  | "user:update"
  | "channel:commands"
  | "channel:create"
  | "member:create"
  | "member:delete";


params=>{
        this.rowID = params['id'];
        console.log('rowID: ' + this.rowID);
      }


data=>{
        if(data['success'] != 1){
          console.log(data['message']);
        }
        else{
          console.log(data['message']);
          localStorage.setItem("dataUpdated","true");
          this._router.navigate(['/viewData']);
        }
      }


data=>{
      if(data['success'] != 1){
        console.log(data['message']);
      }
      else{

        this.data = data['data'][0];
        this.data2 = data['data2'][0];
        this.showMessage = false;
        this.showData = true;
        console.log(this.data2);
        console.log(this.data);

      }
    }


ngOnInit() {
    this._activaterouter.params.subscribe(
      params=>{
        this.rowID = params['id'];
        console.log('rowID: ' + this.rowID);
      })
      this.getDataEntry();
  }


submitData(){
    var check = this.checkInputs();
    console.log(check);
    if (check == false){
      this.errMessage = 'Please enter the fields correctly!';
      this.errErrorMessage = true;
      window.scrollTo(0 , 0);
    }
    else{
      console.log(this.addressModel)
      this.errErrorMessage = false;
      var dataObs = this._httpService.updateDataEntry(this.rowID,this.model, this.addressModel);
      dataObs.subscribe(data=>{
        if(data['success'] != 1){
          console.log(data['message']);
        }
        else{
          console.log(data['message']);
          localStorage.setItem("dataUpdated","true");
          this._router.navigate(['/viewData']);
        }
      })
    }

  }


getDataEntry(){
    var dataObs = this._httpService.getUniqueDataFromDatabase(this.rowID);
    dataObs.subscribe(data=>{
      if(data['success'] != 1){
        console.log(data['message']);
      }
      else{

        this.data = data['data'][0];
        this.data2 = data['data2'][0];
        this.showMessage = false;
        this.showData = true;
        console.log(this.data2);
        console.log(this.data);

      }
    })
  }


export async function readJsonFileContentAsync(file: string, encoding = "utf8") {
    try {
        const content = await readFileAsync(file, encoding);
        return JSON.parse(content) as {};
    } catch (e) {
        throw new Error(`File: '${file}' cannot be opened.`);
    }
}


export declare class OwlDateTimeContainerComponent<T> implements OnInit, AfterContentInit, AfterViewInit {
    private cdRef;
    private elmRef;
    private pickerIntl;
    private dateTimeAdapter;
    calendar: OwlCalendarComponent<T>;
    timer: OwlTimerComponent<T>;
    picker: OwlDateTime<T>;
    activeSelectedIndex: number;
    private hidePicker$;
    readonly hidePickerStream: Observable<any>;
    private confirmSelected$;
    readonly confirmSelectedStream: Observable<any>;
    private pickerOpened$;
    readonly pickerOpenedStream: Observable<any>;
    private _clamPickerMoment;
    pickerMoment: T;
    readonly pickerType: PickerType;
    readonly cancelLabel: string;
    readonly setLabel: string;
    readonly fromLabel: string;
    readonly toLabel: string;
    readonly fromFormattedValue: string;
    readonly toFormattedValue: string;
    readonly showControlButtons: boolean;
    readonly containerElm: HTMLElement;
    readonly owlDTContainerClass: boolean;
    readonly owlDTPopupContainerClass: boolean;
    readonly owlDTDialogContainerClass: boolean;
    readonly owlDTInlineContainerClass: boolean;
    readonly owlDTContainerDisabledClass: boolean;
    readonly owlDTContainerId: string;
    readonly owlDTContainerAnimation: any;
    constructor(cdRef: ChangeDetectorRef, elmRef: ElementRef, pickerIntl: OwlDateTimeIntl, dateTimeAdapter: DateTimeAdapter<T>);
    ngOnInit(): void;
    ngAfterContentInit(): void;
    ngAfterViewInit(): void;
    handleContainerAnimationDone(event: AnimationEvent): void;
    dateSelected(date: T): void;
    timeSelected(time: T): void;
    onCancelClicked(event: any): void;
    onSetClicked(event: any): void;
    handleClickOnInfoGroup(event: any, index: number): void;
    handleKeydownOnInfoGroup(event: any, next: any, index: number): void;
    private setActiveSelectedIndex;
    private initPicker;
    private dateSelectedInSingleMode;
    private dateSelectedInRangeMode;
    private updateAndCheckCalendarDate;
    private focusPicker;
}


ngAfterContentInit(): void;


handleContainerAnimationDone(event: AnimationEvent): void;


dateSelected(date: T): void;


timeSelected(time: T): void;


onCancelClicked(event: any): void;


onSetClicked(event: any): void;


handleClickOnInfoGroup(event: any, index: number): void;


handleKeydownOnInfoGroup(event: any, next: any, index: number): void;


() => {
  const [balance, setBalance] = useState(new BigNumber(0))
  const {
    account,
    ethereum,
  }: { account: string; ethereum: provider } = useWallet()
  const pbr = usePolkaBridge()
  const block = useBlock()

  const fetchBalance = useCallback(async () => {
    const balance = await getLockOf(pbr, account)
    setBalance(balance)
  }, [account, pbr])

  useEffect(() => {
    if (account && pbr) {
      fetchBalance()
    }
  }, [account, block, setBalance, pbr])

  return balance
}


async () => {
    const balance = await getLockOf(pbr, account)
    setBalance(balance)
  }


() => {
    if (account && pbr) {
      fetchBalance()
    }
  }


headerName => headerName === header.name


export class PowerHandler extends AbstractHandler {
  constructor(middleware?: MiddlewareService) {
    super(middleware)
  }

  public canHandle(request: Request): boolean {
    const { header } = request.directive
    return (
      header.namespace === Interface.POWER &&
      [HeaderName.TURN_ON, HeaderName.TURN_OFF].some(headerName => headerName === header.name)
    )
  }

  public getState<T>(request: Request): any {
    const { name } = request.directive.header
    return name === HeaderName.TURN_ON
  }
}


public canHandle(request: Request): boolean {
    const { header } = request.directive
    return (
      header.namespace === Interface.POWER &&
      [HeaderName.TURN_ON, HeaderName.TURN_OFF].some(headerName => headerName === header.name)
    )
  }


public getState<T>(request: Request): any {
    const { name } = request.directive.header
    return name === HeaderName.TURN_ON
  }


export default function Index(props: MessageProps) {
  const { cref, className, ...others } = props
  const topTips = useRef<HTMLDivElement>()
  const [msg, setMsg] = useState('')

  const showTopTips = useFadeIn(topTips)
  const hideTopTips = useFadeOut(topTips)

  const actionRef = useRef({
    show: function (str: string) {
      setMsg(str)
      nextTick(() => {
        showTopTips()
      })
    },
    hide: function () {
      hideTopTips()
      nextTick(() => {
        setMsg('')
      })
    },
  })
  cref.current = actionRef.current

  return (
    <View
      className={`antmui-toptips antmui-toptips_warn ${className || ''}`}


() => {
        showTopTips()
      }


() => {
        setMsg('')
      }


LegacyRef<HTMLDivElement>


(props: Props) => {
	const { direction, classPrefix = null, activeView, onClick } = props;
	const button = React.useMemo(
		() => ({
			testId: direction === 'prev' ? testIds.controlsPrevBtn : testIds.controlsNextBtn,
			arrow: direction === 'prev' ? '<' : '>',
		}),
		[direction]
	);
	const CArrowButton = React.useMemo(
		() => getArrowButtonClass(direction, classPrefix, activeView),
		[direction, classPrefix, activeView]
	);
	const handlerClick = React.useCallback((): void => {
		onClick(direction);
	}, [direction, onClick]);
	return (
		<span
			className={CArrowButton}
			data-testid={button.testId}
			onClick={handlerClick}
		>
			{button.arrow}
		</span>


() => ({
			testId: direction === 'prev' ? testIds.controlsPrevBtn : testIds.controlsNextBtn,
			arrow: direction === 'prev' ? '<' : '>',
		})


() => getArrowButtonClass(direction, classPrefix, activeView)


(): void => {
		onClick(direction);
	}


interface Props {
	direction: 'prev' | 'next';
	classPrefix?: string | string[] | null;
	activeView: string;
	onClick: (direction: string) => void;
}


() => {
                this.fileService.download(item.id);
            }


@Component({
    selector: 'smart-detail-pdf',
    templateUrl: './pdf.component.html',
    styleUrls: ['./pdf.component.scss']
})
export class DetailPdfComponent<T extends IEntity<string>> extends DetailBaseComponent<T> {
    constructor(cd: ChangeDetectorRef, private fileService: FileService) {
        super(cd);
    }

    getButtonOptions(item: { id }): IButtonOptions {
        return {
            click: () => {
                this.fileService.download(item.id);
            }
        }
    }
}


getButtonOptions(item: { id }): IButtonOptions {
        return {
            click: () => {
                this.fileService.download(item.id);
            }
        }
    }


(): void => {
  if (isServer) return

  const wrapper = ({ children }: { children?: ReactNode }): ReactElement => (
    <Provider url='https://example.com'>{children}</Provider>


({ children }: { children?: ReactNode }): ReactElement => (
    <Provider url='https://example.com'>{children}</Provider>


(): void => {
    const { result } = renderHook((): any =>
      useFetchArgs('https://example.com')
    )
    expect(result.current).toEqual({
      ...useFetchArgsDefaults,
      customOptions: {
        ...useFetchArgsDefaults.customOptions,
        url: 'https://example.com'
      }
    })
  }


(): any =>
      useFetchArgs('https://example.com')


(): void => {
    const { result } = renderHook((): any =>
      useFetchArgs({
        url: 'https://example.com'
      }, []) // onMount === true
    )
    expect(result.current).toEqual({
      ...useFetchArgsDefaults,
      customOptions: {
        ...useFetchArgsDefaults.customOptions,
        url: 'https://example.com'
      },
      defaults: {
        loading: true,
        data: undefined
      },
      dependencies: [] // onMount === true
    })
  }


(): any =>
      useFetchArgs({
        url: 'https://example.com'
      }, [])


(): void => {
    const { result } = renderHook((): any => useFetchArgs(), { wrapper })
    expect(result.current).toStrictEqual({
      ...useFetchArgsDefaults,
      customOptions: {
        ...useFetchArgsDefaults.customOptions,
        url: 'https://example.com'
      }
    })
  }


(): any => useFetchArgs()


(): void => {
    const { result } = renderHook(
      (): any => useFetchArgs('https://cool.com', []), // onMount === true
      { wrapper }
    )
    expect(result.current).toStrictEqual({
      ...useFetchArgsDefaults,
      customOptions: {
        ...useFetchArgsDefaults.customOptions,
        url: 'https://cool.com'
      },
      defaults: {
        loading: true,
        data: undefined
      },
      dependencies: [] // onMount === true
    })
  }


(): any => useFetchArgs('https://cool.com', [])


(): void => {
    const { result } = renderHook(
      (): any => useFetchArgs({ data: [] }),
      { wrapper }
    )
    expect(result.current).toStrictEqual({
      ...useFetchArgsDefaults,
      customOptions: {
        ...useFetchArgsDefaults.customOptions,
        url: 'https://example.com'
      },
      defaults: {
        loading: false,
        data: []
      }
    })
  }


(): any => useFetchArgs({ data: [] })


(): void => {
    if (isServer) return

    const wrapper2 = ({ children }: { children?: ReactNode }): ReactElement => (
      <Provider>{children}</Provider>
    )

    const { result } = renderHook((): any => useFetchArgs(), { wrapper: wrapper2 })

    const expected = {
      ...useFetchArgsDefaults,
      customOptions: {
        ...useFetchArgsDefaults.customOptions,
        url: 'http://localhost'
      }
    }
    expect(result.current).toEqual(expected)
  }


({ children }: { children?: ReactNode }): ReactElement => (
      <Provider>{children}</Provider>
    )


async (): Promise<void> => {
    const interceptors = {
      request(options: any) {
        options.headers.Authorization = 'Bearer test'
        return options
      },
      response(response: any) {
        response.test = 'test'
        return response
      }
    }

    const wrapper2 = ({ children }: { children?: ReactNode }): ReactElement => (
      <Provider url='https://example.com' options={{ interceptors }}


({ children }: { children?: ReactNode }): ReactElement => (
      <Provider url='https://example.com'


async (): Promise<void> => {
    const interceptors = {
      request(options: any) {
        options.headers.Authorization = 'Bearer test'
        return options
      },
      response(response: any) {
        response.test = 'test'
        return response
      }
    }

    const { result } = renderHook((): any => useFetchArgs('https://example.com', { interceptors }))

    const { customOptions } = result.current
    const options = customOptions.interceptors.request({ headers: {} })
    expect(options.headers).toHaveProperty('Authorization')
    expect(options).toStrictEqual({
      headers: {
        Authorization: 'Bearer test'
      }
    })
    const response = customOptions.interceptors.response({})
    expect(response).toHaveProperty('test')
    expect(response).toEqual({ test: 'test' })
  }


(): any => useFetchArgs('https://example.com', { interceptors })


(): void => {
    const options = { headers: { 'Content-Type': 'application/text' } }
    const { result } = renderHook((): any => useFetchArgs(options), { wrapper })
    expect(result.current).toStrictEqual({
      ...useFetchArgsDefaults,
      customOptions: {
        ...useFetchArgsDefaults.customOptions,
        url: 'https://example.com'
      },
      requestInit: {
        ...options
      }
    })
  }


(): any => useFetchArgs(options)


(): void => {
    const options = { headers: { 'Content-Type': 'application/text' } }
    const wrapper = ({ children }: { children?: ReactNode }): ReactElement => (
      <Provider options={options}>{children}</Provider>


({ children }: { children?: ReactNode }): ReactElement => (
      <Provider options={options}>{children}</Provider>


(): void => {
    const options = {
      headers: {
        'Content-Type': 'application/text'
      }
    }
    const wrapper = ({ children }: { children?: ReactNode }): ReactElement => (
      <Provider options={options}>{children}</Provider>


(): any => useFetchArgs(overwriteProviderOptions)


(): void => {
  it('should error if no url string is set and no Provider is in place', (): void => {
    const { result } = renderHook((): any => useFetchArgs())
    expect(result.error.name).toBe('Invariant Violation')
    expect(result.error.message).toBe(
      'The first argument of useFetch is required unless you have a global url setup like: <Provider url="https://example.com"></Provider>'
    )
  })

  it('should error if 1st arg is object and no URL field is set in it', (): void => {
    const { result } = renderHook((): any => useFetchArgs({}))
    expect(result.error.name).toBe('Invariant Violation')
    expect(result.error.message).toBe(
      'The first argument of useFetch is required unless you have a global url setup like: <Provider url="https://example.com"></Provider>'
    )
  })

  it('should error if no URL is specified', (): void => {
    const { result } = renderHook((): any => useFetchArgs(''))
    expect(result.error.name).toBe('Invariant Violation')
    expect(result.error.message).toBe(
      'The first argument of useFetch is required unless you have a global url setup like: <Provider url="https://example.com"></Provider>'
    )
  })

  it('should error if 1st and 2nd arg are both objects', (): void => {
    const { result } = renderHook((): any => useFetchArgs({}, {}))
    expect(result.error.name).toBe('Invariant Violation')
    expect(result.error.message).toBe(
      'You cannot have a 2nd parameter of useFetch when your first argument is an object config.'
    )
  })

  // TODO
  it('should error if 1st and 2nd arg are both strings', (): void => {
    expect(typeof useFetchArgs).toBe('function')
    // const { result } = renderHook((): any => useFetchArgs('http://example.com', '?cool=sweet'))
    // expect(result.error.name).toBe('Invariant Violation')
    // expect(result.error.message).toBe('You cannot have a 2nd parameter of useFetch when your first argument is an object config.')
  })

  // TODO
  it('should error if 1st arg is object and 2nd arg is string', (): void => {
    expect(typeof useFetchArgs).toBe('function')
    // const { result } = renderHook((): any => useFetchArgs({}, '?cool=sweet'))
    // expect(result.error.name).toBe('Invariant Violation')
    // expect(result.error.message).toBe('You cannot have a 2nd parameter of useFetch when your first argument is an object config.')
  })
}


(): void => {
    const { result } = renderHook((): any => useFetchArgs())
    expect(result.error.name).toBe('Invariant Violation')
    expect(result.error.message).toBe(
      'The first argument of useFetch is required unless you have a global url setup like: <Provider url="https://example.com"></Provider>'
    )
  }


(): void => {
    const { result } = renderHook((): any => useFetchArgs({}))
    expect(result.error.name).toBe('Invariant Violation')
    expect(result.error.message).toBe(
      'The first argument of useFetch is required unless you have a global url setup like: <Provider url="https://example.com"></Provider>'
    )
  }


(): any => useFetchArgs({})


(): void => {
    const { result } = renderHook((): any => useFetchArgs(''))
    expect(result.error.name).toBe('Invariant Violation')
    expect(result.error.message).toBe(
      'The first argument of useFetch is required unless you have a global url setup like: <Provider url="https://example.com"></Provider>'
    )
  }


(): any => useFetchArgs('')


(): void => {
    const { result } = renderHook((): any => useFetchArgs({}, {}))
    expect(result.error.name).toBe('Invariant Violation')
    expect(result.error.message).toBe(
      'You cannot have a 2nd parameter of useFetch when your first argument is an object config.'
    )
  }


(): any => useFetchArgs({}, {})


(): void => {
    expect(typeof useFetchArgs).toBe('function')
    // const { result } = renderHook((): any => useFetchArgs('http://example.com', '?cool=sweet'))
    // expect(result.error.name).toBe('Invariant Violation')
    // expect(result.error.message).toBe('You cannot have a 2nd parameter of useFetch when your first argument is an object config.')
  }


(): void => {
    expect(typeof useFetchArgs).toBe('function')
    // const { result } = renderHook((): any => useFetchArgs({}, '?cool=sweet'))
    // expect(result.error.name).toBe('Invariant Violation')
    // expect(result.error.message).toBe('You cannot have a 2nd parameter of useFetch when your first argument is an object config.')
  }


request(options: any) {
        options.headers.Authorization = 'Bearer test'
        return options
      }


response(response: any) {
        response.test = 'test'
        return response
      }


() => {
  const history = useHistory();
  const { accessibilityRequestId } = useParams<{
    accessibilityRequestId: string;
  }>();
  const { loading, error, data } = useQuery<GetAccessibilityRequest>(
    GetAccessibilityRequestQuery,
    {
      variables: {
        id: accessibilityRequestId
      }
    }
  );

  const [s3URL, setS3URL] = useState('');
  const [
    generateURL,
    generateURLStatus
  ] = useMutation<GeneratePresignedUploadURL>(GeneratePresignedUploadURLQuery);
  const [createDocument, createDocumentStatus] = useMutation<
    CreateAccessibilityRequestDocument,
    CreateAccessibilityRequestDocumentVariables
  >(CreateAccessibilityRequestDocumentQuery);

  if (loading) {
    return
Loading
;
  }

  if (error) {
    return
{error.message}
;
  }

  if (!data) {
    return (

{`No request found matching id: ${accessibilityRequestId}`}


(event: React.ChangeEvent<HTMLInputElement>) => {
    const file = event?.currentTarget?.files?.[0];
    if (!file) {
      return;
    }
    generateURL({
      variables: {
        input: {
          fileName: file?.name,
          mimeType: file?.type,
          size: file?.size
        }
      }
    }).then(result => {
      const url = result.data?.generatePresignedUploadURL?.url;
      if (
        generateURLStatus.error ||
        result.data?.generatePresignedUploadURL?.userErrors ||
        isUndefined(url)
      ) {
        // eslint-disable-next-line
        console.error('Could not fetch presigned S3 URL');
      } else {
        setS3URL(url || '');
      }
    });
  }


result => {
      const url = result.data?.generatePresignedUploadURL?.url;
      if (
        generateURLStatus.error ||
        result.data?.generatePresignedUploadURL?.userErrors ||
        isUndefined(url)
      ) {
        // eslint-disable-next-line
        console.error('Could not fetch presigned S3 URL');
      } else {
        setS3URL(url || '');
      }
    }


(values: FileUploadForm) => {
    if (!values.file.name) {
      return;
    }

    const options = {
      headers: {
        'Content-Type': values.file.type
      }
    };

    axios.put(s3URL, values.file, options).then(() => {
      createDocument({
        variables: {
          input: {
            mimeType: values.file.type,
            size: values.file.size,
            name: values.file.name,
            url: s3URL,
            requestID: accessibilityRequestId,
            commonDocumentType: values.documentType
              .commonType as AccessibilityRequestDocumentCommonType,
            otherDocumentTypeDescription: values.documentType.otherType
          }
        }
      }).then(() => {
        history.push(`/508/requests/${accessibilityRequestId}`, {
          confirmationText: `${values.file.name} uploaded to ${data?.accessibilityRequest?.name}`
        });
      });
    });
  }


() => {
      createDocument({
        variables: {
          input: {
            mimeType: values.file.type,
            size: values.file.size,
            name: values.file.name,
            url: s3URL,
            requestID: accessibilityRequestId,
            commonDocumentType: values.documentType
              .commonType as AccessibilityRequestDocumentCommonType,
            otherDocumentTypeDescription: values.documentType.otherType
          }
        }
      }).then(() => {
        history.push(`/508/requests/${accessibilityRequestId}`, {
          confirmationText: `${values.file.name} uploaded to ${data?.accessibilityRequest?.name}`
        });
      });
    }


() => {
        history.push(`/508/requests/${accessibilityRequestId}`, {
          confirmationText: `${values.file.name} uploaded to ${data?.accessibilityRequest?.name}`
        });
      }


key => {
                    return (
                      <ErrorAlertMessage
                        key={`Error.${key}`}


commonType => {
                              return (
                                <Field
                                  key={`FileUpload-CommonType${commonType}`}


type of document


translateDocumentType(commonType)


translateDocumentType(
                              AccessibilityRequestDocumentCommonType


export class ConfigurationApi {

    static ConfigureXHR(xhrApi: IXHRApi) {
        XHRFactory.xhrHelper = xhrApi;
    }

    static SetXHROptions(fetchOptions: FetchOptions) {
        XHRDefault.defaultOptions = fetchOptions;
    }

    static ConfigurePromise(promise: PromiseConstructor) {
        ConfigurePromise(promise);
    }
}


static ConfigureXHR(xhrApi: IXHRApi) {
        XHRFactory.xhrHelper = xhrApi;
    }


static SetXHROptions(fetchOptions: FetchOptions) {
        XHRDefault.defaultOptions = fetchOptions;
    }


static ConfigurePromise(promise: PromiseConstructor) {
        ConfigurePromise(promise);
    }


({ ...rest }: IPasswordField): any => {
    const [passwordVisible, setPasswordVisible] = useState(false);

    const inputType = (): string => {
        if (passwordVisible) return "text";
        return "password";
    };

    return (
        <div className="react-simple-widget password-field">
            <TextField
                {...rest}
                type={inputType()}
                trailing={
                    <button type="button" className="toggle-btn">
                        <img
                            alt="Visibility"
                            src={passwordVisible ? HiddenIcon : VisibleIcon}
                            onClick={(): void


(): string => {
        if (passwordVisible) return "text";
        return "password";
    }


inputType()


class SparseMatrix {
    public rows: number;
    public columns: number;
    public constructor(rows: SparseMatrix);

    public constructor(
      rows: number,
      columns: number,
      options?: Partial<OptionsContructor>,
    );

    public constructor(rows: number[][], columns: Partial<OptionsContructor>);

    public forEachNonZero(
      callback: (i: number, j: number, v: number) => void,
    ): this;

    public static eye(rows: number, columns?: number): SparseMatrix;

    public kroneckerProduct(other: SparseMatrix): SparseMatrix;
    public add(other: SparseMatrix): SparseMatrix;
    public mul(other: number): SparseMatrix;
    public mmul(other: SparseMatrix): SparseMatrix;
    public get(rowIndex: number, columnIndex: number): number;
    public set(rowIndex: number, columnIndex: number, value: number): this;
    public clone(): SparseMatrix;
  }


interface OptionsContructor {
    threshold: number;
    minLoadFactor: number;
    maxLoadFactor: number;
    distinct: number;
    freeEntries: number;
    lowWaterMark: number;
    initialCapacity: number;
  }


public forEachNonZero(
      callback: (i: number, j: number, v: number) => void,
    ): this;


public static eye(rows: number, columns?: number): SparseMatrix;


public kroneckerProduct(other: SparseMatrix): SparseMatrix;


public add(other: SparseMatrix): SparseMatrix;


public mul(other: number): SparseMatrix;


public mmul(other: SparseMatrix): SparseMatrix;


public get(rowIndex: number, columnIndex: number): number;


public set(rowIndex: number, columnIndex: number, value: number): this;


public clone(): SparseMatrix;


export interface TodoActions {
  action: TodoActionsType;
  data: TodoDto;
}


export type TodosFilter = 'ALL' | 'DONE' | 'ACTIVE';


export type TodoActionsType = 'delete' | 'update';


export function playlistSearchDirective() {
  return {
    restrict: 'E',
    templateUrl: 'public/app/features/playlist/partials/playlist_search.html',
    controller: PlaylistSearchCtrl,
    bindToController: true,
    controllerAs: 'ctrl',
    scope: {
      searchStarted: '&',
    },
  };
}


() => {
      this.query.query = '';
      this.query.type = 'dash-db';
      this.searchDashboards();
    }


result => {
      return {
        dashboardResult: result,
        tagResult: [],
      };
    }


result => {
      return {
        dashboardResult: [],
        tagResult: result,
      };
    }


export class PlaylistSearchCtrl {
  query: any;
  tagsMode: boolean;

  searchStarted: any;

  /** @ngInject */
  constructor($timeout, private backendSrv) {
    this.query = { query: '', tag: [], starred: false, limit: 20 };

    $timeout(() => {
      this.query.query = '';
      this.query.type = 'dash-db';
      this.searchDashboards();
    }, 100);
  }

  searchDashboards() {
    this.tagsMode = false;
    const prom: any = {};

    prom.promise = this.backendSrv.search(this.query).then(result => {
      return {
        dashboardResult: result,
        tagResult: [],
      };
    });

    this.searchStarted(prom);
  }

  showStarred() {
    this.query.starred = !this.query.starred;
    this.searchDashboards();
  }

  queryHasNoFilters() {
    return this.query.query === '' && this.query.starred === false && this.query.tag.length === 0;
  }

  filterByTag(tag, evt) {
    this.query.tag.push(tag);
    this.searchDashboards();
    if (evt) {
      evt.stopPropagation();
      evt.preventDefault();
    }
  }

  getTags() {
    const prom: any = {};
    prom.promise = this.backendSrv.get('/api/dashboards/tags').then(result => {
      return {
        dashboardResult: [],
        tagResult: result,
      };
    });

    this.searchStarted(prom);
  }
}


searchDashboards() {
    this.tagsMode = false;
    const prom: any = {};

    prom.promise = this.backendSrv.search(this.query).then(result => {
      return {
        dashboardResult: result,
        tagResult: [],
      };
    });

    this.searchStarted(prom);
  }


showStarred() {
    this.query.starred = !this.query.starred;
    this.searchDashboards();
  }


queryHasNoFilters() {
    return this.query.query === '' && this.query.starred === false && this.query.tag.length === 0;
  }


filterByTag(tag, evt) {
    this.query.tag.push(tag);
    this.searchDashboards();
    if (evt) {
      evt.stopPropagation();
      evt.preventDefault();
    }
  }


getTags() {
    const prom: any = {};
    prom.promise = this.backendSrv.get('/api/dashboards/tags').then(result => {
      return {
        dashboardResult: [],
        tagResult: result,
      };
    });

    this.searchStarted(prom);
  }


response => {
          const testsuites: Testsuite[] = new Array();
          response.forEach(element => {
            testsuites.push(TestsuiteService.mapResponseToTestsuite(element));
          });
          return testsuites;
        }


element => {
            testsuites.push(TestsuiteService.mapResponseToTestsuite(element));
          }


response =>
          TestsuiteService.mapResponseToTestsuite(response)


@Injectable({
  providedIn: 'root'
})

export class TestsuiteService {

  readonly baseUrl = this.configurationService.getBaseUrl();

  static mapResponseToTestsuite(response: TestsuiteData): Testsuite {
    const testsuite = new Testsuite();
    testsuite.id = response.testSuite.id;
    testsuite.name = response.testSuite.name;
    switch (response.lastRunResult) {
      case 'PASSED':
        testsuite.lastRunResult = Result.SUCCESSFUL;
        break;
      case 'UNKNOWN':
        testsuite.lastRunResult = Result.UNKNOWN;
        break;
      case 'FAILED':
        testsuite.lastRunResult = Result.FAILED;
        break;
    }
    return testsuite;
  }

  constructor(private httpClient: HttpClient,
              private configurationService: ConfigurationService) {
  }

  getTestsuites(): Observable<Testsuite[]> {
    return this.httpClient.get<TestsuiteData[]>(this.baseUrl + '/testsuites/')
      .pipe(
        map(response => {
          const testsuites: Testsuite[] = new Array();
          response.forEach(element => {
            testsuites.push(TestsuiteService.mapResponseToTestsuite(element));
          });
          return testsuites;
        }));
  }

  getTestsuite(testsuiteId: string): Observable<Testsuite> {
    return this.httpClient.get<TestsuiteData>(this.baseUrl + '/testsuites/' + testsuiteId)
      .pipe(
        map(response =>
          TestsuiteService.mapResponseToTestsuite(response)
        ));
  }

  createTestsuite(testsuiteName: string): Observable<Testsuite> {
    const body = {name: testsuiteName};
    const httpOptions = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json'
      })
    };
    return this.httpClient.post<Testsuite>(this.baseUrl + '/testsuites', body, httpOptions);
  }
}


static mapResponseToTestsuite(response: TestsuiteData): Testsuite {
    const testsuite = new Testsuite();
    testsuite.id = response.testSuite.id;
    testsuite.name = response.testSuite.name;
    switch (response.lastRunResult) {
      case 'PASSED':
        testsuite.lastRunResult = Result.SUCCESSFUL;
        break;
      case 'UNKNOWN':
        testsuite.lastRunResult = Result.UNKNOWN;
        break;
      case 'FAILED':
        testsuite.lastRunResult = Result.FAILED;
        break;
    }
    return testsuite;
  }


getTestsuites(): Observable<Testsuite[]> {
    return this.httpClient.get<TestsuiteData[]>(this.baseUrl + '/testsuites/')
      .pipe(
        map(response => {
          const testsuites: Testsuite[] = new Array();
          response.forEach(element => {
            testsuites.push(TestsuiteService.mapResponseToTestsuite(element));
          });
          return testsuites;
        }));
  }


getTestsuite(testsuiteId: string): Observable<Testsuite> {
    return this.httpClient.get<TestsuiteData>(this.baseUrl + '/testsuites/' + testsuiteId)
      .pipe(
        map(response =>
          TestsuiteService.mapResponseToTestsuite(response)
        ));
  }


createTestsuite(testsuiteName: string): Observable<Testsuite> {
    const body = {name: testsuiteName};
    const httpOptions = {
      headers: new HttpHeaders({
        'Content-Type': 'application/json'
      })
    };
    return this.httpClient.post<Testsuite>(this.baseUrl + '/testsuites', body, httpOptions);
  }


@NgModule({
  imports: [
    CommonModule
  ],
  declarations: [],
  providers: [
    DataService,
    MessageService
  ]
})
export class CoreModule {

  // Prevent reimport of this module
  constructor (@Optional() @SkipSelf() currentModule: CoreModule) {
    if (currentModule) {
      throw new Error(
        'CoreModule is already loaded. Add it to the Imports array of the AppModule only');
    }
  }
}


/**
 * Registers tests for the {@link YAMLResourceHandler `YAMLResourceHandler`} class.
 */
export function YAMLResourceHandlerTests(): void
{
    suite(
        nameof(YAMLResourceHandler),
        () =>
        {
            let fileHandler: IResourceFileHandler;
            let ymlFile: TempFile;
            let yamlFile: TempFile;
            let jsonFile: TempFile;

            suiteSetup(
                () =>
                {
                    fileHandler = new YAMLResourceHandler();

                    ymlFile = new TempFile(
                        {
                            Suffix: random(".yml")
                        });

                    yamlFile = new TempFile(
                        {
                            Suffix: random(".yaml")
                        });

                    jsonFile = new TempFile(
                        {
                            Suffix: random(".json")
                        });
                });

            suiteTeardown(
                () =>
                {
                    ymlFile.Dispose();
                    yamlFile.Dispose();
                    jsonFile.Dispose();
                });

            suite(
                nameof<YAMLResourceHandler>((handler) => handler.CheckApplicability),
                () =>
                {
                    test(
                        "Checking whether files are classified correctly…",
                        () =>
                        {
                            strictEqual(fileHandler.CheckApplicability(ymlFile.FullName), true);
                            strictEqual(fileHandler.CheckApplicability(yamlFile.FullName), true);
                            strictEqual(fileHandler.CheckApplicability(jsonFile.FullName), false);
                        });
                });

            suite(
                nameof<YAMLResourceHandler>((handler) => handler.Create),
                () =>
                {
                    test(
                        "Checking whether the created resources have the correct type…",
                        () =>
                        {
                            strictEqual(fileHandler.Create(ymlFile.FullName) instanceof YAMLResource, true);
                        });
                });
        });
}


() =>
        {
            let fileHandler: IResourceFileHandler;
            let ymlFile: TempFile;
            let yamlFile: TempFile;
            let jsonFile: TempFile;

            suiteSetup(
                () =>
                {
                    fileHandler = new YAMLResourceHandler();

                    ymlFile = new TempFile(
                        {
                            Suffix: random(".yml")
                        });

                    yamlFile = new TempFile(
                        {
                            Suffix: random(".yaml")
                        });

                    jsonFile = new TempFile(
                        {
                            Suffix: random(".json")
                        });
                });

            suiteTeardown(
                () =>
                {
                    ymlFile.Dispose();
                    yamlFile.Dispose();
                    jsonFile.Dispose();
                });

            suite(
                nameof<YAMLResourceHandler>((handler) => handler.CheckApplicability),
                () =>
                {
                    test(
                        "Checking whether files are classified correctly…",
                        () =>
                        {
                            strictEqual(fileHandler.CheckApplicability(ymlFile.FullName), true);
                            strictEqual(fileHandler.CheckApplicability(yamlFile.FullName), true);
                            strictEqual(fileHandler.CheckApplicability(jsonFile.FullName), false);
                        });
                });

            suite(
                nameof<YAMLResourceHandler>((handler) => handler.Create),
                () =>
                {
                    test(
                        "Checking whether the created resources have the correct type…",
                        () =>
                        {
                            strictEqual(fileHandler.Create(ymlFile.FullName) instanceof YAMLResource, true);
                        });
                });
        }


() =>
                {
                    fileHandler = new YAMLResourceHandler();

                    ymlFile = new TempFile(
                        {
                            Suffix: random(".yml")
                        });

                    yamlFile = new TempFile(
                        {
                            Suffix: random(".yaml")
                        });

                    jsonFile = new TempFile(
                        {
                            Suffix: random(".json")
                        });
                }


() =>
                {
                    ymlFile.Dispose();
                    yamlFile.Dispose();
                    jsonFile.Dispose();
                }


(handler) => handler.CheckApplicability


() =>
                {
                    test(
                        "Checking whether files are classified correctly…",
                        () =>
                        {
                            strictEqual(fileHandler.CheckApplicability(ymlFile.FullName), true);
                            strictEqual(fileHandler.CheckApplicability(yamlFile.FullName), true);
                            strictEqual(fileHandler.CheckApplicability(jsonFile.FullName), false);
                        });
                }


() =>
                        {
                            strictEqual(fileHandler.CheckApplicability(ymlFile.FullName), true);
                            strictEqual(fileHandler.CheckApplicability(yamlFile.FullName), true);
                            strictEqual(fileHandler.CheckApplicability(jsonFile.FullName), false);
                        }


(handler) => handler.Create


() =>
                {
                    test(
                        "Checking whether the created resources have the correct type…",
                        () =>
                        {
                            strictEqual(fileHandler.Create(ymlFile.FullName) instanceof YAMLResource, true);
                        });
                }


() =>
                        {
                            strictEqual(fileHandler.Create(ymlFile.FullName) instanceof YAMLResource, true);
                        }


export class DefaultHasManyRepository<
  TargetEntity extends Entity,
  TargetID,
  TargetRepository extends EntityCrudRepository<TargetEntity, TargetID>
> implements HasManyRepository<TargetEntity> {
  /**
   * Constructor of DefaultHasManyEntityCrudRepository
   * @param getTargetRepository the getter of the related target model repository instance
   * @param constraint the key value pair representing foreign key name to constrain
   * the target repository instance
   */
  constructor(
    public getTargetRepository: Getter<TargetRepository>,
    public constraint: DataObject<TargetEntity>,
  ) {}

  async create(
    targetModelData: DataObject<TargetEntity>,
    options?: Options,
  ): Promise<TargetEntity> {
    const targetRepository = await this.getTargetRepository();
    return targetRepository.create(
      constrainDataObject(targetModelData, this.constraint),
      options,
    );
  }

  async find(
    filter?: Filter<TargetEntity>,
    options?: Options,
  ): Promise<TargetEntity[]> {
    const targetRepository = await this.getTargetRepository();
    return targetRepository.find(
      constrainFilter(filter, this.constraint),
      options,
    );
  }

  async delete(where?: Where<TargetEntity>, options?: Options): Promise<Count> {
    const targetRepository = await this.getTargetRepository();
    return targetRepository.deleteAll(
      constrainWhere(where, this.constraint as Where<TargetEntity>),
      options,
    );
  }

  async patch(
    dataObject: DataObject<TargetEntity>,
    where?: Where<TargetEntity>,
    options?: Options,
  ): Promise<Count> {
    const targetRepository = await this.getTargetRepository();
    return targetRepository.updateAll(
      constrainDataObject(dataObject, this.constraint),
      constrainWhere(where, this.constraint as Where<TargetEntity>),
      options,
    );
  }
}


/**
 * CRUD operations for a target repository of a HasMany relation
 */
export interface HasManyRepository<Target extends Entity> {
  /**
   * Create a target model instance
   * @param targetModelData The target model data
   * @param options Options for the operation
   * @returns A promise which resolves to the newly created target model instance
   */
  create(
    targetModelData: DataObject<Target>,
    options?: Options,
  ): Promise<Target>;
  /**
   * Find target model instance(s)
   * @param filter A filter object for where, order, limit, etc.
   * @param options Options for the operation
   * @returns A promise which resolves with the found target instance(s)
   */
  find(filter?: Filter<Target>, options?: Options): Promise<Target[]>;
  /**
   * Delete multiple target model instances
   * @param where Instances within the where scope are deleted
   * @param options
   * @returns A promise which resolves the deleted target model instances
   */
  delete(where?: Where<Target>, options?: Options): Promise<Count>;
  /**
   * Patch multiple target model instances
   * @param dataObject The fields and their new values to patch
   * @param where Instances within the where scope are patched
   * @param options
   * @returns A promise which resolves the patched target model instances
   */
  patch(
    dataObject: DataObject<Target>,
    where?: Where<Target>,
    options?: Options,
  ): Promise<Count>;
}


async create(
    targetModelData: DataObject<TargetEntity>,
    options?: Options,
  ): Promise<TargetEntity> {
    const targetRepository = await this.getTargetRepository();
    return targetRepository.create(
      constrainDataObject(targetModelData, this.constraint),
      options,
    );
  }


async find(
    filter?: Filter<TargetEntity>,
    options?: Options,
  ): Promise<TargetEntity[]> {
    const targetRepository = await this.getTargetRepository();
    return targetRepository.find(
      constrainFilter(filter, this.constraint),
      options,
    );
  }


async delete(where?: Where<TargetEntity>, options?: Options): Promise<Count> {
    const targetRepository = await this.getTargetRepository();
    return targetRepository.deleteAll(
      constrainWhere(where, this.constraint as Where<TargetEntity>),
      options,
    );
  }


async patch(
    dataObject: DataObject<TargetEntity>,
    where?: Where<TargetEntity>,
    options?: Options,
  ): Promise<Count> {
    const targetRepository = await this.getTargetRepository();
    return targetRepository.updateAll(
      constrainDataObject(dataObject, this.constraint),
      constrainWhere(where, this.constraint as Where<TargetEntity>),
      options,
    );
  }


@Component({
  selector: 'app-extend-component',
  templateUrl: './extend-component.component.html',
  styleUrls: ['./extend-component.component.css']
})
export class ExtendComponentComponent {
    @Input() extendedMessage?: string;
    @Input() extendedData?: BaseData;
    @Input() enumData?: EnumData;
}


/**
 * The set of arguments for constructing a Endpoint resource.
 */
export interface EndpointArgs {
    /**
     * List of content types on which compression applies. The value should be a valid MIME type.
     */
    readonly contentTypesToCompress?: pulumi.Input<pulumi.Input<string>[]>;
    /**
     * A policy that specifies the delivery rules to be used for an endpoint.
     */
    readonly deliveryPolicy?: pulumi.Input<inputs.cdn.v20190415.EndpointPropertiesUpdateParametersDeliveryPolicyArgs>;
    /**
     * Name of the endpoint under the profile which is unique globally.
     */
    readonly endpointName?: pulumi.Input<string>;
    /**
     * List of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an access rule to a specified path or content, e.g. block APAC for path /pictures/
     */
    readonly geoFilters?: pulumi.Input<pulumi.Input<inputs.cdn.v20190415.GeoFilterArgs>[]>;
    /**
     * Indicates whether content compression is enabled on CDN. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB.
     */
    readonly isCompressionEnabled?: pulumi.Input<boolean>;
    /**
     * Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed.
     */
    readonly isHttpAllowed?: pulumi.Input<boolean>;
    /**
     * Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed.
     */
    readonly isHttpsAllowed?: pulumi.Input<boolean>;
    /**
     * Resource location.
     */
    readonly location?: pulumi.Input<string>;
    /**
     * Specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven optimization.
     */
    readonly optimizationType?: pulumi.Input<string | enums.cdn.v20190415.OptimizationType>;
    /**
     * The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default.
     */
    readonly originHostHeader?: pulumi.Input<string>;
    /**
     * A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath.
     */
    readonly originPath?: pulumi.Input<string>;
    /**
     * The source of the content being delivered via CDN.
     */
    readonly origins: pulumi.Input<pulumi.Input<inputs.cdn.v20190415.DeepCreatedOriginArgs>[]>;
    /**
     * Path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path.
     */
    readonly probePath?: pulumi.Input<string>;
    /**
     * Name of the CDN profile which is unique within the resource group.
     */
    readonly profileName: pulumi.Input<string>;
    /**
     * Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL.
     */
    readonly queryStringCachingBehavior?: pulumi.Input<enums.cdn.v20190415.QueryStringCachingBehavior>;
    /**
     * Name of the Resource group within the Azure subscription.
     */
    readonly resourceGroupName: pulumi.Input<string>;
    /**
     * Resource tags.
     */
    readonly tags?: pulumi.Input<{[key: string]: pulumi.Input<string>}>;
}


/**
     * Get an existing Endpoint 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): Endpoint {
        return new Endpoint(name, undefined as any, { ...opts, id: id });
    }


/**
     * Returns true if the given object is an instance of Endpoint.  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 Endpoint {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === Endpoint.__pulumiType;
    }


export class CreateAttendeeDto {
    @IsEnum(AttendeeAnswerEnum)
    answer: AttendeeAnswerEnum;
  }


export class UpdateComputeEnvironmentCommand
  implements
    __aws_sdk_types.Command<
      InputTypesUnion,
      UpdateComputeEnvironmentInput,
      OutputTypesUnion,
      UpdateComputeEnvironmentOutput,
      BatchResolvedConfiguration,
      _stream.Readable
    > {
  readonly model = UpdateComputeEnvironment;
  readonly middlewareStack = new __aws_sdk_middleware_stack.MiddlewareStack<
    UpdateComputeEnvironmentInput,
    UpdateComputeEnvironmentOutput,
    _stream.Readable
  >();

  constructor(readonly input: UpdateComputeEnvironmentInput) {}

  resolveMiddleware(
    clientStack: __aws_sdk_middleware_stack.MiddlewareStack<
      InputTypesUnion,
      OutputTypesUnion,
      _stream.Readable
    >,
    configuration: BatchResolvedConfiguration
  ): __aws_sdk_types.Handler<
    UpdateComputeEnvironmentInput,
    UpdateComputeEnvironmentOutput
  > {
    const { handler } = configuration;
    const stack = clientStack.concat(this.middlewareStack);

    const handlerExecutionContext: __aws_sdk_types.HandlerExecutionContext = {
      logger: {} as any,
      model: this.model
    };

    return stack.resolve(
      handler<UpdateComputeEnvironmentInput, UpdateComputeEnvironmentOutput>(
        handlerExecutionContext
      ),
      handlerExecutionContext
    );
  }
}


resolveMiddleware(
    clientStack: __aws_sdk_middleware_stack.MiddlewareStack<
      InputTypesUnion,
      OutputTypesUnion,
      _stream.Readable
    >,
    configuration: BatchResolvedConfiguration
  ): __aws_sdk_types.Handler<
    UpdateComputeEnvironmentInput,
    UpdateComputeEnvironmentOutput
  > {
    const { handler } = configuration;
    const stack = clientStack.concat(this.middlewareStack);

    const handlerExecutionContext: __aws_sdk_types.HandlerExecutionContext = {
      logger: {} as any,
      model: this.model
    };

    return stack.resolve(
      handler<UpdateComputeEnvironmentInput, UpdateComputeEnvironmentOutput>(
        handlerExecutionContext
      ),
      handlerExecutionContext
    );
  }


export function IsDev() {
  return process.env.NODE_ENV === 'development';
}


resultArray => this._articlesArray = resultArray


error => console.log('Error :: ' + error)


@Component({
  selector: 'app-about',
  templateUrl: './about.component.html',
  styleUrls: ['./about.component.scss'],
  providers: [ArticlesService]
})
export class AboutComponent implements OnInit {
  title = "Arya's portfolio :: eTechBuddy";
  _articlesArray: Articles[];

  constructor(private titleService: Title, private articlesSerivce: ArticlesService) { }

  getArticles(): void{
	this.articlesSerivce.getArticles()
	  .subscribe(
		resultArray => this._articlesArray = resultArray,
		error => console.log('Error :: ' + error)
	  )
  }

  ngOnInit() {
	  this.titleService.setTitle(this.title);
	  this.getArticles();
  }
}


getArticles(): void{
	this.articlesSerivce.getArticles()
	  .subscribe(
		resultArray => this._articlesArray = resultArray,
		error => console.log('Error :: ' + error)
	  )
  }


ngOnInit() {
	  this.titleService.setTitle(this.title);
	  this.getArticles();
  }


export function Embedded(options: EmbeddedOptions | (() => AnyEntity) = {}) {
  return function (target: AnyEntity, propertyName: string) {
    const meta = MetadataStorage.getMetadataFromDecorator(target.constructor);
    MetadataValidator.validateSingleDecorator(meta, propertyName, ReferenceType.EMBEDDED);
    options = options instanceof Function ? { entity: options } : options;
    Utils.defaultValue(options, 'prefix', true);
    const property = { name: propertyName, reference: ReferenceType.EMBEDDED } as EntityProperty;
    meta.properties[propertyName] = Object.assign(property, options);
  };
}


export type EmbeddedOptions = {
  entity?: string | (() => AnyEntity);
  type?: string;
  prefix?: string | boolean;
  nullable?: boolean;
};


() => {
      cb(null, 'baz');
    }


export class RemoteService {
  getValue(cb: (err: Error, val: string) => void) {
    setTimeout(() => {
      cb(null, 'baz');
    }, 250);
  }
}


export interface SomeService {
    foo(): void;
}


export interface OtherService {
    bar(): boolean;
}


getValue(cb: (err: Error, val: string) => void) {
    setTimeout(() => {
      cb(null, 'baz');
    }, 250);
  }


structure => {
        let result: boolean = true;
        if (structure.structureType === STRUCTURE_CONTAINER && _.sum(structure.store) < structure.storeCapacity) {
          structure.pos.look();
          for (const node of this.nodeReference) {
            if (node.harvesterPosition.x === structure.pos.x && node.harvesterPosition.y === structure.pos.y) {
              result = false;
              break;
            }
          }
        } else if (
          (structure.structureType === STRUCTURE_EXTENSION ||
            structure.structureType === STRUCTURE_SPAWN ||
            structure.structureType === STRUCTURE_TOWER) &&
          structure.energy < structure.energyCapacity
        ) {
          result = true;
        } else {
          result = false;
        }
        return result;
      }


public run() {
    this.initMemory();

    const room = Game.rooms[this.rm.getRoomName()];

    const energyNodes = this.getEnergyNodes();

    const creeps: Creep[] = this.gr.utilities.getCreepsByRole(room.name, this.roleName);
    const gatherers: Creep[] = this.gr.utilities.filterCreepsByMemoryProperty(creeps, 'resourceSubRole', 'GATHERER');
    const haulers: Creep[] = this.gr.utilities.filterCreepsByMemoryProperty(creeps, 'resourceSubRole', 'HAULER');
    const queuedCreeps: SpawnRequest[] = this.gr.spawnManager.getQueuedSpawnRequests(this.roleName, room.name);

    this.report(energyNodes, gatherers, haulers, queuedCreeps);

    if (this.rm.activeRoom.energyAvailable >= 1200) {
      if (energyNodes && energyNodes.length * 2 + 1 > queuedCreeps.length + gatherers.length + haulers.length) {
        this.handleCreateSpawnRequest(energyNodes, queuedCreeps, haulers, gatherers);
      }
    }

    for (const creepName in creeps) {
      const creep: Creep = creeps[creepName];

      if ((creep.memory as any).job === 'Idle') {
        let assignedJob = false;

        for (const node of this.nodeReference) {
          if ((creep.memory as any).resourceSubRole === 'GATHERER' && node.gathererId == null) {
            this.assignGathererSubRole(creep, node, room);
            assignedJob = true;
            break;
          } else if ((creep.memory as any).resourceSubRole === 'HAULER' && node.haulerId == null) {
            this.assignHaulerSubRole(creep, node, room);
            assignedJob = true;
            break;
          }
        }

        // the extra energy hauler
        if (!assignedJob) {
          this.assignExcessHaulerSubRole(creep, room);
        }
      } else {
        // if it's not idle then update the node it's working on
        this.refreshNode(creep);
      }
    }

    // save back anything that was updated...
    Memory['RESOURCE_TRACKER'][room.name] = this.nodeReference;

    if (this.gr.memoryManager.reportFlag) {
      console.log(` completed : ${Game.cpu.getUsed()}`);
    }
  }


private report(energyNodes: any, gatherers: Creep[], haulers: Creep[], queuedCreeps: SpawnRequest[]) {
    if (this.gr.memoryManager.reportFlag) {
      console.log(' ResourceManager Report');
      console.log(`  Resource Nodes: ${energyNodes ? energyNodes.length : 0}`);
      console.log(`  Gatherers: ${gatherers.length ? gatherers.length : 0}`);
      console.log(`  Haulers: ${haulers.length ? haulers.length : 0}`);
      console.log(`  Queued: ${queuedCreeps.length ? queuedCreeps.length : 0}`);

      this.updateNodes();
    }
  }


/// SubRole
private assignGathererSubRole(creep: Creep, node: any, room: Room) {
    (creep.memory as any).job = 'Harvest';
    (creep.memory as any).jobMisc = {
      pos: {
        x: node.harvesterPosition.x,
        y: node.harvesterPosition.y
      }
    };

    (creep.memory as any).jobTargetIds = [room.lookForAt(LOOK_SOURCES, node.pos.x, node.pos.y)[0].id];

    creep.say('Gathering!');

    node.gathererId = creep.id;
  }


private assignHaulerSubRole(creep: Creep, node: any, room: Room) {
    const structures: Structure[] = room.lookForAt(LOOK_STRUCTURES, node.harvesterPosition.x, node.harvesterPosition.y);

    let structureId = null;
    if (structures.length === 1) {
      structureId = structures[0].id;
    } else {
      for (const structure of structures) {
        if (structure.structureType === STRUCTURE_CONTAINER) {
          structureId = structure.id;
          break;
        }
      }
    }

    if (structureId == null) {
      console.log('No container found for source...');
      return;
    }

    (creep.memory as any).job = 'ResourceTransfer';

    (creep.memory as any).jobMisc = {
      resourceType: RESOURCE_ENERGY,
      repeat: true,

      resourceId: node.resourceId
    };

    if (room.storage) {
      (creep.memory as any).jobTargetIds = [structureId, room.storage.id];
    } else {
      throw new Error('No Storage In Room - Need to code alternative');
    }

    creep.say('Hauling!');

    node.haulerId = creep.id;
  }


private assignExcessHaulerSubRole(creep: Creep, room: Room) {
    // find empty containers to fill with energy
    const container: Structure = creep.pos.findClosestByPath(FIND_STRUCTURES, {
      filter: structure => {
        let result: boolean = true;
        if (structure.structureType === STRUCTURE_CONTAINER && _.sum(structure.store) < structure.storeCapacity) {
          structure.pos.look();
          for (const node of this.nodeReference) {
            if (node.harvesterPosition.x === structure.pos.x && node.harvesterPosition.y === structure.pos.y) {
              result = false;
              break;
            }
          }
        } else if (
          (structure.structureType === STRUCTURE_EXTENSION ||
            structure.structureType === STRUCTURE_SPAWN ||
            structure.structureType === STRUCTURE_TOWER) &&
          structure.energy < structure.energyCapacity
        ) {
          result = true;
        } else {
          result = false;
        }
        return result;
      }
    }) as Structure;

    if (room.storage && container) {
      this.setupHaulerJob(creep, room, room.storage.id, container.id, false, null);
    }
    // move energy from storage to the container
  }


/// Utilities
private setupHaulerJob(creep: Creep, room: Room, sourceStructureId: string, targetStructureId: string, repeatJob: boolean, node?: any) {
    (creep.memory as any).job = 'ResourceTransfer';

    (creep.memory as any).jobMisc = {
      resourceType: RESOURCE_ENERGY,
      repeat: repeatJob,
      resourceId: node ? node.resourceId : null
    };

    if (room.storage) {
      (creep.memory as any).jobTargetIds = [sourceStructureId, targetStructureId];
    } else {
      throw new Error('No Storage In Room - Need to code alternative');
    }

    creep.say('Hauling!');
  }


// should prob be a utility
private generateBodyParts(type: string): BodyPartConstant[] {
    // @ts-ignore
    const room: Room = Game.rooms[this.rm.getRoomName()];

    // @ts-ignore
    let resultParts: BodyPartConstant[] = null;

    if (type === 'HAULER') {
      resultParts = this.getOptimalBodyHauler(room.energyAvailable);
    }

    if (type === 'GATHERER') {
      resultParts = this.getOptimalBodyHauler(room.energyAvailable);
    }

    return resultParts;
  }


private refreshNode(creep: Creep) {
    for (const node of this.nodeReference) {
      // @ts-ignore
      if (creep.memory.resourceSubRole === 'GATHERER' && creep.memory.jobTargetIds[0] === node.resourceId) {
        // @ts-ignore
        node.gathererId = creep.id;
      }

      // @ts-ignore
      if (creep.memory.resourceSubRole === 'HAULER' && creep.memory.jobMisc.resourceId === node.resourceId) {
        // @ts-ignore
        node.haulerId = creep.id;
      }
    }
  }


private updateNodes() {
    const room = Game.rooms[this.rm.getRoomName()];

    if (this.nodeReference) {
      for (const node of this.nodeReference) {
        // @ts-ignore
        node.gathererId = null;
        // @ts-ignore
        node.haulerId = null;
      }
    }
  }


private handleCreateSpawnRequest(energyNodes: any, queuedCreeps: SpawnRequest[], haulers: Creep[], gatherers: Creep[]) {
    // we need to spawn something...

    let haulersQueued = 0;
    let gathersQueued = 0;

    for (const queuedCreep of queuedCreeps) {
      if (queuedCreep.memoryProperties.resourceSubRole === 'GATHERER') {
        gathersQueued++;
      } else {
        haulersQueued++;
      }
    }

    const haulersToSpawn = 1 + energyNodes.length - (haulersQueued + haulers.length);
    const gatheresToSpawn = energyNodes.length - (gathersQueued + gatherers.length);

    const haulerBodyParts = this.getOptimalBodyHauler(1300);

    for (let i = 0; i < haulersToSpawn; i++) {
      // @ts-ignore
      this.gr.spawnManager.createSpawnRequest({
        bodyParts: haulerBodyParts,
        priority: 1,
        role: this.roleName,
        roomName: this.rm.getRoomName(),
        energyRequirements: this.gr.utilities.calculateBodyEnergyRequirements(haulerBodyParts),
        memoryProperties: { resourceSubRole: 'HAULER' }
      });
    }

    const gathererBodyParts = this.getOptimalBodyGatherer(1300);

    for (let i = 0; i < gatheresToSpawn; i++) {
      // @ts-ignore
      this.gr.spawnManager.createSpawnRequest({
        bodyParts: gathererBodyParts,
        priority: 1,
        role: this.roleName,
        roomName: this.rm.getRoomName(),
        energyRequirements: this.gr.utilities.calculateBodyEnergyRequirements(gathererBodyParts),
        memoryProperties: { resourceSubRole: 'GATHERER' }
      });
    }
  }


private getEnergyNodes() {

    // @ts-ignore
    const roomInfo = this.gr.memoryManager.staticInfoTracker.rooms[this.rm.getRoomName()];

    if (roomInfo) {
      const energyNodes = [];
      for (const pointOfInterest of roomInfo.pointsOfInterest) {
        if (pointOfInterest.type === 'Energy Node') {
          energyNodes.push(pointOfInterest);
        }
      }
      return energyNodes;
    }

    return null;
  }


private getOptimalBodyGatherer(energy: number): BodyPartConstant[] {
    let bodyParts: BodyPartConstant[] = [];

    if (energy > 300) {
      const carryCount = 1;
      const workCount = Math.floor(energy / 150);
      const moveCount = 2 + Math.floor(energy / 250);

      this.addBodyParts(bodyParts, carryCount, CARRY);
      this.addBodyParts(bodyParts, workCount > 5 ? 5 : workCount, WORK);
      this.addBodyParts(bodyParts, moveCount, MOVE);
    } else {
      bodyParts = [WORK, WORK, MOVE, CARRY];
    }

    return bodyParts;
  }


private getOptimalBodyHauler(energy: number): BodyPartConstant[] {
    let bodyParts: BodyPartConstant[] = [];

    if (energy > 300) {
      const carryCount = 0 + Math.floor(energy / 80);
      const workCount = 0 + Math.floor(energy / 1400);
      const moveCount = 1 + Math.floor(energy / 165);

      console.log('Carry count... ' + carryCount);

      this.addBodyParts(bodyParts, carryCount, CARRY);
      this.addBodyParts(bodyParts, workCount, WORK);
      this.addBodyParts(bodyParts, moveCount, MOVE);
    } else {
      bodyParts = [CARRY, CARRY, CARRY, CARRY, MOVE, MOVE];
    }

    return bodyParts;
  }


private addBodyParts(bodyParts: BodyPartConstant[], count: number, type: BodyPartConstant) {
    for (let i = 0; i < count; i++) {
      bodyParts.push(type);
    }
  }


private initMemory() {
    // @ts-ignore
    const room: Room = Game.rooms[this.rm.getRoomName()];

    // init room if it's not an object
    if (!Memory['RESOURCE_TRACKER']) {
      Memory['RESOURCE_TRACKER'] = {};
    }

    if (!Memory['RESOURCE_TRACKER'][room.name]) {
      const energyNodes = this.getEnergyNodes();
      const energyNodesForMemory = [];

      if (energyNodes != null) {
        for (const node of energyNodes) {
          const roomPosition = new RoomPosition(node.pos.x, node.pos.y, room.name);
          const energyResource: Source = room.lookForAt(LOOK_SOURCES, roomPosition)[0];

          if (energyResource) {
            energyNodesForMemory.push({
              pos: {
                x: node.pos.x,
                y: node.pos.y
              },
              harvesterPosition: {
                x: node.harvesterPosition.x,
                y: node.harvesterPosition.y
              },
              resourceId: energyResource.id,
              gathererId: null,
              haulerId: null
            });
          }
        }

        // @ts-ignore
        Memory['RESOURCE_TRACKER'][room.name] = energyNodesForMemory;
      }
    }

    this.nodeReference = Memory['RESOURCE_TRACKER'][room.name];
  }


export class ActionRayMediator extends MvcModule.Mediator {

        static NAME:string = "ActionRayMediator";

        constructor(viewComponent:MvcModule.View) {
            super(ActionRayMediator.NAME, viewComponent);
            this.addListenerToSignal("CircleTouched", function(tile:Phaser.Sprite){
                MvcModule.Mvc.getInstance().sendNotification(CharacterModule.CharacterNotifications.GRID_TOUCHED, tile);
            }, this);
        }

        listNotificationInterests():Array<string>{
            return [CharacterModule.CharacterNotifications.CHARACTER_POSITION,
                    GridModule.GridNotifications.GRID_CREATED,
                    CharacterModule.CharacterActionType.ATTACK,
                    UserInterfaceModule.UINotifications.WEAPON_SELECTED
                    ];
        }

        handleNotification(notification:MvcModule.INotification) {
            switch (notification.name){
                case CharacterModule.CharacterNotifications.CHARACTER_POSITION:
                    (this.viewComponent as ActionRayView).addActionRayAt(notification.body.x, notification.body.y, notification.body.actionType);
                    break;
                case GridModule.GridNotifications.GRID_CREATED:
                    (this.viewComponent as ActionRayView).setGrid(notification.body);
                    break;
                case CharacterModule.CharacterActionType.ATTACK:
                    (this.viewComponent as ActionRayView).removeActionRay();
                    break;
                case UserInterfaceModule.UINotifications.WEAPON_SELECTED:
                    var characterProxy:CharacterModule.CharacterProxy = MvcModule.Mvc.getInstance().retrieveProxy(CharacterModule.CharacterProxy.NAME) as CharacterModule.CharacterProxy;
                    (this.viewComponent as ActionRayView).addActionRayAt(characterProxy.getCharacter().x, characterProxy.getCharacter().y, notification.body);
                    break;
            }
        }
    }


listNotificationInterests():Array<string>{
            return [CharacterModule.CharacterNotifications.CHARACTER_POSITION,
                    GridModule.GridNotifications.GRID_CREATED,
                    CharacterModule.CharacterActionType.ATTACK,
                    UserInterfaceModule.UINotifications.WEAPON_SELECTED
                    ];
        }


handleNotification(notification:MvcModule.INotification) {
            switch (notification.name){
                case CharacterModule.CharacterNotifications.CHARACTER_POSITION:
                    (this.viewComponent as ActionRayView).addActionRayAt(notification.body.x, notification.body.y, notification.body.actionType);
                    break;
                case GridModule.GridNotifications.GRID_CREATED:
                    (this.viewComponent as ActionRayView).setGrid(notification.body);
                    break;
                case CharacterModule.CharacterActionType.ATTACK:
                    (this.viewComponent as ActionRayView).removeActionRay();
                    break;
                case UserInterfaceModule.UINotifications.WEAPON_SELECTED:
                    var characterProxy:CharacterModule.CharacterProxy = MvcModule.Mvc.getInstance().retrieveProxy(CharacterModule.CharacterProxy.NAME) as CharacterModule.CharacterProxy;
                    (this.viewComponent as ActionRayView).addActionRayAt(characterProxy.getCharacter().x, characterProxy.getCharacter().y, notification.body);
                    break;
            }
        }


(loading) => loading


@Injectable({
  providedIn: 'root',
})
export class UserDetailLoadGuard implements CanActivate {
  constructor(private store: Store, private router: Router) {}

  async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {
    await this.store.dispatch(new UserDetailLoad(route.params.userPoolId, route.params.username));
    await this.store
      .select(UserDetailStateService.loading)
      .pipe(takeWhile((loading) => loading))
      .toPromise();
    if (this.store.selectSnapshot(UserDetailStateService.item)) {
      return true;
    } else {
      return this.router.createUrlTree(['/app/users']);
    }
  }
}


async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {
    await this.store.dispatch(new UserDetailLoad(route.params.userPoolId, route.params.username));
    await this.store
      .select(UserDetailStateService.loading)
      .pipe(takeWhile((loading) => loading))
      .toPromise();
    if (this.store.selectSnapshot(UserDetailStateService.item)) {
      return true;
    } else {
      return this.router.createUrlTree(['/app/users']);
    }
  }


@NgModule({
  imports: [
    CommonModule,
    FlexLayoutModule
  ],
  declarations: [AlertComponent],
  exports: [AlertComponent]
})
export class SofAlertModule { }


/** setups and returns the fixtures for testing */
function setupFixtures() {
  const basePath = process.cwd();
  const buildPath = `${basePath}/tools/ts_library_builder/testdata`;
  const outputFile = `${buildPath}/lib.output.d.ts`;
  const inputProject = new Project({
    compilerOptions: {
      baseUrl: basePath,
      declaration: true,
      emitDeclarationOnly: true,
      module: ModuleKind.AMD,
      moduleResolution: ModuleResolutionKind.NodeJs,
      strict: true,
      stripInternal: true,
      target: ScriptTarget.ESNext
    }
  });
  inputProject.addExistingSourceFiles([
    `${buildPath}/globals.ts`,
    `${buildPath}/api.ts`
  ]);
  const declarationProject = new Project({
    compilerOptions: {},
    useVirtualFileSystem: true
  });
  loadDtsFiles(declarationProject);
  for (const { filePath, text } of inputProject.emitToMemory().getFiles()) {
    declarationProject.createSourceFile(filePath, text);
  }
  const outputProject = new Project({
    compilerOptions: {},
    useVirtualFileSystem: true
  });
  loadDtsFiles(outputProject);
  const outputSourceFile = outputProject.createSourceFile(outputFile);
  const debug = true;

  return {
    basePath,
    buildPath,
    inputProject,
    outputFile,
    declarationProject,
    outputProject,
    outputSourceFile,
    debug
  };
}


function buildLibraryFlatten() {
  const {
    basePath,
    buildPath,
    debug,
    declarationProject,
    outputSourceFile: targetSourceFile
  } = setupFixtures();

  flatten({
    basePath,
    customSources: {},
    debug,
    declarationProject,
    filePath: `${buildPath}/api.d.ts`,
    moduleName: `"api"`,
    namespaceName: "Api",
    targetSourceFile
  });

  assert(targetSourceFile.getNamespace(`"api"`) != null);
  assert(targetSourceFile.getNamespace("Api") != null);
  assert.equal(targetSourceFile.getNamespaces().length, 2);
  const moduleApi = targetSourceFile.getNamespaceOrThrow(`"api"`);
  const functions = moduleApi.getFunctions();
  assert.equal(functions[0].getName(), "foo");
  assert.equal(
    functions[0]
      .getJsDocs()
      .map(jsdoc => jsdoc.getInnerText())
      .join("\n"),
    "jsdoc for foo"
  );
  assert.equal(functions[1].getName(), "bar");
  assert.equal(
    functions[1]
      .getJsDocs()
      .map(jsdoc => jsdoc.getInnerText())
      .join("\n"),
    ""
  );
  assert.equal(functions.length, 2);
  const classes = moduleApi.getClasses();
  assert.equal(classes[0].getName(), "Foo");
  assert.equal(classes.length, 1);
  const variableDeclarations = moduleApi.getVariableDeclarations();
  assert.equal(variableDeclarations[0].getName(), "arr");
  assert.equal(variableDeclarations.length, 1);

  const namespaceApi = targetSourceFile.getNamespaceOrThrow(`"api"`);
  const functionsNs = namespaceApi.getFunctions();
  assert.equal(functionsNs[0].getName(), "foo");
  assert.equal(
    functionsNs[0]
      .getJsDocs()
      .map(jsdoc => jsdoc.getInnerText())
      .join("\n"),
    "jsdoc for foo"
  );
  assert.equal(functionsNs[1].getName(), "bar");
  assert.equal(
    functionsNs[1]
      .getJsDocs()
      .map(jsdoc => jsdoc.getInnerText())
      .join("\n"),
    ""
  );
  assert.equal(functionsNs.length, 2);
  const classesNs = namespaceApi.getClasses();
  assert.equal(classesNs[0].getName(), "Foo");
  assert.equal(classesNs.length, 1);
  const variableDeclarationsNs = namespaceApi.getVariableDeclarations();
  assert.equal(variableDeclarationsNs[0].getName(), "arr");
  assert.equal(variableDeclarationsNs.length, 1);
}


function buildLibraryMerge() {
  const {
    basePath,
    buildPath,
    declarationProject,
    debug,
    inputProject,
    outputSourceFile: targetSourceFile
  } = setupFixtures();

  mergeGlobal({
    basePath,
    declarationProject,
    debug,
    globalVarName: "foobarbaz",
    filePath: `${buildPath}/globals.ts`,
    inputProject,
    interfaceName: "FooBar",
    targetSourceFile
  });

  assert(targetSourceFile.getNamespace("moduleC") != null);
  assert(targetSourceFile.getNamespace("moduleD") != null);
  assert(targetSourceFile.getNamespace("moduleE") != null);
  assert(targetSourceFile.getNamespace("moduleF") != null);
  assert.equal(targetSourceFile.getNamespaces().length, 4);
  assert(targetSourceFile.getInterface("FooBar") != null);
  assert.equal(targetSourceFile.getInterfaces().length, 1);
  const variableDeclarations = targetSourceFile.getVariableDeclarations();
  assert.equal(variableDeclarations[0].getType().getText(), `FooBar`);
  assert.equal(variableDeclarations[1].getType().getText(), `FooBar`);
  assert.equal(variableDeclarations[2].getType().getText(), `moduleC.Bar`);
  assert.equal(
    variableDeclarations[3].getType().getText(),
    `typeof moduleC.qat`
  );
  assert.equal(
    variableDeclarations[4].getType().getText(),
    `typeof moduleE.process`
  );
  assert.equal(
    variableDeclarations[5].getType().getText(),
    `typeof moduleD.reprocess`
  );
  assert.equal(
    variableDeclarations[6].getType().getText(),
    `typeof moduleC.Bar`
  );
  assert.equal(variableDeclarations.length, 7);
  const typeAliases = targetSourceFile.getTypeAliases();
  assert.equal(typeAliases[0].getName(), "Bar");
  assert.equal(typeAliases[0].getType().getText(), "moduleC.Bar");
  assert.equal(typeAliases.length, 1);
}


function testInlineFiles() {
  const {
    basePath,
    buildPath,
    debug,
    outputSourceFile: targetSourceFile
  } = setupFixtures();

  inlineFiles({
    basePath,
    debug,
    inline: [`${buildPath}/lib.extra.d.ts`],
    targetSourceFile
  });

  assert(targetSourceFile.getNamespace("Qat") != null);
  const qatNamespace = targetSourceFile.getNamespaceOrThrow("Qat");
  assert(qatNamespace.getClass("Foo") != null);
}


// TODO author unit tests for `ast_util.ts`
function main() {
  console.log("ts_library_builder buildLibraryFlatten");
  buildLibraryFlatten();
  console.log("ts_library_builder buildLibraryMerge");
  buildLibraryMerge();
  console.log("ts_library_builder testInlineFiles");
  testInlineFiles();
  console.log("ts_library_builder ok");
}


jsdoc => jsdoc.getInnerText()


data => {
      // console.log(data.subjects)
      // this.subjectArray = data.subjects;
      this.employeeForm = this.fb.group({
        employee_name: [data.employee_name, [Validators.required]],
        employee_email: [data.employee_email, [Validators.required]],
        department: [data.department, [Validators.required]],
        rating: [data.rating, [Validators.required]],
        doj: [data.dob, [Validators.required]],
        gender: [data.gender]
      })
    }


(controlName: string, errorName: string) => {
    return this.employeeForm.controls[controlName].hasError(errorName);
  }


res => {
        this.ngZone.run(() => this.router.navigateByUrl('/employees-list'))
      }


() => this.router.navigateByUrl('/employees-list')


@Component({
  selector: 'app-edit-employee',
  templateUrl: './edit-employee.component.html',
  styleUrls: ['./edit-employee.component.css']
})

export class EditEmployeeComponent implements OnInit {
  [x: string]: any;
  visible = true;
  selectable = true;
  removable = true;
  addOnBlur = true;
  @ViewChild('chipList', { static: true }) chipList;
  @ViewChild('resetEmployeeForm', { static: true }) myNgForm;
  readonly separatorKeysCodes: number[] = [ENTER, COMMA];
  employeeForm: FormGroup;
  // subjectArray: Subject[] = [];
  DepartmentArray: any = ['Accounts and Finance', 'Production', 'Marketing', 'Purchasing', 'Research and Development'];

  ngOnInit() {
    this.updateBookForm();
  }

  constructor(
    public fb: FormBuilder,
    private router: Router,
    private ngZone: NgZone,
    private actRoute: ActivatedRoute,
    private employeeApi: ApiService
  ) {
    var id = this.actRoute.snapshot.paramMap.get('id');
    this.employeeApi.GetEmployee(id).subscribe(data => {
      // console.log(data.subjects)
      // this.subjectArray = data.subjects;
      this.employeeForm = this.fb.group({
        employee_name: [data.employee_name, [Validators.required]],
        employee_email: [data.employee_email, [Validators.required]],
        department: [data.department, [Validators.required]],
        rating: [data.rating, [Validators.required]],
        doj: [data.dob, [Validators.required]],
        gender: [data.gender]
      })
    })
  }

  /* Reactive book form */
  updateBookForm() {
    this.employeeForm = this.fb.group({
      employee_name: ['', [Validators.required]],
      employee_email: ['', [Validators.required]],
      department: ['', [Validators.required]],
      rating: ['', [Validators.required]],
      doj: ['', [Validators.required]],
      gender: ['Male']
    })
  }

  // /* Add dynamic languages */
  // add(event: MatChipInputEvent): void {
  //   const input = event.input;
  //   const value = event.value;
  //   // Add language
  //   if ((value || '').trim() && this.subjectArray.length < 5) {
  //     this.subjectArray.push({ name: value.trim() })
  //   }
  //   // Reset the input value
  //   if (input) {
  //     input.value = '';
  //   }
  // }

  // /* Remove dynamic languages */
  // remove(subject: Subject): void {
  //   const index = this.subjectArray.indexOf(subject);
  //   if (index >= 0) {
  //     this.subjectArray.splice(index, 1);
  //   }
  // }

  /* Date */
  formatDate(e) {
    var convertDate = new Date(e.target.value).toISOString().substring(0, 10);
    this.employeeForm.get('doj').setValue(convertDate, {
      onlyself: true
    })
  }

  /* Get errors */
  public handleError = (controlName: string, errorName: string) => {
    return this.employeeForm.controls[controlName].hasError(errorName);
  }

  /* Update book */
  updateEmployeeForm() {
    console.log(this.employeeForm.value)
    var id = this.actRoute.snapshot.paramMap.get('id');
    if (window.confirm('Are you sure you want to update?')) {
      this.employeeApi.UpdateEmployee(id, this.employeeForm.value).subscribe( res => {
        this.ngZone.run(() => this.router.navigateByUrl('/employees-list'))
      });
    }
  }

}


export interface Subject {
  name: string;
}


ngOnInit() {
    this.updateBookForm();
  }


/* Reactive book form */
updateBookForm() {
    this.employeeForm = this.fb.group({
      employee_name: ['', [Validators.required]],
      employee_email: ['', [Validators.required]],
      department: ['', [Validators.required]],
      rating: ['', [Validators.required]],
      doj: ['', [Validators.required]],
      gender: ['Male']
    })
  }


// /* Add dynamic languages */
// add(event: MatChipInputEvent): void {
//   const input = event.input;
//   const value = event.value;
//   // Add language
//   if ((value || '').trim() && this.subjectArray.length < 5) {
//     this.subjectArray.push({ name: value.trim() })
//   }
//   // Reset the input value
//   if (input) {
//     input.value = '';
//   }
// }
// /* Remove dynamic languages */
// remove(subject: Subject): void {
//   const index = this.subjectArray.indexOf(subject);
//   if (index >= 0) {
//     this.subjectArray.splice(index, 1);
//   }
// }
/* Date */
formatDate(e) {
    var convertDate = new Date(e.target.value).toISOString().substring(0, 10);
    this.employeeForm.get('doj').setValue(convertDate, {
      onlyself: true
    })
  }


/* Update book */
updateEmployeeForm() {
    console.log(this.employeeForm.value)
    var id = this.actRoute.snapshot.paramMap.get('id');
    if (window.confirm('Are you sure you want to update?')) {
      this.employeeApi.UpdateEmployee(id, this.employeeForm.value).subscribe( res => {
        this.ngZone.run(() => this.router.navigateByUrl('/employees-list'))
      });
    }
  }


@UseGuards(JwtAuthGuard, RolesGuard)
@Controller('users')
@ApiTags('Users')
export class UsersController {
  constructor(private usersService: UsersService) { }

  @Roles(Role.ADMIN)
  @Get('clients')
  findAll(@Req() req: Request) {
    const user = req.user as PayloadToken;
    return this.usersService.findAll(user.sub);
  }

  @Public()
  @Post()
  create(@Body() payload: CreateUserDto) {
    return this.usersService.create(payload);
  }

  @Roles(Role.ADMIN)
  @Post('client')
  createClient(@Req() req: Request, @Body() payload: CreateUserDto) {
    const user = req.user as PayloadToken;
    return this.usersService.createClient(user.sub, payload);
  }

  @Roles(Role.ADMIN)
  @Put('client/:id')
  update(
    @Req() req: Request,
    @Param('id', ParseIntPipe) id: number,
    @Body() payload: UpdateUserDto,
  ) {
    const user = req.user as PayloadToken;
    return this.usersService.update(user.sub, id, payload);
  }

  @Roles(Role.ADMIN)
  @Delete('client/:id')
  remove(@Req() req: Request, @Param('id', ParseIntPipe) id: number) {
    const user = req.user as PayloadToken;
    return this.usersService.remove(user.sub, id);
  }
}


@Roles(Role.ADMIN)
  @Get('clients')
  findAll(@Req() req: Request) {
    const user = req.user as PayloadToken;
    return this.usersService.findAll(user.sub);
  }


@Public()
  @Post()
  create(@Body() payload: CreateUserDto) {
    return this.usersService.create(payload);
  }


@Roles(Role.ADMIN)
  @Post('client')
  createClient(@Req() req: Request, @Body() payload: CreateUserDto) {
    const user = req.user as PayloadToken;
    return this.usersService.createClient(user.sub, payload);
  }


@Roles(Role.ADMIN)
  @Put('client/:id')
  update(
    @Req() req: Request,
    @Param('id', ParseIntPipe) id: number,
    @Body() payload: UpdateUserDto,
  ) {
    const user = req.user as PayloadToken;
    return this.usersService.update(user.sub, id, payload);
  }


@Roles(Role.ADMIN)
  @Delete('client/:id')
  remove(@Req() req: Request, @Param('id', ParseIntPipe) id: number) {
    const user = req.user as PayloadToken;
    return this.usersService.remove(user.sub, id);
  }


({ service }: { service: undefined | IRuleService | IMarkerService }): void => {
    service?.exportItems().then((response: RulesExportData | MarkersExportData) => {
        const dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(response));
        const exportElem: HTMLElement | null = document.getElementById('exportAnchor');

        if (exportElem) {
            exportElem.setAttribute('href', dataStr);
            exportElem.setAttribute('download', `${response.kind}.json`);
            exportElem.click();
        }
    });
}


(response: RulesExportData | MarkersExportData) => {
        const dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(response));
        const exportElem: HTMLElement | null = document.getElementById('exportAnchor');

        if (exportElem) {
            exportElem.setAttribute('href', dataStr);
            exportElem.setAttribute('download', `${response.kind}.json`);
            exportElem.click();
        }
    }


async (sharedData: SharedData, folderId: string, dispatch: Function) => {

	if (!!sharedData.resources && sharedData.resources.length > 0) {
		const response = await checkPermissions(PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE);

		if (response !== PermissionsAndroid.RESULTS.GRANTED) {
			ToastAndroid.show('Cannot receive shared data - permission denied', ToastAndroid.SHORT);
			ShareExtension.close();
			return;
		}
	}

	// This is a bit hacky, but the surest way to go to
	// the needed note. We go back one screen in case there's
	// already a note open - if we don't do this, the dispatch
	// below will do nothing (because routeName wouldn't change)
	// Then we wait a bit for the state to be set correctly, and
	// finally we go to the new note.
	dispatch({ type: 'NAV_BACK' });

	dispatch({ type: 'SIDE_MENU_CLOSE' });

	const newNote = await Note.save({
		parent_id: folderId,
	}, { provisional: true });

	shim.setTimeout(() => {
		dispatch({
			type: 'NAV_GO',
			routeName: 'Note',
			noteId: newNote.id,
			sharedData: sharedData,
		});
	}, 5);
}


() => {
		dispatch({
			type: 'NAV_GO',
			routeName: 'Note',
			noteId: newNote.id,
			sharedData: sharedData,
		});
	}


export interface SubmissionErrorConstructor<T> {
    new (errors?: FormErrors<T>): Error;
}


export async function scrollToTimelineTop(session: ElementSession): Promise<void> {
    session.log.step(`scrolls to the top of the timeline`);
    await session.page.evaluate(() => {
        return Promise.resolve().then(async () => {
            let timedOut = false;
            let timeoutHandle = null;
            // set scrollTop to 0 in a loop and check every 50ms
            // if content became available (scrollTop not being 0 anymore),
            // assume everything is loaded after 3s
            do {
                const timelineScrollView = document.querySelector(".mx_RoomView_timeline .mx_ScrollPanel");
                if (timelineScrollView && timelineScrollView.scrollTop !== 0) {
                    if (timeoutHandle) {
                        clearTimeout(timeoutHandle);
                    }
                    timeoutHandle = setTimeout(() => timedOut = true, 3000);
                    timelineScrollView.scrollTop = 0;
                } else {
                    await new Promise((resolve) => setTimeout(resolve, 50));
                }
            } while (!timedOut);
        });
    });
    session.log.done();
}


export async function receiveMessage(session: ElementSession, expectedMessage: Message): Promise<void> {
    session.log.step(`receives message "${expectedMessage.body}" from ${expectedMessage.sender}`);
    // wait for a response to come in that contains the message
    // crude, but effective

    async function getLastMessage(): Promise<Message> {
        const lastTile = await getLastEventTile(session);
        return getMessageFromEventTile(lastTile);
    }

    let lastMessage;
    await session.poll(async () => {
        try {
            lastMessage = await getLastMessage();
        } catch (err) {
            return false;
        }
        // stop polling when found the expected message
        return lastMessage &&
            lastMessage.body === expectedMessage.body &&
            lastMessage.sender === expectedMessage.sender;
    });
    assertMessage(lastMessage, expectedMessage);
    session.log.done();
}


// wait for a response to come in that contains the message
// crude, but effective
async function getLastMessage(): Promise<Message> {
        const lastTile = await getLastEventTile(session);
        return getMessageFromEventTile(lastTile);
    }


export async function checkTimelineContains(session: ElementSession, expectedMessages: Message[],
    sendersDescription: string): Promise<void> {
    session.log.step(`checks timeline contains ${expectedMessages.length} ` +
        `given messages${sendersDescription ? ` from ${sendersDescription}`:""}`);
    const eventTiles = await getAllEventTiles(session);
    let timelineMessages: Message[] = await Promise.all(eventTiles.map((eventTile) => {
        return getMessageFromEventTile(eventTile);
    }));
    //filter out tiles that were not messages
    timelineMessages = timelineMessages.filter((m) => !!m);
    timelineMessages.reduce((prevSender: string, m) => {
        if (m.continuation) {
            m.sender = prevSender;
            return prevSender;
        } else {
            return m.sender;
        }
    }, "");

    expectedMessages.forEach((expectedMessage) => {
        const foundMessage = timelineMessages.find((message) => {
            return message.sender === expectedMessage.sender &&
                message.body === expectedMessage.body;
        });
        try {
            assertMessage(foundMessage, expectedMessage);
        } catch (err) {
            console.log("timelineMessages", timelineMessages);
            throw err;
        }
    });

    session.log.done();
}


function assertMessage(foundMessage: Message, expectedMessage: Message): void {
    assert(foundMessage, `message ${JSON.stringify(expectedMessage)} not found in timeline`);
    assert.equal(foundMessage.body, expectedMessage.body);
    assert.equal(foundMessage.sender, expectedMessage.sender);
    if (expectedMessage.hasOwnProperty("encrypted")) {
        assert.equal(foundMessage.encrypted, expectedMessage.encrypted);
    }
}


function getLastEventTile(session: ElementSession): Promise<ElementHandle> {
    return session.query(".mx_EventTile_last");
}


function getAllEventTiles(session: ElementSession): Promise<ElementHandle[]> {
    return session.queryAll(".mx_RoomView_MessageList .mx_EventTile");
}


async function getMessageFromEventTile(eventTile: ElementHandle): Promise<Message> {
    const senderElement = await eventTile.$(".mx_SenderProfile_displayName");
    const className: string = await (await eventTile.getProperty("className")).jsonValue();
    const classNames = className.split(" ");
    const bodyElement = await eventTile.$(".mx_EventTile_body");
    let sender = null;
    if (senderElement) {
        sender = await(await senderElement.getProperty("innerText")).jsonValue();
    }
    if (!bodyElement) {
        return null;
    }
    const body: string = await(await bodyElement.getProperty("innerText")).jsonValue();

    return {
        sender,
        body,
        encrypted: classNames.includes("mx_EventTile_verified"),
        continuation: classNames.includes("mx_EventTile_continuation"),
    };
}


() => {
        return Promise.resolve().then(async () => {
            let timedOut = false;
            let timeoutHandle = null;
            // set scrollTop to 0 in a loop and check every 50ms
            // if content became available (scrollTop not being 0 anymore),
            // assume everything is loaded after 3s
            do {
                const timelineScrollView = document.querySelector(".mx_RoomView_timeline .mx_ScrollPanel");
                if (timelineScrollView && timelineScrollView.scrollTop !== 0) {
                    if (timeoutHandle) {
                        clearTimeout(timeoutHandle);
                    }
                    timeoutHandle = setTimeout(() => timedOut = true, 3000);
                    timelineScrollView.scrollTop = 0;
                } else {
                    await new Promise((resolve) => setTimeout(resolve, 50));
                }
            } while (!timedOut);
        });
    }


async () => {
            let timedOut = false;
            let timeoutHandle = null;
            // set scrollTop to 0 in a loop and check every 50ms
            // if content became available (scrollTop not being 0 anymore),
            // assume everything is loaded after 3s
            do {
                const timelineScrollView = document.querySelector(".mx_RoomView_timeline .mx_ScrollPanel");
                if (timelineScrollView && timelineScrollView.scrollTop !== 0) {
                    if (timeoutHandle) {
                        clearTimeout(timeoutHandle);
                    }
                    timeoutHandle = setTimeout(() => timedOut = true, 3000);
                    timelineScrollView.scrollTop = 0;
                } else {
                    await new Promise((resolve) => setTimeout(resolve, 50));
                }
            } while (!timedOut);
        }


() => timedOut = true


(resolve) => setTimeout(resolve, 50)