interface OnScreenKeyboardProps {
  /**
  * Capture a ref to the background behind the modal
  */
  backdropRef: RefObject<HTMLDivElement>;
  /**
   * The [X, Y] coordinates where the keyboard's center should be rendered
   */
  coordinates: [number, number]
  /**
   * The text that's currently being searched
   */
  searchQuery: string;
  /**
   * A handler to update the search text
   */
  searchUpdateHandler: (arg0: string) => void;
  /**
   * A handler to initiate a search
   */
  triggerSearchHandler: () => void;
  /**
  * Whether to show the keyboard on screen
  */
  isVisible: boolean;
  /**
  * hide the keyboard
  */
  closeKeyboard: () => void;
}


/**
* Enum for handling the casing of the keyboard
*/
enum CASE {
  /** lowercase layout */
  DEFAULT,
  /** next character uppercase, then back to lowercase */
  SHIFTED,
  /** uppercase layout */
  LOCKED,
  /** next character lowercase, then back to uppercase */
  UNSHIFTED,
}


/**
 * <p>
 *       Deletes a Device Defender audit suppression.
 *     </p>
 * @example
 * Use a bare-bones client and the command you need to make an API call.
 * ```javascript
 * import { IoTClient, DeleteAuditSuppressionCommand } from "@aws-sdk/client-iot"; // ES Modules import
 * // const { IoTClient, DeleteAuditSuppressionCommand } = require("@aws-sdk/client-iot"); // CommonJS import
 * const client = new IoTClient(config);
 * const command = new DeleteAuditSuppressionCommand(input);
 * const response = await client.send(command);
 * ```
 *
 * @see {@link DeleteAuditSuppressionCommandInput} for command's `input` shape.
 * @see {@link DeleteAuditSuppressionCommandOutput} for command's `response` shape.
 * @see {@link IoTClientResolvedConfig | config} for command's `input` shape.
 *
 */
export class DeleteAuditSuppressionCommand extends $Command<
  DeleteAuditSuppressionCommandInput,
  DeleteAuditSuppressionCommandOutput,
  IoTClientResolvedConfig
