{"version":3,"sources":["src/common.speech/Transcription/InternalParticipants.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,yCAAyC;AACzC,qBAAa,oBAAoB;IAEH,YAAY,EAAE,oBAAoB,EAAE;gBAApC,YAAY,GAAE,oBAAoB,EAAO;IAInE;;;OAGG;IACI,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,GAAG,oBAAoB;IAgBhF;;;OAGG;IACI,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAI9C;;;OAGG;IACI,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,oBAAoB;IAIvD;;OAEG;IACI,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;CAG7C","file":"InternalParticipants.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\n/**\r\n * The user who is participating in the meeting.\r\n */\r\nexport interface IInternalParticipant {\r\n    id?: string;\r\n    preferredLanguage?: string;\r\n    voice?: string;\r\n}\r\n\r\n/** Users participating in the meeting */\r\nexport class InternalParticipants {\r\n\r\n    public constructor(public participants: IInternalParticipant[] = []) {\r\n\r\n    }\r\n\r\n    /**\r\n     * Add or update a participant\r\n     * @param value\r\n     */\r\n    public addOrUpdateParticipant(value: IInternalParticipant): IInternalParticipant {\r\n        if (value === undefined) {\r\n            return;\r\n        }\r\n\r\n        const exists: number = this.getParticipantIndex(value.id);\r\n        if (exists > -1) {\r\n            this.participants.splice(exists, 1, value);\r\n        } else {\r\n            this.participants.push(value);\r\n        }\r\n\r\n        // ensure it was added ok\r\n        return this.getParticipant(value.id);\r\n    }\r\n\r\n    /**\r\n     * Find the participant's position in the participants list.\r\n     * @param id\r\n     */\r\n    public getParticipantIndex(id: string): number {\r\n        return this.participants.findIndex((p: IInternalParticipant): boolean => p.id === id);\r\n    }\r\n\r\n    /**\r\n     * Find the participant by id.\r\n     * @param id\r\n     */\r\n    public getParticipant(id: string): IInternalParticipant {\r\n        return this.participants.find((p: IInternalParticipant): boolean => p.id === id);\r\n    }\r\n\r\n    /**\r\n     * Remove a participant from the participants list.\r\n     */\r\n    public deleteParticipant(id: string): void {\r\n        this.participants = this.participants.filter((p: IInternalParticipant): boolean => p.id !== id);\r\n    }\r\n}\r\n"]}