{"version":3,"file":"engine_bundle.js","sources":["../../../out/ui/src/gen/perfetto_version.ts","../../../out/ui/src/base/logging.ts","../../../out/ui/src/base/deferred.ts","../../../out/ui/ui/tsc/gen/trace_processor.js","../../../out/ui/src/engine/wasm_bridge.ts","../../../out/ui/src/engine/index.ts"],"sourcesContent":["export const VERSION = \"v23.0-d7b55ea62\";\nexport const SCM_REVISION = \"d7b55ea623d1106cb4e1961a4180caf1280ec6ab\";","// Copyright (C) 2018 The Android Open Source Project\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport * as version from '../gen/perfetto_version';\n\nexport type ErrorHandler = (err: string) => void;\n\nlet errorHandler: ErrorHandler = (_: string) => {};\n\nexport function assertExists<A>(value: A | null | undefined): A {\n if (value === null || value === undefined) {\n throw new Error('Value doesn\\'t exist');\n }\n return value;\n}\n\nexport function assertTrue(value: boolean, optMsg?: string) {\n if (value !== true) {\n throw new Error(optMsg ? optMsg : 'Failed assertion');\n }\n}\n\nexport function assertFalse(value: boolean, optMsg?: string) {\n assertTrue(!value, optMsg);\n}\n\nexport function setErrorHandler(handler: ErrorHandler) {\n errorHandler = handler;\n}\n\nexport function reportError(err: ErrorEvent|PromiseRejectionEvent|{}) {\n let errLog = '';\n let errorObj = undefined;\n\n if (err instanceof ErrorEvent) {\n errLog = err.message;\n errorObj = err.error;\n } else if (err instanceof PromiseRejectionEvent) {\n errLog = `${err.reason}`;\n errorObj = err.reason;\n } else {\n errLog = `${err}`;\n }\n if (errorObj !== undefined && errorObj !== null) {\n const errStack = (errorObj as {stack?: string}).stack;\n errLog += '\\n';\n errLog += errStack !== undefined ? errStack : JSON.stringify(errorObj);\n }\n errLog += '\\n\\n';\n errLog += `${version.VERSION} ${version.SCM_REVISION}\\n`;\n errLog += `UA: ${navigator.userAgent}\\n`;\n\n console.error(errLog, err);\n errorHandler(errLog);\n}\n","// Copyright (C) 2018 The Android Open Source Project\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// tslint:disable:no-any\n\n/**\n * Promise wrapper with exposed resolve and reject callbacks.\n */\nexport interface Deferred<T> extends Promise<T> {\n readonly resolve: (value?: T|PromiseLike<T>) => void;\n readonly reject: (reason?: any) => void;\n}\n\n/**\n * Create a promise with exposed resolve and reject callbacks.\n */\nexport function defer<T>(): Deferred<T> {\n let resolve = null as any;\n let reject = null as any;\n const p = new Promise((res, rej) => [resolve, reject] = [res, rej]);\n return Object.assign(p, {resolve, reject}) as any;\n}\n","\nvar trace_processor_wasm = (function() {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename;\n return (\nfunction(trace_processor_wasm) {\n trace_processor_wasm = trace_processor_wasm ||