> {
  // Start section: command_properties
  // End section: command_properties

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

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

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

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

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

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

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


export interface DeleteAuditSuppressionCommandInput extends DeleteAuditSuppressionRequest {}


export interface DeleteAuditSuppressionCommandOutput extends DeleteAuditSuppressionResponse, __MetadataBearer {}


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

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

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


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


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


export type CurrencyFormatOptions = Omit<
  Intl.NumberFormatOptions,
  'style' | 'currency'
>;


export type FractionalInputType = BigDecimal | bigint | number | string;


/**
 * A flow source that fetches the data from a UV or MagDir imagery tile layer.
 */
export class ImageryTileLayerFlowSource implements FlowSource {
  private imageryTileLayer: ImageryTileLayer;

  constructor(url: string) {
    this.imageryTileLayer = new ImageryTileLayer({ url });
  }

  async fetchFlowData(extent: Extent, width: Pixels, height: Pixels, signal: AbortSignal): Promise<FlowData> {
    const cellSize = settings.fixedCellSize;

    const columns = Math.round(width / cellSize);
    const rows = Math.round(height / cellSize);

    await this.imageryTileLayer.load(signal);
    const dataType = this.imageryTileLayer.rasterInfo.dataType;
    const rasterData = await this.imageryTileLayer.fetchPixels(
      extent,
      columns,
      rows,
      { signal }
    );
    // The returned data is in the "pixels" property of the pixel block
    // but from the perspective of animated-flow-ts those values are per-cell,
    // not per-pixel; a cell can span multiple pixels.
    const rawCellData: number[][] = rasterData.pixelBlock.pixels;
    const data = new Float32Array(columns * rows * 2);

    for (let i = 0; i < columns * rows; i++) {
      let u: PixelsPerSecond;
      let v: PixelsPerSecond;

      if (dataType === "vector-magdir") {
        const mag = rawCellData[0]![i]!;
        const dir = degreesToRadians(rawCellData[1]![i]!);
        const co = Math.cos(dir - Math.PI / 2);
        const si = Math.sin(dir - Math.PI / 2);
        u = co * mag;
        v = si * mag;
      } else if (dataType === "vector-uv") {
        u = rawCellData[0]![i]!;
        v = -rawCellData[1]![i]!;
      } else {
        console.error(
          `Unsupported data type "${dataType}"; the ImageryTileLayerFlowSource class only suppors "vector-magdir" and "vector-uv".`
        );
        u = 0;
        v = 0;
      }

      data[2 * i + 0] = u;
      data[2 * i + 1] = v;
    }

    return {
      data,
      columns,
      rows,
      cellSize
    };
  }

  destroy(): void {
    this.imageryTileLayer.destroy();
  }
}


/**
 * A flow source that uses a client-side velocity field defined in map units.
 */
export class VectorFieldFlowSource implements FlowSource {
  constructor(private mapVectorField: Field) {
  }

  async fetchFlowData(extent: Extent, width: Pixels, height: Pixels): Promise<FlowData> {
    const cellSize = settings.fixedCellSize;

    const columns = Math.round(width / cellSize);
    const rows = Math.round(height / cellSize);
    const data = new Float32Array(columns * rows * 2);

    for (let i = 0; i < rows; i++) {
      const y = i * cellSize;
      const yMap = extent.ymax + (extent.ymin - extent.ymax) * (y / height);

      for (let j = 0; j < columns; j++) {
        const x = j * cellSize;
        const xMap = extent.xmin + (extent.xmax - extent.xmin) * (x / width);
        const [u, v] = this.mapVectorField(xMap, yMap);
        data[2 * (i * columns + j) + 0] = u;
        data[2 * (i * columns + j) + 1] = v;
      }
    }

    return {
      data,
      columns,
      rows,
      cellSize
    };
  }

  destroy(): void {
  }
}


async fetchFlowData(extent: Extent, width: Pixels, height: Pixels, signal: AbortSignal): Promise<FlowData> {
    const cellSize = settings.fixedCellSize;

    const columns = Math.round(width / cellSize);
    const rows = Math.round(height / cellSize);

    await this.imageryTileLayer.load(signal);
    const dataType = this.imageryTileLayer.rasterInfo.dataType;
    const rasterData = await this.imageryTileLayer.fetchPixels(
      extent,
      columns,
      rows,
      { signal }
    );
    // The returned data is in the "pixels" property of the pixel block
    // but from the perspective of animated-flow-ts those values are per-cell,
    // not per-pixel; a cell can span multiple pixels.
    const rawCellData: number[][] = rasterData.pixelBlock.pixels;
    const data = new Float32Array(columns * rows * 2);

    for (let i = 0; i < columns * rows; i++) {
      let u: PixelsPerSecond;
      let v: PixelsPerSecond;

      if (dataType === "vector-magdir") {
        const mag = rawCellData[0]![i]!;
        const dir = degreesToRadians(rawCellData[1]![i]!);
        const co = Math.cos(dir - Math.PI / 2);
        const si = Math.sin(dir - Math.PI / 2);
        u = co * mag;
        v = si * mag;
      } else if (dataType === "vector-uv") {
        u = rawCellData[0]![i]!;
        v = -rawCellData[1]![i]!;
      } else {
        console.error(
          `Unsupported data type "${dataType}"; the ImageryTileLayerFlowSource class only suppors "vector-magdir" and "vector-uv".`
        );
        u = 0;
        v = 0;
      }

      data[2 * i + 0] = u;
      data[2 * i + 1] = v;
    }

    return {
      data,
      columns,
      rows,
      cellSize
    };
  }


destroy(): void {
    this.imageryTileLayer.destroy();
  }


async fetchFlowData(extent: Extent, width: Pixels, height: Pixels): Promise<FlowData> {
    const cellSize = settings.fixedCellSize;

    const columns = Math.round(width / cellSize);
    const rows = Math.round(height / cellSize);
    const data = new Float32Array(columns * rows * 2);

    for (let i = 0; i < rows; i++) {
      const y = i * cellSize;
      const yMap = extent.ymax + (extent.ymin - extent.ymax) * (y / height);

      for (let j = 0; j < columns; j++) {
        const x = j * cellSize;
        const xMap = extent.xmin + (extent.xmax - extent.xmin) * (x / width);
        const [u, v] = this.mapVectorField(xMap, yMap);
        data[2 * (i * columns + j) + 0] = u;
        data[2 * (i * columns + j) + 1] = v;
      }
    }

    return {
      data,
      columns,
      rows,
      cellSize
    };
  }


destroy(): void {
  }


/**
 * @example
 * import { none, some, getEq } from 'fp-ts/lib/Option'
 * import { eqNumber } from 'fp-ts/lib/Eq'
 *
 * const S = getEq(eqNumber)
 * assert.strictEqual(S.equals(none, none), true)
 * assert.strictEqual(S.equals(none, some(1)), false)
 * assert.strictEqual(S.equals(some(1), none), false)
 * assert.strictEqual(S.equals(some(1), some(2)), false)
 * assert.strictEqual(S.equals(some(1), some(1)), true)
 *
 * @since 1.19.0
 */
export declare function getEq<A>(E: Eq<A>): Eq<Option<A>>;


/**
 * @example
 * import { none, some, fromPredicate } from 'fp-ts/lib/Option'
 *
 * const positive = fromPredicate((n: number) => n >= 0)
 *
 * assert.deepStrictEqual(positive(-1), none)
 * assert.deepStrictEqual(positive(1), some(1))
 *
 * @since 1.0.0
 */
export declare function fromPredicate<A, B extends A>(predicate: Refinement<A, B>): (a: A) => Option<B>;


export declare function fromPredicate<A>(predicate: Predicate<A>): (a: A) => Option<A>;


/**
 * Returns an `L` value if possible
 *
 * @since 1.19.0
 */
export declare function getLeft<L, A>(ma: Either<L, A>): Option<L>;


/**
 * Returns an `A` value if possible
 *
 * @since 1.19.0
 */
export declare function getRight<L, A>(ma: Either<L, A>): Option<A>;


/**
 * @since 1.19.0
 */
export declare function fold<A, R>(onNone: () => R, onSome: (a: A) => R): (ma: Option<A>) => R;


/**
 * @since 1.19.0
 */
export declare function toNullable<A>(ma: Option<A>): A | null;


/**
 * @since 1.19.0
 */
export declare function toUndefined<A>(ma: Option<A>): A | undefined;


/**
 * @since 1.19.0
 */
export declare function getOrElse<A>(f: () => A): (ma: Option<A>) => A;


/**
 * @since 1.19.0
 */
export declare function elem<A>(E: Eq<A>): (a: A) => (ma: Option<A>) => boolean;


/**
 * @since 1.19.0
 */
export declare function exists<A>(predicate: Predicate<A>): (ma: Option<A>) => boolean;


/**
 * @since 1.19.0
 */
export declare function mapNullable<A, B>(f: (a: A) => B | null | undefined): (ma: Option<A>) => Option<B>;


export declare class Some<A> {
    readonly value: A;
    readonly _tag: 'Some';
    readonly _A: A;
    readonly _URI: URI;
    constructor(value: A);
    map<B>(f: (a: A) => B): Option<B>;
    mapNullable<B>(f: (a: A) => B | null | undefined): Option<B>;
    ap<B>(fab: Option<(a: A) => B>): Option<B>;
    ap_<B, C>(this: Option<(b: B) => C>, fb: Option<B>): Option<C>;
    chain<B>(f: (a: A) => Option<B>): Option<B>;
    reduce<B>(b: B, f: (b: B, a: A) => B): B;
    alt(fa: Option<A>): Option<A>;
    orElse(fa: Lazy<Option<A>>): Option<A>;
    extend<B>(f: (ea: Option<A>) => B): Option<B>;
    fold<B>(b: B, onSome: (a: A) => B): B;
    foldL<B>(onNone: () => B, onSome: (a: A) => B): B;
    getOrElse(a: A): A;
    getOrElseL(f: () => A): A;
    toNullable(): A | null;
    toUndefined(): A | undefined;
    inspect(): string;
    toString(): string;
    contains(E: Eq<A>, a: A): boolean;
    isNone(): this is None<A>;
    isSome(): this is Some<A>;
    exists(p: (a: A) => boolean): boolean;
    filter<B extends A>(p: Refinement<A, B>): Option<B>;
    filter(p: Predicate<A>): Option<A>;
    refine<B extends A>(refinement: Refinement<A, B>): Option<B>;
}


interface URItoKind<A> {
        Option: Option<A>;
    }


export declare type URI = typeof URI;


/**
 * @since 1.0.0
 */
export declare type Option<A> = None<A> | Some<A>;


/**
     * Takes a function `f` and an `Option` of `A`. Maps `f` either on `None` or `Some`, Option's data constructors. If it
     * maps on `Some` then it will apply the `f` on `Some`'s value, if it maps on `None` it will return `None`.
     *
     * @example
     * import { some } from 'fp-ts/lib/Option'
     *
     * assert.deepStrictEqual(some(1).map(n => n * 2), some(2))
     * @obsolete
     */
map<B>(f: (a: A) => B): Option<B>;


/**
     * Maps `f` over this `Option`'s value. If the value returned from `f` is null or undefined, returns `None`
     *
     * @example
     * import { none, some } from 'fp-ts/lib/Option'
     *
     * interface Foo {
     *   bar?: {
     *     baz?: string
     *   }
     * }
     *
     * assert.deepStrictEqual(
     *   some<Foo>({ bar: { baz: 'quux' } })
     *     .mapNullable(foo => foo.bar)
     *     .mapNullable(bar => bar.baz),
     *   some('quux')
     * )
     * assert.deepStrictEqual(
     *   some<Foo>({ bar: {} })
     *     .mapNullable(foo => foo.bar)
     *     .mapNullable(bar => bar.baz),
     *   none
     * )
     * assert.deepStrictEqual(
     *   some<Foo>({})
     *     .mapNullable(foo => foo.bar)
     *     .mapNullable(bar => bar.baz),
     *   none
     * )
     * @obsolete
     */
mapNullable<B>(f: (a: A) => B | null | undefined): Option<B>;


/**
     * `ap`, some may also call it "apply". Takes a function `fab` that is in the context of `Option`, and applies that
     * function to this `Option`'s value. If the `Option` calling `ap` is `none` it will return `none`.
     *
     * @example
     * import { some, none } from 'fp-ts/lib/Option'
     *
     * assert.deepStrictEqual(some(2).ap(some((x: number) => x + 1)), some(3))
     * assert.deepStrictEqual(none.ap(some((x: number) => x + 1)), none)
     * @obsolete
     */
ap<B>(fab: Option<(a: A) => B>): Option<B>;


/**
     * Flipped version of `ap`
     *
     * @example
     * import { some, none } from 'fp-ts/lib/Option'
     *
     * assert.deepStrictEqual(some((x: number) => x + 1).ap_(some(2)), some(3))
     * assert.deepStrictEqual(none.ap_(some(2)), none)
     * @obsolete
     */
ap_<B, C>(this: Option<(b: B) => C>, fb: Option<B>): Option<C>;


/**
     * Returns the result of applying f to this `Option`'s value if this `Option` is nonempty. Returns `None` if this
     * `Option` is empty. Slightly different from `map` in that `f` is expected to return an `Option` (which could be
     * `None`)
     * @obsolete
     */
chain<B>(f: (a: A) => Option<B>): Option<B>;


/** @obsolete */
reduce<B>(b: B, f: (b: B, a: A) => B): B;


/**
     * `alt` short for alternative, takes another `Option`. If this `Option` is a `Some` type then it will be returned, if
     * it is a `None` then it will return the next `Some` if it exist. If both are `None` then it will return `none`.
     *
     * @example
     * import { Option, some, none } from 'fp-ts/lib/Option'
     *
     * assert.deepStrictEqual(some(2).alt(some(4)), some(2))
     * const fa: Option<number> = none
     * assert.deepStrictEqual(fa.alt(some(4)), some(4))
     * @obsolete
     */
alt(fa: Option<A>): Option<A>;


/**
     * Lazy version of `alt`
     *
     * @example
     * import { some } from 'fp-ts/lib/Option'
     *
     * assert.deepStrictEqual(some(1).orElse(() => some(2)), some(1))
     *
     * @since 1.6.0
     * @obsolete
     */
orElse(fa: Lazy<Option<A>>): Option<A>;


/** @obsolete */
extend<B>(f: (ea: Option<A>) => B): Option<B>;


/**
     * Applies a function to each case in the data structure
     *
     * @example
     * import { none, some } from 'fp-ts/lib/Option'
     *
     * assert.strictEqual(some(1).fold('none', a => `some: ${a}`), 'some: 1')
     * assert.strictEqual(none.fold('none', a => `some: ${a}`), 'none')
     * @obsolete
     */
fold<B>(b: B, onSome: (a: A) => B): B;


/**
     * Lazy version of `fold`
     * @obsolete
     */
foldL<B>(onNone: () => B, onSome: (a: A) => B): B;


/**
     * Returns the value from this `Some` or the given argument if this is a `None`
     *
     * @example
     * import { Option, none, some } from 'fp-ts/lib/Option'
     *
     * assert.strictEqual(some(1).getOrElse(0), 1)
     * const fa: Option<number> = none
     * assert.strictEqual(fa.getOrElse(0), 0)
     * @obsolete
     */
getOrElse(a: A): A;


/**
     * Lazy version of `getOrElse`
     * @obsolete
     */
getOrElseL(f: () => A): A;


/**
     * Returns the value from this `Some` or `null` if this is a `None`
     * @obsolete
     */
toNullable(): A | null;


/**
     * Returns the value from this `Some` or `undefined` if this is a `None`
     * @obsolete
     */
toUndefined(): A | undefined;


inspect(): string;


toString(): string;


/**
     * Returns `true` if the option has an element that is equal (as determined by `S`) to `a`, `false` otherwise
     * @obsolete
     */
contains(E: Eq<A>, a: A): boolean;


/**
     * Returns `true` if the option is `None`, `false` otherwise
     * @obsolete
     */
isNone(): this is None<A>;


/**
     * Returns `true` if the option is an instance of `Some`, `false` otherwise
     * @obsolete
     */
isSome(): this is Some<A>;


/**
     * Returns `true` if this option is non empty and the predicate `p` returns `true` when applied to this Option's value
     * @obsolete
     */
exists(p: (a: A) => boolean): boolean;


/**
     * Returns this option if it is non empty and the predicate `p` return `true` when applied to this Option's value.
     * Otherwise returns `None`
     * @obsolete
     */
filter<B extends A>(p: Refinement<A, B>): Option<B>;


filter(p: Predicate<A>): Option<A>;


/**
     * Use `filter` instead.
     * Returns this option refined as `Option<B>` if it is non empty and the `refinement` returns `true` when applied to
     * this Option's value. Otherwise returns `None`
     * @since 1.3.0
     * @deprecated
     */
refine<B extends A>(refinement: Refinement<A, B>): Option<B>;


map<B>(f: (a: A) => B): Option<B>;


mapNullable<B>(f: (a: A) => B | null | undefined): Option<B>;


ap<B>(fab: Option<(a: A) => B>): Option<B>;


ap_<B, C>(this: Option<(b: B) => C>, fb: Option<B>): Option<C>;


chain<B>(f: (a: A) => Option<B>): Option<B>;


reduce<B>(b: B, f: (b: B, a: A) => B): B;


alt(fa: Option<A>): Option<A>;


orElse(fa: Lazy<Option<A>>): Option<A>;


extend<B>(f: (ea: Option<A>) => B): Option<B>;


fold<B>(b: B, onSome: (a: A) => B): B;


foldL<B>(onNone: () => B, onSome: (a: A) => B): B;


getOrElse(a: A): A;


getOrElseL(f: () => A): A;


toNullable(): A | null;


toUndefined(): A | undefined;


contains(E: Eq<A>, a: A): boolean;


isNone(): this is None<A>;


isSome(): this is Some<A>;


exists(p: (a: A) => boolean): boolean;


filter<B extends A>(p: Refinement<A, B>): Option<B>;


refine<B extends A>(refinement: Refinement<A, B>): Option<B>;


() => {
    let localizer: IMock<LocalizerService>;

    beforeEach(() => {
        document.title = '';

        localizer = Mock.ofType<LocalizerService>();

        localizer.setup(x => x.getOrKey(It.isAnyString()))
            .returns((key: string) => key.substr(5));
    });

    it('should instantiate', () => {
        const titleService = new TitleService(new TitlesConfig(), localizer.object);

        expect(titleService).toBeDefined();
    });

    it('should use single part if title element is pushed', () => {
        const titleService = new TitleService(new TitlesConfig(), localizer.object);

        titleService.push('i18n:my-title');

        expect(document.title).toBe('my-title');
    });

    it('should concatenate multiple parts if title elements are pushed', () => {
        const titleService = new TitleService(new TitlesConfig(), localizer.object);

        titleService.push('i18n:my-title1');
        titleService.push('i18n:my-title2');

        expect(document.title).toBe('my-title1 | my-title2');
    });

    it('should replace previous element if found', () => {
        const titleService = new TitleService(new TitlesConfig(), localizer.object);

        titleService.push('i18n:my-title1');
        titleService.push('i18n:my-title2');
        titleService.push('i18n:my-title3', 'i18n:my-title2');

        expect(document.title).toBe('my-title1 | my-title3');
    });

    it('should concatenate remainging parts if title elements are popped', () => {
        const titleService = new TitleService(new TitlesConfig(), localizer.object);

        titleService.push('i18n:my-title1');
        titleService.pop();

        expect(document.title).toBe('');
    });

    it('should prepand prefix to title', () => {
        const titleService = new TitleService(new TitlesConfig('i18n:prefix'), localizer.object);

        titleService.push('i18n:my-title');

        expect(document.title).toBe('prefix - my-title');
    });

    it('should append suffix to title', () => {
        const titleService = new TitleService(new TitlesConfig( undefined, 'i18n:suffix'), localizer.object);

        titleService.push('i18n:my-title');

        expect(document.title).toBe('my-title - suffix');
    });

    it('should use suffix if stack is empty', () => {
        const titleService = new TitleService(new TitlesConfig('i18n:prefix', 'i18n:suffix'), localizer.object);

        titleService.pop();

        expect(document.title).toBe('suffix');
    });

    it('should use suffix if stack is empty and no suffix is set', () => {
        const titleService = new TitleService(new TitlesConfig('i18n:prefix'), localizer.object);

        titleService.pop();

        expect(document.title).toBe('prefix');
    });
}


() => {
        document.title = '';

        localizer = Mock.ofType<LocalizerService>();

        localizer.setup(x => x.getOrKey(It.isAnyString()))
            .returns((key: string) => key.substr(5));
    }


x => x.getOrKey(It.isAnyString())


(key: string) => key.substr(5)


() => {
        const titleService = new TitleService(new TitlesConfig(), localizer.object);

        expect(titleService).toBeDefined();
    }


() => {
        const titleService = new TitleService(new TitlesConfig(), localizer.object);

        titleService.push('i18n:my-title');

        expect(document.title).toBe('my-title');
    }


() => {
        const titleService = new TitleService(new TitlesConfig(), localizer.object);

        titleService.push('i18n:my-title1');
        titleService.push('i18n:my-title2');

        expect(document.title).toBe('my-title1 | my-title2');
    }


() => {
        const titleService = new TitleService(new TitlesConfig(), localizer.object);

        titleService.push('i18n:my-title1');
        titleService.push('i18n:my-title2');
        titleService.push('i18n:my-title3', 'i18n:my-title2');

        expect(document.title).toBe('my-title1 | my-title3');
    }


() => {
        const titleService = new TitleService(new TitlesConfig(), localizer.object);

        titleService.push('i18n:my-title1');
        titleService.pop();

        expect(document.title).toBe('');
    }


() => {
        const titleService = new TitleService(new TitlesConfig('i18n:prefix'), localizer.object);

        titleService.push('i18n:my-title');

        expect(document.title).toBe('prefix - my-title');
    }


() => {
        const titleService = new TitleService(new TitlesConfig( undefined, 'i18n:suffix'), localizer.object);

        titleService.push('i18n:my-title');

        expect(document.title).toBe('my-title - suffix');
    }


() => {
        const titleService = new TitleService(new TitlesConfig('i18n:prefix', 'i18n:suffix'), localizer.object);

        titleService.pop();

        expect(document.title).toBe('suffix');
    }


() => {
        const titleService = new TitleService(new TitlesConfig('i18n:prefix'), localizer.object);

        titleService.pop();

        expect(document.title).toBe('prefix');
    }


@Component({
  selector: 'app-admin',
  templateUrl: './admin.component.html',
  styleUrls: ['./admin.component.scss']
})
export class AdminComponent {

  toggledValue = true;

  toggled(event) {
    this.toggledValue = event;
  }

}


toggled(event) {
    this.toggledValue = event;
  }


/**
 * An Application Insights workbook definition.
 */
export function getWorkbook(args: GetWorkbookArgs, opts?: pulumi.InvokeOptions): Promise<GetWorkbookResult> {
    if (!opts) {
        opts = {}
    }

    if (!opts.version) {
        opts.version = utilities.getVersion();
    }
    return pulumi.runtime.invoke("azure-native:insights/v20180617preview:getWorkbook", {
        "resourceGroupName": args.resourceGroupName,
        "resourceName": args.resourceName,
    }, opts);
}


export interface GetWorkbookArgs {
    /**
     * The name of the resource group. The name is case insensitive.
     */
    resourceGroupName: string;
    /**
     * The name of the Application Insights component resource.
     */
    resourceName: string;
}


/**
 * An Application Insights workbook definition.
 */
export interface GetWorkbookResult {
    /**
     * Workbook category, as defined by the user at creation time.
     */
    readonly category: string;
    /**
     * The user-defined name (display name) of the workbook.
     */
    readonly displayName: string;
    /**
     * Azure resource Id
     */
    readonly id: string;
    /**
     * The kind of workbook. Choices are user and shared.
     */
    readonly kind?: string;
    /**
     * Resource location
     */
    readonly location: string;
    /**
     * Azure resource name. This is GUID value. The display name should be assigned within properties field.
     */
    readonly name: string;
    /**
     * Configuration of this particular workbook. Configuration data is a string containing valid JSON
     */
    readonly serializedData: string;
    /**
     * ResourceId for a source resource.
     */
    readonly sourceId?: string;
    /**
     * Resource tags
     */
    readonly tags?: {[key: string]: string};
    /**
     * Date and time in UTC of the last modification that was made to this workbook definition.
     */
    readonly timeModified: string;
    /**
     * Azure resource type
     */
    readonly type: string;
    /**
     * Unique user id of the specific user that owns this workbook.
     */
    readonly userId: string;
    /**
     * Workbook version
     */
    readonly version?: string;
}


() => {
  const today = todayAsString();
  return [
    snippetCompletion(
      `${today} #{*} "#{}" "#{}"\n  #{Account:A}  #{Amount}\n  #{Account:B}`,
      {
        label: `${today} * transaction`,
      }
    ),
  ];
}


response => response.json().data as Hero


response => response.json().data as Hero[]


res => res.json().data as Hero


() => hero


// import { HEROES } from './mock-data/mock-heroes';
@Injectable() // Cú pháp
export class HeroService {
	// Khi xài lib webAPI đó, thì mặc định URL truy cập là nó
	private heroesUrl = 'api/heroes';
	// Tạo quy định dữ liệu khi trả về là JSON
	private headers = new Headers({'Content-Type': 'application/json'});

	constructor(private http: Http) { }

	getHero(id: number): Promise<Hero> {
  		// return this.getHeroes()
    //          .then(heroes => heroes.find(hero => hero.id === id));
    	const url = `${this.heroesUrl}/${id}`;
  		return this.http.get(url)
    		.toPromise()
    		.then(response => response.json().data as Hero)
    		.catch(this.handleError);
	}

	getHeroes(): Promise<Hero[]> {
  		return this.http.get(this.heroesUrl)
             .toPromise()
             .then(response => response.json().data as Hero[])
             .catch(this.handleError);
	}

	private handleError(error: any): Promise<any> {
  		console.error('An error occurred', error); // for demo purposes only
  		return Promise.reject(error.message || error);
	}

	// getHeroesSlowly(): Promise<Hero[]> {
	// 	return new Promise(resolve => {
	//     	// Simulate server latency with 2 second delay
	//     	setTimeout(() => resolve(this.getHeroes()), 2000);
	//   	});
	// }

	create(name: string): Promise<Hero> {
		return this.http
			.post(this.heroesUrl, JSON.stringify({name: name}), {headers: this.headers})
			.toPromise()
			.then(res => res.json().data as Hero)
			.catch(this.handleError);
	}

	update(hero: Hero): Promise<Hero> {
		const url = `${this.heroesUrl}/${hero.id}`;
		return this.http
			.put(url, JSON.stringify(hero), {headers: this.headers})
			.toPromise()
			.then(() => hero)
			.catch(this.handleError);
	}

	delete(id: number): Promise<void> {
	const url = `${this.heroesUrl}/${id}`;
		return this.http.delete(url, {headers: this.headers})
		.toPromise()
		.then(() => null)
		.catch(this.handleError);
	}
}


getHero(id: number): Promise<Hero> {
  		// return this.getHeroes()
    //          .then(heroes => heroes.find(hero => hero.id === id));
    	const url = `${this.heroesUrl}/${id}`;
  		return this.http.get(url)
    		.toPromise()
    		.then(response => response.json().data as Hero)
    		.catch(this.handleError);
	}


getHeroes(): Promise<Hero[]> {
  		return this.http.get(this.heroesUrl)
             .toPromise()
             .then(response => response.json().data as Hero[])
             .catch(this.handleError);
	}


private handleError(error: any): Promise<any> {
  		console.error('An error occurred', error); // for demo purposes only
  		return Promise.reject(error.message || error);
	}


// getHeroesSlowly(): Promise<Hero[]> {
// 	return new Promise(resolve => {
//     	// Simulate server latency with 2 second delay
//     	setTimeout(() => resolve(this.getHeroes()), 2000);
//   	});
// }
create(name: string): Promise<Hero> {
		return this.http
			.post(this.heroesUrl, JSON.stringify({name: name}), {headers: this.headers})
			.toPromise()
			.then(res => res.json().data as Hero)
			.catch(this.handleError);
	}


update(hero: Hero): Promise<Hero> {
		const url = `${this.heroesUrl}/${hero.id}`;
		return this.http
			.put(url, JSON.stringify(hero), {headers: this.headers})
			.toPromise()
			.then(() => hero)
			.catch(this.handleError);
	}


delete(id: number): Promise<void> {
	const url = `${this.heroesUrl}/${id}`;
		return this.http.delete(url, {headers: this.headers})
		.toPromise()
		.then(() => null)
		.catch(this.handleError);
	}


d => d.name


d => d.value


d => {
      return d.name === item.name && d.value === item.value && d.series === item.series;
    }


@Component({
  selector: 'ngx-charts-bar-vertical',
  template: `
    <ngx-charts-chart
      [view]="[width, height]"
      [showLegend]="legend"
      [legendOptions]="legendOptions"
      [activeEntries]="activeEntries"
      [animations]="animations"
      (legendLabelClick)="onClick($event)"
      (legendLabelActivate)="onActivate($event)"
      (legendLabelDeactivate)="onDeactivate($event)">
      <svg:g [attr.transform]="transform" class="bar-chart chart">
        <svg:g ngx-charts-x-axis
          *ngIf="xAxis"
          [xScale]="xScale"
          [dims]="dims"
          [showLabel]="showXAxisLabel"
          [labelText]="xAxisLabel"
          [tickFormatting]="xAxisTickFormatting"
          (dimensionsChanged)="updateXAxisHeight($event)">
        </svg:g>
        <svg:g ngx-charts-y-axis
          *ngIf="yAxis"
          [yScale]="yScale"
          [dims]="dims"
          [showGridLines]="showGridLines"
          [showLabel]="showYAxisLabel"
          [labelText]="yAxisLabel"
          [tickFormatting]="yAxisTickFormatting"
          (dimensionsChanged)="updateYAxisWidth($event)">
        </svg:g>
        <svg:g ngx-charts-series-vertical
          [xScale]="xScale"
          [yScale]="yScale"
          [colors]="colors"
          [series]="results"
          [dims]="dims"
          [gradient]="gradient"
          [tooltipDisabled]="tooltipDisabled"
          [tooltipTemplate]="tooltipTemplate"
          [activeEntries]="activeEntries"
          [roundEdges]="roundEdges"
          [animations]="animations"
          (activate)="onActivate($event)"
          (deactivate)="onDeactivate($event)"
          (select)="onClick($event)">
        </svg:g>
      </svg:g>
    </ngx-charts-chart>
  `,
  changeDetection: ChangeDetectionStrategy.OnPush,
  styleUrls: ['../common/base-chart.component.scss'],
  encapsulation: ViewEncapsulation.None
})
export class BarVerticalComponent extends BaseChartComponent {

  @Input() legend = false;
  @Input() legendTitle: string = 'Legend';
  @Input() xAxis;
  @Input() yAxis;
  @Input() showXAxisLabel;
  @Input() showYAxisLabel;
  @Input() xAxisLabel;
  @Input() yAxisLabel;
  @Input() tooltipDisabled: boolean = false;
  @Input() gradient: boolean;
  @Input() showGridLines: boolean = true;
  @Input() activeEntries: any[] = [];
  @Input() schemeType: string;
  @Input() xAxisTickFormatting: any;
  @Input() yAxisTickFormatting: any;
  @Input() barPadding = 8;
  @Input() roundDomains: boolean = false;
  @Input() roundEdges: boolean = true;
  @Input() yScaleMax: number;
  @Input() yScaleMin: number;

  @Output() activate: EventEmitter<any> = new EventEmitter();
  @Output() deactivate: EventEmitter<any> = new EventEmitter();

  @ContentChild('tooltipTemplate') tooltipTemplate: TemplateRef<any>;

  dims: ViewDimensions;
  xScale: any;
  yScale: any;
  xDomain: any;
  yDomain: any;
  transform: string;
  colors: ColorHelper;
  margin: any[] = [10, 20, 10, 20];
  xAxisHeight: number = 0;
  yAxisWidth: number = 0;
  legendOptions: any;

  update(): void {
    super.update();

    this.dims = calculateViewDimensions({
      width: this.width,
      height: this.height,
      margins: this.margin,
      showXAxis: this.xAxis,
      showYAxis: this.yAxis,
      xAxisHeight: this.xAxisHeight,
      yAxisWidth: this.yAxisWidth,
      showXLabel: this.showXAxisLabel,
      showYLabel: this.showYAxisLabel,
      showLegend: this.legend,
      legendType: this.schemeType
    });

    this.xScale = this.getXScale();
    this.yScale = this.getYScale();

    this.setColors();
    this.legendOptions = this.getLegendOptions();

    this.transform = `translate(${ this.dims.xOffset } , ${ this.margin[0] })`;
  }

  getXScale(): any {
    this.xDomain = this.getXDomain();
    const spacing = this.xDomain.length / (this.dims.width / this.barPadding + 1);
    return scaleBand()
      .rangeRound([0, this.dims.width])
      .paddingInner(spacing)
      .domain(this.xDomain);
  }

  getYScale(): any {
    this.yDomain = this.getYDomain();
    const scale = scaleLinear()
      .range([this.dims.height, 0])
      .domain(this.yDomain);
    return this.roundDomains ? scale.nice() : scale;
  }

  getXDomain(): any[] {
    return this.results.map(d => d.name);
  }

  getYDomain() {
    const values = this.results.map(d => d.value);

    const min = this.yScaleMin
      ? Math.min(this.yScaleMin, ...values)
      : Math.min(0, ...values);

    const max = this.yScaleMax
      ? Math.max(this.yScaleMax, ...values)
      : Math.max(...values);

    return [min, max];
  }

  onClick(data) {
    this.select.emit(data);
  }

  setColors(): void {
    let domain;
    if (this.schemeType === 'ordinal') {
      domain = this.xDomain;
    } else {
      domain = this.yDomain;
    }

    this.colors = new ColorHelper(this.scheme, this.schemeType, domain, this.customColors);
  }

  getLegendOptions() {
    const opts = {
      scaleType: this.schemeType,
      colors: undefined,
      domain: [],
      title: undefined
    };
    if (opts.scaleType === 'ordinal') {
      opts.domain = this.xDomain;
      opts.colors = this.colors;
      opts.title = this.legendTitle;
    } else {
      opts.domain = this.yDomain;
      opts.colors = this.colors.scale;
    }
    return opts;
  }

  updateYAxisWidth({ width }): void {
    this.yAxisWidth = width;
    this.update();
  }

  updateXAxisHeight({ height }): void {
    this.xAxisHeight = height;
    this.update();
  }

  onActivate(item) {
    const idx = this.activeEntries.findIndex(d => {
      return d.name === item.name && d.value === item.value && d.series === item.series;
    });
    if (idx > -1) {
      return;
    }

    this.activeEntries = [ item, ...this.activeEntries ];
    this.activate.emit({ value: item, entries: this.activeEntries });
  }

  onDeactivate(item) {
    const idx = this.activeEntries.findIndex(d => {
      return d.name === item.name && d.value === item.value && d.series === item.series;
    });

    this.activeEntries.splice(idx, 1);
    this.activeEntries = [...this.activeEntries];

    this.deactivate.emit({ value: item, entries: this.activeEntries });
  }

}


update(): void {
    super.update();

    this.dims = calculateViewDimensions({
      width: this.width,
      height: this.height,
      margins: this.margin,
      showXAxis: this.xAxis,
      showYAxis: this.yAxis,
      xAxisHeight: this.xAxisHeight,
      yAxisWidth: this.yAxisWidth,
      showXLabel: this.showXAxisLabel,
      showYLabel: this.showYAxisLabel,
      showLegend: this.legend,
      legendType: this.schemeType
    });

    this.xScale = this.getXScale();
    this.yScale = this.getYScale();

    this.setColors();
    this.legendOptions = this.getLegendOptions();

    this.transform = `translate(${ this.dims.xOffset } , ${ this.margin[0] })`;
  }


getXScale(): any {
    this.xDomain = this.getXDomain();
    const spacing = this.xDomain.length / (this.dims.width / this.barPadding + 1);
    return scaleBand()
      .rangeRound([0, this.dims.width])
      .paddingInner(spacing)
      .domain(this.xDomain);
  }


getYScale(): any {
    this.yDomain = this.getYDomain();
    const scale = scaleLinear()
      .range([this.dims.height, 0])
      .domain(this.yDomain);
    return this.roundDomains ? scale.nice() : scale;
  }


getXDomain(): any[] {
    return this.results.map(d => d.name);
  }


getYDomain() {
    const values = this.results.map(d => d.value);

    const min = this.yScaleMin
      ? Math.min(this.yScaleMin, ...values)
      : Math.min(0, ...values);

    const max = this.yScaleMax
      ? Math.max(this.yScaleMax, ...values)
      : Math.max(...values);

    return [min, max];
  }


onClick(data) {
    this.select.emit(data);
  }


setColors(): void {
    let domain;
    if (this.schemeType === 'ordinal') {
      domain = this.xDomain;
    } else {
      domain = this.yDomain;
    }

    this.colors = new ColorHelper(this.scheme, this.schemeType, domain, this.customColors);
  }


getLegendOptions() {
    const opts = {
      scaleType: this.schemeType,
      colors: undefined,
      domain: [],
      title: undefined
    };
    if (opts.scaleType === 'ordinal') {
      opts.domain = this.xDomain;
      opts.colors = this.colors;
      opts.title = this.legendTitle;
    } else {
      opts.domain = this.yDomain;
      opts.colors = this.colors.scale;
    }
    return opts;
  }


onActivate(item) {
    const idx = this.activeEntries.findIndex(d => {
      return d.name === item.name && d.value === item.value && d.series === item.series;
    });
    if (idx > -1) {
      return;
    }

    this.activeEntries = [ item, ...this.activeEntries ];
    this.activate.emit({ value: item, entries: this.activeEntries });
  }


onDeactivate(item) {
    const idx = this.activeEntries.findIndex(d => {
      return d.name === item.name && d.value === item.value && d.series === item.series;
    });

    this.activeEntries.splice(idx, 1);
    this.activeEntries = [...this.activeEntries];

    this.deactivate.emit({ value: item, entries: this.activeEntries });
  }


(config: DirectoryServiceClientConfig = {}) => {
  emitWarningIfUnsupportedVersion(process.version);
  const clientSharedValues = getSharedRuntimeConfig(config);
  return {
    ...clientSharedValues,
    ...config,
    runtime: "node",
    base64Decoder: config.base64Decoder ?? fromBase64,
    base64Encoder: config.base64Encoder ?? toBase64,
    bodyLengthChecker: config.bodyLengthChecker ?? calculateBodyLength,
    credentialDefaultProvider:
      config.credentialDefaultProvider ?? decorateDefaultCredentialProvider(credentialDefaultProvider),
    defaultUserAgentProvider:
      config.defaultUserAgentProvider ??
      defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
    maxAttempts: config.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
    region: config.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
    requestHandler: config.requestHandler ?? new NodeHttpHandler(),
    retryModeProvider: config.retryModeProvider ?? loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS),
    sha256: config.sha256 ?? Hash.bind(null, "sha256"),
    streamCollector: config.streamCollector ?? streamCollector,
    utf8Decoder: config.utf8Decoder ?? fromUtf8,
    utf8Encoder: config.utf8Encoder ?? toUtf8,
  };
}


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

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

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

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


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


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


