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 bjccovms5u83rv = new BjcCov({ version: "bjc v1.0.0", versionCode: 10000, path: "tencentqianwebview/src/main/ets/model/SdkEvent.ets", hash: "bbffa2a5f8fad83dba31e9d1a204188c6ff3dc5fa574eb62ee78d7e87a0cf6c8", lineCnt: 205, count: 0, projectPath: "", functions: { 0: { name: "PageStartedEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 28, col: 3 }, endLoc: { line: 30, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 29, col: 5 }, endLoc: { line: 30, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 0 }, 1: { name: "PageFinishedEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 37, col: 3 }, endLoc: { line: 39, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 38, col: 5 }, endLoc: { line: 39, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 1 }, 2: { name: "PermissionGrantedEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 48, col: 3 }, endLoc: { line: 50, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 49, col: 5 }, endLoc: { line: 50, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 2 }, 3: { name: "PermissionDeniedEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 57, col: 3 }, endLoc: { line: 59, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 58, col: 5 }, endLoc: { line: 59, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 3 }, 4: { name: "SchemeInterceptedEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 69, col: 3 }, endLoc: { line: 72, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 70, col: 5 }, endLoc: { line: 72, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 4 }, 5: { name: "SchemeNotMatchedEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 79, col: 3 }, endLoc: { line: 81, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 80, col: 5 }, endLoc: { line: 81, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 5 }, 6: { name: "LoadErrorEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 92, col: 3 }, endLoc: { line: 96, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 93, col: 5 }, endLoc: { line: 96, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 6 }, 7: { name: "HttpErrorEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 105, col: 3 }, endLoc: { line: 109, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 106, col: 5 }, endLoc: { line: 109, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 7 }, 8: { name: "SslErrorEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 117, col: 3 }, endLoc: { line: 120, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 118, col: 5 }, endLoc: { line: 120, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 8 }, 9: { name: "DownloadStartEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 131, col: 3 }, endLoc: { line: 135, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 132, col: 5 }, endLoc: { line: 135, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 9 }, 10: { name: "DownloadFailedEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 143, col: 3 }, endLoc: { line: 146, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 144, col: 5 }, endLoc: { line: 146, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 10 }, 11: { name: "DownloadCompletedEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 154, col: 3 }, endLoc: { line: 157, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 155, col: 5 }, endLoc: { line: 157, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 11 }, 12: { name: "RenderProcessGoneEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 168, col: 3 }, endLoc: { line: 171, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 169, col: 5 }, endLoc: { line: 171, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 12 }, 13: { name: "UserAgentInjectFailedEvent.constructor", count: 0, regions: { 0: { startLoc: { line: 180, col: 3 }, endLoc: { line: 182, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 181, col: 5 }, endLoc: { line: 182, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 13 } }, exeLine: { 0: 24, 1: 25, 2: 26, 3: 28, 4: 29, 5: 33, 6: 34, 7: 35, 8: 37, 9: 38, 10: 44, 11: 45, 12: 46, 13: 48, 14: 49, 15: 53, 16: 54, 17: 55, 18: 57, 19: 58, 20: 64, 21: 65, 22: 66, 23: 67, 24: 69, 25: 70, 26: 71, 27: 75, 28: 76, 29: 77, 30: 79, 31: 80, 32: 86, 33: 87, 34: 88, 35: 89, 36: 90, 37: 92, 38: 93, 39: 94, 40: 95, 41: 99, 42: 100, 43: 101, 44: 102, 45: 103, 46: 105, 47: 106, 48: 107, 49: 108, 50: 112, 51: 113, 52: 114, 53: 115, 54: 117, 55: 118, 56: 119, 57: 125, 58: 126, 59: 127, 60: 128, 61: 129, 62: 131, 63: 132, 64: 133, 65: 134, 66: 138, 67: 139, 68: 140, 69: 141, 70: 143, 71: 144, 72: 145, 73: 149, 74: 150, 75: 151, 76: 152, 77: 154, 78: 155, 79: 156, 80: 162, 81: 163, 82: 165, 83: 166, 84: 168, 85: 169, 86: 170, 87: 176, 88: 177, 89: 178, 90: 180, 91: 181, 92: 190, 93: 191, 94: 192, 95: 193, 96: 194, 97: 195, 98: 196, 99: 197, 100: 198, 101: 199, 102: 200, 103: 201, 104: 202, 105: 203, 106: 204 } });
/**
 * SDK 内部事件，用于将容器层观测点上报给业务方。
 *
 * 协议回调走 `onSignResult`，容器观测走 `onSdkEvent`；事件用 `type` 判别字段（string literal 联合）便于 switch 穷尽匹配。
 *
 * **使用范例**:
 * ```ts
 * const handler = (event: SdkEvent): void => {
 *   switch (event.type) {
 *     case 'PageStarted':
 *       console.log('开始加载', event.url);
 *       break;
 *     case 'SchemeIntercepted':
 *       console.log('拦截 scheme', event.scheme, event.url);
 *       break;
 *     // ...
 *   }
 * };
 * ```
 */
// ────────── 页面生命周期 ──────────
export class PageStartedEvent {
    public readonly type: 'PageStarted' = 'PageStarted';
    public url: string;
    constructor(url: string) {
        bjccovms5u83rv.instrumentFunction(0);
        bjccovms5u83rv.instrumentRegion(0, 1);
        this.url = url;
    }
}
export class PageFinishedEvent {
    public readonly type: 'PageFinished' = 'PageFinished';
    public url: string;
    constructor(url: string) {
        bjccovms5u83rv.instrumentFunction(1);
        bjccovms5u83rv.instrumentRegion(1, 1);
        this.url = url;
    }
}
// ────────── 权限 ──────────
export class PermissionGrantedEvent {
    public readonly type: 'PermissionGranted' = 'PermissionGranted';
    public permissions: string[];
    constructor(permissions: string[]) {
        bjccovms5u83rv.instrumentFunction(2);
        bjccovms5u83rv.instrumentRegion(2, 1);
        this.permissions = permissions;
    }
}
export class PermissionDeniedEvent {
    public readonly type: 'PermissionDenied' = 'PermissionDenied';
    public permissions: string[];
    constructor(permissions: string[]) {
        bjccovms5u83rv.instrumentFunction(3);
        bjccovms5u83rv.instrumentRegion(3, 1);
        this.permissions = permissions;
    }
}
// ────────── Scheme 拦截 ──────────
export class SchemeInterceptedEvent {
    public readonly type: 'SchemeIntercepted' = 'SchemeIntercepted';
    public scheme: string;
    public url: string;
    constructor(scheme: string, url: string) {
        bjccovms5u83rv.instrumentFunction(4);
        bjccovms5u83rv.instrumentRegion(4, 1);
        this.scheme = scheme;
        this.url = url;
    }
}
export class SchemeNotMatchedEvent {
    public readonly type: 'SchemeNotMatched' = 'SchemeNotMatched';
    public url: string;
    constructor(url: string) {
        bjccovms5u83rv.instrumentFunction(5);
        bjccovms5u83rv.instrumentRegion(5, 1);
        this.url = url;
    }
}
// ────────── 网络与渲染错误 ──────────
export class LoadErrorEvent {
    public readonly type: 'LoadError' = 'LoadError';
    public url: string;
    public errorCode: number;
    public description: string;
    constructor(url: string, errorCode: number, description: string) {
        bjccovms5u83rv.instrumentFunction(6);
        bjccovms5u83rv.instrumentRegion(6, 1);
        this.url = url;
        this.errorCode = errorCode;
        this.description = description;
    }
}
export class HttpErrorEvent {
    public readonly type: 'HttpError' = 'HttpError';
    public url: string;
    public statusCode: number;
    public reasonPhrase: string;
    constructor(url: string, statusCode: number, reasonPhrase: string) {
        bjccovms5u83rv.instrumentFunction(7);
        bjccovms5u83rv.instrumentRegion(7, 1);
        this.url = url;
        this.statusCode = statusCode;
        this.reasonPhrase = reasonPhrase;
    }
}
export class SslErrorEvent {
    public readonly type: 'SslError' = 'SslError';
    public url: string;
    public primaryError: number;
    constructor(url: string, primaryError: number) {
        bjccovms5u83rv.instrumentFunction(8);
        bjccovms5u83rv.instrumentRegion(8, 1);
        this.url = url;
        this.primaryError = primaryError;
    }
}
// ────────── 下载 ──────────
export class DownloadStartEvent {
    public readonly type: 'DownloadStart' = 'DownloadStart';
    public url: string;
    public mimeType: string;
    public contentDisposition: string;
    constructor(url: string, mimeType: string, contentDisposition: string) {
        bjccovms5u83rv.instrumentFunction(9);
        bjccovms5u83rv.instrumentRegion(9, 1);
        this.url = url;
        this.mimeType = mimeType;
        this.contentDisposition = contentDisposition;
    }
}
export class DownloadFailedEvent {
    public readonly type: 'DownloadFailed' = 'DownloadFailed';
    public url: string;
    public reason: string;
    constructor(url: string, reason: string) {
        bjccovms5u83rv.instrumentFunction(10);
        bjccovms5u83rv.instrumentRegion(10, 1);
        this.url = url;
        this.reason = reason;
    }
}
export class DownloadCompletedEvent {
    public readonly type: 'DownloadCompleted' = 'DownloadCompleted';
    public url: string;
    public filePath: string;
    constructor(url: string, filePath: string) {
        bjccovms5u83rv.instrumentFunction(11);
        bjccovms5u83rv.instrumentRegion(11, 1);
        this.url = url;
        this.filePath = filePath;
    }
}
// ────────── 渲染进程崩溃 ──────────
export class RenderProcessGoneEvent {
    public readonly type: 'RenderProcessGone' = 'RenderProcessGone';
    /** `true` = 进程崩溃(OOM 等);`false` = 被系统回收(低内存) */
    public didCrash: boolean;
    public url: string;
    constructor(didCrash: boolean, url: string) {
        bjccovms5u83rv.instrumentFunction(12);
        bjccovms5u83rv.instrumentRegion(12, 1);
        this.didCrash = didCrash;
        this.url = url;
    }
}
// ────────── UA 注入失败兜底 ──────────
export class UserAgentInjectFailedEvent {
    public readonly type: 'UserAgentInjectFailed' = 'UserAgentInjectFailed';
    public reason: string;
    constructor(reason: string) {
        bjccovms5u83rv.instrumentFunction(13);
        bjccovms5u83rv.instrumentRegion(13, 1);
        this.reason = reason;
    }
}
/**
 * SDK 事件联合类型。
 *
 * 客户实现 `onSdkEvent: (event: SdkEvent) => void`,通过 `event.type` 判别具体子类型。
 */
export type SdkEvent = PageStartedEvent | PageFinishedEvent | PermissionGrantedEvent | PermissionDeniedEvent | SchemeInterceptedEvent | SchemeNotMatchedEvent | LoadErrorEvent | HttpErrorEvent | SslErrorEvent | DownloadStartEvent | DownloadCompletedEvent | DownloadFailedEvent | RenderProcessGoneEvent | UserAgentInjectFailedEvent;
