"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
require("reflect-metadata");
const core_1 = require("@oclif/core");
const core_2 = require("@oclif/core");
const inquirer_select_pro_1 = require("inquirer-select-pro");
const command_base_exec_1 = require("../../command-base-exec");
const flexsearch_1 = require("flexsearch");
class SnapshotTags extends command_base_exec_1.CommandBaseExec {
    captureArgs() {
        var _a, _b, _c, _d;
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const { flags } = yield this.parse(SnapshotTags);
            let partial = {};
            partial.pageSize = flags.pageSize;
            let piped;
            partial.toScript = { enabled: flags["to-script"] };
            const pipedInput = this.pipedInput;
            if (pipedInput) {
                try {
                    piped = JSON.parse(pipedInput);
                    partial.silent = true;
                    partial.toScript = { enabled: false };
                    partial.add = [...((_a = flags.addTags) !== null && _a !== void 0 ? _a : []), ...((_b = piped === null || piped === void 0 ? void 0 : piped.add) !== null && _b !== void 0 ? _b : [])];
                    partial.remove = [...((_c = flags.removeTags) !== null && _c !== void 0 ? _c : []), ...((_d = piped === null || piped === void 0 ? void 0 : piped.remove) !== null && _d !== void 0 ? _d : [])];
                }
                catch (error) {
                    this.log(error);
                    throw new Error("Piped data is invalid");
                }
            }
            partial.silent = partial.silent || flags.silent;
            Object.entries(SnapshotTags.flags).forEach(([name, flagDef]) => {
                var _a;
                if (flagDef.expr) {
                    const expr = flagDef.expr;
                    partial.filters = partial.filters || {};
                    let data = [];
                    let flagset = flags[name] && Array.isArray(flags[name]) && flags[name].length > 0;
                    if (flagset) {
                        for (let index = 0; index < flags[name].length; index++) {
                            const element = flags[name][index];
                            data = [...data, ...element.split(',').map((t) => t.trim()).filter(Boolean)];
                        }
                        // data = [...flags[name]]
                    }
                    if (pipedInput && (piped === null || piped === void 0 ? void 0 : piped.filters)) {
                        const pipedData = (_a = piped.filters[expr.name]) !== null && _a !== void 0 ? _a : [];
                        data = [...(data !== null && data !== void 0 ? data : []), ...pipedData];
                        flagset = data.length > 0;
                    }
                    if (flagset)
                        partial.filters[expr.name] = { input: data, expr: this.toInQuery(data, expr.on) };
                }
            });
            // ---------------------------------------------------------------
            // ---------------------------------------------------------------
            const takeDefaults = flags['take-defaults'];
            return [partial, takeDefaults];
        });
    }
    runAsync() {
        const _super = Object.create(null, {
            runAsync: { get: () => super.runAsync }
        });
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            yield _super.runAsync.call(this);
            process.exit(0);
        });
    }
    buildCandidate_silently(partial, rootMap) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const snapshots = yield this.getData(partial);
            const partialFull = partial;
            if (partialFull.remove && Array.isArray(partialFull.remove) && partialFull.remove.length > 0) {
                const allTags = this.checkForTags(snapshots);
                if (!allTags || !Array.isArray(allTags) || (Array.isArray(allTags) && allTags.length === 0)) {
                    this.log('\nNo tags to remove');
                }
                else {
                    this.removeTags(snapshots, partialFull.remove, true);
                }
            }
            if (partialFull.add && Array.isArray(partialFull.add) && partialFull.add.length > 0) {
                this.addTags(snapshots, partialFull.add, true);
            }
            return partial;
        });
    }
    buildCandidate_interactively(partial, rootMap, takeDefaults) {
        var _a;
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            while (true) {
                const selectedItems = yield this.multiSelect(partial);
                if (!selectedItems || selectedItems.length === 0) {
                    return partial;
                }
                yield this.bulkManageTags(selectedItems, partial);
                if ((_a = partial === null || partial === void 0 ? void 0 : partial.toScript) === null || _a === void 0 ? void 0 : _a.enabled) {
                    partial.toScript.snapShotData = selectedItems;
                    return partial;
                }
                const again = yield core_2.ux.prompt('\nBack to search (s) or (q)uit?', { type: 'single', default: 's' });
                if (again.toLowerCase() === 'q') {
                    return partial;
                }
            }
        });
    }
    buildCommandString(candidate, cmd) {
        var _a, _b, _c;
        this._ui.userMessage("");
        cmd.push("--silent");
        const addTags = ((_a = candidate.toScript) === null || _a === void 0 ? void 0 : _a.addTags) ? Array.from(candidate.toScript.addTags) : [];
        for (let index = 0; index < addTags.length; index++) {
            const tag = addTags[index];
            cmd.push(`--addTags ${tag}`);
        }
        const removeTags = ((_b = candidate.toScript) === null || _b === void 0 ? void 0 : _b.removeTags) ? Array.from(candidate.toScript.removeTags) : [];
        for (let index = 0; index < removeTags.length; index++) {
            const tag = removeTags[index];
            cmd.push(`--removeTags ${tag}`);
        }
        const snapShotData = ((_c = candidate.toScript) === null || _c === void 0 ? void 0 : _c.snapShotData) ? Array.from(candidate.toScript.snapShotData) : [];
        for (let index = 0; index < snapShotData.length; index++) {
            const item = snapShotData[index];
            cmd.push(`--filterVersions ${item.version}`);
        }
        return cmd;
    }
    executeTask(candidate) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            process.exit(0);
        });
    }
    bulkManageTags(snapshots, partial) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            while (true) {
                this.log(`Selected ${snapshots.length} snapshot(s)\n`);
                const action = yield core_2.ux.prompt('(a)dd tag to all  (r)emove tag from all  (d)one', { type: 'single', default: 'a' });
                switch (action.toLowerCase()) {
                    case 'a':
                        yield this.bulkAddTag(snapshots, partial);
                        break;
                    case 'r':
                        yield this.bulkRemoveTag(snapshots, partial);
                        break;
                    case 'd':
                        return;
                    default:
                        this.log('Invalid option');
                }
            }
        });
    }
    bulkAddTag(snapshots, partial) {
        var _a, _b;
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const tag = yield core_2.ux.prompt('\nEnter tag to ADD', { required: false });
            const t = tag.trim();
            if (!t)
                return;
            if ((_a = partial === null || partial === void 0 ? void 0 : partial.toScript) === null || _a === void 0 ? void 0 : _a.enabled) {
                if (!((_b = partial === null || partial === void 0 ? void 0 : partial.toScript) === null || _b === void 0 ? void 0 : _b.addTags))
                    partial.toScript.addTags = new Set();
                partial.toScript.addTags.add(t);
            }
            else {
                yield this.addTags(snapshots, [t]);
            }
        });
    }
    addTags(snapshots, tagList, silent = false) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const tagRepoOptions = {
                throwNotFound: true,
                projection: { pathsIncluded: ["ownerId", "name"], pathsExcluded: [] }
            };
            let added = [];
            for (const s of snapshots) {
                for (const t of tagList) {
                    if (!s.tags.includes(t)) {
                        s.tags.push(t);
                        s.tags.sort();
                        added.push({
                            name: t,
                            ownerId: s.id,
                            ownerType: "EnterpriseVersionConfig"
                        });
                    }
                }
            }
            if (added.length > 0) {
                core_2.ux.action.start('Saving tags');
                try {
                    const tags = yield this._codiacApi.Tag.createMany(added, tagRepoOptions);
                    const ownerTagObjs = this.reduceByField(tags, 'ownerId');
                    for (const s of snapshots) {
                        s.ownerTags = [...s.ownerTags, ...ownerTagObjs[s.id]];
                    }
                    core_2.ux.action.stop('✓ Saved successfully');
                }
                catch (error) {
                    core_2.ux.action.stop('failed');
                    this.error(`Failed to save tags: ${error.message}`);
                }
                this.log(`\nAdded "${tagList.join(",")}" to ${added.length} snapshot(s)`);
                if (silent)
                    yield core_2.ux.anykey('\nPress any key to continue...');
            }
            else {
                this.log(`\nAll selected already have "${tagList.join(",")}"`);
            }
        });
    }
    bulkRemoveTag(snapshots, partial) {
        var _a, _b;
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const allTags = this.checkForTags(snapshots);
            if (!allTags || !Array.isArray(allTags) || (Array.isArray(allTags) && allTags.length === 0)) {
                this.log('\nNo tags to remove');
                return;
            }
            try {
                const tag = yield (0, inquirer_select_pro_1.select)({
                    message: 'Select tag to REMOVE',
                    options: allTags.map(t => ({ name: t, value: t })),
                    multiple: false,
                });
                if ((_a = partial === null || partial === void 0 ? void 0 : partial.toScript) === null || _a === void 0 ? void 0 : _a.enabled) {
                    if (!((_b = partial === null || partial === void 0 ? void 0 : partial.toScript) === null || _b === void 0 ? void 0 : _b.removeTags))
                        partial.toScript.removeTags = new Set();
                    partial.toScript.removeTags.add(tag);
                }
                else {
                    yield this.removeTags(snapshots, [tag]);
                }
            }
            catch (error) {
                return;
            }
        });
    }
    checkForTags(snapshots) {
        const allTags = Array.from(new Set(snapshots.flatMap(s => s.tags)));
        if (!allTags.length) {
            this.log('\nNo tags to remove');
            return undefined;
        }
        return allTags;
    }
    removeTags(snapshots, tagList, silent = false) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const tagRepoOptions = {
                throwNotFound: true,
                projection: { pathsIncluded: ["ownerId", "name"], pathsExcluded: [] }
            };
            try {
                let removed = [];
                for (const s of snapshots) {
                    for (const tag of tagList) {
                        const i = s.tags.indexOf(tag);
                        const tagIdx = s.ownerTags.findIndex(t => t.name === tag);
                        if (i !== -1) {
                            removed.push(s.ownerTags[tagIdx].id);
                            s.tags.splice(i, 1);
                            s.ownerTags.splice(tagIdx, 1);
                        }
                    }
                }
                if (removed.length > 0) {
                    core_2.ux.action.start('Removing tags');
                    try {
                        yield this._codiacApi.Tag.deleteWhere({ ids: removed }, tagRepoOptions);
                        core_2.ux.action.stop('✓ Removed successfully');
                    }
                    catch (error) {
                        core_2.ux.action.stop('failed');
                        this.error(`Failed to remove tags: ${error.message}`);
                    }
                    this.log(`\nRemoved "${tagList.join(",")}" from ${removed.length} snapshot(s)`);
                    if (silent)
                        yield core_2.ux.anykey('\nPress any key to continue...');
                }
                else {
                    this.log(`\nNo snapshot had tag "${tagList.join(",")}"`);
                }
            }
            catch (error) {
                return;
            }
        });
    }
    multiSelect(partial) {
        var _a;
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            try {
                const result = yield (0, inquirer_select_pro_1.select)({
                    filter: true,
                    instructions: this.multiSelectInstructions,
                    message: 'Search & select snapshots',
                    multiple: true,
                    canToggleAll: true,
                    required: true,
                    options: (input = '') => tslib_1.__awaiter(this, void 0, void 0, function* () {
                        return this.getOptions(partial, input);
                    }),
                    theme: {
                        style: {
                            answer: (text) => {
                                if (text === '')
                                    return '';
                                const items = text.split("Cabinets");
                                return Array.isArray(items) && items.length > 0 ? `${items.length - 1} items selected: ` : '';
                            },
                        },
                    },
                    pageSize: (_a = partial.pageSize) !== null && _a !== void 0 ? _a : 10,
                    loop: false
                });
                if (result && Array.isArray(result) && result.length > 0) {
                    const store = this.getCachedStore();
                    return result.map(i => store.get(i));
                }
                else
                    return null;
            }
            catch (error) {
                return null;
            }
        });
    }
    multiSelectInstructions(context) {
        const { theme } = context;
        const keys = [];
        keys.push(`${theme.style.key('tab')} to select/deselect`);
        keys.push(`${theme.style.key('ctrl')} + ${theme.style.key('a')} to toggle all`);
        keys.push(`${theme.style.key('enter')} to proceed`);
        const helpTipTop = ` (Press ${keys.join(', ')})`;
        const headerLine = `${'Versions'.padStart(13)}${'Date'.padStart(7)}`;
        return `${helpTipTop}\n${headerLine}`;
    }
    getData(partial) {
        var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const enterpriseVersionConfigsRepoOptions = {
                throwNotFound: true,
                projection: { pathsIncluded: ["version", "tags.name", "created"], pathsExcluded: [] }
            };
            const cabinetRepoOptions = {
                throwNotFound: true,
                projection: { pathsIncluded: ["enterpriseCode", "environment", "version", "name"], pathsExcluded: [] }
            };
            const tagRepoOptions = {
                throwNotFound: true,
                projection: { pathsIncluded: ["ownerId", "name"], pathsExcluded: [] }
            };
            let enterpriseVersionConfigCriteria;
            const cabinetCriteria = { all: true };
            let tagCriteria = { ownerType: "EnterpriseVersionConfig" };
            const isCabinetFiltered = !!((_b = (_a = partial === null || partial === void 0 ? void 0 : partial.filters) === null || _a === void 0 ? void 0 : _a.cabinets) === null || _b === void 0 ? void 0 : _b.expr);
            const listCabinets = yield this._codiacApi.Cabinet.tryReadMany(isCabinetFiltered ? (_d = (_c = partial === null || partial === void 0 ? void 0 : partial.filters) === null || _c === void 0 ? void 0 : _c.cabinets) === null || _d === void 0 ? void 0 : _d.expr : cabinetCriteria, cabinetRepoOptions);
            if (isCabinetFiltered && (!(listCabinets.success && listCabinets.output && ((_e = listCabinets.output) === null || _e === void 0 ? void 0 : _e.length) > 0))) {
                throw new Error('No Cabinets found. <ctrl> + c to exit');
            }
            const cabinets = (_f = listCabinets.output) !== null && _f !== void 0 ? _f : [];
            if (isCabinetFiltered)
                enterpriseVersionConfigCriteria = this.toInQuery(cabinets.map(c => c.version).filter((v) => v !== undefined), 'version');
            let tags = [];
            const isTagFiltered = !!((_h = (_g = partial === null || partial === void 0 ? void 0 : partial.filters) === null || _g === void 0 ? void 0 : _g.tags) === null || _h === void 0 ? void 0 : _h.expr);
            if (isTagFiltered) {
                const listTags = yield this._codiacApi.Tag.tryReadMany(Object.assign(Object.assign({}, tagCriteria), (_k = (_j = partial === null || partial === void 0 ? void 0 : partial.filters) === null || _j === void 0 ? void 0 : _j.tags) === null || _k === void 0 ? void 0 : _k.expr), tagRepoOptions);
                if (!(listTags.success && listTags.output && ((_l = listTags.output) === null || _l === void 0 ? void 0 : _l.length) > 0)) {
                    throw new Error('No Tags found. <ctrl> + c to exit');
                }
                tags = listTags.output;
                enterpriseVersionConfigCriteria = Object.assign(Object.assign({}, (enterpriseVersionConfigCriteria !== null && enterpriseVersionConfigCriteria !== void 0 ? enterpriseVersionConfigCriteria : {})), { ids: tags.map(c => c.ownerId).filter((v) => v !== undefined) });
            }
            const isVersionFiltered = !!((_o = (_m = partial === null || partial === void 0 ? void 0 : partial.filters) === null || _m === void 0 ? void 0 : _m.versions) === null || _o === void 0 ? void 0 : _o.expr);
            if (isVersionFiltered)
                enterpriseVersionConfigCriteria = Object.assign(Object.assign({}, (enterpriseVersionConfigCriteria !== null && enterpriseVersionConfigCriteria !== void 0 ? enterpriseVersionConfigCriteria : {})), (_q = (_p = partial === null || partial === void 0 ? void 0 : partial.filters) === null || _p === void 0 ? void 0 : _p.versions) === null || _q === void 0 ? void 0 : _q.expr);
            const ListEnterpriseVersionConfigs = yield this._codiacApi.EnterpriseVersionConfig.
                tryReadMany(enterpriseVersionConfigCriteria !== null && enterpriseVersionConfigCriteria !== void 0 ? enterpriseVersionConfigCriteria : { all: true }, enterpriseVersionConfigsRepoOptions);
            if (!(ListEnterpriseVersionConfigs.success && ListEnterpriseVersionConfigs.output && ((_r = ListEnterpriseVersionConfigs.output) === null || _r === void 0 ? void 0 : _r.length) > 0)) {
                throw new Error('No Versions found. <ctrl> + c to exit');
            }
            let enterpriseVersionConfigs = ListEnterpriseVersionConfigs.output;
            const isDateFiltered = !!((_t = (_s = partial === null || partial === void 0 ? void 0 : partial.filters) === null || _s === void 0 ? void 0 : _s.dates) === null || _t === void 0 ? void 0 : _t.expr);
            if (isDateFiltered) {
                const dateStrings = (_v = (_u = partial === null || partial === void 0 ? void 0 : partial.filters) === null || _u === void 0 ? void 0 : _u.dates) === null || _v === void 0 ? void 0 : _v.input;
                const targetDays = new Set(dateStrings.map(d => new Date(d).toLocaleDateString('en-CA')));
                enterpriseVersionConfigs = enterpriseVersionConfigs.filter((e) => {
                    return targetDays.has(new Date(e.created).toLocaleDateString('en-CA'));
                });
                if (enterpriseVersionConfigs.length === 0) {
                    throw new Error('No Versions found. <ctrl> + c to exit');
                }
            }
            if (!isTagFiltered) {
                tagCriteria = Object.assign(Object.assign({}, tagCriteria), (this.toInQuery(enterpriseVersionConfigs.map(e => e.id).filter((v) => v !== undefined), 'ownerId')));
                tags = yield this._codiacApi.Tag.readMany(tagCriteria, Object.assign(Object.assign({}, tagRepoOptions), { throwNotFound: false }));
            }
            const ownerTagObjs = this.reduceByField(tags, 'ownerId');
            const ownerTags = this.reduceByField(tags, 'ownerId', 'name');
            const versionCabinets = this.reduceByField(cabinets, 'version', 'name');
            const snapShotData = enterpriseVersionConfigs.map((v) => {
                return {
                    id: v.id,
                    version: v.version,
                    date: (typeof v.created === 'string' ? new Date(v.created) : v.created).toLocaleDateString('en-US', {
                        month: '2-digit',
                        day: '2-digit',
                        year: 'numeric'
                    }),
                    cabinets: versionCabinets[v.version] || [],
                    tags: ownerTags[v.id] || [],
                    ownerTags: ownerTagObjs[v.id] || []
                };
            });
            return snapShotData;
        });
    }
    loadIndexed(partial) {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            if (!this.indexedSnapShots) {
                const snapShotData = yield this.getData(partial);
                this.indexedSnapShots = new flexsearch_1.Document({
                    worker: true,
                    document: {
                        id: "id",
                        store: true,
                        index: [{
                                field: "version",
                                tokenize: "forward",
                                encoder: flexsearch_1.Charset.LatinAdvanced,
                            }, {
                                field: "dates",
                                tokenize: "forward",
                                encoder: flexsearch_1.Charset.LatinAdvanced
                            }, {
                                field: "cabinets",
                                tokenize: "forward",
                                encoder: flexsearch_1.Charset.LatinAdvanced
                            },
                            {
                                field: "tags",
                                tokenize: "forward",
                                encoder: flexsearch_1.Charset.LatinAdvanced
                            }
                        ],
                    }
                });
                for (let i = 0; i < snapShotData.length; i++) {
                    yield this.indexedSnapShots.add(snapShotData[i]);
                }
            }
            return this.indexedSnapShots;
        });
    }
    getOptions(partial, input = '') {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const formatData = (doc) => ({
                name: `${doc.version.padEnd(10)} ${doc.date.padEnd(12)} Cabinets - [${doc.cabinets.join(', ')}] Tags - [${doc.tags.join(', ')}]`,
                value: doc.id,
            });
            const indexedSnapShots = yield this.loadIndexed(partial);
            let options = [];
            if (input) {
                const searchedResults = yield indexedSnapShots.search({
                    query: input,
                    // suggest: true,
                    enrich: true,
                    // index:["version"],
                    merge: true
                });
                options = searchedResults.map(s => {
                    const doc = s.doc;
                    return formatData(doc);
                });
            }
            else {
                const store = this.getCachedStore();
                options = [...store].map((s) => {
                    const doc = s;
                    return formatData(doc[1]);
                });
            }
            return options;
        });
    }
    getCachedStore() {
        const store = this.indexedSnapShots.store;
        return store;
    }
    reduceByField(array, keyField, valueField) {
        return array.reduce((acc, item) => {
            const key = String(item[keyField]);
            const value = valueField ? item[valueField] : item;
            if (!acc[key]) {
                acc[key] = [];
            }
            acc[key].push(value);
            return acc;
        }, {});
    }
    toInQuery(array, field) {
        return {
            [field]: { $in: array }
        };
    }
    clearScreen() {
        // process.stdout.write('\x1Bc')
    }
}
exports.default = SnapshotTags;
SnapshotTags.hidden = true; // This command is misconceived and misbuilt.  Delete when we have its replacement.
SnapshotTags.description = 'manage snapshot version tags';
SnapshotTags.examples = [
    '<%= config.bin %> <%= command.id %>',
    '<%= config.bin %> <%= command.id %> --silent --addTags prod --addTags stable --filterVersions 10036A9Z  --filterVersions 000000',
    '<%= config.bin %> <%= command.id %> --silent --removeTags deprecated --removeTags stable --filterCabinet west',
    'echo -n \'{"filters":{"versions":["587JZ95N"]},"add":["tag1","tag2"]}\' | <%= config.bin %> <%= command.id %> --silent --addTags tag3 --filterVersions 00000000',
    '<%= config.bin %> <%= command.id %> --to-script --filterVersions 10036A9Z',
];
SnapshotTags.flags = {
    filterCabinets: core_1.Flags.string({ char: 'c', multiple: true, description: 'Filter by cabinet', expr: { on: "name", name: "cabinets" } }),
    filterDates: core_1.Flags.string({ char: 'd', multiple: true, description: 'Filter by exact date', expr: { on: "created", name: "dates" } }),
    filterVersions: core_1.Flags.string({ char: 'v', multiple: true, description: 'Filter by version', expr: { on: "versions", name: "versions" } }),
    filterTags: core_1.Flags.string({ char: 't', multiple: true, description: 'Filter by tag', expr: { on: "name", name: "tags" } }),
    silent: core_1.Flags.boolean({ char: 's', description: 'Run in silent mode without interactive prompts' }),
    addTags: core_1.Flags.string({ description: 'Tags to add', multiple: true, dependsOn: ['silent'] }),
    removeTags: core_1.Flags.string({ description: 'Tags to remove', multiple: true, dependsOn: ['silent'] }),
    toScript: core_1.Flags.boolean({ description: 'Generate script command without executing' }),
    // echo: Flags.boolean({ exclusive: ["to-script", "silent"], description: 'Echo interaction mode; renders the equivalent non-interactive cli command for future use before final execution.' }),
    "to-script": core_1.Flags.boolean({ exclusive: ["echo", "silent"], description: 'scripts interaction mode; renders the equivalent non-interactive cli command WITHOUT any execution.' }),
    pageSize: core_1.Flags.integer({ description: 'Number of records per page', default: 10 }),
    // "take-defaults": Flags.boolean({ /* char: 'y', */ exclusive: ["silent"], description: "Setting this to true prevents prompting for confirmation on parameters that were passed in or were automatically set to default values (Irrelevant in --silent mode).  This behavior does NOT apply to scenarios that the command needs to override invalid user input; such cases will always prompt for confirmation.  eg: when no argument was provided for file or type, and only one exists, the system will render the autoselected file unless this flag is set." })
};
SnapshotTags.args = {};
//# sourceMappingURL=tags.js.map