(string: string, length: number): string => {
  return Array(length - string.length + 1).join('0') + string
}


(integer: number, byteLength: number): string => {
  return padLeftZero(Number(integer).toString(16), byteLength * 2)
}


(bytes: number[]): string => {
  return Buffer.from(bytes).toString('hex')
}


(integerString: string | number | BigNumber, byteLength: number): string => {
  const hex = (new BigNumber(integerString)).toString(16)
  return padLeftZero(hex, byteLength * 2)
}


(name: string): string => {
  return intToHex(ledgerspaces[name].charCodeAt(0), 2)
}


(address: string): string => {
  return (Buffer.from(decodeAccountID(address))).toString('hex')
}


(currency: string): string => {
  if (currency.length === 3) {
    const bytes = new Array(20 + 1).join('0').split('').map(parseFloat)
    bytes[12] = currency.charCodeAt(0) & 0xff
    bytes[13] = currency.charCodeAt(1) & 0xff
    bytes[14] = currency.charCodeAt(2) & 0xff
    return bytesToHex(bytes)
  }
  return currency
}


(hex: string): string => {
  const length = hex.length / 2
  if (length <= 192) {
    return bytesToHex([length]) + hex
  } else if (length <= 12480) {
    const x = length - 193
    return bytesToHex([193 + (x >>> 8), x & 0xff]) + hex
  } else if (length <= 918744) {
    const x = length - 12481
    return bytesToHex([241 + (x >>> 16), x >>> 8 & 0xff, x & 0xff]) + hex
  }
  throw new Error('Variable integer overflow.')
}


