interface LoDashImplicitObjectWrapper<T> {
        /**
         * @see _.attempt
         */
        attempt<TResult>(...args: any[]): TResult|Error;
    }


interface LoDashExplicitObjectWrapper<T> {
        /**
         * @see _.attempt
         */
        attempt<TResult>(...args: any[]): LoDashExplicitObjectWrapper<TResult|Error>;
    }


//_.constant
interface LoDashStatic {
        /**
         * Creates a function that returns value.
         *
         * @param value The value to return from the new function.
         * @return Returns the new function.
         */
        constant<T>(value: T): () => T;
    }


interface LoDashImplicitWrapperBase<T, TWrapper> {
        /**
         * @see _.constant
         */
        constant<TResult>(): LoDashImplicitObjectWrapper<() => TResult>;
    }


interface LoDashExplicitWrapperBase<T, TWrapper> {
        /**
         * @see _.constant
         */
        constant<TResult>(): LoDashExplicitObjectWrapper<() => TResult>;
    }


//_.identity
interface LoDashStatic {
        /**
         * This method returns the first argument provided to it.
         *
         * @param value Any value.
         * @return Returns value.
         */
        identity<T>(value?: T): T;
    }


interface LoDashImplicitWrapper<T> {
        /**
         * @see _.identity
         */
        identity(): T;
    }


interface LoDashImplicitArrayWrapper<T> {
        /**
         * @see _.identity
         */
        identity(): T[];
    }


interface LoDashImplicitObjectWrapper<T> {
        /**
         * @see _.identity
         */
        identity(): T;
    }


interface LoDashExplicitWrapper<T> {
        /**
         * @see _.identity
         */
        identity(): LoDashExplicitWrapper<T>;
    }


interface LoDashExplicitArrayWrapper<T> {
        /**
         * @see _.identity
         */
        identity(): LoDashExplicitArrayWrapper<T>;
    }


interface LoDashExplicitObjectWrapper<T> {
        /**
         * @see _.identity
         */
        identity(): LoDashExplicitObjectWrapper<T>;
    }


//_.iteratee
interface LoDashStatic {
        /**
         * Creates a function that invokes `func` with the arguments of the created
         * function. If `func` is a property name the created callback returns the
         * property value for a given element. If `func` is an object the created
         * callback returns `true` for elements that contain the equivalent object properties, otherwise it returns `false`.
         *
         * @static
         * @memberOf _
         * @category Util
         * @param {*} [func=_.identity] The value to convert to a callback.
         * @returns {Function} Returns the callback.
         * @example
         *
         * var users = [
         *   { 'user': 'barney', 'age': 36 },
         *   { 'user': 'fred',   'age': 40 }
         * ];
         *
         * // create custom iteratee shorthands
         * _.iteratee = _.wrap(_.iteratee, function(callback, func) {
         *   var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func);
         *   return !p ? callback(func) : function(object) {
         *     return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);
         *   };
         * });
         *
         * _.filter(users, 'age > 36');
         * // => [{ 'user': 'fred', 'age': 40 }]
         */
        iteratee<TResult>(
            func: Function,
            thisArg?: any
        ): (...args: any[]) => TResult;

        /**
         * @see _.iteratee
         */
        iteratee<TResult>(
            func: string,
            thisArg?: any
        ): (object: any) => TResult;

        /**
         * @see _.iteratee
         */
        iteratee(
            func: Object,
            thisArg?: any
        ): (object: any) => boolean;

        /**
         * @see _.iteratee
         */
        iteratee<TResult>(): (value: TResult) => TResult;
    }


interface LoDashImplicitWrapper<T> {
        /**
         * @see _.iteratee
         */
        iteratee<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => TResult>;
    }


interface LoDashImplicitObjectWrapper<T> {
        /**
         * @see _.iteratee
         */
        iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => boolean>;

        /**
         * @see _.iteratee
         */
        iteratee<TResult>(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>;
    }


interface LoDashExplicitWrapper<T> {
        /**
         * @see _.iteratee
         */
        iteratee<TResult>(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => TResult>;
    }


interface LoDashExplicitObjectWrapper<T> {
        /**
         * @see _.iteratee
         */
        iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => boolean>;

        /**
         * @see _.iteratee
         */
        iteratee<TResult>(thisArg?: any): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>;
    }


//_.matches
interface LoDashStatic {
        /**
         * Creates a function that performs a deep comparison between a given object and source, returning true if the
         * given object has equivalent property values, else false.
         *
         * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and
         * strings. Objects are compared by their own, not inherited, enumerable properties. For comparing a single own
         * or inherited property value see _.matchesProperty.
         *
         * @param source The object of property values to match.
         * @return Returns the new function.
         */
        matches<T>(source: T): (value: any) => boolean;

        /**
         * @see _.matches
         */
        matches<T, V>(source: T): (value: V) => boolean;
    }


interface LoDashImplicitWrapperBase<T, TWrapper> {
        /**
         * @see _.matches
         */
        matches<V>(): LoDashImplicitObjectWrapper<(value: V) => boolean>;
    }


interface LoDashExplicitWrapperBase<T, TWrapper> {
        /**
         * @see _.matches
         */
        matches<V>(): LoDashExplicitObjectWrapper<(value: V) => boolean>;
    }


//_.matchesProperty
interface LoDashStatic {
        /**
         * Creates a function that compares the property value of path on a given object to value.
         *
         * Note: This method supports comparing arrays, booleans, Date objects, numbers, Object objects, regexes, and
         * strings. Objects are compared by their own, not inherited, enumerable properties.
         *
         * @param path The path of the property to get.
         * @param srcValue The value to match.
         * @return Returns the new function.
         */
        matchesProperty<T>(
            path: StringRepresentable|StringRepresentable[],
            srcValue: T
        ): (value: any) => boolean;

        /**
         * @see _.matchesProperty
         */
        matchesProperty<T, V>(
            path: StringRepresentable|StringRepresentable[],
            srcValue: T
        ): (value: V) => boolean;
    }


interface LoDashImplicitWrapperBase<T, TWrapper> {
        /**
         * @see _.matchesProperty
         */
        matchesProperty<SrcValue>(
            srcValue: SrcValue
        ): LoDashImplicitObjectWrapper<(value: any) => boolean>;

        /**
         * @see _.matchesProperty
         */
        matchesProperty<SrcValue, Value>(
            srcValue: SrcValue
        ): LoDashImplicitObjectWrapper<(value: Value) => boolean>;
    }


interface LoDashExplicitWrapperBase<T, TWrapper> {
        /**
         * @see _.matchesProperty
         */
        matchesProperty<SrcValue>(
            srcValue: SrcValue
        ): LoDashExplicitObjectWrapper<(value: any) => boolean>;

        /**
         * @see _.matchesProperty
         */
        matchesProperty<SrcValue, Value>(
            srcValue: SrcValue
        ): LoDashExplicitObjectWrapper<(value: Value) => boolean>;
    }


//_.method
interface LoDashStatic {
        /**
         * Creates a function that invokes the method at path on a given object. Any additional arguments are provided
         * to the invoked method.
         *
         * @param path The path of the method to invoke.
         * @param args The arguments to invoke the method with.
         * @return Returns the new function.
         */
        method<TObject, TResult>(
            path: string|StringRepresentable[],
            ...args: any[]
        ): (object: TObject) => TResult;

        /**
         * @see _.method
         */
        method<TResult>(
            path: string|StringRepresentable[],
            ...args: any[]
        ): (object: any) => TResult;
    }


interface LoDashImplicitWrapper<T> {
        /**
         * @see _.method
         */
        method<TObject, TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>;

        /**
         * @see _.method
         */
        method<TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>;
    }


interface LoDashImplicitArrayWrapper<T> {
        /**
         * @see _.method
         */
        method<TObject, TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: TObject) => TResult>;

        /**
         * @see _.method
         */
        method<TResult>(...args: any[]): LoDashImplicitObjectWrapper<(object: any) => TResult>;
    }


interface LoDashExplicitWrapper<T> {
        /**
         * @see _.method
         */
        method<TObject, TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>;

        /**
         * @see _.method
         */
        method<TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>;
    }


interface LoDashExplicitArrayWrapper<T> {
        /**
         * @see _.method
         */
        method<TObject, TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: TObject) => TResult>;

        /**
         * @see _.method
         */
        method<TResult>(...args: any[]): LoDashExplicitObjectWrapper<(object: any) => TResult>;
    }


//_.methodOf
interface LoDashStatic {
        /**
         * The opposite of _.method; this method creates a function that invokes the method at a given path on object.
         * Any additional arguments are provided to the invoked method.
         *
         * @param object The object to query.
         * @param args The arguments to invoke the method with.
         * @return Returns the new function.
         */
        methodOf<TObject extends {}, TResult>(
            object: TObject,
            ...args: any[]
        ): (path: StringRepresentable|StringRepresentable[]) => TResult;

        /**
         * @see _.methodOf
         */
        methodOf<TResult>(
            object: {},
            ...args: any[]
        ): (path: StringRepresentable|StringRepresentable[]) => TResult;
    }


interface LoDashImplicitObjectWrapper<T> {
        /**
         * @see _.methodOf
         */
        methodOf<TResult>(
            ...args: any[]
        ): LoDashImplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>;
    }


interface LoDashExplicitObjectWrapper<T> {
        /**
         * @see _.methodOf
         */
        methodOf<TResult>(
            ...args: any[]
        ): LoDashExplicitObjectWrapper<(path: StringRepresentable|StringRepresentable[]) => TResult>;
    }


//_.mixin
interface MixinOptions {
        chain?: boolean;
    }


interface LoDashStatic {
        /**
         * Adds all own enumerable function properties of a source object to the destination object. If object is a
         * function then methods are added to its prototype as well.
         *
         * Note: Use _.runInContext to create a pristine lodash function to avoid conflicts caused by modifying
         * the original.
         *
         * @param object The destination object.
         * @param source The object of functions to add.
         * @param options The options object.
         * @param options.chain Specify whether the functions added are chainable.
         * @return Returns object.
         */
        mixin<TResult, TObject>(
            object: TObject,
            source: Dictionary<Function>,
            options?: MixinOptions
        ): TResult;

        /**
         * @see _.mixin
         */
        mixin<TResult>(
            source: Dictionary<Function>,
            options?: MixinOptions
        ): TResult;
    }


interface LoDashImplicitObjectWrapper<T> {
        /**
         * @see _.mixin
         */
        mixin<TResult>(
            source: Dictionary<Function>,
            options?: MixinOptions
        ): LoDashImplicitObjectWrapper<TResult>;

        /**
         * @see _.mixin
         */
        mixin<TResult>(
            options?: MixinOptions
        ): LoDashImplicitObjectWrapper<TResult>;
    }


interface LoDashExplicitObjectWrapper<T> {
        /**
         * @see _.mixin
         */
        mixin<TResult>(
            source: Dictionary<Function>,
            options?: MixinOptions
        ): LoDashExplicitObjectWrapper<TResult>;

        /**
         * @see _.mixin
         */
        mixin<TResult>(
            options?: MixinOptions
        ): LoDashExplicitObjectWrapper<TResult>;
    }


//_.noConflict
interface LoDashStatic {
        /**
         * Reverts the _ variable to its previous value and returns a reference to the lodash function.
         *
         * @return Returns the lodash function.
         */
        noConflict(): typeof _;
    }


