/**
 * @license
 * Copyright 2018 JBoss Inc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import { Component, QueryList, ViewChildren, ViewEncapsulation } from "@angular/core";
import { CombinedVisitorAdapter, DocumentType, TraverserDirection, VisitorUtil } from "apicurio-data-models";
import { EntityEditor } from "./entity-editor.component";
import { ObjectUtils } from "apicurio-ts-core";
export class SecuritySchemeEditorComponent extends EntityEditor {
    constructor() {
        super(...arguments);
        this.oauthTab = "implicit";
    }
    /**
     * Called to open the editor.
     * @param handler
     * @param context
     * @param server
     */
    open(handler, context, scheme) {
        super.open(handler, context, scheme);
    }
    is2x() {
        return this.context.ownerDocument().getDocumentType() == DocumentType.openapi2;
    }
    is3x() {
        return this.context.ownerDocument().getDocumentType() == DocumentType.openapi3;
    }
    isAai2x() {
        return this.context.ownerDocument().getDocumentType() == DocumentType.asyncapi2;
    }
    /**
     * Initializes the editor's data model from a provided entity.
     * @param entity
     */
    initializeModelFromEntity(entity) {
        this.initModel(entity);
    }
    /**
     * Initializes the editor's data model to an empty state.
     */
    initializeModel() {
        this.initModel();
    }
    /**
     * Returns true if the data model is valid.
     */
    isValid() {
        let hasSchemeName = !ObjectUtils.isNullOrUndefined(this.model.schemeName);
        let hasType = !ObjectUtils.isNullOrUndefined(this.model.type);
        let validNameInput = true;
        if (this.nameInput && this.nameInput.first) {
            validNameInput = this.nameInput.first.valid;
        }
        return hasSchemeName && hasType && validNameInput;
    }
    /**
     * Creates an entity event specific to this entity editor.
     */
    entityEvent() {
        let event = {
            entity: this.entity,
            data: this.model
        };
        return event;
    }
    initModel(scheme) {
        this.schemeExists = false;
        let schemeNames = [];
        VisitorUtil.visitTree(this.context.ownerDocument(), new class extends CombinedVisitorAdapter {
            visitSecurityScheme(node) {
                schemeNames.push(node.getName());
            }
        }, TraverserDirection.down);
        this.schemeNames = schemeNames;
        if (this.context.ownerDocument().getDocumentType() == DocumentType.openapi2) {
            this.model = {
                schemeName: null,
                description: null,
                type: null,
                name: null,
                in: null,
                flow: null,
                authorizationUrl: null,
                tokenUrl: null,
                scopes: []
            };
        }
        else {
            this.model = {
                schemeName: null,
                type: null,
                description: null,
                name: null,
                in: null,
                scheme: null,
                bearerFormat: null,
                openIdConnectUrl: null,
                flows: {
                    implicit: {
                        enabled: false,
                        authorizationUrl: null,
                        tokenUrl: null,
                        refreshUrl: null,
                        scopes: []
                    },
                    password: {
                        enabled: false,
                        authorizationUrl: null,
                        tokenUrl: null,
                        refreshUrl: null,
                        scopes: []
                    },
                    clientCredentials: {
                        enabled: false,
                        authorizationUrl: null,
                        tokenUrl: null,
                        refreshUrl: null,
                        scopes: []
                    },
                    authorizationCode: {
                        enabled: false,
                        authorizationUrl: null,
                        tokenUrl: null,
                        refreshUrl: null,
                        scopes: []
                    }
                }
            };
        }
        if (scheme) {
            if (this.context.ownerDocument().getDocumentType() == DocumentType.openapi2) {
                let scheme20 = scheme;
                this.model.schemeName = scheme20.getSchemeName();
                this.model.description = scheme20.description;
                this.model.type = scheme20.type;
                this.model.in = scheme20.in;
                this.model.name = scheme20.name;
                this.model.flow = scheme20.flow;
                this.model.authorizationUrl = scheme20.authorizationUrl;
                this.model.tokenUrl = scheme20.tokenUrl;
                this.model.scopes = this.toScopesArray(scheme20.scopes);
            }
            else if (this.context.ownerDocument().getDocumentType() == DocumentType.openapi3) {
                let scheme30 = scheme;
                let model = this.model;
                model.schemeName = scheme30.getSchemeName();
                model.description = scheme30.description;
                model.type = scheme30.type;
                model.in = scheme30.in;
                model.name = scheme30.name;
                model.scheme = scheme30.scheme;
                model.bearerFormat = scheme30.bearerFormat;
                model.openIdConnectUrl = scheme30.openIdConnectUrl;
                this.readFlows(scheme30);
                if (!ObjectUtils.isNullOrUndefined(scheme30.flows)) {
                    if (!ObjectUtils.isNullOrUndefined(scheme30.flows.authorizationCode)) {
                        this.oauthTab = "authorizationCode";
                    }
                    if (!ObjectUtils.isNullOrUndefined(scheme30.flows.clientCredentials)) {
                        this.oauthTab = "clientCredentials";
                    }
                    if (!ObjectUtils.isNullOrUndefined(scheme30.flows.password)) {
                        this.oauthTab = "password";
                    }
                    if (!ObjectUtils.isNullOrUndefined(scheme30.flows.implicit)) {
                        this.oauthTab = "implicit";
                    }
                }
            }
            else {
                let aai20SecurityScheme = scheme;
                let model = this.model;
                model.schemeName = aai20SecurityScheme.getSchemeName();
                model.description = aai20SecurityScheme.description;
                model.type = aai20SecurityScheme.type;
                model.in = aai20SecurityScheme.in;
                model.name = aai20SecurityScheme.name;
                model.scheme = aai20SecurityScheme.scheme;
                model.bearerFormat = aai20SecurityScheme.bearerFormat;
                model.openIdConnectUrl = aai20SecurityScheme.openIdConnectUrl;
                this.readFlows(aai20SecurityScheme);
                if (!ObjectUtils.isNullOrUndefined(aai20SecurityScheme.flows)) {
                    if (!ObjectUtils.isNullOrUndefined(aai20SecurityScheme.flows.authorizationCode)) {
                        this.oauthTab = "authorizationCode";
                    }
                    if (!ObjectUtils.isNullOrUndefined(aai20SecurityScheme.flows.clientCredentials)) {
                        this.oauthTab = "clientCredentials";
                    }
                    if (!ObjectUtils.isNullOrUndefined(aai20SecurityScheme.flows.password)) {
                        this.oauthTab = "password";
                    }
                    if (!ObjectUtils.isNullOrUndefined(aai20SecurityScheme.flows.implicit)) {
                        this.oauthTab = "implicit";
                    }
                }
            }
        }
    }
    /**
     * Reads the flow information from the security scheme and copies it to the model.
     * @param scheme
     */
    readFlows(scheme) {
        if (!ObjectUtils.isNullOrUndefined(scheme.flows)) {
            if (!ObjectUtils.isNullOrUndefined(scheme.flows.implicit)) {
                this.readFlowInto(scheme.flows.implicit, this.model.flows.implicit);
            }
            if (!ObjectUtils.isNullOrUndefined(scheme.flows.password)) {
                this.readFlowInto(scheme.flows.password, this.model.flows.password);
            }
            if (!ObjectUtils.isNullOrUndefined(scheme.flows.authorizationCode)) {
                this.readFlowInto(scheme.flows.authorizationCode, this.model.flows.authorizationCode);
            }
            if (!ObjectUtils.isNullOrUndefined(scheme.flows.clientCredentials)) {
                this.readFlowInto(scheme.flows.clientCredentials, this.model.flows.clientCredentials);
            }
        }
    }
    /**
     * Reads flow information from the data model into the local UI model.
     * @param flowModel
     * @param flow
     */
    readFlowInto(flowModel, flow) {
        flow.enabled = true;
        flow.authorizationUrl = flowModel.authorizationUrl;
        flow.tokenUrl = flowModel.tokenUrl;
        flow.refreshUrl = flowModel.refreshUrl;
        flow.scopes = this.toScopesArray(flowModel.scopes);
    }
    /**
     * Converts from OAS30 scopes to an array of scope objects.
     * @param scopes
     */
    toScopesArray(scopes) {
        if (scopes && (this.is3x() || this.isAai2x())) {
            let rval = [];
            for (let sk in scopes) {
                let sd = scopes[sk];
                rval.push({
                    name: sk,
                    description: sd
                });
            }
            return rval;
        }
        else if (scopes && this.is2x()) {
            let scopes20 = scopes;
            return scopes20.getScopeNames().map(sname => {
                return {
                    name: sname,
                    description: scopes20.getScopeDescription(sname)
                };
            });
        }
    }
    /**
     * Sets the flow.
     * @param flow
     */
    setFlow(flow) {
        this.model.flow = flow;
        if (flow === "implicit") {
            this.model.tokenUrl = null;
        }
        if (flow === "password") {
            this.model.authorizationUrl = null;
        }
        if (flow === "accessCode") {
        }
        if (flow === "application") {
            this.model.authorizationUrl = null;
        }
    }
    /**
     * Returns true only if all the defined scopes are valid (have names).
     * @return
     */
    scopesAreValid() {
        if (this.model.type === "oauth2") {
            for (let scope of this.model.scopes) {
                if (ObjectUtils.isNullOrUndefined(scope.name) || scope.name.length === 0) {
                    return false;
                }
            }
        }
        return true;
    }
    /**
     * Sets the type.
     * @param type
     */
    setType(type) {
        this.model.type = type;
    }
    /**
     * Gets the 2.0 version of the data model.
     */
    model20() {
        return this.model;
    }
    /**
     * Gets the 3.0 version of the data model.
     */
    model30() {
        return this.model;
    }
    /**
     * Gets the Aai 2.0 version of the data model.
     */
    modelAai20() {
        return this.model;
    }
}
SecuritySchemeEditorComponent.decorators = [
    { type: Component, args: [{
                selector: "security-scheme-editor",
                template: "<entity-editor (onClose)=\"close()\" (onSave)=\"save()\" [context]=\"context\" entityType=\"security-scheme\" *ngIf=\"isOpen()\"\n               [showRequiredFieldsMessage]=\"true\" heading=\"Define the Security Scheme\" [valid]=\"isValid()\">\n    <div class=\"row-fluid body-section\">\n        <div class=\"col-md-12\">\n            <h3>1. Enter Security Scheme Info</h3>\n            <p class=\"explanation\">\n                <span>\n                    Enter the name, description, and type of the security scheme.\n                </span>\n            </p>\n        </div>\n        <div class=\"col-md-12\">\n            <div class=\"form-group\">\n                <label class=\"control-label required\" for=\"securitySchemeName\">Name</label>\n                <div *ngIf=\"_mode === 'create'\">\n                    <input name=\"schemeName\" type=\"text\" id=\"securitySchemeName\" class=\"form-control short\" #nameInput=\"ngModel\"\n                           placeholder=\"Enter Security Scheme Name\" (ngModelChange)=\"schemeExists = schemeNames.indexOf($event) != -1\"\n                           required [(ngModel)]=\"model.schemeName\" pattern=\"[a-zA-Z0-9\\.\\-_]+\">\n                    <div class=\"form-error-message error\" *ngIf=\"schemeExists\">Security Scheme already exists.</div>\n                    <form-error-message [inputModel]=\"nameInput\" [type]=\"'required'\">Security Scheme name is required.</form-error-message>\n                    <form-error-message [inputModel]=\"nameInput\" [type]=\"'pattern'\" [alwaysOn]=\"true\">Enter a valid name (only alpha-numeric characters are allowed - no whitespace).</form-error-message>\n                </div>\n                <div *ngIf=\"_mode === 'edit'\">\n                    <input title=\"To change a security scheme name, choose the 'Rename' option from the previous screen.\"\n                           name=\"schemeName\" type=\"text\" id=\"name_ro\" class=\"form-control\" required [(ngModel)]=\"model.schemeName\" readonly>\n                </div>\n            </div>\n            <div class=\"form-group\">\n                <label class=\"control-label\" for=\"description\">Description</label>\n                <div>\n                    <textarea name=\"description\" id=\"description\" class=\"form-control\" autosize #descriptionInput\n                              placeholder=\"Server description\" [(ngModel)]=\"model.description\"></textarea>\n                </div>\n            </div>\n            <div class=\"form-group\">\n                <label class=\"control-label required\">Security Type</label>\n                <div>\n                    <div class=\"dropdown\" *ngIf=\"is2x()\">\n                        <button class=\"btn btn-default dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\">\n                            <span *ngIf=\"!model.type\"><i>Choose Type</i></span>\n                            <span *ngIf=\"model.type === 'basic'\">BASIC</span>\n                            <span *ngIf=\"model.type === 'apiKey'\">API Key</span>\n                            <span *ngIf=\"model.type === 'oauth2'\">OAuth 2</span>\n                            <span class=\"caret\"></span>\n                        </button>\n                        <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"statusCodeMenu\">\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('basic')\">BASIC</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('apiKey')\">API Key</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('oauth2')\">OAuth 2</a></li>\n                        </ul>\n                    </div>\n                    <div class=\"dropdown\" *ngIf=\"is3x()\">\n                        <button class=\"btn btn-default dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\">\n                            <span *ngIf=\"!model.type\"><i>Choose Type</i></span>\n                            <span *ngIf=\"model.type === 'http'\">HTTP</span>\n                            <span *ngIf=\"model.type === 'apiKey'\">API Key</span>\n                            <span *ngIf=\"model.type === 'oauth2'\">OAuth 2</span>\n                            <span *ngIf=\"model.type === 'openIdConnect'\">OpenID Connect</span>\n                            <span class=\"caret\"></span>\n                        </button>\n                        <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"statusCodeMenu\">\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('http')\">HTTP</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('apiKey')\">API Key</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('oauth2')\">OAuth 2</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('openIdConnect')\">OpenID Connect</a></li>\n                        </ul>\n                    </div>\n                    <div class=\"dropdown\" *ngIf=\"isAai2x()\">\n                        <button class=\"btn btn-default dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\">\n                            <span *ngIf=\"!model.type\"><i>Choose Type</i></span>\n                            <span *ngIf=\"model.type === 'http'\">HTTP</span>\n                            <span *ngIf=\"model.type === 'httpApiKey'\">HTTP API Key</span>\n                            <span *ngIf=\"model.type === 'apiKey'\">API Key</span>\n                            <span *ngIf=\"model.type === 'oauth2'\">OAuth 2</span>\n                            <span *ngIf=\"model.type === 'openIdConnect'\">OpenID Connect</span>\n                            <span *ngIf=\"model.type === 'userPassword'\">User Password</span>\n                            <span *ngIf=\"model.type === 'X509'\">X509 Certificate</span>\n                            <span *ngIf=\"model.type === 'symmetricEncryption'\">Symmetric Encryption</span>\n                            <span *ngIf=\"model.type === 'asymmetricEncryption'\">Asymmetric Encryption</span>\n                            <span class=\"caret\"></span>\n                        </button>\n                        <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"statusCodeMenu\">\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('http')\">HTTP</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().in = ''; setType('httpApiKey')\">HTTP API Key</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().in = ''; setType('apiKey')\">API Key</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('oauth2')\">OAuth 2</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('openIdConnect')\">OpenID Connect</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('userPassword')\">User Password</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('X509')\">X509 Certificate</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('symmetricEncryption')\">Symmetric Encryption</a></li>\n                            <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setType('asymmetricEncryption')\">Asymmetric Encryption</a></li>\n                        </ul>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n    <div class=\"row-fluid divider-section\">\n        <div class=\"col-md-12\">\n            <hr />\n        </div>\n    </div>\n    <div class=\"row-fluid body-section\">\n        <div class=\"col-md-12\">\n            <h3>2. Configure Security Scheme Details</h3>\n            <p class=\"explanation\">\n                <span>\n                    Configure the type-specific details for the security scheme.  You must first configure the scheme type above.\n                </span>\n            </p>\n        </div>\n        <div class=\"col-md-12\">\n            <p class=\"empty-state\" *ngIf=\"!model.type\">\n                No security type has been configured for this security scheme.  A type must first be selected prior to configuring\n                the scheme's type-specific details.\n            </p>\n\n            <div class=\"scheme-details\" *ngIf=\"model.type\">\n\n                <div *ngIf=\"is2x()\">\n                    <!-- BASIC Auth -->\n                    <div class=\"basic-auth\" *ngIf=\"model20().type === 'basic'\">\n                        <div class=\"alert alert-success\">\n                            <span class=\"pficon pficon-ok\"></span>\n                            <strong>All Set!</strong> No additional configuration options are needed for BASIC authentication.\n                        </div>\n                    </div>\n                    <!-- API Key Auth Config -->\n                    <div class=\"apiKey-auth\" *ngIf=\"model20().type === 'apiKey'\">\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"in20\">Key Location</label>\n                            <div>\n                                <div class=\"dropdown\">\n                                    <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"in20\" data-toggle=\"dropdown\">\n                                        <span *ngIf=\"!model20().in\"><i>Choose Location</i></span>\n                                        <span *ngIf=\"model20().in === 'header'\">HTTP header</span>\n                                        <span *ngIf=\"model20().in === 'query'\">Query Parameter</span>\n                                        <span class=\"caret\"></span>\n                                    </button>\n                                    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"statusCodeMenu\">\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"model20().in = 'header'\">HTTP header</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"model20().in = 'query'\">Query Parameter</a></li>\n                                    </ul>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"name20\">Header/Parameter Name</label>\n                            <div>\n                                <input name=\"name\" type=\"text\" id=\"name20\" class=\"form-control short\" [(ngModel)]=\"model20().name\"\n                                       placeholder=\"Enter a {{ model20().in == 'header' ? 'header' : 'query parameter' }} name\">\n                            </div>\n                        </div>\n                    </div>\n                    <!-- OAuth2 Auth Config -->\n                    <div class=\"oauth2-auth\" *ngIf=\"model20().type === 'oauth2'\">\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"flow\">OAuth Flow</label>\n                            <div>\n                                <div class=\"dropdown\">\n                                    <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"flow\" data-toggle=\"dropdown\">\n                                        <span *ngIf=\"!model20().flow\"><i>Choose Flow</i></span>\n                                        <span *ngIf=\"model20().flow === 'implicit'\">Implicit</span>\n                                        <span *ngIf=\"model20().flow === 'password'\">Password</span>\n                                        <span *ngIf=\"model20().flow === 'application'\">Application</span>\n                                        <span *ngIf=\"model20().flow === 'accessCode'\">Access Code</span>\n                                        <span class=\"caret\"></span>\n                                    </button>\n                                    <ul class=\"dropdown-menu\" role=\"menu\">\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setFlow('implicit')\">Implicit</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setFlow('password')\">Password</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setFlow('application')\">Application</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"setFlow('accessCode')\">Access Code</a></li>\n                                    </ul>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"form-group\" *ngIf=\"model20().flow === 'implicit' || model20().flow === 'accessCode'\">\n                            <label class=\"control-label\" for=\"authorizationUrl\">Auth URL</label>\n                            <div>\n                                <input name=\"authorizationUrl\" type=\"text\" id=\"authorizationUrl\" class=\"form-control\"\n                                       placeholder=\"Enter the authorization URL\" [(ngModel)]=\"model20().authorizationUrl\">\n                            </div>\n                        </div>\n                        <div class=\"form-group\" *ngIf=\"model20().flow === 'password' || model20().flow === 'application' || model20().flow === 'accessCode'\">\n                            <label class=\"control-label\" for=\"tokenUrl\">Token URL</label>\n                            <div>\n                                <input name=\"tokenUrl\" type=\"text\" id=\"tokenUrl\" class=\"form-control\"\n                                       placeholder=\"Enter the token URL\" [(ngModel)]=\"model20().tokenUrl\">\n                            </div>\n                        </div>\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"scopes20\">Scopes</label>\n                            <scopes-input id=\"scopes20\" [scopes]=\"model20().scopes\" (onChange)=\"model20().scopes = $event\"></scopes-input>\n                        </div>\n                    </div>\n                </div>\n                <div *ngIf=\"is3x()\">\n                    <!-- HTTP Auth Config -->\n                    <div class=\"http-auth\" *ngIf=\"model30().type === 'http'\">\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"scheme\">Scheme</label>\n                            <div>\n                                <div class=\"dropdown\">\n                                    <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"scheme\" data-toggle=\"dropdown\">\n                                        <span *ngIf=\"!model30().scheme\"><i>Choose Scheme</i></span>\n                                        <span *ngIf=\"model30().scheme === 'basic'\">BASIC</span>\n                                        <span *ngIf=\"model30().scheme === 'bearer'\">Bearer</span>\n                                        <span *ngIf=\"model30().scheme === 'digest'\">Digest</span>\n                                        <span class=\"caret\"></span>\n                                    </button>\n                                    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"statusCodeMenu\">\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"model30().scheme = 'basic'\">BASIC</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"model30().scheme = 'bearer'\">Bearer</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"model30().scheme = 'digest'\">Digest</a></li>\n                                    </ul>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"form-group\" *ngIf=\"model30().scheme === 'bearer'\">\n                            <label class=\"control-label\" for=\"bearerFormat\">Format</label>\n                            <div>\n                                <div class=\"dropdown\">\n                                    <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"bearerFormat\" data-toggle=\"dropdown\">\n                                        <span *ngIf=\"model30().bearerFormat === '' || !model30().bearerFormat\"><i>Choose Format</i></span>\n                                        <span *ngIf=\"model30().bearerFormat === 'jwt'\">JWT</span>\n                                        <span *ngIf=\"model30().bearerFormat === 'oauth'\">OAuth</span>\n                                        <span class=\"caret\"></span>\n                                    </button>\n                                    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"statusCodeMenu\">\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"model30().bearerFormat = 'jwt'\">JWT</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"model30().bearerFormat = 'oauth'\">OAuth</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"model30().bearerFormat = null\"><i>None</i></a></li>\n                                    </ul>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                    <!-- OpenID Connect Config -->\n                    <div class=\"openIdConnect-auth\" *ngIf=\"model30().type === 'openIdConnect'\">\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"openIdConnectUrl\">OpenID Connect URL</label>\n                            <div>\n                                <input name=\"name\" type=\"text\" id=\"openIdConnectUrl\" class=\"form-control\" pattern=\"https?://.+\"\n                                       placeholder=\"Enter a valid OpenID Connect URL\" [(ngModel)]=\"model30().openIdConnectUrl\" #oidConnectUrl=\"ngModel\">\n                                <form-error-message [inputModel]=\"oidConnectUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                            </div>\n                        </div>\n                    </div>\n                    <!-- API Key Auth Config -->\n                    <div class=\"apiKey-auth\" *ngIf=\"model30().type === 'apiKey'\">\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"in\">Key Location</label>\n                            <div>\n                                <div class=\"dropdown\">\n                                    <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"in\" data-toggle=\"dropdown\">\n                                        <span *ngIf=\"!model30().in\"><i>Choose Location</i></span>\n                                        <span *ngIf=\"model30().in === 'header'\">HTTP header</span>\n                                        <span *ngIf=\"model30().in === 'query'\">Query Parameter</span>\n                                        <span *ngIf=\"model30().in === 'cookie'\">Cookie</span>\n                                        <span class=\"caret\"></span>\n                                    </button>\n                                    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"statusCodeMenu\">\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"model30().in = 'header'\">HTTP header</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"model30().in = 'query'\">Query Parameter</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"model30().in = 'cookie'\">Cookie</a></li>\n                                    </ul>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"name\">Name</label>\n                            <div>\n                                <input name=\"name\" type=\"text\" id=\"name\" class=\"form-control short\"\n                                       placeholder=\"Name of {{ model30().in === 'query' ? 'query parameter' : (!model30().in ? 'parameter' : model30().in) }}\"\n                                       [(ngModel)]=\"model30().name\">\n                            </div>\n                        </div>\n                    </div>\n                    <!-- OAuth2 Auth Config -->\n                    <div class=\"oauth2-auth\" *ngIf=\"model30().type === 'oauth2'\">\n                        <ul class=\"nav nav-tabs\">\n                            <li [class.enabled]=\"model30().flows.implicit.enabled\" [class.active]=\"oauthTab === 'implicit'\"><a (click)=\"oauthTab = 'implicit'\">Implicit</a></li>\n                            <li [class.enabled]=\"model30().flows.password.enabled\" [class.active]=\"oauthTab === 'password'\"><a (click)=\"oauthTab = 'password'\">Password</a></li>\n                            <li [class.enabled]=\"model30().flows.clientCredentials.enabled\" [class.active]=\"oauthTab === 'clientCredentials'\"><a (click)=\"oauthTab = 'clientCredentials'\">Client Credentials</a></li>\n                            <li [class.enabled]=\"model30().flows.authorizationCode.enabled\" [class.active]=\"oauthTab === 'authorizationCode'\"><a (click)=\"oauthTab = 'authorizationCode'\">Authorization Code</a></li>\n                        </ul>\n                        <div class=\"panel panel-default tab-panel\">\n                            <!-- Implicit Flow -->\n                            <div class=\"panel-body\" *ngIf=\"oauthTab === 'implicit'\">\n                                <div>\n                                    <input name=\"implicit_enabled\" id=\"implicit_enabled\" type=\"checkbox\" [(ngModel)]=\"model30().flows.implicit.enabled\">\n                                    <label for=\"implicit_enabled\">Enable this OAuth flow</label>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"implicit_authorizationUrl\">Auth URL</label>\n                                    <div>\n                                        <input name=\"implicit_authorizationUrl\" type=\"text\" id=\"implicit_authorizationUrl\" class=\"form-control\"\n                                               placeholder=\"OAuth Authorization URL\" [(ngModel)]=\"model30().flows.implicit.authorizationUrl\"\n                                               pattern=\"https?://.+\" #implicitAuthUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"implicitAuthUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"implicit_refreshUrl\">Refresh URL</label>\n                                    <div>\n                                        <input name=\"implicit_refreshUrl\" type=\"text\" id=\"implicit_refreshUrl\" class=\"form-control\"\n                                               placeholder=\"OAuth Refresh URL\" [(ngModel)]=\"model30().flows.implicit.refreshUrl\"\n                                               pattern=\"https?://.+\" #implicitRefreshUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"implicitRefreshUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <!-- Scopes -->\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"implicit-scopes\">Scopes</label>\n                                    <scopes-input id=\"implicit-scopes\" [scopes]=\"model30().flows.implicit.scopes\"\n                                                  (onChange)=\"model30().flows.implicit.scopes = $event\"></scopes-input>\n                                </div>\n                            </div>\n                            <!-- Password Flow -->\n                            <div class=\"panel-body\" *ngIf=\"oauthTab === 'password'\">\n                                <div>\n                                    <input name=\"password_enabled\" id=\"password_enabled\" type=\"checkbox\" [(ngModel)]=\"model30().flows.password.enabled\">\n                                    <label for=\"password_enabled\">Enable this OAuth flow</label>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"password_tokenUrl\">Token URL</label>\n                                    <div>\n                                        <input name=\"password_tokenUrl\" type=\"text\" id=\"password_tokenUrl\" class=\"form-control\"\n                                               placeholder=\"OAuth Token URL\" [(ngModel)]=\"model30().flows.password.tokenUrl\"\n                                               pattern=\"https?://.+\" #passwordTokenUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"passwordTokenUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"password_refreshUrl\">Refresh URL</label>\n                                    <div>\n                                        <input name=\"password_refreshUrl\" type=\"text\" id=\"password_refreshUrl\" class=\"form-control\"\n                                               placeholder=\"OAuth Refresh URL\" [(ngModel)]=\"model30().flows.password.refreshUrl\"\n                                               pattern=\"https?://.+\" #passwordRefreshUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"passwordRefreshUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <!-- Scopes -->\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"password-scopes\">Scopes</label>\n                                    <scopes-input id=\"password-scopes\" [scopes]=\"model30().flows.password.scopes\"\n                                                  (onChange)=\"model30().flows.password.scopes = $event\"></scopes-input>\n                                </div>\n                            </div>\n                            <!-- Client Credentials Flow -->\n                            <div class=\"panel-body\" *ngIf=\"oauthTab === 'clientCredentials'\">\n                                <div>\n                                    <input name=\"clientCredentials_enabled\" id=\"clientCredentials_enabled\" type=\"checkbox\" [(ngModel)]=\"model30().flows.clientCredentials.enabled\">\n                                    <label for=\"clientCredentials_enabled\">Enable this OAuth flow</label>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"clientCredentials_tokenUrl\">Token URL</label>\n                                    <div>\n                                        <input name=\"clientCredentials_tokenUrl\" type=\"text\" id=\"clientCredentials_tokenUrl\" class=\"form-control\"\n                                               placeholder=\"OAuth Token URL\" [(ngModel)]=\"model30().flows.clientCredentials.tokenUrl\"\n                                               pattern=\"https?://.+\" #clientCredsTokenUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"clientCredsTokenUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"clientCredentials_refreshUrl\">Refresh URL</label>\n                                    <div>\n                                        <input name=\"clientCredentials_refreshUrl\" type=\"text\" id=\"clientCredentials_refreshUrl\" class=\"form-control\"\n                                               placeholder=\"OAuth Refresh URL\" [(ngModel)]=\"model30().flows.clientCredentials.refreshUrl\"\n                                               pattern=\"https?://.+\" #clientCredsRefreshUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"clientCredsRefreshUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <!-- Scopes -->\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"cc-scopes\">Scopes</label>\n                                    <scopes-input id=\"cc-scopes\" [scopes]=\"model30().flows.clientCredentials.scopes\"\n                                                  (onChange)=\"model30().flows.clientCredentials.scopes = $event\"></scopes-input>\n                                </div>\n                            </div>\n                            <!-- Authorization Code Flow -->\n                            <div class=\"panel-body\" *ngIf=\"oauthTab === 'authorizationCode'\">\n                                <div>\n                                    <input name=\"authorizationCode_enabled\" id=\"authorizationCode_enabled\" type=\"checkbox\" [(ngModel)]=\"model30().flows.authorizationCode.enabled\">\n                                    <label for=\"authorizationCode_enabled\">Enable this OAuth flow</label>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"authorizationCode_authorizationUrl\">Auth URL</label>\n                                    <div>\n                                        <input name=\"authorizationCode_authorizationUrl\" type=\"text\" id=\"authorizationCode_authorizationUrl\" class=\"form-control\"\n                                               placeholder=\"OAuth Authorization URL\" [(ngModel)]=\"model30().flows.authorizationCode.authorizationUrl\"\n                                               pattern=\"https?://.+\" #authCodeAuthUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"authCodeAuthUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"authorizationCode_tokenUrl\">Token URL</label>\n                                    <div>\n                                        <input name=\"authorizationCode_tokenUrl\" type=\"text\" id=\"authorizationCode_tokenUrl\" class=\"form-control\"\n                                               placeholder=\"OAuth Token URL\" [(ngModel)]=\"model30().flows.authorizationCode.tokenUrl\"\n                                               pattern=\"https?://.+\" #authCodeTokenUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"authCodeTokenUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"authorizationCode_refreshUrl\">Refresh URL</label>\n                                    <div>\n                                        <input name=\"authorizationCode_refreshUrl\" type=\"text\" id=\"authorizationCode_refreshUrl\" class=\"form-control\"\n                                               placeholder=\"OAuth Refresh URL\" [(ngModel)]=\"model30().flows.authorizationCode.refreshUrl\"\n                                               pattern=\"https?://.+\" #authCodeRefreshUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"authCodeRefreshUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <!-- Scopes -->\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"authcode-scopes\">Scopes</label>\n                                    <scopes-input id=\"authcode-scopes\" [scopes]=\"model30().flows.authorizationCode.scopes\"\n                                                  (onChange)=\"model30().flows.authorizationCode.scopes = $event\"></scopes-input>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n                <div *ngIf=\"isAai2x()\">\n                <!-- HTTP Auth Config -->\n                    <div class=\"http-auth\" *ngIf=\"modelAai20().type === 'http'\">\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"schemeAai20\">Scheme</label>\n                            <div>\n                                <div class=\"dropdown\">\n                                    <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"schemeAai20\" data-toggle=\"dropdown\">\n                                        <span *ngIf=\"!modelAai20().scheme\"><i>Choose Scheme</i></span>\n                                        <span *ngIf=\"modelAai20().scheme === 'basic'\">BASIC</span>\n                                        <span *ngIf=\"modelAai20().scheme === 'bearer'\">Bearer</span>\n                                        <span *ngIf=\"modelAai20().scheme === 'digest'\">Digest</span>\n                                        <span class=\"caret\"></span>\n                                    </button>\n                                    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"statusCodeMenu\">\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().scheme = 'basic'\">BASIC</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().scheme = 'bearer'\">Bearer</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().scheme = 'digest'\">Digest</a></li>\n                                    </ul>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"form-group\" *ngIf=\"modelAai20().scheme === 'bearer'\">\n                            <label class=\"control-label\" for=\"bearerFormatAai20\">Format</label>\n                            <div>\n                                <div class=\"dropdown\">\n                                    <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"bearerFormatAai20\" data-toggle=\"dropdown\">\n                                        <span *ngIf=\"modelAai20().bearerFormat === '' || !modelAai20().bearerFormat\"><i>Choose Format</i></span>\n                                        <span *ngIf=\"modelAai20().bearerFormat === 'jwt'\">JWT</span>\n                                        <span *ngIf=\"modelAai20().bearerFormat === 'oauth'\">OAuth</span>\n                                        <span class=\"caret\"></span>\n                                    </button>\n                                    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"statusCodeMenu\">\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().bearerFormat = 'jwt'\">JWT</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().bearerFormat = 'oauth'\">OAuth</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().bearerFormat = null\"><i>None</i></a></li>\n                                    </ul>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                    <!-- OpenID Connect Config -->\n                    <div class=\"openIdConnect-auth\" *ngIf=\"modelAai20().type === 'openIdConnect'\">\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"openIdConnectUrlAai20\">OpenID Connect URL</label>\n                            <div>\n                                <input name=\"name\" type=\"text\" id=\"openIdConnectUrlAai20\" class=\"form-control\" pattern=\"https?://.+\"\n                                       placeholder=\"Enter a valid OpenID Connect URL\" [(ngModel)]=\"modelAai20().openIdConnectUrl\" #oidConnectUrl=\"ngModel\">\n                                <form-error-message [inputModel]=\"oidConnectUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                            </div>\n                        </div>\n                    </div>\n                    <!-- API Key Auth Config -->\n                    <div class=\"apiKey-auth\" *ngIf=\"modelAai20().type === 'apiKey'\">\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"inApiKeyAai20\">Key Location</label>\n                            <div>\n                                <div class=\"dropdown\">\n                                    <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"inApiKeyAai20\" data-toggle=\"dropdown\">\n                                        <span *ngIf=\"!modelAai20().in\"><i>Choose Location</i></span>\n                                        <span *ngIf=\"modelAai20().in === 'user'\">User</span>\n                                        <span *ngIf=\"modelAai20().in === 'password'\">Password</span>\n                                        <span class=\"caret\"></span>\n                                    </button>\n                                    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"statusCodeMenu\">\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().in = 'user'\">User</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().in = 'password'\">Password</a></li>\n                                    </ul>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                    <!-- HTTP API Key Auth Config -->\n                    <div class=\"apiKey-auth\" *ngIf=\"modelAai20().type === 'httpApiKey'\">\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"inHttpApiKeyAai20\">Key Location</label>\n                            <div>\n                                <div class=\"dropdown\">\n                                    <button class=\"btn btn-default dropdown-toggle\" type=\"button\" id=\"inHttpApiKeyAai20\" data-toggle=\"dropdown\">\n                                        <span *ngIf=\"!modelAai20().in\"><i>Choose Location</i></span>\n                                        <span *ngIf=\"modelAai20().in === 'header'\">HTTP header</span>\n                                        <span *ngIf=\"modelAai20().in === 'query'\">Query Parameter</span>\n                                        <span *ngIf=\"modelAai20().in === 'cookie'\">Cookie</span>\n                                        <span class=\"caret\"></span>\n                                    </button>\n                                    <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"statusCodeMenu\">\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().in = 'header'\">HTTP header</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().in = 'query'\">Query Parameter</a></li>\n                                        <li role=\"presentation\"><a role=\"menuitem\" (click)=\"modelAai20().in = 'cookie'\">Cookie</a></li>\n                                    </ul>\n                                </div>\n                            </div>\n                        </div>\n                        <div class=\"form-group\">\n                            <label class=\"control-label\" for=\"nameAai20\">Name</label>\n                            <div>\n                                <input name=\"name\" type=\"text\" id=\"nameAai20\" class=\"form-control short\"\n                                       placeholder=\"Name of {{ modelAai20().in === 'query' ? 'query parameter' : (!modelAai20().in ? 'parameter' : modelAai20().in) }}\"\n                                       [(ngModel)]=\"modelAai20().name\">\n                            </div>\n                        </div>\n                    </div>\n                    <!-- OAuth2 Auth Config -->\n                    <div class=\"oauth2-auth\" *ngIf=\"modelAai20().type === 'oauth2'\">\n                        <ul class=\"nav nav-tabs\">\n                            <li [class.enabled]=\"modelAai20().flows.implicit.enabled\" [class.active]=\"oauthTab === 'implicit'\"><a (click)=\"oauthTab = 'implicit'\">Implicit</a></li>\n                            <li [class.enabled]=\"modelAai20().flows.password.enabled\" [class.active]=\"oauthTab === 'password'\"><a (click)=\"oauthTab = 'password'\">Password</a></li>\n                            <li [class.enabled]=\"modelAai20().flows.clientCredentials.enabled\" [class.active]=\"oauthTab === 'clientCredentials'\"><a (click)=\"oauthTab = 'clientCredentials'\">Client Credentials</a></li>\n                            <li [class.enabled]=\"modelAai20().flows.authorizationCode.enabled\" [class.active]=\"oauthTab === 'authorizationCode'\"><a (click)=\"oauthTab = 'authorizationCode'\">Authorization Code</a></li>\n                        </ul>\n                        <div class=\"panel panel-default tab-panel\">\n                            <!-- Implicit Flow -->\n                            <div class=\"panel-body\" *ngIf=\"oauthTab === 'implicit'\">\n                                <div>\n                                    <input name=\"implicit_enabledAai20\" id=\"implicit_enabledAai20\" type=\"checkbox\" [(ngModel)]=\"modelAai20().flows.implicit.enabled\">\n                                    <label for=\"implicit_enabledAai20\">Enable this OAuth flow</label>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"implicit_authorizationUrlAai20\">Auth URL</label>\n                                    <div>\n                                        <input name=\"implicit_authorizationUrlAai20\" type=\"text\" id=\"implicit_authorizationUrlAai20\" class=\"form-control\"\n                                               placeholder=\"OAuth Authorization URL\" [(ngModel)]=\"modelAai20().flows.implicit.authorizationUrl\"\n                                               pattern=\"https?://.+\" #implicitAuthUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"implicitAuthUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"implicit_refreshUrlAai20\">Refresh URL</label>\n                                    <div>\n                                        <input name=\"implicit_refreshUrlAai20\" type=\"text\" id=\"implicit_refreshUrlAai20\" class=\"form-control\"\n                                               placeholder=\"OAuth Refresh URL\" [(ngModel)]=\"modelAai20().flows.implicit.refreshUrl\"\n                                               pattern=\"https?://.+\" #implicitRefreshUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"implicitRefreshUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <!-- Scopes -->\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"implicit-scopesAai20\">Scopes</label>\n                                    <scopes-input id=\"implicit-scopesAai20\" [scopes]=\"modelAai20().flows.implicit.scopes\"\n                                                  (onChange)=\"modelAai20().flows.implicit.scopes = $event\"></scopes-input>\n                                </div>\n                            </div>\n                            <!-- Password Flow -->\n                            <div class=\"panel-body\" *ngIf=\"oauthTab === 'password'\">\n                                <div>\n                                    <input name=\"password_enabledAai20\" id=\"password_enabledAai20\" type=\"checkbox\" [(ngModel)]=\"modelAai20().flows.password.enabled\">\n                                    <label for=\"password_enabledAai20\">Enable this OAuth flow</label>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"password_tokenUrlAai20\">Token URL</label>\n                                    <div>\n                                        <input name=\"password_tokenUrlAai20\" type=\"text\" id=\"password_tokenUrlAai20\" class=\"form-control\"\n                                               placeholder=\"OAuth Token URL\" [(ngModel)]=\"modelAai20().flows.password.tokenUrl\"\n                                               pattern=\"https?://.+\" #passwordTokenUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"passwordTokenUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"password_refreshUrlAai20\">Refresh URL</label>\n                                    <div>\n                                        <input name=\"password_refreshUrlAai20\" type=\"text\" id=\"password_refreshUrlAai20\" class=\"form-control\"\n                                               placeholder=\"OAuth Refresh URL\" [(ngModel)]=\"modelAai20().flows.password.refreshUrl\"\n                                               pattern=\"https?://.+\" #passwordRefreshUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"passwordRefreshUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <!-- Scopes -->\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"password-scopesAai20\">Scopes</label>\n                                    <scopes-input id=\"password-scopesAai20\" [scopes]=\"modelAai20().flows.password.scopes\"\n                                                  (onChange)=\"modelAai20().flows.password.scopes = $event\"></scopes-input>\n                                </div>\n                            </div>\n                            <!-- Client Credentials Flow -->\n                            <div class=\"panel-body\" *ngIf=\"oauthTab === 'clientCredentials'\">\n                                <div>\n                                    <input name=\"clientCredentials_enabledAai20\" id=\"clientCredentials_enabledAai20\" type=\"checkbox\" [(ngModel)]=\"modelAai20().flows.clientCredentials.enabled\">\n                                    <label for=\"clientCredentials_enabledAai20\">Enable this OAuth flow</label>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"clientCredentials_tokenUrlAai20\">Token URL</label>\n                                    <div>\n                                        <input name=\"clientCredentials_tokenUrlAai20\" type=\"text\" id=\"clientCredentials_tokenUrlAai20\" class=\"form-control\"\n                                               placeholder=\"OAuth Token URL\" [(ngModel)]=\"modelAai20().flows.clientCredentials.tokenUrl\"\n                                               pattern=\"https?://.+\" #clientCredsTokenUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"clientCredsTokenUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"clientCredentials_refreshUrlAai20\">Refresh URL</label>\n                                    <div>\n                                        <input name=\"clientCredentials_refreshUrlAai20\" type=\"text\" id=\"clientCredentials_refreshUrlAai20\" class=\"form-control\"\n                                               placeholder=\"OAuth Refresh URL\" [(ngModel)]=\"modelAai20().flows.clientCredentials.refreshUrl\"\n                                               pattern=\"https?://.+\" #clientCredsRefreshUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"clientCredsRefreshUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <!-- Scopes -->\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"cc-scopesAai20\">Scopes</label>\n                                    <scopes-input id=\"cc-scopesAai20\" [scopes]=\"modelAai20().flows.clientCredentials.scopes\"\n                                                  (onChange)=\"modelAai20().flows.clientCredentials.scopes = $event\"></scopes-input>\n                                </div>\n                            </div>\n                            <!-- Authorization Code Flow -->\n                            <div class=\"panel-body\" *ngIf=\"oauthTab === 'authorizationCode'\">\n                                <div>\n                                    <input name=\"authorizationCode_enabledAai20\" id=\"authorizationCode_enabledAai20\" type=\"checkbox\" [(ngModel)]=\"modelAai20().flows.authorizationCode.enabled\">\n                                    <label for=\"authorizationCode_enabledAai20\">Enable this OAuth flow</label>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"authorizationCode_authorizationUrlAai20\">Auth URL</label>\n                                    <div>\n                                        <input name=\"authorizationCode_authorizationUrlAai20\" type=\"text\" id=\"authorizationCode_authorizationUrlAai20\" class=\"form-control\"\n                                               placeholder=\"OAuth Authorization URL\" [(ngModel)]=\"modelAai20().flows.authorizationCode.authorizationUrl\"\n                                               pattern=\"https?://.+\" #authCodeAuthUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"authCodeAuthUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"authorizationCode_tokenUrlAai20\">Token URL</label>\n                                    <div>\n                                        <input name=\"authorizationCode_tokenUrlAai20\" type=\"text\" id=\"authorizationCode_tokenUrlAai20\" class=\"form-control\"\n                                               placeholder=\"OAuth Token URL\" [(ngModel)]=\"modelAai20().flows.authorizationCode.tokenUrl\"\n                                               pattern=\"https?://.+\" #authCodeTokenUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"authCodeTokenUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"authorizationCode_refreshUrlAai20\">Refresh URL</label>\n                                    <div>\n                                        <input name=\"authorizationCode_refreshUrlAai20\" type=\"text\" id=\"authorizationCode_refreshUrlAai20\" class=\"form-control\"\n                                               placeholder=\"OAuth Refresh URL\" [(ngModel)]=\"modelAai20().flows.authorizationCode.refreshUrl\"\n                                               pattern=\"https?://.+\" #authCodeRefreshUrl=\"ngModel\">\n                                        <form-error-message [inputModel]=\"authCodeRefreshUrl\" [type]=\"'pattern'\">Please enter a valid URL.</form-error-message>\n                                    </div>\n                                </div>\n                                <!-- Scopes -->\n                                <div class=\"form-group\">\n                                    <label class=\"control-label\" for=\"authcode-scopesAai20\">Scopes</label>\n                                    <scopes-input id=\"authcode-scopesAai20\" [scopes]=\"modelAai20().flows.authorizationCode.scopes\"\n                                                  (onChange)=\"modelAai20().flows.authorizationCode.scopes = $event\"></scopes-input>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n</entity-editor>\n",
                encapsulation: ViewEncapsulation.None,
                styles: [".security-scheme-entity-editor .body-section .scheme-details{margin-left:20px}.security-scheme-entity-editor .body-section #name_ro{border-color:#002d45;background-color:#efefef;color:#666}.security-scheme-entity-editor .scheme-details .form-group div input{min-width:350px;width:100%}.security-scheme-entity-editor .oauth2-auth input[type=checkbox]{margin-right:3px}"]
            },] }
];
SecuritySchemeEditorComponent.propDecorators = {
    nameInput: [{ type: ViewChildren, args: ["nameInput",] }]
};
//# sourceMappingURL=data:application/json;base64, 