(txBlobHex: string): string => {
  const prefix = HashPrefix.TRANSACTION_ID.toString(16).toUpperCase()
  return sha512Half(prefix + txBlobHex)
}


(txJSON: any): string => {
  return computeBinaryTransactionHash(encode(txJSON))
}


(txBlobHex: string): string => {
  const prefix = HashPrefix.TRANSACTION_SIGN.toString(16).toUpperCase()
  return sha512Half(prefix + txBlobHex)
}


(txJSON: any): string => {
  return computeBinaryTransactionSigningHash(encode(txJSON))
}


(address: string): string => {
  return sha512Half(ledgerSpaceHex('account') + addressToHex(address))
}


(address: string): string => {
  return sha512Half(ledgerSpaceHex('signerList') +
              addressToHex(address) +
              '00000000') // uint32(0) signer list index
}


(address: string, sequence: number): string => {
  const prefix = '00' + intToHex(ledgerspaces.offer.charCodeAt(0), 1)
  return sha512Half(prefix + addressToHex(address) + intToHex(sequence, 4))
}


(address1: string, address2: string, currency: string): string => {
  const address1Hex = addressToHex(address1)
  const address2Hex = addressToHex(address2)

  const swap = (new BigNumber(address1Hex, 16)).greaterThan(
    new BigNumber(address2Hex, 16))
  const lowAddressHex = swap ? address2Hex : address1Hex
  const highAddressHex = swap ? address1Hex : address2Hex

  const prefix = ledgerSpaceHex('rippleState')
  return sha512Half(prefix + lowAddressHex + highAddressHex +
              currencyToHex(currency))
}


(transactions: any[]): string => {
  const shamap = new SHAMap()

  transactions.forEach(txJSON => {
    const txBlobHex = encode(txJSON)
    const metaHex = encode(txJSON.metaData)
    const txHash = computeBinaryTransactionHash(txBlobHex)
    const data = addLengthPrefix(txBlobHex) + addLengthPrefix(metaHex)
    shamap.addItem(txHash, data, NodeType.TRANSACTION_METADATA)
  })

  return shamap.hash
}


txJSON => {
    const txBlobHex = encode(txJSON)
    const metaHex = encode(txJSON.metaData)
    const txHash = computeBinaryTransactionHash(txBlobHex)
    const data = addLengthPrefix(txBlobHex) + addLengthPrefix(metaHex)
    shamap.addItem(txHash, data, NodeType.TRANSACTION_METADATA)
  }


(entries: any[]): string => {
  const shamap = new SHAMap()

  entries.forEach(ledgerEntry => {
    const data = encode(ledgerEntry)
    shamap.addItem(ledgerEntry.index, data, NodeType.ACCOUNT_STATE)
  })

  return shamap.hash
}


ledgerEntry => {
    const data = encode(ledgerEntry)
    shamap.addItem(ledgerEntry.index, data, NodeType.ACCOUNT_STATE)
  }


(ledgerHeader): string => {
  const prefix = HashPrefix.LEDGER.toString(16).toUpperCase()
  return sha512Half(prefix +
    intToHex(ledgerHeader.ledger_index, 4) +
    bigintToHex(ledgerHeader.total_coins, 8) +
    ledgerHeader.parent_hash +
    ledgerHeader.transaction_hash +
    ledgerHeader.account_hash +
    intToHex(ledgerHeader.parent_close_time, 4) +
    intToHex(ledgerHeader.close_time, 4) +
    intToHex(ledgerHeader.close_time_resolution, 1) +
    intToHex(ledgerHeader.close_flags, 1)
  )
}


(address, sequence): string => {
  return sha512Half(ledgerSpaceHex('escrow') + addressToHex(address) +
    intToHex(sequence, 4))
}


