"use strict";
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var React = require('react');
var index_1 = require('../../../../index');
var PeoplePickerDisconnectedExample = (function (_super) {
    __extends(PeoplePickerDisconnectedExample, _super);
    function PeoplePickerDisconnectedExample() {
        _super.call(this);
        this._peopleList = [
            {
                imageUrl: '//www.fillmurray.com/200/200',
                imageInitials: 'PV',
                primaryText: 'Peter Venkman',
                secondaryText: 'Ghostbuster',
                tertiaryText: 'In a meeting',
                optionalText: 'Available at 4:00pm'
            },
            {
                imageUrl: '//www.fillmurray.com/200/200',
                imageInitials: 'PC',
                primaryText: 'Phil Connors',
                secondaryText: 'Reporter',
                tertiaryText: 'In a meeting',
                optionalText: 'Available at 4:00pm'
            },
            {
                imageUrl: '//www.fillmurray.com/200/200',
                imageInitials: 'CS',
                primaryText: 'Carl Spackler',
                secondaryText: 'Golpher',
                tertiaryText: 'In a meeting',
                optionalText: 'Available at 4:00pm'
            },
            {
                imageUrl: '//www.fillmurray.com/200/200',
                imageInitials: 'SZ',
                primaryText: 'Steve Zissou',
                secondaryText: 'Oceanographer',
                tertiaryText: 'In a meeting',
                optionalText: 'Available at 4:00pm'
            },
            {
                imageUrl: '//www.fillmurray.com/200/200',
                imageInitials: 'BH',
                primaryText: 'Bob Harris',
                secondaryText: 'Actor',
                tertiaryText: 'In a meeting',
                optionalText: 'Available at 4:00pm'
            },
            {
                imageUrl: '//www.fillmurray.com/200/200',
                imageInitials: 'BB',
                primaryText: 'Bunny Breckinridge',
                secondaryText: 'Actor',
                tertiaryText: 'In a meeting',
                optionalText: 'Available at 4:00pm'
            },
        ];
        this._onFilterChanged = this._onFilterChanged.bind(this);
        this._onRemoveSuggestion = this._onRemoveSuggestion.bind(this);
        this.state = {
            suggestions: this._peopleList,
        };
    }
    PeoplePickerDisconnectedExample.prototype.render = function () {
        var suggestions = this.state.suggestions;
        return (React.createElement(index_1.PeoplePicker, {suggestions: suggestions, searchCategoryName: 'Top Results', noResultsText: 'No Results Available', onSearchFieldChanged: this._onFilterChanged, onRemoveSuggestion: this._onRemoveSuggestion, isConnected: false, primarySearchText: 'Showing top 5 results', secondarySearchText: 'Search Contacts & Directory', disconnectedText: 'We are having trouble connecting to the server.<br>Please try again in a few minutes.'}));
    };
    PeoplePickerDisconnectedExample.prototype._onFilterChanged = function (filterText) {
        this.setState({
            suggestions: this._peopleList.filter(function (item) { return item.primaryText.toLowerCase().indexOf(filterText.toLowerCase()) >= 0; })
        });
    };
    ;
    PeoplePickerDisconnectedExample.prototype._onRemoveSuggestion = function (index, persona) {
        var personas = this.state.suggestions;
        personas.splice(index, 1);
        this.setState({
            suggestions: personas
        });
    };
    return PeoplePickerDisconnectedExample;
}(React.Component));
exports.PeoplePickerDisconnectedExample = PeoplePickerDisconnectedExample;

//# sourceMappingURL=PeoplePicker.Disconnected.Example.js.map
