class BjcCov {
    coverage: {
        [key: string]: string | number;
    };
    constructor(covData: object) {
        const gcv = "__coverage__";
        let coverage = globalThis[gcv] || (globalThis[gcv] = {});
        if (!coverage[covData.path] && true) {
            coverage[covData.path] = covData;
        }
        this.coverage = coverage[covData.path];
    }
    instrumentFunction(func: number) {
        this.coverage.functions[func].count++;
        this.coverage.functions[func].regions[0].count++;
    }
    instrumentRegion(func: number, region: number) {
        this.coverage.functions[func].regions[region].count++;
    }
    instrumentReturn(func: number, retIdx: number) {
        this.coverage.functions[func].returnes[retIdx].count++;
    }
    instrumentBranch(func: number, branch: number, trueOrFalse: boolean) {
        if (trueOrFalse) {
            this.coverage.functions[func].branches[branch].trueCount++;
            for (let r of Object.values(this.coverage.functions[func].branches[branch].group)) {
                if (r !== branch) {
                    this.coverage.functions[func].branches[r as number].falseCount++;
                }
            }
        }
        else {
            this.coverage.functions[func].branches[branch].falseCount++;
        }
    }
}
let bjccovms5u83rd = new BjcCov({ version: "bjc v1.0.0", versionCode: 10000, path: "tencentqianwebview/src/main/ets/model/SignResult.ets", hash: "34645a304c27f2b7a5995e8a5c267ce180b1ffe09dc2067ae6e5dc09e3eb31e5", lineCnt: 76, count: 0, projectPath: "", functions: { 0: { name: "SignResult.constructor", count: 0, regions: { 0: { startLoc: { line: 49, col: 3 }, endLoc: { line: 65, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 58, col: 5 }, endLoc: { line: 65, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 0 }, 1: { name: "SignResult.EMPTY", count: 0, regions: { 0: { startLoc: { line: 72, col: 3 }, endLoc: { line: 74, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 73, col: 5 }, endLoc: { line: 74, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 1 } }, exeLine: { 0: 15, 1: 17, 2: 20, 3: 23, 4: 30, 5: 37, 6: 40, 7: 47, 8: 50, 9: 51, 10: 52, 11: 53, 12: 54, 13: 55, 14: 56, 15: 57, 16: 58, 17: 59, 18: 60, 19: 61, 20: 62, 21: 63, 22: 64, 23: 72, 24: 73 } });
/**
 * `qianapp://` 协议解析结果。
 *
 * **协议形态**: `qianapp://<custom-path>?flowId=...&action=...&result=...&from=tencent_ess&<extras>`
 *
 * **字段说明**:
 * - rawUrl:    原始 URL
 * - customPath: host + path 拼接（去除前后斜杠）
 * - flowId:    流程 ID（协议未给则为空字符串）
 * - action:    动作字符串原值；建议与 `SignAction` 常量比对，未知值原样透出
 * - result:    结果字符串原值；建议与 `SignResultStatus` 常量比对，未知值原样透出
 * - from:      固定 `tencent_ess`
 * - extras:    除上述字段之外的自定义 query 透传
 */
export class SignResult {
    /** 原始 qianapp:// URL */
    public rawUrl: string;
    /** host + path,例 `callback/sign` */
    public customPath: string;
    /** 流程 ID;协议未给则为空字符串 */
    public flowId: string;
    /**
     * 动作类型(String 直透,未识别值原样透出)。
     *
     * 已知值见 SignAction:`fill` / `sign` / `reject_fill` / `reject_sign` / `view` / `""`。
     */
    public action: string;
    /**
     * 结果状态(String 直透,未识别值原样透出)。
     *
     * 已知值见 SignResultStatus:`success` / `fail` / `""`。
     */
    public result: string;
    /** 来源标识,通常为 `tencent_ess`;协议未给则为空字符串 */
    public from: string;
    /**
     * 客户自定义 query 透传(已剔除 4 个 recognized field)。
     *
     * 重复 key 保留首个,UTF-8 percent-decoded。
     */
    public extras: Map<string, string>;
    constructor(rawUrl: string, customPath: string, flowId: string, action: string, result: string, from: string, extras: Map<string, string>) {
        bjccovms5u83rd.instrumentFunction(0);
        bjccovms5u83rd.instrumentRegion(0, 1);
        this.rawUrl = rawUrl;
        this.customPath = customPath;
        this.flowId = flowId;
        this.action = action;
        this.result = result;
        this.from = from;
        this.extras = extras;
    }
    /**
     * 全空 SignResult,用于解析失败兜底。
     *
     * 通过 `rawUrl.length === 0` 判定空结果,勿用 `===` 引用比较。
     */
    public static get EMPTY(): SignResult {
        bjccovms5u83rd.instrumentFunction(1);
        bjccovms5u83rd.instrumentRegion(1, 1);
        return new SignResult('', '', '', '', '', '', new Map<string, string>());
    }
}