(address, dstAddress, sequence): string => {
  return sha512Half(ledgerSpaceHex('paychan') + addressToHex(address) +
    addressToHex(dstAddress) + intToHex(sequence, 4))
}


(
	plugins: Plugin[],
	apply: EmitFunc,
	cache: Cache
): EmitFunc => {
	if (__DEV__) {
		for (const ex of plugins) {
			if (!is.string(ex?.name)) {
				throw new Error(
					`plugin.name must be a non-empty string. Found: ${ex?.name}`
				);
			}

			if (!is.func(ex?.init)) {
				throw new Error(
					`plugin.init must be a function. Found: ${ex?.init}`
				);
			}
		}

		// No duplicated names allowed
		const names = plugins.map((e) => e.name);
		for (const name of names) {
			if (names.indexOf(name) !== names.lastIndexOf(name)) {
				throw new Error(
					`plugin names must be unique. ` +
						`Found two or more plugins with the name: ${name}`
				);
			}
		}
	}

	let emitInsidePlugins: EmitFunc = () => {
		throw new Error('Emitting during plugin setup is not allowed');
	};

	const emit = plugins
		.map((ex) =>
			ex.init({
				cache,
				emit: (op) => emitInsidePlugins(op),
			})
		)
		.reduce((a, b) => (o) => a(b(o)))(apply);

	emitInsidePlugins = (op) => {
		if (op.type === 'dispose') {
			throw new Error(
				'disposing queries inside plugins is not supported'
			);
		}

		return emit(op);
	};

	return emit;
}


(e) => e.name


() => {
		throw new Error('Emitting during plugin setup is not allowed');
	}


(ex) =>
			ex.init({
				cache,
				emit: (op) => emitInsidePlugins(op),
			})


(op) => emitInsidePlugins(op)


(a, b) => (o) => a(b(o))


(o) => a(b(o))


(op) => {
		if (op.type === 'dispose') {
			throw new Error(
				'disposing queries inside plugins is not supported'
			);
		}

		return emit(op);
	}


export interface PluginOptions {
	emit: EmitFunc;
	cache: Cache;
}


export interface Plugin {
	name: string;
	init: (o?: PluginOptions) => (next?: EmitFunc) => EmitFunc;
}


export type EmitFunc = (op: Operation) => Operation;


function throttle<T>(callback: Function, limit: number) {
	var waiting = false;

	return (...args: Array<T>) => {
		if (!waiting) {
			callback(...args);
			waiting = true;

			setTimeout(() => {
				waiting = false;
			}, limit);
		}
	};
}


(...args: Array<T>) => {
		if (!waiting) {
			callback(...args);
			waiting = true;

			setTimeout(() => {
				waiting = false;
			}, limit);
		}
	}


() => {
				waiting = false;
			}


() => {
	const [mousePosition, setMousePosition] = useState<MousePosition>([0, 0]);

	useEffect(() => {
		const handleMousePosition = throttle(
			(event: MouseEvent) =>
				setMousePosition([event.clientX, event.clientY]),
			200
		);

		window.addEventListener('mousemove', handleMousePosition);

		return () =>
			window.removeEventListener('mousemove', handleMousePosition);
	}, []);

	return mousePosition;
}


() => {
		const handleMousePosition = throttle(
			(event: MouseEvent) =>
				setMousePosition([event.clientX, event.clientY]),
			200
		);

		window.addEventListener('mousemove', handleMousePosition);

		return () =>
			window.removeEventListener('mousemove', handleMousePosition);
	}


(event: MouseEvent) =>
				setMousePosition([event.clientX, event.clientY])


() =>
			window.removeEventListener('mousemove', handleMousePosition)


type MousePosition = [number, number];


function execute(info, isValid, overwrite : boolean)
{
    starter(info.startServer(), info, isValid, 'MOVE', 'file1Undefined', 'file1_moved', overwrite, v2.HTTPCodes.NotFound);
    starter(info.startServer(), info, isValid, 'MOVE', 'file1Undefined', 'folder1/file2', overwrite, v2.HTTPCodes.NotFound);
    starter(info.startServer(), info, isValid, 'MOVE', 'file1Undefined', 'file1', overwrite, v2.HTTPCodes.NotFound);
    starter(info.startServer(), info, isValid, 'MOVE', 'file1Undefined', 'file1/file1', overwrite, v2.HTTPCodes.NotFound);
    starter(info.startServer(), info, isValid, 'MOVE', 'file1Undefined', 'unmapped/file1', overwrite, v2.HTTPCodes.NotFound);
}


(info, isValid) =>
{
    const server1 = info.init(5 * 2);

    execute(info, isValid, false);
    execute(info, isValid, true);

}


() => {
    it("default no content", () => {
      var test = urlPath.StringToIUrl("");
      expect(test).toStrictEqual({});
    });
    it("default fallback", () => {
      var test = urlPath.StringToIUrl("?random1=tr");
      expect(test).toStrictEqual({});
    });
    it("colorClass 1 item", () => {
      var test = urlPath.StringToIUrl("?colorClass=8");
      expect(test.colorClass).toStrictEqual([8]);
    });
    it("colorClass 2 items", () => {
      var test = urlPath.StringToIUrl("?colorClass=1,2");
      expect(test.colorClass).toStrictEqual([1, 2]);
    });
    it("colorClass 2 NaN items", () => {
      var test = urlPath.StringToIUrl("?colorClass=NaN,5");
      expect(test.colorClass).toStrictEqual([5]);
    });
    it("colorClass 1 NaN items", () => {
      var test = urlPath.StringToIUrl("?colorClass=NaN");
      expect(test.colorClass).toStrictEqual([]);
    });
    it("collections false", () => {
      var test = urlPath.StringToIUrl("?collections=false");
      expect(test.collections).toStrictEqual(false);
    });
    it("collections true", () => {
      var test = urlPath.StringToIUrl("?collections=anything");
      expect(test.collections).toStrictEqual(true);
    });
    it("details false", () => {
      var test = urlPath.StringToIUrl("?details=anything");
      expect(test.details).toStrictEqual(false);
    });
    it("details true", () => {
      var test = urlPath.StringToIUrl("?details=true");
      expect(test.details).toStrictEqual(true);
    });
    it("sidebar false", () => {
      var test = urlPath.StringToIUrl("?sidebar=anything");
      expect(test.sidebar).toStrictEqual(false);
    });
    it("sidebar true", () => {
      var test = urlPath.StringToIUrl("?sidebar=true");
      expect(test.sidebar).toStrictEqual(true);
    });
    it("f", () => {
      var test = urlPath.StringToIUrl("?f=test");
      expect(test.f).toBe("test");
    });
    it("t", () => {
      var test = urlPath.StringToIUrl("?t=test");
      expect(test.t).toBe("test");
    });
    it("p null", () => {
      var test = urlPath.StringToIUrl("?p=NaN");
      expect(test.p).toBeUndefined();
    });
    it("p 15", () => {
      const test = urlPath.StringToIUrl("?p=15");
      expect(test.p).toBe(15);
    });
    it("select 2 items", () => {
      const test = urlPath.StringToIUrl("?select=test,test2");
      expect(test.select).toStrictEqual(["test", "test2"]);
    });
    it("select 1 item", () => {
      const test = urlPath.StringToIUrl("?select=test");
      expect(test.select).toStrictEqual(["test"]);
    });
    it("list default", () => {
      const test = urlPath.StringToIUrl("?list=undefined");
      expect(test.list).toStrictEqual(false);
    });
    it("list false", () => {
      const test = urlPath.StringToIUrl("?list=false");
      expect(test.list).toStrictEqual(false);
    });
    it("list true", () => {
      const test = urlPath.StringToIUrl("?list=true");
      expect(test.list).toStrictEqual(true);
    });
  }


() => {
      var test = urlPath.StringToIUrl("");
      expect(test).toStrictEqual({});
    }


() => {
      var test = urlPath.StringToIUrl("?random1=tr");
      expect(test).toStrictEqual({});
    }


() => {
      var test = urlPath.StringToIUrl("?colorClass=8");
      expect(test.colorClass).toStrictEqual([8]);
    }


() => {
      var test = urlPath.StringToIUrl("?colorClass=1,2");
      expect(test.colorClass).toStrictEqual([1, 2]);
    }


() => {
      var test = urlPath.StringToIUrl("?colorClass=NaN,5");
      expect(test.colorClass).toStrictEqual([5]);
    }


() => {
      var test = urlPath.StringToIUrl("?colorClass=NaN");
      expect(test.colorClass).toStrictEqual([]);
    }


() => {
      var test = urlPath.StringToIUrl("?collections=false");
      expect(test.collections).toStrictEqual(false);
    }


() => {
      var test = urlPath.StringToIUrl("?collections=anything");
      expect(test.collections).toStrictEqual(true);
    }


() => {
      var test = urlPath.StringToIUrl("?details=anything");
      expect(test.details).toStrictEqual(false);
    }


() => {
      var test = urlPath.StringToIUrl("?details=true");
      expect(test.details).toStrictEqual(true);
    }


() => {
      var test = urlPath.StringToIUrl("?sidebar=anything");
      expect(test.sidebar).toStrictEqual(false);
    }


() => {
      var test = urlPath.StringToIUrl("?sidebar=true");
      expect(test.sidebar).toStrictEqual(true);
    }


() => {
      var test = urlPath.StringToIUrl("?f=test");
      expect(test.f).toBe("test");
    }


() => {
      var test = urlPath.StringToIUrl("?t=test");
      expect(test.t).toBe("test");
    }


() => {
      var test = urlPath.StringToIUrl("?p=NaN");
      expect(test.p).toBeUndefined();
    }


() => {
      const test = urlPath.StringToIUrl("?p=15");
      expect(test.p).toBe(15);
    }


() => {
      const test = urlPath.StringToIUrl("?select=test,test2");
      expect(test.select).toStrictEqual(["test", "test2"]);
    }


() => {
      const test = urlPath.StringToIUrl("?select=test");
      expect(test.select).toStrictEqual(["test"]);
    }


() => {
      const test = urlPath.StringToIUrl("?list=undefined");
      expect(test.list).toStrictEqual(false);
    }


() => {
      const test = urlPath.StringToIUrl("?list=false");
      expect(test.list).toStrictEqual(false);
    }


() => {
      const test = urlPath.StringToIUrl("?list=true");
      expect(test.list).toStrictEqual(true);
    }


() => {
    it("default", () => {
      var test = urlPath.getParent("");
      expect(test).toStrictEqual("/");
    });
    it("one parent", () => {
      var test = urlPath.getParent("?f=/test");
      expect(test).toStrictEqual("/");
    });
    it("two parents", () => {
      var test = urlPath.getParent("?f=/test/test");
      expect(test).toStrictEqual("/test");
    });

    it("three parents", () => {
      var test = urlPath.getParent("?f=/test/test/item.jpg");
      expect(test).toStrictEqual("/test/test");
    });
  }


() => {
      var test = urlPath.getParent("");
      expect(test).toStrictEqual("/");
    }


() => {
      var test = urlPath.getParent("?f=/test");
      expect(test).toStrictEqual("/");
    }


() => {
      var test = urlPath.getParent("?f=/test/test");
      expect(test).toStrictEqual("/test");
    }


() => {
      var test = urlPath.getParent("?f=/test/test/item.jpg");
      expect(test).toStrictEqual("/test/test");
    }


() => {
    it("default", () => {
      var test = urlPath.getFilePath("");
      expect(test).toStrictEqual("/");
    });
    it("one", () => {
      var test = urlPath.getFilePath("?f=/test");
      expect(test).toStrictEqual("/test");
    });
  }


() => {
      var test = urlPath.getFilePath("");
      expect(test).toStrictEqual("/");
    }


() => {
      var test = urlPath.getFilePath("?f=/test");
      expect(test).toStrictEqual("/test");
    }


