<commit_before><div class="wrapper" *ngIf="!disabled" role="region" aria-labelledby="keys1 keys2">
    <busy-state name="function-keys"></busy-state>
    <label *ngIf="functionInfo" id="keys1" class="title"> {{'functionKeys_title' | translate}} </label>
    <label *ngIf="!functionInfo" id="keys2" class="title"> {{'adminKeys_title' | translate}} </label>
    <table class="table-function">
        <thead>
            <tr class="not-clickable">
                <th width="15%">{{'functionKeys_keyName' | translate}}</th>
                <th width="50%">{{'functionKeys_keyValue' | translate}}</th>
                <th width="35%" style="text-align: left;">{{'functionKeys_actions' | translate}}</th>
            </tr>
        </thead>
        <tbody>
            <tr class="not-clickable" *ngFor="let key of keys">
                <td><label id="keyNameLabel">{{key.name}}</label></td>
                <td>                    
                    <a (click)="key.show=!key.show" 
                        (keydown)="keyDown($event, 'showKey', key)"
                        class="operation" 
                        tabindex="0"
                        [attr.aria-expanded]="key.show"
                        [attr.aria-label]="key.name"
                        >
                        <ng-container *ngIf="key.show">{{'functionKeys_clickToHide' | translate}}</ng-container>
                        <ng-container *ngIf="!key.show">{{'functionKeys_clickToShow' | translate}}</ng-container>
                    </a>
                    <span *ngIf="key.show" [attr.aria-label]="key.value" tabindex="0">{{ key.value }}</span>
                </td>
                <td>
                    <div id="operations-bar">
                        <pop-over message="{{ 'copypre_copied' | translate }}" hideAfter="300">                            
                            <span class="operation" 
                                (click)="copyKey(key)" 
                                (keydown)="keyDown($event, 'copyKey', key)"
                                >
                                <i class="fa fa-copy"></i> {{'functionKeys_copy' | translate}}
                            </span>
                        </pop-over>
                        <a class="operation" 
                            (click)="renewKey(key)"
                            (keydown)="keyDown($event, 'renewKey', key)"
                            tabindex="0"
                            id="renewKeyAction"
                            aria-labelledby="keyNameLabel renewKeyAction">
                                <i class="fa fa-refresh"></i> {{'functionKeys_renew' | translate}}</a>
                        <a class="operation" 
                            *ngIf="key.name !== '_master'"
                            (click)="revokeKey(key)"
                            (keydown)="keyDown($event, 'revokeKey', key)"
                            tabindex="0"
                            id="revokeKeyAction"
                            aria-labelledby="keyNameLabel revokeKeyAction">
                                <i class="fa fa-times"></i> {{'functionKeys_revoke' | translate}}
                        </a>
                    </div>
                </td>
            </tr>
            <tr *ngIf="addingNew" class="not-clickable">
                <td>
                    <input #newKeyInput
                        type="text"
                        id="newKeyName"
                        (keyup)="checkValidName($event)"
                        [(ngModel)]="newKeyName"
                        placeholder="{{'functionKeys_enterKeyName' | translate}}" />
                </td>
                <td>
                    <input
                        type="text"
                        id="newKeyValue"
                        (keyup)="checkValidName($event)"
                        [(ngModel)]="newKeyValue"
                        placeholder="{{'functionKeys_enterKeyValue' | translate}}" />
                </td>
                <td>
                    <button 
                        class="custom-button" 
                        [ngClass]="validKey ? '' : 'disabled'" 
                        (click)="saveNewKey()" 
                        tabindex="0"
                        id="saveNewKeyButton"
                        aria-labelledby="newKeyName newKeyValue saveNewKeyButton">
                        {{'save' | translate}}                        
                    </button>
                </td>
            </tr>
        </tbody>
    </table>
    <button class="custom-button" (click)="showOrHideNewKeyUi()">
        <span *ngIf="!addingNew && !!functionInfo">
            {{ 'functionKeys_addNewFunctionKey' | translate}}
        </span>
        <span *ngIf="!addingNew && !functionInfo">
            {{ 'functionKeys_addNewAdminKey' | translate}}
        </span>
        <span *ngIf="addingNew">
            {{'functionKeys_discard' | translate}}<commit_msg>add role and label to click to show/click to hide<commit_after><div class="wrapper" *ngIf="!disabled" role="region" aria-labelledby="keys1 keys2">
    <busy-state name="function-keys"></busy-state>
    <label *ngIf="functionInfo" id="keys1" class="title"> {{'functionKeys_title' | translate}} </label>
    <label *ngIf="!functionInfo" id="keys2" class="title"> {{'adminKeys_title' | translate}} </label>
    <table class="table-function">
        <thead>
            <tr class="not-clickable">
                <th width="15%">{{'functionKeys_keyName' | translate}}</th>
                <th width="50%">{{'functionKeys_keyValue' | translate}}</th>
                <th width="35%" style="text-align: left;">{{'functionKeys_actions' | translate}}</th>
            </tr>
        </thead>
        <tbody>
            <tr class="not-clickable" *ngFor="let key of keys">
                <td><label id="keyNameLabel">{{key.name}}</label></td>
                <td>
                    <a *ngIf="key.show"
                        role="button"
                        (click)="key.show=!key.show" 
                        (keydown)="keyDown($event, 'showKey', key)"
                        class="operation" 
                        tabindex="0"
                        [attr.aria-expanded]="key.show"
                        [attr.aria-label]="clickToHide">
                        {{'functionKeys_clickToHide' | translate}}
                    </a>
                    <a *ngIf="!key.show"
                        role="button"
                        (click)="key.show=!key.show" 
                        (keydown)="keyDown($event, 'showKey', key)"
                        class="operation" 
                        tabindex="0"
                        [attr.aria-expanded]="key.show"
                        [attr.aria-label]="clickToShow">
                        {{'functionKeys_clickToShow' | translate}}
                    </a>
                    <span *ngIf="key.show" [attr.aria-label]="key.value" tabindex="0">{{ key.value }}</span>
                </td>
                <td>
                    <div id="operations-bar">
                        <pop-over message="{{ 'copypre_copied' | translate }}" hideAfter="300">
                            <span class="operation" 
                                (click)="copyKey(key)" 
                                (keydown)="keyDown($event, 'copyKey', key)">
                                <i class="fa fa-copy"></i> {{'functionKeys_copy' | translate}}
                            </span>
                        </pop-over>
                        <a class="operation" 
                            (click)="renewKey(key)"
                            (keydown)="keyDown($event, 'renewKey', key)"
                            tabindex="0"
                            id="renewKeyAction"
                            aria-labelledby="keyNameLabel renewKeyAction">
                                <i class="fa fa-refresh"></i> {{'functionKeys_renew' | translate}}</a>
                        <a class="operation" 
                            *ngIf="key.name !== '_master'"
                            (click)="revokeKey(key)"
                            (keydown)="keyDown($event, 'revokeKey', key)"
                            tabindex="0"
                            id="revokeKeyAction"
                            aria-labelledby="keyNameLabel revokeKeyAction">
                                <i class="fa fa-times"></i> {{'functionKeys_revoke' | translate}}
                        </a>
                    </div>
                </td>
            </tr>
            <tr *ngIf="addingNew" class="not-clickable">
                <td>
                    <input #newKeyInput
                        type="text"
                        id="newKeyName"
                        (keyup)="checkValidName($event)"
                        [(ngModel)]="newKeyName"
                        placeholder="{{'functionKeys_enterKeyName' | translate}}" />
                </td>
                <td>
                    <input
                        type="text"
                        id="newKeyValue"
                        (keyup)="checkValidName($event)"
                        [(ngModel)]="newKeyValue"
                        placeholder="{{'functionKeys_enterKeyValue' | translate}}" />
                </td>
                <td>
                    <button 
                        class="custom-button" 
                        [ngClass]="validKey ? '' : 'disabled'" 
                        (click)="saveNewKey()" 
                        tabindex="0"
                        id="saveNewKeyButton"
                        aria-labelledby="newKeyName newKeyValue saveNewKeyButton">
                        {{'save' | translate}}
                    </button>
                </td>
            </tr>
        </tbody>
    </table>
    <button class="custom-button" (click)="showOrHideNewKeyUi()">
        <span *ngIf="!addingNew && !!functionInfo">
            {{ 'functionKeys_addNewFunctionKey' | translate}}
        </span>
        <span *ngIf="!addingNew && !functionInfo">
            {{ 'functionKeys_addNewAdminKey' | translate}}
        </span>
        <span *ngIf="addingNew">
            {{'functionKeys_discard' | translate}}
{'fraction_non_alphanumeric': 0.14206209724663152, 'fraction_numerical': 0.0036125756688146844, 'mean_word_length': 1.191484809584938, 'pattern_counts': {'":': 0, '<': 147, '<?xml version=': 0, '>': 147, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3143670', 'n_tokens_mistral': 2707, 'n_tokens_neox': 2498, 'n_words': 398}