interface LoDashImplicitWrapperBase<T, TWrapper> {
        /**
         * @see _.noConflict
         */
        noConflict(): typeof _;
    }


//_.noop
interface LoDashStatic {
        /**
         * A no-operation function that returns undefined regardless of the arguments it receives.
         *
         * @return undefined
         */
        noop(...args: any[]): void;
    }


interface LoDashImplicitWrapperBase<T, TWrapper> {
        /**
         * @see _.noop
         */
        noop(...args: any[]): void;
    }


interface LoDashExplicitWrapperBase<T, TWrapper> {
        /**
         * @see _.noop
         */
        noop(...args: any[]): _.LoDashExplicitWrapper<void>;
    }


//_.nthArg
interface LoDashStatic {
        /**
         * Creates a function that returns its nth argument.
         *
         * @param n The index of the argument to return.
         * @return Returns the new function.
         */
        nthArg<TResult extends Function>(n?: number): TResult;
    }


interface LoDashImplicitWrapper<T> {
        /**
         * @see _.nthArg
         */
        nthArg<TResult extends Function>(): LoDashImplicitObjectWrapper<TResult>;
    }


interface LoDashExplicitWrapper<T> {
        /**
         * @see _.nthArg
         */
        nthArg<TResult extends Function>(): LoDashExplicitObjectWrapper<TResult>;
    }


//_.over
interface LoDashStatic {
        /**
         * Creates a function that invokes iteratees with the arguments provided to the created function and returns
         * their results.
         *
         * @param iteratees The iteratees to invoke.
         * @return Returns the new function.
         */
        over<TResult>(...iteratees: (Function|Function[])[]): (...args: any[]) => TResult[];
    }


interface LoDashImplicitArrayWrapper<T> {
        /**
         * @see _.over
         */
        over<TResult>(...iteratees: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>;
    }


interface LoDashImplicitObjectWrapper<T> {
        /**
         * @see _.over
         */
        over<TResult>(...iteratees: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => TResult[]>;
    }


interface LoDashExplicitArrayWrapper<T> {
        /**
         * @see _.over
         */
        over<TResult>(...iteratees: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>;
    }


interface LoDashExplicitObjectWrapper<T> {
        /**
         * @see _.over
         */
        over<TResult>(...iteratees: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => TResult[]>;
    }


//_.overEvery
interface LoDashStatic {
        /**
         * Creates a function that checks if all of the predicates return truthy when invoked with the arguments
         * provided to the created function.
         *
         * @param predicates The predicates to check.
         * @return Returns the new function.
         */
        overEvery(...predicates: (Function|Function[])[]): (...args: any[]) => boolean;
    }


interface LoDashImplicitArrayWrapper<T> {
        /**
         * @see _.overEvery
         */
        overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
    }


interface LoDashImplicitObjectWrapper<T> {
        /**
         * @see _.overEvery
         */
        overEvery(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
    }


interface LoDashExplicitArrayWrapper<T> {
        /**
         * @see _.overEvery
         */
        overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
    }


interface LoDashExplicitObjectWrapper<T> {
        /**
         * @see _.overEvery
         */
        overEvery(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
    }


//_.overSome
interface LoDashStatic {
        /**
         * Creates a function that checks if any of the predicates return truthy when invoked with the arguments
         * provided to the created function.
         *
         * @param predicates The predicates to check.
         * @return Returns the new function.
         */
        overSome(...predicates: (Function|Function[])[]): (...args: any[]) => boolean;
    }


interface LoDashImplicitArrayWrapper<T> {
        /**
         * @see _.overSome
         */
        overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
    }


interface LoDashImplicitObjectWrapper<T> {
        /**
         * @see _.overSome
         */
        overSome(...predicates: (Function|Function[])[]): LoDashImplicitObjectWrapper<(...args: any[]) => boolean>;
    }


interface LoDashExplicitArrayWrapper<T> {
        /**
         * @see _.overSome
         */
        overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
    }


interface LoDashExplicitObjectWrapper<T> {
        /**
         * @see _.overSome
         */
        overSome(...predicates: (Function|Function[])[]): LoDashExplicitObjectWrapper<(...args: any[]) => boolean>;
    }


//_.property
interface LoDashStatic {
        /**
         * Creates a function that returns the property value at path on a given object.
         *
         * @param path The path of the property to get.
         * @return Returns the new function.
         */
        property<TObj, TResult>(path: StringRepresentable|StringRepresentable[]): (obj: TObj) => TResult;
    }


interface LoDashImplicitWrapper<T> {
        /**
         * @see _.property
         */
        property<TObj, TResult>(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>;
    }


interface LoDashImplicitArrayWrapper<T> {
        /**
         * @see _.property
         */
        property<TObj, TResult>(): LoDashImplicitObjectWrapper<(obj: TObj) => TResult>;
    }


interface LoDashExplicitWrapper<T> {
        /**
         * @see _.property
         */
        property<TObj, TResult>(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>;
    }


interface LoDashExplicitArrayWrapper<T> {
        /**
         * @see _.property
         */
        property<TObj, TResult>(): LoDashExplicitObjectWrapper<(obj: TObj) => TResult>;
    }


//_.propertyOf
interface LoDashStatic {
        /**
         * The opposite of _.property; this method creates a function that returns the property value at a given path
         * on object.
         *
         * @param object The object to query.
         * @return Returns the new function.
         */
        propertyOf<T extends {}>(object: T): (path: string|string[]) => any;
    }


interface LoDashImplicitObjectWrapper<T> {
        /**
         * @see _.propertyOf
         */
        propertyOf(): LoDashImplicitObjectWrapper<(path: string|string[]) => any>;
    }


interface LoDashExplicitObjectWrapper<T> {
        /**
         * @see _.propertyOf
         */
        propertyOf(): LoDashExplicitObjectWrapper<(path: string|string[]) => any>;
    }


//_.range
interface LoDashStatic {
        /**
         * Creates an array of numbers (positive and/or negative) progressing from start up to, but not including, end.
         * If end is not specified it’s set to start with start then set to 0. If end is less than start a zero-length
         * range is created unless a negative step is specified.
         *
         * @param start The start of the range.
         * @param end The end of the range.
         * @param step The value to increment or decrement by.
         * @return Returns a new range array.
         */
        range(
            start: number,
            end: number,
            step?: number
        ): number[];

        /**
         * @see _.range
         */
        range(
            end: number,
            step?: number
        ): number[];
    }


interface LoDashImplicitWrapper<T> {
        /**
         * @see _.range
         */
        range(
            end?: number,
            step?: number
        ): LoDashImplicitArrayWrapper<number>;
    }


interface LoDashExplicitWrapper<T> {
        /**
         * @see _.range
         */
        range(
            end?: number,
            step?: number
        ): LoDashExplicitArrayWrapper<number>;
    }


//_.rangeRight
interface LoDashStatic {
        /**
         * This method is like `_.range` except that it populates values in
         * descending order.
         *
         * @static
         * @memberOf _
         * @category Util
         * @param {number} [start=0] The start of the range.
         * @param {number} end The end of the range.
         * @param {number} [step=1] The value to increment or decrement by.
         * @returns {Array} Returns the new array of numbers.
         * @example
         *
         * _.rangeRight(4);
         * // => [3, 2, 1, 0]
         *
         * _.rangeRight(-4);
         * // => [-3, -2, -1, 0]
         *
         * _.rangeRight(1, 5);
         * // => [4, 3, 2, 1]
         *
         * _.rangeRight(0, 20, 5);
         * // => [15, 10, 5, 0]
         *
         * _.rangeRight(0, -4, -1);
         * // => [-3, -2, -1, 0]
         *
         * _.rangeRight(1, 4, 0);
         * // => [1, 1, 1]
         *
         * _.rangeRight(0);
         * // => []
         */
        rangeRight(
            start: number,
            end: number,
            step?: number
        ): number[];

        /**
         * @see _.rangeRight
         */
        rangeRight(
            end: number,
            step?: number
        ): number[];
    }


interface LoDashImplicitWrapper<T> {
        /**
         * @see _.rangeRight
         */
        rangeRight(
            end?: number,
            step?: number
        ): LoDashImplicitArrayWrapper<number>;
    }


interface LoDashExplicitWrapper<T> {
        /**
         * @see _.rangeRight
         */
        rangeRight(
            end?: number,
            step?: number
        ): LoDashExplicitArrayWrapper<number>;
    }


//_.runInContext
interface LoDashStatic {
        /**
         * Create a new pristine lodash function using the given context object.
         *
         * @param context The context object.
         * @return Returns a new lodash function.
         */
        runInContext(context?: Object): typeof _;
    }


interface LoDashImplicitObjectWrapper<T> {
        /**
         * @see _.runInContext
         */
        runInContext(): typeof _;
    }


//_.times
interface LoDashStatic {
        /**
         * Invokes the iteratee function n times, returning an array of the results of each invocation. The iteratee
         * is invoked with one argument; (index).
         *
         * @param n The number of times to invoke iteratee.
         * @param iteratee The function invoked per iteration.
         * @return Returns the array of results.
         */
        times<TResult>(
            n: number,
            iteratee: (num: number) => TResult
        ): TResult[];

        /**
         * @see _.times
         */
        times(n: number): number[];
    }


interface LoDashImplicitWrapper<T> {
        /**
         * @see _.times
         */
        times<TResult>(
            iteratee: (num: number) => TResult
        ): TResult[];

        /**
         * @see _.times
         */
        times(): number[];
    }


interface LoDashExplicitWrapper<T> {
        /**
         * @see _.times
         */
        times<TResult>(
            iteratee: (num: number) => TResult
        ): LoDashExplicitArrayWrapper<TResult>;