() => {
    it("add", () => {
      var test = urlPath.toggleSelection("test.jpg", "");
      if (!test.select) throw Error("select is null");
      expect(test.select[0]).toStrictEqual("test.jpg");
    });

    it("add + remove (aka toggle)", () => {
      // two times
      var first = urlPath.toggleSelection("test.jpg", "");
      var test = urlPath.toggleSelection(
        "test.jpg",
        urlPath.IUrlToString(first)
      );
      if (test.select === undefined) throw Error("select is null");
      expect(test.select.length).toStrictEqual(0);
    });
  }


() => {
      var test = urlPath.toggleSelection("test.jpg", "");
      if (!test.select) throw Error("select is null");
      expect(test.select[0]).toStrictEqual("test.jpg");
    }


() => {
      // two times
      var first = urlPath.toggleSelection("test.jpg", "");
      var test = urlPath.toggleSelection(
        "test.jpg",
        urlPath.IUrlToString(first)
      );
      if (test.select === undefined) throw Error("select is null");
      expect(test.select.length).toStrictEqual(0);
    }


() => {
    it("default", () => {
      var test = urlPath.getSelect("");
      expect(test).toStrictEqual([]);
    });
    it("selectResult !== undefined", () => {
      var test = urlPath.getSelect("?select=");
      expect(test).toStrictEqual([]);
    });
  }


() => {
      var test = urlPath.getSelect("");
      expect(test).toStrictEqual([]);
    }


() => {
      var test = urlPath.getSelect("?select=");
      expect(test).toStrictEqual([]);
    }


() => {
    it("default", () => {
      var test = urlPath.MergeSelectParent([], undefined);
      expect(test).toStrictEqual([]);
    });
    it("default (2)", () => {
      var test = urlPath.MergeSelectParent(undefined, "");
      expect(test).toStrictEqual([]);
    });

    it("merge", () => {
      var test = urlPath.MergeSelectParent(["test.jpg"], "/test");
      expect(test[0]).toStrictEqual("/test/test.jpg");
    });

    it("merge home item", () => {
      var test = urlPath.MergeSelectParent(["test.jpg"], "/");
      expect(test[0]).toStrictEqual("/test.jpg");
    });
  }


() => {
      var test = urlPath.MergeSelectParent([], undefined);
      expect(test).toStrictEqual([]);
    }


() => {
      var test = urlPath.MergeSelectParent(undefined, "");
      expect(test).toStrictEqual([]);
    }


() => {
      var test = urlPath.MergeSelectParent(["test.jpg"], "/test");
      expect(test[0]).toStrictEqual("/test/test.jpg");
    }


() => {
      var test = urlPath.MergeSelectParent(["test.jpg"], "/");
      expect(test[0]).toStrictEqual("/test.jpg");
    }


() => {
    it("default", () => {
      var test = urlPath.MergeSelectFileIndexItem([], newIFileIndexItemArray());
      expect(test).toStrictEqual([]);
    });

    it("item already exist", () => {
      var list = newIFileIndexItemArray();
      list.push({
        parentDirectory: "/test",
        fileName: "test.jpg"
      } as IFileIndexItem);
      var test = urlPath.MergeSelectFileIndexItem(["test.jpg"], list);
      expect(test[0]).toStrictEqual("/test/test.jpg");
      expect(test.length).toStrictEqual(1);
    });

    it("home - item already exist", () => {
      var list = newIFileIndexItemArray();
      list.push({
        parentDirectory: "/",
        fileName: "test.jpg"
      } as IFileIndexItem);
      var test = urlPath.MergeSelectFileIndexItem(["test.jpg"], list);
      expect(test[0]).toStrictEqual("/test.jpg");
      expect(test.length).toStrictEqual(1);
    });
  }


() => {
      var test = urlPath.MergeSelectFileIndexItem([], newIFileIndexItemArray());
      expect(test).toStrictEqual([]);
    }


() => {
      var list = newIFileIndexItemArray();
      list.push({
        parentDirectory: "/test",
        fileName: "test.jpg"
      } as IFileIndexItem);
      var test = urlPath.MergeSelectFileIndexItem(["test.jpg"], list);
      expect(test[0]).toStrictEqual("/test/test.jpg");
      expect(test.length).toStrictEqual(1);
    }


() => {
      var list = newIFileIndexItemArray();
      list.push({
        parentDirectory: "/",
        fileName: "test.jpg"
      } as IFileIndexItem);
      var test = urlPath.MergeSelectFileIndexItem(["test.jpg"], list);
      expect(test[0]).toStrictEqual("/test.jpg");
      expect(test.length).toStrictEqual(1);
    }


() => {
    it("default", () => {
      var test = urlPath.ArrayToCommaSeperatedString([]);
      expect(test).toStrictEqual("");
    });

    it("list 1 item", () => {
      var test = urlPath.ArrayToCommaSeperatedString(["/test.jpg"]);
      expect(test).toStrictEqual("/test.jpg");
    });
    it("list 2 items", () => {
      var test = urlPath.ArrayToCommaSeperatedString([
        "/parent/test.jpg",
        "/parent/test2.jpg"
      ]);
      expect(test).toStrictEqual("/parent/test.jpg;/parent/test2.jpg");
    });
  }


() => {
      var test = urlPath.ArrayToCommaSeperatedString([]);
      expect(test).toStrictEqual("");
    }


() => {
      var test = urlPath.ArrayToCommaSeperatedString(["/test.jpg"]);
      expect(test).toStrictEqual("/test.jpg");
    }


() => {
      var test = urlPath.ArrayToCommaSeperatedString([
        "/parent/test.jpg",
        "/parent/test2.jpg"
      ]);
      expect(test).toStrictEqual("/parent/test.jpg;/parent/test2.jpg");
    }


() => {
    it("default", () => {
      var test = urlPath.ArrayToCommaSeperatedStringOneParent([], "");
      expect(test).toStrictEqual("");
    });

    it("list 1 item", () => {
      var test = urlPath.ArrayToCommaSeperatedStringOneParent(
        ["test.jpg"],
        "/parent"
      );
      expect(test).toStrictEqual("/parent/test.jpg");
    });
    it("list 2 items", () => {
      var test = urlPath.ArrayToCommaSeperatedStringOneParent(
        ["test.jpg", "test2.jpg"],
        "/parent"
      );
      expect(test).toStrictEqual("/parent/test.jpg;/parent/test2.jpg");
    });
  }


() => {
      var test = urlPath.ArrayToCommaSeperatedStringOneParent([], "");
      expect(test).toStrictEqual("");
    }


() => {
      var test = urlPath.ArrayToCommaSeperatedStringOneParent(
        ["test.jpg"],
        "/parent"
      );
      expect(test).toStrictEqual("/parent/test.jpg");
    }


() => {
      var test = urlPath.ArrayToCommaSeperatedStringOneParent(
        ["test.jpg", "test2.jpg"],
        "/parent"
      );
      expect(test).toStrictEqual("/parent/test.jpg;/parent/test2.jpg");
    }


() => {
    it("default bool", () => {
      var bodyParams = new URLPath().ObjectToSearchParams({ append: true });
      expect(bodyParams.toString()).toBe("append=true");
    });

    it("default value", () => {
      var bodyParams = new URLPath().ObjectToSearchParams({ number: "1" });
      expect(bodyParams.toString()).toBe("number=1");
    });
  }


() => {
      var bodyParams = new URLPath().ObjectToSearchParams({ append: true });
      expect(bodyParams.toString()).toBe("append=true");
    }


() => {
      var bodyParams = new URLPath().ObjectToSearchParams({ number: "1" });
      expect(bodyParams.toString()).toBe("number=1");
    }


() => {
    it("slash", () => {
      var path = urlPath.getChild("/");
      expect(path).toBe("");
    });

    it("get image without ending slash", () => {
      var path = urlPath.getChild("/test/img");
      expect(path).toBe("img");
    });

    it("get image ending slash", () => {
      var path = urlPath.getChild("/test/img/");
      expect(path).toBe("img");
    });
  }


() => {
      var path = urlPath.getChild("/");
      expect(path).toBe("");
    }


() => {
      var path = urlPath.getChild("/test/img");
      expect(path).toBe("img");
    }


() => {
      var path = urlPath.getChild("/test/img/");
      expect(path).toBe("img");
    }


() => {
    it("default", () => {
      var encoded = new URLPath().encodeURI("€£@test");
      expect(encoded).toBe("%E2%82%AC%C2%A3@test");
    });

    it("+", () => {
      var encoded = new URLPath().encodeURI("+");
      expect(encoded).toBe("%2B");
    });
  }


() => {
      var encoded = new URLPath().encodeURI("€£@test");
      expect(encoded).toBe("%E2%82%AC%C2%A3@test");
    }


() => {
      var encoded = new URLPath().encodeURI("+");
      expect(encoded).toBe("%2B");
    }


() => {
    it("undefined input", () => {
      try {
        new URLPath().StartOnSlash("");
      } catch (error) {
        return;
      }
      throw new Error("should not pass");
    });

    it("/", () => {
      var encoded = new URLPath().StartOnSlash("/");
      expect(encoded).toBe("/");
    });

    it("test", () => {
      var encoded = new URLPath().StartOnSlash("test");
      expect(encoded).toBe("/test");
    });

    it("/test", () => {
      var encoded = new URLPath().StartOnSlash("/test");
      expect(encoded).toBe("/test");
    });
  }


() => {
      try {
        new URLPath().StartOnSlash("");
      } catch (error) {
        return;
      }
      throw new Error("should not pass");
    }


() => {
      var encoded = new URLPath().StartOnSlash("/");
      expect(encoded).toBe("/");
    }


() => {
      var encoded = new URLPath().StartOnSlash("test");
      expect(encoded).toBe("/test");
    }


() => {
      var encoded = new URLPath().StartOnSlash("/test");
      expect(encoded).toBe("/test");
    }


export interface Element {
    id: number;
    element: string;
    symbol: string;
    atomicMass: number;
    neutrons: number;
    protons: number;
    electrons: number;
    period: number;
    group: number;
    phase: string;
    radioactive: boolean;
    natural: boolean;
    metal: boolean;
    nonmental: boolean;
    metalloid: boolean;
    type: string;
    atomicRadius: number;
    electronegativity: number;
    firstIonization: number;
    density: string;
    meltingPoint: number;
    boilingPoint: number;
    isotopes: number;
    discoverer: string;
    year: number;
    specificHeat: number;
    shells: number;
    valence: number;
  }


export class LendingPoolLiquidationManager extends Contract {
  connect(signerOrProvider: Signer | Provider | string): this;
  attach(addressOrName: string): this;
  deployed(): Promise<this>;

  on(event: EventFilter | string, listener: Listener): this;
  once(event: EventFilter | string, listener: Listener): this;
  addListener(eventName: EventFilter | string, listener: Listener): this;
  removeAllListeners(eventName: EventFilter | string): this;
  removeListener(eventName: any, listener: Listener): this;

  interface: LendingPoolLiquidationManagerInterface;

  functions: {
    addressesProvider(
      overrides?: CallOverrides
    ): Promise<{
      0: string;
    }>;

    /**
     * users can invoke this function to liquidate an undercollateralized position.
     * @param _purchaseAmount the amount of principal that the liquidator wants to repay
     * @param _receiveAToken true if the liquidators wants to receive the aTokens, false if he wants to receive the underlying asset directly*
     * @param _reserve the address of the principal reserve
     * @param _user the address of the borrower
     */
    liquidationCall(
      _collateral: string,
      _reserve: string,
      _user: string,
      _purchaseAmount: BigNumberish,
      _receiveAToken: boolean,
      overrides?: PayableOverrides
    ): Promise<ContractTransaction>;
  };

  addressesProvider(overrides?: CallOverrides): Promise<string>;

  /**
   * users can invoke this function to liquidate an undercollateralized position.
   * @param _purchaseAmount the amount of principal that the liquidator wants to repay
   * @param _receiveAToken true if the liquidators wants to receive the aTokens, false if he wants to receive the underlying asset directly*
   * @param _reserve the address of the principal reserve
   * @param _user the address of the borrower
   */
  liquidationCall(
    _collateral: string,
    _reserve: string,
    _user: string,
    _purchaseAmount: BigNumberish,
    _receiveAToken: boolean,
    overrides?: PayableOverrides
  ): Promise<ContractTransaction>;

  callStatic: {
    addressesProvider(overrides?: CallOverrides): Promise<string>;

    /**
     * users can invoke this function to liquidate an undercollateralized position.
     * @param _purchaseAmount the amount of principal that the liquidator wants to repay
     * @param _receiveAToken true if the liquidators wants to receive the aTokens, false if he wants to receive the underlying asset directly*
     * @param _reserve the address of the principal reserve
     * @param _user the address of the borrower
     */
    liquidationCall(
      _collateral: string,
      _reserve: string,
      _user: string,
      _purchaseAmount: BigNumberish,
      _receiveAToken: boolean,
      overrides?: PayableOverrides
    ): Promise<{
      0: BigNumber;
      1: string;
    }>;
  };

  filters: {
    LiquidationCall(
      _collateral: string | null,
      _reserve: string | null,
      _user: string | null,
      _purchaseAmount: null,
      _liquidatedCollateralAmount: null,
      _accruedBorrowInterest: null,
      _liquidator: null,
      _receiveAToken: null,
      _timestamp: null
    ): EventFilter;

    OriginationFeeLiquidated(
      _collateral: string | null,
      _reserve: string | null,
      _user: string | null,
      _feeLiquidated: null,
      _liquidatedCollateralForFee: null,
      _timestamp: null
    ): EventFilter;
  };

  estimateGas: {
    addressesProvider(): Promise<BigNumber>;
    liquidationCall(
      _collateral: string,
      _reserve: string,
      _user: string,
      _purchaseAmount: BigNumberish,
      _receiveAToken: boolean
    ): Promise<BigNumber>;
  };

  populateTransaction: {
    addressesProvider(): Promise<PopulatedTransaction>;
    liquidationCall(
      _collateral: string,
      _reserve: string,
      _user: string,
      _purchaseAmount: BigNumberish,
      _receiveAToken: boolean
    ): Promise<PopulatedTransaction>;
  };
}


interface LendingPoolLiquidationManagerInterface
  extends ethers.utils.Interface {
  functions: {
    "addressesProvider()": FunctionFragment;
    "liquidationCall(address,address,address,uint256,bool)": FunctionFragment;
  };

  encodeFunctionData(
    functionFragment: "addressesProvider",
    values?: undefined
  ): string;
  encodeFunctionData(
    functionFragment: "liquidationCall",
    values: [string, string, string, BigNumberish, boolean]
  ): string;

  decodeFunctionResult(
    functionFragment: "addressesProvider",
    data: BytesLike
  ): Result;
  decodeFunctionResult(
    functionFragment: "liquidationCall",
    data: BytesLike
  ): Result;

  events: {
    "LiquidationCall(address,address,address,uint256,uint256,uint256,address,bool,uint256)": EventFragment;
    "OriginationFeeLiquidated(address,address,address,uint256,uint256,uint256)": EventFragment;
  };

  getEvent(nameOrSignatureOrTopic: "LiquidationCall"): EventFragment;
  getEvent(nameOrSignatureOrTopic: "OriginationFeeLiquidated"): EventFragment;
}


on(event: EventFilter | string, listener: Listener): this;


once(event: EventFilter | string, listener: Listener): this;


addListener(eventName: EventFilter | string, listener: Listener): this;


removeAllListeners(eventName: EventFilter | string): this;


removeListener(eventName: any, listener: Listener): this;


addressesProvider(overrides?: CallOverrides): Promise<string>;


/**
   * users can invoke this function to liquidate an undercollateralized position.
   * @param _purchaseAmount the amount of principal that the liquidator wants to repay
   * @param _receiveAToken true if the liquidators wants to receive the aTokens, false if he wants to receive the underlying asset directly*
   * @param _reserve the address of the principal reserve
   * @param _user the address of the borrower
   */
liquidationCall(
    _collateral: string,
    _reserve: string,
    _user: string,
    _purchaseAmount: BigNumberish,
    _receiveAToken: boolean,
    overrides?: PayableOverrides
  ): Promise<ContractTransaction>;


(l) => {
      if (!sourcePositionValid(l)) {
        console.log("Warning: invalid source position");
        return false;
      }
      return true;
    }


export class SelectionBroker {
  sourceResolver: SourceResolver;
  allHandlers: Array<ClearableHandler>;
  sourcePositionHandlers: Array<SelectionHandler>;
  nodeHandlers: Array<NodeSelectionHandler>;
  blockHandlers: Array<BlockSelectionHandler>;
  instructionHandlers: Array<InstructionSelectionHandler>;

  constructor(sourceResolver) {
    this.allHandlers = [];
    this.sourcePositionHandlers = [];
    this.nodeHandlers = [];
    this.blockHandlers = [];
    this.instructionHandlers = [];
    this.sourceResolver = sourceResolver;
  };

  addSourcePositionHandler(handler: SelectionHandler & ClearableHandler) {
    this.allHandlers.push(handler);
    this.sourcePositionHandlers.push(handler);
  }

  addNodeHandler(handler: NodeSelectionHandler & ClearableHandler) {
    this.allHandlers.push(handler);
    this.nodeHandlers.push(handler);
  }

  addBlockHandler(handler: BlockSelectionHandler & ClearableHandler) {
    this.allHandlers.push(handler);
    this.blockHandlers.push(handler);
  }

  addInstructionHandler(handler: InstructionSelectionHandler & ClearableHandler) {
    this.allHandlers.push(handler);
    this.instructionHandlers.push(handler);
  }

  broadcastInstructionSelect(from, instructionOffsets, selected) {
    for (const b of this.instructionHandlers) {
      if (b != from) b.brokeredInstructionSelect(instructionOffsets, selected);
    }
  }

  broadcastSourcePositionSelect(from, sourcePositions, selected) {
    sourcePositions = sourcePositions.filter((l) => {
      if (!sourcePositionValid(l)) {
        console.log("Warning: invalid source position");
        return false;
      }
      return true;
    });
    for (const b of this.sourcePositionHandlers) {
      if (b != from) b.brokeredSourcePositionSelect(sourcePositions, selected);
    }
    const nodes = this.sourceResolver.sourcePositionsToNodeIds(sourcePositions);
    for (const b of this.nodeHandlers) {
      if (b != from) b.brokeredNodeSelect(nodes, selected);
    }
  }

  broadcastNodeSelect(from, nodes, selected) {
    for (const b of this.nodeHandlers) {
      if (b != from) b.brokeredNodeSelect(nodes, selected);
    }
    const sourcePositions = this.sourceResolver.nodeIdsToSourcePositions(nodes);
    for (const b of this.sourcePositionHandlers) {
      if (b != from) b.brokeredSourcePositionSelect(sourcePositions, selected);
    }
  }

  broadcastBlockSelect(from, blocks, selected) {
    for (var b of this.blockHandlers) {
      if (b != from) b.brokeredBlockSelect(blocks, selected);
    }
  }

  broadcastClear(from) {
    this.allHandlers.forEach(function (b) {
      if (b != from) b.brokeredClear();
    });
  }
}


addSourcePositionHandler(handler: SelectionHandler & ClearableHandler) {
    this.allHandlers.push(handler);
    this.sourcePositionHandlers.push(handler);
  }


addNodeHandler(handler: NodeSelectionHandler & ClearableHandler) {
    this.allHandlers.push(handler);
    this.nodeHandlers.push(handler);
  }


addBlockHandler(handler: BlockSelectionHandler & ClearableHandler) {
    this.allHandlers.push(handler);
    this.blockHandlers.push(handler);
  }


addInstructionHandler(handler: InstructionSelectionHandler & ClearableHandler) {
    this.allHandlers.push(handler);
    this.instructionHandlers.push(handler);
  }


broadcastInstructionSelect(from, instructionOffsets, selected) {
    for (const b of this.instructionHandlers) {
      if (b != from) b.brokeredInstructionSelect(instructionOffsets, selected);
    }
  }


broadcastSourcePositionSelect(from, sourcePositions, selected) {
    sourcePositions = sourcePositions.filter((l) => {
      if (!sourcePositionValid(l)) {
        console.log("Warning: invalid source position");
        return false;
      }
      return true;
    });
    for (const b of this.sourcePositionHandlers) {
      if (b != from) b.brokeredSourcePositionSelect(sourcePositions, selected);
    }
    const nodes = this.sourceResolver.sourcePositionsToNodeIds(sourcePositions);
    for (const b of this.nodeHandlers) {
      if (b != from) b.brokeredNodeSelect(nodes, selected);
    }
  }


broadcastNodeSelect(from, nodes, selected) {
    for (const b of this.nodeHandlers) {
      if (b != from) b.brokeredNodeSelect(nodes, selected);
    }
    const sourcePositions = this.sourceResolver.nodeIdsToSourcePositions(nodes);
    for (const b of this.sourcePositionHandlers) {
      if (b != from) b.brokeredSourcePositionSelect(sourcePositions, selected);
    }
  }


broadcastBlockSelect(from, blocks, selected) {
    for (var b of this.blockHandlers) {
      if (b != from) b.brokeredBlockSelect(blocks, selected);
    }
  }


broadcastClear(from) {
    this.allHandlers.forEach(function (b) {
      if (b != from) b.brokeredClear();
    });
  }


export class ErrorBoundary extends React.Component {
  componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
    if (toNativeBridge.editorError) {
      toNativeBridge.editorError(
        error.toString(),
        errorInfo?.toString() || undefined,
      );
    }
  }

  render() {
    return this.props.children;
  }
}


componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
    if (toNativeBridge.editorError) {
      toNativeBridge.editorError(
        error.toString(),
        errorInfo?.toString() || undefined,
      );
    }
  }


render() {
    return this.props.children;
  }


@NgModule({
  imports: [RouterModule.forChild(DashboardRoutes), LayoutModule, SharedModule],
  declarations: [
    DashboardDetailComponent,
    DashboardScreenComponent,
    DashboardScreenWidgetComponent,
    DashboardTvComponent,
    DashboardsComponent,
    ProjectWidgetWizardComponent,
    TvManagementDialogComponent
  ],
  entryComponents: [TvManagementDialogComponent],
  exports: [RouterModule]
})
export class DashboardModule {}


@NgModule({
  declarations: [
    MyApp,
    TabsPage,
    ShoppingListPage,
    RecipesPage,
    NewRecipePage
  ],
  imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    TabsPage,
    ShoppingListPage,
    RecipesPage,
    NewRecipePage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    ShoppingListService
  ]
})
export class AppModule {}


/**
 * Creates navigation LayoutStack exposing multiple function types for the same function as a list of overloads.
 * [more info](https://wix.github.io/react-native-navigation/api/layout-stack)
 */
function createStack(layoutStackChildren: LayoutStackChildren, id?: string, options?: Options): LayoutStack


function createStack(layoutStackChildrenArray: LayoutStackChildren[], id?: string, options?: Options): LayoutStack


function createStack(name: string): LayoutStack


function createStack<P = {}>(name: string, passProps?: P): LayoutStack


function createStack<P = {}>(name: string, passProps?: P, options?: Options): LayoutStack