        /**
         * @see _.times
         */
        times(): LoDashExplicitArrayWrapper<number>;
    }


//_.toPath
interface LoDashStatic {
        /**
         * Converts `value` to a property path array.
         *
         * @static
         * @memberOf _
         * @category Util
         * @param {*} value The value to convert.
         * @returns {Array} Returns the new property path array.
         * @example
         *
         * _.toPath('a.b.c');
         * // => ['a', 'b', 'c']
         *
         * _.toPath('a[0].b.c');
         * // => ['a', '0', 'b', 'c']
         *
         * var path = ['a', 'b', 'c'],
         *     newPath = _.toPath(path);
         *
         * console.log(newPath);
         * // => ['a', 'b', 'c']
         *
         * console.log(path === newPath);
         * // => false
         */
        toPath(value: any): string[];
    }


interface LoDashImplicitWrapperBase<T, TWrapper> {
        /**
         * @see _.toPath
         */
        toPath(): LoDashImplicitWrapper<string[]>;
    }


interface LoDashExplicitWrapperBase<T, TWrapper> {
        /**
         * @see _.toPath
         */
        toPath(): LoDashExplicitWrapper<string[]>;
    }


//_.uniqueId
interface LoDashStatic {
        /**
         * Generates a unique ID. If prefix is provided the ID is appended to it.
         *
         * @param prefix The value to prefix the ID with.
         * @return Returns the unique ID.
         */
        uniqueId(prefix?: string): string;
    }


interface LoDashImplicitWrapper<T> {
        /**
         * @see _.uniqueId
         */
        uniqueId(): string;
    }


interface LoDashExplicitWrapper<T> {
        /**
         * @see _.uniqueId
         */
        uniqueId(): LoDashExplicitWrapper<string>;
    }


interface ListIterator<T, TResult> {
        (value: T, index: number, collection: List<T>): TResult;
    }


interface DictionaryIterator<T, TResult> {
        (value: T, key?: string, collection?: Dictionary<T>): TResult;
    }


interface NumericDictionaryIterator<T, TResult> {
        (value: T, key?: number, collection?: Dictionary<T>): TResult;
    }


interface ObjectIterator<T, TResult> {
        (element: T, key?: string, collection?: any): TResult;
    }


interface StringIterator<TResult> {
        (char: string, index?: number, string?: string): TResult;
    }


interface MemoVoidIterator<T, TResult> {
        (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): void;
    }


interface MemoIterator<T, TResult> {
        (prev: TResult, curr: T, indexOrKey?: any, list?: T[]): TResult;
    }


interface MemoVoidArrayIterator<T, TResult> {
        (acc: TResult, curr: T, index?: number, arr?: T[]): void;
    }


interface MemoVoidDictionaryIterator<T, TResult> {
        (acc: TResult, curr: T, key?: string, dict?: Dictionary<T>): void;
    }


//interface Collection<T> {}
// Common interface between Arrays and jQuery objects
interface List<T> {
        [index: number]: T;
        length: number;
    }


interface Dictionary<T> {
        [index: string]: T;
    }


interface NumericDictionary<T> {
        [index: number]: T;
    }


interface StringRepresentable {
        toString(): string;
    }


interface Cancelable {
        cancel(): void;
    }


// Backward compatibility with --target es5
interface Set<T> {}


interface Map<K, V> {}


interface WeakSet<T> {}


interface WeakMap<K, V> {}


type PH = LoDashStatic;


function P13_On_doSet(o: PropertyOperation) {
    console.log('P13_On_doSet: ', o.value);
}


export function S12_Switch_doSet(o: PropertyOperation) {
    if (o.pid == null) {
        return;
    }

    switch (o.pid.iid) {
        case 13:
            P13_On_doSet(o);
            break;

        default:
            o.status = OperationStatus.PROPERTY_NOT_FOUND;
            break;
    }
}


(
  props: DashboardHeaderProps,
  ref: React.Ref<HTMLDivElement>
) => {
  const { asPublicHeader = false, subHeader, className, ...otherProps } = props;

  const classes = useStyles();

  return (
    <header
      ref={ref}
      className={c(className, classes.root, {
        [classes.publicHeader]: asPublicHeader
      })}


interface DashboardHeaderBaseProps {
  className?: string;
  asPublicHeader?: boolean;
  subHeader?: JSX.Element;
}


type DashboardHeaderProps = Omit<
  React.ComponentPropsWithRef<"div">,
  keyof DashboardHeaderBaseProps
> &
  DashboardHeaderBaseProps;


c(className, classes


({
  size = 's',
  color,
  customSize,
}: IconProps): JSX.Element => (
  <div
    className={`fds-icon fds-icon--${size}`


() => log(`Running at http://localhost:${port}`)


/**
 * @ignore Exclude from docs
 * @todo Description
 */
export declare function fromArray<A>(array: Array<A>): Iterator<A>;


/**
 * @ignore Exclude from docs
 * @todo Description
 */
export declare function length<A>(iter: Iterator<A>): number;


/**
 * @ignore Exclude from docs
 * @todo Description
 */
export declare function toArray<A>(iter: Iterator<A>): Array<A>;


/**
 * [iter description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @type {Iterator<A>}
 */
export declare function eachContinue<A>(iter: Iterator<A>, fn: (value: A) => boolean): void;


/**
 * [iter description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @type {Iterator<A>}
 */
export declare function each<A>(iter: Iterator<A>, fn: (value: A) => void): void;


/**
 * [iter description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @type {Iterator<A>}
 */
export declare function sort<A>(iter: Iterator<A>, fn: (left: A, right: A) => Ordering): Iterator<A>;


/**
 * [A description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @type {[type]}
 */
export declare function map<A, B>(iter: Iterator<A>, fn: (value: A) => B): Iterator<B>;


/**
 * [iter description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @type {Iterator<A>}
 */
export declare function filter<A>(iter: Iterator<A>, fn: (value: A) => boolean): Iterator<A>;


/**
 * @ignore Exclude from docs
 * @todo Description
 */
export declare function concat<A>(...args: Array<Iterator<A>>): Iterator<A>;


/**
 * @ignore Exclude from docs
 * @todo Description
 */
export declare function flatten<A>(iter: Iterator<Iterator<A>>): Iterator<A>;


/**
 * [number description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @type {[type]}
 */
export declare function indexed<A>(iter: Iterator<A>): Iterator<[number, A]>;


/**
 * [iter description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @type {Iterator<A>}
 */
export declare function findIndex<A>(iter: Iterator<A>, matches: (value: A) => boolean): number;


/**
 * [iter description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @type {Iterator<A>}
 */
export declare function find<A>(iter: Iterator<A>, matches: (value: A) => boolean): A | undefined;


/**
 * [A description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @type {[type]}
 */
export declare function findMap<A, B>(iter: Iterator<A>, matches: (value: A) => B | null): B | undefined;


/**
 * [iter description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @type {Iterator<A>}
 */
export declare function contains<A>(iter: Iterator<A>, matches: (value: A) => boolean): boolean;


/**
 * [A description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @type {[type]}
 */
export declare function foldl<A, B>(iter: Iterator<A>, init: B, fn: (state: B, value: A) => B): B;


/**
 * [min description]
 *
 * @ignore Exclude from docs
 * @todo Verify that this works correctly
 * @todo Description
 * @param  {Iterator<number>} a [description]
 * @return {number}             [description]
 */
export declare function min(a: Iterator<number>): number | null;


/**
 * [max description]
 *
 * @ignore Exclude from docs
 * @todo Verify that this works correctly
 * @todo Description
 * @param  {Iterator<number>} a [description]
 * @return {number}             [description]
 */
export declare function max(a: Iterator<number>): number | null;


/**
 * [join description]
 *
 * @ignore Exclude from docs
 * @todo Description
 * @param  {Iterator<string>} iter [description]
 * @param  {string        =    ""}          separator [description]
 * @return {string}                [description]
 */
export declare function join(iter: Iterator<string>, separator?: string): string;


/**
 * @ignore Exclude from docs
 * @todo Description
 */
export declare class ListIterator<T extends IClone<T>> {
    private _listCopy;
    private _create;
    list: Iterable<T>;
    createNewItems: boolean;
    /**
     * Constructor
     *
     * @param {Iterable<T>} list [description]
     * @param {()       =>   T}           create [description]
     */
    constructor(list: Iterable<T>, create: () => T);
    reset(): void;
    clear(): void;
    getFirst(): $type.Optional<T>;
    getLast(): $type.Optional<T>;
    find(fn: (value: T) => boolean): $type.Optional<T>;
    removeItem(item: T): boolean;
    protected returnItem(index: number): $type.Optional<T>;
    iterator(): Iterator<T>;
}


/**
 * ============================================================================
 * UTILITY FUNCTIONS
 * ============================================================================
 * @hidden
 */
/**
 * @ignore Exclude from docs
 * @todo Description
 */
export interface Iterator<A> {
    (push: (value: A) => boolean): void;
}


/**
 * @ignore Exclude from docs
 * @todo Description
 */
export interface Iterable<A> {
    iterator(): Iterator<A>;
}


reset(): void;


clear(): void;


getFirst(): $type.Optional<T>;


getLast(): $type.Optional<T>;


find(fn: (value: T) => boolean): $type.Optional<T>;


removeItem(item: T): boolean;


protected returnItem(index: number): $type.Optional<T>;


iterator(): Iterator<T>;


(done) => {
		const payload = {};
		const resources = [{}, {}, {}];
		const result = {};
		const config: RedundancyConfig = {
			resources,
			index: 0,
			timeout: 200,
			rotate: 50,
			random: false,
			dataAfterTimeout: false,
		};

		// Tracking
		let isSync = true;
		const startTime = Date.now();
		let sentQuery = 0;
		let itemAborted = false;
		let secondItem: PendingQueryItem;

		// Send query
		const getStatus = sendQuery(
			config,
			payload,
			(resource, queryPayload, queryItem) => {
				expect(isSync).to.be.equal(false);
				expect(queryPayload).to.be.equal(payload);

				// Query should be executed 3 times
				expect(sentQuery < 3).to.be.equal(true);
				expect(resource).to.be.equal(resources[sentQuery]);

				// Check status
				expect(queryItem.getQueryStatus).to.be.equal(getStatus);
				const status = getStatus();
				expect(status.status).to.be.equal('pending');
				expect(status.payload).to.be.equal(payload);

				// Bump counter
				sentQuery++;

				// Tests specific to each query
				switch (sentQuery) {
					case 1:
						// First query
						expect(status.queriesSent).to.be.equal(1);
						expect(status.queriesPending).to.be.equal(1);

						// Add abort
						queryItem.abort = (): void => {
							done(
								'Abort should have not been called for first item'
							);
						};

						// Fail in 20ms
						setTimeout(() => {
							// Status should not have changed
							const status = getStatus();
							expect(status.queriesSent).to.be.equal(1);
							expect(status.queriesPending).to.be.equal(1);

							// Fail
							queryItem.done(void 0, true);
						}, 20);
						return;

					case 2:
						// Only second query should be pending
						expect(status.queriesSent).to.be.equal(2);
						expect(status.queriesPending).to.be.equal(1);

						// Add abort
						queryItem.abort = (): void => {
							done(
								'Abort should have not been called for second item'
							);
						};

						// Save item
						secondItem = queryItem;
						return;

					case 3:
						// 2nd and 3rd queries should be pending
						expect(status.queriesSent).to.be.equal(3);
						expect(status.queriesPending).to.be.equal(2);

						// Add abort
						queryItem.abort = (): void => {
							// This item should be aborted, but only once
							expect(itemAborted).to.be.equal(false);
							expect(sentQuery).to.be.equal(3);
							itemAborted = true;
						};

						// Complete second item
						secondItem.done(result);
						return;

					default:
						done('This code should not have been reached');
				}
			},
			(data, error) => {
				// Make sure queries were sent
				expect(sentQuery).to.be.equal(3);

				// Third query should have been aborted
				expect(itemAborted).to.be.equal(true);

				// Validate data
				expect(data).to.be.equal(result);
				expect(error).to.be.equal(void 0);

				// Check status
				const status = getStatus();
				expect(status.status).to.be.equal('completed');
				expect(status.queriesSent).to.be.equal(3);
				expect(status.queriesPending).to.be.equal(0);

				// 20ms from first query failing, 50ms from delay between second and third
				const diff = Date.now() - startTime;
				expect(diff > 50 && diff < 90).to.be.equal(
					true,
					`Time difference: ${diff}, should have been ~70ms`
				);

				done();
			}
		);

		// Check status
		const status = getStatus();
		expect(status.status).to.be.equal('pending');
		expect(status.queriesSent).to.be.equal(0);
		expect(status.queriesPending).to.be.equal(0);

		isSync = false;
	}


(resource, queryPayload, queryItem) => {
				expect(isSync).to.be.equal(false);
				expect(queryPayload).to.be.equal(payload);

				// Query should be executed 3 times
				expect(sentQuery < 3).to.be.equal(true);
				expect(resource).to.be.equal(resources[sentQuery]);

				// Check status
				expect(queryItem.getQueryStatus).to.be.equal(getStatus);
				const status = getStatus();
				expect(status.status).to.be.equal('pending');
				expect(status.payload).to.be.equal(payload);

				// Bump counter
				sentQuery++;

				// Tests specific to each query
				switch (sentQuery) {
					case 1:
						// First query
						expect(status.queriesSent).to.be.equal(1);
						expect(status.queriesPending).to.be.equal(1);

						// Add abort
						queryItem.abort = (): void => {
							done(
								'Abort should have not been called for first item'
							);
						};

						// Fail in 20ms
						setTimeout(() => {
							// Status should not have changed
							const status = getStatus();
							expect(status.queriesSent).to.be.equal(1);
							expect(status.queriesPending).to.be.equal(1);

							// Fail
							queryItem.done(void 0, true);
						}, 20);
						return;

					case 2:
						// Only second query should be pending
						expect(status.queriesSent).to.be.equal(2);
						expect(status.queriesPending).to.be.equal(1);

						// Add abort
						queryItem.abort = (): void => {
							done(
								'Abort should have not been called for second item'
							);
						};

						// Save item
						secondItem = queryItem;
						return;

					case 3:
						// 2nd and 3rd queries should be pending
						expect(status.queriesSent).to.be.equal(3);
						expect(status.queriesPending).to.be.equal(2);

						// Add abort
						queryItem.abort = (): void => {
							// This item should be aborted, but only once
							expect(itemAborted).to.be.equal(false);
							expect(sentQuery).to.be.equal(3);
							itemAborted = true;
						};

						// Complete second item
						secondItem.done(result);
						return;

					default:
						done('This code should not have been reached');
				}
			}


(): void => {
							done(
								'Abort should have not been called for first item'
							);
						}


() => {
							// Status should not have changed
							const status = getStatus();
							expect(status.queriesSent).to.be.equal(1);
							expect(status.queriesPending).to.be.equal(1);

							// Fail
							queryItem.done(void 0, true);
						}


(): void => {
							done(
								'Abort should have not been called for second item'
							);
						}


(): void => {
							// This item should be aborted, but only once
							expect(itemAborted).to.be.equal(false);
							expect(sentQuery).to.be.equal(3);
							itemAborted = true;
						}


(data, error) => {
				// Make sure queries were sent
				expect(sentQuery).to.be.equal(3);

				// Third query should have been aborted
				expect(itemAborted).to.be.equal(true);

				// Validate data
				expect(data).to.be.equal(result);
				expect(error).to.be.equal(void 0);

				// Check status
				const status = getStatus();
				expect(status.status).to.be.equal('completed');
				expect(status.queriesSent).to.be.equal(3);
				expect(status.queriesPending).to.be.equal(0);

				// 20ms from first query failing, 50ms from delay between second and third
				const diff = Date.now() - startTime;
				expect(diff > 50 && diff < 90).to.be.equal(
					true,
					`Time difference: ${diff}, should have been ~70ms`
				);

				done();
			}


(done) => {
		const payload = {};
		const resources = [{}, {}];
		const result1 = {};
		const result2 = {};
		const config: RedundancyConfig = {
			resources,
			index: 0,
			timeout: 200,
			rotate: 50,
			random: false,
			dataAfterTimeout: false,
		};

		// Tracking
		let isSync = true;
		const startTime = Date.now();
		let sentQuery = 0;
		let itemAborted = false;
		let firstItem: PendingQueryItem;

		// Send query
		const getStatus = sendQuery(
			config,
			payload,
			(resource, queryPayload, queryItem) => {
				expect(isSync).to.be.equal(false);
				expect(queryPayload).to.be.equal(payload);

				// Query should be executed 2 times
				expect(sentQuery < 2).to.be.equal(true);
				expect(resource).to.be.equal(resources[sentQuery]);

				// Check status
				expect(queryItem.getQueryStatus).to.be.equal(getStatus);
				const status = getStatus();
				expect(status.status).to.be.equal('pending');
				expect(status.payload).to.be.equal(payload);

				// Bump counter
				sentQuery++;

				// Tests specific to each query
				switch (sentQuery) {
					case 1:
						// First query
						expect(status.queriesSent).to.be.equal(1);
						expect(status.queriesPending).to.be.equal(1);

						// Add abort
						queryItem.abort = (): void => {
							done(
								'Abort should have not been called for first item'
							);
						};

						// Store item
						firstItem = queryItem;
						return;

					case 2:
						// Both queries should be pending
						expect(status.queriesSent).to.be.equal(2);
						expect(status.queriesPending).to.be.equal(2);

						// Add abort
						queryItem.abort = (): void => {
							expect(itemAborted).to.be.equal(false);
							itemAborted = true;
						};

						// Complete first item in 20ms (70ms from start), then second item
						setTimeout(() => {
							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('pending');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(2);

							firstItem.done(result1);

							// Complete second item in 30 ms
							setTimeout(() => {
								expect(queryItem.status).to.be.equal('aborted');

								// Should not change anything because query is already complete
								queryItem.done(result2);

								// Finish test
								done();
							}, 30);
						}, 20);
						return;

					default:
						done('This code should not have been reached');
				}
			},
			(data, error) => {
				// Make sure queries were sent
				expect(sentQuery).to.be.equal(2);

				// Second query should have been aborted
				expect(itemAborted).to.be.equal(true);

				// Validate data
				expect(data).to.be.equal(result1);
				expect(error).to.be.equal(void 0);

				// Check status
				const status = getStatus();
				expect(status.status).to.be.equal('completed');
				expect(status.queriesSent).to.be.equal(2);
				expect(status.queriesPending).to.be.equal(0);

				// 50ms delay between queries, 20ms delay by test timer
				const diff = Date.now() - startTime;
				expect(diff > 50 && diff < 90).to.be.equal(
					true,
					`Time difference: ${diff}, should have been ~70ms`
				);

				// Do not finish: second item is still pending
			}
		);

		// Check status
		const status = getStatus();
		expect(status.status).to.be.equal('pending');
		expect(status.queriesSent).to.be.equal(0);
		expect(status.queriesPending).to.be.equal(0);

		isSync = false;
	}


(resource, queryPayload, queryItem) => {
				expect(isSync).to.be.equal(false);
				expect(queryPayload).to.be.equal(payload);

				// Query should be executed 2 times
				expect(sentQuery < 2).to.be.equal(true);
				expect(resource).to.be.equal(resources[sentQuery]);

				// Check status
				expect(queryItem.getQueryStatus).to.be.equal(getStatus);
				const status = getStatus();
				expect(status.status).to.be.equal('pending');
				expect(status.payload).to.be.equal(payload);

				// Bump counter
				sentQuery++;

				// Tests specific to each query
				switch (sentQuery) {
					case 1:
						// First query
						expect(status.queriesSent).to.be.equal(1);
						expect(status.queriesPending).to.be.equal(1);

						// Add abort
						queryItem.abort = (): void => {
							done(
								'Abort should have not been called for first item'
							);
						};

						// Store item
						firstItem = queryItem;
						return;

					case 2:
						// Both queries should be pending
						expect(status.queriesSent).to.be.equal(2);
						expect(status.queriesPending).to.be.equal(2);

						// Add abort
						queryItem.abort = (): void => {
							expect(itemAborted).to.be.equal(false);
							itemAborted = true;
						};

						// Complete first item in 20ms (70ms from start), then second item
						setTimeout(() => {
							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('pending');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(2);

							firstItem.done(result1);

							// Complete second item in 30 ms
							setTimeout(() => {
								expect(queryItem.status).to.be.equal('aborted');

								// Should not change anything because query is already complete
								queryItem.done(result2);

								// Finish test
								done();
							}, 30);
						}, 20);
						return;

					default:
						done('This code should not have been reached');
				}
			}


(): void => {
							expect(itemAborted).to.be.equal(false);
							itemAborted = true;
						}


() => {
							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('pending');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(2);

							firstItem.done(result1);

							// Complete second item in 30 ms
							setTimeout(() => {
								expect(queryItem.status).to.be.equal('aborted');

								// Should not change anything because query is already complete
								queryItem.done(result2);

								// Finish test
								done();
							}, 30);
						}


() => {
								expect(queryItem.status).to.be.equal('aborted');

								// Should not change anything because query is already complete
								queryItem.done(result2);

								// Finish test
								done();
							}


(data, error) => {
				// Make sure queries were sent
				expect(sentQuery).to.be.equal(2);

				// Second query should have been aborted
				expect(itemAborted).to.be.equal(true);

				// Validate data
				expect(data).to.be.equal(result1);
				expect(error).to.be.equal(void 0);

				// Check status
				const status = getStatus();
				expect(status.status).to.be.equal('completed');
				expect(status.queriesSent).to.be.equal(2);
				expect(status.queriesPending).to.be.equal(0);

				// 50ms delay between queries, 20ms delay by test timer
				const diff = Date.now() - startTime;
				expect(diff > 50 && diff < 90).to.be.equal(
					true,
					`Time difference: ${diff}, should have been ~70ms`
				);

				// Do not finish: second item is still pending
			}


(done) => {
		const payload = {};
		const resources = [{}, {}];
		const result = {};
		const config: RedundancyConfig = {
			resources,
			index: 0,
			timeout: 100,
			rotate: 25,
			random: false,
			dataAfterTimeout: false,
		};

		// Tracking
		let isSync = true;
		const startTime = Date.now();
		let sentQuery = 0;
		let item1Aborted = false;
		let item2Aborted = false;
		let firstItem: PendingQueryItem;
		let completeCount = 0;

		// Send query
		const getStatus = sendQuery(
			config,
			payload,
			(resource, queryPayload, queryItem) => {
				expect(isSync).to.be.equal(false);
				expect(queryPayload).to.be.equal(payload);

				// Query should be executed 2 times
				expect(sentQuery < 2).to.be.equal(true);
				expect(resource).to.be.equal(resources[sentQuery]);

				// Check status
				expect(queryItem.getQueryStatus).to.be.equal(getStatus);
				const status = getStatus();
				expect(status.status).to.be.equal('pending');
				expect(status.payload).to.be.equal(payload);

				// Bump counter
				sentQuery++;

				// Tests specific to each query
				switch (sentQuery) {
					case 1:
						// First query
						expect(status.queriesSent).to.be.equal(1);
						expect(status.queriesPending).to.be.equal(1);

						// Add abort
						queryItem.abort = (): void => {
							item1Aborted = true;
						};

						// Store item
						firstItem = queryItem;
						return;

					case 2:
						// Both queries should be pending
						expect(status.queriesSent).to.be.equal(2);
						expect(status.queriesPending).to.be.equal(2);

						// Add abort
						queryItem.abort = (): void => {
							item2Aborted = true;
						};
						return;

					default:
						done('This code should not have been reached');
				}
			},
			(data, error) => {
				// Make sure queries were sent
				expect(sentQuery).to.be.equal(2);

				// Bump couneter
				completeCount++;
				switch (completeCount) {
					case 1:
						// First call: time out
						((): void => {
							// Validate data
							expect(data).to.be.equal(void 0);
							expect(error).to.be.equal(void 0);

							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('failed');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(0);

							// 25ms delay between queries * 2 + 100ms timeout
							const diff = Date.now() - startTime;
							expect(diff > 130 && diff < 170).to.be.equal(
								true,
								`Time difference: ${diff}, should have been ~150ms`
							);

							// Send data from first query, which should be ignored because dataAfterTimeout is false
							firstItem.done(result);

							// Complete test
							done();
						})();
						return;

					default:
						done('Callback should have been called only once');
				}
			}
		);

		// Check status
		const status = getStatus();
		expect(status.status).to.be.equal('pending');
		expect(status.queriesSent).to.be.equal(0);
		expect(status.queriesPending).to.be.equal(0);

		isSync = false;
	}


(resource, queryPayload, queryItem) => {
				expect(isSync).to.be.equal(false);
				expect(queryPayload).to.be.equal(payload);

				// Query should be executed 2 times
				expect(sentQuery < 2).to.be.equal(true);
				expect(resource).to.be.equal(resources[sentQuery]);

				// Check status
				expect(queryItem.getQueryStatus).to.be.equal(getStatus);
				const status = getStatus();
				expect(status.status).to.be.equal('pending');
				expect(status.payload).to.be.equal(payload);

				// Bump counter
				sentQuery++;

				// Tests specific to each query
				switch (sentQuery) {
					case 1:
						// First query
						expect(status.queriesSent).to.be.equal(1);
						expect(status.queriesPending).to.be.equal(1);

						// Add abort
						queryItem.abort = (): void => {
							item1Aborted = true;
						};

						// Store item
						firstItem = queryItem;
						return;

					case 2:
						// Both queries should be pending
						expect(status.queriesSent).to.be.equal(2);
						expect(status.queriesPending).to.be.equal(2);

						// Add abort
						queryItem.abort = (): void => {
							item2Aborted = true;
						};
						return;

					default:
						done('This code should not have been reached');
				}
			}


(): void => {
							item1Aborted = true;
						}


(): void => {
							item2Aborted = true;
						}


(data, error) => {
				// Make sure queries were sent
				expect(sentQuery).to.be.equal(2);

				// Bump couneter
				completeCount++;
				switch (completeCount) {
					case 1:
						// First call: time out
						((): void => {
							// Validate data
							expect(data).to.be.equal(void 0);
							expect(error).to.be.equal(void 0);

							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('failed');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(0);

							// 25ms delay between queries * 2 + 100ms timeout
							const diff = Date.now() - startTime;
							expect(diff > 130 && diff < 170).to.be.equal(
								true,
								`Time difference: ${diff}, should have been ~150ms`
							);

							// Send data from first query, which should be ignored because dataAfterTimeout is false
							firstItem.done(result);

							// Complete test
							done();
						})();
						return;

					default:
						done('Callback should have been called only once');
				}
			}


(): void => {
							// Validate data
							expect(data).to.be.equal(void 0);
							expect(error).to.be.equal(void 0);

							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('failed');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(0);

							// 25ms delay between queries * 2 + 100ms timeout
							const diff = Date.now() - startTime;
							expect(diff > 130 && diff < 170).to.be.equal(
								true,
								`Time difference: ${diff}, should have been ~150ms`
							);

							// Send data from first query, which should be ignored because dataAfterTimeout is false
							firstItem.done(result);

							// Complete test
							done();
						}


(done) => {
		const payload = {};
		const resources = [{}, {}];
		const result = {};
		const config: RedundancyConfig = {
			resources,
			index: 0,
			timeout: 100,
			rotate: 25,
			random: false,
			dataAfterTimeout: true,
		};

		// Tracking
		let isSync = true;
		const startTime = Date.now();
		let sentQuery = 0;
		let item1Aborted = false;
		let item2Aborted = false;
		let firstItem: PendingQueryItem;
		let completeCount = 0;

		// Send query
		const getStatus = sendQuery(
			config,
			payload,
			(resource, queryPayload, queryItem) => {
				expect(isSync).to.be.equal(false);
				expect(queryPayload).to.be.equal(payload);

				// Query should be executed 2 times
				expect(sentQuery < 2).to.be.equal(true);
				expect(resource).to.be.equal(resources[sentQuery]);

				// Check status
				expect(queryItem.getQueryStatus).to.be.equal(getStatus);
				const status = getStatus();
				expect(status.status).to.be.equal('pending');
				expect(status.payload).to.be.equal(payload);

				// Bump counter
				sentQuery++;

				// Tests specific to each query
				switch (sentQuery) {
					case 1:
						// First query
						expect(status.queriesSent).to.be.equal(1);
						expect(status.queriesPending).to.be.equal(1);

						// Add abort
						queryItem.abort = (): void => {
							item1Aborted = true;
						};

						// Store item
						firstItem = queryItem;
						return;

					case 2:
						// Both queries should be pending
						expect(status.queriesSent).to.be.equal(2);
						expect(status.queriesPending).to.be.equal(2);

						// Add abort
						queryItem.abort = (): void => {
							item2Aborted = true;
						};
						return;

					default:
						done('This code should not have been reached');
				}
			},
			(data, error) => {
				// Make sure queries were sent
				expect(sentQuery).to.be.equal(2);

				// Bump couneter
				completeCount++;
				switch (completeCount) {
					case 1:
						// First call: time out
						((): void => {
							// Validate data
							expect(data).to.be.equal(void 0);
							expect(error).to.be.equal(void 0);

							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('failed');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(0);

							// 25ms delay between queries * 2 + 100ms timeout
							const diff = Date.now() - startTime;
							expect(diff > 130 && diff < 170).to.be.equal(
								true,
								`Time difference: ${diff}, should have been ~150ms`
							);

							// Send data from first query
							firstItem.done(result);
						})();
						return;

					case 2:
						// Second call: data
						((): void => {
							// Validate data
							expect(data).to.be.equal(result);
							expect(error).to.be.equal(void 0);

							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('completed');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(0);

							// Same as few lines above
							const diff = Date.now() - startTime;
							expect(diff > 130 && diff < 170).to.be.equal(
								true,
								`Time difference: ${diff}, should have been ~150ms`
							);

							// Done
							done();
						})();
						return;

					default:
						done('Callback should have been called only twice');
				}
			}
		);

		// Check status
		const status = getStatus();
		expect(status.status).to.be.equal('pending');
		expect(status.queriesSent).to.be.equal(0);
		expect(status.queriesPending).to.be.equal(0);

		isSync = false;
	}


(data, error) => {
				// Make sure queries were sent
				expect(sentQuery).to.be.equal(2);

				// Bump couneter
				completeCount++;
				switch (completeCount) {
					case 1:
						// First call: time out
						((): void => {
							// Validate data
							expect(data).to.be.equal(void 0);
							expect(error).to.be.equal(void 0);

							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('failed');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(0);

							// 25ms delay between queries * 2 + 100ms timeout
							const diff = Date.now() - startTime;
							expect(diff > 130 && diff < 170).to.be.equal(
								true,
								`Time difference: ${diff}, should have been ~150ms`
							);

							// Send data from first query
							firstItem.done(result);
						})();
						return;

					case 2:
						// Second call: data
						((): void => {
							// Validate data
							expect(data).to.be.equal(result);
							expect(error).to.be.equal(void 0);

							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('completed');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(0);

							// Same as few lines above
							const diff = Date.now() - startTime;
							expect(diff > 130 && diff < 170).to.be.equal(
								true,
								`Time difference: ${diff}, should have been ~150ms`
							);

							// Done
							done();
						})();
						return;

					default:
						done('Callback should have been called only twice');
				}
			}


(): void => {
							// Validate data
							expect(data).to.be.equal(void 0);
							expect(error).to.be.equal(void 0);

							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('failed');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(0);

							// 25ms delay between queries * 2 + 100ms timeout
							const diff = Date.now() - startTime;
							expect(diff > 130 && diff < 170).to.be.equal(
								true,
								`Time difference: ${diff}, should have been ~150ms`
							);

							// Send data from first query
							firstItem.done(result);
						}


(): void => {
							// Validate data
							expect(data).to.be.equal(result);
							expect(error).to.be.equal(void 0);

							// Check status
							const status = getStatus();
							expect(status.status).to.be.equal('completed');
							expect(status.queriesSent).to.be.equal(2);
							expect(status.queriesPending).to.be.equal(0);

							// Same as few lines above
							const diff = Date.now() - startTime;
							expect(diff > 130 && diff < 170).to.be.equal(
								true,
								`Time difference: ${diff}, should have been ~150ms`
							);

							// Done
							done();
						}


() => {
  const [open, setOpen] = React.useState(true);
  const [openSecondOverlay, setOpenSecondOverlay] = React.useState(false);
  const dimension = select('dimension', ['medium', 'large'], 'medium');

  const knobOpen = boolean('open', open);
  const knobSecondOpen = boolean('openSecondOverlay', openSecondOverlay);

  const onClose = () => {
    setOpen(!open);
    action('on close triggered')();
    updateKnob('open', !open);
  };

  const onCloseSecondOverlay = () => {
    setOpenSecondOverlay(!openSecondOverlay);
    action('on close triggered')();
    updateKnob('openSecondOverlay', !openSecondOverlay);
  }

  const openModal = () => {
    setOpen(true);
    updateKnob('open', !open);
  };

  const openSecondModal = () => {
    setOpenSecondOverlay(true);
    updateKnob('openSecondOverlay', true);
  };

  return (

      <Paragraph>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore
        magna aliqua.

        Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

        Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

      </Paragraph>

      <Button appearance="primary" onClick={openModal}>
        Open modal
      </Button>

      <FullscreenModal
        closeOnEscape={true}
        open={knobOpen}
        dimension={dimension}
        onClose={onClose}
        headerOptions={{
          heading: 'This is modal Heading',
          subHeading: 'This is modal subheading',
        }}


() => {
    setOpen(!open);
    action('on close triggered')();
    updateKnob('open', !open);
  }


() => {
    setOpenSecondOverlay(!openSecondOverlay);
    action('on close triggered')();
    updateKnob('openSecondOverlay', !openSecondOverlay);
  }


() => {
    setOpen(true);
    updateKnob('open', !open);
  }


() => {
    setOpenSecondOverlay(true);
    updateKnob('openSecondOverlay', true);
  }


() => {

  return (
    <>

mode="month"

      <DatePicker placeholder="Please select" mode="month" />

mode="year"

      <DatePicker placeholder="Please select" mode="year" />
    </>


type => Facilities


facilities => facilities.facility_type


@Entity()
export class Facility_Types {

    @PrimaryGeneratedColumn()
    id: number;

    @Column()
    facility_type: string;

    @Column({type: 'text'})
    description: string;

    @CreateDateColumn({type: 'timestamp'})
    created_at: Date;

    @UpdateDateColumn({type: 'timestamp'})
    updated_at: Date;

    @OneToMany(type => Facilities, facilities => facilities.facility_type)
    facility: Facilities[];
}


export class HelmReleaseMenu extends React.Component<Props> {
  @autobind()
  remove() {
    return releaseStore.remove(this.props.release);
  }

  @autobind()
  upgrade() {
    const { release, hideDetails } = this.props;

    createUpgradeChartTab(release);
    hideDetails && hideDetails();
  }

  @autobind()
  rollback() {
    ReleaseRollbackDialog.open(this.props.release);
  }

  renderContent() {
    const { release, toolbar } = this.props;

    if (!release) return;
    const hasRollback = release && release.getRevision() > 1;

    return (
      <>
        {hasRollback && (
          <MenuItem onClick={this.rollback}>
            <Icon material="history" interactive={toolbar} title={_i18n._(t`Rollback`)}/>
            <Trans>Rollback</Trans>
          </MenuItem>
        )}


interface Props extends MenuActionsProps {
  release: HelmRelease;
  hideDetails?(): void;
}


@autobind()
  remove() {
    return releaseStore.remove(this.props.release);
  }


@autobind()
  upgrade() {
    const { release, hideDetails } = this.props;

    createUpgradeChartTab(release);
    hideDetails && hideDetails();
  }


@autobind()
  rollback() {
    ReleaseRollbackDialog.open(this.props.release);
  }


renderContent() {
    const { release, toolbar } = this.props;

    if (!release) return;
    const hasRollback = release && release.getRevision() > 1;

    return (
      <>
        {hasRollback && (
          <MenuItem onClick={this.rollback}>
            <Icon material="history" interactive={toolbar} title={_i18n._(t`Rollback`)}/>
            <Trans>Rollback</Trans>
          </MenuItem>
        )}


cssNames("HelmReleaseMenu", className)


async function getTotalGenerated(opts: Record<string, string>) {
  const xchain = nonNullable(opts.xchain);
  const asset = nonNullable(opts.asset);
  if (xchain !== 'ethereum') throw new Error('only support ethereum currently');
  const configPath = nonNullable(opts.config);
  await bootstrap(configPath);
  const conn = await getDBConnection();
  const bridgeFeeDB = new BridgeFeeDB(conn);
  const ethAsset = new EthAsset(asset);

  const bridgeInFee = await bridgeFeeDB.getEthTotalGeneratedBridgeInFee(asset);
  const humanizeBridgeInFee = ethAsset.getHumanizedDescription(bridgeInFee);
  console.log('total bridge-in fee:', humanizeBridgeInFee);

  const bridgeOutFee = await bridgeFeeDB.getEthTotalGeneratedBridgeOutFee(asset);
  const humanizeBridgeOutFee = ethAsset.getHumanizedDescription(bridgeOutFee);
  console.log('total bridge-out fee:', humanizeBridgeOutFee);

  const bridgeFee = await bridgeFeeDB.getEthTotalGeneratedBridgeFee(asset);
  const humanizeBridgtFee = ethAsset.getHumanizedDescription(bridgeFee);
  console.log('total bridge fee:', humanizeBridgtFee);
}


async function getTotalWithdrawed(opts: Record<string, string>) {
  const xchain = nonNullable(opts.xchain);
  const asset = nonNullable(opts.asset);
  if (xchain !== 'ethereum') throw new Error('only support ethereum currently');
  const configPath = nonNullable(opts.config);
  await bootstrap(configPath);
  const conn = await getDBConnection();
  const bridgeFeeDB = new BridgeFeeDB(conn);
  const ethAsset = new EthAsset(asset);

  const withdrawedBridgeFee = await bridgeFeeDB.getEthTotalWithdrawedBridgeFee(asset);
  const humanizedWithdrawedBridgeFee = ethAsset.getHumanizedDescription(withdrawedBridgeFee);
  console.log('total withdrawed bridge fee:', humanizedWithdrawedBridgeFee);
}


async function getTotalAvailable(opts: Record<string, string>) {
  const xchain = nonNullable(opts.xchain);
  const asset = nonNullable(opts.asset);
  if (xchain !== 'ethereum') throw new Error('only support ethereum currently');
  const configPath = nonNullable(opts.config);
  await bootstrap(configPath);
  const conn = await getDBConnection();
  const bridgeFeeDB = new BridgeFeeDB(conn);
  const ethAsset = new EthAsset(asset);

  const withdrawedBridgeFee = await bridgeFeeDB.getEthTotalWithdrawedBridgeFee(asset);
  const generatedBridgeFee = await bridgeFeeDB.getEthTotalGeneratedBridgeFee(asset);
  const availableBridgeFee = new Amount(generatedBridgeFee, 0).sub(new Amount(withdrawedBridgeFee, 0)).toString(0);
  const humanizedAvailableBridgeFee = ethAsset.getHumanizedDescription(availableBridgeFee);
  console.log('total available bridge fee:', humanizedAvailableBridgeFee);
}


async function generateWithdrawTxSignature(opts: Record<string, string | string[]>) {
  const xchain = nonNullable(opts.xchain) as string;
  if (xchain !== 'ethereum') throw new Error('only support ethereum currently');
  const asset = nonNullable(opts.asset) as string;
  const ethAsset = new EthAsset(asset);
  const recipient = nonNullable(opts.recipient) as string[];
  const amount = nonNullable(opts.amount) as string[];
  if (recipient.length !== amount.length) throw new Error('recipient number should equal amount number');
  const configPath = nonNullable(opts.config) as string;
  await bootstrap(configPath);

  const withdrawRecords = recipient.map((r, i) => {
    return {
      ckbTxHash: WithdrawBridgeFeeTopic,
      token: asset,
      amount: BigNumber.from(ethAsset.parseAmount(amount[i])),
      recipient: r,
    };
  });
  const ethChain = new EthChain('verifier');
  const message = await ethChain.getUnlockMessageToSign(withdrawRecords);
  const privKeyPath = ForceBridgeCore.config.eth.privateKey;
  const privKey = parsePrivateKey(privKeyPath);
  const { v, r, s } = ecsign(Buffer.from(message.slice(2), 'hex'), Buffer.from(privKey.slice(2), 'hex'));
  console.log(`signature of withdraw tx: ${toRpcSig(v, r, s)}`);
}


async function sendWithdrawTx(opts: Record<string, string | string[] | boolean>) {
  const xchain = nonNullable(opts.xchain) as string;
  if (xchain !== 'ethereum') throw new Error('only support ethereum currently');
  const asset = nonNullable(opts.asset) as string;
  const ethAsset = new EthAsset(asset);
  const recipient = nonNullable(opts.recipient) as string[];
  const amount = nonNullable(opts.amount) as string[];
  const signature = nonNullable(opts.signature) as string[];
  if (recipient.length !== amount.length) throw new Error('recipient number should equal amount number');
  const configPath = nonNullable(opts.config) as string;
  await bootstrap(configPath);
  ForceBridgeCore.config.eth.privateKey = parsePrivateKey(ForceBridgeCore.config.eth.privateKey);

  const withdrawRecords = recipient.map((r, i) => {
    return {
      ckbTxHash: WithdrawBridgeFeeTopic,
      token: asset,
      amount: BigNumber.from(ethAsset.parseAmount(amount[i])),
      recipient: r,
    };
  });
  const ethChain = new EthChain('collector');
  const parsedSigs = signature.map((s) => s.slice(2));
  const txRes = await ethChain.sendWithdrawBridgeFeeTx(withdrawRecords, parsedSigs);
  if (opts.wait as boolean) {
    const receipt = await txRes.wait();
    if (receipt.status == 1) {
      console.log(`send withdraw tx sucess, tx hash: ${txRes.hash}`);
    } else {
      console.log(`send withdraw tx failed, tx receipt: ${receipt}`);
    }
  } else {
    console.log(`withdraw tx was sent, tx hash: ${txRes.hash}`);
  }
}


(r, i) => {
    return {
      ckbTxHash: WithdrawBridgeFeeTopic,
      token: asset,
      amount: BigNumber.from(ethAsset.parseAmount(amount[i])),
      recipient: r,
    };
  }


(s) => s.slice(2)


() => {
  const args = ['test'];
  let context: RedisContext;

  beforeEach(() => {
    context = new RedisContext(args as [string]);
  });
  describe('getChannel', () => {
    it('should return original channel', () => {
      expect(context.getChannel()).to.be.eql(args[0]);
    });
  });
}


() => {
    context = new RedisContext(args as [string]);
  }


() => {
    it('should return original channel', () => {
      expect(context.getChannel()).to.be.eql(args[0]);
    });
  }


() => {
      expect(context.getChannel()).to.be.eql(args[0]);
    }


/**
 *
Creates an assessment template for the assessment target that is specified by the ARN
 *          of the assessment target. If the service-linked role isn’t already registered, this action also creates and
 *          registers a service-linked role to grant Amazon Inspector access to AWS Services needed to
 *          perform security assessments.

 * @example
 * Use a bare-bones client and the command you need to make an API call.
 * ```javascript
 * import { InspectorClient, CreateAssessmentTemplateCommand } from "../../client-inspector/mod.ts";
 * // const { InspectorClient, CreateAssessmentTemplateCommand } = require("@aws-sdk/client-inspector"); // CommonJS import
 * const client = new InspectorClient(config);
 * const command = new CreateAssessmentTemplateCommand(input);
 * const response = await client.send(command);
 * ```
 *
 * @see {@link CreateAssessmentTemplateCommandInput} for command's `input` shape.
 * @see {@link CreateAssessmentTemplateCommandOutput} for command's `response` shape.
 * @see {@link InspectorClientResolvedConfig | config} for command's `input` shape.
 *
 */
export class CreateAssessmentTemplateCommand extends $Command<
  CreateAssessmentTemplateCommandInput,
  CreateAssessmentTemplateCommandOutput,
  InspectorClientResolvedConfig
> {
  // Start section: command_properties
  // End section: command_properties

  constructor(readonly input: CreateAssessmentTemplateCommandInput) {
    // Start section: command_constructor
    super();
    // End section: command_constructor
  }

  /**
   * @internal
   */
  resolveMiddleware(
    clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
    configuration: InspectorClientResolvedConfig,
    options?: __HttpHandlerOptions
  ): Handler<CreateAssessmentTemplateCommandInput, CreateAssessmentTemplateCommandOutput> {
    this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

    const stack = clientStack.concat(this.middlewareStack);

    const { logger } = configuration;
    const clientName = "InspectorClient";
    const commandName = "CreateAssessmentTemplateCommand";
    const handlerExecutionContext: HandlerExecutionContext = {
      logger,
      clientName,
      commandName,
      inputFilterSensitiveLog: CreateAssessmentTemplateRequest.filterSensitiveLog,
      outputFilterSensitiveLog: CreateAssessmentTemplateResponse.filterSensitiveLog,
    };
    const { requestHandler } = configuration;
    return stack.resolve(
      (request: FinalizeHandlerArguments<any>) =>
        requestHandler.handle(request.request as __HttpRequest, options || {}),
      handlerExecutionContext
    );
  }

  private serialize(input: CreateAssessmentTemplateCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
    return serializeAws_json1_1CreateAssessmentTemplateCommand(input, context);
  }

  private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateAssessmentTemplateCommandOutput> {
    return deserializeAws_json1_1CreateAssessmentTemplateCommand(output, context);
  }

  // Start section: command_body_extra
  // End section: command_body_extra
}


export interface CreateAssessmentTemplateCommandInput extends CreateAssessmentTemplateRequest {}


export interface CreateAssessmentTemplateCommandOutput extends CreateAssessmentTemplateResponse, __MetadataBearer {}


/**
   * @internal
   */
resolveMiddleware(
    clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
    configuration: InspectorClientResolvedConfig,
    options?: __HttpHandlerOptions
  ): Handler<CreateAssessmentTemplateCommandInput, CreateAssessmentTemplateCommandOutput> {
    this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

    const stack = clientStack.concat(this.middlewareStack);

    const { logger } = configuration;
    const clientName = "InspectorClient";
    const commandName = "CreateAssessmentTemplateCommand";
    const handlerExecutionContext: HandlerExecutionContext = {
      logger,
      clientName,
      commandName,
      inputFilterSensitiveLog: CreateAssessmentTemplateRequest.filterSensitiveLog,
      outputFilterSensitiveLog: CreateAssessmentTemplateResponse.filterSensitiveLog,
    };
    const { requestHandler } = configuration;
    return stack.resolve(
      (request: FinalizeHandlerArguments<any>) =>
        requestHandler.handle(request.request as __HttpRequest, options || {}),
      handlerExecutionContext
    );
  }


private serialize(input: CreateAssessmentTemplateCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
    return serializeAws_json1_1CreateAssessmentTemplateCommand(input, context);
  }


private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateAssessmentTemplateCommandOutput> {
    return deserializeAws_json1_1CreateAssessmentTemplateCommand(output, context);
  }


// Copyright (c) Wictor Wilén. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
/**
 * Configuration options for the generator
 */
export class GeneratorTeamsAppOptions {
    id: string;
    title: string;
    description: string;
    solutionName: string;
    packageName: string;
    name: string;
    shouldUseSubDir: boolean;
    libraryName: string;
    'skip-install': string;
    telemetry: boolean;
    namespace: string;
    developer: string;
    host: string;
    hostname: string;
    bot: boolean;
    mpnId?: string = undefined;
    updateBuildSystem: boolean = false;
    showLoadingIndicator: boolean = false;
    isFullScreen: boolean = false;

    reactComponents: boolean;
    websitePrefix: string;
    unitTestsEnabled: boolean;
    manifestVersion: string;
    updateManifestVersion: boolean = false; // Set to true when asked to update manifest
    useAzureAppInsights: boolean = false;
    azureAppInsightsKey?: string = undefined;

    /* Tabs */
    tab: boolean;
    tabTitle: string;
    tabName: string;
    tabUpperName: string;
    tabReactComponentName: string;
    tabSharePoint: boolean;
    tabSharePointHosts: string[] = [];
    tabScopes: string[];
    tabType: "configurable" | "static";
    tabSSO: boolean;
    tabSSOAppId: string;
    tabSSOAppUri: string;

    /* Bots */
    botid: string = '';
    botidEnv: string = "MICROSOFT_APP_ID";
    botidEnvSecret: string = "MICROSOFT_APP_PASSWORD";
    staticTab: boolean = false;
    staticTabName: string;
    staticTabTitle: string;
    staticTabClassName: string;
    botType: string = "";
    botTitle: string;
    botName: string;
    botClassName: string;
    botCallingEnabled: boolean = false;
    botFilesEnabled: boolean = false;
    /* Outgoing webhook */
    customBot: boolean;
    customBotTitle: string;
    customBotName: string;
    customBotClassName: string;
    /* Connector */
    connector: boolean;
    connectorId?: string = undefined;
    connectorType: string = '';
    connectorTitle: string;
    connectorName: string;
    connectorComponentName: string;
    /* Message extensions */
    messageExtension: boolean;
    messageExtensionHost: string = '';
    messageExtensionTitle: string;
    messageExtensionDescription: string;
    messageExtensionName: string;
    messageExtensionId: string;
    messageExtensionClassName: string;
    messagingExtensionBot: boolean; // indicates that we need to add a bot to host the messaging extension
    messagingExtensionType: string = "query";
    messagingExtensionActionContext?: string[] = undefined;
    messagingExtensionActionInputType: string | undefined = undefined;
    messagingExtensionActionResponseType?: string;
    messagingExtensionCanUpdateConfiguration: boolean = false;
    messagingExtensionActionResponseTypeConfig: boolean = false;
    /* manifest */
    existingManifest: any;
    /* Localization */
    localization: boolean;
    defaultLanguage: string | undefined;
    additionalLanguage: string | undefined;
}


function normalizeFilename(filename: string) {
		if (filename.startsWith('/@fs')) {
			filename = filename.slice('/@fs'.length);
		} else if (filename.startsWith('/') && !ancestor(filename, config.root.pathname)) {
			filename = new URL('.' + filename, config.root).pathname;
		}
		return filename;
	}


function relativeToRoot(pathname: string) {
		const arg = startsWithForwardSlash(pathname) ? '.' + pathname : pathname;
		const url = new URL(arg, config.root);
		return slash(fileURLToPath(url)) + url.search;
	}


(path: string) => path.startsWith(srcRootWeb)


(s) => s.stage === 'page'


interface AstroPluginOptions {
	config: AstroConfig;
	logging: LogOptions;
}


configResolved(_resolvedConfig) {
			resolvedConfig = _resolvedConfig;
			viteTransform = getViteTransform(resolvedConfig);
		}


configureServer(server) {
			viteDevServer = server;
		}


// note: don’t claim .astro files with resolveId() — it prevents Vite from transpiling the final JS (import.meta.globEager, etc.)
async resolveId(id, from) {
			// If resolving from an astro subresource such as a hoisted script,
			// we need to resolve relative paths ourselves.
			if (from) {
				const parsedFrom = parseAstroRequest(from);
				if (parsedFrom.query.astro && isRelativePath(id) && parsedFrom.query.type === 'script') {
					const filename = normalizeFilename(parsedFrom.filename);
					const resolvedURL = new URL(id, `file://${filename}`);
					const resolved = resolvedURL.pathname;
					if (isBrowserPath(resolved)) {
						return relativeToRoot(resolved + resolvedURL.search);
					}
					return slash(fileURLToPath(resolvedURL)) + resolvedURL.search;
				}
			}

			// serve sub-part requests (*?astro) as virtual modules
			const { query } = parseAstroRequest(id);
			if (query.astro) {
				// Convert /src/pages/index.astro?astro&type=style to /Users/name/
				// Because this needs to be the id for the Vite CSS plugin to property resolve
				// relative @imports.
				if (query.type === 'style' && isBrowserPath(id)) {
					return relativeToRoot(id);
				}

				return id;
			}
		}


async load(this: PluginContext, id, opts) {
			const parsedId = parseAstroRequest(id);
			const query = parsedId.query;
			if (!id.endsWith('.astro') && !query.astro) {
				return null;
			}

			const filename = normalizeFilename(parsedId.filename);
			const fileUrl = new URL(`file://${filename}`);
			let source = await fs.promises.readFile(fileUrl, 'utf-8');
			const isPage = fileUrl.pathname.startsWith(resolvePages(config).pathname);
			if (isPage && config._ctx.scripts.some((s) => s.stage === 'page')) {
				source += `\n<script src="${PAGE_SCRIPT_ID}" />`;
			}
			const compileProps = {
				config,
				filename,
				moduleId: id,
				source,
				ssr: Boolean(opts?.ssr),
				viteTransform,
			};
			if (query.astro) {
				if (query.type === 'style') {
					if (typeof query.index === 'undefined') {
						throw new Error(`Requests for Astro CSS must include an index.`);
					}

					const transformResult = await cachedCompilation(compileProps);

					// Track any CSS dependencies so that HMR is triggered when they change.
					await trackCSSDependencies.call(this, {
						viteDevServer,
						id,
						filename,
						deps: transformResult.rawCSSDeps,
					});
					const csses = transformResult.css;
					const code = csses[query.index];

					return {
						code,
					};
				} else if (query.type === 'script') {
					if (typeof query.index === 'undefined') {
						throw new Error(`Requests for hoisted scripts must include an index`);
					}
					// HMR hoisted script only exists to make them appear in the module graph.
					if (opts?.ssr) {
						return {
							code: `/* client hoisted script, empty in SSR: ${id} */`,
						};
					}

					const transformResult = await cachedCompilation(compileProps);
					const scripts = transformResult.scripts;
					const hoistedScript = scripts[query.index];

					if (!hoistedScript) {
						throw new Error(`No hoisted script at index ${query.index}`);
					}

					if (hoistedScript.type === 'external') {
						const src = hoistedScript.src!;
						if (src.startsWith('/') && !isBrowserPath(src)) {
							const publicDir = config.publicDir.pathname.replace(/\/$/, '').split('/').pop() + '/';
							throw new Error(
								`\n\n<script src="${src}"> references an asset in the "${publicDir}" directory. Please add the "is:inline" directive to keep this asset from being bundled.\n\nFile: ${filename}`
							);
						}
					}

					return {
						code:
							hoistedScript.type === 'inline'
								? hoistedScript.code!
								: `import "${hoistedScript.src!}";`,
					};
				}
			}

			try {
				const transformResult = await cachedCompilation(compileProps);
				const { fileId: file, fileUrl: url } = getFileInfo(id, config);

				// Compile all TypeScript to JavaScript.
				// Also, catches invalid JS/TS in the compiled output before returning.
				const { code, map } = await esbuild.transform(transformResult.code, {
					loader: 'ts',
					sourcemap: 'external',
					sourcefile: id,
					// Pass relevant Vite options, if needed:
					define: config.vite?.define,
				});

				let SUFFIX = '';
				SUFFIX += `\nconst $$file = ${JSON.stringify(file)};\nconst $$url = ${JSON.stringify(
					url
				)};export { $$file as file, $$url as url };\n`;
				// Add HMR handling in dev mode.
				if (!resolvedConfig.isProduction) {
					// HACK: extract dependencies from metadata until compiler static extraction handles them
					const metadata = transformResult.code.split('$$createMetadata(')[1].split('});\n')[0];
					const pattern = /specifier:\s*'([^']*)'/g;
					const deps = new Set();
					let match;
					while ((match = pattern.exec(metadata)?.[1])) {
						deps.add(match);
					}

					let i = 0;
					while (i < transformResult.scripts.length) {
						deps.add(`${id}?astro&type=script&index=${i}`);
						SUFFIX += `import "${id}?astro&type=script&index=${i}";`;
						i++;
					}

					SUFFIX += `\nif (import.meta.hot) {
						import.meta.hot.accept(mod => mod);
					}`;
				}
				// Add handling to inject scripts into each page JS bundle, if needed.
				if (isPage) {
					SUFFIX += `\nimport "${PAGE_SSR_SCRIPT_ID}";`;
				}

				return {
					code: `${code}${SUFFIX}`,
					map,
				};
			} catch (err: any) {
				// Verify frontmatter: a common reason that this plugin fails is that
				// the user provided invalid JS/TS in the component frontmatter.
				// If the frontmatter is invalid, the `err` object may be a compiler
				// panic or some other vague/confusing compiled error message.
				//
				// Before throwing, it is better to verify the frontmatter here, and
				// let esbuild throw a more specific exception if the code is invalid.
				// If frontmatter is valid or cannot be parsed, then continue.
				const scannedFrontmatter = FRONTMATTER_PARSE_REGEXP.exec(source);
				if (scannedFrontmatter) {
					try {
						await esbuild.transform(scannedFrontmatter[1], {
							loader: 'ts',
							sourcemap: false,
							sourcefile: id,
						});
					} catch (frontmatterErr: any) {
						// Improve the error by replacing the phrase "unexpected end of file"
						// with "unexpected end of frontmatter" in the esbuild error message.
						if (frontmatterErr && frontmatterErr.message) {
							frontmatterErr.message = frontmatterErr.message.replace(
								'end of file',
								'end of frontmatter'
							);
						}
						throw frontmatterErr;
					}
				}

				// improve compiler errors
				if (err.stack.includes('wasm-function')) {
					const search = new URLSearchParams({
						labels: 'compiler',
						title: '🐛 BUG: `@astrojs/compiler` panic',
						template: '---01-bug-report.yml',
						'bug-description': `\`@astrojs/compiler\` encountered an unrecoverable error when compiling the following file.

**${id.replace(fileURLToPath(config.root), '')}**
\`\`\`astro
${source}
\`\`\``,
					});
					err.url = `https://github.com/withastro/astro/issues/new?${search.toString()}`;
					err.message = `Error: Uh oh, the Astro compiler encountered an unrecoverable error!

    Please open
    a GitHub issue using the link below:
    ${err.url}`;

					if (logging.level !== 'debug') {
						// TODO: remove stack replacement when compiler throws better errors
						err.stack = `    at ${id}`;
					}
				}

				throw err;
			}
		}


async handleHotUpdate(context) {
			if (context.server.config.isProduction) return;
			return handleHotUpdate.call(this, context, config, logging);
		}


@Component({
  selector: 'app-task',
  template: `

          <input
            type="checkbox"
            [defaultChecked]="task?.state === 'TASK_ARCHIVED'"
            disabled="true"
            name="checked"
          />

          <input
            type="text"
            [value]="task?.title"
            readonly="true"
            placeholder="Input title"
          />

  `,
})
export class TaskComponent {
  @Input() task: Task;

  // tslint:disable-next-line: no-output-on-prefix
  @Output()
  onPinTask = new EventEmitter<Event>();

  // tslint:disable-next-line: no-output-on-prefix
  @Output()
  onArchiveTask = new EventEmitter<Event>();

  /**
 * Component method to trigger the onPin event
 * @param id string
 */
  onPin(id: any) {
    this.onPinTask.emit(id);
  }
  /**
   * Component method to trigger the onArchive event
   * @param id string
   */
  onArchive(id: any) {
    this.onArchiveTask.emit(id);
  }

}


/**
 * Component method to trigger the onPin event
 * @param id string
 */
onPin(id: any) {
    this.onPinTask.emit(id);
  }


/**
   * Component method to trigger the onArchive event
   * @param id string
   */
onArchive(id: any) {
    this.onArchiveTask.emit(id);
  }


function titleFromFile(c :Config, file :string, name :string) :string {
  let title = name
  if (title == "index") {
    let parent = Path.dir(file)
    if (parent == c.srcdirAbs) {
      return "Home"
    } else {
      title = Path.base(parent)
    }
  }
  // "foo-bar.baz" -> "Foo bar baz"
  return title[0].toUpperCase() + title.substr(1).replace(/[_\-\.]+/g, " ")
}


// The most minimal structured page is 8 bytes:
//---\n
//---\n
function hasMoreToRead(s :ReadState) :bool {
  return s.buf.length >= HEADER_READ_SIZE && s.buf.length % HEADER_READ_SIZE == 0
}


function fread(fd :number, buf :Buffer, offs :int) :Promise<int> {
  // dlog(`fread len=${buf.length - offs} from fd=${fd} into buf[${offs}]`)
  return fs.read(fd, buf, offs, buf.length - offs, null).then(r => r.bytesRead)
}


function freadSync(fd :number, buf :Buffer, offs :int, len :int) :int {
  // dlog(`freadSync len=${buf.length - offs} from fd=${fd} into buf[${offs}]`)
  return fs.readSync(fd, buf, offs, len, null)
}


async function readHeader(c :Config, fd :number, file :string) :Promise<ReadState> {
  let buf = Buffer.allocUnsafe(HEADER_READ_SIZE)
  let len = await fread(fd, buf, 0)
  let nread = HEADER_READ_SIZE
  let fm :FrontMatter|null = null
  let fmend = -1

  if (len > 7) { // The most minimal magic page is 8 bytes
    let i = 0  // index in buf

    // find start of front matter
    let fmstart = 0
    while (i < len) {
      let c = buf[i++]
      if (c != 0x2D) { // -
        if (c == 0x0A) {
          // ---\n
          fmstart = i
        }
        break
      }
    }
    if (fmstart) {
      // find end of front matter
      let index = i
      while (1) {
        index--  // to include "\n"
        let count = 0
        while (index < len) {
          let c = buf[index]
          if (fmend != -1) {
            if (c == 0x0A && count >= 3) {
              // found end; <LF> c{n,} <LF>
              //                        ^
              index++
              break
            } else if (c == 0x2D) { // -
              count++
            } else {
              fmend = -1
            }
          } else if (c == 0x0A) {
            // probably start
            fmend = index
          }
          index++
        }

        // Note: In case the header is larger than HEADER_READ_SIZE we may get a false positive
        //       here, indicating there's no header end, but in fact it is beyond what we read.
        if (fmend == -1 && len == nread) {
          buf = bufexpand(buf, HEADER_READ_SIZE)
          len += freadSync(fd, buf, len, HEADER_READ_SIZE)
          nread += HEADER_READ_SIZE
          index = i  // reset index
        } else {
          break
        }
      }

      if (fmend != -1) {
        try {
          fm = parseFrontMatter(buf.subarray(fmstart, fmend).toString("utf8"))
          fmend = index  // end of the last "\n---\n" <
        } catch (err) {
          console.error(
            `${c.relpath(file)}: Failed to parse header: ${err.message||err}; ` +
            `Treating this page as a verbatim file.`
          )
        }
      } else if (len > HEADER_READ_SIZE) {
        // in this case we read until the end of the file but found no ending \n---\n
        c.log(
          `suspicious: %q seems to have front matter ("---" at the beginning)` +
          ` but no ending "\\n---\\n" was found. Treating this page as a verbatim file.`,
          ()=>c.relpath(file)
        )
      }
    }
  }
  return {
    fd,
    buf: buf.subarray(0, len),
    fm,
    fmEndOffs: fmend,
  }
}


r => r.bytesRead


()=>c.relpath(file)


export default class Page {
  // internal
  _s :ReadState

  parent   :Page|null = null
  children :Page[] = []

  constructor(
    public title :string,
    public sfile :string,  // source filename (absolute path)
    public sext  :string,  // source file extension, e.g. ".md"
    public ofile :string,  // output filename (relative path)
    public url   :string,  // inter-site URL, e.g /foo/bar.html
    public meta  :FrontMatter|null,  // null if there is no front matter
    _s :ReadState,
  ) {
    this._s  = _s
  }

  toString() :string {
    return `Page(${this.title})`
  }

  // NOTE: Any properties in Page objects are visible within templates.
  // For this reason, helper functions like readAll are not part of the prototype.

  // readAll reads the complete page source
  //
  static readAll(p :Page) :Buffer {
    let buf = p._s.buf
    let hasMore = buf.length >= HEADER_READ_SIZE && buf.length % HEADER_READ_SIZE == 0
    if (p._s.fmEndOffs != -1) {
      // trim way front matter
      buf = buf.subarray(p._s.fmEndOffs)
    }
    let fd = p._s.fd
    if (hasMore) {
      // read rest
      while (1) {
        let z = buf.length
        buf = bufexpand(buf, REST_READ_SIZE)  // grow buffer
        let bytesRead = freadSync(fd, buf, z, REST_READ_SIZE)
        if (bytesRead < REST_READ_SIZE) {
          buf = buf.subarray(0, z + bytesRead)
          break
        }
      }
    }
    fs.close(fd)
    delete p._s
    return buf
  }

  static async read(c :Config, file :string, sext :string) :Promise<Page> {
    // dlog(`Page.read ${file}`)
    let fd = fs.openSync(file, "r")
    try {
      let _s = await readHeader(c, fd, file)
      let fm = _s.fm ; _s.fm = null
      let file_noext = file.substr(0, file.length - sext.length)  // a/b.md -> a/b
      let name = Path.base(file_noext)  // a/b -> b

      // figure out ofile and url
      let url = c.baseUrl
      let ofile = ""
      if (name == "index") {
        ofile = Path.join(Path.dir(c.relpath(file_noext)), "index.html")
        url += c.relpath(Path.dir(file)) + "/"
      } else {
        ofile = c.relpath(file_noext) + ".html"
        url += name + ".html"
      }

      return new Page(
        (fm && fm.title) || titleFromFile(c, file, name),
        file,
        sext,
        ofile,
        url,
        fm,
        _s,
      )
    } catch (err) {
      fs.closeSync(fd)
      throw err
    }
  }
}


interface ReadState {
  fd        :number    // source file read FD. -1 when invalid
  buf       :Buffer
  fm        :FrontMatter|null
  fmEndOffs :number  // offset in buf where front matter ends, -1 if no front matter
}


toString() :string {
    return `Page(${this.title})`
  }


// NOTE: Any properties in Page objects are visible within templates.
// For this reason, helper functions like readAll are not part of the prototype.
// readAll reads the complete page source
//
static readAll(p :Page) :Buffer {
    let buf = p._s.buf
    let hasMore = buf.length >= HEADER_READ_SIZE && buf.length % HEADER_READ_SIZE == 0
    if (p._s.fmEndOffs != -1) {
      // trim way front matter
      buf = buf.subarray(p._s.fmEndOffs)
    }
    let fd = p._s.fd
    if (hasMore) {
      // read rest
      while (1) {
        let z = buf.length
        buf = bufexpand(buf, REST_READ_SIZE)  // grow buffer
        let bytesRead = freadSync(fd, buf, z, REST_READ_SIZE)
        if (bytesRead < REST_READ_SIZE) {
          buf = buf.subarray(0, z + bytesRead)
          break
        }
      }
    }
    fs.close(fd)
    delete p._s
    return buf
  }


static async read(c :Config, file :string, sext :string) :Promise<Page> {
    // dlog(`Page.read ${file}`)
    let fd = fs.openSync(file, "r")
    try {
      let _s = await readHeader(c, fd, file)
      let fm = _s.fm ; _s.fm = null
      let file_noext = file.substr(0, file.length - sext.length)  // a/b.md -> a/b
      let name = Path.base(file_noext)  // a/b -> b

      // figure out ofile and url
      let url = c.baseUrl
      let ofile = ""
      if (name == "index") {
        ofile = Path.join(Path.dir(c.relpath(file_noext)), "index.html")
        url += c.relpath(Path.dir(file)) + "/"
      } else {
        ofile = c.relpath(file_noext) + ".html"
        url += name + ".html"
      }

      return new Page(
        (fm && fm.title) || titleFromFile(c, file, name),
        file,
        sext,
        ofile,
        url,
        fm,
        _s,
      )
    } catch (err) {
      fs.closeSync(fd)
      throw err
    }
  }


() => {
  let service: MoedaService;

  beforeEach(() => {
    TestBed.configureTestingModule({});
    service = TestBed.inject(MoedaService);
  });

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


() => {
    TestBed.configureTestingModule({});
    service = TestBed.inject(MoedaService);
  }


(theme: Theme) =>
    createStyles({
        root: {
            display: "flex",
        },
        drawer: {
            [theme.breakpoints.up("sm")]: {
                width: drawerWidth,
                flexShrink: 0,
            },
        },
        onlyMobile: {
            [theme.breakpoints.up("md")]: {
                display: "none",
            },
        },
        appBar: {
            background: "white",
            [theme.breakpoints.up("sm")]: {
                width: `calc(100% - ${drawerWidth}px)`,
                marginLeft: drawerWidth,
            },
        },
        menuButton: {
            color: theme.palette.primary.main,
            marginRight: theme.spacing(2),
            [theme.breakpoints.up("sm")]: {
                display: "none",
            },
        },
        // necessary for content to be below app bar
        toolbar: {
            ...theme.mixins.toolbar,
            height: 64,
        },
        drawerPaper: {
            width: drawerWidth,
        },
        topleft: {
            color: "#666666",
            fontSize: "xx-large",
            display: "flex",
            "justify-content": "center",
            "align-items": "center",
            height: 64,
        },
        content: {
            flexGrow: 1,
            paddingLeft: 12,
            display: "flex",
            flexDirection: "column",
            height: "100vh",
        },
    })