function createStack<P = {}>(
  nameOrLayoutStackChildren: string | LayoutStackChildren | LayoutStackChildren[],
  passPropsOrId?: P | string,
  options?: Options
): LayoutStack {
  let stackOptions
  let id: string | undefined
  let layoutStackChildren

  if (typeof nameOrLayoutStackChildren === 'string') {
    const layoutComponent = createLayout<P>(
      nameOrLayoutStackChildren,
      passPropsOrId as P,
      options
    ) as LayoutStackChildren
    layoutStackChildren = [layoutComponent]
  } else {
    stackOptions = options
    id = passPropsOrId as string
    layoutStackChildren = Array.isArray(nameOrLayoutStackChildren)
      ? nameOrLayoutStackChildren
      : [nameOrLayoutStackChildren]
  }

  return { id, children: layoutStackChildren, options: stackOptions }
}


export class ComponentsConfig {

  constructor(register: che.IRegisterService) {
    /* tslint:disable */
    new ApiConfig(register);
    new AttributeConfig(register);
    new FilterConfig(register);
    new CheBrandingConfig(register);
    new GitHubService(register);
    new CheIdeFetcherConfig(register);
    new CheNotificationConfig(register);
    new RoutingConfig(register);
    new ValidatorConfig(register);
    new WidgetConfig(register);
    new CheErrorMessagesConfig(register);
    new ServiceConfig(register);
    new InterceptorConfig(register);
    /* tslint:enable */

    register.directive('cheStepsContainer', CheStepsContainer);

    register.factory('randomSvc', RandomSvc);
  }
}


({ project }: Props) => {
  const display = useBreakpointValue([VStack, VStack, Flex, Flex]);

  if (project.userPermission !== PermissionType.Own) {
    return <p />;
  }

  return (
    <>
      <Flex>
        <Flex gridGap="0.25em" as={display}>
          <UpdateAction project={project} />
          <DeleteAction projectId={project.id} />
        </Flex>
      </Flex>
    </>


type Props = {
  project: ProjectType;
};


// interface SidebarProps {
//   handleChildButton: (id: number) => {},
//   selectedGenreId: number;
// }
export function SideBar({handleChildButton, selectedGenreId}: any) {
  const [genres, setGenres] = useState<GenreResponseProps[]>([]);

  useEffect(() => {
    api.get<GenreResponseProps[]>('genres').then(response => {
      setGenres(response.data);
    });
  }, []);

  return (

      Watch
Me

        {genres.map(genre => (
          <Button
            key={String(genre.id)}
            id={String(genre.id)}
            title={genre.title}
            iconName={genre.name}
            onClick={() => handleChildButton(genre.id)}


() => {
    api.get<GenreResponseProps[]>('genres').then(response => {
      setGenres(response.data);
    });
  }


response => {
      setGenres(response.data);
    }


genre => (
          <Button
            key={String(genre.id


String(genre


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

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ ThemeExercisePage ],
      imports: [IonicModule.forRoot()]
    }).compileComponents();

    fixture = TestBed.createComponent(ThemeExercisePage);
    component = fixture.componentInstance;
    fixture.detectChanges();
  }));

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


() => {
    TestBed.configureTestingModule({
      declarations: [ ThemeExercisePage ],
      imports: [IonicModule.forRoot()]
    }).compileComponents();

    fixture = TestBed.createComponent(ThemeExercisePage);
    component = fixture.componentInstance;
    fixture.detectChanges();
  }


(...args: unknown[]) =>
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      (i18n as any)[DatetimePartsSymbol](...args)


export type DatetimeFormatProps = FormattableProps<
  number | Date,
  Intl.DateTimeFormatOptions
>


/* eslint-enable */
setup(props: DatetimeFormatProps, context: SetupContext): RenderFunction {
    const i18n = useI18n({ useScope: 'parent' }) as Composer & ComposerInternal

    return renderFormatter<
      FormattableProps<number | Date, Intl.DateTimeFormatOptions>,
      number | Date,
      Intl.DateTimeFormatOptions,
      DateTimeOptions,
      Intl.DateTimeFormatPart
    >(props, context, DATETIME_FORMAT_KEYS, (...args: unknown[]) =>
      // eslint-disable-next-line @typescript-eslint/no-explicit-any
      (i18n as any)[DatetimePartsSymbol](...args)
    )
  }


@NgModule({
	declarations: [StepInfoComponent, CriteriaDialogComponent],
	imports: [
		CommonModule,
		StepInfoRoutingModule,
		MatButtonModule,
		MatCardModule,
		MatDialogModule,
	],
	entryComponents: [CriteriaDialogComponent],
})
export class StepInfoModule {}


export async function create(req: Request, res: Response) {
    try {

        const db = admin.firestore();

        const noteId = v4()
        const { id: creator } = res.locals
        const { title, subtitle } = req.body

        if (!title || !subtitle) {
            return res.status(401).send({ code: '401', message: 'Missing fields' })
        }

        const raw = {
            title,
            subtitle,
            creator
        };

        const note = { id: noteId, ...raw }
        const result = await db.collection('notes').doc(noteId).set(note);

        return res.status(201).send(mapNote({ ...note, date: result.writeTime }))

    } catch (err) {
        console.error(err)
        return res.status(500).send(err)
    }
}


export async function get(req: Request, res: Response) {
    try {

        const db = admin.firestore();

        const { id: userId, role } = res.locals
        const { id: noteId } = req.params

        if (!noteId)
            return res.status(400).send({ message: 'Missing fields' })

        const response = await db.collection('notes')
            .where(admin.firestore.FieldPath.documentId(), '==', noteId)
            .get()

        const note = response.docs[0]?.data()

        if (!note)
            return res.status(404).send({ code: '404', message: `Note with id: ${noteId} not found` })

        if (!['admin', 'manager'].includes(role) && note.creator != userId)
            return res.status(403).send({ code: '403', message: `You don't have acces to note with id: ${noteId}` })

        return res.status(200).send(mapNote( { ...note, date: response.docs[0].updateTime } ))

    } catch (err) {
        console.error(err)
        return res.status(500).send(err)
    }
}


export async function getList(_req: Request, res: Response) {
    try {

        const db = admin.firestore();
        const { id: userId } = res.locals

        const response = await db.collection('notes')
            .where('creator', '==', userId)
            .get()

        return res.status(200).send(response.docs.map((doc) => {
            return { ...doc.data(), date: doc.updateTime }
        }).map(mapNote))

    } catch (err) {
        console.error(err)
        return res.status(500).send(err)
    }
}


function mapNote(note: any) {
    return {
        id: note.id,
        title: note.title,
        subtitle: note.subtitle,
        date: note.date.toDate()
    }
}


(doc) => {
            return { ...doc.data(), date: doc.updateTime }
        }


export interface Inventory {
  id: string;
  price: string;
  quantity: number;
  condition: ProductConditions;
  createdAt: Date;
  updatedAt: Date;
  seller: User;
  product: Product;
}


export enum ProductConditions {
  NEW = 'NEW',
  RENEWED = 'RENEWED',
  USED_LIKE_NEW_OR_OPEN_BOX = 'USED_LIKE_NEW_OR_OPEN_BOX',
  USED_VERY_GOOD = 'USED_VERY_GOOD',
  USED_GOOD = 'USED_GOOD',
  USED_ACCEPTABLE = 'USED_ACCEPTABLE',
}


interface User extends Resetable {
    id: string,
    firstName: string;
    lastName: string;
    age: number;
    consumptions: string[];
}


/**
 *
Gets information about the scalable targets in the specified namespace.

 *
You can filter the results using ResourceIds and
 *             ScalableDimension.

 * @example
 * Use a bare-bones client and the command you need to make an API call.
 * ```javascript
 * import { ApplicationAutoScalingClient, DescribeScalableTargetsCommand } from "@aws-sdk/client-application-auto-scaling"; // ES Modules import
 * // const { ApplicationAutoScalingClient, DescribeScalableTargetsCommand } = require("@aws-sdk/client-application-auto-scaling"); // CommonJS import
 * const client = new ApplicationAutoScalingClient(config);
 * const command = new DescribeScalableTargetsCommand(input);
 * const response = await client.send(command);
 * ```
 *
 * @see {@link DescribeScalableTargetsCommandInput} for command's `input` shape.
 * @see {@link DescribeScalableTargetsCommandOutput} for command's `response` shape.
 * @see {@link ApplicationAutoScalingClientResolvedConfig | config} for ApplicationAutoScalingClient's `config` shape.
 *
 */
export class DescribeScalableTargetsCommand extends $Command<
  DescribeScalableTargetsCommandInput,
  DescribeScalableTargetsCommandOutput,
  ApplicationAutoScalingClientResolvedConfig
> {
  // Start section: command_properties
  // End section: command_properties

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

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

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

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

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

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

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


export interface DescribeScalableTargetsCommandInput extends DescribeScalableTargetsRequest {}


export interface DescribeScalableTargetsCommandOutput extends DescribeScalableTargetsResponse, __MetadataBearer {}


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

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

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


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


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


(c) => {
                let settings = {};
                let settingsArray = [];
                if (c.length > 0) {
                    settings = c[0];
                }
                for (let s in settings) {
                    if (s.indexOf('@') == -1 && s.indexOf('_') == -1) {
                        settingsArray.push({ name: s, value: settings[s] });
                    }
                }
                this.utility.messageExtension(settingsArray, 'Settings');
            }


(err) => {
                console.log(err);
            }


x => `RoleId eq (guid'${x}')`


x => `roleid eq ${x}`


(results) => {
                    results.forEach(r => {
                        resultsArray.push({ cells: Object.keys(r).sort().filter(x => !x.startsWith('@') && !x.startsWith('_')).map(key => r[key]) });
                    });
                    this.utility.messageExtension(resultsArray, 'myRoles');
                }


r => {
                        resultsArray.push({ cells: Object.keys(r).sort().filter(x => !x.startsWith('@') && !x.startsWith('_')).map(key => r[key]) });
                    }


x => !x.startsWith('@') && !x.startsWith('_')


key => r[key]


(err) => {
                    console.log(err);
                }


entities => {
                console.log(entities);
                let cells = entities.forEach(attributes => {
                    let roleId = attributes['systemuserroles.roleid'] || 'No Role',
                        roleName = attributes['role.name'] || 'No Role',
                        userId = attributes['systemuserid'],
                        userName = attributes['fullname'];

                    resultsArray.push({
                        bu: attributes['_businessunitid_value@OData.Community.Display.V1.FormattedValue'],
                        role: {
                            id: roleId,
                            name: roleName,
                            url: `${this.utility.clientUrlForParams}etn=role&id=${roleId}&newWindow=true&pagetype=entityrecord`
                        },
                        user: {
                            id: userId,
                            name: userName,
                            url: `${this.utility.clientUrlForParams}etn=systemuser&id=${userId}&newWindow=true&pagetype=entityrecord`
                        },
                        adname: attributes['domainname']
                    });
                });
                this.utility.messageExtension(resultsArray, 'allUserRoles');
            }


attributes => {
                    let roleId = attributes['systemuserroles.roleid'] || 'No Role',
                        roleName = attributes['role.name'] || 'No Role',
                        userId = attributes['systemuserid'],
                        userName = attributes['fullname'];

                    resultsArray.push({
                        bu: attributes['_businessunitid_value@OData.Community.Display.V1.FormattedValue'],
                        role: {
                            id: roleId,
                            name: roleName,
                            url: `${this.utility.clientUrlForParams}etn=role&id=${roleId}&newWindow=true&pagetype=entityrecord`
                        },
                        user: {
                            id: userId,
                            name: userName,
                            url: `${this.utility.clientUrlForParams}etn=systemuser&id=${userId}&newWindow=true&pagetype=entityrecord`
                        },
                        adname: attributes['domainname']
                    });
                }


s=>{
                        if(Xrm.Internal.isUci || Xrm.Internal.isUci()){
                            alert(`New navigation has been ${isNewNavigation ? 'enabled' : 'disabled'}. The page will now reload.`);
                            location.reload();
                        }
                        else{
                            alert(`New navigation has been ${isNewNavigation ? 'enabled' : 'disabled'}.`);
                        }
                    }