{"version":3,"sources":["../../common/lib/backend-impl.ts","../../common/lib/backend.ts","../../common/lib/version.ts","../../common/lib/env-impl.ts","../../common/lib/env.ts","../../common/lib/tensor-conversion-impl.ts","../../common/lib/tensor-factory-impl.ts","../../common/lib/tensor-impl-type-mapping.ts","../../common/lib/tensor-utils-impl.ts","../../common/lib/tensor-impl.ts","../../common/lib/tensor.ts","../../common/lib/trace.ts","../../common/lib/inference-session-impl.ts","../../common/lib/inference-session.ts","../../common/lib/tensor-conversion.ts","../../common/lib/tensor-factory.ts","../../common/lib/onnx-model.ts","../../common/lib/onnx-value.ts","../../common/lib/index.ts","../lib/wasm/wasm-utils-env.ts","../lib/wasm/proxy-worker/main.ts","ort-wasm-simd-threaded.asyncify.mjs","../lib/wasm/wasm-utils-import.ts","../lib/wasm/wasm-factory.ts","../lib/wasm/wasm-utils.ts","../lib/wasm/run-options.ts","../lib/wasm/session-options.ts","../lib/wasm/wasm-common.ts","../lib/wasm/wasm-utils-load-file.ts","../lib/wasm/jsep/tensor-view.ts","../lib/wasm/jsep/log.ts","../lib/wasm/jsep/webnn/tensor-manager.ts","../lib/wasm/jsep/backend-webnn.ts","../lib/wasm/wasm-core-impl.ts","../lib/wasm/proxy-wrapper.ts","../lib/wasm/session-handler-inference.ts","../lib/backend-wasm.ts","../lib/index.ts","../lib/version.ts"],"names":["backends","backendsSortedByPriority","registerBackend","tryResolveAndInitializeBackend","resolveBackendAndExecutionProviders","init_backend_impl","__esmMin","name","backend","priority","currentBackend","i","backendName","backendInfo","isInitializing","e","options","eps","backendHints","backendNames","errors","availableBackendNames","resolveResult","err","filteredEps","target","prop","init_backend","version","init_version","logLevelValue","env","init_env_impl","value","init_env","tensorToDataURL","tensorToImageData","init_tensor_conversion_impl","tensor","canvas","pixels2DContext","width","height","inputformat","norm","normMean","normBias","stride","rTensorPointer","gTensorPointer","bTensorPointer","aTensorPointer","j","R","G","B","A","image","channels","step","rImagePointer","gImagePointer","bImagePointer","aImagePointer","bufferToTensor","tensorFromImage","tensorFromTexture","tensorFromGpuBuffer","tensorFromMLTensor","tensorFromPinnedBuffer","init_tensor_factory_impl","init_tensor_impl","buffer","outputformat","float32Data","Tensor","isHTMLImageEle","isImageDataEle","isImageBitmap","isString","data","bufferToTensorOptions","createCanvas","createCanvasContext","tempCanvas","resolve","reject","context","newImage","img","texture","download","dispose","dims","gpuBuffer","dataType","mlTensor","type","NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP","NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP","isTypedArrayChecked","checkTypedArray","init_tensor_impl_type_mapping","isBigInt64ArrayAvailable","isBigUint64ArrayAvailable","Float16Array","isFloat16ArrayAvailable","calculateSize","tensorReshape","init_tensor_utils_impl","size","dim","arg0","arg1","arg2","expectedTypedArrayConstructor","maybeDims","typedArrayConstructor","firstElementType","mappedType","releaseData","init_tensor","TRACE","TRACE_FUNC","TRACE_FUNC_BEGIN","TRACE_FUNC_END","TRACE_EVENT_BEGIN","TRACE_EVENT_END","init_trace","deviceType","label","msg","extraMsg","stack","hasTraceFunc","InferenceSession","init_inference_session_impl","_InferenceSession","handler","feeds","fetches","isFetchesEmpty","isFetches","arg1Keys","results","returnValue","key","result","arg3","filePathOrUint8Array","byteOffset","byteLength","optionsWithValidatedEPs","init_inference_session","init_tensor_conversion","init_tensor_factory","init_onnx_model","init_onnx_value","esm_exports","__export","init_esm","init_wasm_utils_env","main_exports","main_default","WORKER_NAME","isProxyWorker","init_main","init_wasm_core_impl","init_wasm_factory","init_wasm_utils_import","ev","message","initializeWebAssembly","initRuntime","epName","initEp","bufferData","copyFromExternalBuffer","model","createSession","sessionMetadata","releaseSession","sessionId","inputIndices","inputs","outputIndices","run","outputs","o","extractTransferableBuffers","endProfiling","urlOverride","scriptSrc","ort_wasm_simd_threaded_asyncify_exports","ort_wasm_simd_threaded_asyncify_default","t","n","a","r","Gr","qr","u","c","s","f","S","l","d","m","h","p","v","g","b","w","y","x","T","ue","W","Oo","$","To","$a","Na","Ea","ae","Cr","O","ca","ce","Mr","Ua","P","C","M","E","U","D","k","I","_","L","_i","z","de","he","we","ye","xe","Se","Te","Oe","Be","Pe","Ue","De","ke","Ie","_e","We","Le","Ge","ze","$e","Ne","Fe","Ve","Ye","Ke","er","cr","fr","lr","dr","pr","Tr","Or","Ar","Rr","Ur","Dr","kr","Ir","Xr","tt","nr","nt","at","it","ot","ut","ct","st","ft","lt","dt","mt","ht","pt","vt","yt","xt","St","Tt","Bt","Pt","Rt","Dt","kt","It","Ct","_t","Wt","Lt","At","Gt","zt","$t","fn","ln","dn","mn","hn","pn","vn","gn","bn","wn","yn","xn","Sn","Tn","Pn","Cn","J","Mn","Rn","En","Dn","xo","po","yo","ho","to","Ni","zi","Gi","Ji","fo","so","Yi","lo","vo","co","uo","oo","no","io","ao","wo","mo","$i","Vi","Fi","So","ji","eo","qi","Hi","ro","go","Qi","bo","Zi","Xi","Ki","kn","Z","In","_n","Wn","Ln","Gn","zn","$n","Nn","Fn","Vn","Yn","qn","jn","Hn","Xn","Zn","Qn","Jn","Kn","ea","ta","na","aa","ia","oa","Wr","re","ua","sa","fa","la","da","ma","ha","pa","va","ga","ba","wa","ya","xa","Sa","Ta","Oa","Aa","Ba","Pa","Ca","Ma","Ra","Da","ka","Ia","_a","Wa","La","Ga","za","Fa","Va","Ya","qa","ja","Ha","Xa","Za","Qa","Ja","Ka","ei","ri","ti","ni","ai","ii","oi","ui","ci","si","fi","li","di","mi","hi","pi","vi","gi","bi","wi","yi","xi","Si","Ti","Oi","Ai","Bi","Pi","Ci","Mi","Ri","Ei","Ui","Di","ki","Ii","N","F","V","Y","q","K","oe","ie","ee","te","H","X","Q","ne","Br","se","fe","le","ge","pe","ve","me","be","Ae","Ce","Me","Re","Ee","qe","je","He","Xe","Ze","Qe","Je","rr","tr","ar","ir","or","ur","sr","mr","hr","vr","gr","br","wr","yr","xr","Sr","Pr","Er","Li","Wi","_r","$r","Lr","Vr","zr","Nr","Fr","Yr","jr","Hr","Zr","Qr","Jr","Kr","et","rt","gt","bt","wt","Ot","Mt","Et","Ut","Nt","Ft","Vt","Yt","qt","jt","Ht","Xt","Zt","Qt","Jt","Kt","en","rn","tn","nn","an","on","un","cn","sn","On","An","Bn","Un","ra","init_ort_wasm_simd_threaded_asyncify","origin","isEsmImportMetaUrlHardcodedAsFileUri","getScriptSrc","inferWasmPathPrefixFromScriptSrc","isSameOrigin","normalizeUrl","fallbackUrl","preload","dynamicImportDefault","createProxyWorker","importProxyWorker","embeddedWasmModule","importWasmModule","URL2","filename","prefixOverride","baseUrl","absoluteUrl","blob","url","isMultiThreaded","isWasmOverridden","useEmbeddedModule","wasmModuleFilename","wasmModuleUrl","needPreload","wasm","initialized","initializing","aborted","isMultiThreadSupported","isSimdSupported","isRelaxedSimdSupported","getInstance","flags","timeout","numThreads","multiThreadSupported","wasmPaths","wasmPrefixOverride","mjsPathOverrideFlag","mjsPathOverride","wasmPathOverrideFlag","wasmPathOverride","wasmBinaryOverride","objectUrl","ortWasmFactory","isTimeout","tasks","config","fileName","inferredWasmPathPrefix","module","what","allocWasmString","iterateExtraOptions","checkLastError","init_wasm_utils","allocs","dataLength","dataOffset","prefix","seen","ptrSize","paramsOffset","errorCode","errorMessagePointer","errorMessage","setRunOptions","init_run_options","runOptionsHandle","runOptions","tagDataOffset","keyDataOffset","valueDataOffset","alloc","getGraphOptimzationLevel","getExecutionMode","appendDefaultOptions","appendSessionConfig","appendEpOption","setExecutionProviders","setSessionOptions","init_session_options","graphOptimizationLevel","executionMode","session","ep","sessionOptionsHandle","epOptions","sessionOptions","executionProviders","customDevice","webgpuOptions","enableGraphCapture","names","info","deviceId","instanceHandle","deviceHandle","epNameDataOffset","epOptionsCount","keysOffset","valuesOffset","logIdDataOffset","logSeverityLevel","logVerbosityLevel","optimizedModelFilePathOffset","nameOffset","tensorDataTypeStringToEnum","tensorDataTypeEnumToString","calculateTensorSizeInBytes","tensorTypeToTypedArrayConstructor","logLevelStringToEnum","isGpuBufferSupportedType","isMLTensorSupportedType","dataLocationStringToEnum","init_wasm_common","typeProto","dateType","dimsOrSize","elementSize","logLevel","location","loadFile","init_wasm_utils_load_file","file","readFile","createReadStream","stream","chunks","chunk","response","contentLengthHeader","fileSize","reader","pages","offset","done","chunkSize","createView","init_tensor_view","dataBuffer","logLevelPrefix","doLog","configLogLevel","debug","configureLogger","LOG","LOG_DEBUG","init_log","level","$configLogLevel","$debug","messageLevel","configLevel","args","webnnDataTypeToSize","convertDataToInt32","convertInt32ToData","tensorGuid","createNewTensorId","webnnDataTypeToFallback","calculateByteLength","TensorWrapper","TensorIdTracker","TensorManagerImpl","createTensorManager","init_tensor_manager","dataTypeSize","bytesPerElement","numElements","originalArray","int32Array","bigInt64Array","bigUint64Array","int8Array","uint32Array","shape","descriptor","fallbackDataType","dstBuffer","originalData","isConverted","tensorManager","wrapper","copyOld","opLimits","usage","newData","dstData","tensorId","tensorTracker","writable","readable","index","tensorWrapper","backend_webnn_exports","WebNNBackend","onnxDataTypeToWebnnDataType","compareMLContextOptions","init_backend_webnn","aKeys","bKeys","tensorIds","optionsOrDevice","mlContextIndex","entry","mlContext","sessionIds","onnxDataType","dimensions","webnnDataType","id","externalFilePath","builder","desc","mountedFiles","shouldConvertInt64ToInt32","filePath","fileData","bufferView","int32Buffer","inputName","outputName","inputNames","outputNames","isInput","initOrt","activeSessions","getSessionInputOutputCount","getSessionInputOutputMetadata","prepareInputOutputTensor","loggingLevel","webgpuAdapter","powerPreference","forceFallbackAdapter","device","sessionHandle","metadataOffset","elementType","dimsCount","symbolicDimNameOffset","modelDataOffset","modelData","modelDataLength","ioBindingHandle","inputNamesUTF8Encoded","outputNamesUTF8Encoded","loadingPromises","path","provider","webnnOptions","gpuDevice","inputCount","outputCount","inputMetadata","outputMetadata","outputPreferredLocations","nameString","isGraphOutput","bindingState","buf","ioBindingState","tensorHandles","tensorNameUTF8Encoded","actualLocation","rawData","dataByteLength","registerBuffer","registerMLTensor","isGraphInput","tensorName","dataTypeEnum","createTemporaryTensor","uploadTensor","dimsOffset","inputTensors","outputTensors","inputOutputBound","runOptionsAllocs","inputTensorHandles","outputTensorHandles","inputOutputAllocs","preAllocatedOutputs","beforeRunStack","inputValuesOffset","inputNamesOffset","outputValuesOffset","outputNamesOffset","handle","outputPreferredLocationsEncoded","output","outputPromises","beforeGetTensorDataStack","tensorDataOffset","keepOutputTensor","valueType","dimsLength","preferredLocation","stringData","nextOffset","maxBytesToRead","getBuffer","bufferSize","downloadDataFunction","arrayBuffer","ensureTensor","isGraphInputOutputTypeSupported","profileFileName","tensors","buffers","isProxy","proxyWorker","temporaryObjectUrl","initWasmCallbacks","queuedCallbacks","enqueueCallbacks","ensureWorker","onProxyWorkerMessage","initializeWebAssemblyAndOrtRuntime","initializeOrtEp","init_proxy_wrapper","callbacks","queue","worker","transferable","serializableInputs","encodeTensorMetadata","decodeTensorMetadata","OnnxruntimeWebAssemblySessionHandler","init_session_handler_inference","getName","pathOrBuffer","inputArray","kvp","outputArray","resultMap","backend_wasm_exports","OnnxruntimeWebAssemblyBackend","initializeFlags","wasmBackend","init_backend_wasm","simd","numCpuLogicalCores","index_default"],"mappings":";;;;;usBAAA,IAgBMA,GACAC,GAYOC,GAwCPC,GAwCOC,GA7GbC,GAAAC,EAAA,kBAgBMN,GAAqC,IAAI,IACzCC,GAAqC,CAAA,EAY9BC,GAAkB,CAACK,EAAcC,EAAkBC,IAA0B,CACxF,GAAID,GAAW,OAAOA,EAAQ,MAAS,YAAc,OAAOA,EAAQ,+BAAkC,WAAY,CAChH,IAAME,EAAiBV,GAAS,IAAIO,CAAI,EACxC,GAAIG,IAAmB,OACrBV,GAAS,IAAIO,EAAM,CAAE,QAAAC,EAAS,SAAAC,CAAQ,CAAE,MACnC,IAAIC,EAAe,SAAWD,EAEnC,OACK,GAAIC,EAAe,WAAaD,GACjCC,EAAe,UAAYF,EAC7B,MAAM,IAAI,MAAM,4BAA4BD,CAAI,oBAAoBE,CAAQ,EAAE,EAIlF,GAAIA,GAAY,EAAG,CACj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D,CAS5D,MAAM,KAAKp5B,EAAoC,CAE7Cq5B,GAAgB,EAGhB,MAAMpB,GAAmC,EAGzC,MAAMC,GAAgBl4B,CAAW,CACnC,CASA,MAAM,8BACJ84B,EACA14B,EACkC,CAClC,IAAM0H,EAAU,IAAI6wB,GACpB,aAAM7wB,EAAQ,UAAUgxB,EAAc14B,CAAO,EACtC0H,CACT,CACF,EAEawxB,GAAc,IAAIF,KCtF/BhwB,KACAA,KAGAA,KCPO,IAAMpI,GAAU,SDKvB,IAAO04B,GAAQxwB,GAwBe,CAC5B,IAAMowB,EAAc,cAA0B,YAE5Ch6B,GAAgB,SAAUg6B,EAAa,CAAC,EAGxCh6B,GAAgB,QAASg6B,EAAa,CAAC,EAEzCh6B,GAAgB,MAAOg6B,EAAa,EAAE,EACtCh6B,GAAgB,OAAQg6B,EAAa,EAAE,CACzC,CAEA,OAAO,eAAen4B,EAAI,SAAU,MAAO,CAAE,MAAOH,GAAS,WAAY,EAAK,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Backend } from './backend.js';\nimport { InferenceSession } from './inference-session.js';\n\ninterface BackendInfo {\n  backend: Backend;\n  priority: number;\n\n  initPromise?: Promise<void>;\n  initialized?: boolean;\n  aborted?: boolean;\n  error?: string;\n}\n\nconst backends: Map<string, BackendInfo> = new Map();\nconst backendsSortedByPriority: string[] = [];\n\n/**\n * Register a backend.\n *\n * @param name - the name as a key to lookup as an execution provider.\n * @param backend - the backend object.\n * @param priority - an integer indicating the priority of the backend. Higher number means higher priority. if priority\n * < 0, it will be considered as a 'beta' version and will not be used as a fallback backend by default.\n *\n * @ignore\n */\nexport const registerBackend = (name: string, backend: Backend, priority: number): void => {\n  if (backend && typeof backend.init === 'function' && typeof backend.createInferenceSessionHandler === 'function') {\n    const currentBackend = backends.get(name);\n    if (currentBackend === undefined) {\n      backends.set(name, { backend, priority });\n    } else if (currentBackend.priority > priority) {\n      // same name is already registered with a higher priority. skip registeration.\n      return;\n    } else if (currentBackend.priority === priority) {\n      if (currentBackend.backend !== backend) {\n        throw new Error(`cannot register backend \"${name}\" using priority ${priority}`);\n      }\n    }\n\n    if (priority >= 0) {\n      const i = backendsSortedByPriority.indexOf(name);\n      if (i !== -1) {\n        backendsSortedByPriority.splice(i, 1);\n      }\n\n      for (let i = 0; i < backendsSortedByPriority.length; i++) {\n        if (backends.get(backendsSortedByPriority[i])!.priority <= priority) {\n          backendsSortedByPriority.splice(i, 0, name);\n          return;\n        }\n      }\n      backendsSortedByPriority.push(name);\n    }\n    return;\n  }\n\n  throw new TypeError('not a valid backend');\n};\n\n/**\n * Try to resolve and initialize a backend.\n *\n * @param backendName - the name of the backend.\n * @returns the backend instance if resolved and initialized successfully, or an error message if failed.\n */\nconst tryResolveAndInitializeBackend = async (backendName: string): Promise<Backend | string> => {\n  const backendInfo = backends.get(backendName);\n  if (!backendInfo) {\n    return 'backend not found.';\n  }\n\n  if (backendInfo.initialized) {\n    return backendInfo.backend;\n  } else if (backendInfo.aborted) {\n    return backendInfo.error!;\n  } else {\n    const isInitializing = !!backendInfo.initPromise;\n    try {\n      if (!isInitializing) {\n        backendInfo.initPromise = backendInfo.backend.init(backendName);\n      }\n      await backendInfo.initPromise;\n      backendInfo.initialized = true;\n      return backendInfo.backend;\n    } catch (e) {\n      if (!isInitializing) {\n        backendInfo.error = `${e}`;\n        backendInfo.aborted = true;\n      }\n      return backendInfo.error!;\n    } finally {\n      delete backendInfo.initPromise;\n    }\n  }\n};\n\n/**\n * Resolve execution providers from the specific session options.\n *\n * @param options - the session options object.\n * @returns a promise that resolves to a tuple of an initialized backend instance and a session options object with\n * filtered EP list.\n *\n * @ignore\n */\nexport const resolveBackendAndExecutionProviders = async (\n  options: InferenceSession.SessionOptions,\n): Promise<[backend: Backend, options: InferenceSession.SessionOptions]> => {\n  // extract backend hints from session options\n  const eps = options.executionProviders || [];\n  const backendHints = eps.map((i) => (typeof i === 'string' ? i : i.name));\n  const backendNames = backendHints.length === 0 ? backendsSortedByPriority : backendHints;\n\n  // try to resolve and initialize all requested backends\n  let backend: Backend | undefined;\n  const errors = [];\n  const availableBackendNames = new Set<string>();\n  for (const backendName of backendNames) {\n    const resolveResult = await tryResolveAndInitializeBackend(backendName);\n    if (typeof resolveResult === 'string') {\n      errors.push({ name: backendName, err: resolveResult });\n    } else {\n      if (!backend) {\n        backend = resolveResult;\n      }\n      if (backend === resolveResult) {\n        availableBackendNames.add(backendName);\n      }\n    }\n  }\n\n  // if no backend is available, throw error.\n  if (!backend) {\n    throw new Error(`no available backend found. ERR: ${errors.map((e) => `[${e.name}] ${e.err}`).join(', ')}`);\n  }\n\n  // for each explicitly requested backend, if it's not available, output warning message.\n  for (const { name, err } of errors) {\n    if (backendHints.includes(name)) {\n      // eslint-disable-next-line no-console\n      console.warn(\n        `removing requested execution provider \"${name}\" from session options because it is not available: ${err}`,\n      );\n    }\n  }\n\n  const filteredEps = eps.filter((i) => availableBackendNames.has(typeof i === 'string' ? i : i.name));\n\n  return [\n    backend,\n    new Proxy(options, {\n      get: (target, prop) => {\n        if (prop === 'executionProviders') {\n          return filteredEps;\n        }\n        return Reflect.get(target, prop);\n      },\n    }),\n  ];\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { InferenceSession } from './inference-session.js';\nimport { OnnxValue } from './onnx-value.js';\n\n/**\n * @ignore\n */\nexport declare namespace SessionHandler {\n  type FeedsType = { [name: string]: OnnxValue };\n  type FetchesType = { [name: string]: OnnxValue | null };\n  type ReturnType = { [name: string]: OnnxValue };\n}\n\n/**\n * Represents shared SessionHandler functionality\n *\n * @ignore\n */\ninterface SessionHandler {\n  dispose(): Promise<void>;\n\n  readonly inputNames: readonly string[];\n  readonly outputNames: readonly string[];\n\n  readonly inputMetadata: readonly InferenceSession.ValueMetadata[];\n  readonly outputMetadata: readonly InferenceSession.ValueMetadata[];\n}\n\n/**\n * Represent a handler instance of an inference session.\n *\n * @ignore\n */\nexport interface InferenceSessionHandler extends SessionHandler {\n  startProfiling(): void;\n  endProfiling(): void;\n\n  run(\n    feeds: SessionHandler.FeedsType,\n    fetches: SessionHandler.FetchesType,\n    options: InferenceSession.RunOptions,\n  ): Promise<SessionHandler.ReturnType>;\n}\n\n/**\n * Represent a backend that provides implementation of model inferencing.\n *\n * @ignore\n */\nexport interface Backend {\n  /**\n   * Initialize the backend asynchronously. Should throw when failed.\n   */\n  init(backendName: string): Promise<void>;\n\n  createInferenceSessionHandler(\n    uriOrBuffer: string | Uint8Array,\n    options?: InferenceSession.SessionOptions,\n  ): Promise<InferenceSessionHandler>;\n}\n\nexport { registerBackend } from './backend-impl.js';\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n// This file is generated by /js/scripts/update-version.ts\n// Do not modify file content manually.\n\nexport const version = '1.27.0';\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Env } from './env.js';\nimport { version } from './version.js';\n\ntype LogLevelType = Env['logLevel'];\n\nlet logLevelValue: Required<LogLevelType> = 'warning';\n\nexport const env: Env = {\n  wasm: {},\n  webgl: {} as Env.WebGLFlags,\n  webgpu: {} as Env.WebGpuFlags,\n  versions: { common: version },\n\n  set logLevel(value: LogLevelType) {\n    if (value === undefined) {\n      return;\n    }\n    if (typeof value !== 'string' || ['verbose', 'info', 'warning', 'error', 'fatal'].indexOf(value) === -1) {\n      throw new Error(`Unsupported logging level: ${value}`);\n    }\n    logLevelValue = value;\n  },\n  get logLevel(): Required<LogLevelType> {\n    return logLevelValue;\n  },\n};\n\n// set property 'logLevel' so that they can be correctly transferred to worker by `postMessage()`.\nObject.defineProperty(env, 'logLevel', { enumerable: true });\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { env as envImpl } from './env-impl.js';\nimport { TryGetGlobalType } from './type-helper.js';\n\nexport declare namespace Env {\n  export type WasmPathPrefix = string;\n  export interface WasmFilePaths {\n    /**\n     * Specify the override path for the main .wasm file.\n     *\n     * This path should be an absolute path.\n     *\n     * If not modified, the filename of the .wasm file is:\n     * - `ort-wasm-simd-threaded.wasm` for default build\n     * - `ort-wasm-simd-threaded.jsep.wasm` for JSEP build (with WebGPU and WebNN)\n     * - `ort-wasm-simd-threaded.asyncify.wasm` for WebGPU build with Asyncify (with WebNN)\n     * - `ort-wasm-simd-threaded.jspi.wasm` for WebGPU build with JSPI support (with WebNN)\n     */\n    wasm?: URL | string;\n    /**\n     * Specify the override path for the main .mjs file.\n     *\n     * This path should be an absolute path.\n     *\n     * If not modified, the filename of the .mjs file is:\n     * - `ort-wasm-simd-threaded.mjs` for default build\n     * - `ort-wasm-simd-threaded.jsep.mjs` for JSEP build (with WebGPU and WebNN)\n     * - `ort-wasm-simd-threaded.asyncify.mjs` for WebGPU build with Asyncify (with WebNN)\n     * - `ort-wasm-simd-threaded.jspi.mjs` for WebGPU build with JSPI support (with WebNN)\n     */\n    mjs?: URL | string;\n  }\n  export type WasmPrefixOrFilePaths = WasmPathPrefix | WasmFilePaths;\n  export interface WebAssemblyFlags {\n    /**\n     * set or get number of thread(s). If omitted or set to 0, number of thread(s) will be determined by system. If set\n     * to 1, no worker thread will be spawned.\n     *\n     * This setting is available only when WebAssembly multithread feature is available in current context.\n     *\n     * @defaultValue `0`\n     */\n    numThreads?: number;\n\n    /**\n     * set a value indicating whether to enable SIMD.\n     *\n     * ONNX Runtime will perform feature detection based on the value of this property. Specifically, when the value is\n     * set to:\n     * - `undefined`, `true` or `\"fixed\"`: will check availability of Fixed-width SIMD.\n     * - `\"relaxed\"`: will check availability of Relaxed SIMD.\n     * - `false`: will not perform SIMD feature checking.\n     *\n     * Setting this property does not make ONNX Runtime to switch to the corresponding runtime automatically. User need\n     * to set `wasmPaths` or `wasmBinary` property to load the corresponding runtime.\n     *\n     * This setting is available only when WebAssembly SIMD feature is available in current context.\n     *\n     * @defaultValue `true`\n     */\n    simd?: boolean | 'fixed' | 'relaxed';\n\n    /**\n     * set or get a boolean value indicating whether to enable trace.\n     *\n     * @defaultValue `false`\n     *\n     * @deprecated Use `env.trace` instead. If `env.trace` is set, this property will be ignored.\n     */\n    trace?: boolean;\n\n    /**\n     * Set or get a number specifying the timeout for initialization of WebAssembly backend, in milliseconds. A zero\n     * value indicates no timeout is set.\n     *\n     * @defaultValue `0`\n     */\n    initTimeout?: number;\n\n    /**\n     * Set a custom URL prefix to the .wasm/.mjs files, or an object of overrides for both .wasm/.mjs file. The override\n     * path should be an absolute path.\n     */\n    wasmPaths?: WasmPrefixOrFilePaths;\n\n    /**\n     * Set a custom buffer which contains the WebAssembly binary. If this property is set, the `wasmPaths` property will\n     * be ignored.\n     */\n    wasmBinary?: ArrayBufferLike | Uint8Array;\n\n    /**\n     * Set or get a boolean value indicating whether to proxy the execution of main thread to a worker thread.\n     *\n     * @defaultValue `false`\n     */\n    proxy?: boolean;\n  }\n\n  export interface WebGLFlags {\n    /**\n     * Set or get the WebGL Context ID (webgl or webgl2).\n     *\n     * @defaultValue `'webgl2'`\n     */\n    contextId?: 'webgl' | 'webgl2';\n    /**\n     * Get the WebGL rendering context.\n     */\n    readonly context: WebGLRenderingContext;\n    /**\n     * Set or get the maximum batch size for matmul. 0 means to disable batching.\n     *\n     * @deprecated\n     */\n    matmulMaxBatchSize?: number;\n    /**\n     * Set or get the texture cache mode.\n     *\n     * @defaultValue `'full'`\n     */\n    textureCacheMode?: 'initializerOnly' | 'full';\n    /**\n     * Set or get the packed texture mode\n     *\n     * @defaultValue `false`\n     */\n    pack?: boolean;\n    /**\n     * Set or get whether enable async download.\n     *\n     * @defaultValue `false`\n     */\n    async?: boolean;\n  }\n\n  export interface WebGpuProfilingDataV1TensorMetadata {\n    dims: readonly number[];\n    dataType: string;\n  }\n  export interface WebGpuProfilingDataV1 {\n    version: 1;\n    inputsMetadata: readonly WebGpuProfilingDataV1TensorMetadata[];\n    outputsMetadata: readonly WebGpuProfilingDataV1TensorMetadata[];\n    kernelId: number;\n    kernelType: string;\n    kernelName: string;\n    programName: string;\n    startTime: number;\n    endTime: number;\n  }\n\n  export type WebGpuProfilingData = WebGpuProfilingDataV1;\n\n  export interface WebGpuFlags {\n    /**\n     * Set or get the profiling mode.\n     *\n     * @deprecated Use `env.webgpu.profiling.mode` instead. If `env.webgpu.profiling.mode` is set, this property will be\n     * ignored.\n     */\n    profilingMode?: 'off' | 'default';\n    /**\n     * Set or get the profiling configuration.\n     */\n    profiling: {\n      /**\n       * Set or get the profiling mode.\n       *\n       * @defaultValue `'off'`\n       */\n      mode?: 'off' | 'default';\n\n      /**\n       * Set or get a callback function when a profiling data is received. If not set, the profiling data will be\n       * printed to console.\n       */\n      ondata?: (data: WebGpuProfilingData) => void;\n    };\n    /**\n     * Set or get the power preference.\n     *\n     * Setting this property only has effect before the first WebGPU inference session is created. The value will be\n     * used as options for `navigator.gpu.requestAdapter()`.\n     *\n     * See {@link https://gpuweb.github.io/gpuweb/#dictdef-gpurequestadapteroptions} for more details.\n     *\n     * @defaultValue `undefined`\n     *\n     * @deprecated Create your own GPUAdapter, use it to create a GPUDevice instance and set {@link device} property if\n     * you want to use a specific power preference.\n     */\n    powerPreference?: 'low-power' | 'high-performance';\n    /**\n     * Set or get the force fallback adapter flag.\n     *\n     * Setting this property only has effect before the first WebGPU inference session is created. The value will be\n     * used as options for `navigator.gpu.requestAdapter()`.\n     *\n     * See {@link https://gpuweb.github.io/gpuweb/#dictdef-gpurequestadapteroptions} for more details.\n     *\n     * @defaultValue `undefined`\n     *\n     * @deprecated Create your own GPUAdapter, use it to create a GPUDevice instance and set {@link device} property if\n     * you want to use a specific fallback option.\n     */\n    forceFallbackAdapter?: boolean;\n    /**\n     * Set or get the adapter for WebGPU.\n     *\n     * Setting this property only has effect before the first WebGPU inference session is created. The value will be\n     * used as the GPU adapter for the underlying WebGPU backend to create GPU device.\n     *\n     * If this property is not set, it will be available to get after the first WebGPU inference session is created. The\n     * value will be the GPU adapter that created by the underlying WebGPU backend.\n     *\n     * When use with TypeScript, the type of this property is `GPUAdapter` defined in \"@webgpu/types\".\n     *\n     * @deprecated It is no longer recommended to use this property. The latest WebGPU spec adds `GPUDevice.adapterInfo`\n     * (https://www.w3.org/TR/webgpu/#dom-gpudevice-adapterinfo), which allows to get the adapter information from the\n     * device. When it's available, there is no need to set/get the {@link adapter} property.\n     */\n    adapter: TryGetGlobalType<'GPUAdapter'>;\n    /**\n     * Set or get the GPU device for WebGPU.\n     *\n     * There are 3 valid scenarios of accessing this property:\n     * - Set a value before the first WebGPU inference session is created. The value will be used by the WebGPU backend\n     * to perform calculations. If the value is not a `GPUDevice` object, an error will be thrown.\n     * - Get the value before the first WebGPU inference session is created. This will try to create a new GPUDevice\n     * instance. Returns a `Promise` that resolves to a `GPUDevice` object.\n     * - Get the value after the first WebGPU inference session is created. Returns a resolved `Promise` to the\n     * `GPUDevice` object used by the WebGPU backend.\n     */\n    get device(): Promise<TryGetGlobalType<'GPUDevice'>>;\n    set device(value: TryGetGlobalType<'GPUDevice'>);\n    /**\n     * Set or get whether validate input content.\n     *\n     * @defaultValue `false`\n     */\n    validateInputContent?: boolean;\n  }\n}\n\nexport interface Env {\n  /**\n   * set the severity level for logging.\n   *\n   * @defaultValue `'warning'`\n   */\n  logLevel?: 'verbose' | 'info' | 'warning' | 'error' | 'fatal';\n\n  /**\n   * Indicate whether run in debug mode.\n   *\n   * @defaultValue `false`\n   */\n  debug?: boolean;\n\n  /**\n   * set or get a boolean value indicating whether to enable trace.\n   *\n   * @defaultValue `false`\n   */\n  trace?: boolean;\n\n  /**\n   * Get version of the current package.\n   */\n  readonly versions: {\n    readonly common: string;\n    readonly web?: string;\n    readonly node?: string;\n    // eslint-disable-next-line @typescript-eslint/naming-convention\n    readonly 'react-native'?: string;\n  };\n\n  /**\n   * Represent a set of flags for WebAssembly\n   */\n  readonly wasm: Env.WebAssemblyFlags;\n\n  /**\n   * Represent a set of flags for WebGL\n   */\n  readonly webgl: Env.WebGLFlags;\n\n  /**\n   * Represent a set of flags for WebGPU\n   */\n  readonly webgpu: Env.WebGpuFlags;\n\n  [name: string]: unknown;\n}\n\n/**\n * Represent a set of flags as a global singleton.\n */\nexport const env: Env = envImpl;\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { TensorToDataUrlOptions, TensorToImageDataOptions } from './tensor-conversion.js';\nimport { Tensor } from './tensor.js';\n\n/**\n * implementation of Tensor.toDataURL()\n */\nexport const tensorToDataURL = (tensor: Tensor, options?: TensorToDataUrlOptions): string => {\n  const canvas = typeof document !== 'undefined' ? document.createElement('canvas') : new OffscreenCanvas(1, 1);\n  canvas.width = tensor.dims[3];\n  canvas.height = tensor.dims[2];\n  const pixels2DContext = canvas.getContext('2d') as\n    | CanvasRenderingContext2D\n    | OffscreenCanvasRenderingContext2D\n    | null;\n\n  if (pixels2DContext != null) {\n    // Default values for height and width & format\n    let width: number;\n    let height: number;\n    if (options?.tensorLayout !== undefined && options.tensorLayout === 'NHWC') {\n      width = tensor.dims[2];\n      height = tensor.dims[3];\n    } else {\n      // Default layout is NCWH\n      width = tensor.dims[3];\n      height = tensor.dims[2];\n    }\n\n    const inputformat = options?.format !== undefined ? options.format : 'RGB';\n\n    const norm = options?.norm;\n    let normMean: [number, number, number, number];\n    let normBias: [number, number, number, number];\n    if (norm === undefined || norm.mean === undefined) {\n      normMean = [255, 255, 255, 255];\n    } else {\n      if (typeof norm.mean === 'number') {\n        normMean = [norm.mean, norm.mean, norm.mean, norm.mean];\n      } else {\n        normMean = [norm.mean[0], norm.mean[1], norm.mean[2], 0];\n        if (norm.mean[3] !== undefined) {\n          normMean[3] = norm.mean[3];\n        }\n      }\n    }\n    if (norm === undefined || norm.bias === undefined) {\n      normBias = [0, 0, 0, 0];\n    } else {\n      if (typeof norm.bias === 'number') {\n        normBias = [norm.bias, norm.bias, norm.bias, norm.bias];\n      } else {\n        normBias = [norm.bias[0], norm.bias[1], norm.bias[2], 0];\n        if (norm.bias[3] !== undefined) {\n          normBias[3] = norm.bias[3];\n        }\n      }\n    }\n\n    const stride = height * width;\n    // Default pointer assignments\n    let rTensorPointer = 0,\n      gTensorPointer = stride,\n      bTensorPointer = stride * 2,\n      aTensorPointer = -1;\n\n    // Updating the pointer assignments based on the input image format\n    if (inputformat === 'RGBA') {\n      rTensorPointer = 0;\n      gTensorPointer = stride;\n      bTensorPointer = stride * 2;\n      aTensorPointer = stride * 3;\n    } else if (inputformat === 'RGB') {\n      rTensorPointer = 0;\n      gTensorPointer = stride;\n      bTensorPointer = stride * 2;\n    } else if (inputformat === 'RBG') {\n      rTensorPointer = 0;\n      bTensorPointer = stride;\n      gTensorPointer = stride * 2;\n    }\n\n    for (let i = 0; i < height; i++) {\n      for (let j = 0; j < width; j++) {\n        const R = ((tensor.data[rTensorPointer++] as number) - normBias[0]) * normMean[0]; // R value\n        const G = ((tensor.data[gTensorPointer++] as number) - normBias[1]) * normMean[1]; // G value\n        const B = ((tensor.data[bTensorPointer++] as number) - normBias[2]) * normMean[2]; // B value\n        const A = aTensorPointer === -1 ? 255 : ((tensor.data[aTensorPointer++] as number) - normBias[3]) * normMean[3]; // A value\n\n        pixels2DContext.fillStyle = 'rgba(' + R + ',' + G + ',' + B + ',' + A + ')';\n        pixels2DContext.fillRect(j, i, 1, 1);\n      }\n    }\n    if ('toDataURL' in canvas) {\n      return canvas.toDataURL();\n    } else {\n      throw new Error('toDataURL is not supported');\n    }\n  } else {\n    throw new Error('Can not access image data');\n  }\n};\n\n/**\n * implementation of Tensor.toImageData()\n */\nexport const tensorToImageData = (tensor: Tensor, options?: TensorToImageDataOptions): ImageData => {\n  const pixels2DContext =\n    typeof document !== 'undefined'\n      ? document.createElement('canvas').getContext('2d')\n      : (new OffscreenCanvas(1, 1).getContext('2d') as OffscreenCanvasRenderingContext2D);\n  let image: ImageData;\n  if (pixels2DContext != null) {\n    // Default values for height and width & format\n    let width: number;\n    let height: number;\n    let channels: number;\n    if (options?.tensorLayout !== undefined && options.tensorLayout === 'NHWC') {\n      width = tensor.dims[2];\n      height = tensor.dims[1];\n      channels = tensor.dims[3];\n    } else {\n      // Default layout is NCWH\n      width = tensor.dims[3];\n      height = tensor.dims[2];\n      channels = tensor.dims[1];\n    }\n    const inputformat = options !== undefined ? (options.format !== undefined ? options.format : 'RGB') : 'RGB';\n\n    const norm = options?.norm;\n    let normMean: [number, number, number, number];\n    let normBias: [number, number, number, number];\n    if (norm === undefined || norm.mean === undefined) {\n      normMean = [255, 255, 255, 255];\n    } else {\n      if (typeof norm.mean === 'number') {\n        normMean = [norm.mean, norm.mean, norm.mean, norm.mean];\n      } else {\n        normMean = [norm.mean[0], norm.mean[1], norm.mean[2], 255];\n        if (norm.mean[3] !== undefined) {\n          normMean[3] = norm.mean[3];\n        }\n      }\n    }\n    if (norm === undefined || norm.bias === undefined) {\n      normBias = [0, 0, 0, 0];\n    } else {\n      if (typeof norm.bias === 'number') {\n        normBias = [norm.bias, norm.bias, norm.bias, norm.bias];\n      } else {\n        normBias = [norm.bias[0], norm.bias[1], norm.bias[2], 0];\n        if (norm.bias[3] !== undefined) {\n          normBias[3] = norm.bias[3];\n        }\n      }\n    }\n\n    const stride = height * width;\n    if (options !== undefined) {\n      if (\n        (options.format !== undefined && channels === 4 && options.format !== 'RGBA') ||\n        (channels === 3 && options.format !== 'RGB' && options.format !== 'BGR')\n      ) {\n        throw new Error(\"Tensor format doesn't match input tensor dims\");\n      }\n    }\n\n    // Default pointer assignments\n    const step = 4;\n    let rImagePointer = 0,\n      gImagePointer = 1,\n      bImagePointer = 2,\n      aImagePointer = 3;\n    let rTensorPointer = 0,\n      gTensorPointer = stride,\n      bTensorPointer = stride * 2,\n      aTensorPointer = -1;\n\n    // Updating the pointer assignments based on the input image format\n    if (inputformat === 'RGBA') {\n      rTensorPointer = 0;\n      gTensorPointer = stride;\n      bTensorPointer = stride * 2;\n      aTensorPointer = stride * 3;\n    } else if (inputformat === 'RGB') {\n      rTensorPointer = 0;\n      gTensorPointer = stride;\n      bTensorPointer = stride * 2;\n    } else if (inputformat === 'RBG') {\n      rTensorPointer = 0;\n      bTensorPointer = stride;\n      gTensorPointer = stride * 2;\n    }\n\n    image = pixels2DContext.createImageData(width, height);\n\n    for (\n      let i = 0;\n      i < height * width;\n      rImagePointer += step, gImagePointer += step, bImagePointer += step, aImagePointer += step, i++\n    ) {\n      image.data[rImagePointer] = ((tensor.data[rTensorPointer++] as number) - normBias[0]) * normMean[0]; // R value\n      image.data[gImagePointer] = ((tensor.data[gTensorPointer++] as number) - normBias[1]) * normMean[1]; // G value\n      image.data[bImagePointer] = ((tensor.data[bTensorPointer++] as number) - normBias[2]) * normMean[2]; // B value\n      image.data[aImagePointer] =\n        aTensorPointer === -1 ? 255 : ((tensor.data[aTensorPointer++] as number) - normBias[3]) * normMean[3]; // A value\n    }\n  } else {\n    throw new Error('Can not access image data');\n  }\n  return image;\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {\n  OptionsDimensions,\n  OptionsFormat,\n  OptionsNormalizationParameters,\n  OptionsTensorFormat,\n  OptionsTensorLayout,\n  TensorFromGpuBufferOptions,\n  TensorFromImageBitmapOptions,\n  TensorFromImageDataOptions,\n  TensorFromImageElementOptions,\n  TensorFromMLTensorOptions,\n  TensorFromTextureOptions,\n  TensorFromUrlOptions,\n} from './tensor-factory.js';\nimport { Tensor } from './tensor-impl.js';\nimport { Tensor as TensorInterface } from './tensor.js';\n\ninterface BufferToTensorOptions\n  extends OptionsDimensions, OptionsTensorLayout, OptionsNormalizationParameters, OptionsFormat, OptionsTensorFormat {}\n\n/**\n * Create a new tensor object from image object\n *\n * @param buffer - Extracted image buffer data - assuming RGBA format\n * @param imageFormat - input image configuration - required configurations height, width, format\n * @param tensorFormat - output tensor configuration - Default is RGB format\n */\nexport const bufferToTensor = (buffer: Uint8ClampedArray | undefined, options: BufferToTensorOptions): Tensor => {\n  if (buffer === undefined) {\n    throw new Error('Image buffer must be defined');\n  }\n  if (options.height === undefined || options.width === undefined) {\n    throw new Error('Image height and width must be defined');\n  }\n  if (options.tensorLayout === 'NHWC') {\n    throw new Error('NHWC Tensor layout is not supported yet');\n  }\n\n  const { height, width } = options;\n\n  const norm = options.norm ?? { mean: 255, bias: 0 };\n  let normMean: [number, number, number, number];\n  let normBias: [number, number, number, number];\n\n  if (typeof norm.mean === 'number') {\n    normMean = [norm.mean, norm.mean, norm.mean, norm.mean];\n  } else {\n    normMean = [norm.mean![0], norm.mean![1], norm.mean![2], norm.mean![3] ?? 255];\n  }\n\n  if (typeof norm.bias === 'number') {\n    normBias = [norm.bias, norm.bias, norm.bias, norm.bias];\n  } else {\n    normBias = [norm.bias![0], norm.bias![1], norm.bias![2], norm.bias![3] ?? 0];\n  }\n\n  const inputformat = options.format !== undefined ? options.format : 'RGBA';\n  // default value is RGBA since imagedata and HTMLImageElement uses it\n\n  const outputformat =\n    options.tensorFormat !== undefined ? (options.tensorFormat !== undefined ? options.tensorFormat : 'RGB') : 'RGB';\n  const stride = height * width;\n  const float32Data = outputformat === 'RGBA' ? new Float32Array(stride * 4) : new Float32Array(stride * 3);\n\n  // Default pointer assignments\n  let step = 4,\n    rImagePointer = 0,\n    gImagePointer = 1,\n    bImagePointer = 2,\n    aImagePointer = 3;\n  let rTensorPointer = 0,\n    gTensorPointer = stride,\n    bTensorPointer = stride * 2,\n    aTensorPointer = -1;\n\n  // Updating the pointer assignments based on the input image format\n  if (inputformat === 'RGB') {\n    step = 3;\n    rImagePointer = 0;\n    gImagePointer = 1;\n    bImagePointer = 2;\n    aImagePointer = -1;\n  }\n\n  // Updating the pointer assignments based on the output tensor format\n  if (outputformat === 'RGBA') {\n    aTensorPointer = stride * 3;\n  } else if (outputformat === 'RBG') {\n    rTensorPointer = 0;\n    bTensorPointer = stride;\n    gTensorPointer = stride * 2;\n  } else if (outputformat === 'BGR') {\n    bTensorPointer = 0;\n    gTensorPointer = stride;\n    rTensorPointer = stride * 2;\n  }\n\n  for (\n    let i = 0;\n    i < stride;\n    i++, rImagePointer += step, bImagePointer += step, gImagePointer += step, aImagePointer += step\n  ) {\n    float32Data[rTensorPointer++] = (buffer[rImagePointer] + normBias[0]) / normMean[0];\n    float32Data[gTensorPointer++] = (buffer[gImagePointer] + normBias[1]) / normMean[1];\n    float32Data[bTensorPointer++] = (buffer[bImagePointer] + normBias[2]) / normMean[2];\n    if (aTensorPointer !== -1 && aImagePointer !== -1) {\n      float32Data[aTensorPointer++] = (buffer[aImagePointer] + normBias[3]) / normMean[3];\n    }\n  }\n\n  // Float32Array -> ort.Tensor\n  const outputTensor =\n    outputformat === 'RGBA'\n      ? new Tensor('float32', float32Data, [1, 4, height, width])\n      : new Tensor('float32', float32Data, [1, 3, height, width]);\n  return outputTensor;\n};\n\n/**\n * implementation of Tensor.fromImage().\n */\nexport const tensorFromImage = async (\n  image: ImageData | HTMLImageElement | ImageBitmap | string,\n  options?:\n    | TensorFromImageDataOptions\n    | TensorFromImageElementOptions\n    | TensorFromImageBitmapOptions\n    | TensorFromUrlOptions,\n): Promise<Tensor> => {\n  // checking the type of image object\n  const isHTMLImageEle = typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement;\n  const isImageDataEle = typeof ImageData !== 'undefined' && image instanceof ImageData;\n  const isImageBitmap = typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap;\n  const isString = typeof image === 'string';\n\n  let data: Uint8ClampedArray | undefined;\n  let bufferToTensorOptions: BufferToTensorOptions = options ?? {};\n\n  const createCanvas = () => {\n    if (typeof document !== 'undefined') {\n      return document.createElement('canvas');\n    } else if (typeof OffscreenCanvas !== 'undefined') {\n      return new OffscreenCanvas(1, 1);\n    } else {\n      throw new Error('Canvas is not supported');\n    }\n  };\n  const createCanvasContext = (canvas: HTMLCanvasElement | OffscreenCanvas) => {\n    if (typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement) {\n      return canvas.getContext('2d');\n    } else if (canvas instanceof OffscreenCanvas) {\n      return canvas.getContext('2d') as OffscreenCanvasRenderingContext2D;\n    } else {\n      return null;\n    }\n  };\n  // filling and checking image configuration options\n  if (isHTMLImageEle) {\n    // HTMLImageElement - image object - format is RGBA by default\n    const canvas = createCanvas();\n    canvas.width = image.width;\n    canvas.height = image.height;\n    const pixels2DContext = createCanvasContext(canvas);\n\n    if (pixels2DContext != null) {\n      let height = image.height;\n      let width = image.width;\n      if (options !== undefined && options.resizedHeight !== undefined && options.resizedWidth !== undefined) {\n        height = options.resizedHeight;\n        width = options.resizedWidth;\n      }\n\n      if (options !== undefined) {\n        bufferToTensorOptions = options;\n        if (options.tensorFormat !== undefined) {\n          throw new Error('Image input config format must be RGBA for HTMLImageElement');\n        } else {\n          bufferToTensorOptions.tensorFormat = 'RGBA';\n        }\n        bufferToTensorOptions.height = height;\n        bufferToTensorOptions.width = width;\n      } else {\n        bufferToTensorOptions.tensorFormat = 'RGBA';\n        bufferToTensorOptions.height = height;\n        bufferToTensorOptions.width = width;\n      }\n\n      pixels2DContext.drawImage(image, 0, 0);\n      data = pixels2DContext.getImageData(0, 0, width, height).data;\n    } else {\n      throw new Error('Can not access image data');\n    }\n  } else if (isImageDataEle) {\n    let height: number;\n    let width: number;\n\n    if (options !== undefined && options.resizedWidth !== undefined && options.resizedHeight !== undefined) {\n      height = options.resizedHeight;\n      width = options.resizedWidth;\n    } else {\n      height = image.height;\n      width = image.width;\n    }\n\n    if (options !== undefined) {\n      bufferToTensorOptions = options;\n    }\n    bufferToTensorOptions.format = 'RGBA';\n    bufferToTensorOptions.height = height;\n    bufferToTensorOptions.width = width;\n\n    if (options !== undefined) {\n      const tempCanvas = createCanvas();\n\n      tempCanvas.width = width;\n      tempCanvas.height = height;\n\n      const pixels2DContext = createCanvasContext(tempCanvas);\n\n      if (pixels2DContext != null) {\n        pixels2DContext.putImageData(image, 0, 0);\n        data = pixels2DContext.getImageData(0, 0, width, height).data;\n      } else {\n        throw new Error('Can not access image data');\n      }\n    } else {\n      data = image.data;\n    }\n  } else if (isImageBitmap) {\n    // ImageBitmap - image object - format must be provided by user\n    if (options === undefined) {\n      throw new Error('Please provide image config with format for Imagebitmap');\n    }\n\n    const canvas = createCanvas();\n    canvas.width = image.width;\n    canvas.height = image.height;\n    const pixels2DContext = createCanvasContext(canvas);\n\n    if (pixels2DContext != null) {\n      const height = image.height;\n      const width = image.width;\n      pixels2DContext.drawImage(image, 0, 0, width, height);\n      data = pixels2DContext.getImageData(0, 0, width, height).data;\n      bufferToTensorOptions.height = height;\n      bufferToTensorOptions.width = width;\n      return bufferToTensor(data, bufferToTensorOptions);\n    } else {\n      throw new Error('Can not access image data');\n    }\n  } else if (isString) {\n    return new Promise((resolve, reject) => {\n      const canvas = createCanvas();\n      const context = createCanvasContext(canvas);\n      if (!image || !context) {\n        return reject();\n      }\n      const newImage = new Image();\n      newImage.crossOrigin = 'Anonymous';\n      newImage.src = image;\n      newImage.onload = () => {\n        canvas.width = newImage.width;\n        canvas.height = newImage.height;\n        context.drawImage(newImage, 0, 0, canvas.width, canvas.height);\n        const img = context.getImageData(0, 0, canvas.width, canvas.height);\n\n        bufferToTensorOptions.height = canvas.height;\n        bufferToTensorOptions.width = canvas.width;\n        resolve(bufferToTensor(img.data, bufferToTensorOptions));\n      };\n    });\n  } else {\n    throw new Error('Input data provided is not supported - aborted tensor creation');\n  }\n\n  if (data !== undefined) {\n    return bufferToTensor(data, bufferToTensorOptions);\n  } else {\n    throw new Error('Input data provided is not supported - aborted tensor creation');\n  }\n};\n\n/**\n * implementation of Tensor.fromTexture().\n */\nexport const tensorFromTexture = <T extends TensorInterface.TextureDataTypes>(\n  texture: TensorInterface.TextureType,\n  options: TensorFromTextureOptions<T>,\n): Tensor => {\n  const { width, height, download, dispose } = options;\n  // Always assume RGBAF32. TODO: support different texture format\n  const dims = [1, height, width, 4];\n  return new Tensor({ location: 'texture', type: 'float32', texture, dims, download, dispose });\n};\n\n/**\n * implementation of Tensor.fromGpuBuffer().\n */\nexport const tensorFromGpuBuffer = <T extends TensorInterface.GpuBufferDataTypes>(\n  gpuBuffer: TensorInterface.GpuBufferType,\n  options: TensorFromGpuBufferOptions<T>,\n): Tensor => {\n  const { dataType, dims, download, dispose } = options;\n  return new Tensor({ location: 'gpu-buffer', type: dataType ?? 'float32', gpuBuffer, dims, download, dispose });\n};\n\n/**\n * implementation of Tensor.fromMLTensor().\n */\nexport const tensorFromMLTensor = <T extends TensorInterface.MLTensorDataTypes>(\n  mlTensor: TensorInterface.MLTensorType,\n  options: TensorFromMLTensorOptions<T>,\n): Tensor => {\n  const { dataType, dims, download, dispose } = options;\n  return new Tensor({ location: 'ml-tensor', type: dataType ?? 'float32', mlTensor, dims, download, dispose });\n};\n\n/**\n * implementation of Tensor.fromPinnedBuffer().\n */\nexport const tensorFromPinnedBuffer = <T extends TensorInterface.CpuPinnedDataTypes>(\n  type: T,\n  buffer: TensorInterface.DataTypeMap[T],\n  dims?: readonly number[],\n): Tensor => new Tensor({ location: 'cpu-pinned', type, data: buffer, dims: dims ?? [buffer.length] });\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from './tensor.js';\n\nexport type SupportedTypedArrayConstructors =\n  | Float32ArrayConstructor\n  | Uint8ArrayConstructor\n  | Int8ArrayConstructor\n  | Uint16ArrayConstructor\n  | Int16ArrayConstructor\n  | Int32ArrayConstructor\n  | BigInt64ArrayConstructor\n  | Uint8ArrayConstructor\n  | Float64ArrayConstructor\n  | Uint32ArrayConstructor\n  | BigUint64ArrayConstructor;\nexport type SupportedTypedArray = InstanceType<SupportedTypedArrayConstructors>;\n\n// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap.\nexport const NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP = new Map<string, SupportedTypedArrayConstructors>([\n  ['float32', Float32Array],\n  ['uint8', Uint8Array],\n  ['int8', Int8Array],\n  ['uint16', Uint16Array],\n  ['int16', Int16Array],\n  ['int32', Int32Array],\n  ['bool', Uint8Array],\n  ['float64', Float64Array],\n  ['uint32', Uint32Array],\n  ['int4', Uint8Array],\n  ['uint4', Uint8Array],\n]);\n\n// a runtime map that maps type string to TypedArray constructor. Should match Tensor.DataTypeMap.\nexport const NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP = new Map<SupportedTypedArrayConstructors, Tensor.Type>([\n  [Float32Array, 'float32'],\n  [Uint8Array, 'uint8'],\n  [Int8Array, 'int8'],\n  [Uint16Array, 'uint16'],\n  [Int16Array, 'int16'],\n  [Int32Array, 'int32'],\n  [Float64Array, 'float64'],\n  [Uint32Array, 'uint32'],\n]);\n\n// the following code allows delaying execution of BigInt/Float16Array checking. This allows lazy initialization for\n// NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP and NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP, which allows BigInt/Float16Array\n// polyfill if available.\nlet isTypedArrayChecked = false;\nexport const checkTypedArray = () => {\n  if (!isTypedArrayChecked) {\n    isTypedArrayChecked = true;\n    const isBigInt64ArrayAvailable = typeof BigInt64Array !== 'undefined' && BigInt64Array.from;\n    const isBigUint64ArrayAvailable = typeof BigUint64Array !== 'undefined' && BigUint64Array.from;\n\n    // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-explicit-any\n    const Float16Array = (globalThis as any).Float16Array;\n    const isFloat16ArrayAvailable = typeof Float16Array !== 'undefined' && Float16Array.from;\n\n    if (isBigInt64ArrayAvailable) {\n      NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('int64', BigInt64Array);\n      NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigInt64Array, 'int64');\n    }\n    if (isBigUint64ArrayAvailable) {\n      NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('uint64', BigUint64Array);\n      NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(BigUint64Array, 'uint64');\n    }\n    if (isFloat16ArrayAvailable) {\n      NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('float16', Float16Array);\n      NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.set(Float16Array, 'float16');\n    } else {\n      // if Float16Array is not available, use 'Uint16Array' to store the data.\n      NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.set('float16', Uint16Array);\n    }\n  }\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {\n  CpuPinnedConstructorParameters,\n  GpuBufferConstructorParameters,\n  MLTensorConstructorParameters,\n  TextureConstructorParameters,\n} from './tensor-factory.js';\nimport { Tensor } from './tensor-impl.js';\n\n/**\n * calculate size from dims.\n *\n * @param dims the dims array. May be an illegal input.\n */\nexport const calculateSize = (dims: readonly unknown[]): number => {\n  let size = 1;\n  for (let i = 0; i < dims.length; i++) {\n    const dim = dims[i];\n    if (typeof dim !== 'number' || !Number.isSafeInteger(dim)) {\n      throw new TypeError(`dims[${i}] must be an integer, got: ${dim}`);\n    }\n    if (dim < 0) {\n      throw new RangeError(`dims[${i}] must be a non-negative integer, got: ${dim}`);\n    }\n    size *= dim;\n  }\n  return size;\n};\n\n/**\n * implementation of Tensor.reshape()\n */\nexport const tensorReshape = (tensor: Tensor, dims: readonly number[]): Tensor => {\n  switch (tensor.location) {\n    case 'cpu':\n      return new Tensor(tensor.type, tensor.data, dims);\n    case 'cpu-pinned':\n      return new Tensor({\n        location: 'cpu-pinned',\n        data: tensor.data as CpuPinnedConstructorParameters['data'],\n        type: tensor.type as CpuPinnedConstructorParameters['type'],\n        dims,\n      });\n    case 'texture':\n      return new Tensor({\n        location: 'texture',\n        texture: tensor.texture,\n        type: tensor.type as TextureConstructorParameters['type'],\n        dims,\n      });\n    case 'gpu-buffer':\n      return new Tensor({\n        location: 'gpu-buffer',\n        gpuBuffer: tensor.gpuBuffer,\n        type: tensor.type as GpuBufferConstructorParameters['type'],\n        dims,\n      });\n    case 'ml-tensor':\n      return new Tensor({\n        location: 'ml-tensor',\n        mlTensor: tensor.mlTensor,\n        type: tensor.type as MLTensorConstructorParameters['type'],\n        dims,\n      });\n    default:\n      throw new Error(`tensorReshape: tensor location ${tensor.location} is not supported`);\n  }\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { tensorToDataURL, tensorToImageData } from './tensor-conversion-impl.js';\nimport { TensorToDataUrlOptions, TensorToImageDataOptions } from './tensor-conversion.js';\nimport {\n  tensorFromGpuBuffer,\n  tensorFromImage,\n  tensorFromMLTensor,\n  tensorFromPinnedBuffer,\n  tensorFromTexture,\n} from './tensor-factory-impl.js';\nimport {\n  CpuPinnedConstructorParameters,\n  GpuBufferConstructorParameters,\n  MLTensorConstructorParameters,\n  TensorFromGpuBufferOptions,\n  TensorFromImageBitmapOptions,\n  TensorFromImageDataOptions,\n  TensorFromImageElementOptions,\n  TensorFromMLTensorOptions,\n  TensorFromTextureOptions,\n  TensorFromUrlOptions,\n  TextureConstructorParameters,\n} from './tensor-factory.js';\nimport {\n  checkTypedArray,\n  NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP,\n  NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP,\n  SupportedTypedArray,\n  SupportedTypedArrayConstructors,\n} from './tensor-impl-type-mapping.js';\nimport { calculateSize, tensorReshape } from './tensor-utils-impl.js';\nimport { Tensor as TensorInterface } from './tensor.js';\n\n// type aliases for those exported from Tensor interface\n\ntype TensorType = TensorInterface.Type;\ntype TensorDataType = TensorInterface.DataType;\ntype TensorDataLocation = TensorInterface.DataLocation;\ntype TensorTextureType = TensorInterface.TextureType;\ntype TensorGpuBufferType = TensorInterface.GpuBufferType;\ntype TensorMLTensorType = TensorInterface.MLTensorType;\n\n/**\n * the implementation of Tensor interface.\n *\n * @ignore\n */\nexport class Tensor implements TensorInterface {\n  // #region constructors\n\n  /**\n   * Construct a new CPU tensor object from the given type, data and dims.\n   */\n  constructor(\n    type: TensorType,\n    data: TensorDataType | Uint8ClampedArray | readonly string[] | readonly number[] | readonly boolean[],\n    dims?: readonly number[],\n  );\n  /**\n   * Construct a new CPU tensor object from the given data and dims. Type is inferred from data.\n   */\n  constructor(\n    data: TensorDataType | Uint8ClampedArray | readonly string[] | readonly boolean[],\n    dims?: readonly number[],\n  );\n  /**\n   * Construct a new tensor object from the pinned CPU data with the given type and dims.\n   *\n   * Tensor's location will be set to 'cpu-pinned'.\n   *\n   * @param params - Specify the parameters to construct the tensor.\n   */\n  constructor(params: CpuPinnedConstructorParameters);\n  /**\n   * Construct a new tensor object from the WebGL texture with the given type and dims.\n   *\n   * Tensor's location will be set to 'texture'.\n   *\n   * @param params - Specify the parameters to construct the tensor.\n   */\n  constructor(params: TextureConstructorParameters);\n  /**\n   * Construct a new tensor object from the WebGPU buffer with the given type and dims.\n   *\n   * Tensor's location will be set to 'gpu-buffer'.\n   *\n   * @param params - Specify the parameters to construct the tensor.\n   */\n  constructor(params: GpuBufferConstructorParameters);\n\n  /**\n   * Construct a new tensor object from the WebNN MLTensor with the given type and dims.\n   *\n   * Tensor's location will be set to 'ml-tensor'.\n   *\n   * @param params - Specify the parameters to construct the tensor.\n   */\n  constructor(params: MLTensorConstructorParameters);\n\n  /**\n   * implementation.\n   */\n  constructor(\n    arg0:\n      | TensorType\n      | TensorDataType\n      | Uint8ClampedArray\n      | readonly string[]\n      | readonly boolean[]\n      | CpuPinnedConstructorParameters\n      | TextureConstructorParameters\n      | GpuBufferConstructorParameters\n      | MLTensorConstructorParameters,\n    arg1?: TensorDataType | Uint8ClampedArray | readonly number[] | readonly string[] | readonly boolean[],\n    arg2?: readonly number[],\n  ) {\n    // perform one-time check for BigInt/Float16Array support\n    checkTypedArray();\n\n    let type: TensorType;\n    let dims: readonly number[];\n\n    if (typeof arg0 === 'object' && 'location' in arg0) {\n      //\n      // constructing tensor from specific location\n      //\n      this.dataLocation = arg0.location;\n      type = arg0.type;\n      dims = arg0.dims;\n      switch (arg0.location) {\n        case 'cpu-pinned': {\n          const expectedTypedArrayConstructor = NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(type);\n          if (!expectedTypedArrayConstructor) {\n            throw new TypeError(`unsupported type \"${type}\" to create tensor from pinned buffer`);\n          }\n          if (!(arg0.data instanceof expectedTypedArrayConstructor)) {\n            throw new TypeError(`buffer should be of type ${expectedTypedArrayConstructor.name}`);\n          }\n          this.cpuData = arg0.data;\n          break;\n        }\n        case 'texture': {\n          if (type !== 'float32') {\n            throw new TypeError(`unsupported type \"${type}\" to create tensor from texture`);\n          }\n          this.gpuTextureData = arg0.texture;\n          this.downloader = arg0.download;\n          this.disposer = arg0.dispose;\n          break;\n        }\n        case 'gpu-buffer': {\n          if (\n            type !== 'float32' &&\n            type !== 'float16' &&\n            type !== 'int32' &&\n            type !== 'int64' &&\n            type !== 'uint32' &&\n            type !== 'uint8' &&\n            type !== 'bool' &&\n            type !== 'uint4' &&\n            type !== 'int4'\n          ) {\n            throw new TypeError(`unsupported type \"${type}\" to create tensor from gpu buffer`);\n          }\n          this.gpuBufferData = arg0.gpuBuffer;\n          this.downloader = arg0.download;\n          this.disposer = arg0.dispose;\n          break;\n        }\n        case 'ml-tensor': {\n          if (\n            type !== 'float32' &&\n            type !== 'float16' &&\n            type !== 'int32' &&\n            type !== 'int64' &&\n            type !== 'uint32' &&\n            type !== 'uint64' &&\n            type !== 'int8' &&\n            type !== 'uint8' &&\n            type !== 'bool' &&\n            type !== 'uint4' &&\n            type !== 'int4'\n          ) {\n            throw new TypeError(`unsupported type \"${type}\" to create tensor from MLTensor`);\n          }\n          this.mlTensorData = arg0.mlTensor;\n          this.downloader = arg0.download;\n          this.disposer = arg0.dispose;\n          break;\n        }\n        default:\n          throw new Error(`Tensor constructor: unsupported location '${this.dataLocation}'`);\n      }\n    } else {\n      //\n      // constructing tensor of location 'cpu'\n      //\n      let data: TensorDataType;\n      let maybeDims: typeof arg1 | typeof arg2;\n      // check whether arg0 is type or data\n      if (typeof arg0 === 'string') {\n        //\n        // Override: constructor(type, data, ...)\n        //\n        type = arg0;\n        maybeDims = arg2;\n        if (arg0 === 'string') {\n          // string tensor\n          if (!Array.isArray(arg1)) {\n            throw new TypeError(\"A string tensor's data must be a string array.\");\n          }\n          // we don't check whether every element in the array is string; this is too slow. we assume it's correct and\n          // error will be populated at inference\n          data = arg1;\n        } else {\n          // numeric tensor\n          const typedArrayConstructor = NUMERIC_TENSOR_TYPE_TO_TYPEDARRAY_MAP.get(arg0);\n          if (typedArrayConstructor === undefined) {\n            throw new TypeError(`Unsupported tensor type: ${arg0}.`);\n          }\n          if (Array.isArray(arg1)) {\n            if ((arg0 === 'float16' && typedArrayConstructor === Uint16Array) || arg0 === 'uint4' || arg0 === 'int4') {\n              // - 'float16':\n              //   When no Float16Array polyfill is used, we cannot create 'float16' tensor from number array.\n              //\n              //   Throw error here because when user try to use number array as data,\n              //   e.g. new Tensor('float16', [1, 2, 3, 4], dims)), it will actually call\n              //   Uint16Array.from(arg1) which generates wrong data.\n              //\n              // - 'uint4' and 'int4':\n              //   Uint8Array.from(arg1) will generate wrong data for 'uint4' and 'int4' tensor.\n              //\n              throw new TypeError(\n                `Creating a ${arg0} tensor from number array is not supported. Please use ${typedArrayConstructor.name} as data.`,\n              );\n            } else if (arg0 === 'uint64' || arg0 === 'int64') {\n              // use 'as any' here because:\n              // 1. TypeScript's check on type of 'Array.isArray()' does not work with readonly arrays.\n              // see https://github.com/microsoft/TypeScript/issues/17002\n              // 2. TypeScript's check on union type of '(BigInt64ArrayConstructor|BigUint64ArrayConstructor).from()'\n              // does not accept parameter mapFn.\n              // 3. parameters of 'SupportedTypedArrayConstructors.from()' does not match the requirement of the union\n              // type.\n\n              // assume 'arg1' is of type \"readonly number[]|readonly bigint[]\" here.\n\n              // eslint-disable-next-line @typescript-eslint/no-explicit-any\n              data = (typedArrayConstructor as any).from(arg1, BigInt);\n            } else {\n              // assume 'arg1' is of type \"readonly number[]\" here.\n              // eslint-disable-next-line @typescript-eslint/no-explicit-any\n              data = (typedArrayConstructor as any).from(arg1);\n            }\n          } else if (arg1 instanceof typedArrayConstructor) {\n            data = arg1;\n          } else if (arg1 instanceof Uint8ClampedArray) {\n            if (arg0 === 'uint8') {\n              data = Uint8Array.from(arg1);\n            } else {\n              throw new TypeError(`A Uint8ClampedArray tensor's data must be type of uint8`);\n            }\n          } else if (arg0 === 'float16' && arg1 instanceof Uint16Array && typedArrayConstructor !== Uint16Array) {\n            // when Float16Array is available and data is of type Uint16Array.\n            // We allow Uint16Array to be passed in as data for 'float16' tensor until Float16Array is generally\n            // supported in JavaScript environment.\n\n            // eslint-disable-next-line @typescript-eslint/no-explicit-any\n            data = new (globalThis as any).Float16Array(arg1.buffer, arg1.byteOffset, arg1.length);\n          } else {\n            throw new TypeError(`A ${type} tensor's data must be type of ${typedArrayConstructor}`);\n          }\n        }\n      } else {\n        //\n        // Override: constructor(data, ...)\n        //\n        maybeDims = arg1;\n        if (Array.isArray(arg0)) {\n          // only boolean[] and string[] is supported\n          if (arg0.length === 0) {\n            throw new TypeError('Tensor type cannot be inferred from an empty array.');\n          }\n          const firstElementType = typeof arg0[0];\n          if (firstElementType === 'string') {\n            type = 'string';\n            data = arg0;\n          } else if (firstElementType === 'boolean') {\n            type = 'bool';\n            // 'arg0' is of type 'boolean[]'. Uint8Array.from(boolean[]) actually works, but typescript thinks this is\n            // wrong type. We use 'as any' to make it happy.\n            // eslint-disable-next-line @typescript-eslint/no-explicit-any\n            data = Uint8Array.from(arg0 as any[]);\n          } else {\n            throw new TypeError(`Invalid element type of data array: ${firstElementType}.`);\n          }\n        } else if (arg0 instanceof Uint8ClampedArray) {\n          type = 'uint8';\n          data = Uint8Array.from(arg0);\n        } else {\n          // get tensor type from TypedArray\n          const mappedType = NUMERIC_TENSOR_TYPEDARRAY_TO_TYPE_MAP.get(\n            arg0.constructor as SupportedTypedArrayConstructors,\n          );\n          if (mappedType === undefined) {\n            throw new TypeError(`Unsupported type for tensor data: ${arg0.constructor}.`);\n          }\n          type = mappedType;\n          data = arg0 as SupportedTypedArray;\n        }\n      }\n\n      // type and data is processed, now processing dims\n      if (maybeDims === undefined) {\n        // assume 1-D tensor if dims omitted\n        maybeDims = [data.length];\n      } else if (!Array.isArray(maybeDims)) {\n        throw new TypeError(\"A tensor's dims must be a number array\");\n      }\n      dims = maybeDims as readonly number[];\n\n      this.cpuData = data;\n      this.dataLocation = 'cpu';\n    }\n\n    // perform check on dims\n    const size = calculateSize(dims);\n    // if data is on CPU, check whether data length matches tensor size\n    if (this.cpuData && size !== this.cpuData.length) {\n      if ((type === 'uint4' || type === 'int4') && Math.ceil(size / 2) === this.cpuData.length) {\n        // for (u)int4, the data length is half of the tensor size. So we check this special case when size is odd.\n      } else {\n        throw new Error(`Tensor's size(${size}) does not match data length(${this.cpuData.length}).`);\n      }\n    }\n\n    this.type = type;\n    this.dims = dims;\n    this.size = size;\n  }\n  // #endregion\n\n  // #region factory\n  static async fromImage(\n    image: ImageData | HTMLImageElement | ImageBitmap | string,\n    options?:\n      | TensorFromImageDataOptions\n      | TensorFromImageElementOptions\n      | TensorFromImageBitmapOptions\n      | TensorFromUrlOptions,\n  ): Promise<TensorInterface> {\n    return tensorFromImage(image, options);\n  }\n\n  static fromTexture<T extends TensorInterface.TextureDataTypes>(\n    texture: TensorTextureType,\n    options: TensorFromTextureOptions<T>,\n  ): TensorInterface {\n    return tensorFromTexture(texture, options);\n  }\n\n  static fromGpuBuffer<T extends TensorInterface.GpuBufferDataTypes>(\n    gpuBuffer: TensorGpuBufferType,\n    options: TensorFromGpuBufferOptions<T>,\n  ): TensorInterface {\n    return tensorFromGpuBuffer(gpuBuffer, options);\n  }\n\n  static fromMLTensor<T extends TensorInterface.MLTensorDataTypes>(\n    mlTensor: TensorMLTensorType,\n    options: TensorFromMLTensorOptions<T>,\n  ): TensorInterface {\n    return tensorFromMLTensor(mlTensor, options);\n  }\n\n  static fromPinnedBuffer<T extends TensorInterface.CpuPinnedDataTypes>(\n    type: T,\n    buffer: TensorInterface.DataTypeMap[T],\n    dims?: readonly number[],\n  ): Tensor {\n    return tensorFromPinnedBuffer(type, buffer, dims);\n  }\n\n  // #endregion\n\n  // #region conversions\n  toDataURL(options?: TensorToDataUrlOptions): string {\n    return tensorToDataURL(this, options);\n  }\n\n  toImageData(options?: TensorToImageDataOptions): ImageData {\n    return tensorToImageData(this, options);\n  }\n  // #endregion\n\n  // #region public fields\n  readonly dims: readonly number[];\n  readonly type: TensorType;\n  readonly size: number;\n  // #endregion\n\n  // #region private fields\n\n  /**\n   * stores the location of the data.\n   */\n  private dataLocation: TensorDataLocation;\n\n  /**\n   * stores the data on CPU, if location is 'cpu' or 'cpu-pinned'. otherwise empty.\n   */\n  private cpuData?: TensorDataType;\n\n  /**\n   * stores the underlying texture when location is 'texture'. otherwise empty.\n   */\n  private gpuTextureData?: TensorTextureType;\n\n  /**\n   * stores the underlying GPU buffer when location is 'gpu-buffer'. otherwise empty.\n   */\n  private gpuBufferData?: TensorGpuBufferType;\n\n  /**\n   * stores the underlying WebNN MLTensor when location is 'ml-tensor'. otherwise empty.\n   */\n  private mlTensorData?: TensorMLTensorType;\n\n  /**\n   * stores an optional downloader function to download data from GPU to CPU.\n   */\n  private downloader?(): Promise<TensorDataType>;\n\n  /**\n   * a flag indicating whether the data is being downloaded from GPU to CPU.\n   */\n  private isDownloading?: boolean;\n\n  /**\n   * stores an optional disposer function to dispose the underlying data.\n   */\n  private disposer?(): void;\n  // #endregion\n\n  // #region properties\n  get data(): TensorDataType {\n    this.ensureValid();\n    if (!this.cpuData) {\n      throw new Error(\n        'The data is not on CPU. Use `getData()` to download GPU data to CPU, ' +\n          'or use `texture` or `gpuBuffer` property to access the GPU data directly.',\n      );\n    }\n    return this.cpuData;\n  }\n\n  get location(): TensorDataLocation {\n    return this.dataLocation;\n  }\n\n  get texture(): TensorTextureType {\n    this.ensureValid();\n    if (!this.gpuTextureData) {\n      throw new Error('The data is not stored as a WebGL texture.');\n    }\n    return this.gpuTextureData;\n  }\n\n  get gpuBuffer(): TensorGpuBufferType {\n    this.ensureValid();\n    if (!this.gpuBufferData) {\n      throw new Error('The data is not stored as a WebGPU buffer.');\n    }\n    return this.gpuBufferData;\n  }\n\n  get mlTensor(): TensorMLTensorType {\n    this.ensureValid();\n    if (!this.mlTensorData) {\n      throw new Error('The data is not stored as a WebNN MLTensor.');\n    }\n    return this.mlTensorData;\n  }\n  // #endregion\n\n  // #region methods\n\n  async getData(releaseData?: boolean): Promise<TensorDataType> {\n    this.ensureValid();\n    switch (this.dataLocation) {\n      case 'cpu':\n      case 'cpu-pinned':\n        return this.data;\n      case 'texture':\n      case 'gpu-buffer':\n      case 'ml-tensor': {\n        if (!this.downloader) {\n          throw new Error('The current tensor is not created with a specified data downloader.');\n        }\n        if (this.isDownloading) {\n          throw new Error('The current tensor is being downloaded.');\n        }\n        try {\n          this.isDownloading = true;\n          const data = await this.downloader();\n          this.downloader = undefined;\n          this.dataLocation = 'cpu';\n          this.cpuData = data;\n\n          if (releaseData && this.disposer) {\n            this.disposer();\n            this.disposer = undefined;\n          }\n\n          return data;\n        } finally {\n          this.isDownloading = false;\n        }\n      }\n      default:\n        throw new Error(`cannot get data from location: ${this.dataLocation}`);\n    }\n  }\n\n  dispose(): void {\n    if (this.isDownloading) {\n      throw new Error('The current tensor is being downloaded.');\n    }\n\n    if (this.disposer) {\n      this.disposer();\n      this.disposer = undefined;\n    }\n    this.cpuData = undefined;\n    this.gpuTextureData = undefined;\n    this.gpuBufferData = undefined;\n    this.mlTensorData = undefined;\n    this.downloader = undefined;\n    this.isDownloading = undefined;\n\n    this.dataLocation = 'none';\n  }\n\n  // #endregion\n\n  // #region tensor utilities\n  private ensureValid(): void {\n    if (this.dataLocation === 'none') {\n      throw new Error('The tensor is disposed.');\n    }\n  }\n\n  reshape(dims: readonly number[]): TensorInterface {\n    this.ensureValid();\n    if (this.downloader || this.disposer) {\n      throw new Error('Cannot reshape a tensor that owns GPU resource.');\n    }\n    return tensorReshape(this, dims);\n  }\n  // #endregion\n}\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { TensorFactory } from './tensor-factory.js';\nimport { Tensor as TensorImpl } from './tensor-impl.js';\nimport { TypedTensorUtils } from './tensor-utils.js';\nimport { TryGetGlobalType } from './type-helper.js';\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\n/**\n * represent a basic tensor with specified dimensions and data type.\n */\ninterface TypedTensorBase<T extends Tensor.Type> {\n  /**\n   * Get the dimensions of the tensor.\n   */\n  readonly dims: readonly number[];\n  /**\n   * Get the data type of the tensor.\n   */\n  readonly type: T;\n  /**\n   * Get the buffer data of the tensor.\n   *\n   * If the data is not on CPU (eg. it's in the form of WebGL texture or WebGPU buffer), throw error.\n   */\n  readonly data: Tensor.DataTypeMap[T];\n  /**\n   * Get the location of the data.\n   */\n  readonly location: Tensor.DataLocation;\n  /**\n   * Get the WebGL texture that holds the tensor data.\n   *\n   * If the data is not on GPU as WebGL texture, throw error.\n   */\n  readonly texture: Tensor.TextureType;\n  /**\n   * Get the WebGPU buffer that holds the tensor data.\n   *\n   * If the data is not on GPU as WebGPU buffer, throw error.\n   */\n  readonly gpuBuffer: Tensor.GpuBufferType;\n\n  /**\n   * Get the WebNN MLTensor that holds the tensor data.\n   *\n   * If the data is not in a WebNN MLTensor, throw error.\n   */\n  readonly mlTensor: Tensor.MLTensorType;\n\n  /**\n   * Get the buffer data of the tensor.\n   *\n   * If the data is on CPU, returns the data immediately.\n   * If the data is on GPU, downloads the data and returns the promise.\n   *\n   * @param releaseData - whether release the data on GPU. Ignore if data is already on CPU.\n   */\n  getData(releaseData?: boolean): Promise<Tensor.DataTypeMap[T]>;\n\n  /**\n   * Dispose the tensor data.\n   *\n   * If the data is on CPU, remove its internal reference to the underlying data.\n   * If the data is on GPU, release the data on GPU.\n   *\n   * After calling this function, the tensor is considered no longer valid. Its location will be set to 'none'.\n   */\n  dispose(): void;\n}\n\nexport declare namespace Tensor {\n  interface DataTypeMap {\n    float32: Float32Array;\n    uint8: Uint8Array;\n    int8: Int8Array;\n    uint16: Uint16Array;\n    int16: Int16Array;\n    int32: Int32Array;\n    int64: BigInt64Array;\n    string: string[];\n    bool: Uint8Array;\n    float16: Uint16Array; // Keep using Uint16Array until we have a concrete solution for float 16.\n    float64: Float64Array;\n    uint32: Uint32Array;\n    uint64: BigUint64Array;\n    // complex64: never;\n    // complex128: never;\n    // bfloat16: never;\n    uint4: Uint8Array;\n    int4: Int8Array;\n  }\n\n  interface ElementTypeMap {\n    float32: number;\n    uint8: number;\n    int8: number;\n    uint16: number;\n    int16: number;\n    int32: number;\n    int64: bigint;\n    string: string;\n    bool: boolean;\n    float16: number; // Keep using Uint16Array until we have a concrete solution for float 16.\n    float64: number;\n    uint32: number;\n    uint64: bigint;\n    // complex64: never;\n    // complex128: never;\n    // bfloat16: never;\n    uint4: number;\n    int4: number;\n  }\n\n  type DataType = DataTypeMap[Type];\n  type ElementType = ElementTypeMap[Type];\n\n  /**\n   * supported data types for constructing a tensor from a pinned CPU buffer\n   */\n  export type CpuPinnedDataTypes = Exclude<Tensor.Type, 'string'>;\n\n  /**\n   * type alias for WebGL texture\n   */\n  export type TextureType = WebGLTexture;\n\n  /**\n   * supported data types for constructing a tensor from a WebGL texture\n   */\n  export type TextureDataTypes = 'float32';\n\n  type GpuBufferTypeFallback = { size: number; mapState: 'unmapped' | 'pending' | 'mapped' };\n  /**\n   * type alias for WebGPU buffer\n   */\n  export type GpuBufferType = TryGetGlobalType<'GPUBuffer', GpuBufferTypeFallback>;\n\n  type MLTensorTypeFallback = { destroy(): void };\n  /**\n   * type alias for WebNN MLTensor\n   *\n   * The specification for WebNN's MLTensor is currently in flux.\n   */\n  export type MLTensorType = TryGetGlobalType<'MLTensor', MLTensorTypeFallback>;\n\n  /**\n   * supported data types for constructing a tensor from a WebGPU buffer\n   */\n  export type GpuBufferDataTypes = 'float32' | 'float16' | 'int32' | 'int64' | 'uint32' | 'uint8' | 'bool';\n\n  /**\n   * supported data types for constructing a tensor from a WebNN MLTensor\n   */\n  export type MLTensorDataTypes =\n    | 'float32'\n    | 'float16'\n    | 'int8'\n    | 'uint8'\n    | 'int32'\n    | 'uint32'\n    | 'int64'\n    | 'uint64'\n    | 'bool'\n    | 'uint4'\n    | 'int4';\n\n  /**\n   * represent where the tensor data is stored\n   */\n  export type DataLocation = 'none' | 'cpu' | 'cpu-pinned' | 'texture' | 'gpu-buffer' | 'ml-tensor';\n\n  /**\n   * represent the data type of a tensor\n   */\n  export type Type = keyof DataTypeMap;\n}\n\n/**\n * Represent multi-dimensional arrays to feed to or fetch from model inferencing.\n */\nexport interface TypedTensor<T extends Tensor.Type> extends TypedTensorBase<T>, TypedTensorUtils<T> {}\n/**\n * Represent multi-dimensional arrays to feed to or fetch from model inferencing.\n */\nexport interface Tensor extends TypedTensorBase<Tensor.Type>, TypedTensorUtils<Tensor.Type> {}\n\n/**\n * type TensorConstructor defines the constructors of 'Tensor' to create CPU tensor instances.\n */\nexport interface TensorConstructor extends TensorFactory {\n  // #region CPU tensor - specify element type\n  /**\n   * Construct a new string tensor object from the given type, data and dims.\n   *\n   * @param type - Specify the element type.\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (\n    type: 'string',\n    data: Tensor.DataTypeMap['string'] | readonly string[],\n    dims?: readonly number[],\n  ): TypedTensor<'string'>;\n\n  /**\n   * Construct a new bool tensor object from the given type, data and dims.\n   *\n   * @param type - Specify the element type.\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (\n    type: 'bool',\n    data: Tensor.DataTypeMap['bool'] | readonly boolean[],\n    dims?: readonly number[],\n  ): TypedTensor<'bool'>;\n\n  /**\n   * Construct a new uint8 tensor object from a Uint8ClampedArray, data and dims.\n   *\n   * @param type - Specify the element type.\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (type: 'uint8', data: Uint8ClampedArray, dims?: readonly number[]): TypedTensor<'uint8'>;\n\n  /**\n   * Construct a new 64-bit integer typed tensor object from the given type, data and dims.\n   *\n   * @param type - Specify the element type.\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new <T extends 'uint64' | 'int64'>(\n    type: T,\n    data: Tensor.DataTypeMap[T] | readonly bigint[] | readonly number[],\n    dims?: readonly number[],\n  ): TypedTensor<T>;\n\n  /**\n   * Construct a new numeric tensor object from the given type, data and dims.\n   *\n   * @param type - Specify the element type.\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new <T extends Exclude<Tensor.Type, 'string' | 'bool' | 'uint64' | 'int64'>>(\n    type: T,\n    data: Tensor.DataTypeMap[T] | readonly number[],\n    dims?: readonly number[],\n  ): TypedTensor<T>;\n  // #endregion\n\n  // #region CPU tensor - infer element types\n\n  /**\n   * Construct a new float32 tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: Float32Array, dims?: readonly number[]): TypedTensor<'float32'>;\n\n  /**\n   * Construct a new int8 tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: Int8Array, dims?: readonly number[]): TypedTensor<'int8'>;\n\n  /**\n   * Construct a new uint8 tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: Uint8Array, dims?: readonly number[]): TypedTensor<'uint8'>;\n\n  /**\n   * Construct a new uint8 tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: Uint8ClampedArray, dims?: readonly number[]): TypedTensor<'uint8'>;\n\n  /**\n   * Construct a new uint16 tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: Uint16Array, dims?: readonly number[]): TypedTensor<'uint16'>;\n\n  /**\n   * Construct a new int16 tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: Int16Array, dims?: readonly number[]): TypedTensor<'int16'>;\n\n  /**\n   * Construct a new int32 tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: Int32Array, dims?: readonly number[]): TypedTensor<'int32'>;\n\n  /**\n   * Construct a new int64 tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: BigInt64Array, dims?: readonly number[]): TypedTensor<'int64'>;\n\n  /**\n   * Construct a new string tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: readonly string[], dims?: readonly number[]): TypedTensor<'string'>;\n\n  /**\n   * Construct a new bool tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: readonly boolean[], dims?: readonly number[]): TypedTensor<'bool'>;\n\n  /**\n   * Construct a new float64 tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: Float64Array, dims?: readonly number[]): TypedTensor<'float64'>;\n\n  /**\n   * Construct a new uint32 tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: Uint32Array, dims?: readonly number[]): TypedTensor<'uint32'>;\n\n  /**\n   * Construct a new uint64 tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: BigUint64Array, dims?: readonly number[]): TypedTensor<'uint64'>;\n\n  // #endregion\n\n  // #region CPU tensor - fall back to non-generic tensor type declaration\n\n  /**\n   * Construct a new tensor object from the given type, data and dims.\n   *\n   * @param type - Specify the element type.\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (\n    type: Tensor.Type,\n    data: Tensor.DataType | readonly number[] | readonly string[] | readonly bigint[] | readonly boolean[],\n    dims?: readonly number[],\n  ): Tensor;\n\n  /**\n   * Construct a new tensor object from the given data and dims.\n   *\n   * @param data - Specify the CPU tensor data.\n   * @param dims - Specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   */\n  new (data: Tensor.DataType, dims?: readonly number[]): Tensor;\n  // #endregion\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const Tensor = TensorImpl as TensorConstructor;\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { env } from './env-impl.js';\n\n/**\n * @ignore\n */\nexport const TRACE = (deviceType: string, label: string) => {\n  if (typeof env.trace === 'undefined' ? !env.wasm.trace : !env.trace) {\n    return;\n  }\n  // eslint-disable-next-line no-console\n  console.timeStamp(`${deviceType}::ORT::${label}`);\n};\n\nconst TRACE_FUNC = (msg: string, extraMsg?: string) => {\n  const stack = new Error().stack?.split(/\\r\\n|\\r|\\n/g) || [];\n  let hasTraceFunc = false;\n  for (let i = 0; i < stack.length; i++) {\n    if (hasTraceFunc && !stack[i].includes('TRACE_FUNC')) {\n      let label = `FUNC_${msg}::${stack[i].trim().split(' ')[1]}`;\n      if (extraMsg) {\n        label += `::${extraMsg}`;\n      }\n      TRACE('CPU', label);\n      return;\n    }\n    if (stack[i].includes('TRACE_FUNC')) {\n      hasTraceFunc = true;\n    }\n  }\n};\n\n/**\n * @ignore\n */\nexport const TRACE_FUNC_BEGIN = (extraMsg?: string) => {\n  if (typeof env.trace === 'undefined' ? !env.wasm.trace : !env.trace) {\n    return;\n  }\n  TRACE_FUNC('BEGIN', extraMsg);\n};\n\n/**\n * @ignore\n */\nexport const TRACE_FUNC_END = (extraMsg?: string) => {\n  if (typeof env.trace === 'undefined' ? !env.wasm.trace : !env.trace) {\n    return;\n  }\n  TRACE_FUNC('END', extraMsg);\n};\n\n/**\n * @ignore\n */\nexport const TRACE_EVENT_BEGIN = (extraMsg?: string) => {\n  if (typeof env.trace === 'undefined' ? !env.wasm.trace : !env.trace) {\n    return;\n  }\n  // eslint-disable-next-line no-console\n  console.time(`ORT::${extraMsg}`);\n};\n\n/**\n * @ignore\n */\nexport const TRACE_EVENT_END = (extraMsg?: string) => {\n  if (typeof env.trace === 'undefined' ? !env.wasm.trace : !env.trace) {\n    return;\n  }\n  // eslint-disable-next-line no-console\n  console.timeEnd(`ORT::${extraMsg}`);\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { resolveBackendAndExecutionProviders } from './backend-impl.js';\nimport { InferenceSessionHandler } from './backend.js';\nimport { InferenceSession as InferenceSessionInterface } from './inference-session.js';\nimport { OnnxValue } from './onnx-value.js';\nimport { Tensor } from './tensor.js';\nimport { TRACE_FUNC_BEGIN, TRACE_FUNC_END, TRACE_EVENT_BEGIN, TRACE_EVENT_END } from './trace.js';\n\ntype SessionOptions = InferenceSessionInterface.SessionOptions;\ntype RunOptions = InferenceSessionInterface.RunOptions;\ntype FeedsType = InferenceSessionInterface.FeedsType;\ntype FetchesType = InferenceSessionInterface.FetchesType;\ntype ReturnType = InferenceSessionInterface.ReturnType;\n\nexport class InferenceSession implements InferenceSessionInterface {\n  private constructor(handler: InferenceSessionHandler) {\n    this.handler = handler;\n  }\n  run(feeds: FeedsType, options?: RunOptions): Promise<ReturnType>;\n  run(feeds: FeedsType, fetches: FetchesType, options?: RunOptions): Promise<ReturnType>;\n  async run(feeds: FeedsType, arg1?: FetchesType | RunOptions, arg2?: RunOptions): Promise<ReturnType> {\n    TRACE_FUNC_BEGIN();\n    TRACE_EVENT_BEGIN('InferenceSession.run');\n    const fetches: { [name: string]: OnnxValue | null } = {};\n    let options: RunOptions = {};\n    // check inputs\n    if (typeof feeds !== 'object' || feeds === null || feeds instanceof Tensor || Array.isArray(feeds)) {\n      throw new TypeError(\n        \"'feeds' must be an object that use input names as keys and OnnxValue as corresponding values.\",\n      );\n    }\n\n    let isFetchesEmpty = true;\n    // determine which override is being used\n    if (typeof arg1 === 'object') {\n      if (arg1 === null) {\n        throw new TypeError('Unexpected argument[1]: cannot be null.');\n      }\n      if (arg1 instanceof Tensor) {\n        throw new TypeError(\"'fetches' cannot be a Tensor\");\n      }\n\n      if (Array.isArray(arg1)) {\n        if (arg1.length === 0) {\n          throw new TypeError(\"'fetches' cannot be an empty array.\");\n        }\n        isFetchesEmpty = false;\n        // output names\n        for (const name of arg1) {\n          if (typeof name !== 'string') {\n            throw new TypeError(\"'fetches' must be a string array or an object.\");\n          }\n          if (this.outputNames.indexOf(name) === -1) {\n            throw new RangeError(`'fetches' contains invalid output name: ${name}.`);\n          }\n          fetches[name] = null;\n        }\n\n        if (typeof arg2 === 'object' && arg2 !== null) {\n          options = arg2;\n        } else if (typeof arg2 !== 'undefined') {\n          throw new TypeError(\"'options' must be an object.\");\n        }\n      } else {\n        // decide whether arg1 is fetches or options\n        // if any output name is present and its value is valid OnnxValue, we consider it fetches\n        let isFetches = false;\n        const arg1Keys = Object.getOwnPropertyNames(arg1);\n        for (const name of this.outputNames) {\n          if (arg1Keys.indexOf(name) !== -1) {\n            const v = (arg1 as InferenceSessionInterface.NullableOnnxValueMapType)[name];\n            if (v === null || v instanceof Tensor) {\n              isFetches = true;\n              isFetchesEmpty = false;\n              fetches[name] = v;\n            }\n          }\n        }\n\n        if (isFetches) {\n          if (typeof arg2 === 'object' && arg2 !== null) {\n            options = arg2;\n          } else if (typeof arg2 !== 'undefined') {\n            throw new TypeError(\"'options' must be an object.\");\n          }\n        } else {\n          options = arg1 as RunOptions;\n        }\n      }\n    } else if (typeof arg1 !== 'undefined') {\n      throw new TypeError(\"Unexpected argument[1]: must be 'fetches' or 'options'.\");\n    }\n\n    // check if all inputs are in feed\n    for (const name of this.inputNames) {\n      if (typeof feeds[name] === 'undefined') {\n        throw new Error(`input '${name}' is missing in 'feeds'.`);\n      }\n    }\n\n    // if no fetches is specified, we use the full output names list\n    if (isFetchesEmpty) {\n      for (const name of this.outputNames) {\n        fetches[name] = null;\n      }\n    }\n\n    // feeds, fetches and options are prepared\n\n    const results = await this.handler.run(feeds, fetches, options);\n    const returnValue: { [name: string]: OnnxValue } = {};\n    for (const key in results) {\n      if (Object.hasOwnProperty.call(results, key)) {\n        const result = results[key];\n        if (result instanceof Tensor) {\n          returnValue[key] = result;\n        } else {\n          returnValue[key] = new Tensor(result.type, result.data, result.dims);\n        }\n      }\n    }\n    TRACE_EVENT_END('InferenceSession.run');\n    TRACE_FUNC_END();\n    return returnValue;\n  }\n\n  async release(): Promise<void> {\n    return this.handler.dispose();\n  }\n\n  static create(path: string, options?: SessionOptions): Promise<InferenceSessionInterface>;\n  static create(buffer: ArrayBufferLike, options?: SessionOptions): Promise<InferenceSessionInterface>;\n  static create(\n    buffer: ArrayBufferLike,\n    byteOffset: number,\n    byteLength?: number,\n    options?: SessionOptions,\n  ): Promise<InferenceSessionInterface>;\n  static create(buffer: Uint8Array, options?: SessionOptions): Promise<InferenceSessionInterface>;\n  static async create(\n    arg0: string | ArrayBufferLike | Uint8Array,\n    arg1?: SessionOptions | number,\n    arg2?: number,\n    arg3?: SessionOptions,\n  ): Promise<InferenceSessionInterface> {\n    TRACE_FUNC_BEGIN();\n    TRACE_EVENT_BEGIN('InferenceSession.create');\n    // either load from a file or buffer\n    let filePathOrUint8Array: string | Uint8Array;\n    let options: SessionOptions = {};\n\n    if (typeof arg0 === 'string') {\n      filePathOrUint8Array = arg0;\n      if (typeof arg1 === 'object' && arg1 !== null) {\n        options = arg1;\n      } else if (typeof arg1 !== 'undefined') {\n        throw new TypeError(\"'options' must be an object.\");\n      }\n    } else if (arg0 instanceof Uint8Array) {\n      filePathOrUint8Array = arg0;\n      if (typeof arg1 === 'object' && arg1 !== null) {\n        options = arg1;\n      } else if (typeof arg1 !== 'undefined') {\n        throw new TypeError(\"'options' must be an object.\");\n      }\n    } else if (\n      arg0 instanceof ArrayBuffer ||\n      (typeof SharedArrayBuffer !== 'undefined' && arg0 instanceof SharedArrayBuffer)\n    ) {\n      const buffer = arg0;\n      let byteOffset = 0;\n      let byteLength = arg0.byteLength;\n      if (typeof arg1 === 'object' && arg1 !== null) {\n        options = arg1;\n      } else if (typeof arg1 === 'number') {\n        byteOffset = arg1;\n        if (!Number.isSafeInteger(byteOffset)) {\n          throw new RangeError(\"'byteOffset' must be an integer.\");\n        }\n        if (byteOffset < 0 || byteOffset >= buffer.byteLength) {\n          throw new RangeError(`'byteOffset' is out of range [0, ${buffer.byteLength}).`);\n        }\n        byteLength = arg0.byteLength - byteOffset;\n        if (typeof arg2 === 'number') {\n          byteLength = arg2;\n          if (!Number.isSafeInteger(byteLength)) {\n            throw new RangeError(\"'byteLength' must be an integer.\");\n          }\n          if (byteLength <= 0 || byteOffset + byteLength > buffer.byteLength) {\n            throw new RangeError(`'byteLength' is out of range (0, ${buffer.byteLength - byteOffset}].`);\n          }\n          if (typeof arg3 === 'object' && arg3 !== null) {\n            options = arg3;\n          } else if (typeof arg3 !== 'undefined') {\n            throw new TypeError(\"'options' must be an object.\");\n          }\n        } else if (typeof arg2 !== 'undefined') {\n          throw new TypeError(\"'byteLength' must be a number.\");\n        }\n      } else if (typeof arg1 !== 'undefined') {\n        throw new TypeError(\"'options' must be an object.\");\n      }\n      filePathOrUint8Array = new Uint8Array(buffer, byteOffset, byteLength);\n    } else {\n      throw new TypeError(\"Unexpected argument[0]: must be 'path' or 'buffer'.\");\n    }\n\n    // resolve backend, update session options with validated EPs, and create session handler\n    const [backend, optionsWithValidatedEPs] = await resolveBackendAndExecutionProviders(options);\n    const handler = await backend.createInferenceSessionHandler(filePathOrUint8Array, optionsWithValidatedEPs);\n    TRACE_EVENT_END('InferenceSession.create');\n    TRACE_FUNC_END();\n    return new InferenceSession(handler);\n  }\n\n  startProfiling(): void {\n    this.handler.startProfiling();\n  }\n  endProfiling(): void {\n    this.handler.endProfiling();\n  }\n\n  get inputNames(): readonly string[] {\n    return this.handler.inputNames;\n  }\n  get outputNames(): readonly string[] {\n    return this.handler.outputNames;\n  }\n\n  get inputMetadata(): readonly InferenceSessionInterface.ValueMetadata[] {\n    return this.handler.inputMetadata;\n  }\n\n  get outputMetadata(): readonly InferenceSessionInterface.ValueMetadata[] {\n    return this.handler.outputMetadata;\n  }\n\n  private handler: InferenceSessionHandler;\n}\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { InferenceSession as InferenceSessionImpl } from './inference-session-impl.js';\nimport { OnnxModelOptions } from './onnx-model.js';\nimport { OnnxValue, OnnxValueDataLocation } from './onnx-value.js';\nimport type { Tensor } from './tensor.js';\nimport { TryGetGlobalType } from './type-helper.js';\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\nexport declare namespace InferenceSession {\n  // #region input/output types\n\n  type OnnxValueMapType = { readonly [name: string]: OnnxValue };\n  type NullableOnnxValueMapType = { readonly [name: string]: OnnxValue | null };\n\n  /**\n   * A feeds (model inputs) is an object that uses input names as keys and OnnxValue as corresponding values.\n   */\n  type FeedsType = OnnxValueMapType;\n\n  /**\n   * A fetches (model outputs) could be one of the following:\n   *\n   * - Omitted. Use model's output names definition.\n   * - An array of string indicating the output names.\n   * - An object that use output names as keys and OnnxValue or null as corresponding values.\n   *\n   * @remarks\n   * different from input argument, in output, OnnxValue is optional. If an OnnxValue is present it will be\n   * used as a pre-allocated value by the inference engine; if omitted, inference engine will allocate buffer\n   * internally.\n   */\n  type FetchesType = readonly string[] | NullableOnnxValueMapType;\n\n  /**\n   * A inferencing return type is an object that uses output names as keys and OnnxValue as corresponding values.\n   */\n  type ReturnType = OnnxValueMapType;\n\n  // #endregion\n\n  // #region session options\n\n  /**\n   * A set of configurations for session behavior.\n   */\n  export interface SessionOptions extends OnnxModelOptions {\n    /**\n     * An array of execution provider options.\n     *\n     * An execution provider option can be a string indicating the name of the execution provider,\n     * or an object of corresponding type.\n     */\n    executionProviders?: readonly ExecutionProviderConfig[];\n\n    /**\n     * The intra OP threads number.\n     *\n     * This setting is available only in ONNXRuntime (Node.js binding and react-native).\n     */\n    intraOpNumThreads?: number;\n\n    /**\n     * The inter OP threads number.\n     *\n     * This setting is available only in ONNXRuntime (Node.js binding and react-native).\n     */\n    interOpNumThreads?: number;\n\n    /**\n     * The free dimension override.\n     *\n     * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n     */\n    freeDimensionOverrides?: { readonly [dimensionName: string]: number };\n\n    /**\n     * The optimization level.\n     *\n     * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n     */\n    graphOptimizationLevel?: 'disabled' | 'basic' | 'extended' | 'layout' | 'all';\n\n    /**\n     * Whether enable CPU memory arena.\n     *\n     * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n     */\n    enableCpuMemArena?: boolean;\n\n    /**\n     * Whether enable memory pattern.\n     *\n     * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n     */\n    enableMemPattern?: boolean;\n\n    /**\n     * Execution mode.\n     *\n     * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n     */\n    executionMode?: 'sequential' | 'parallel';\n\n    /**\n     * Optimized model file path.\n     *\n     * If this setting is specified, the optimized model will be dumped. In browser, a blob will be created\n     * with a pop-up window.\n     */\n    optimizedModelFilePath?: string;\n\n    /**\n     * Whether enable profiling.\n     *\n     * This setting is a placeholder for a future use.\n     */\n    enableProfiling?: boolean;\n\n    /**\n     * File prefix for profiling.\n     *\n     * This setting is a placeholder for a future use.\n     */\n    profileFilePrefix?: string;\n\n    /**\n     * Log ID.\n     *\n     * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n     */\n    logId?: string;\n\n    /**\n     * Log severity level. See\n     * https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/common/logging/severity.h\n     *\n     * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n     */\n    logSeverityLevel?: 0 | 1 | 2 | 3 | 4;\n\n    /**\n     * Log verbosity level.\n     *\n     * This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later\n     */\n    logVerbosityLevel?: number;\n\n    /**\n     * Specify string as a preferred data location for all outputs, or an object that use output names as keys and a\n     * preferred data location as corresponding values.\n     *\n     * This setting is available only in ONNXRuntime Web for WebGL and WebGPU EP.\n     */\n    preferredOutputLocation?: OnnxValueDataLocation | { readonly [outputName: string]: OnnxValueDataLocation };\n\n    /**\n     * Whether enable graph capture.\n     * This setting is available only in ONNXRuntime Web for WebGPU EP.\n     */\n    enableGraphCapture?: boolean;\n\n    /**\n     * Store configurations for a session. See\n     * https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/session/\n     * onnxruntime_session_options_config_keys.h\n     *\n     * This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later\n     *\n     * @example\n     * ```js\n     * extra: {\n     *   session: {\n     *     set_denormal_as_zero: \"1\",\n     *     disable_prepacking: \"1\"\n     *   },\n     *   optimization: {\n     *     enable_gelu_approximation: \"1\"\n     *   }\n     * }\n     * ```\n     */\n    extra?: Record<string, unknown>;\n  }\n\n  // #region execution providers\n\n  // Currently, we have the following backends to support execution providers:\n  // Backend Node.js binding: supports 'cpu', 'dml' (win32), 'coreml' (macOS) and 'cuda' (linux).\n  // Backend WebAssembly: supports 'cpu', 'wasm', 'webgpu' and 'webnn'.\n  // Backend ONNX.js: supports 'webgl'.\n  // Backend React Native: supports 'cpu', 'xnnpack', 'coreml' (iOS), 'nnapi' (Android).\n  interface ExecutionProviderOptionMap {\n    coreml: CoreMLExecutionProviderOption;\n    cpu: CpuExecutionProviderOption;\n    cuda: CudaExecutionProviderOption;\n    dml: DmlExecutionProviderOption;\n    nnapi: NnapiExecutionProviderOption;\n    tensorrt: TensorRtExecutionProviderOption;\n    wasm: WebAssemblyExecutionProviderOption;\n    webgl: WebGLExecutionProviderOption;\n    webgpu: WebGpuExecutionProviderOption;\n    webnn: WebNNExecutionProviderOption;\n    qnn: QnnExecutionProviderOption;\n    xnnpack: XnnpackExecutionProviderOption;\n  }\n\n  type ExecutionProviderName = keyof ExecutionProviderOptionMap;\n  type ExecutionProviderConfig =\n    | ExecutionProviderOptionMap[ExecutionProviderName]\n    | ExecutionProviderOption\n    | ExecutionProviderName\n    | string;\n\n  export interface ExecutionProviderOption {\n    readonly name: string;\n  }\n  export interface CpuExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'cpu';\n    useArena?: boolean;\n  }\n  export interface CudaExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'cuda';\n    deviceId?: number;\n  }\n  export interface DmlExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'dml';\n    deviceId?: number;\n  }\n  export interface TensorRtExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'tensorrt';\n    deviceId?: number;\n  }\n  export interface WebAssemblyExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'wasm';\n  }\n  export interface WebGLExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'webgl';\n    // TODO: add flags\n  }\n  export interface XnnpackExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'xnnpack';\n  }\n  export interface WebGpuExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'webgpu';\n\n    /**\n     * Specify the preferred layout when running layout sensitive operators.\n     *\n     * @default 'NCHW'\n     */\n    preferredLayout?: 'NCHW' | 'NHWC';\n\n    /**\n     * Specify a list of node names that should be executed on CPU even when WebGPU EP is used.\n     */\n    forceCpuNodeNames?: readonly string[];\n\n    /**\n     * Specify the validation mode for WebGPU execution provider.\n     * - 'disabled': Disable all validation.\n     * When used in Node.js, disable validation may cause process crash if WebGPU errors occur. Be cautious when using\n     * this mode.\n     * When used in web, this mode is equivalent to 'wgpuOnly'.\n     * - 'wgpuOnly': Perform WebGPU internal validation only.\n     * - 'basic': Perform basic validation including WebGPU internal validation. This is the default mode.\n     * - 'full': Perform full validation. This mode may have performance impact. Use it for debugging purpose.\n     *\n     * @default 'basic'\n     */\n    validationMode?: 'disabled' | 'wgpuOnly' | 'basic' | 'full';\n\n    /**\n     * Specify an optional WebGPU device to be used by the WebGPU execution provider.\n     */\n    device?: TryGetGlobalType<'GPUDevice'>;\n  }\n\n  // #region WebNN options\n\n  interface WebNNExecutionProviderName extends ExecutionProviderOption {\n    readonly name: 'webnn';\n  }\n\n  /**\n   * Represents a set of options for creating a WebNN MLContext.\n   *\n   * @see https://www.w3.org/TR/webnn/#dictdef-mlcontextoptions\n   */\n  export interface WebNNContextOptions {\n    deviceType?: 'cpu' | 'gpu' | 'npu';\n    numThreads?: number;\n    powerPreference?: 'default' | 'low-power' | 'high-performance';\n  }\n\n  /**\n   * Represents a set of options for WebNN execution provider without MLContext.\n   */\n  export interface WebNNOptionsWithoutMLContext extends WebNNExecutionProviderName, WebNNContextOptions {\n    context?: never;\n  }\n\n  /**\n   * Represents a set of options for WebNN execution provider with MLContext.\n   *\n   * When MLContext is provided, the deviceType is also required so that the WebNN EP can determine the preferred\n   * channel layout.\n   *\n   * @see https://www.w3.org/TR/webnn/#dom-ml-createcontext\n   */\n  export interface WebNNOptionsWithMLContext\n    extends\n      WebNNExecutionProviderName,\n      Omit<WebNNContextOptions, 'deviceType'>,\n      Required<Pick<WebNNContextOptions, 'deviceType'>> {\n    context: TryGetGlobalType<'MLContext'>;\n  }\n\n  /**\n   * Represents a set of options for WebNN execution provider with MLContext which is created from GPUDevice.\n   *\n   * @see https://www.w3.org/TR/webnn/#dom-ml-createcontext-gpudevice\n   */\n  export interface WebNNOptionsWebGpu extends WebNNExecutionProviderName {\n    context: TryGetGlobalType<'MLContext'>;\n    gpuDevice: TryGetGlobalType<'GPUDevice'>;\n  }\n\n  /**\n   * Options for WebNN execution provider.\n   */\n  export type WebNNExecutionProviderOption =\n    | WebNNOptionsWithoutMLContext\n    | WebNNOptionsWithMLContext\n    | WebNNOptionsWebGpu;\n\n  // #endregion\n\n  export interface QnnExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'qnn';\n    /**\n     * Specify the QNN backend type. E.g., 'cpu' or 'htp'.\n     * Mutually exclusive with `backendPath`.\n     *\n     * @default 'htp'\n     */\n    backendType?: string;\n    /**\n     * Specify a path to the QNN backend library.\n     * Mutually exclusive with `backendType`.\n     */\n    backendPath?: string;\n    /**\n     * Specify whether to enable HTP FP16 precision.\n     *\n     * @default true\n     */\n    enableFp16Precision?: boolean;\n  }\n  export interface CoreMLExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'coreml';\n    /**\n     * The bit flags for CoreML execution provider.\n     *\n     * ```\n     * COREML_FLAG_USE_CPU_ONLY = 0x001\n     * COREML_FLAG_ENABLE_ON_SUBGRAPH = 0x002\n     * COREML_FLAG_ONLY_ENABLE_DEVICE_WITH_ANE = 0x004\n     * COREML_FLAG_ONLY_ALLOW_STATIC_INPUT_SHAPES = 0x008\n     * COREML_FLAG_CREATE_MLPROGRAM = 0x010\n     * COREML_FLAG_USE_CPU_AND_GPU = 0x020\n     * ```\n     *\n     * See include/onnxruntime/core/providers/coreml/coreml_provider_factory.h for more details.\n     *\n     * This flag is available only in ONNXRuntime (Node.js binding).\n     */\n    coreMlFlags?: number;\n    /**\n     * Specify whether to use CPU only in CoreML EP.\n     *\n     * This setting is available only in ONNXRuntime (react-native).\n     */\n    useCPUOnly?: boolean;\n    useCPUAndGPU?: boolean;\n    /**\n     * Specify whether to enable CoreML EP on subgraph.\n     *\n     * This setting is available only in ONNXRuntime (react-native).\n     */\n    enableOnSubgraph?: boolean;\n    /**\n     * Specify whether to only enable CoreML EP for Apple devices with ANE (Apple Neural Engine).\n     *\n     * This setting is available only in ONNXRuntime (react-native).\n     */\n    onlyEnableDeviceWithANE?: boolean;\n  }\n  export interface NnapiExecutionProviderOption extends ExecutionProviderOption {\n    readonly name: 'nnapi';\n    useFP16?: boolean;\n    useNCHW?: boolean;\n    cpuDisabled?: boolean;\n    cpuOnly?: boolean;\n  }\n  // #endregion\n\n  // #endregion\n\n  // #region run options\n\n  /**\n   * A set of configurations for inference run behavior\n   */\n  export interface RunOptions {\n    /**\n     * Log severity level. See\n     * https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/common/logging/severity.h\n     *\n     * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n     */\n    logSeverityLevel?: 0 | 1 | 2 | 3 | 4;\n\n    /**\n     * Log verbosity level.\n     *\n     * This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later\n     */\n    logVerbosityLevel?: number;\n\n    /**\n     * Terminate all incomplete OrtRun calls as soon as possible if true\n     *\n     * This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later\n     */\n    terminate?: boolean;\n\n    /**\n     * A tag for the Run() calls using this\n     *\n     * This setting is available only in ONNXRuntime (Node.js binding and react-native) or WebAssembly backend\n     */\n    tag?: string;\n\n    /**\n     * Set a single run configuration entry. See\n     * https://github.com/microsoft/onnxruntime/blob/main/include/onnxruntime/core/session/\n     * onnxruntime_run_options_config_keys.h\n     *\n     * This setting is available only in WebAssembly backend. Will support Node.js binding and react-native later\n     *\n     * @example\n     *\n     * ```js\n     * extra: {\n     *   memory: {\n     *     enable_memory_arena_shrinkage: \"1\",\n     *   }\n     * }\n     * ```\n     */\n    extra?: Record<string, unknown>;\n  }\n\n  // #endregion\n\n  // #region value metadata\n\n  /**\n   * The common part of the value metadata type for both tensor and non-tensor values.\n   */\n  export interface ValueMetadataBase {\n    /**\n     * The name of the specified input or output.\n     */\n    readonly name: string;\n  }\n\n  /**\n   * Represents the metadata of a non-tensor value.\n   */\n  export interface NonTensorValueMetadata extends ValueMetadataBase {\n    /**\n     * Get a value indicating whether the value is a tensor.\n     */\n    readonly isTensor: false;\n  }\n\n  /**\n   * Represents the metadata of a tensor value.\n   */\n  export interface TensorValueMetadata extends ValueMetadataBase {\n    /**\n     * Get a value indicating whether the value is a tensor.\n     */\n    readonly isTensor: true;\n    /**\n     * Get the data type of the tensor.\n     */\n    readonly type: Tensor.Type;\n    /**\n     * Get the shape of the tensor.\n     *\n     * If the shape is not defined, the value will an empty array. Otherwise, it will be an array representing the shape\n     * of the tensor. Each element in the array can be a number or a string. If the element is a number, it represents\n     * the corresponding dimension size. If the element is a string, it represents a symbolic dimension.\n     */\n    readonly shape: ReadonlyArray<number | string>;\n  }\n\n  /**\n   * Represents the metadata of a value.\n   */\n  export type ValueMetadata = NonTensorValueMetadata | TensorValueMetadata;\n\n  // #endregion\n}\n\n/**\n * Represent a runtime instance of an ONNX model.\n */\nexport interface InferenceSession {\n  // #region run()\n\n  /**\n   * Execute the model asynchronously with the given feeds and options.\n   *\n   * @param feeds - Representation of the model input. See type description of `InferenceSession.InputType` for detail.\n   * @param options - Optional. A set of options that controls the behavior of model inference.\n   * @returns A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding values.\n   */\n  run(feeds: InferenceSession.FeedsType, options?: InferenceSession.RunOptions): Promise<InferenceSession.ReturnType>;\n\n  /**\n   * Execute the model asynchronously with the given feeds, fetches and options.\n   *\n   * @param feeds - Representation of the model input. See type description of `InferenceSession.InputType` for detail.\n   * @param fetches - Representation of the model output. See type description of `InferenceSession.OutputType` for\n   * detail.\n   * @param options - Optional. A set of options that controls the behavior of model inference.\n   * @returns A promise that resolves to a map, which uses output names as keys and OnnxValue as corresponding values.\n   */\n  run(\n    feeds: InferenceSession.FeedsType,\n    fetches: InferenceSession.FetchesType,\n    options?: InferenceSession.RunOptions,\n  ): Promise<InferenceSession.ReturnType>;\n\n  // #endregion\n\n  // #region release()\n\n  /**\n   * Release the inference session and the underlying resources.\n   */\n  release(): Promise<void>;\n\n  // #endregion\n\n  // #region profiling\n\n  /**\n   * Start profiling.\n   */\n  startProfiling(): void;\n\n  /**\n   * End profiling.\n   */\n  endProfiling(): void;\n\n  // #endregion\n\n  // #region metadata\n\n  /**\n   * Get input names of the loaded model.\n   */\n  readonly inputNames: readonly string[];\n\n  /**\n   * Get output names of the loaded model.\n   */\n  readonly outputNames: readonly string[];\n\n  /**\n   * Get input metadata of the loaded model.\n   */\n  readonly inputMetadata: readonly InferenceSession.ValueMetadata[];\n\n  /**\n   * Get output metadata of the loaded model.\n   */\n  readonly outputMetadata: readonly InferenceSession.ValueMetadata[];\n\n  // #endregion\n}\n\nexport interface InferenceSessionFactory {\n  // #region create()\n\n  /**\n   * Create a new inference session and load model asynchronously from an ONNX model file.\n   *\n   * @param uri - The URI or file path of the model to load.\n   * @param options - specify configuration for creating a new inference session.\n   * @returns A promise that resolves to an InferenceSession object.\n   */\n  create(uri: string, options?: InferenceSession.SessionOptions): Promise<InferenceSession>;\n\n  /**\n   * Create a new inference session and load model asynchronously from an array bufer.\n   *\n   * @param buffer - An ArrayBuffer representation of an ONNX model.\n   * @param options - specify configuration for creating a new inference session.\n   * @returns A promise that resolves to an InferenceSession object.\n   */\n  create(buffer: ArrayBufferLike, options?: InferenceSession.SessionOptions): Promise<InferenceSession>;\n\n  /**\n   * Create a new inference session and load model asynchronously from segment of an array bufer.\n   *\n   * @param buffer - An ArrayBuffer representation of an ONNX model.\n   * @param byteOffset - The beginning of the specified portion of the array buffer.\n   * @param byteLength - The length in bytes of the array buffer.\n   * @param options - specify configuration for creating a new inference session.\n   * @returns A promise that resolves to an InferenceSession object.\n   */\n  create(\n    buffer: ArrayBufferLike,\n    byteOffset: number,\n    byteLength?: number,\n    options?: InferenceSession.SessionOptions,\n  ): Promise<InferenceSession>;\n\n  /**\n   * Create a new inference session and load model asynchronously from a Uint8Array.\n   *\n   * @param buffer - A Uint8Array representation of an ONNX model.\n   * @param options - specify configuration for creating a new inference session.\n   * @returns A promise that resolves to an InferenceSession object.\n   */\n  create(buffer: Uint8Array, options?: InferenceSession.SessionOptions): Promise<InferenceSession>;\n\n  // #endregion\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const InferenceSession: InferenceSessionFactory = InferenceSessionImpl;\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { OptionsFormat, OptionsNormalizationParameters, OptionsTensorLayout } from './tensor-factory.js';\n\nexport interface TensorToDataUrlOptions extends OptionsTensorLayout, OptionsFormat, OptionsNormalizationParameters {}\n\nexport interface TensorToImageDataOptions extends OptionsTensorLayout, OptionsFormat, OptionsNormalizationParameters {}\n\nexport interface ConversionUtils {\n  /**\n   * creates a DataURL instance from tensor\n   *\n   * @param options - An optional object representing options for creating a DataURL instance from the tensor.\n   *\n   * The following default settings will be applied:\n   * - `format`: `'RGB'`\n   * - `tensorLayout`: `'NCHW'`\n   * @returns a DataURL string representing the image converted from tensor data\n   */\n  toDataURL(options?: TensorToDataUrlOptions): string;\n\n  /**\n   * creates an ImageData instance from tensor\n   *\n   * @param options - An optional object representing options for creating an ImageData instance from the tensor.\n   *\n   * The following default settings will be applied:\n   * - `format`: `'RGB'`\n   * - `tensorLayout`: `'NCHW'`\n   * @returns an ImageData instance representing the image converted from tensor data\n   */\n  toImageData(options?: TensorToImageDataOptions): ImageData;\n}\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor, TypedTensor } from './tensor.js';\n\nexport type ImageFormat = 'RGB' | 'RGBA' | 'BGR' | 'RBG';\nexport type ImageTensorLayout = 'NHWC' | 'NCHW';\n\n// the following region contains type definitions for constructing tensor from a specific location.\n\n// #region types for constructing a tensor from a specific location\n\n/**\n * represent common properties of the parameter for constructing a tensor from a specific location.\n */\ninterface CommonConstructorParameters<T> extends Pick<Tensor, 'dims'> {\n  /**\n   * Specify the data type of the tensor.\n   */\n  readonly type: T;\n}\n\n/**\n * represent the parameter for constructing a tensor from a GPU resource.\n */\ninterface GpuResourceConstructorParameters<T extends Tensor.Type> {\n  /**\n   * an optional callback function to download data from GPU to CPU.\n   *\n   * If not provided, the tensor treat the GPU data as external resource.\n   */\n  download?(): Promise<Tensor.DataTypeMap[T]>;\n\n  /**\n   * an optional callback function that will be called when the tensor is disposed.\n   *\n   * If not provided, the tensor treat the GPU data as external resource.\n   */\n  dispose?(): void;\n}\n\n/**\n * represent the parameter for constructing a tensor from a pinned CPU buffer\n */\nexport interface CpuPinnedConstructorParameters<\n  T extends Tensor.CpuPinnedDataTypes = Tensor.CpuPinnedDataTypes,\n> extends CommonConstructorParameters<T> {\n  /**\n   * Specify the location of the data to be 'cpu-pinned'.\n   */\n  readonly location: 'cpu-pinned';\n  /**\n   * Specify the CPU pinned buffer that holds the tensor data.\n   */\n  readonly data: Tensor.DataTypeMap[T];\n}\n\n/**\n * represent the parameter for constructing a tensor from a WebGL texture\n */\nexport interface TextureConstructorParameters<T extends Tensor.TextureDataTypes = Tensor.TextureDataTypes>\n  extends CommonConstructorParameters<T>, GpuResourceConstructorParameters<T> {\n  /**\n   * Specify the location of the data to be 'texture'.\n   */\n  readonly location: 'texture';\n  /**\n   * Specify the WebGL texture that holds the tensor data.\n   */\n  readonly texture: Tensor.TextureType;\n}\n\n/**\n * represent the parameter for constructing a tensor from a WebGPU buffer\n */\nexport interface GpuBufferConstructorParameters<T extends Tensor.GpuBufferDataTypes = Tensor.GpuBufferDataTypes>\n  extends CommonConstructorParameters<T>, GpuResourceConstructorParameters<T> {\n  /**\n   * Specify the location of the data to be 'gpu-buffer'.\n   */\n  readonly location: 'gpu-buffer';\n  /**\n   * Specify the WebGPU buffer that holds the tensor data.\n   */\n  readonly gpuBuffer: Tensor.GpuBufferType;\n}\n\nexport interface MLTensorConstructorParameters<T extends Tensor.MLTensorDataTypes = Tensor.MLTensorDataTypes>\n  extends CommonConstructorParameters<T>, GpuResourceConstructorParameters<T> {\n  /**\n   * Specify the location of the data to be 'ml-tensor'.\n   */\n  readonly location: 'ml-tensor';\n\n  /**\n   * Specify the WebNN MLTensor that holds the tensor data.\n   */\n  readonly mlTensor: Tensor.MLTensorType;\n}\n\n// #endregion\n\n// the following region contains type definitions of each individual options.\n// the tensor factory functions use a composition of those options as the parameter type.\n\n// #region Options fields\n\nexport interface OptionsFormat {\n  /**\n   * Describes the image format represented in RGBA color space.\n   */\n  format?: ImageFormat;\n}\n\nexport interface OptionsTensorFormat {\n  /**\n   * Describes the image format of the tensor.\n   *\n   * NOTE: this is different from option 'format'. While option 'format' represents the original image, 'tensorFormat'\n   * represents the target format of the tensor. A transpose will be performed if they are different.\n   */\n  tensorFormat?: ImageFormat;\n}\n\nexport interface OptionsTensorDataType {\n  /**\n   * Describes the data type of the tensor.\n   */\n  dataType?: 'float32' | 'uint8';\n}\n\nexport interface OptionsTensorLayout {\n  /**\n   * Describes the tensor layout when representing data of one or more image(s).\n   */\n  tensorLayout?: ImageTensorLayout;\n}\n\nexport interface OptionsDimensions {\n  /**\n   * Describes the image height in pixel\n   */\n  height?: number;\n  /**\n   * Describes the image width in pixel\n   */\n  width?: number;\n}\n\nexport interface OptionResizedDimensions {\n  /**\n   * Describes the resized height. If omitted, original height will be used.\n   */\n  resizedHeight?: number;\n  /**\n   * Describes resized width - can be accessed via tensor dimensions as well\n   */\n  resizedWidth?: number;\n}\n\nexport interface OptionsNormalizationParameters {\n  /**\n   * Describes normalization parameters when preprocessing the image as model input.\n   *\n   * Data element are ranged from 0 to 255.\n   */\n  norm?: {\n    /**\n     * The 'bias' value for image normalization.\n     * - If omitted, use default value 0.\n     * - If it's a single number, apply to each channel\n     * - If it's an array of 3 or 4 numbers, apply element-wise. Number of elements need to match the number of channels\n     * for the corresponding image format\n     */\n    bias?: number | [number, number, number] | [number, number, number, number];\n    /**\n     * The 'mean' value for image normalization.\n     * - If omitted, use default value 255.\n     * - If it's a single number, apply to each channel\n     * - If it's an array of 3 or 4 numbers, apply element-wise. Number of elements need to match the number of channels\n     * for the corresponding image format\n     */\n    mean?: number | [number, number, number] | [number, number, number, number];\n  };\n}\n\n// #endregion\n\n// #region Options composition\n\nexport interface TensorFromImageDataOptions\n  extends\n    OptionResizedDimensions,\n    OptionsTensorFormat,\n    OptionsTensorLayout,\n    OptionsTensorDataType,\n    OptionsNormalizationParameters {}\n\nexport interface TensorFromImageElementOptions\n  extends\n    OptionResizedDimensions,\n    OptionsTensorFormat,\n    OptionsTensorLayout,\n    OptionsTensorDataType,\n    OptionsNormalizationParameters {}\n\nexport interface TensorFromUrlOptions\n  extends\n    OptionsDimensions,\n    OptionResizedDimensions,\n    OptionsTensorFormat,\n    OptionsTensorLayout,\n    OptionsTensorDataType,\n    OptionsNormalizationParameters {}\n\nexport interface TensorFromImageBitmapOptions\n  extends\n    OptionResizedDimensions,\n    OptionsTensorFormat,\n    OptionsTensorLayout,\n    OptionsTensorDataType,\n    OptionsNormalizationParameters {}\n\nexport interface TensorFromTextureOptions<T extends Tensor.TextureDataTypes>\n  extends Required<OptionsDimensions>, OptionsFormat, GpuResourceConstructorParameters<T> /* TODO: add more */ {}\n\nexport interface TensorFromGpuBufferOptions<T extends Tensor.GpuBufferDataTypes>\n  extends Pick<Tensor, 'dims'>, GpuResourceConstructorParameters<T> {\n  /**\n   * Describes the data type of the tensor.\n   */\n  dataType?: T;\n}\n\nexport interface TensorFromMLTensorOptions<T extends Tensor.MLTensorDataTypes>\n  extends Pick<Tensor, 'dims'>, GpuResourceConstructorParameters<T> {\n  /**\n   * Describes the data type of the tensor.\n   */\n  dataType?: T;\n}\n\n// #endregion\n\n/**\n * type TensorFactory defines the factory functions of 'Tensor' to create tensor instances from existing data or\n * resources.\n */\nexport interface TensorFactory {\n  /**\n   * create a tensor from an ImageData object\n   *\n   * @param imageData - the ImageData object to create tensor from\n   * @param options - An optional object representing options for creating tensor from ImageData.\n   *\n   * The following default settings will be applied:\n   * - `tensorFormat`: `'RGB'`\n   * - `tensorLayout`: `'NCHW'`\n   * - `dataType`: `'float32'`\n   * @returns A promise that resolves to a tensor object\n   */\n  fromImage(\n    imageData: ImageData,\n    options?: TensorFromImageDataOptions,\n  ): Promise<TypedTensor<'float32'> | TypedTensor<'uint8'>>;\n\n  /**\n   * create a tensor from a HTMLImageElement object\n   *\n   * @param imageElement - the HTMLImageElement object to create tensor from\n   * @param options - An optional object representing options for creating tensor from HTMLImageElement.\n   *\n   * The following default settings will be applied:\n   * - `tensorFormat`: `'RGB'`\n   * - `tensorLayout`: `'NCHW'`\n   * - `dataType`: `'float32'`\n   * @returns A promise that resolves to a tensor object\n   */\n  fromImage(\n    imageElement: HTMLImageElement,\n    options?: TensorFromImageElementOptions,\n  ): Promise<TypedTensor<'float32'> | TypedTensor<'uint8'>>;\n\n  /**\n   * create a tensor from URL\n   *\n   * @param urlSource - a string as a URL to the image or a data URL containing the image data.\n   * @param options - An optional object representing options for creating tensor from URL.\n   *\n   * The following default settings will be applied:\n   * - `tensorFormat`: `'RGB'`\n   * - `tensorLayout`: `'NCHW'`\n   * - `dataType`: `'float32'`\n   * @returns A promise that resolves to a tensor object\n   */\n  fromImage(urlSource: string, options?: TensorFromUrlOptions): Promise<TypedTensor<'float32'> | TypedTensor<'uint8'>>;\n\n  /**\n   * create a tensor from an ImageBitmap object\n   *\n   * @param bitmap - the ImageBitmap object to create tensor from\n   * @param options - An optional object representing options for creating tensor from URL.\n   *\n   * The following default settings will be applied:\n   * - `tensorFormat`: `'RGB'`\n   * - `tensorLayout`: `'NCHW'`\n   * - `dataType`: `'float32'`\n   * @returns A promise that resolves to a tensor object\n   */\n  fromImage(\n    bitmap: ImageBitmap,\n    options: TensorFromImageBitmapOptions,\n  ): Promise<TypedTensor<'float32'> | TypedTensor<'uint8'>>;\n\n  /**\n   * create a tensor from a WebGL texture\n   *\n   * @param texture - the WebGLTexture object to create tensor from\n   * @param options - An optional object representing options for creating tensor from WebGL texture.\n   *\n   * The options include following properties:\n   * - `width`: the width of the texture. Required.\n   * - `height`: the height of the texture. Required.\n   * - `format`: the format of the texture. If omitted, assume 'RGBA'.\n   * - `download`: an optional function to download the tensor data from GPU to CPU. If omitted, the GPU data\n   * will not be able to download. Usually, this is provided by a GPU backend for the inference outputs. Users don't\n   * need to provide this function.\n   * - `dispose`: an optional function to dispose the tensor data on GPU. If omitted, the GPU data will not be disposed.\n   * Usually, this is provided by a GPU backend for the inference outputs. Users don't need to provide this function.\n   *\n   * @returns a tensor object\n   */\n  fromTexture<T extends Tensor.TextureDataTypes = 'float32'>(\n    texture: Tensor.TextureType,\n    options: TensorFromTextureOptions<T>,\n  ): TypedTensor<'float32'>;\n\n  /**\n   * create a tensor from a WebGPU buffer\n   *\n   * @param buffer - the GPUBuffer object to create tensor from\n   * @param options - An optional object representing options for creating tensor from WebGPU buffer.\n   *\n   * The options include following properties:\n   * - `dataType`: the data type of the tensor. If omitted, assume 'float32'.\n   * - `dims`: the dimension of the tensor. Required.\n   * - `download`: an optional function to download the tensor data from GPU to CPU. If omitted, the GPU data\n   * will not be able to download. Usually, this is provided by a GPU backend for the inference outputs. Users don't\n   * need to provide this function.\n   * - `dispose`: an optional function to dispose the tensor data on GPU. If omitted, the GPU data will not be disposed.\n   * Usually, this is provided by a GPU backend for the inference outputs. Users don't need to provide this function.\n   *\n   * @returns a tensor object\n   */\n  fromGpuBuffer<T extends Tensor.GpuBufferDataTypes>(\n    buffer: Tensor.GpuBufferType,\n    options: TensorFromGpuBufferOptions<T>,\n  ): TypedTensor<T>;\n\n  /**\n   * create a tensor from a WebNN MLTensor\n   *\n   * @param tensor - the MLTensor object to create tensor from\n   * @param options - An optional object representing options for creating tensor from a WebNN MLTensor.\n   *\n   * The options include following properties:\n   * - `dataType`: the data type of the tensor. If omitted, assume 'float32'.\n   * - `dims`: the dimension of the tensor. Required.\n   * - `download`: an optional function to download the tensor data from the MLTensor to CPU. If omitted, the MLTensor\n   * data will not be able to download. Usually, this is provided by the WebNN backend for the inference outputs.\n   * Users don't need to provide this function.\n   * - `dispose`: an optional function to dispose the tensor data on the WebNN MLTensor. If omitted, the MLTensor will\n   * not be disposed. Usually, this is provided by the WebNN backend for the inference outputs. Users don't need to\n   * provide this function.\n   *\n   * @returns a tensor object\n   */\n  fromMLTensor<T extends Tensor.MLTensorDataTypes>(\n    tensor: Tensor.MLTensorType,\n    options: TensorFromMLTensorOptions<T>,\n  ): TypedTensor<T>;\n\n  /**\n   * create a tensor from a pre-allocated buffer. The buffer will be used as a pinned buffer.\n   *\n   * @param type - the tensor element type.\n   * @param buffer - a TypedArray corresponding to the type.\n   * @param dims - specify the dimension of the tensor. If omitted, a 1-D tensor is assumed.\n   *\n   * @returns a tensor object\n   */\n  fromPinnedBuffer<T extends Exclude<Tensor.Type, 'string'>>(\n    type: T,\n    buffer: Tensor.DataTypeMap[T],\n    dims?: readonly number[],\n  ): TypedTensor<T>;\n}\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/**\n * A string that represents a file's URL or path.\n *\n * Path is vailable only in onnxruntime-node or onnxruntime-web running in Node.js.\n */\nexport type FileUrlOrPath = string;\n\n/**\n * A Blob object that represents a file.\n */\nexport type FileBlob = Blob;\n\n/**\n * A Uint8Array, ArrayBuffer or SharedArrayBuffer object that represents a file content.\n *\n * When it is an ArrayBuffer or SharedArrayBuffer, the whole buffer is assumed to be the file content.\n */\nexport type FileData = Uint8Array | ArrayBufferLike;\n\n/**\n * Represents a file that can be loaded by the ONNX Runtime JavaScript API.\n */\nexport type FileType = FileUrlOrPath | FileBlob | FileData;\n\n/**\n * Represents an external data file.\n */\nexport interface ExternalDataFileDescription {\n  /**\n   * Specify the external data file.\n   */\n  data: FileType;\n  /**\n   * Specify the file path.\n   */\n  path: string;\n}\n\n/**\n * Represents an external data file.\n *\n * When using a string, it should be a file URL or path that in the same directory as the model file.\n */\nexport type ExternalDataFileType = ExternalDataFileDescription | FileUrlOrPath;\n\n/**\n * Options for model loading.\n */\nexport interface OnnxModelOptions {\n  /**\n   * Specifying a list of files that represents the external data.\n   */\n  externalData?: readonly ExternalDataFileType[];\n}\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from './tensor.js';\n\nexport type NonTensorType = never;\n\n/**\n * Type OnnxValue Represents both tensors and non-tensors value for model's inputs/outputs.\n *\n * NOTE: currently not support non-tensor\n */\nexport type OnnxValue = Tensor | NonTensorType;\n\n/**\n * Type OnnxValueDataLocation represents the location of the data of an OnnxValue.\n */\nexport type OnnxValueDataLocation = Tensor.DataLocation;\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/**\n * # ONNX Runtime JavaScript API\n *\n * ONNX Runtime JavaScript API is a unified API for all JavaScript usages, including the following NPM packages:\n *\n * - [onnxruntime-node](https://www.npmjs.com/package/onnxruntime-node)\n * - [onnxruntime-web](https://www.npmjs.com/package/onnxruntime-web)\n * - [onnxruntime-react-native](https://www.npmjs.com/package/onnxruntime-react-native)\n *\n * See also:\n * - [Get Started](https://onnxruntime.ai/docs/get-started/with-javascript/)\n * - [Inference examples](https://github.com/microsoft/onnxruntime-inference-examples/tree/main/js)\n *\n * @packageDocumentation\n */\n\nexport * from './backend.js';\nexport * from './env.js';\nexport * from './inference-session.js';\nexport * from './tensor.js';\nexport * from './tensor-conversion.js';\nexport * from './tensor-factory.js';\nexport * from './trace.js';\nexport * from './onnx-model.js';\nexport * from './onnx-value.js';\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nexport const isNode = !!(typeof process !== 'undefined' && process.versions && process.versions.node);\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/// <reference lib=\"webworker\" />\n\n//\n// * type hack for \"HTMLImageElement\"\n//\n// in typescript, the type of \"HTMLImageElement\" is defined in lib.dom.d.ts, which is conflict with lib.webworker.d.ts.\n// when we use webworker, the lib.webworker.d.ts will be used, which does not have HTMLImageElement defined.\n//\n// we will get the following errors complaining that HTMLImageElement is not defined:\n//\n// ====================================================================================================================\n//\n// ../common/dist/cjs/tensor-factory.d.ts:187:29 - error TS2552: Cannot find name 'HTMLImageElement'. Did you mean\n// 'HTMLLIElement'?\n//\n// 187     fromImage(imageElement: HTMLImageElement, options?: TensorFromImageElementOptions):\n// Promise<TypedTensor<'float32'> | TypedTensor<'uint8'>>;\n//                                 ~~~~~~~~~~~~~~~~\n//\n// node_modules/@webgpu/types/dist/index.d.ts:83:7 - error TS2552: Cannot find name 'HTMLImageElement'. Did you mean\n// 'HTMLLIElement'?\n//\n// 83     | HTMLImageElement\n//          ~~~~~~~~~~~~~~~~\n//\n// ====================================================================================================================\n//\n// `HTMLImageElement` is only used in type declaration and not in real code. So we define it as `unknown` here to\n// bypass the type check.\n\n//\n// * type hack for \"document\"\n//\n// in typescript, the type of \"document\" is defined in lib.dom.d.ts, so it's not available in webworker.\n//\n// we will get the following errors complaining that document is not defined:\n//\n// ====================================================================================================================\n//\n// lib/wasm/wasm-utils-import.ts:7:33 - error TS2584: Cannot find name 'document'. Do you need to change your target\n// library? Try changing the 'lib' compiler option to include 'dom'.\n//\n// 7 export const scriptSrc = typeof document !== 'undefined' ? (document?.currentScript as HTMLScriptElement)?.src :\n//                                   ~~~~~~~~\n//\n// lib/wasm/wasm-utils-import.ts:7:61 - error TS2584: Cannot find name 'document'. Do you need to change your target\n// library? Try changing the 'lib' compiler option to include 'dom'.\n//\n// 7 export const scriptSrc = typeof document !== 'undefined' ? (document?.currentScript as HTMLScriptElement)?.src :\n//                                                               ~~~~~~~~\n//\n// lib/wasm/wasm-utils-import.ts:7:88 - error TS2552: Cannot find name 'HTMLScriptElement'. Did you mean\n// 'HTMLLIElement'?\n//\n// 7 export const scriptSrc = typeof document !== 'undefined' ? (document?.currentScript as HTMLScriptElement)?.src :\n//                                                                                          ~~~~~~~~~~~~~~~~~\n// ====================================================================================================================\n//\n// `document` is used to get the current script URL, which is not available in webworker. This file is served as a\n// \"dual\" file for entries of both webworker and the esm module.\n//\ndeclare global {\n  type HTMLImageElement = unknown;\n  type HTMLScriptElement = { src?: string };\n  const document: undefined | { currentScript?: HTMLScriptElement };\n}\n\n/**\n * @summary\n *\n * This file is served as a \"dual\" file for both entries of the following:\n * - The proxy worker itself.\n *   - When used as a worker, it listens to the messages from the main thread and performs the corresponding operations.\n *   - Should be imported directly using `new Worker()` in the main thread.\n *\n * - The ESM module that creates the proxy worker (as a worker launcher).\n *   - When used as a worker launcher, it creates the proxy worker and returns it.\n *   - Should be imported using `import()` in the main thread, with the query parameter `import=1`.\n *\n * This file will be always compiling into ESM format.\n */\n\nimport type { OrtWasmMessage, SerializableTensorMetadata } from '../proxy-messages.js';\nimport {\n  createSession,\n  copyFromExternalBuffer,\n  endProfiling,\n  extractTransferableBuffers,\n  initEp,\n  initRuntime,\n  releaseSession,\n  run,\n} from '../wasm-core-impl.js';\nimport { initializeWebAssembly } from '../wasm-factory.js';\nimport { scriptSrc } from '../wasm-utils-import.js';\n\nconst WORKER_NAME = 'ort-wasm-proxy-worker';\nconst isProxyWorker = globalThis.self?.name === WORKER_NAME;\n\nif (isProxyWorker) {\n  // Worker thread\n  self.onmessage = (ev: MessageEvent<OrtWasmMessage>): void => {\n    const { type, in: message } = ev.data;\n    try {\n      switch (type) {\n        case 'init-wasm':\n          initializeWebAssembly(message!.wasm).then(\n            () => {\n              initRuntime(message!).then(\n                () => {\n                  postMessage({ type });\n                },\n                (err) => {\n                  postMessage({ type, err });\n                },\n              );\n            },\n            (err) => {\n              postMessage({ type, err });\n            },\n          );\n          break;\n        case 'init-ep': {\n          const { epName, env } = message!;\n          initEp(env, epName).then(\n            () => {\n              postMessage({ type });\n            },\n            (err) => {\n              postMessage({ type, err });\n            },\n          );\n          break;\n        }\n        case 'copy-from': {\n          const { buffer } = message!;\n          const bufferData = copyFromExternalBuffer(buffer);\n          postMessage({ type, out: bufferData });\n          break;\n        }\n        case 'create': {\n          const { model, options } = message!;\n          createSession(model, options).then(\n            (sessionMetadata) => {\n              postMessage({ type, out: sessionMetadata });\n            },\n            (err) => {\n              postMessage({ type, err });\n            },\n          );\n          break;\n        }\n        case 'release':\n          releaseSession(message!);\n          postMessage({ type });\n          break;\n        case 'run': {\n          const { sessionId, inputIndices, inputs, outputIndices, options } = message!;\n          run(sessionId, inputIndices, inputs, outputIndices, new Array(outputIndices.length).fill(null), options).then(\n            (outputs) => {\n              if (outputs.some((o) => o[3] !== 'cpu')) {\n                postMessage({ type, err: 'Proxy does not support non-cpu tensor location.' });\n              } else {\n                postMessage(\n                  { type, out: outputs },\n                  extractTransferableBuffers([...inputs, ...outputs] as SerializableTensorMetadata[]),\n                );\n              }\n            },\n            (err) => {\n              postMessage({ type, err });\n            },\n          );\n          break;\n        }\n        case 'end-profiling':\n          endProfiling(message!);\n          postMessage({ type });\n          break;\n        default:\n      }\n    } catch (err) {\n      postMessage({ type, err });\n    }\n  };\n}\n\nexport default isProxyWorker\n  ? null\n  : (urlOverride?: string) =>\n      new Worker(urlOverride ?? scriptSrc!, { type: BUILD_DEFS.IS_ESM ? 'module' : 'classic', name: WORKER_NAME });\n","async function e(e={}){var r=e,t=!!globalThis.window,n=!!globalThis.WorkerGlobalScope,a=n&&self.name?.startsWith(\"em-pthread\");r.mountExternalData=(e,t)=>{e.startsWith(\"./\")&&(e=e.substring(2)),(r.Vc||(r.Vc=new Map)).set(e,t)},r.unmountExternalData=()=>{delete r.Vc},globalThis.SharedArrayBuffer??new WebAssembly.Memory({initial:0,maximum:0,shared:!0}).buffer.constructor;let i=()=>{const e=e=>(...r)=>{const t=Gr;return r=e(...r),Gr!=t?new Promise((e,r)=>{qr={resolve:e,reject:r}}):r};(()=>{for(const t of[\"_OrtAppendExecutionProvider\",\"_OrtCreateSession\",\"_OrtRun\",\"_OrtRunWithBinding\",\"_OrtBindInput\"])r[t]=e(r[t])})(),\"undefined\"!=typeof jsepRunAsync&&(r._OrtRun=jsepRunAsync(r._OrtRun),r._OrtRunWithBinding=jsepRunAsync(r._OrtRunWithBinding)),i=void 0};r.asyncInit=()=>{i?.()};var o,u,c=(e,r)=>{throw r},s=import.meta.url,f=\"\";if(t||n){try{f=new URL(\".\",s).href}catch{}n&&(u=e=>{var r=new XMLHttpRequest;return r.open(\"GET\",e,!1),r.responseType=\"arraybuffer\",r.send(null),new Uint8Array(r.response)}),o=async e=>{if(S(e))return new Promise((r,t)=>{var n=new XMLHttpRequest;n.open(\"GET\",e,!0),n.responseType=\"arraybuffer\",n.onload=()=>{200==n.status||0==n.status&&n.response?r(n.response):t(n.status)},n.onerror=t,n.send(null)});var r=await fetch(e,{credentials:\"same-origin\"});if(r.ok)return r.arrayBuffer();throw Error(r.status+\" : \"+r.url)}}var l,d,m,h,p,v,g=console.log.bind(console),b=console.error.bind(console),w=g,y=b,x=!1,S=e=>e.startsWith(\"file://\");function T(){ue.buffer!=A.buffer&&W()}if(a){var O=!1;function Oo(e){try{var t=e.data,n=t.Pc;if(\"load\"===n){let e=[];self.onmessage=r=>e.push(r),v=()=>{postMessage({Pc:\"loaded\"});for(let r of e)Oo(r);self.onmessage=Oo};for(const e of t.ee)r[e]&&!r[e].proxy||(r[e]=(...r)=>{postMessage({Pc:\"callHandler\",de:e,args:r})},\"print\"==e&&(w=r[e]),\"printErr\"==e&&(y=r[e]));ue=t.ke,W(),d=t.le,$(),To()}else if(\"run\"===n){!function(e){var r=(T(),R)[e+52>>>2>>>0];e=(T(),R)[e+56>>>2>>>0],$a(r,r-e),Na(r)}(t.Oc),Ea(t.Oc,0,0,1,0,0),ae(),Cr(t.Oc),O||(ca(),O=!0);try{ce(t.ie,t.Xc)}catch(e){if(\"unwind\"!=e)throw e}}else\"setimmediate\"!==t.target&&(\"checkMailbox\"===n?O&&Mr():n&&(y(`worker: received unknown command ${n}`),y(t)))}catch(e){throw Ua(),e}}self.onunhandledrejection=e=>{throw e.reason||e},self.onmessage=Oo}var A,B,P,C,M,R,E,U,D,k,I,_=!1;function W(){var e=ue.buffer;r.HEAP8=A=new Int8Array(e),P=new Int16Array(e),r.HEAPU8=B=new Uint8Array(e),C=new Uint16Array(e),r.HEAP32=M=new Int32Array(e),r.HEAPU32=R=new Uint32Array(e),E=new Float32Array(e),U=new Float64Array(e),D=new BigInt64Array(e),k=new BigUint64Array(e)}function L(){_=!0,a?v():_i.$b()}function G(e){throw y(e=\"Aborted(\"+e+\")\"),x=!0,e=new WebAssembly.RuntimeError(e+\". Build with -sASSERTIONS for more info.\"),p?.(e),e}function z(){return{a:{f:de,J:he,k:we,p:ye,l:xe,sa:Se,b:Te,ca:Oe,Ja:Be,q:Pe,da:Ue,Za:De,Fa:ke,Ha:Ie,_a:_e,Xa:We,Qa:Le,Wa:Ge,oa:ze,Ga:$e,Yb:Ne,Ya:Fe,Zb:Ve,db:Ye,Da:Ke,Tb:er,Rb:cr,Ca:fr,M:lr,I:dr,Sb:pr,ja:Tr,Ub:Or,Ta:Ar,Wb:Rr,Ka:Ur,Pb:Dr,ka:kr,Sa:Cr,ab:Ir,U:Xr,n:tt,c:nr,rb:nt,w:at,L:it,z:ot,j:ut,o:ct,sb:st,G:ft,T:lt,h:dt,u:mt,m:ht,i:pt,Na:vt,Oa:yt,Pa:xt,La:St,Ma:Tt,Qb:Bt,eb:Pt,cb:Rt,Y:Dt,qb:kt,la:It,bb:Ct,fb:_t,$a:Wt,Xb:Lt,N:At,gb:Gt,X:zt,Vb:$t,nb:fn,C:ln,ra:dn,qa:mn,pb:hn,W:pn,v:vn,mb:gn,lb:bn,kb:wn,ob:yn,jb:xn,ib:Sn,hb:Tn,Ua:Pn,Va:Cn,Ia:J,V:Mn,na:Rn,Ra:En,ma:Dn,Cb:xo,xa:po,Db:yo,ya:ho,F:to,e:Ni,s:zi,x:Gi,B:Ji,Fb:fo,ba:so,D:Yi,za:lo,$:vo,ga:co,Gb:uo,Hb:oo,Ba:no,Aa:io,Ib:ao,wa:wo,aa:mo,d:$i,A:Vi,r:Fi,Bb:So,t:ji,y:eo,H:qi,E:Hi,K:ro,R:go,ia:Qi,_:bo,Kb:Zi,Lb:Xi,Jb:Ki,g:kn,a:ue,Ob:Z,Eb:In,ha:_n,O:Wn,pa:Ln,Mb:Gn,ta:zn,Q:$n,yb:Nn,zb:Fn,ua:Vn,ea:Yn,P:qn,Ea:jn,va:Hn,Z:Xn,wb:Zn,_b:Qn,S:Jn,Ab:Kn,tb:ea,ub:ta,vb:na,fa:aa,xb:ia,Nb:oa}}}async function $(){function e(e,t){var n=_i=e.exports;e={};for(let[r,t]of Object.entries(n))\"function\"==typeof t?(n=Wr(t),e[r]=n):e[r]=t;return _i=e,_i=function(){var e=_i,r=e=>r=>e(r)>>>0,t=e=>()=>e()>>>0;return(e=Object.assign({},e)).ac=r(e.ac),e.Dc=t(e.Dc),e.Fc=r(e.Fc),e.sd=(e=>(r,t)=>e(r,t)>>>0)(e.sd),e.xd=r(e.xd),e.yd=t(e.yd),e.Cd=r(e.Cd),e}(),re.push(_i.jd),ua=(e=_i).ac,ca=e.bc,r._OrtInit=e.cc,r._OrtGetLastError=e.dc,r._OrtCreateSessionOptions=e.ec,r._OrtAppendExecutionProvider=e.fc,r._OrtAddFreeDimensionOverride=e.gc,r._OrtAddSessionConfigEntry=e.hc,r._OrtReleaseSessionOptions=e.ic,r._OrtCreateSession=e.jc,r._OrtReleaseSession=e.kc,r._OrtGetInputOutputCount=e.lc,r._OrtGetInputOutputMetadata=e.mc,r._OrtFree=e.nc,r._OrtCreateTensor=e.oc,r._OrtGetTensorData=e.pc,r._OrtReleaseTensor=e.qc,r._OrtCreateRunOptions=e.rc,r._OrtAddRunConfigEntry=e.sc,r._OrtReleaseRunOptions=e.tc,r._OrtCreateBinding=e.uc,r._OrtBindInput=e.vc,r._OrtBindOutput=e.wc,r._OrtClearBoundOutputs=e.xc,r._OrtReleaseBinding=e.yc,r._OrtRunWithBinding=e.zc,r._OrtRun=e.Ac,r._OrtEndProfiling=e.Bc,sa=r._OrtGetWebGpuDevice=e.Cc,fa=e.Dc,la=r._free=e.Ec,da=r._malloc=e.Fc,ma=r._wgpuBufferRelease=e.Gc,ha=r._wgpuCreateInstance=e.Hc,pa=e.Ic,va=e.Jc,ga=e.Kc,ba=e.Lc,wa=e.Mc,ya=e.Qc,xa=e._c,Sa=e.$c,Ta=e.ad,Oa=e.cd,Aa=e.dd,Ba=e.ed,Pa=e.fd,Ca=e.gd,Ma=e.hd,Ra=e.id,Ea=e.ld,Ua=e.md,Da=e.nd,ka=e.od,Ia=e.pd,_a=e.qd,Wa=e.rd,La=e.sd,Ga=e.td,za=e.ud,$a=e.vd,Na=e.wd,Fa=e.xd,Va=e.yd,Ya=e.zd,qa=e.Ad,ja=e.Bd,Ha=e.Cd,Xa=e.Dd,Za=e.Ed,Qa=e.Fd,Ja=e.Gd,Ka=e.Hd,ei=e.Id,ri=e.Jd,ti=e.Kd,ni=e.Ld,ai=e.Md,ii=e.Nd,oi=e.Od,ui=e.Pd,ci=e.Qd,si=e.Rd,fi=e.Sd,li=e.Ud,di=e.Vd,mi=e.Wd,hi=e.Xd,pi=e.Zd,vi=e._d,gi=e.$d,bi=e.ae,wi=e.be,yi=e.ce,xi=e.qe,Si=e.re,Ti=e.se,Oi=e.te,Ai=e.ue,Bi=e.ve,Pi=e.we,Ci=e.xe,Mi=e.ye,Ri=e.ze,Ei=e.Ae,Ui=e.$e,Di=e.af,ki=e.bf,Ii=e.cf,d=t,_i}var t,n=z();return r.instantiateWasm?new Promise(t=>{r.instantiateWasm(n,(r,n)=>{t(e(r,n))})}):a?e(new WebAssembly.Instance(d,z()),d):(I??=r.locateFile?r.locateFile?r.locateFile(\"ort-wasm-simd-threaded.asyncify.wasm\",f):f+\"ort-wasm-simd-threaded.asyncify.wasm\":new URL(\"ort-wasm-simd-threaded.asyncify.wasm\",import.meta.url).href,t=await async function(e){var r=I;if(!l&&!S(r))try{var t=fetch(r,{credentials:\"same-origin\"});return await WebAssembly.instantiateStreaming(t,e)}catch(e){y(`wasm streaming compile failed: ${e}`),y(\"falling back to ArrayBuffer instantiation\")}return async function(e,r){try{var t=await async function(e){if(!l)try{var r=await o(e);return new Uint8Array(r)}catch{}if(e==I&&l)e=new Uint8Array(l);else{if(!u)throw\"both async and sync fetching of the wasm failed\";e=u(e)}return e}(e);return await WebAssembly.instantiate(t,r)}catch(e){y(`failed to asynchronously prepare wasm: ${e}`),G(e)}}(r,e)}(n),e(t.instance,t.module))}class N{name=\"ExitStatus\";constructor(e){this.message=`Program terminated with exit(${e})`,this.status=e}}var F=e=>{e.terminate(),e.onmessage=()=>{}},V=[],Y=0,q=null,j=e=>{0==K.length&&(oe(),ie(K[0]));var r=K.pop();if(!r)return 6;ee.push(r),te[e.Oc]=r,r.Oc=e.Oc;var t={Pc:\"run\",ie:e.he,Xc:e.Xc,Oc:e.Oc};return r.postMessage(t,e.Zc),0},H=0,X=(e,r,...t)=>{var n,a=16*t.length,i=Va(),o=Fa(a),u=o>>>3;for(n of t)\"bigint\"==typeof n?((T(),D)[u++>>>0]=1n,(T(),D)[u++>>>0]=n):((T(),D)[u++>>>0]=0n,(T(),U)[u++>>>0]=n);return e=Da(e,0,a,o,r),Na(i),e};function Z(e){if(a)return X(0,1,e);if(m=e,!(0<H)){for(var r of ee)F(r);for(r of K)F(r);K=[],ee=[],te={},x=!0}c(0,new N(e))}function Q(e){if(a)return X(1,0,e);J(e)}var J=e=>{if(m=e,a)throw Q(e),\"unwind\";Z(e)},K=[],ee=[],re=[],te={},ne=e=>{var r=e.Oc;delete te[r],K.push(e),ee.splice(ee.indexOf(e),1),e.Oc=0,ka(r)};function ae(){re.forEach(e=>e())}var ie=e=>new Promise(t=>{e.onmessage=n=>{var a=n.data;if(n=a.Pc,a.Wc&&a.Wc!=fa()){var i=te[a.Wc];i?i.postMessage(a,a.Zc):y(`Internal error! Worker sent a message \"${n}\" to target pthread ${a.Wc}, but that thread no longer exists!`)}else\"checkMailbox\"===n?Mr():\"spawnThread\"===n?j(a):\"cleanupThread\"===n?Br(()=>{ne(te[a.je])}):\"loaded\"===n?(e.loaded=!0,t(e)):\"setimmediate\"===a.target?e.postMessage(a):\"uncaughtException\"===n?e.onerror(a.error):\"callHandler\"===n?r[a.de](...a.args):n&&y(`worker sent an unknown command ${n}`)},e.onerror=e=>{throw y(`worker sent an error! ${e.filename}:${e.lineno}: ${e.message}`),e};var n,a=[];for(n of[])r.propertyIsEnumerable(n)&&a.push(n);e.postMessage({Pc:\"load\",ee:a,ke:ue,le:d})});function oe(){var e=new Worker((()=>{const e=URL;return import.meta.url>\"file:\"&&import.meta.url<\"file;\"?new e(BUILD_DEFS.BUNDLE_FILENAME,import.meta.url):new URL(import.meta.url)})(),{type:\"module\",workerData:\"em-pthread\",name:\"em-pthread\"});K.push(e)}var ue,ce=(e,r)=>{H=0,e=Za(e,r),0<H?m=e:Ia(e)},se=[],fe=0,le=e=>-9007199254740992>e||9007199254740992<e?NaN:Number(e);function de(e){var r=new ge(e>>>=0);return 0==(T(),A)[r.Rc+12>>>0]&&(pe(r,!0),fe--),ve(r,!1),se.push(r),Ha(e)}var me=0,he=()=>{Ga(0,0);var e=se.pop();Ya(e.Yc),me=0};function pe(e,r){r=r?1:0,(T(),A)[e.Rc+12>>>0]=r}function ve(e,r){r=r?1:0,(T(),A)[e.Rc+13>>>0]=r}class ge{constructor(e){this.Yc=e,this.Rc=e-24}}var be=e=>{var r=me;if(!r)return za(0),0;var t=new ge(r);(T(),R)[t.Rc+16>>>2>>>0]=r;var n=(T(),R)[t.Rc+4>>>2>>>0];if(!n)return za(0),r;for(var a of e){if(0===a||a===n)break;if(ja(a,n,t.Rc+16))return za(a),r}return za(n),r};function we(){return be([])}function ye(e){return be([e>>>0])}function xe(e,r,t,n){return be([e>>>0,r>>>0,t>>>0,n>>>0])}var Se=()=>{var e=se.pop();e||G(\"no exception to throw\");var r=e.Yc;throw 0==(T(),A)[e.Rc+13>>>0]&&(se.push(e),ve(e,!0),pe(e,!1),fe++),qa(r),me=r};function Te(e,r,t){var n=new ge(e>>>=0);throw r>>>=0,t>>>=0,(T(),R)[n.Rc+16>>>2>>>0]=0,(T(),R)[n.Rc+4>>>2>>>0]=r,(T(),R)[n.Rc+8>>>2>>>0]=t,qa(e),fe++,me=e}var Oe=()=>fe;function Ae(e,r,t,n){return a?X(2,1,e,r,t,n):Be(e,r,t,n)}function Be(e,r,t,n){if(e>>>=0,r>>>=0,t>>>=0,n>>>=0,!globalThis.SharedArrayBuffer)return 6;var i=[];return a&&0===i.length?Ae(e,r,t,n):(e={he:t,Oc:e,Xc:n,Zc:i},a?(e.Pc=\"spawnThread\",postMessage(e,i),0):j(e))}function Pe(e){throw me||=e>>>0,me}var Ce=globalThis.TextDecoder&&new TextDecoder,Me=(e,r,t,n)=>{if(t=r+t,n)return t;for(;e[r]&&!(r>=t);)++r;return r},Re=(e,r=0,t,n)=>{if(16<(t=Me(e,r>>>=0,t,n))-r&&e.buffer&&Ce)return Ce.decode(e.buffer instanceof ArrayBuffer?e.subarray(r,t):e.slice(r,t));for(n=\"\";r<t;){var a=e[r++];if(128&a){var i=63&e[r++];if(192==(224&a))n+=String.fromCharCode((31&a)<<6|i);else{var o=63&e[r++];65536>(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&e[r++])?n+=String.fromCharCode(a):(a-=65536,n+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else n+=String.fromCharCode(a)}return n},Ee=(e,r,t)=>(e>>>=0)?Re((T(),B),e,r,t):\"\";function Ue(e,r,t){return a?X(3,1,e,r,t):0}function De(e,r){if(a)return X(4,1,e,r)}function ke(e,r){if(a)return X(5,1,e,r)}function Ie(e,r,t){if(a)return X(6,1,e,r,t)}function _e(e,r,t){return a?X(7,1,e,r,t):0}function We(e,r){if(a)return X(8,1,e,r)}function Le(e,r,t){if(a)return X(9,1,e,r,t)}function Ge(e,r,t,n){if(a)return X(10,1,e,r,t,n)}function ze(e,r,t,n){if(a)return X(11,1,e,r,t,n)}function $e(e,r,t,n){if(a)return X(12,1,e,r,t,n)}function Ne(e){if(a)return X(13,1,e)}function Fe(e,r){if(a)return X(14,1,e,r)}function Ve(e,r,t){if(a)return X(15,1,e,r,t)}var Ye=()=>G(\"\"),qe=e=>{e>>>=0;for(var r=\"\";;){var t=(T(),B)[e++>>>0];if(!t)return r;r+=String.fromCharCode(t)}},je={},He={},Xe={},Ze=class extends Error{constructor(e){super(e),this.name=\"BindingError\"}};function Qe(e,r,t={}){return function(e,r,t={}){var n=r.name;if(!e)throw new Ze(`type \"${n}\" must have a positive integer typeid pointer`);if(He.hasOwnProperty(e)){if(t.fe)return;throw new Ze(`Cannot register type '${n}' twice`)}He[e]=r,delete Xe[e],je.hasOwnProperty(e)&&(r=je[e],delete je[e],r.forEach(e=>e()))}(e,r,t)}var Je=(e,r,t)=>{switch(r){case 1:return t?e=>(T(),A)[e>>>0]:e=>(T(),B)[e>>>0];case 2:return t?e=>(T(),P)[e>>>1>>>0]:e=>(T(),C)[e>>>1>>>0];case 4:return t?e=>(T(),M)[e>>>2>>>0]:e=>(T(),R)[e>>>2>>>0];case 8:return t?e=>(T(),D)[e>>>3>>>0]:e=>(T(),k)[e>>>3>>>0];default:throw new TypeError(`invalid integer width (${r}): ${e}`)}};function Ke(e,r,t,n,a){e>>>=0,t>>>=0,r=qe(r>>>0);let i=e=>e;if(n=0n===n){const e=8*t;i=r=>BigInt.asUintN(e,r),a=i(a)}Qe(e,{name:r,Nc:i,Tc:(e,r)=>(\"number\"==typeof r&&(r=BigInt(r)),r),Sc:Je(r,t,!n),Uc:null})}function er(e,r,t,n){Qe(e>>>=0,{name:r=qe(r>>>0),Nc:function(e){return!!e},Tc:function(e,r){return r?t:n},Sc:function(e){return this.Nc((T(),B)[e>>>0])},Uc:null})}var rr=[],tr=[0,1,,1,null,1,!0,1,!1,1];function nr(e){9<(e>>>=0)&&0===--tr[e+1]&&(tr[e]=void 0,rr.push(e))}var ar=e=>{if(!e)throw new Ze(`Cannot use deleted val. handle = ${e}`);return tr[e]},ir=e=>{switch(e){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:const r=rr.pop()||tr.length;return tr[r]=e,tr[r+1]=1,r}};function or(e){return this.Nc((T(),R)[e>>>2>>>0])}var ur={name:\"emscripten::val\",Nc:e=>{var r=ar(e);return nr(e),r},Tc:(e,r)=>ir(r),Sc:or,Uc:null};function cr(e){return Qe(e>>>0,ur)}var sr=(e,r)=>{switch(r){case 4:return function(e){return this.Nc((T(),E)[e>>>2>>>0])};case 8:return function(e){return this.Nc((T(),U)[e>>>3>>>0])};default:throw new TypeError(`invalid float width (${r}): ${e}`)}};function fr(e,r,t){t>>>=0,Qe(e>>>=0,{name:r=qe(r>>>0),Nc:e=>e,Tc:(e,r)=>r,Sc:sr(r,t),Uc:null})}function lr(e,r,t,n,a){e>>>=0,t>>>=0,r=qe(r>>>0);let i=e=>e;if(0===n){var o=32-8*t;i=e=>e<<o>>>o,a=i(a)}Qe(e,{name:r,Nc:i,Tc:(e,r)=>r,Sc:Je(r,t,0!==n),Uc:null})}function dr(e,r,t){function n(e){var r=(T(),R)[e>>>2>>>0];return e=(T(),R)[e+4>>>2>>>0],new a((T(),A).buffer,e,r)}var a=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][r];Qe(e>>>=0,{name:t=qe(t>>>0),Nc:n,Sc:n},{fe:!0})}var mr=(e,r,t)=>{var n=(T(),B);if(r>>>=0,0<t){var a=r;t=r+t-1;for(var i=0;i<e.length;++i){var o=e.codePointAt(i);if(127>=o){if(r>=t)break;n[r++>>>0]=o}else if(2047>=o){if(r+1>=t)break;n[r++>>>0]=192|o>>6,n[r++>>>0]=128|63&o}else if(65535>=o){if(r+2>=t)break;n[r++>>>0]=224|o>>12,n[r++>>>0]=128|o>>6&63,n[r++>>>0]=128|63&o}else{if(r+3>=t)break;n[r++>>>0]=240|o>>18,n[r++>>>0]=128|o>>12&63,n[r++>>>0]=128|o>>6&63,n[r++>>>0]=128|63&o,i++}}n[r>>>0]=0,e=r-a}else e=0;return e},hr=e=>{for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);127>=n?r++:2047>=n?r+=2:55296<=n&&57343>=n?(r+=4,++t):r+=3}return r};function pr(e,r){Qe(e>>>=0,{name:r=qe(r>>>0),Nc(e){var r=(T(),R)[e>>>2>>>0];return r=Ee(e+4,r,!0),la(e),r},Tc(e,r){r instanceof ArrayBuffer&&(r=new Uint8Array(r));var t=\"string\"==typeof r;if(!(t||ArrayBuffer.isView(r)&&1==r.BYTES_PER_ELEMENT))throw new Ze(\"Cannot pass non-string to std::string\");var n=t?hr(r):r.length,a=da(4+n+1),i=a+4;return(T(),R)[a>>>2>>>0]=n,t?mr(r,i,n+1):(T(),B).set(r,i>>>0),null!==e&&e.push(la,a),a},Sc:or,Uc(e){la(e)}})}var vr=globalThis.TextDecoder?new TextDecoder(\"utf-16le\"):void 0,gr=(e,r,t)=>{if(e>>>=1,16<(r=Me((T(),C),e,r/2,t))-e&&vr)return vr.decode((T(),C).slice(e,r));for(t=\"\";e<r;++e){var n=(T(),C)[e>>>0];t+=String.fromCharCode(n)}return t},br=(e,r,t)=>{if(t??=2147483647,2>t)return 0;var n=r;t=(t-=2)<2*e.length?t/2:e.length;for(var a=0;a<t;++a){var i=e.charCodeAt(a);(T(),P)[r>>>1>>>0]=i,r+=2}return(T(),P)[r>>>1>>>0]=0,r-n},wr=e=>2*e.length,yr=(e,r,t)=>{var n=\"\";e>>>=2;for(var a=0;!(a>=r/4);a++){var i=(T(),R)[e+a>>>0];if(!i&&!t)break;n+=String.fromCodePoint(i)}return n},xr=(e,r,t)=>{if(r>>>=0,t??=2147483647,4>t)return 0;var n=r;t=n+t-4;for(var a=0;a<e.length;++a){var i=e.codePointAt(a);if(65535<i&&a++,(T(),M)[r>>>2>>>0]=i,(r+=4)+4>t)break}return(T(),M)[r>>>2>>>0]=0,r-n},Sr=e=>{for(var r=0,t=0;t<e.length;++t)65535<e.codePointAt(t)&&t++,r+=4;return r};function Tr(e,r,t){if(e>>>=0,r>>>=0,t=qe(t>>>=0),2===r)var n=gr,a=br,i=wr;else n=yr,a=xr,i=Sr;Qe(e,{name:t,Nc:e=>{var t=(T(),R)[e>>>2>>>0];return t=n(e+4,t*r,!0),la(e),t},Tc:(e,n)=>{if(\"string\"!=typeof n)throw new Ze(`Cannot pass non-string to C++ string type ${t}`);var o=i(n),u=da(4+o+r);return(T(),R)[u>>>2>>>0]=o/r,a(n,u+4,o+r),null!==e&&e.push(la,u),u},Sc:or,Uc(e){la(e)}})}function Or(e,r){Qe(e>>>=0,{ge:!0,name:r=qe(r>>>0),Nc:()=>{},Tc:()=>{}})}function Ar(e){Ea(e>>>0,!n,1,!t,131072,!1),ae()}var Br=e=>{if(!x)try{if(e(),!(0<H))try{a?fa()&&Ia(m):J(m)}catch(e){e instanceof N||\"unwind\"==e||c(0,e)}}catch(e){e instanceof N||\"unwind\"==e||c(0,e)}},Pr=!Atomics.waitAsync||globalThis.navigator?.userAgent&&91>Number((navigator.userAgent.match(/Chrom(e|ium)\\/([0-9]+)\\./)||[])[2]);function Cr(e){e>>>=0,Pr||(Atomics.waitAsync((T(),M),e>>>2,e).value.then(Mr),e+=128,Atomics.store((T(),M),e>>>2,1))}var Mr=()=>Br(()=>{var e=fa();e&&(Cr(e),Wa())});function Rr(e,r){(e>>>=0)==r>>>0?setTimeout(Mr):a?postMessage({Wc:e,Pc:\"checkMailbox\"}):(e=te[e])&&e.postMessage({Pc:\"checkMailbox\"})}var Er=[];function Ur(e,r,t,n,a){for(r>>>=0,a>>>=0,Er.length=0,t=a>>>3,n=a+n>>>3;t<n;){var i;i=(T(),D)[t++>>>0]?(T(),D)[t++>>>0]:(T(),U)[t++>>>0],Er.push(i)}return(r?Li[r]:Wi[e])(...Er)}var Dr=()=>{H=0};function kr(e){e>>>=0,a?postMessage({Pc:\"cleanupThread\",je:e}):ne(te[e])}function Ir(e){}var _r=e=>{try{e()}catch(e){G(e)}};function Wr(e){var r=(...r)=>{$r.push(e);try{return e(...r)}finally{x||($r.pop(),Gr&&1===Lr&&0===$r.length&&(Lr=0,H+=1,_r(Di),\"undefined\"!=typeof Fibers&&Fibers.De()))}};return Vr.set(e,r),r}var Lr=0,Gr=null,zr=0,$r=[],Nr=new Map,Fr=new Map,Vr=new Map,Yr=0,qr=null,jr=[];var Hr=e=>function(e){if(!x){if(0===Lr){var r=!1,t=!1;e((e=0)=>{if(!x&&(zr=e,r=!0,t)){Lr=2,_r(()=>ki(Gr)),\"undefined\"!=typeof MainLoop&&MainLoop.Yd&&MainLoop.resume(),e=!1;try{var n=function(){var e=(T(),M)[Gr+8>>>2>>>0];return e=Fr.get(e),e=Vr.get(e),--H,e()}()}catch(r){n=r,e=!0}var a=!1;if(!Gr){var i=qr;i&&(qr=null,(e?i.reject:i.resolve)(n),a=!0)}if(e&&!a)throw n}}),t=!0,r||(Lr=1,Gr=function(){var e=da(65548),r=e+12;if((T(),R)[e>>>2>>>0]=r,(T(),R)[e+4>>>2>>>0]=r+65536,r=$r[0],!Nr.has(r)){var t=Yr++;Nr.set(r,t),Fr.set(t,r)}return r=Nr.get(r),(T(),M)[e+8>>>2>>>0]=r,e}(),\"undefined\"!=typeof MainLoop&&MainLoop.Yd&&MainLoop.pause(),_r(()=>Ui(Gr)))}else 2===Lr?(Lr=0,_r(Ii),la(Gr),Gr=null,jr.forEach(Br)):G(`invalid state: ${Lr}`);return zr}}(r=>{e().then(r)});function Xr(e){return e>>>=0,Hr(async()=>{var r=await ar(e);return ir(r)})}var Zr=[],Qr=e=>{var r=Zr.length;return Zr.push(e),r},Jr=(e,r)=>{for(var t=Array(e),n=0;n<e;++n){var a=n,i=(T(),R)[r+4*n>>>2>>>0],o=He[i];if(void 0===o)throw e=`parameter ${n}`,i=ua(i),r=qe(i),la(i),new Ze(`${e} has unknown type ${r}`);t[a]=o}return t},Kr=(e,r,t)=>{var n=[];return e=e(n,t),n.length&&((T(),R)[r>>>2>>>0]=ir(n)),e},et={},rt=e=>{var r=et[e];return void 0===r?qe(e):r};function tt(e,r,t){var[n,...a]=Jr(e,r>>>0);r=n.Tc.bind(n);var i=a.map(e=>e.Sc.bind(e));e--;var o={toValue:ar};switch(e=i.map((e,r)=>{var t=`argFromPtr${r}`;return o[t]=e,`${t}(args${r?\"+\"+8*r:\"\"})`}),t){case 0:var u=\"toValue(handle)\";break;case 2:u=\"new (toValue(handle))\";break;case 3:u=\"\";break;case 1:o.getStringOrSymbol=rt,u=\"toValue(handle)[getStringOrSymbol(methodName)]\"}return u+=`(${e})`,n.ge||(o.toReturnWire=r,o.emval_returnValue=Kr,u=`return emval_returnValue(toReturnWire, destructorsRef, ${u})`),u=`return function (handle, methodName, destructorsRef, args) {\\n  ${u}\\n  }`,t=new Function(Object.keys(o),u)(...Object.values(o)),u=`methodCaller<(${a.map(e=>e.name)}) => ${n.name}>`,Qr(Object.defineProperty(t,\"name\",{value:u}))}function nt(e,r){return r>>>=0,(e=ar(e>>>0))==ar(r)}function at(e){return(e>>>=0)?(e=rt(e),ir(globalThis[e])):ir(globalThis)}function it(e){return e=rt(e>>>0),ir(r[e])}function ot(e,r){return r>>>=0,e=ar(e>>>0),r=ar(r),ir(e[r])}function ut(e){9<(e>>>=0)&&(tr[e+1]+=1)}function ct(e,r,t,n,a){return Zr[e>>>0](r>>>0,t>>>0,n>>>0,a>>>0)}function st(e,r,t,n,a){return ct(e>>>0,r>>>0,t>>>0,n>>>0,a>>>0)}function ft(){return ir([])}function lt(e){e=ar(e>>>0);for(var r=Array(e.length),t=0;t<e.length;t++)r[t]=e[t];return ir(r)}function dt(e){return ir(rt(e>>>0))}function mt(){return ir({})}function ht(e){for(var r=ar(e>>>=0);r.length;){var t=r.pop();r.pop()(t)}nr(e)}function pt(e,r,t){r>>>=0,t>>>=0,e=ar(e>>>0),r=ar(r),t=ar(t),e[r]=t}function vt(e,r){e=le(e),r>>>=0,e=new Date(1e3*e),(T(),M)[r>>>2>>>0]=e.getUTCSeconds(),(T(),M)[r+4>>>2>>>0]=e.getUTCMinutes(),(T(),M)[r+8>>>2>>>0]=e.getUTCHours(),(T(),M)[r+12>>>2>>>0]=e.getUTCDate(),(T(),M)[r+16>>>2>>>0]=e.getUTCMonth(),(T(),M)[r+20>>>2>>>0]=e.getUTCFullYear()-1900,(T(),M)[r+24>>>2>>>0]=e.getUTCDay(),e=(e.getTime()-Date.UTC(e.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,(T(),M)[r+28>>>2>>>0]=e}var gt=e=>0==e%4&&(0!=e%100||0==e%400),bt=[0,31,60,91,121,152,182,213,244,274,305,335],wt=[0,31,59,90,120,151,181,212,243,273,304,334];function yt(e,r){e=le(e),r>>>=0,e=new Date(1e3*e),(T(),M)[r>>>2>>>0]=e.getSeconds(),(T(),M)[r+4>>>2>>>0]=e.getMinutes(),(T(),M)[r+8>>>2>>>0]=e.getHours(),(T(),M)[r+12>>>2>>>0]=e.getDate(),(T(),M)[r+16>>>2>>>0]=e.getMonth(),(T(),M)[r+20>>>2>>>0]=e.getFullYear()-1900,(T(),M)[r+24>>>2>>>0]=e.getDay();var t=(gt(e.getFullYear())?bt:wt)[e.getMonth()]+e.getDate()-1|0;(T(),M)[r+28>>>2>>>0]=t,(T(),M)[r+36>>>2>>>0]=-60*e.getTimezoneOffset(),t=new Date(e.getFullYear(),6,1).getTimezoneOffset();var n=new Date(e.getFullYear(),0,1).getTimezoneOffset();e=0|(t!=n&&e.getTimezoneOffset()==Math.min(n,t)),(T(),M)[r+32>>>2>>>0]=e}function xt(e){e>>>=0;var r=new Date((T(),M)[e+20>>>2>>>0]+1900,(T(),M)[e+16>>>2>>>0],(T(),M)[e+12>>>2>>>0],(T(),M)[e+8>>>2>>>0],(T(),M)[e+4>>>2>>>0],(T(),M)[e>>>2>>>0],0),t=(T(),M)[e+32>>>2>>>0],n=r.getTimezoneOffset(),a=new Date(r.getFullYear(),6,1).getTimezoneOffset(),i=new Date(r.getFullYear(),0,1).getTimezoneOffset(),o=Math.min(i,a);return 0>t?(T(),M)[e+32>>>2>>>0]=Number(a!=i&&o==n):0<t!=(o==n)&&(a=Math.max(i,a),r.setTime(r.getTime()+6e4*((0<t?o:a)-n))),(T(),M)[e+24>>>2>>>0]=r.getDay(),t=(gt(r.getFullYear())?bt:wt)[r.getMonth()]+r.getDate()-1|0,(T(),M)[e+28>>>2>>>0]=t,(T(),M)[e>>>2>>>0]=r.getSeconds(),(T(),M)[e+4>>>2>>>0]=r.getMinutes(),(T(),M)[e+8>>>2>>>0]=r.getHours(),(T(),M)[e+12>>>2>>>0]=r.getDate(),(T(),M)[e+16>>>2>>>0]=r.getMonth(),(T(),M)[e+20>>>2>>>0]=r.getYear(),e=r.getTime(),BigInt(isNaN(e)?-1:e/1e3)}function St(e,r,t,n,i,o,u){return a?X(16,1,e,r,t,n,i,o,u):-52}function Tt(e,r,t,n,i,o){if(a)return X(17,1,e,r,t,n,i,o)}var Ot={},At=()=>performance.timeOrigin+performance.now();function Bt(e,r){if(a)return X(18,1,e,r);if(Ot[e]&&(clearTimeout(Ot[e].id),delete Ot[e]),!r)return 0;var t=setTimeout(()=>{delete Ot[e],Br(()=>_a(e,performance.timeOrigin+performance.now()))},r);return Ot[e]={id:t,Ce:r},0}function Pt(e,r,t,n){e>>>=0,r>>>=0,t>>>=0,n>>>=0;var a=(new Date).getFullYear(),i=new Date(a,0,1).getTimezoneOffset();a=new Date(a,6,1).getTimezoneOffset();var o=Math.max(i,a);(T(),R)[e>>>2>>>0]=60*o,(T(),M)[r>>>2>>>0]=Number(i!=a),e=(r=e=>{var r=Math.abs(e);return`UTC${0<=e?\"-\":\"+\"}${String(Math.floor(r/60)).padStart(2,\"0\")}${String(r%60).padStart(2,\"0\")}`})(i),r=r(a),a<i?(mr(e,t,17),mr(r,n,17)):(mr(e,n,17),mr(r,t,17))}var Ct=()=>Date.now(),Mt=1;function Rt(e,r,t){if(t>>>=0,!(0<=e&&3>=e))return 28;if(0===e)e=Date.now();else{if(!Mt)return 52;e=performance.timeOrigin+performance.now()}return e=Math.round(1e6*e),(T(),D)[t>>>3>>>0]=BigInt(e),0}var Et=[],Ut=(e,r)=>{Et.length=0;for(var t;t=(T(),B)[e++>>>0];){var n=105!=t;r+=(n&=112!=t)&&r%8?4:0,Et.push(112==t?(T(),R)[r>>>2>>>0]:106==t?(T(),D)[r>>>3>>>0]:105==t?(T(),M)[r>>>2>>>0]:(T(),U)[r>>>3>>>0]),r+=n?8:4}return Et};function Dt(e,r,t){return e>>>=0,r=Ut(r>>>0,t>>>0),Li[e](...r)}function kt(e,r,t){return e>>>=0,r=Ut(r>>>0,t>>>0),Li[e](...r)}var It=()=>{};function _t(e,r){return y(Ee(e>>>0,r>>>0))}var Wt=()=>{throw H+=1,\"unwind\"};function Lt(){return 4294901760}var Gt=()=>1,zt=()=>navigator.hardwareConcurrency;function $t(e){e>>>=0;var r=(T(),B).length;if(e<=r||4294901760<e)return!1;for(var t=1;4>=t;t*=2){var n=r*(1+.2/t);n=Math.min(n,e+100663296);e:{n=(Math.min(4294901760,65536*Math.ceil(Math.max(e,n)/65536))-ue.buffer.byteLength+65535)/65536|0;try{ue.grow(n),W();var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1}var Nt=e=>{var r=hr(e)+1,t=Fa(r);return mr(e,t,r),t},Ft=(e,r)=>{(T(),R)[e>>>2>>>0]=r;var t=(T(),R)[e>>>2>>>0];(T(),R)[e+4>>>2>>>0]=(r-t)/4294967296},Vt=e=>(T(),R)[e>>>2>>>0]+4294967296*(T(),M)[e+4>>>2>>>0],Yt=[],qt=(e,r)=>{Yt[e>>>0]=r},jt=[],Ht=[],Xt=(e,r)=>{Ht[e]=new Promise(t=>r.finally(()=>t(e)))},Zt=e=>{if(e)return Yt[e>>>0]},Qt=(e,r)=>{for(e=(T(),R)[e>>>2>>>0];e;e=(T(),R)[e>>>2>>>0])r[(T(),M)[e+4>>>2>>>0]](e)},Jt=(e,r,t)=>{(T(),R)[e>>>2>>>0]=r,(T(),R)[e+4>>>2>>>0]=t},Kt=e=>{var r=(T(),R)[e>>>2>>>0];return e=(T(),R)[e+4>>>2>>>0],Ee(r,e)},en=e=>{var r=(T(),R)[e>>>2>>>0];return e=(T(),R)[e+4>>>2>>>0],r?Ee(r,e):0===e?\"\":void 0},rn=e=>{var r=en(e+4),t=(t=(T(),R)[e+12>>>2>>>0])?Zt(t):\"auto\";if(e+=16){var n=Zt((T(),R)[e+4>>>2>>>0]),a=(T(),R)[e+16>>>2>>>0],i=(T(),R)[e+20>>>2>>>0];if(a){for(var o={},u=0;u<a;++u){var c=i+24*u;o[Kt(c+4)]=(T(),U)[c+16>>>3>>>0]}a=o}else a=void 0;e={module:n,constants:a,entryPoint:en(e+8)}}else e=void 0;return{label:r,layout:t,compute:e}},tn=(e,r)=>{function t(t,n){t=e[t],(T(),R)[r+n>>>2>>>0]=t}t(\"maxTextureDimension1D\",4),t(\"maxTextureDimension2D\",8),t(\"maxTextureDimension3D\",12),t(\"maxTextureArrayLayers\",16),t(\"maxBindGroups\",20),t(\"maxBindGroupsPlusVertexBuffers\",24),t(\"maxBindingsPerBindGroup\",28),t(\"maxDynamicUniformBuffersPerPipelineLayout\",32),t(\"maxDynamicStorageBuffersPerPipelineLayout\",36),t(\"maxSampledTexturesPerShaderStage\",40),t(\"maxSamplersPerShaderStage\",44),t(\"maxStorageBuffersPerShaderStage\",48),t(\"maxStorageTexturesPerShaderStage\",52),t(\"maxUniformBuffersPerShaderStage\",56),t(\"minUniformBufferOffsetAlignment\",80),t(\"minStorageBufferOffsetAlignment\",84),Ft(r+64,e.maxUniformBufferBindingSize),Ft(r+72,e.maxStorageBufferBindingSize),t(\"maxVertexBuffers\",88),Ft(r+96,e.maxBufferSize),t(\"maxVertexAttributes\",104),t(\"maxVertexBufferArrayStride\",108),t(\"maxInterStageShaderVariables\",112),t(\"maxColorAttachments\",116),t(\"maxColorAttachmentBytesPerSample\",120),t(\"maxComputeWorkgroupStorageSize\",124),t(\"maxComputeInvocationsPerWorkgroup\",128),t(\"maxComputeWorkgroupSizeX\",132),t(\"maxComputeWorkgroupSizeY\",136),t(\"maxComputeWorkgroupSizeZ\",140),t(\"maxComputeWorkgroupsPerDimension\",144),void 0!==e.Be&&t(\"maxImmediateSize\",148)},nn=[,\"validation\",\"out-of-memory\",\"internal\"],an=[,\"compatibility\",\"core\"],on={1:\"core-features-and-limits\",2:\"depth-clip-control\",3:\"depth32float-stencil8\",4:\"texture-compression-bc\",5:\"texture-compression-bc-sliced-3d\",6:\"texture-compression-etc2\",7:\"texture-compression-astc\",8:\"texture-compression-astc-sliced-3d\",9:\"timestamp-query\",10:\"indirect-first-instance\",11:\"shader-f16\",12:\"rg11b10ufloat-renderable\",13:\"bgra8unorm-storage\",14:\"float32-filterable\",15:\"float32-blendable\",16:\"clip-distances\",17:\"dual-source-blending\",18:\"subgroups\",19:\"texture-formats-tier1\",20:\"texture-formats-tier2\",21:\"primitive-index\",22:\"texture-component-swizzle\",327692:\"chromium-experimental-unorm16-texture-formats\",327729:\"chromium-experimental-multi-draw-indirect\"},un=[,\"low-power\",\"high-performance\"],cn=[,\"occlusion\",\"timestamp\"],sn={undefined:1,unknown:1,destroyed:2};function fn(e,r,t,n,a,i){r=le(r),t=le(t),n>>>=0,a>>>=0,i>>>=0;var o=Zt(e>>>0);if(e={},i){var u=(T(),R)[i+12>>>2>>>0];if(u){var c=(T(),R)[i+16>>>2>>>0];e.requiredFeatures=Array.from((T(),R).subarray(c>>>2>>>0,c+4*u>>>2>>>0),e=>on[e])}var s=(T(),R)[i+20>>>2>>>0];if(s){var f={};function l(e,r,t=!1){r=s+r,4294967295==(r=(T(),R)[r>>>2>>>0])||t&&0==r||(f[e]=r)}function d(e,r){r=s+r;var t=(T(),R)[r>>>2>>>0],n=(T(),R)[r+4>>>2>>>0];4294967295==t&&4294967295==n||(f[e]=Vt(r))}l(\"maxTextureDimension1D\",4),l(\"maxTextureDimension2D\",8),l(\"maxTextureDimension3D\",12),l(\"maxTextureArrayLayers\",16),l(\"maxBindGroups\",20),l(\"maxBindGroupsPlusVertexBuffers\",24),l(\"maxDynamicUniformBuffersPerPipelineLayout\",32),l(\"maxDynamicStorageBuffersPerPipelineLayout\",36),l(\"maxSampledTexturesPerShaderStage\",40),l(\"maxSamplersPerShaderStage\",44),l(\"maxStorageBuffersPerShaderStage\",48),l(\"maxStorageTexturesPerShaderStage\",52),l(\"maxUniformBuffersPerShaderStage\",56),l(\"minUniformBufferOffsetAlignment\",80),l(\"minStorageBufferOffsetAlignment\",84),d(\"maxUniformBufferBindingSize\",64),d(\"maxStorageBufferBindingSize\",72),l(\"maxVertexBuffers\",88),d(\"maxBufferSize\",96),l(\"maxVertexAttributes\",104),l(\"maxVertexBufferArrayStride\",108),l(\"maxInterStageShaderVariables\",112),l(\"maxColorAttachments\",116),l(\"maxColorAttachmentBytesPerSample\",120),l(\"maxComputeWorkgroupStorageSize\",124),l(\"maxComputeInvocationsPerWorkgroup\",128),l(\"maxComputeWorkgroupSizeX\",132),l(\"maxComputeWorkgroupSizeY\",136),l(\"maxComputeWorkgroupSizeZ\",140),l(\"maxComputeWorkgroupsPerDimension\",144),l(\"maxImmediateSize\",148,!0),e.requiredLimits=f}(u=(T(),R)[i+24>>>2>>>0])&&(u={label:en(u+4)},e.defaultQueue=u),e.label=en(i+4)}H+=1,Xt(r,o.requestDevice(e).then(e=>{--H,Br(()=>{Yt[a>>>0]=e.queue,Yt[n>>>0]=e,H+=1,Xt(t,e.lost.then(r=>{Br(()=>{e.onuncapturederror=()=>{};var n=Va(),a=Nt(r.message);Aa(t,sn[r.reason],a),Na(n)}),--H})),e.onuncapturederror=e=>{var r=5;e.error instanceof GPUValidationError?r=2:e.error instanceof GPUOutOfMemoryError?r=3:e.error instanceof GPUInternalError&&(r=4);var t=Va();e=Nt(e.error.message),Ra(n,r,e),Na(t)},\"adapterInfo\"in e||(e.adapterInfo=o.info),Ma(r,1,n,0)})},e=>{--H,Br(()=>{var a=Va(),i=Nt(e.message);Ma(r,3,n,i),t&&Aa(t,4,i),Na(a)})}))}function ln(e){var r=Zt(e>>>=0),t=jt[e];if(t){for(var n=0;n<t.length;++n)t[n]();delete jt[e]}r.destroy()}function dn(e,r,t){t>>>=0;var n=Zt(e>>>=0);4294967295==t&&(t=void 0);try{var a=n.getMappedRange(r>>>0,t)}catch(e){return 0}var i=La(16,a.byteLength);return(T(),B).set(new Uint8Array(a),i>>>0),jt[e].push(()=>la(i)),i}function mn(e,r,t){t>>>=0;var n=Zt(e>>>=0);4294967295==t&&(t=void 0);try{var a=n.getMappedRange(r>>>0,t)}catch(e){return 0}var i=La(16,a.byteLength);return(T(),B).fill(0,i,a.byteLength),jt[e].push(()=>{new Uint8Array(a).set((T(),B).subarray(i>>>0,i+a.byteLength>>>0)),la(i)}),i}function hn(e,r,t,n,a){e>>>=0,r=le(r),t=le(t),a>>>=0;var i=Zt(e);jt[e]=[],4294967295==a&&(a=void 0),H+=1,Xt(r,i.mapAsync(t,n>>>0,a).then(()=>{--H,Br(()=>{Ba(r,1,0)})},t=>{--H,Br(()=>{Va();var n=Nt(t.message);Ba(r,\"AbortError\"===t.name?4:\"OperationError\"===t.name?3:0,n),delete jt[e]})}))}function pn(e){var r=Zt(e>>>=0),t=jt[e];if(t){for(var n=0;n<t.length;++n)t[n]();delete jt[e],r.unmap()}}function vn(e){delete Yt[e>>>0]}function gn(e,r,t){e>>>=0,r>>>=0,t>>>=0;var n=!!(T(),R)[r+32>>>2>>>0];r={label:en(r+4),usage:(T(),R)[r+16>>>2>>>0],size:Vt(r+24),mappedAtCreation:n},e=Zt(e);try{var a=e.createBuffer(r)}catch(e){return!1}return Yt[t>>>0]=a,n&&(jt[t]=[]),!0}function bn(e,r,t,n){e>>>=0,r=le(r),n>>>=0,t=rn(t>>>0),e=Zt(e),H+=1,Xt(r,e.createComputePipelineAsync(t).then(e=>{--H,Br(()=>{Yt[n>>>0]=e,Oa(r,1,n,0)})},e=>{--H,Br(()=>{var t=Va(),a=Nt(e.message);Oa(r,\"validation\"===e.reason?3:\"internal\"===e.reason?4:0,n,a),Na(t)})}))}function wn(e,r,t){e>>>=0,r>>>=0,t>>>=0;var n=(T(),R)[r>>>2>>>0],a=(T(),M)[n+4>>>2>>>0];r={label:en(r+4),code:\"\"},2===a&&(r.code=Kt(n+8)),e=Zt(e).createShaderModule(r),Yt[t>>>0]=e}var yn=e=>{(e=Zt(e)).onuncapturederror=null,e.destroy()};function xn(e,r){r=le(r),e=Zt(e>>>0),H+=1,Xt(r,e.popErrorScope().then(e=>{--H,Br(()=>{var t=5;e?e instanceof GPUValidationError?t=2:e instanceof GPUOutOfMemoryError?t=3:e instanceof GPUInternalError&&(t=4):t=1;var n=Va(),a=e?Nt(e.message):0;Pa(r,1,t,a),Na(n)})},e=>{--H,Br(()=>{var t=Va(),n=Nt(e.message);Pa(r,1,5,n),Na(t)})}))}function Sn(e,r,t,n){if(r=le(r),n>>>=0,t>>>=0){var a={featureLevel:an[(T(),M)[t+4>>>2>>>0]],powerPreference:un[(T(),M)[t+8>>>2>>>0]],forceFallbackAdapter:!!(T(),R)[t+12>>>2>>>0]};0!==(e=(T(),R)[t>>>2>>>0])&&(T(),a.Fe=!!(T(),R)[e+8>>>2>>>0])}\"gpu\"in navigator?(H+=1,Xt(r,navigator.gpu.requestAdapter(a).then(e=>{--H,Br(()=>{if(e)Yt[n>>>0]=e,Ca(r,1,n,0);else{var t=Va(),a=Nt(\"WebGPU not available on this browser (requestAdapter returned null)\");Ca(r,3,n,a),Na(t)}})},e=>{--H,Br(()=>{var t=Va(),a=Nt(e.message);Ca(r,4,n,a),Na(t)})}))):(a=Va(),e=Nt(\"WebGPU not available on this browser (navigator.gpu is not available)\"),Ca(r,3,n,e),Na(a))}function Tn(e,r,t){return e>>>=0,r>>>=0,t>>>=0,Hr(async()=>{var n=[];if(t){var a=(T(),M)[t>>>2>>>0];n.length=r+1,n[r]=new Promise(e=>setTimeout(e,a,0))}else n.length=r;for(var i=0;i<r;++i){var o=Vt(e+8*i);if(!(o in Ht))return o;n[i]=Ht[o]}return n=await Promise.race(n),delete Ht[n],n})}var On,An={},Bn=()=>{if(!On){var e,r={USER:\"web_user\",LOGNAME:\"web_user\",PATH:\"/\",PWD:\"/\",HOME:\"/home/web_user\",LANG:(globalThis.navigator?.language??\"C\").replace(\"-\",\"_\")+\".UTF-8\",_:\"./this.program\"};for(e in An)void 0===An[e]?delete r[e]:r[e]=An[e];var t=[];for(e in r)t.push(`${e}=${r[e]}`);On=t}return On};function Pn(e,r){if(a)return X(19,1,e,r);e>>>=0,r>>>=0;var t,n=0,i=0;for(t of Bn()){var o=r+n;(T(),R)[e+i>>>2>>>0]=o,n+=mr(t,o,1/0)+1,i+=4}return 0}function Cn(e,r){if(a)return X(20,1,e,r);e>>>=0,r>>>=0;var t=Bn();for(var n of((T(),R)[e>>>2>>>0]=t.length,e=0,t))e+=hr(n)+1;return(T(),R)[r>>>2>>>0]=e,0}function Mn(e){return a?X(21,1,e):52}function Rn(e,r,t,n){return a?X(22,1,e,r,t,n):52}function En(e,r,t,n){return a?X(23,1,e,r,t,n):70}var Un=[null,[],[]];function Dn(e,r,t,n){if(a)return X(24,1,e,r,t,n);r>>>=0,t>>>=0,n>>>=0;for(var i=0,o=0;o<t;o++){var u=(T(),R)[r>>>2>>>0],c=(T(),R)[r+4>>>2>>>0];r+=8;for(var s=0;s<c;s++){var f=e,l=(T(),B)[u+s>>>0],d=Un[f];0===l||10===l?((1===f?w:y)(Re(d)),d.length=0):d.push(l)}i+=c}return(T(),R)[n>>>2>>>0]=i,0}function kn(e){return e>>>0}function In(e,r){return tn(Zt(e>>>0).limits,r>>>0),1}function _n(e,r){return Zt(e>>>0).features.has(on[r])}function Wn(e){return BigInt(Zt(e>>>0).size)}function Ln(e){return BigInt(Zt(e>>>0).usage)}function Gn(e,r){if(e>>>=0,r>>>=0){var t=en(r+4);t={label:t,timestampWrites:r=0!==(r=(T(),R)[r+12>>>2>>>0])?{querySet:Zt((T(),R)[r+4>>>2>>>0]),beginningOfPassWriteIndex:(T(),R)[r+8>>>2>>>0],endOfPassWriteIndex:(T(),R)[r+12>>>2>>>0]}:void 0}}return r=Zt(e),e=wa(0),t=r.beginComputePass(t),Yt[e>>>0]=t,e}function zn(e,r,t,n){t=le(t),-1==(n=le(n))&&(n=void 0),(e=Zt(e>>>0)).clearBuffer(Zt(r>>>0),t,n)}function $n(e,r,t,n,a,i){t=le(t),a=le(a),i=le(i),Zt(e>>>0).copyBufferToBuffer(Zt(r>>>0),t,Zt(n>>>0),a,i)}function Nn(e){var r=Zt(e>>>0);return e=ga(0),r=r.finish(),Yt[e>>>0]=r,e}function Fn(e,r,t,n,a,i){i=le(i),Zt(e>>>0).resolveQuerySet(Zt(r>>>0),t,n,Zt(a>>>0),i)}function Vn(e,r,t,n){Zt(e>>>0).dispatchWorkgroups(r,t,n)}function Yn(e,r,t){t=le(t),Zt(e>>>0).dispatchWorkgroupsIndirect(Zt(r>>>0),t)}function qn(e){Zt(e>>>0).end()}function jn(e,r,t,n,a){n>>>=0,a>>>=0,e=Zt(e>>>0),t=Zt(t>>>0),0==n?e.setBindGroup(r,t):e.setBindGroup(r,t,(T(),R),a>>>2,n)}function Hn(e,r){Zt(e>>>0).setPipeline(Zt(r>>>0))}function Xn(e,r,t){Zt(e>>>0).Ee(Zt(r>>>0),t)}function Zn(e,r){var t=Zt(e>>>0);return e=va(0),r=t.getBindGroupLayout(r),Yt[e>>>0]=r,e}function Qn(e,r){function t(e){var r=(T(),R)[e+8>>>2>>>0],t=(T(),R)[e+32>>>2>>>0],n=(T(),R)[e+36>>>2>>>0],a=0;return Qt(e,{327681:e=>{a=(T(),R)[e+8>>>2>>>0]}}),r?(-1==(t=Vt(e+24))&&(t=void 0),r={buffer:Zt(r),offset:Vt(e+16),size:t}):r=Zt(t||n||a),{binding:(T(),R)[e+4>>>2>>>0],resource:r}}e>>>=0,r={label:en((r>>>=0)+4),layout:Zt((T(),R)[r+12>>>2>>>0]),entries:function(e,r){for(var n=[],a=0;a<e;++a)n.push(t(r+40*a));return n}((T(),R)[r+16>>>2>>>0],(T(),R)[r+20>>>2>>>0])},e=Zt(e);var n=pa(0);return qt(n,e.createBindGroup(r)),n}function Jn(e,r){var t;return e>>>=0,(r>>>=0)&&(t={label:en(r+4)}),r=Zt(e),e=ba(0),t=r.createCommandEncoder(t),Yt[e>>>0]=t,e}function Kn(e,r){e>>>=0,r>>>=0,r={type:cn[(T(),M)[r+12>>>2>>>0]],count:(T(),R)[r+16>>>2>>>0]};var t=Zt(e);return e=ya(0),r=t.createQuerySet(r),Yt[e>>>0]=r,e}function ea(e,r){e=Zt(e>>>0).adapterInfo,r>>>=0,(T(),R)[r+52>>>2>>>0]=e.subgroupMinSize,(T(),R)[r+56>>>2>>>0]=e.subgroupMaxSize;var t=e.vendor+e.architecture+e.device+e.description,n=hr(t)+1,a=da(n);return a&&mr(t,a,n),t=a,n=hr(e.vendor),Jt(r+4,t,n),t+=n,n=hr(e.architecture),Jt(r+12,t,n),t+=n,n=hr(e.device),Jt(r+20,t,n),Jt(r+28,t+n,hr(e.description)),(T(),M)[r+36>>>2>>>0]=2,e=e.isFallbackAdapter?3:4,(T(),M)[r+40>>>2>>>0]=e,(T(),R)[r+44>>>2>>>0]=0,(T(),R)[r+48>>>2>>>0]=0,1}var ra={\"core-features-and-limits\":1,\"depth-clip-control\":2,\"depth32float-stencil8\":3,\"texture-compression-bc\":4,\"texture-compression-bc-sliced-3d\":5,\"texture-compression-etc2\":6,\"texture-compression-astc\":7,\"texture-compression-astc-sliced-3d\":8,\"timestamp-query\":9,\"indirect-first-instance\":10,\"shader-f16\":11,\"rg11b10ufloat-renderable\":12,\"bgra8unorm-storage\":13,\"float32-filterable\":14,\"float32-blendable\":15,\"clip-distances\":16,\"dual-source-blending\":17,subgroups:18,\"texture-formats-tier1\":19,\"texture-formats-tier2\":20,\"primitive-index\":21,\"texture-component-swizzle\":22,\"chromium-experimental-unorm16-texture-formats\":327692,\"chromium-experimental-multi-draw-indirect\":327729};function ta(e,r){r>>>=0;var t=Zt(e>>>0);e=da(4*t.features.size);var n=0,a=0;for(const r of t.features)0<=(t=ra[r])&&((T(),M)[e+n>>>2>>>0]=t,n+=4,a++);(T(),R)[r+4>>>2>>>0]=e,(T(),R)[r>>>2>>>0]=a}function na(e,r){return tn(Zt(e>>>0).limits,r>>>0),1}function aa(e,r){Zt(e>>>0).pushErrorScope(nn[r])}function ia(e,r,t){r>>>=0,t>>>=0,e=Zt(e>>>0),r=Array.from((T(),M).subarray(t>>>2>>>0,t+4*r>>>2>>>0),e=>Zt(e)),e.submit(r)}function oa(e,r,t,n,a){t=le(t),n>>>=0,a>>>=0,e=Zt(e>>>0),r=Zt(r>>>0),n=(T(),B).subarray(n>>>0,n+a>>>0),e.writeBuffer(r,t,n,0,a)}a||function(){for(var e=r.numThreads-1;e--;)oe();V.push(async()=>{var e=async function(){if(!a)return Promise.all(K.map(ie))}();Y++,await e,0==--Y&&q&&(e=q,q=null,e())})}(),a||(ue=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),W()),r.wasmBinary&&(l=r.wasmBinary),r.stackSave=()=>Va(),r.stackRestore=e=>Na(e),r.stackAlloc=e=>Fa(e),r.setValue=function(e,r,t=\"i8\"){switch(t.endsWith(\"*\")&&(t=\"*\"),t){case\"i1\":case\"i8\":(T(),A)[e>>>0]=r;break;case\"i16\":(T(),P)[e>>>1>>>0]=r;break;case\"i32\":(T(),M)[e>>>2>>>0]=r;break;case\"i64\":(T(),D)[e>>>3>>>0]=BigInt(r);break;case\"float\":(T(),E)[e>>>2>>>0]=r;break;case\"double\":(T(),U)[e>>>3>>>0]=r;break;case\"*\":(T(),R)[e>>>2>>>0]=r;break;default:G(`invalid type for setValue: ${t}`)}},r.getValue=function(e,r=\"i8\"){switch(r.endsWith(\"*\")&&(r=\"*\"),r){case\"i1\":case\"i8\":return(T(),A)[e>>>0];case\"i16\":return(T(),P)[e>>>1>>>0];case\"i32\":return(T(),M)[e>>>2>>>0];case\"i64\":return(T(),D)[e>>>3>>>0];case\"float\":return(T(),E)[e>>>2>>>0];case\"double\":return(T(),U)[e>>>3>>>0];case\"*\":return(T(),R)[e>>>2>>>0];default:G(`invalid type for getValue: ${r}`)}},r.UTF8ToString=Ee,r.stringToUTF8=mr,r.lengthBytesUTF8=hr;var ua,ca,sa,fa,la,da,ma,ha,pa,va,ga,ba,wa,ya,xa,Sa,Ta,Oa,Aa,Ba,Pa,Ca,Ma,Ra,Ea,Ua,Da,ka,Ia,_a,Wa,La,Ga,za,$a,Na,Fa,Va,Ya,qa,ja,Ha,Xa,Za,Qa,Ja,Ka,ei,ri,ti,ni,ai,ii,oi,ui,ci,si,fi,li,di,mi,hi,pi,vi,gi,bi,wi,yi,xi,Si,Ti,Oi,Ai,Bi,Pi,Ci,Mi,Ri,Ei,Ui,Di,ki,Ii,_i,Wi=[Z,Q,Ae,Ue,De,ke,Ie,_e,We,Le,Ge,ze,$e,Ne,Fe,Ve,St,Tt,Bt,Pn,Cn,Mn,Rn,En,Dn],Li={1028716:(e,t,n,a,i)=>{if(void 0===r||!r.Vc)return 1;if((e=Ee(Number(e>>>0))).startsWith(\"./\")&&(e=e.substring(2)),!(e=r.Vc.get(e)))return 2;if(t=Number(t>>>0),n=Number(n>>>0),a=Number(a>>>0),t+n>e.byteLength)return 3;try{const o=e.subarray(t,t+n);switch(i){case 0:(T(),B).set(o,a>>>0);break;case 1:r.bd?r.bd(a,o):r.pe(a,o);break;default:return 4}return 0}catch{return 4}},1029540:(e,t,n)=>{r.Td(e,(T(),B).subarray(t>>>0,t+n>>>0))},1029604:()=>r.ne(),1029646:e=>{r.kd(e)},1029683:()=>\"undefined\"!=typeof wasmOffsetConverter};function Gi(e,r,t,n){var a=Va();try{return ai(e,r,t,n)}catch(e){if(Na(a),e!==e+0)throw e;Ga(1,0)}}function zi(e,r,t){var n=Va();try{return ri(e,r,t)}catch(e){if(Na(n),e!==e+0)throw e;Ga(1,0)}}function $i(e){var r=Va();try{Qa(e)}catch(e){if(Na(r),e!==e+0)throw e;Ga(1,0)}}function Ni(e,r){var t=Va();try{return Za(e,r)}catch(e){if(Na(t),e!==e+0)throw e;Ga(1,0)}}function Fi(e,r,t){var n=Va();try{Xa(e,r,t)}catch(e){if(Na(n),e!==e+0)throw e;Ga(1,0)}}function Vi(e,r){var t=Va();try{ii(e,r)}catch(e){if(Na(t),e!==e+0)throw e;Ga(1,0)}}function Yi(e,r,t,n,a,i,o){var u=Va();try{return ei(e,r,t,n,a,i,o)}catch(e){if(Na(u),e!==e+0)throw e;Ga(1,0)}}function qi(e,r,t,n,a,i){var o=Va();try{Ja(e,r,t,n,a,i)}catch(e){if(Na(o),e!==e+0)throw e;Ga(1,0)}}function ji(e,r,t,n){var a=Va();try{ni(e,r,t,n)}catch(e){if(Na(a),e!==e+0)throw e;Ga(1,0)}}function Hi(e,r,t,n,a,i,o){var u=Va();try{ui(e,r,t,n,a,i,o)}catch(e){if(Na(u),e!==e+0)throw e;Ga(1,0)}}function Xi(e,r,t,n,a,i,o){var u=Va();try{ci(e,r,t,n,a,i,o)}catch(e){if(Na(u),e!==e+0)throw e;Ga(1,0)}}function Zi(e,r,t,n,a,i,o,u){var c=Va();try{gi(e,r,t,n,a,i,o,u)}catch(e){if(Na(c),e!==e+0)throw e;Ga(1,0)}}function Qi(e,r,t,n,a,i,o,u,c,s,f,l){var d=Va();try{si(e,r,t,n,a,i,o,u,c,s,f,l)}catch(e){if(Na(d),e!==e+0)throw e;Ga(1,0)}}function Ji(e,r,t,n,a){var i=Va();try{return oi(e,r,t,n,a)}catch(e){if(Na(i),e!==e+0)throw e;Ga(1,0)}}function Ki(e,r,t,n,a,i){var o=Va();try{bi(e,r,t,n,a,i)}catch(e){if(Na(o),e!==e+0)throw e;Ga(1,0)}}function eo(e,r,t,n,a){var i=Va();try{Ka(e,r,t,n,a)}catch(e){if(Na(i),e!==e+0)throw e;Ga(1,0)}}function ro(e,r,t,n,a,i,o,u){var c=Va();try{ti(e,r,t,n,a,i,o,u)}catch(e){if(Na(c),e!==e+0)throw e;Ga(1,0)}}function to(e){var r=Va();try{return wi(e)}catch(e){if(Na(r),e!==e+0)throw e;Ga(1,0)}}function no(e,r,t){var n=Va();try{return yi(e,r,t)}catch(e){if(Na(n),e!==e+0)throw e;Ga(1,0)}}function ao(e,r){var t=Va();try{return Ei(e,r)}catch(e){if(Na(t),e!==e+0)throw e;return Ga(1,0),0n}}function io(e){var r=Va();try{return fi(e)}catch(e){if(Na(r),e!==e+0)throw e;return Ga(1,0),0n}}function oo(e,r,t,n){var a=Va();try{return xi(e,r,t,n)}catch(e){if(Na(a),e!==e+0)throw e;Ga(1,0)}}function uo(e,r,t,n,a){var i=Va();try{return Si(e,r,t,n,a)}catch(e){if(Na(i),e!==e+0)throw e;Ga(1,0)}}function co(e,r,t,n,a,i){var o=Va();try{return Ti(e,r,t,n,a,i)}catch(e){if(Na(o),e!==e+0)throw e;Ga(1,0)}}function so(e,r,t,n,a,i){var o=Va();try{return pi(e,r,t,n,a,i)}catch(e){if(Na(o),e!==e+0)throw e;Ga(1,0)}}function fo(e,r,t,n,a,i){var o=Va();try{return Oi(e,r,t,n,a,i)}catch(e){if(Na(o),e!==e+0)throw e;Ga(1,0)}}function lo(e,r,t,n,a,i,o,u){var c=Va();try{return vi(e,r,t,n,a,i,o,u)}catch(e){if(Na(c),e!==e+0)throw e;Ga(1,0)}}function mo(e,r,t,n,a){var i=Va();try{return Ai(e,r,t,n,a)}catch(e){if(Na(i),e!==e+0)throw e;return Ga(1,0),0n}}function ho(e,r,t,n){var a=Va();try{return Bi(e,r,t,n)}catch(e){if(Na(a),e!==e+0)throw e;Ga(1,0)}}function po(e,r,t,n){var a=Va();try{return Pi(e,r,t,n)}catch(e){if(Na(a),e!==e+0)throw e;Ga(1,0)}}function vo(e,r,t,n,a,i,o,u,c,s,f,l){var d=Va();try{return Ci(e,r,t,n,a,i,o,u,c,s,f,l)}catch(e){if(Na(d),e!==e+0)throw e;Ga(1,0)}}function go(e,r,t,n,a,i,o,u,c,s,f){var l=Va();try{Mi(e,r,t,n,a,i,o,u,c,s,f)}catch(e){if(Na(l),e!==e+0)throw e;Ga(1,0)}}function bo(e,r,t,n,a,i,o,u,c,s,f,l,d,m,h,p){var v=Va();try{Ri(e,r,t,n,a,i,o,u,c,s,f,l,d,m,h,p)}catch(e){if(Na(v),e!==e+0)throw e;Ga(1,0)}}function wo(e,r,t){var n=Va();try{return di(e,r,t)}catch(e){if(Na(n),e!==e+0)throw e;return Ga(1,0),0n}}function yo(e,r,t){var n=Va();try{return li(e,r,t)}catch(e){if(Na(n),e!==e+0)throw e;Ga(1,0)}}function xo(e,r,t){var n=Va();try{return mi(e,r,t)}catch(e){if(Na(n),e!==e+0)throw e;Ga(1,0)}}function So(e,r,t,n){var a=Va();try{hi(e,r,t,n)}catch(e){if(Na(a),e!==e+0)throw e;Ga(1,0)}}function To(){if(0<Y)q=To;else if(a)h?.(r),L();else{for(var e=V;0<e.length;)e.shift()(r);0<Y?q=To:(r.calledRun=!0,x||(L(),h?.(r)))}}return a||(_i=await $(),To()),r.PTR_SIZE=4,r.webgpuInit=e=>{const t=new WeakMap;let n,a,i=1;r.webgpuRegisterDevice=e=>{if(void 0!==a)throw Error(\"another WebGPU EP inference session is being created.\");if(e){var r=t.get(e);if(!r){const n=((e,r=0)=>{var t=Ta(r);return r=Sa(r,t),Yt[t>>>0]=e.queue,Yt[r>>>0]=e,r})(e,r=ha(0));r=[i++,r,n],t.set(e,r)}return n=e,a=r[0],r}n=void 0,a=0};const o=new Map;r.webgpuOnCreateSession=r=>{if(void 0!==a){var t=a;if(a=void 0,r){const a=sa(t);o.set(r,a),0===t&&e(n??Zt(a))}n=void 0}},r.webgpuOnReleaseSession=e=>{o.delete(e)};const u=Symbol(\"gpuBufferMetadata\");r.webgpuRegisterBuffer=(e,r,t)=>{if(t)return e[u]=[t,NaN],t;if(t=e[u])return t[1]++,t[0];if(void 0===(r=o.get(r)))throw Error(\"Invalid session handle passed to webgpuRegisterBuffer\");return r=((e,r=0)=>(\"unmapped\"===e.mapState||G(),r=xa(r),Yt[r>>>0]=e,r))(e,r),e[u]=[r,1],r},r.webgpuUnregisterBuffer=e=>{const r=e[u];if(!r)throw Error(\"Buffer is not registered\");r[1]--,0===r[1]&&(ma(r[0]),delete e[u])},r.webgpuGetBuffer=e=>Zt(e),r.webgpuCreateDownloader=(e,r,t)=>{if(void 0===(t=o.get(t)))throw Error(\"Invalid session handle passed to webgpuRegisterBuffer\");const n=Zt(t),a=16*Math.ceil(Number(r)/16);return async()=>{const t=n.createBuffer({size:a,usage:9});try{const i=n.createCommandEncoder();return i.copyBufferToBuffer(e,0,t,0,a),n.queue.submit([i.finish()]),await t.mapAsync(GPUMapMode.READ),t.getMappedRange().slice(0,r)}finally{t.destroy()}}},r.bd=(e,r)=>{var t=r.buffer;const i=r.byteOffset,o=r.byteLength;if(r=16*Math.ceil(Number(o)/16),e=Zt(e),!n){var u=sa(a);n=Zt(u)}const c=(u=n.createBuffer({mappedAtCreation:!0,size:r,usage:6})).getMappedRange();new Uint8Array(c).set(new Uint8Array(t,i,o)),u.unmap(),(t=n.createCommandEncoder()).copyBufferToBuffer(u,0,e,0,r),n.queue.submit([t.finish()]),u.destroy()}},r.webnnInit=e=>{const t=e[0];[r.ne,r.kd,r.webnnEnsureTensor,r.Td,r.webnnDownloadTensor,r.me,r.webnnEnableTraceEvent]=e.slice(1),r.webnnReleaseTensorId=r.kd,r.webnnUploadTensor=r.Td,r.webnnRegisterMLContext=r.me,r.webnnOnRunStart=e=>t.onRunStart(e),r.webnnOnRunEnd=t.onRunEnd.bind(t),r.webnnOnReleaseSession=e=>{t.onReleaseSession(e)},r.webnnCreateMLTensorDownloader=(e,r)=>t.createMLTensorDownloader(e,r),r.webnnRegisterMLTensor=(e,r,n,a)=>t.registerMLTensor(e,r,n,a),r.webnnCreateMLContext=e=>t.createMLContext(e),r.webnnRegisterMLConstant=(e,n,a,i,o,u)=>t.registerMLConstant(e,n,a,i,o,r.Vc,u),r.webnnRegisterGraphInput=t.registerGraphInput.bind(t),r.webnnIsGraphInput=t.isGraphInput.bind(t),r.webnnRegisterGraphOutput=t.registerGraphOutput.bind(t),r.webnnIsGraphOutput=t.isGraphOutput.bind(t),r.webnnCreateTemporaryTensor=t.createTemporaryTensor.bind(t),r.webnnIsGraphInputOutputTypeSupported=t.isGraphInputOutputTypeSupported.bind(t)},_?r:new Promise((e,r)=>{h=e,p=r})}export default e;var r=globalThis.self?.name?.startsWith(\"em-pthread\");r&&e();","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport type { OrtWasmModule } from './wasm-types';\nimport { isNode } from './wasm-utils-env';\n\n/**\n * The origin of the current location.\n *\n * In Node.js, this is undefined.\n */\nconst origin = isNode || typeof location === 'undefined' ? undefined : location.origin;\n\n/**\n * Some bundlers (eg. Webpack) will rewrite `import.meta.url` to a file URL at compile time.\n *\n * This function checks if `import.meta.url` starts with `file:`, but using the `>` and `<` operators instead of\n * `startsWith` function so that code minimizers can remove the dead code correctly.\n *\n * For example, if we use terser to minify the following code:\n * ```js\n * if (\"file://hard-coded-filename\".startsWith(\"file:\")) {\n *   console.log(1)\n * } else {\n *   console.log(2)\n * }\n *\n * if (\"file://hard-coded-filename\" > \"file:\" && \"file://hard-coded-filename\" < \"file;\") {\n *   console.log(3)\n * } else {\n *   console.log(4)\n * }\n * ```\n *\n * The minified code will be:\n * ```js\n * \"file://hard-coded-filename\".startsWith(\"file:\")?console.log(1):console.log(2),console.log(3);\n * ```\n *\n * (use Terser 5.39.0 with default options, https://try.terser.org/)\n *\n * @returns true if the import.meta.url is hardcoded as a file URI.\n */\nexport const isEsmImportMetaUrlHardcodedAsFileUri =\n  BUILD_DEFS.IS_ESM && BUILD_DEFS.ESM_IMPORT_META_URL! > 'file:' && BUILD_DEFS.ESM_IMPORT_META_URL! < 'file;';\n\nconst getScriptSrc = (): string | undefined => {\n  // if Nodejs, return undefined\n  if (isNode) {\n    return undefined;\n  }\n  // if It's ESM, use import.meta.url\n  if (BUILD_DEFS.IS_ESM) {\n    // For ESM, if the import.meta.url is a file URL, this usually means the bundler rewrites `import.meta.url` to\n    // the file path at compile time. In this case, this file path cannot be used to determine the runtime URL.\n    //\n    // We need to use the URL constructor like this:\n    // ```js\n    // new URL('actual-bundle-name.js', import.meta.url).href\n    // ```\n    // So that bundler can preprocess the URL correctly.\n    if (isEsmImportMetaUrlHardcodedAsFileUri) {\n      // if the rewritten URL is a relative path, we need to use the origin to resolve the URL.\n\n      // The following is a workaround for Vite.\n      //\n      // Vite uses a bundler(rollup/rolldown) that does not rewrite `import.meta.url` to a file URL. So in theory, this\n      // code path should not be executed in Vite. However, the bundler does not know it and it still try to load the\n      // following pattern:\n      // - `return new URL('filename', import.meta.url).href`\n      //\n      // By replacing the pattern above with the following code, we can skip the resource loading behavior:\n      // - `const URL2 = URL; return new URL2('filename', import.meta.url).href;`\n      //\n      // And it still works in Webpack.\n      const URL2 = URL;\n      return new URL(new URL2(BUILD_DEFS.BUNDLE_FILENAME, BUILD_DEFS.ESM_IMPORT_META_URL).href, origin).href;\n    }\n\n    return BUILD_DEFS.ESM_IMPORT_META_URL;\n  }\n\n  return typeof document !== 'undefined'\n    ? (document.currentScript as HTMLScriptElement)?.src\n    : // use `self.location.href` if available\n      typeof self !== 'undefined'\n      ? self.location?.href\n      : undefined;\n};\n\n/**\n * The classic script source URL. This is not always available in non ESModule environments.\n *\n * In Node.js, this is undefined.\n */\nexport const scriptSrc = getScriptSrc();\n\n/**\n * Infer the wasm path prefix from the script source URL.\n *\n * @returns The inferred wasm path prefix, or undefined if the script source URL is not available or is a blob URL.\n */\nexport const inferWasmPathPrefixFromScriptSrc = (): string | undefined => {\n  if (scriptSrc && !scriptSrc.startsWith('blob:')) {\n    return scriptSrc.substring(0, scriptSrc.lastIndexOf('/') + 1);\n  }\n  return undefined;\n};\n\n/**\n * Check if the given filename with prefix is from the same origin.\n */\nconst isSameOrigin = (filename: string, prefixOverride?: string) => {\n  try {\n    const baseUrl = prefixOverride ?? scriptSrc;\n    const url = baseUrl ? new URL(filename, baseUrl) : new URL(filename);\n    return url.origin === origin;\n  } catch {\n    return false;\n  }\n};\n\n/**\n * Normalize the inputs to an absolute URL with the given prefix override. If failed, return undefined.\n */\nconst normalizeUrl = (filename: string, prefixOverride?: string) => {\n  const baseUrl = prefixOverride ?? scriptSrc;\n  try {\n    const url = baseUrl ? new URL(filename, baseUrl) : new URL(filename);\n    return url.href;\n  } catch {\n    return undefined;\n  }\n};\n\n/**\n * Create a fallback URL if an absolute URL cannot be created by the normalizeUrl function.\n */\nconst fallbackUrl = (filename: string, prefixOverride?: string) => `${prefixOverride ?? './'}${filename}`;\n\n/**\n * This helper function is used to preload a module from a URL.\n *\n * If the origin of the worker URL is different from the current origin, the worker cannot be loaded directly.\n * See discussions in https://github.com/webpack-contrib/worker-loader/issues/154\n *\n * In this case, we will fetch the worker URL and create a new Blob URL with the same origin as a workaround.\n *\n * @param absoluteUrl - The absolute URL to preload.\n *\n * @returns - A promise that resolves to a new Blob URL\n */\nconst preload = async (absoluteUrl: string): Promise<string> => {\n  const response = await fetch(absoluteUrl, { credentials: 'same-origin' });\n  const blob = await response.blob();\n  return URL.createObjectURL(blob);\n};\n\n/**\n * This helper function is used to dynamically import a module from a URL.\n *\n * The build script has special handling for this function to ensure that the URL is not bundled into the final output.\n *\n * @param url - The URL to import.\n *\n * @returns - A promise that resolves to the default export of the module.\n */\nconst dynamicImportDefault = async <T>(url: string): Promise<T> =>\n  (await import(/* webpackIgnore: true */ /* @vite-ignore */ url)).default;\n\n/**\n * The proxy worker factory imported from the proxy worker module.\n *\n * This is only available when the WebAssembly proxy is not disabled.\n */\nconst createProxyWorker: ((urlOverride?: string) => Worker) | undefined =\n  // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n  BUILD_DEFS.DISABLE_WASM_PROXY ? undefined : require('./proxy-worker/main').default;\n\n/**\n * Import the proxy worker.\n *\n * This function will perform the following steps:\n * 1. If a preload is needed, it will preload the module and return the object URL.\n * 2. Use the proxy worker factory to create the proxy worker.\n *\n * @returns - A promise that resolves to a tuple of 2 elements:\n *            - The object URL of the preloaded module, or undefined if no preload is needed.\n *            - The proxy worker.\n */\nexport const importProxyWorker = async (): Promise<[undefined | string, Worker]> => {\n  if (!scriptSrc) {\n    throw new Error('Failed to load proxy worker: cannot determine the script source URL.');\n  }\n\n  // If the script source is from the same origin, we can use the embedded proxy module directly.\n  if (isSameOrigin(scriptSrc)) {\n    return [undefined, createProxyWorker!()];\n  }\n\n  // Otherwise, need to preload\n  const url = await preload(scriptSrc);\n  return [url, createProxyWorker!(url)];\n};\n\n/**\n * The embedded WebAssembly module.\n *\n * This is only available in ESM and when embedding is not disabled.\n */\nconst embeddedWasmModule: EmscriptenModuleFactory<OrtWasmModule> | undefined =\n  BUILD_DEFS.IS_ESM && BUILD_DEFS.ENABLE_BUNDLE_WASM_JS\n    ? // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n      require(\n        !BUILD_DEFS.DISABLE_JSEP\n          ? '../../dist/ort-wasm-simd-threaded.jsep.mjs'\n          : BUILD_DEFS.ENABLE_JSPI\n            ? '../../dist/ort-wasm-simd-threaded.jspi.mjs'\n            : !BUILD_DEFS.DISABLE_WEBGPU\n              ? '../../dist/ort-wasm-simd-threaded.asyncify.mjs'\n              : '../../dist/ort-wasm-simd-threaded.mjs',\n      ).default\n    : undefined;\n\n/**\n * Import the WebAssembly module.\n *\n * This function will perform the following steps:\n * 1. If the embedded module exists and no custom URL is specified, use the embedded module.\n * 2. If a preload is needed, it will preload the module and return the object URL.\n * 3. Otherwise, it will perform a dynamic import of the module.\n *\n * @returns - A promise that resolves to a tuple of 2 elements:\n *            - The object URL of the preloaded module, or undefined if no preload is needed.\n *            - The default export of the module, which is a factory function to create the WebAssembly module.\n */\nexport const importWasmModule = async (\n  urlOverride: string | undefined,\n  prefixOverride: string | undefined,\n  isMultiThreaded: boolean,\n  isWasmOverridden: boolean,\n): Promise<[undefined | string, EmscriptenModuleFactory<OrtWasmModule>]> => {\n  //\n  // Check if we should use the embedded module.\n  //\n\n  // To use the embedded module, it should be available, and no URL override or prefix override should be specified.\n  let useEmbeddedModule = embeddedWasmModule && !(urlOverride || prefixOverride);\n  if (useEmbeddedModule) {\n    if (!scriptSrc) {\n      // no URL info available.\n      //\n      // Note: when the embedded module is available, it means the current script is ESM. Usually, in ESM, the\n      // `import.meta.url` is available. But in some cases (eg. Cloudflare Workers), the value of `import.meta.url`\n      // can be `null` or `undefined`. In this case, we can only load the embedded module when:\n      //\n      // 1. The WebAssembly module binary is overridden:\n      //    ```js\n      //    env.wasm.wasmPaths = undefined;  // or not specified\n      //    env.wasm.wasmBinary = /* a Uint8Array containing the WebAssembly binary */;\n      //    ```\n      //\n      // 2. The \".wasm\" only is overridden.\n      //    ```js\n      //    env.wasm.wasmPaths = { wasm: /* URL of the .wasm file */ };\n      //    ```\n      //\n      if (isWasmOverridden && !isMultiThreaded) {\n        useEmbeddedModule = true;\n      } else {\n        throw new Error('cannot determine the script source URL.');\n      }\n    } else {\n      // if the script source is available, we can check if it is from the same origin.\n      // Also use the embedded module when wasmBinary is provided and single-threaded (eg. Blob URL workers\n      // where isSameOrigin fails but no file resolution or worker spawning is needed).\n      useEmbeddedModule = isSameOrigin(scriptSrc) || (isWasmOverridden && !isMultiThreaded);\n    }\n  }\n  if (useEmbeddedModule) {\n    return [undefined, embeddedWasmModule!];\n  } else {\n    const wasmModuleFilename = !BUILD_DEFS.DISABLE_JSEP\n      ? 'ort-wasm-simd-threaded.jsep.mjs'\n      : BUILD_DEFS.ENABLE_JSPI\n        ? 'ort-wasm-simd-threaded.jspi.mjs'\n        : !BUILD_DEFS.DISABLE_WEBGPU\n          ? 'ort-wasm-simd-threaded.asyncify.mjs'\n          : 'ort-wasm-simd-threaded.mjs';\n    const wasmModuleUrl = urlOverride ?? normalizeUrl(wasmModuleFilename, prefixOverride);\n    // need to preload if all of the following conditions are met:\n    // 1. not in Node.js.\n    //    - Node.js does not have the same origin policy for creating workers.\n    // 2. multi-threaded is enabled.\n    //    - If multi-threaded is disabled, no worker will be created. So we don't need to preload the module.\n    // 3. the absolute URL is available.\n    //    - If the absolute URL is failed to be created, the origin cannot be determined. In this case, we will not\n    //    preload the module.\n    // 4. the worker URL is not from the same origin.\n    //    - If the worker URL is from the same origin, we can create the worker directly.\n    const needPreload = !isNode && isMultiThreaded && wasmModuleUrl && !isSameOrigin(wasmModuleUrl, prefixOverride);\n    const url = needPreload\n      ? await preload(wasmModuleUrl)\n      : (wasmModuleUrl ?? fallbackUrl(wasmModuleFilename, prefixOverride));\n    return [needPreload ? url : undefined, await dynamicImportDefault<EmscriptenModuleFactory<OrtWasmModule>>(url)];\n  }\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Env } from 'onnxruntime-common';\n\nimport type { OrtWasmModule } from './wasm-types';\nimport { importWasmModule, inferWasmPathPrefixFromScriptSrc } from './wasm-utils-import';\n\nlet wasm: OrtWasmModule | undefined;\nlet initialized = false;\nlet initializing = false;\nlet aborted = false;\n\nconst isMultiThreadSupported = (): boolean => {\n  // If 'SharedArrayBuffer' is not available, WebAssembly threads will not work.\n  if (typeof SharedArrayBuffer === 'undefined') {\n    return false;\n  }\n\n  try {\n    // Test for transferability of SABs (for browsers. needed for Firefox)\n    // https://groups.google.com/forum/#!msg/mozilla.dev.platform/IHkBZlHETpA/dwsMNchWEQAJ\n    if (typeof MessageChannel !== 'undefined') {\n      new MessageChannel().port1.postMessage(new SharedArrayBuffer(1));\n    }\n\n    // Test for WebAssembly threads capability (for both browsers and Node.js)\n    // This typed array is a WebAssembly program containing threaded instructions.\n    return WebAssembly.validate(\n      new Uint8Array([\n        0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16,\n        2, 0, 26, 11,\n      ]),\n    );\n  } catch {\n    return false;\n  }\n};\n\nconst isSimdSupported = (): boolean => {\n  try {\n    // Test for WebAssembly SIMD capability (for both browsers and Node.js)\n    // This typed array is a WebAssembly program containing SIMD instructions.\n\n    // The binary data is generated from the following code by wat2wasm:\n    //\n    // (module\n    //   (type $t0 (func))\n    //   (func $f0 (type $t0)\n    //     (drop\n    //       (i32x4.dot_i16x8_s\n    //         (i8x16.splat\n    //           (i32.const 0))\n    //         (v128.const i32x4 0x00000000 0x00000000 0x00000000 0x00000000)))))\n\n    return WebAssembly.validate(\n      new Uint8Array([\n        0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 10, 30, 1, 28, 0, 65, 0, 253, 15, 253, 12, 0, 0, 0,\n        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 253, 186, 1, 26, 11,\n      ]),\n    );\n  } catch {\n    return false;\n  }\n};\n\nconst isRelaxedSimdSupported = (): boolean => {\n  try {\n    // Test for WebAssembly Relaxed SIMD capability (for both browsers and Node.js)\n    // This typed array is a WebAssembly program containing Relaxed SIMD instructions.\n\n    // The binary data is generated from the following code by wat2wasm:\n    // (module\n    //   (func (result v128)\n    //      i32.const 1\n    //      i8x16.splat\n    //      i32.const 2\n    //      i8x16.splat\n    //      i32.const 3\n    //      i8x16.splat\n    //      i32x4.relaxed_dot_i8x16_i7x16_add_s\n    //   )\n    //  )\n    return WebAssembly.validate(\n      new Uint8Array([\n        0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 96, 0, 1, 123, 3, 2, 1, 0, 10, 19, 1, 17, 0, 65, 1, 253, 15, 65, 2, 253,\n        15, 65, 3, 253, 15, 253, 147, 2, 11,\n      ]),\n    );\n  } catch {\n    return false;\n  }\n};\n\nexport const initializeWebAssembly = async (flags: Env.WebAssemblyFlags): Promise<void> => {\n  if (initialized) {\n    return Promise.resolve();\n  }\n  if (initializing) {\n    throw new Error(\"multiple calls to 'initializeWebAssembly()' detected.\");\n  }\n  if (aborted) {\n    throw new Error(\"previous call to 'initializeWebAssembly()' failed.\");\n  }\n\n  initializing = true;\n\n  // wasm flags are already initialized\n  const timeout = flags.initTimeout!;\n  let numThreads = flags.numThreads!;\n\n  // ensure SIMD is supported\n  if (flags.simd === false) {\n    // skip SIMD feature checking as it is disabled explicitly by user\n  } else if (flags.simd === 'relaxed') {\n    // check if relaxed SIMD is supported\n    if (!isRelaxedSimdSupported()) {\n      throw new Error('Relaxed WebAssembly SIMD is not supported in the current environment.');\n    }\n  } else if (!isSimdSupported()) {\n    throw new Error('WebAssembly SIMD is not supported in the current environment.');\n  }\n\n  if (BUILD_DEFS.ENABLE_JSPI) {\n    if (!('Suspending' in WebAssembly)) {\n      throw new Error('WebAssembly JSPI is not supported in the current environment.');\n    }\n  }\n\n  // check if multi-threading is supported\n  const multiThreadSupported = isMultiThreadSupported();\n  if (numThreads > 1 && !multiThreadSupported) {\n    if (typeof self !== 'undefined' && !self.crossOriginIsolated) {\n      // eslint-disable-next-line no-console\n      console.warn(\n        'env.wasm.numThreads is set to ' +\n          numThreads +\n          ', but this will not work unless you enable crossOriginIsolated mode. ' +\n          'See https://web.dev/cross-origin-isolation-guide/ for more info.',\n      );\n    }\n\n    // eslint-disable-next-line no-console\n    console.warn(\n      'WebAssembly multi-threading is not supported in the current environment. ' + 'Falling back to single-threading.',\n    );\n\n    // set flags.numThreads to 1 so that OrtInit() will not create a global thread pool.\n    flags.numThreads = numThreads = 1;\n  }\n\n  const wasmPaths = flags.wasmPaths;\n  const wasmPrefixOverride = typeof wasmPaths === 'string' ? wasmPaths : undefined;\n  const mjsPathOverrideFlag = (wasmPaths as Env.WasmFilePaths)?.mjs;\n  const mjsPathOverride = (mjsPathOverrideFlag as URL)?.href ?? mjsPathOverrideFlag;\n  const wasmPathOverrideFlag = (wasmPaths as Env.WasmFilePaths)?.wasm;\n  const wasmPathOverride = (wasmPathOverrideFlag as URL)?.href ?? wasmPathOverrideFlag;\n  const wasmBinaryOverride = flags.wasmBinary;\n\n  const [objectUrl, ortWasmFactory] = await importWasmModule(\n    mjsPathOverride,\n    wasmPrefixOverride,\n    numThreads > 1,\n    !!wasmBinaryOverride || !!wasmPathOverride,\n  );\n\n  let isTimeout = false;\n\n  const tasks: Array<Promise<void>> = [];\n\n  // promise for timeout\n  if (timeout > 0) {\n    tasks.push(\n      new Promise((resolve) => {\n        setTimeout(() => {\n          isTimeout = true;\n          resolve();\n        }, timeout);\n      }),\n    );\n  }\n\n  // promise for module initialization\n  tasks.push(\n    new Promise((resolve, reject) => {\n      const config: Partial<OrtWasmModule> = {\n        /**\n         * The number of threads. WebAssembly will create (Module.numThreads - 1) workers. If it is 1, no worker will be\n         * created.\n         */\n        numThreads,\n      };\n\n      if (wasmBinaryOverride) {\n        // Set a custom buffer which contains the WebAssembly binary. This will skip the wasm file fetching.\n        config.wasmBinary = wasmBinaryOverride as ArrayBuffer;\n\n        // Offer an implementation of locateFile() that returns the file name directly. This helps to avoid an error\n        // thrown later from the following code when `import.meta.url` is a blob URL:\n        // ```\n        //   return new URL(\"ort-wasm-simd-threaded.jsep.wasm\", import.meta.url).href;\n        // ```\n        config.locateFile = (fileName) => fileName;\n      } else if (wasmPathOverride || wasmPrefixOverride) {\n        // A callback function to locate the WebAssembly file. The function should return the full path of the file.\n        //\n        // Since Emscripten 3.1.58, this function is only called for the .wasm file.\n        config.locateFile = (fileName) => wasmPathOverride ?? wasmPrefixOverride + fileName;\n      } else if (mjsPathOverride && mjsPathOverride.indexOf('blob:') !== 0) {\n        // if mjs path is specified, use it as the base path for the .wasm file.\n        config.locateFile = (fileName) => new URL(fileName, mjsPathOverride).href;\n      } else if (objectUrl) {\n        const inferredWasmPathPrefix = inferWasmPathPrefixFromScriptSrc();\n        if (inferredWasmPathPrefix) {\n          // if the wasm module is preloaded, use the inferred wasm path as the base path for the .wasm file.\n          config.locateFile = (fileName) => inferredWasmPathPrefix + fileName;\n        }\n      }\n\n      ortWasmFactory(config).then(\n        // wasm module initialized successfully\n        (module) => {\n          initializing = false;\n          initialized = true;\n          wasm = module;\n          resolve();\n          if (objectUrl) {\n            URL.revokeObjectURL(objectUrl);\n          }\n        },\n        // wasm module failed to initialize\n        (what) => {\n          initializing = false;\n          aborted = true;\n          reject(what);\n        },\n      );\n    }),\n  );\n\n  await Promise.race(tasks);\n\n  if (isTimeout) {\n    throw new Error(`WebAssembly backend initializing failed due to timeout: ${timeout}ms`);\n  }\n};\n\nexport const getInstance = (): OrtWasmModule => {\n  if (initialized && wasm) {\n    return wasm;\n  }\n\n  throw new Error('WebAssembly is not initialized yet.');\n};\n\nexport const dispose = (): void => {\n  if (initialized && !initializing && !aborted) {\n    // TODO: currently \"PThread.terminateAllThreads()\" is not exposed in the wasm module.\n    //       And this function is not yet called by any code.\n    //       If it is needed in the future, we should expose it in the wasm module and uncomment the following line.\n\n    // wasm?.PThread?.terminateAllThreads();\n    wasm = undefined;\n\n    initializing = false;\n    initialized = false;\n    aborted = true;\n  }\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { getInstance } from './wasm-factory';\n\nexport const allocWasmString = (data: string, allocs: number[]): number => {\n  const wasm = getInstance();\n\n  const dataLength = wasm.lengthBytesUTF8(data) + 1;\n  const dataOffset = wasm._malloc(dataLength);\n  wasm.stringToUTF8(data, dataOffset, dataLength);\n  allocs.push(dataOffset);\n\n  return dataOffset;\n};\n\ninterface ExtraOptionsHandler {\n  (name: string, value: string): void;\n}\n\nexport const iterateExtraOptions = (\n  options: Record<string, unknown>,\n  prefix: string,\n  seen: WeakSet<Record<string, unknown>>,\n  handler: ExtraOptionsHandler,\n): void => {\n  if (typeof options == 'object' && options !== null) {\n    if (seen.has(options)) {\n      throw new Error('Circular reference in options');\n    } else {\n      seen.add(options);\n    }\n  }\n\n  Object.entries(options).forEach(([key, value]) => {\n    const name = prefix ? prefix + key : key;\n    if (typeof value === 'object') {\n      iterateExtraOptions(value as Record<string, unknown>, name + '.', seen, handler);\n    } else if (typeof value === 'string' || typeof value === 'number') {\n      handler(name, value.toString());\n    } else if (typeof value === 'boolean') {\n      handler(name, value ? '1' : '0');\n    } else {\n      throw new Error(`Can't handle extra config type: ${typeof value}`);\n    }\n  });\n};\n\n/**\n * check web assembly API's last error and throw error if any error occurred.\n * @param message a message used when an error occurred.\n */\nexport const checkLastError = (message: string): void => {\n  const wasm = getInstance();\n\n  const stack = wasm.stackSave();\n  try {\n    const ptrSize = wasm.PTR_SIZE;\n    const paramsOffset = wasm.stackAlloc(2 * ptrSize);\n    wasm._OrtGetLastError(paramsOffset, paramsOffset + ptrSize);\n    const errorCode = Number(wasm.getValue(paramsOffset, ptrSize === 4 ? 'i32' : 'i64'));\n    const errorMessagePointer = wasm.getValue(paramsOffset + ptrSize, '*');\n    const errorMessage = errorMessagePointer ? wasm.UTF8ToString(errorMessagePointer) : '';\n    throw new Error(`${message} ERROR_CODE: ${errorCode}, ERROR_MESSAGE: ${errorMessage}`);\n  } finally {\n    wasm.stackRestore(stack);\n  }\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { InferenceSession } from 'onnxruntime-common';\n\nimport { getInstance } from './wasm-factory';\nimport { allocWasmString, checkLastError, iterateExtraOptions } from './wasm-utils';\n\nexport const setRunOptions = (options: InferenceSession.RunOptions): [number, number[]] => {\n  const wasm = getInstance();\n  let runOptionsHandle = 0;\n  const allocs: number[] = [];\n\n  const runOptions: InferenceSession.RunOptions = options || {};\n\n  try {\n    if (options?.logSeverityLevel === undefined) {\n      runOptions.logSeverityLevel = 2; // Default to warning\n    } else if (\n      typeof options.logSeverityLevel !== 'number' ||\n      !Number.isInteger(options.logSeverityLevel) ||\n      options.logSeverityLevel < 0 ||\n      options.logSeverityLevel > 4\n    ) {\n      throw new Error(`log severity level is not valid: ${options.logSeverityLevel}`);\n    }\n\n    if (options?.logVerbosityLevel === undefined) {\n      runOptions.logVerbosityLevel = 0; // Default to 0\n    } else if (typeof options.logVerbosityLevel !== 'number' || !Number.isInteger(options.logVerbosityLevel)) {\n      throw new Error(`log verbosity level is not valid: ${options.logVerbosityLevel}`);\n    }\n\n    if (options?.terminate === undefined) {\n      runOptions.terminate = false;\n    }\n\n    let tagDataOffset = 0;\n    if (options?.tag !== undefined) {\n      tagDataOffset = allocWasmString(options.tag, allocs);\n    }\n\n    runOptionsHandle = wasm._OrtCreateRunOptions(\n      runOptions.logSeverityLevel!,\n      runOptions.logVerbosityLevel!,\n      !!runOptions.terminate!,\n      tagDataOffset,\n    );\n    if (runOptionsHandle === 0) {\n      checkLastError(\"Can't create run options.\");\n    }\n\n    if (options?.extra !== undefined) {\n      iterateExtraOptions(options.extra, '', new WeakSet<Record<string, unknown>>(), (key, value) => {\n        const keyDataOffset = allocWasmString(key, allocs);\n        const valueDataOffset = allocWasmString(value, allocs);\n\n        if (wasm._OrtAddRunConfigEntry(runOptionsHandle, keyDataOffset, valueDataOffset) !== 0) {\n          checkLastError(`Can't set a run config entry: ${key} - ${value}.`);\n        }\n      });\n    }\n\n    return [runOptionsHandle, allocs];\n  } catch (e) {\n    if (runOptionsHandle !== 0) {\n      wasm._OrtReleaseRunOptions(runOptionsHandle);\n    }\n    allocs.forEach((alloc) => wasm._free(alloc));\n    throw e;\n  }\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport type { InferenceSession } from 'onnxruntime-common';\n\nimport { getInstance } from './wasm-factory';\nimport { allocWasmString, checkLastError, iterateExtraOptions } from './wasm-utils';\n\nconst getGraphOptimzationLevel = (graphOptimizationLevel: string | unknown): number => {\n  switch (graphOptimizationLevel) {\n    case 'disabled':\n      return 0;\n    case 'basic':\n      return 1;\n    case 'extended':\n      return 2;\n    case 'layout':\n      return 3;\n    case 'all':\n      return 99;\n    default:\n      throw new Error(`unsupported graph optimization level: ${graphOptimizationLevel}`);\n  }\n};\n\nconst getExecutionMode = (executionMode: 'sequential' | 'parallel'): number => {\n  switch (executionMode) {\n    case 'sequential':\n      return 0;\n    case 'parallel':\n      return 1;\n    default:\n      throw new Error(`unsupported execution mode: ${executionMode}`);\n  }\n};\n\nconst appendDefaultOptions = (options: InferenceSession.SessionOptions): void => {\n  if (!options.extra) {\n    options.extra = {};\n  }\n  if (!options.extra.session) {\n    options.extra.session = {};\n  }\n  const session = options.extra.session as Record<string, string>;\n  if (!session.use_ort_model_bytes_directly) {\n    // eslint-disable-next-line camelcase\n    session.use_ort_model_bytes_directly = '1';\n  }\n\n  // if using JSEP with WebGPU, always disable memory pattern\n  if (\n    options.executionProviders &&\n    options.executionProviders.some((ep) => (typeof ep === 'string' ? ep : ep.name) === 'webgpu')\n  ) {\n    options.enableMemPattern = false;\n  }\n};\n\nconst appendSessionConfig = (sessionOptionsHandle: number, key: string, value: string, allocs: number[]): void => {\n  const keyDataOffset = allocWasmString(key, allocs);\n  const valueDataOffset = allocWasmString(value, allocs);\n  if (getInstance()._OrtAddSessionConfigEntry(sessionOptionsHandle, keyDataOffset, valueDataOffset) !== 0) {\n    checkLastError(`Can't set a session config entry: ${key} - ${value}.`);\n  }\n};\n\nconst appendEpOption = (epOptions: Array<[number, number]>, key: string, value: string, allocs: number[]): void => {\n  const keyDataOffset = allocWasmString(key, allocs);\n  const valueDataOffset = allocWasmString(value, allocs);\n  epOptions.push([keyDataOffset, valueDataOffset]);\n};\n\nconst setExecutionProviders = async (\n  sessionOptionsHandle: number,\n  sessionOptions: InferenceSession.SessionOptions,\n  allocs: number[],\n): Promise<void> => {\n  const executionProviders = sessionOptions.executionProviders!;\n  for (const ep of executionProviders) {\n    let epName = typeof ep === 'string' ? ep : ep.name;\n    const epOptions: Array<[number, number]> = [];\n\n    // check EP name\n    switch (epName) {\n      case 'webnn':\n        epName = 'WEBNN';\n        // Disable QDQ fusion so DQ/Q nodes are preserved as individual ops for WebNN EP.\n        appendSessionConfig(sessionOptionsHandle, 'session.disable_quant_qdq', '1', allocs);\n        // Forcibly prevent constant folding from replacing DQ nodes with constants.\n        appendSessionConfig(sessionOptionsHandle, 'session.disable_qdq_constant_folding', '1', allocs);\n        if (typeof ep !== 'string') {\n          const webnnOptions = ep as InferenceSession.WebNNExecutionProviderOption;\n          // const context = (webnnOptions as InferenceSession.WebNNOptionsWithMLContext)?.context;\n          const deviceType = (webnnOptions as InferenceSession.WebNNContextOptions)?.deviceType;\n          if (deviceType) {\n            appendSessionConfig(sessionOptionsHandle, 'deviceType', deviceType, allocs);\n          }\n        }\n        break;\n      case 'webgpu':\n        if (!BUILD_DEFS.DISABLE_WEBGPU) {\n          epName = 'WebGPU';\n          let customDevice: GPUDevice | undefined;\n\n          if (typeof ep !== 'string') {\n            const webgpuOptions = ep as InferenceSession.WebGpuExecutionProviderOption;\n\n            // set custom GPU device\n            if (webgpuOptions.device) {\n              if (typeof GPUDevice !== 'undefined' && webgpuOptions.device instanceof GPUDevice) {\n                customDevice = webgpuOptions.device;\n              } else {\n                throw new Error('Invalid GPU device set in WebGPU EP options.');\n              }\n            }\n\n            // set graph capture option from session options\n            const { enableGraphCapture } = sessionOptions;\n            if (typeof enableGraphCapture === 'boolean' && enableGraphCapture) {\n              appendEpOption(epOptions, 'enableGraphCapture', '1', allocs);\n            }\n\n            // set layout option\n            if (typeof webgpuOptions.preferredLayout === 'string') {\n              appendEpOption(epOptions, 'preferredLayout', webgpuOptions.preferredLayout, allocs);\n            }\n\n            // set force CPU fallback nodes\n            if (webgpuOptions.forceCpuNodeNames) {\n              const names = Array.isArray(webgpuOptions.forceCpuNodeNames)\n                ? webgpuOptions.forceCpuNodeNames\n                : [webgpuOptions.forceCpuNodeNames];\n\n              appendEpOption(epOptions, 'forceCpuNodeNames', names.join('\\n'), allocs);\n            }\n\n            // set validation mode\n            if (webgpuOptions.validationMode) {\n              appendEpOption(epOptions, 'validationMode', webgpuOptions.validationMode, allocs);\n            }\n          }\n\n          const info = getInstance().webgpuRegisterDevice!(customDevice);\n          if (info) {\n            const [deviceId, instanceHandle, deviceHandle] = info;\n            appendEpOption(epOptions, 'deviceId', deviceId.toString(), allocs);\n            appendEpOption(epOptions, 'webgpuInstance', instanceHandle.toString(), allocs);\n            appendEpOption(epOptions, 'webgpuDevice', deviceHandle.toString(), allocs);\n          }\n        } else {\n          epName = 'JS';\n          if (typeof ep !== 'string') {\n            const webgpuOptions = ep as InferenceSession.WebGpuExecutionProviderOption;\n            if (webgpuOptions?.preferredLayout) {\n              if (webgpuOptions.preferredLayout !== 'NCHW' && webgpuOptions.preferredLayout !== 'NHWC') {\n                throw new Error(`preferredLayout must be either 'NCHW' or 'NHWC': ${webgpuOptions.preferredLayout}`);\n              }\n              appendSessionConfig(sessionOptionsHandle, 'preferredLayout', webgpuOptions.preferredLayout, allocs);\n            }\n          }\n        }\n        break;\n      case 'wasm':\n      case 'cpu':\n        continue;\n      default:\n        throw new Error(`not supported execution provider: ${epName}`);\n    }\n\n    const epNameDataOffset = allocWasmString(epName, allocs);\n    const epOptionsCount = epOptions.length;\n    let keysOffset = 0;\n    let valuesOffset = 0;\n    if (epOptionsCount > 0) {\n      keysOffset = getInstance()._malloc(epOptionsCount * getInstance().PTR_SIZE);\n      allocs.push(keysOffset);\n      valuesOffset = getInstance()._malloc(epOptionsCount * getInstance().PTR_SIZE);\n      allocs.push(valuesOffset);\n      for (let i = 0; i < epOptionsCount; i++) {\n        getInstance().setValue(keysOffset + i * getInstance().PTR_SIZE, epOptions[i][0], '*');\n        getInstance().setValue(valuesOffset + i * getInstance().PTR_SIZE, epOptions[i][1], '*');\n      }\n    }\n    if (\n      (await getInstance()._OrtAppendExecutionProvider(\n        sessionOptionsHandle,\n        epNameDataOffset,\n        keysOffset,\n        valuesOffset,\n        epOptionsCount,\n      )) !== 0\n    ) {\n      checkLastError(`Can't append execution provider: ${epName}.`);\n    }\n  }\n};\n\nexport const setSessionOptions = async (options?: InferenceSession.SessionOptions): Promise<[number, number[]]> => {\n  const wasm = getInstance();\n  let sessionOptionsHandle = 0;\n  const allocs: number[] = [];\n\n  const sessionOptions: InferenceSession.SessionOptions = options || {};\n  appendDefaultOptions(sessionOptions);\n\n  try {\n    const graphOptimizationLevel = getGraphOptimzationLevel(sessionOptions.graphOptimizationLevel ?? 'all');\n    const executionMode = getExecutionMode(sessionOptions.executionMode ?? 'sequential');\n    const logIdDataOffset =\n      typeof sessionOptions.logId === 'string' ? allocWasmString(sessionOptions.logId, allocs) : 0;\n\n    const logSeverityLevel = sessionOptions.logSeverityLevel ?? 2; // Default to 2 - warning\n    if (!Number.isInteger(logSeverityLevel) || logSeverityLevel < 0 || logSeverityLevel > 4) {\n      throw new Error(`log severity level is not valid: ${logSeverityLevel}`);\n    }\n\n    const logVerbosityLevel = sessionOptions.logVerbosityLevel ?? 0; // Default to 0 - verbose\n    if (!Number.isInteger(logVerbosityLevel) || logVerbosityLevel < 0 || logVerbosityLevel > 4) {\n      throw new Error(`log verbosity level is not valid: ${logVerbosityLevel}`);\n    }\n\n    const optimizedModelFilePathOffset =\n      typeof sessionOptions.optimizedModelFilePath === 'string'\n        ? allocWasmString(sessionOptions.optimizedModelFilePath, allocs)\n        : 0;\n\n    sessionOptionsHandle = wasm._OrtCreateSessionOptions(\n      graphOptimizationLevel,\n      !!sessionOptions.enableCpuMemArena,\n      !!sessionOptions.enableMemPattern,\n      executionMode,\n      !!sessionOptions.enableProfiling,\n      0,\n      logIdDataOffset,\n      logSeverityLevel,\n      logVerbosityLevel,\n      optimizedModelFilePathOffset,\n    );\n    if (sessionOptionsHandle === 0) {\n      checkLastError(\"Can't create session options.\");\n    }\n\n    if (sessionOptions.executionProviders) {\n      await setExecutionProviders(sessionOptionsHandle, sessionOptions, allocs);\n    }\n\n    if (sessionOptions.enableGraphCapture !== undefined) {\n      if (typeof sessionOptions.enableGraphCapture !== 'boolean') {\n        throw new Error(`enableGraphCapture must be a boolean value: ${sessionOptions.enableGraphCapture}`);\n      }\n      appendSessionConfig(\n        sessionOptionsHandle,\n        'enableGraphCapture',\n        sessionOptions.enableGraphCapture.toString(),\n        allocs,\n      );\n    }\n\n    if (sessionOptions.freeDimensionOverrides) {\n      for (const [name, value] of Object.entries(sessionOptions.freeDimensionOverrides)) {\n        if (typeof name !== 'string') {\n          throw new Error(`free dimension override name must be a string: ${name}`);\n        }\n        if (typeof value !== 'number' || !Number.isInteger(value) || value < 0) {\n          throw new Error(`free dimension override value must be a non-negative integer: ${value}`);\n        }\n        const nameOffset = allocWasmString(name, allocs);\n        if (wasm._OrtAddFreeDimensionOverride(sessionOptionsHandle, nameOffset, value) !== 0) {\n          checkLastError(`Can't set a free dimension override: ${name} - ${value}.`);\n        }\n      }\n    }\n\n    if (sessionOptions.extra !== undefined) {\n      iterateExtraOptions(sessionOptions.extra, '', new WeakSet<Record<string, unknown>>(), (key, value) => {\n        appendSessionConfig(sessionOptionsHandle, key, value, allocs);\n      });\n    }\n\n    return [sessionOptionsHandle, allocs];\n  } catch (e) {\n    if (sessionOptionsHandle !== 0) {\n      if (wasm._OrtReleaseSessionOptions(sessionOptionsHandle) !== 0) {\n        checkLastError(\"Can't release session options.\");\n      }\n    }\n    allocs.forEach((alloc) => wasm._free(alloc));\n    throw e;\n  }\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from 'onnxruntime-common';\n\n// This file includes common definitions. They do NOT have dependency on the WebAssembly instance.\n\n/**\n * Copied from ONNX definition. Use this to drop dependency 'onnx_proto' to decrease compiled .js file size.\n */\nexport const enum DataType {\n  undefined = 0,\n  float = 1,\n  uint8 = 2,\n  int8 = 3,\n  uint16 = 4,\n  int16 = 5,\n  int32 = 6,\n  int64 = 7,\n  string = 8,\n  bool = 9,\n  float16 = 10,\n  double = 11,\n  uint32 = 12,\n  uint64 = 13,\n  complex64 = 14,\n  complex128 = 15,\n  bfloat16 = 16,\n\n  // 4-bit data-types\n  uint4 = 21,\n  int4 = 22,\n}\n\n/**\n * Map string tensor data to enum value\n */\nexport const tensorDataTypeStringToEnum = (type: string): DataType => {\n  switch (type) {\n    case 'int8':\n      return DataType.int8;\n    case 'uint8':\n      return DataType.uint8;\n    case 'bool':\n      return DataType.bool;\n    case 'int16':\n      return DataType.int16;\n    case 'uint16':\n      return DataType.uint16;\n    case 'int32':\n      return DataType.int32;\n    case 'uint32':\n      return DataType.uint32;\n    case 'float16':\n      return DataType.float16;\n    case 'float32':\n      return DataType.float;\n    case 'float64':\n      return DataType.double;\n    case 'string':\n      return DataType.string;\n    case 'int64':\n      return DataType.int64;\n    case 'uint64':\n      return DataType.uint64;\n    case 'int4':\n      return DataType.int4;\n    case 'uint4':\n      return DataType.uint4;\n\n    default:\n      throw new Error(`unsupported data type: ${type}`);\n  }\n};\n\n/**\n * Map enum value to string tensor data\n */\nexport const tensorDataTypeEnumToString = (typeProto: DataType): Tensor.Type => {\n  switch (typeProto) {\n    case DataType.int8:\n      return 'int8';\n    case DataType.uint8:\n      return 'uint8';\n    case DataType.bool:\n      return 'bool';\n    case DataType.int16:\n      return 'int16';\n    case DataType.uint16:\n      return 'uint16';\n    case DataType.int32:\n      return 'int32';\n    case DataType.uint32:\n      return 'uint32';\n    case DataType.float16:\n      return 'float16';\n    case DataType.float:\n      return 'float32';\n    case DataType.double:\n      return 'float64';\n    case DataType.string:\n      return 'string';\n    case DataType.int64:\n      return 'int64';\n    case DataType.uint64:\n      return 'uint64';\n    case DataType.int4:\n      return 'int4';\n    case DataType.uint4:\n      return 'uint4';\n\n    default:\n      throw new Error(`unsupported data type: ${typeProto}`);\n  }\n};\n\n/**\n * get tensor size in bytes by the given data type and dimensions\n * @returns size in integer or undefined if the data type is not supported\n */\nexport const calculateTensorSizeInBytes = (\n  dateType: number,\n  dimsOrSize: readonly number[] | number,\n): number | undefined => {\n  const elementSize = [\n    -1, // undefined = 0\n    4, // float = 1\n    1, // uint8 = 2\n    1, // int8 = 3\n    2, // uint16 = 4\n    2, // int16 = 5\n    4, // int32 = 6\n    8, // int64 = 7\n    -1, // string = 8\n    1, // bool = 9\n    2, // float16 = 10\n    8, // double = 11\n    4, // uint32 = 12\n    8, // uint64 = 13\n    -1, // complex64 = 14\n    -1, // complex128 = 15\n    -1, // bfloat16 = 16\n    -1, // FLOAT8E4M3FN = 17\n    -1, // FLOAT8E4M3FNUZ = 18\n    -1, // FLOAT8E5M2 = 19\n    -1, // FLOAT8E5M2FNUZ = 20\n    0.5, // uint4 = 21\n    0.5, // int4 = 22\n  ][dateType];\n\n  const size = typeof dimsOrSize === 'number' ? dimsOrSize : dimsOrSize.reduce((a, b) => a * b, 1);\n  return elementSize > 0 ? Math.ceil(size * elementSize) : undefined;\n};\n\n/**\n * get typed array constructor by the given tensor type\n */\nexport const tensorTypeToTypedArrayConstructor = (\n  type: Tensor.Type,\n):\n  | Float32ArrayConstructor\n  | Uint8ArrayConstructor\n  | Int8ArrayConstructor\n  | Uint16ArrayConstructor\n  | Int16ArrayConstructor\n  | Int32ArrayConstructor\n  | BigInt64ArrayConstructor\n  | Uint8ArrayConstructor\n  | Float64ArrayConstructor\n  | Uint32ArrayConstructor\n  | BigUint64ArrayConstructor => {\n  switch (type) {\n    case 'float16':\n      // Float16 tensor data is stored as raw 16-bit values. Prefer a native or polyfilled Float16Array when\n      // available so callers can work with float16 values directly; otherwise fall back to Uint16Array storage.\n      return typeof Float16Array !== 'undefined' ? (Float16Array as unknown as Uint16ArrayConstructor) : Uint16Array;\n    case 'float32':\n      return Float32Array;\n    case 'uint8':\n      return Uint8Array;\n    case 'int8':\n      return Int8Array;\n    case 'uint16':\n      return Uint16Array;\n    case 'int16':\n      return Int16Array;\n    case 'int32':\n      return Int32Array;\n    case 'bool':\n      return Uint8Array;\n    case 'float64':\n      return Float64Array;\n    case 'uint32':\n      return Uint32Array;\n    case 'int64':\n      return BigInt64Array;\n    case 'uint64':\n      return BigUint64Array;\n    default:\n      throw new Error(`unsupported type: ${type}`);\n  }\n};\n\n/**\n * Map string log level to integer value\n */\nexport const logLevelStringToEnum = (logLevel?: 'verbose' | 'info' | 'warning' | 'error' | 'fatal'): number => {\n  switch (logLevel) {\n    case 'verbose':\n      return 0;\n    case 'info':\n      return 1;\n    case 'warning':\n      return 2;\n    case 'error':\n      return 3;\n    case 'fatal':\n      return 4;\n    default:\n      throw new Error(`unsupported logging level: ${logLevel}`);\n  }\n};\n\n/**\n * Check whether the given tensor type is supported by GPU buffer\n */\nexport const isGpuBufferSupportedType = (type: Tensor.Type): type is Tensor.GpuBufferDataTypes =>\n  type === 'float32' ||\n  type === 'float16' ||\n  type === 'int32' ||\n  type === 'int64' ||\n  type === 'uint32' ||\n  type === 'uint8' ||\n  type === 'bool' ||\n  type === 'uint4' ||\n  type === 'int4';\n\n/**\n * Check whether the given tensor type is supported by WebNN MLTensor\n */\nexport const isMLTensorSupportedType = (type: Tensor.Type): type is Tensor.MLTensorDataTypes =>\n  type === 'float32' ||\n  type === 'float16' ||\n  type === 'int32' ||\n  type === 'int64' ||\n  type === 'uint32' ||\n  type === 'uint64' ||\n  type === 'int8' ||\n  type === 'uint8' ||\n  type === 'bool' ||\n  type === 'uint4' ||\n  type === 'int4';\n\n/**\n * Map string data location to integer value\n */\nexport const dataLocationStringToEnum = (location: Tensor.DataLocation): number => {\n  switch (location) {\n    case 'none':\n      return 0;\n    case 'cpu':\n      return 1;\n    case 'cpu-pinned':\n      return 2;\n    case 'texture':\n      return 3;\n    case 'gpu-buffer':\n      return 4;\n    case 'ml-tensor':\n      return 5;\n    default:\n      throw new Error(`unsupported data location: ${location}`);\n  }\n};\n\n/**\n * Map integer data location to string value\n */\nexport const dataLocationEnumToString = (location: number): Tensor.DataLocation | undefined =>\n  (['none', 'cpu', 'cpu-pinned', 'texture', 'gpu-buffer', 'ml-tensor'] as const)[location];\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { isNode } from './wasm-utils-env';\n\n/**\n * Load a file into a Uint8Array.\n *\n * @param file - the file to load. Can be a URL/path, a Blob, an ArrayBuffer, or a Uint8Array.\n * @returns a Uint8Array containing the file data.\n */\nexport const loadFile = async (file: string | Blob | ArrayBufferLike | Uint8Array): Promise<Uint8Array> => {\n  if (typeof file === 'string') {\n    if (isNode) {\n      // load file into ArrayBuffer in Node.js\n      try {\n        const { readFile } = require('node:fs/promises');\n        return new Uint8Array(await readFile(file));\n      } catch (e) {\n        if (e.code === 'ERR_FS_FILE_TOO_LARGE') {\n          // file is too large, use fs.createReadStream instead\n          const { createReadStream } = require('node:fs');\n          const stream = createReadStream(file);\n          const chunks: Uint8Array[] = [];\n          for await (const chunk of stream) {\n            chunks.push(chunk);\n          }\n          return new Uint8Array(Buffer.concat(chunks));\n        }\n        throw e;\n      }\n    } else {\n      // load file into ArrayBuffer in browsers\n      const response = await fetch(file);\n      if (!response.ok) {\n        throw new Error(`failed to load external data file: ${file}`);\n      }\n      const contentLengthHeader = response.headers.get('Content-Length');\n      const fileSize = contentLengthHeader ? parseInt(contentLengthHeader, 10) : 0;\n      if (fileSize < 1073741824 /* 1GB */) {\n        // when Content-Length header is not set, we cannot determine the file size. We assume it is small enough to\n        // load into memory.\n        return new Uint8Array(await response.arrayBuffer());\n      } else {\n        // file is too large, use stream instead\n        if (!response.body) {\n          throw new Error(`failed to load external data file: ${file}, no response body.`);\n        }\n        const reader = response.body.getReader();\n\n        let buffer;\n        try {\n          // try to create ArrayBuffer directly\n          buffer = new ArrayBuffer(fileSize);\n        } catch (e) {\n          if (e instanceof RangeError) {\n            // use WebAssembly Memory to allocate larger ArrayBuffer\n            const pages = Math.ceil(fileSize / 65536);\n            buffer = new WebAssembly.Memory({ initial: pages, maximum: pages }).buffer;\n          } else {\n            throw e;\n          }\n        }\n\n        let offset = 0;\n        while (true) {\n          const { done, value } = await reader.read();\n          if (done) {\n            break;\n          }\n          const chunkSize = value.byteLength;\n          const chunk = new Uint8Array(buffer, offset, chunkSize);\n          chunk.set(value);\n          offset += chunkSize;\n        }\n        return new Uint8Array(buffer, 0, fileSize);\n      }\n    }\n  } else if (file instanceof Blob) {\n    return new Uint8Array(await file.arrayBuffer());\n  } else if (file instanceof Uint8Array) {\n    return file;\n  } else {\n    return new Uint8Array(file);\n  }\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Tensor } from 'onnxruntime-common';\n\nimport { tensorTypeToTypedArrayConstructor } from '../wasm-common';\n\nexport const createView = (\n  dataBuffer: ArrayBuffer,\n  type: Tensor.Type,\n):\n  | Int32Array\n  | Uint32Array\n  | BigInt64Array\n  | BigUint64Array\n  | Uint8Array\n  | Float32Array\n  | Float64Array\n  | Int8Array\n  | Int16Array\n  | Uint16Array => new (tensorTypeToTypedArrayConstructor(type))(dataBuffer);\n\n/**\n * a TensorView does not own the data.\n */\nexport interface TensorView {\n  readonly data: number;\n  readonly dataType: number;\n  readonly dims: readonly number[];\n\n  /**\n   * get a Float16Array data view of the tensor data. tensor data must be on CPU.\n   */\n  getUint16Array(): Uint16Array;\n\n  /**\n   * get a Float32Array data view of the tensor data. tensor data must be on CPU.\n   */\n  getFloat32Array(): Float32Array;\n\n  /**\n   * get a BigInt64Array data view of the tensor data. tensor data must be on CPU.\n   */\n  getBigInt64Array(): BigInt64Array;\n\n  /**\n   * get a Int32Array data view of the tensor data. tensor data must be on CPU.\n   */\n  getInt32Array(): Int32Array;\n\n  /**\n   * get a Uint16Array data view of the tensor data. tensor data must be on CPU.\n   */\n  getUint16Array(): Uint16Array;\n\n  /**\n   * create a new tensor view with the same data but different dimensions.\n   */\n  reshape(newDims: readonly number[]): TensorView;\n}\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Env } from 'onnxruntime-common';\n\nimport { logLevelStringToEnum } from '../wasm-common';\n\ntype LogLevel = NonNullable<Env['logLevel']>;\ntype MessageString = string;\ntype MessageFunction = () => string;\ntype Message = MessageString | MessageFunction;\n\nconst logLevelPrefix = ['V', 'I', 'W', 'E', 'F'];\n\nconst doLog = (level: number, message: string): void => {\n  // eslint-disable-next-line no-console\n  console.log(`[${logLevelPrefix[level]},${new Date().toISOString()}]${message}`);\n};\n\nlet configLogLevel: LogLevel | undefined;\nlet debug: boolean | undefined;\n\nexport const configureLogger = ($configLogLevel: LogLevel, $debug: boolean): void => {\n  configLogLevel = $configLogLevel;\n  debug = $debug;\n};\n\n/**\n * A simple logging utility to log messages to the console.\n */\nexport const LOG = (logLevel: LogLevel, msg: Message): void => {\n  const messageLevel = logLevelStringToEnum(logLevel);\n  const configLevel = logLevelStringToEnum(configLogLevel);\n  if (messageLevel >= configLevel) {\n    doLog(messageLevel, typeof msg === 'function' ? msg() : msg);\n  }\n};\n\n/**\n * A simple logging utility to log messages to the console. Only logs when debug is enabled.\n */\nexport const LOG_DEBUG: typeof LOG = (...args: Parameters<typeof LOG>) => {\n  if (debug) {\n    LOG(...args);\n  }\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { WebNNBackend } from '../backend-webnn';\nimport { tensorTypeToTypedArrayConstructor } from '../../wasm-common';\nimport { LOG_DEBUG } from '../log';\n\n// WebNN API currently does not have a TypeScript definition file. This file is a workaround with types generated from\n// WebNN API specification.\n// https://github.com/webmachinelearning/webnn/issues/677\n/// <reference path=\"webnn.d.ts\" />\n\n/**\n * Map from MLOperandDataType to size in bits. Using bits instead of bytes to avoid possible precision loss on int4 and uint4.\n */\nconst webnnDataTypeToSize = new Map<MLOperandDataType, number>([\n  ['float32', 32],\n  ['float16', 16],\n  ['int32', 32],\n  ['uint32', 32],\n  ['int64', 64],\n  ['uint64', 64],\n  ['int8', 8],\n  ['uint8', 8],\n  ['int4', 4],\n  ['uint4', 4],\n]);\n\n// Convert integer data to an Int32Array buffer.\n// Supports conversion from int64, uint64, uint32, int8 and uint8 to int32.\nexport const convertDataToInt32 = (data: Uint8Array, dataType: MLOperandDataType): Uint8Array => {\n  if (dataType === 'int32') {\n    return data;\n  }\n\n  const dataTypeSize = webnnDataTypeToSize.get(dataType);\n  if (!dataTypeSize) {\n    throw new Error(`WebNN backend does not support data type: ${dataType}`);\n  }\n  const bytesPerElement = dataTypeSize / 8;\n  // Make sure the data length is a multiple of the data type size.\n  if (data.byteLength % bytesPerElement !== 0) {\n    throw new Error(`Invalid Uint8Array length - must be a multiple of ${bytesPerElement}.`);\n  }\n\n  // Convert Uint8Array to original typed array.\n  const numElements = data.byteLength / bytesPerElement;\n  const originalArray = new (tensorTypeToTypedArrayConstructor(dataType))(\n    data.buffer as ArrayBuffer,\n    data.byteOffset,\n    numElements,\n  );\n\n  switch (dataType) {\n    case 'int64':\n    case 'uint64': {\n      // Convert original typed array to Int32Array.\n      const int32Array = new Int32Array(numElements);\n      for (let i = 0; i < numElements; i++) {\n        const value = originalArray[i];\n\n        // Check for overflow.\n        if (value > 2147483647n || value < -2147483648n) {\n          throw new Error(`Can not convert int64 data to int32 - value out of range.`);\n        }\n\n        int32Array[i] = Number(value);\n      }\n\n      return new Uint8Array(int32Array.buffer);\n    }\n    case 'int8':\n    case 'uint8':\n    case 'uint32': {\n      // Check for overflow.\n      if (dataType === 'uint32') {\n        if (originalArray.some((value) => value > 2147483647)) {\n          throw new Error(`Can not convert uint32 data to int32 - value out of range.`);\n        }\n      }\n      // Convert original typed array to Int32Array.\n      const int32Array = Int32Array.from(originalArray, Number);\n      return new Uint8Array(int32Array.buffer);\n    }\n    default:\n      throw new Error(`Unsupported data conversion from ${dataType} to 'int32'`);\n  }\n};\n\n// Convert Int32Array data to original integer data buffer.\n// Supports conversion from int32 to int64, uint64, uint32, int8 and uint8.\nexport const convertInt32ToData = (data: Uint8Array, dataType: MLOperandDataType): Uint8Array => {\n  if (dataType === 'int32') {\n    return data;\n  }\n\n  // Make sure the data length is a multiple of 4 bytes (Int32Array).\n  if (data.byteLength % 4 !== 0) {\n    throw new Error('Invalid Uint8Array length - must be a multiple of 4 (int32).');\n  }\n\n  // Convert Uint8Array to Int32Array.\n  const numElements = data.byteLength / 4;\n  const int32Array = new Int32Array(data.buffer, data.byteOffset, numElements);\n\n  switch (dataType) {\n    case 'int64': {\n      const bigInt64Array = BigInt64Array.from(int32Array, BigInt);\n      return new Uint8Array(bigInt64Array.buffer);\n    }\n    case 'uint64': {\n      if (int32Array.some((value) => value < 0)) {\n        throw new Error('Can not convert int32 data to uin64 - negative value found.');\n      }\n      const bigUint64Array = BigUint64Array.from(int32Array, BigInt);\n      return new Uint8Array(bigUint64Array.buffer);\n    }\n    case 'int8': {\n      if (int32Array.some((value) => value < -128 || value > 127)) {\n        throw new Error('Can not convert int32 data to int8 - value out of range.');\n      }\n      const int8Array = Int8Array.from(int32Array, Number);\n      return new Uint8Array(int8Array.buffer);\n    }\n    case 'uint8': {\n      if (int32Array.some((value) => value < 0 || value > 255)) {\n        throw new Error('Can not convert int32 data to uint8 - value out of range.');\n      }\n      return Uint8Array.from(int32Array, Number);\n    }\n    case 'uint32': {\n      if (int32Array.some((value) => value < 0)) {\n        throw new Error('Can not convert int32 data to uint32 - negative value found.');\n      }\n      const uint32Array = Uint32Array.from(int32Array, Number);\n      return new Uint8Array(uint32Array.buffer);\n    }\n    default:\n      throw new Error(`Unsupported data conversion from 'int32' to ${dataType}`);\n  }\n};\n\nexport type TensorId = number;\n\n/**\n * Manages TensorId to MLTensor mapping.\n */\nexport interface TensorManager {\n  /**\n   * Reserve a new TensorId.\n   */\n  reserveTensorId(): TensorId;\n  /**\n   * Release a TensorId.\n   */\n  releaseTensorId(tensorId: TensorId): void;\n  /**\n   * Ensure a MLTensor is created for the TensorId.\n   */\n  ensureTensor(\n    sessionId: number,\n    tensorId: TensorId,\n    dataType: MLOperandDataType,\n    shape: readonly number[],\n    copyOld: boolean,\n  ): Promise<MLTensor>;\n  /**\n   * Upload data to a MLTensor.\n   */\n  upload(tensorId: TensorId, data: Uint8Array): void;\n  /**\n   * Download data from a MLTensor.\n   */\n  download(tensorId: TensorId): Promise<ArrayBuffer>;\n  download(tensorId: TensorId, dstTensor: ArrayBufferView | ArrayBuffer): Promise<undefined>;\n  /**\n   * Release all tensors for a given session.\n   */\n  releaseTensorsForSession(session: number): void;\n  /**\n   * Register an externally created MLTensor with a given session id and return a TensorId.\n   */\n  registerTensor(sessionId: number, mlTensor: MLTensor, dataType: MLOperandDataType, shape: number[]): TensorId;\n}\n\nlet tensorGuid = 1;\nconst createNewTensorId = (): TensorId => tensorGuid++;\n\n/**\n * Map from data type to fallback data type.\n * When the context does not support the original data type, use fallback data type as workaround.\n * Note: Currently, we only support fallback to int32 for certain integer data types.\n */\nconst webnnDataTypeToFallback = new Map<MLOperandDataType, MLOperandDataType>([\n  ['int8', 'int32'],\n  ['uint8', 'int32'],\n  ['uint32', 'int32'],\n  ['int64', 'int32'],\n]);\n\n/**\n * Calculate the byte length of a tensor with the given data type and shape.\n */\nconst calculateByteLength = (dataType: MLOperandDataType, shape: readonly number[]): number => {\n  const dataTypeSize = webnnDataTypeToSize.get(dataType);\n  if (!dataTypeSize) {\n    throw new Error(`WebNN backend does not support data type: ${dataType}`);\n  }\n  return shape.length > 0 ? Math.ceil((shape.reduce((a, b) => a * b) * dataTypeSize) / 8) : 0;\n};\n\n/**\n * TensorWrapper wraps an MLTensor and provides a way to track the last session that used it.\n */\nclass TensorWrapper {\n  // The id of the last session that used this tensor.\n  public sessionId: number;\n  // This flag is used to indicate whether the data has been converted to fallback data type.\n  public isDataConverted = false;\n\n  private mlContext: MLContext;\n  private mlTensor: MLTensor;\n  private dataType: MLOperandDataType;\n  // Fallback data type to use when the context does not support the original data type.\n  private fallbackDataType: MLOperandDataType | undefined;\n  private tensorShape: readonly number[];\n\n  constructor(descriptor: {\n    sessionId: number;\n    context: MLContext;\n    tensor: MLTensor;\n    dataType: MLOperandDataType;\n    shape: readonly number[];\n    fallbackDataType?: MLOperandDataType;\n  }) {\n    const { sessionId, context, tensor, dataType, shape, fallbackDataType } = descriptor;\n    this.sessionId = sessionId;\n    this.mlContext = context;\n    this.mlTensor = tensor;\n    this.dataType = dataType;\n    this.tensorShape = shape;\n    this.fallbackDataType = fallbackDataType;\n  }\n\n  public get tensor(): MLTensor {\n    return this.mlTensor;\n  }\n\n  public get type(): MLOperandDataType {\n    return this.dataType;\n  }\n\n  public get fallbackType(): MLOperandDataType | undefined {\n    return this.fallbackDataType;\n  }\n\n  public get shape(): readonly number[] {\n    return this.tensorShape;\n  }\n\n  public get byteLength(): number {\n    return calculateByteLength(this.dataType, this.tensorShape);\n  }\n\n  public destroy(): void {\n    LOG_DEBUG('verbose', () => '[WebNN] TensorWrapper.destroy');\n    this.mlTensor.destroy();\n  }\n\n  public write(data: Uint8Array): void {\n    this.mlContext.writeTensor(this.mlTensor, data);\n  }\n\n  public async read(): Promise<ArrayBuffer>;\n  public async read(dstBuffer?: ArrayBufferView | ArrayBuffer): Promise<ArrayBuffer | undefined>;\n  public async read(dstBuffer?: ArrayBufferView | ArrayBuffer): Promise<ArrayBuffer | undefined> {\n    if (this.fallbackDataType) {\n      // This tensor has been fallback to int32 as workaround, we need to read it as its original integer data type.\n      const data = await this.mlContext.readTensor(this.mlTensor);\n      const originalData = convertInt32ToData(new Uint8Array(data), this.dataType);\n\n      if (dstBuffer) {\n        const targetBuffer =\n          dstBuffer instanceof ArrayBuffer\n            ? new Uint8Array(dstBuffer)\n            : new Uint8Array(dstBuffer.buffer, dstBuffer.byteOffset, dstBuffer.byteLength);\n        targetBuffer.set(originalData);\n        return undefined;\n      } else {\n        return new Uint8Array(originalData).buffer;\n      }\n    } else {\n      return dstBuffer ? this.mlContext.readTensor(this.mlTensor, dstBuffer) : this.mlContext.readTensor(this.mlTensor);\n    }\n  }\n\n  public canReuseTensor(context: MLContext, dataType: MLOperandDataType, shape: readonly number[]): boolean {\n    return (\n      this.mlContext === context &&\n      this.dataType === dataType &&\n      this.tensorShape.length === shape.length &&\n      this.tensorShape.every((v, i) => v === shape[i])\n    );\n  }\n\n  public setIsDataConverted(isConverted: boolean): void {\n    this.isDataConverted = isConverted;\n  }\n}\n\n/**\n * TensorTracker tracks the MLTensor and pending upload data.\n *\n * We need to track the MLTensor and pending upload data because we delay the creation of MLTensor until\n * we know the data type and shape. This is because WebNN only support creating MLTensors with dataTypes and shape.\n */\nclass TensorIdTracker {\n  private activeUpload?: Uint8Array;\n\n  constructor(\n    private tensorManager: TensorManagerImpl,\n    private wrapper?: TensorWrapper,\n  ) {}\n\n  public get tensorWrapper(): TensorWrapper | undefined {\n    return this.wrapper;\n  }\n\n  public releaseTensor(): void {\n    if (this.tensorWrapper) {\n      this.tensorManager.releaseTensor(this.tensorWrapper);\n      this.wrapper = undefined;\n    }\n  }\n\n  public async ensureTensor(\n    sessionId: number,\n    dataType: MLOperandDataType,\n    shape: readonly number[],\n    copyOld: boolean,\n  ): Promise<MLTensor> {\n    const context = this.tensorManager.getMLContext(sessionId);\n    const opLimits = this.tensorManager.getMLOpSupportLimits(sessionId);\n    let fallbackDataType: MLOperandDataType | undefined;\n    // Check if the context supports the data type. If not, try to use the fallback data type.\n    if (!opLimits?.input.dataTypes.includes(dataType)) {\n      fallbackDataType = webnnDataTypeToFallback.get(dataType);\n      if (!fallbackDataType || opLimits?.input.dataTypes.includes(fallbackDataType)) {\n        throw new Error(`WebNN backend does not support data type: ${dataType}`);\n      }\n      LOG_DEBUG(\n        'verbose',\n        () => `[WebNN] TensorIdTracker.ensureTensor: fallback dataType from ${dataType} to ${fallbackDataType}`,\n      );\n    }\n\n    if (this.wrapper) {\n      if (this.wrapper.canReuseTensor(context, dataType, shape)) {\n        return this.wrapper.tensor;\n      } else {\n        if (copyOld) {\n          if (this.wrapper.byteLength !== calculateByteLength(dataType, shape)) {\n            throw new Error('Unable to copy data to tensor with different size.');\n          }\n          this.activeUpload = new Uint8Array(await this.wrapper.read());\n        }\n        this.tensorManager.releaseTensor(this.wrapper);\n      }\n    }\n\n    // eslint-disable-next-line no-bitwise\n    const usage = typeof MLTensorUsage == 'undefined' ? undefined : MLTensorUsage.READ | MLTensorUsage.WRITE;\n    this.wrapper = await this.tensorManager.getCachedTensor(\n      sessionId,\n      dataType,\n      shape,\n      usage,\n      true,\n      true,\n      fallbackDataType,\n    );\n\n    if (copyOld && this.activeUpload) {\n      // We don't need to convert the original integer data to int32,\n      // because it has been converted when it was uploaded.\n      this.wrapper.write(this.activeUpload);\n      this.activeUpload = undefined;\n    }\n\n    return this.wrapper.tensor;\n  }\n\n  public upload(data: Uint8Array): void {\n    let newData = data;\n    if (this.wrapper) {\n      if (this.wrapper.fallbackType) {\n        if (this.wrapper.fallbackType === 'int32') {\n          // Convert original integer data to int32.\n          newData = convertDataToInt32(data, this.wrapper.type);\n          this.wrapper.setIsDataConverted(true);\n        } else {\n          throw new Error(`Unsupported fallback data type: ${this.wrapper.fallbackType}`);\n        }\n      }\n\n      // Check if the data size matches the tensor size.\n      if (data.byteLength === this.wrapper.byteLength) {\n        // Write the newData to the tensor.\n        this.wrapper.write(newData);\n        return;\n      } else {\n        LOG_DEBUG('verbose', () => 'Data size does not match tensor size. Releasing tensor.');\n        this.releaseTensor();\n      }\n    }\n\n    if (this.activeUpload) {\n      this.activeUpload.set(newData);\n    } else {\n      this.activeUpload = new Uint8Array(newData);\n    }\n  }\n\n  public async download(dstBuffer?: ArrayBufferView | ArrayBuffer): Promise<ArrayBuffer | undefined> {\n    if (this.activeUpload) {\n      // If this.activeUpload has been converted to int32, we need to convert it back to original integer data type.\n      const dstData = this.wrapper?.isDataConverted\n        ? convertInt32ToData(this.activeUpload, this.wrapper?.type)\n        : this.activeUpload;\n\n      if (dstBuffer) {\n        if (dstBuffer instanceof ArrayBuffer) {\n          new Uint8Array(dstBuffer).set(dstData);\n        } else {\n          new Uint8Array(dstBuffer.buffer, dstBuffer.byteOffset, dstBuffer.byteLength).set(dstData);\n        }\n        return;\n      } else {\n        return dstData.buffer as ArrayBuffer;\n      }\n    }\n    if (!this.wrapper) {\n      throw new Error('Tensor has not been created.');\n    }\n\n    if (!dstBuffer) {\n      return this.wrapper.read();\n    }\n    return this.wrapper.read(dstBuffer);\n  }\n}\n\nclass TensorManagerImpl implements TensorManager {\n  private tensorTrackersById: Map<TensorId, TensorIdTracker> = new Map();\n  private freeTensors: TensorWrapper[] = [];\n  private externalTensors: Set<TensorWrapper> = new Set();\n\n  constructor(private backend: WebNNBackend) {}\n\n  public getMLContext(sessionId: number): MLContext {\n    const context = this.backend.getMLContext(sessionId);\n    if (!context) {\n      throw new Error('MLContext not found for session.');\n    }\n    return context;\n  }\n\n  public getMLOpSupportLimits(sessionId: number): MLOpSupportLimits | undefined {\n    return this.backend.getMLOpSupportLimits(sessionId);\n  }\n\n  public reserveTensorId(): TensorId {\n    const tensorId = createNewTensorId();\n    this.tensorTrackersById.set(tensorId, new TensorIdTracker(this));\n    return tensorId;\n  }\n\n  public releaseTensorId(tensorId: TensorId): void {\n    const tensorTracker = this.tensorTrackersById.get(tensorId);\n    if (!tensorTracker) {\n      return;\n    }\n    this.tensorTrackersById.delete(tensorId);\n    if (tensorTracker.tensorWrapper) {\n      this.releaseTensor(tensorTracker.tensorWrapper);\n    }\n  }\n\n  public async ensureTensor(\n    sessionId: number,\n    tensorId: TensorId,\n    dataType: MLOperandDataType,\n    shape: number[],\n    copyOld: boolean,\n  ): Promise<MLTensor> {\n    LOG_DEBUG(\n      'verbose',\n      () =>\n        `[WebNN] TensorManager.ensureTensor {tensorId: ${tensorId}, dataType: ${\n          dataType\n        }, shape: ${shape}, copyOld: ${copyOld}}`,\n    );\n    const tensor = this.tensorTrackersById.get(tensorId);\n    if (!tensor) {\n      throw new Error('Tensor not found.');\n    }\n    return tensor.ensureTensor(sessionId, dataType, shape, copyOld);\n  }\n\n  public upload(tensorId: TensorId, data: Uint8Array): void {\n    const tensor = this.tensorTrackersById.get(tensorId);\n    if (!tensor) {\n      throw new Error('Tensor not found.');\n    }\n    tensor.upload(data);\n  }\n\n  public async download(tensorId: TensorId): Promise<ArrayBuffer>;\n  public async download(tensorId: TensorId, dstBuffer: ArrayBufferView | ArrayBuffer): Promise<undefined>;\n  async download(tensorId: TensorId, dstBuffer?: ArrayBufferView | ArrayBuffer): Promise<ArrayBuffer | undefined> {\n    LOG_DEBUG(\n      'verbose',\n      () => `[WebNN] TensorManager.download {tensorId: ${tensorId}, dstBuffer: ${dstBuffer?.byteLength}}`,\n    );\n    const tensorTracker = this.tensorTrackersById.get(tensorId);\n    if (!tensorTracker) {\n      throw new Error('Tensor not found.');\n    }\n    return tensorTracker.download(dstBuffer);\n  }\n\n  public releaseTensorsForSession(sessionId: number): void {\n    for (const tensor of this.freeTensors) {\n      if (tensor.sessionId === sessionId) {\n        tensor.destroy();\n      }\n    }\n    this.freeTensors = this.freeTensors.filter((tensor) => tensor.sessionId !== sessionId);\n  }\n\n  public registerTensor(\n    sessionId: number,\n    mlTensor: MLTensor,\n    dataType: MLOperandDataType,\n    shape: readonly number[],\n  ): TensorId {\n    const context = this.getMLContext(sessionId);\n    const tensorId = createNewTensorId();\n    // Defaulting to READ | WRITE if usage is not provided.\n    const wrapper = new TensorWrapper({\n      sessionId,\n      context,\n      tensor: mlTensor,\n      dataType,\n      shape,\n    });\n    this.tensorTrackersById.set(tensorId, new TensorIdTracker(this, wrapper));\n    this.externalTensors.add(wrapper);\n    return tensorId;\n  }\n\n  /**\n   * Get or create an MLTensor with the given data type and shape.\n   */\n  public async getCachedTensor(\n    sessionId: number,\n    dataType: MLOperandDataType,\n    shape: readonly number[],\n    usage: MLTensorUsageFlags | undefined,\n    writable: boolean,\n    readable: boolean,\n    fallbackDataType?: MLOperandDataType,\n  ): Promise<TensorWrapper> {\n    const context = this.getMLContext(sessionId);\n    for (const [index, tensor] of this.freeTensors.entries()) {\n      if (tensor.canReuseTensor(context, dataType, shape)) {\n        LOG_DEBUG(\n          'verbose',\n          () =>\n            `[WebNN] Reusing tensor {dataType: ${dataType}, ${\n              fallbackDataType ? `fallbackDataType: ${fallbackDataType},` : ''\n            } shape: ${shape}`,\n        );\n        const wrapper = this.freeTensors.splice(index, 1)[0];\n        wrapper.sessionId = sessionId;\n        return wrapper;\n      }\n    }\n    LOG_DEBUG(\n      'verbose',\n      () =>\n        `[WebNN] MLContext.createTensor {dataType: ${dataType}, ${\n          fallbackDataType ? `fallbackDataType: ${fallbackDataType},` : ''\n        } shape: ${shape}}`,\n    );\n    const tensor = await context.createTensor({\n      dataType: fallbackDataType ?? dataType, // If fallback data type is provided, use it.\n      shape,\n      dimensions: shape,\n      usage,\n      writable,\n      readable,\n    });\n    return new TensorWrapper({ sessionId, context, tensor, dataType, shape, fallbackDataType });\n  }\n\n  /**\n   * Release tensor for reuse unless external.\n   */\n  public releaseTensor(tensorWrapper: TensorWrapper) {\n    if (this.externalTensors.has(tensorWrapper)) {\n      this.externalTensors.delete(tensorWrapper);\n    }\n    this.freeTensors.push(tensorWrapper);\n  }\n}\n\nexport const createTensorManager = (...args: ConstructorParameters<typeof TensorManagerImpl>): TensorManager =>\n  new TensorManagerImpl(...args);\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n// WebNN API currently does not have a TypeScript definition file. This file is a workaround with types generated from\n// WebNN API specification.\n// https://github.com/webmachinelearning/webnn/issues/677\n/// <reference path=\"webnn/webnn.d.ts\" />\n\nimport { Env, Tensor } from 'onnxruntime-common';\n\nimport { DataType, tensorDataTypeStringToEnum } from '../wasm-common';\nimport { getInstance } from '../wasm-factory';\n\nimport { createView } from './tensor-view';\nimport { TensorId, createTensorManager, convertDataToInt32 } from './webnn/tensor-manager';\nimport { configureLogger, LOG_DEBUG } from './log';\n\n/*\n * TensorProto::data_type to WebNN OperandType mapping.\n */\nconst onnxDataTypeToWebnnDataType = new Map<DataType, MLOperandDataType>([\n  [DataType.float, 'float32'],\n  [DataType.float16, 'float16'],\n  [DataType.int32, 'int32'],\n  [DataType.uint32, 'uint32'],\n  [DataType.int64, 'int64'],\n  [DataType.uint64, 'uint64'],\n  [DataType.int4, 'int4'],\n  [DataType.uint4, 'uint4'],\n  [DataType.int8, 'int8'],\n  [DataType.uint8, 'uint8'],\n  [DataType.bool, 'uint8'],\n]);\n\ntype MLContextEntry = {\n  gpuDevice?: GPUDevice;\n  options?: MLContextOptions;\n  mlContext: MLContext;\n};\n\nconst compareMLContextOptions = (a?: MLContextOptions, b?: MLContextOptions): boolean => {\n  if (a === b) {\n    return true;\n  }\n  if (a === undefined || b === undefined) {\n    return false;\n  }\n  const aKeys = Object.keys(a).sort() as Array<keyof typeof a>;\n  const bKeys = Object.keys(b).sort() as Array<keyof typeof b>;\n  return aKeys.length === bKeys.length && aKeys.every((key, index) => key === bKeys[index] && a[key] === b[key]);\n};\n\n/**\n * WebNN backend implementation. This class is used to keep track of the MLTensors created by the backend and keep track\n * of the current MLContext being used by the sessions.\n */\nexport class WebNNBackend {\n  /**\n   * Tensor managers for each session.\n   */\n  private tensorManager = createTensorManager(this);\n  /**\n   * Maps from session id to MLContexts.\n   */\n  private mlContextBySessionId = new Map<number, MLContext>();\n  /**\n   * Maps from MLContext to session ids.\n   */\n  private sessionIdsByMLContext = new Map<MLContext, Set<number>>();\n  /**\n   * Cache of MLContexts.\n   */\n  private mlContextCache: MLContextEntry[] = [];\n  /**\n   * Current session id.\n   */\n  private activeSessionId?: number;\n  /**\n   * Maps from session id to list of graph inputs.\n   */\n  private sessionGraphInputs: Map<number, string[]> = new Map();\n  /**\n   * Maps from session id to list of graph outputs.\n   */\n  private sessionGraphOutputs: Map<number, string[]> = new Map();\n  /**\n   * Temporary graph inputs for the current session.\n   * These inputs will be registered when the session is created.\n   */\n  private temporaryGraphInputs: string[] = [];\n  /**\n   * Temporary graph outputs for the current session.\n   * These outputs will be registered when the session is created.\n   */\n  private temporaryGraphOutputs: string[] = [];\n  /**\n   * Temporary tensors for the current session.\n   */\n  private temporarySessionTensorIds: Map<number, TensorId[]> = new Map();\n  /**\n   * Maps from session id to MLOpSupportLimits.\n   */\n  private mlOpSupportLimitsBySessionId = new Map<number, MLOpSupportLimits>();\n\n  constructor(env: Env) {\n    configureLogger(env.logLevel!, !!env.debug);\n  }\n\n  public get currentSessionId(): number {\n    if (this.activeSessionId === undefined) {\n      throw new Error('No active session');\n    }\n    return this.activeSessionId;\n  }\n\n  public onRunStart(sessionId: number): void {\n    LOG_DEBUG('verbose', () => `[WebNN] onRunStart {sessionId: ${sessionId}}`);\n    this.activeSessionId = sessionId;\n  }\n\n  public onRunEnd(sessionId: number): void {\n    LOG_DEBUG('verbose', () => `[WebNN] onRunEnd {sessionId: ${sessionId}}`);\n    const tensorIds = this.temporarySessionTensorIds.get(sessionId);\n    if (!tensorIds) {\n      return;\n    }\n    for (const tensorId of tensorIds) {\n      LOG_DEBUG('verbose', () => `[WebNN] releasing temporary tensor {tensorId: ${tensorId}}`);\n      this.tensorManager.releaseTensorId(tensorId);\n    }\n    this.temporarySessionTensorIds.delete(sessionId);\n    this.activeSessionId = undefined;\n  }\n\n  public async createMLContext(optionsOrDevice?: MLContextOptions | GPUDevice): Promise<MLContext> {\n    if (optionsOrDevice instanceof GPUDevice) {\n      const mlContextIndex = this.mlContextCache.findIndex((entry) => entry.gpuDevice === optionsOrDevice);\n      if (mlContextIndex !== -1) {\n        return this.mlContextCache[mlContextIndex].mlContext;\n      } else {\n        const mlContext = await navigator.ml.createContext(optionsOrDevice);\n        this.mlContextCache.push({ gpuDevice: optionsOrDevice, mlContext });\n        return mlContext;\n      }\n    } else if (optionsOrDevice === undefined) {\n      const mlContextIndex = this.mlContextCache.findIndex(\n        (entry) => entry.options === undefined && entry.gpuDevice === undefined,\n      );\n      if (mlContextIndex !== -1) {\n        return this.mlContextCache[mlContextIndex].mlContext;\n      } else {\n        const mlContext = await navigator.ml.createContext();\n        this.mlContextCache.push({ mlContext });\n        return mlContext;\n      }\n    }\n\n    const mlContextIndex = this.mlContextCache.findIndex((entry) =>\n      compareMLContextOptions(entry.options, optionsOrDevice),\n    );\n    if (mlContextIndex !== -1) {\n      return this.mlContextCache[mlContextIndex].mlContext;\n    } else {\n      const mlContext = await navigator.ml.createContext(optionsOrDevice);\n      this.mlContextCache.push({ options: optionsOrDevice, mlContext });\n      return mlContext;\n    }\n  }\n\n  public registerMLContext(sessionId: number, mlContext: MLContext): void {\n    this.mlContextBySessionId.set(sessionId, mlContext);\n    let sessionIds = this.sessionIdsByMLContext.get(mlContext);\n    if (!sessionIds) {\n      sessionIds = new Set();\n      this.sessionIdsByMLContext.set(mlContext, sessionIds);\n    }\n    sessionIds.add(sessionId);\n\n    if (!this.mlOpSupportLimitsBySessionId.has(sessionId)) {\n      this.mlOpSupportLimitsBySessionId.set(sessionId, mlContext.opSupportLimits());\n    }\n\n    if (this.temporaryGraphInputs.length > 0) {\n      this.sessionGraphInputs.set(sessionId, this.temporaryGraphInputs);\n      this.temporaryGraphInputs = [];\n    }\n    if (this.temporaryGraphOutputs.length > 0) {\n      this.sessionGraphOutputs.set(sessionId, this.temporaryGraphOutputs);\n      this.temporaryGraphOutputs = [];\n    }\n  }\n\n  public onReleaseSession(sessionId: number): void {\n    this.sessionGraphInputs.delete(sessionId);\n    this.sessionGraphOutputs.delete(sessionId);\n    const mlContext = this.mlContextBySessionId.get(sessionId)!;\n    if (!mlContext) {\n      // Current session is not a WebNN session.\n      return;\n    }\n    this.tensorManager.releaseTensorsForSession(sessionId);\n    this.mlContextBySessionId.delete(sessionId);\n    this.mlOpSupportLimitsBySessionId.delete(sessionId);\n    const sessionIds = this.sessionIdsByMLContext.get(mlContext)!;\n    sessionIds.delete(sessionId);\n    if (sessionIds.size === 0) {\n      this.sessionIdsByMLContext.delete(mlContext);\n      const mlContextIndex = this.mlContextCache.findIndex((entry) => entry.mlContext === mlContext);\n      if (mlContextIndex !== -1) {\n        this.mlContextCache.splice(mlContextIndex, 1);\n      }\n    }\n  }\n\n  public getMLContext(sessionId: number): MLContext | undefined {\n    return this.mlContextBySessionId.get(sessionId);\n  }\n\n  public getMLOpSupportLimits(sessionId: number): MLOpSupportLimits | undefined {\n    return this.mlOpSupportLimitsBySessionId.get(sessionId);\n  }\n\n  public reserveTensorId(): TensorId {\n    return this.tensorManager.reserveTensorId();\n  }\n\n  public releaseTensorId(tensorId: TensorId): void {\n    LOG_DEBUG('verbose', () => `[WebNN] releaseTensorId {tensorId: ${tensorId}}`);\n    this.tensorManager.releaseTensorId(tensorId);\n  }\n\n  public async ensureTensor(\n    sessionId: number | undefined,\n    tensorId: TensorId,\n    onnxDataType: DataType,\n    dimensions: number[],\n    copyOld: boolean,\n  ): Promise<MLTensor> {\n    const webnnDataType = onnxDataTypeToWebnnDataType.get(onnxDataType);\n    if (!webnnDataType) {\n      throw new Error(`Unsupported ONNX data type: ${onnxDataType}`);\n    }\n    return this.tensorManager.ensureTensor(\n      sessionId ?? this.currentSessionId,\n      tensorId,\n      webnnDataType,\n      dimensions,\n      copyOld,\n    );\n  }\n\n  public async createTemporaryTensor(\n    sessionId: number,\n    onnxDataType: DataType,\n    shape: readonly number[],\n  ): Promise<TensorId> {\n    LOG_DEBUG('verbose', () => `[WebNN] createTemporaryTensor {onnxDataType: ${onnxDataType}, shape: ${shape}}`);\n    const dataType = onnxDataTypeToWebnnDataType.get(onnxDataType);\n    if (!dataType) {\n      throw new Error(`Unsupported ONNX data type: ${onnxDataType}`);\n    }\n    const tensorId = this.tensorManager.reserveTensorId();\n    await this.tensorManager.ensureTensor(sessionId, tensorId, dataType, shape, false);\n    const tensorIds = this.temporarySessionTensorIds.get(sessionId);\n    if (!tensorIds) {\n      this.temporarySessionTensorIds.set(sessionId, [tensorId]);\n    } else {\n      tensorIds.push(tensorId);\n    }\n    return tensorId;\n  }\n\n  public uploadTensor(tensorId: TensorId, data: Uint8Array): void {\n    const wasm = getInstance();\n    if (!wasm.shouldTransferToMLTensor) {\n      throw new Error('Trying to upload to a MLTensor while shouldTransferToMLTensor is false');\n    }\n    LOG_DEBUG('verbose', () => `[WebNN] uploadTensor {tensorId: ${tensorId}, data: ${data.byteLength}}`);\n    this.tensorManager.upload(tensorId, data);\n  }\n\n  public async downloadTensor(tensorId: TensorId, dstBuffer: ArrayBufferView | ArrayBuffer): Promise<undefined> {\n    return this.tensorManager.download(tensorId, dstBuffer);\n  }\n\n  public createMLTensorDownloader(tensorId: TensorId, type: Tensor.MLTensorDataTypes): () => Promise<Tensor.DataType> {\n    return async () => {\n      const data = await this.tensorManager.download(tensorId);\n      return createView(data, type);\n    };\n  }\n\n  public registerMLTensor(sessionId: number, tensor: MLTensor, onnxDataType: DataType, dimensions: number[]): TensorId {\n    const webnnDataType = onnxDataTypeToWebnnDataType.get(onnxDataType);\n    if (!webnnDataType) {\n      throw new Error(`Unsupported ONNX data type: ${onnxDataType}`);\n    }\n\n    const id = this.tensorManager.registerTensor(sessionId, tensor, webnnDataType, dimensions);\n    LOG_DEBUG(\n      'verbose',\n      () =>\n        `[WebNN] registerMLTensor {tensor: ${tensor}, dataType: ${webnnDataType}, dimensions: ${\n          dimensions\n        }} -> {tensorId: ${id}}`,\n    );\n    return id;\n  }\n\n  // Register a WebNN Constant operand from external data.\n  public registerMLConstant(\n    externalFilePath: string,\n    dataOffset: number,\n    dataLength: number,\n    builder: MLGraphBuilder,\n    desc: MLOperandDescriptor,\n    mountedFiles: Map<string, Uint8Array> | undefined,\n    shouldConvertInt64ToInt32 = false,\n  ): MLOperand {\n    // If available, \"Module.MountedFiles\" is a Map for all preloaded files.\n    if (!mountedFiles) {\n      throw new Error('External mounted files are not available.');\n    }\n\n    let filePath = externalFilePath;\n    if (externalFilePath.startsWith('./')) {\n      filePath = externalFilePath.substring(2);\n    }\n    const fileData = mountedFiles.get(filePath);\n    if (!fileData) {\n      throw new Error(`File with name ${filePath} not found in preloaded files.`);\n    }\n\n    if (dataOffset + dataLength > fileData.byteLength) {\n      throw new Error('Out of bounds: data offset and length exceed the external file data size.');\n    }\n\n    const buffer = fileData.slice(dataOffset, dataOffset + dataLength).buffer;\n    let bufferView: ArrayBufferView;\n    switch (desc.dataType) {\n      case 'float32':\n        bufferView = new Float32Array(buffer);\n        break;\n      case 'float16':\n        bufferView = typeof Float16Array !== 'undefined' ? new Float16Array(buffer) : new Uint16Array(buffer);\n        break;\n      case 'int32':\n        bufferView = new Int32Array(buffer);\n        break;\n      case 'uint32':\n        bufferView = new Uint32Array(buffer);\n        break;\n      case 'int64':\n        if (shouldConvertInt64ToInt32) {\n          // Int64 is not supported by current context, use int32 instead.\n          const int32Buffer = convertDataToInt32(new Uint8Array(buffer), 'int64');\n          bufferView = new Int32Array(int32Buffer.buffer);\n          desc.dataType = 'int32';\n        } else {\n          bufferView = new BigInt64Array(buffer);\n        }\n        break;\n      case 'uint64':\n        bufferView = new BigUint64Array(buffer);\n        break;\n      case 'int8':\n        bufferView = new Int8Array(buffer);\n        break;\n      case 'int4':\n      case 'uint4':\n      case 'uint8':\n        bufferView = new Uint8Array(buffer);\n        break;\n      default:\n        throw new Error(`Unsupported data type: ${desc.dataType} in creating WebNN Constant from external data.`);\n    }\n\n    LOG_DEBUG(\n      'verbose',\n      () =>\n        `[WebNN] registerMLConstant {dataType: ${desc.dataType}, shape: ${desc.shape}}} ${\n          shouldConvertInt64ToInt32 ? '(Note: it was int64 data type and registered to int32 as workaround)' : ''\n        }`,\n    );\n\n    return builder.constant(desc, bufferView);\n  }\n\n  public registerGraphInput(inputName: string): void {\n    this.temporaryGraphInputs.push(inputName);\n  }\n\n  public registerGraphOutput(outputName: string): void {\n    this.temporaryGraphOutputs.push(outputName);\n  }\n\n  public isGraphInput(sessionId: number, inputName: string): boolean {\n    const inputNames = this.sessionGraphInputs.get(sessionId);\n    if (!inputNames) {\n      return false;\n    }\n    return inputNames.includes(inputName);\n  }\n\n  public isGraphOutput(sessionId: number, outputName: string): boolean {\n    const outputNames = this.sessionGraphOutputs.get(sessionId);\n    if (!outputNames) {\n      return false;\n    }\n    return outputNames.includes(outputName);\n  }\n\n  public isGraphInputOutputTypeSupported(sessionId: number, type: Tensor.Type, isInput = true): boolean {\n    const dataType = onnxDataTypeToWebnnDataType.get(tensorDataTypeStringToEnum(type));\n    const opLimits = this.mlOpSupportLimitsBySessionId.get(sessionId);\n\n    if (typeof dataType === 'undefined') {\n      return false;\n    }\n\n    if (isInput) {\n      return !!opLimits?.input.dataTypes.includes(dataType);\n    } else {\n      return !!opLimits?.output.dataTypes.includes(dataType);\n    }\n  }\n\n  public flush(): void {\n    // Unlike the WebGPU backend, the WebNN backend does not need to flush any pending operations.\n  }\n}\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n// WebNN API currently does not have a TypeScript definition file. This file is a workaround with types generated from\n// WebNN API specification.\n// https://github.com/webmachinelearning/webnn/issues/677\n/// <reference path=\"jsep/webnn/webnn.d.ts\" />\n\nimport { Env, InferenceSession, Tensor, TRACE_EVENT_BEGIN, TRACE_EVENT_END } from 'onnxruntime-common';\n\nimport {\n  SerializableInternalBuffer,\n  SerializableSessionMetadata,\n  SerializableTensorMetadata,\n  TensorMetadata,\n} from './proxy-messages';\nimport { setRunOptions } from './run-options';\nimport { setSessionOptions } from './session-options';\nimport {\n  calculateTensorSizeInBytes,\n  dataLocationStringToEnum,\n  isGpuBufferSupportedType,\n  isMLTensorSupportedType,\n  logLevelStringToEnum,\n  tensorDataTypeEnumToString,\n  tensorDataTypeStringToEnum,\n  tensorTypeToTypedArrayConstructor,\n} from './wasm-common';\nimport { getInstance } from './wasm-factory';\nimport { allocWasmString, checkLastError } from './wasm-utils';\nimport { loadFile } from './wasm-utils-load-file';\n\n// #region Initializations\n\n/**\n * There are 4 different \"initialization\" steps for ORT. They happen in different places and different time.\n *\n * 1. JavaScript initialization for onnxruntime-common and onnxruntime-web.\n *    This is the first initialization step. In this step, onnxruntime-web calls onnxruntime-common's registerBackend()\n * function multiple times to register all the available backends. The backend registration is very fast. It only\n * registers the backend name with the uninitialized backend object. No heavy initialization is done in this step.\n *    Refer to web/lib/index.ts for the backend registration.\n *\n * 2. WebAssembly artifact initialization.\n *    This happens when any registered wasm backend is used for the first time (ie. `ort.InferenceSession.create()` is\n * called). In this step, onnxruntime-web does the followings:\n *     - create a proxy worker and make sure the proxy worker is ready to receive messages, if proxy is enabled.\n *     - perform feature detection, locate correct WebAssembly artifact path and call the Emscripten generated\n * JavaScript code to initialize the WebAssembly runtime.\n *         - if proxy is enabled, this step happens in the proxy worker using message 'init-wasm'.\n *         - downloading the 'ort-wasm{...}.wasm' file is done in this step.\n *         - if multi-thread is enabled, one or more webworker will be created to initialize the PThread threadpool.\n *\n * 3. ORT environment initialization.\n *    This happens after step 2. In this step, onnxruntime-web performs ONNX Runtime environment initialization.\n * Function `_OrtInit()` is called in this step.\n *     - if proxy is enabled, this step happens in the proxy worker using message 'init-ort'.\n *     - logging level (ort.env.logLevel) and thread number (ort.env.wasm.numThreads) are set in this step.\n *\n * 4. Session initialization.\n *    This happens when `ort.InferenceSession.create()` is called. Unlike the first 3 steps (they only called once),\n * this step will be done for each session. In this step, onnxruntime-web does the followings:\n *    If the parameter is a URL:\n *    - download the model data from the URL.\n *    - copy the model data to the WASM heap. (proxy: 'copy-from')\n *    - dereference the model buffer. This step allows the original ArrayBuffer to be garbage collected.\n *    - call `_OrtCreateSession()` to create the session. (proxy: 'create')\n *\n *    If the parameter is a Uint8Array object:\n *    - copy the model data to the WASM heap. (proxy: 'copy-from')\n *    - call `_OrtCreateSession()` to create the session. (proxy: 'create')\n *\n *\n */\n\n/**\n * initialize ORT environment.\n *\n * @param numThreads SetGlobalIntraOpNumThreads(numThreads)\n * @param loggingLevel CreateEnv(static_cast<OrtLoggingLevel>(logging_level))\n */\nconst initOrt = (numThreads: number, loggingLevel: number): void => {\n  const errorCode = getInstance()._OrtInit(numThreads, loggingLevel);\n  if (errorCode !== 0) {\n    checkLastError(\"Can't initialize onnxruntime.\");\n  }\n};\n\n/**\n * initialize runtime environment.\n * @param env passed in the environment config object.\n */\nexport const initRuntime = async (env: Env): Promise<void> => {\n  // init ORT\n  initOrt(env.wasm.numThreads!, logLevelStringToEnum(env.logLevel));\n};\n\n/**\n * perform EP specific initialization.\n *\n * @param env\n * @param epName\n */\nexport const initEp = async (env: Env, epName: string): Promise<void> => {\n  // initialize ASYNCIFY support\n  getInstance().asyncInit?.();\n\n  // perform WebGPU availability check ( either JSEP or WebGPU EP )\n  let webgpuAdapter: GPUAdapter | null = env.webgpu.adapter;\n  if (epName === 'webgpu') {\n    if (typeof navigator === 'undefined' || !navigator.gpu) {\n      throw new Error('WebGPU is not supported in current environment');\n    }\n    if (!webgpuAdapter) {\n      // if adapter is not set, request a new adapter.\n      const powerPreference = env.webgpu.powerPreference;\n      if (powerPreference !== undefined && powerPreference !== 'low-power' && powerPreference !== 'high-performance') {\n        throw new Error(`Invalid powerPreference setting: \"${powerPreference}\"`);\n      }\n      const forceFallbackAdapter = env.webgpu.forceFallbackAdapter;\n      if (forceFallbackAdapter !== undefined && typeof forceFallbackAdapter !== 'boolean') {\n        throw new Error(`Invalid forceFallbackAdapter setting: \"${forceFallbackAdapter}\"`);\n      }\n      webgpuAdapter = await navigator.gpu.requestAdapter({ powerPreference, forceFallbackAdapter });\n      if (!webgpuAdapter) {\n        throw new Error(\n          'Failed to get GPU adapter. ' +\n            'You may need to enable flag \"--enable-unsafe-webgpu\" if you are using Chrome.',\n        );\n      }\n    } else {\n      // if adapter is set, validate it.\n      if (\n        typeof webgpuAdapter.limits !== 'object' ||\n        typeof webgpuAdapter.features !== 'object' ||\n        typeof webgpuAdapter.requestDevice !== 'function'\n      ) {\n        throw new Error('Invalid GPU adapter set in `env.webgpu.adapter`. It must be a GPUAdapter object.');\n      }\n    }\n  }\n\n  // perform WebNN availability check ( either JSEP or WebNN EP )\n  if (epName === 'webnn') {\n    if (typeof navigator === 'undefined' || !(navigator as unknown as { ml: unknown }).ml) {\n      throw new Error('WebNN is not supported in current environment');\n    }\n  }\n\n  if (!BUILD_DEFS.DISABLE_JSEP) {\n    // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n    const initJsep = require('./jsep/init').init;\n\n    if (epName === 'webgpu') {\n      await initJsep('webgpu', getInstance(), env, webgpuAdapter);\n    }\n    if (epName === 'webnn') {\n      await initJsep('webnn', getInstance(), env);\n    }\n  } else {\n    if (!BUILD_DEFS.DISABLE_WEBGPU && epName === 'webgpu') {\n      getInstance().webgpuInit!((device) => {\n        env.webgpu.device = device;\n      });\n    }\n    if (!BUILD_DEFS.DISABLE_WEBNN && epName === 'webnn') {\n      // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n      const backend = new (require('./jsep/backend-webnn').WebNNBackend)(env);\n      getInstance().webnnInit!([\n        backend,\n        // webnnReserveTensorId\n        () => backend.reserveTensorId(),\n        // webnnReleaseTensorId,\n        (tensorId: number) => backend.releaseTensorId(tensorId),\n        // webnnEnsureTensor\n        async (sessionId: number | undefined, tensorId: number, onnxDataType: number, shape: number[], copyOld) =>\n          backend.ensureTensor(sessionId, tensorId, onnxDataType, shape, copyOld),\n        // webnnUploadTensor\n        (tensorId: number, data: Uint8Array) => {\n          backend.uploadTensor(tensorId, data);\n        },\n        // webnnDownloadTensor\n        async (tensorId: number, dstBuffer: ArrayBufferView | ArrayBuffer) =>\n          backend.downloadTensor(tensorId, dstBuffer),\n        // webnnRegisterMLContext\n        (sessionId: number, mlContext: MLContext) => backend.registerMLContext(sessionId, mlContext),\n        // webnnEnableTraceEvent\n        !!env.trace,\n      ]);\n    }\n  }\n};\n\n// #endregion Initializations\n\n/**\n * valid data locations for input/output tensors.\n */\ntype SupportedTensorDataLocationForInputOutput =\n  | 'cpu'\n  | 'cpu-pinned'\n  | 'gpu-buffer'\n  | 'ml-tensor'\n  // Use 'ml-tensor' during inference, but output a tensor located on the CPU.\n  | 'ml-tensor-cpu-output';\n\ntype IOBindingState = {\n  /**\n   * the handle of IO binding.\n   */\n  readonly handle: number;\n\n  /**\n   * the preferred location for each output tensor.\n   *\n   * value is one of 'cpu', 'cpu-pinned', 'gpu-buffer', 'ml-tensor'.\n   */\n  readonly outputPreferredLocations: readonly SupportedTensorDataLocationForInputOutput[];\n\n  /**\n   * enum value of the preferred location for each output tensor.\n   */\n  readonly outputPreferredLocationsEncoded: readonly number[];\n};\n\n/**\n *  tuple elements are: InferenceSession ID; inputNamesUTF8Encoded; outputNamesUTF8Encoded; bindingState\n */\ntype SessionMetadata = [\n  inferenceSessionId: number,\n  inputNamesUTF8Encoded: number[],\n  outputNamesUTF8Encoded: number[],\n  bindingState: IOBindingState | null,\n  enableGraphCapture: boolean,\n  inputOutputBound: boolean,\n];\n\nconst activeSessions = new Map<number, SessionMetadata>();\n\n/**\n * get the input/output count of the session.\n * @param sessionHandle the handle representing the session. should be non-zero.\n * @returns a tuple including 2 numbers, representing the input count and output count.\n */\nconst getSessionInputOutputCount = (sessionHandle: number): [number, number] => {\n  const wasm = getInstance();\n  const stack = wasm.stackSave();\n  try {\n    const ptrSize = wasm.PTR_SIZE;\n    const dataOffset = wasm.stackAlloc(2 * ptrSize);\n    const errorCode = wasm._OrtGetInputOutputCount(sessionHandle, dataOffset, dataOffset + ptrSize);\n    if (errorCode !== 0) {\n      checkLastError(\"Can't get session input/output count.\");\n    }\n    const type = ptrSize === 4 ? 'i32' : 'i64';\n    return [Number(wasm.getValue(dataOffset, type)), Number(wasm.getValue(dataOffset + ptrSize, type))];\n  } finally {\n    wasm.stackRestore(stack);\n  }\n};\n\nconst getSessionInputOutputMetadata = (\n  sessionHandle: number,\n  index: number,\n): [nameOffset: number, elementType: number, dims?: Array<number | string>] => {\n  const wasm = getInstance();\n  const stack = wasm.stackSave();\n  let metadataOffset = 0;\n  try {\n    const ptrSize = wasm.PTR_SIZE;\n    const dataOffset = wasm.stackAlloc(2 * ptrSize);\n    const errorCode = wasm._OrtGetInputOutputMetadata(sessionHandle, index, dataOffset, dataOffset + ptrSize);\n    if (errorCode !== 0) {\n      checkLastError(\"Can't get session input/output metadata.\");\n    }\n    const nameOffset = Number(wasm.getValue(dataOffset, '*'));\n    metadataOffset = Number(wasm.getValue(dataOffset + ptrSize, '*'));\n    // get element type\n    const elementType = wasm.HEAP32[metadataOffset / 4];\n    if (elementType === 0) {\n      return [nameOffset, 0]; // non-tensor\n    }\n\n    // get dims count\n    const dimsCount = wasm.HEAPU32[metadataOffset / 4 + 1];\n    // get dims\n    const dims: Array<number | string> = [];\n    for (let i = 0; i < dimsCount; i++) {\n      const symbolicDimNameOffset = Number(wasm.getValue(metadataOffset + 8 + i * ptrSize, '*'));\n      dims.push(\n        symbolicDimNameOffset !== 0\n          ? wasm.UTF8ToString(symbolicDimNameOffset)\n          : Number(wasm.getValue(metadataOffset + 8 + (i + dimsCount) * ptrSize, '*')),\n      );\n    }\n    return [nameOffset, elementType, dims];\n  } finally {\n    wasm.stackRestore(stack);\n    if (metadataOffset !== 0) {\n      wasm._OrtFree(metadataOffset);\n    }\n  }\n};\n\n/**\n * allocate the memory and memcpy the external buffer.\n *\n * @param model - the external buffer containing the model data. Must not be the same buffer as the WASM heap.\n * @returns a 2-elements tuple - the pointer and size of the allocated buffer\n */\nexport const copyFromExternalBuffer = (model: Uint8Array): [number, number] => {\n  const wasm = getInstance();\n  const modelDataOffset = wasm._malloc(model.byteLength);\n  if (modelDataOffset === 0) {\n    throw new Error(`Can't create a session. failed to allocate a buffer of size ${model.byteLength}.`);\n  }\n  wasm.HEAPU8.set(model, modelDataOffset);\n  return [modelDataOffset, model.byteLength];\n};\n\n/**\n * create an inference session from a model data buffer.\n *\n * @param modelData - either a Uint8Array object representing the model data, or a 2-elements tuple containing the\n *     pointer and size of the model data buffer.\n * @param options an optional session options object.\n * @returns a 3-elements tuple containing [session handle, input names, output names]\n */\nexport const createSession = async (\n  modelData: Uint8Array | SerializableInternalBuffer,\n  options?: InferenceSession.SessionOptions,\n): Promise<SerializableSessionMetadata> => {\n  let modelDataOffset: number, modelDataLength: number;\n  const wasm = getInstance();\n\n  if (Array.isArray(modelData)) {\n    // if model data is an array, it must be a 2-elements tuple containing the pointer and size of the model data\n    [modelDataOffset, modelDataLength] = modelData;\n  } else if (modelData.buffer === wasm.HEAPU8.buffer) {\n    // if model data uses the same buffer as the WASM heap, we don't need to copy it.\n    [modelDataOffset, modelDataLength] = [modelData.byteOffset, modelData.byteLength];\n  } else {\n    // otherwise, copy the model data to the WASM heap.\n    [modelDataOffset, modelDataLength] = copyFromExternalBuffer(modelData);\n  }\n\n  let sessionHandle = 0;\n  let sessionOptionsHandle = 0;\n  let ioBindingHandle = 0;\n  let allocs: number[] = [];\n  const inputNamesUTF8Encoded = [];\n  const outputNamesUTF8Encoded = [];\n\n  try {\n    [sessionOptionsHandle, allocs] = await setSessionOptions(options);\n\n    if (options?.externalData && wasm.mountExternalData) {\n      const loadingPromises = [];\n      for (const file of options.externalData) {\n        const path = typeof file === 'string' ? file : file.path;\n        loadingPromises.push(\n          loadFile(typeof file === 'string' ? file : file.data).then((data) => {\n            wasm.mountExternalData(path, data);\n          }),\n        );\n      }\n\n      // wait for all external data files to be loaded\n      await Promise.all(loadingPromises);\n    }\n\n    for (const provider of options?.executionProviders ?? []) {\n      const providerName = typeof provider === 'string' ? provider : provider.name;\n      if (providerName === 'webnn') {\n        wasm.shouldTransferToMLTensor = false;\n        if (typeof provider !== 'string') {\n          const webnnOptions = provider as InferenceSession.WebNNExecutionProviderOption;\n          const context = (webnnOptions as InferenceSession.WebNNOptionsWithMLContext)?.context;\n          const gpuDevice = (webnnOptions as InferenceSession.WebNNOptionsWebGpu)?.gpuDevice;\n          const deviceType = (webnnOptions as InferenceSession.WebNNContextOptions)?.deviceType;\n          const powerPreference = (webnnOptions as InferenceSession.WebNNContextOptions)?.powerPreference;\n          if (context) {\n            wasm.currentContext = context as MLContext;\n          } else if (gpuDevice) {\n            wasm.currentContext = await wasm.webnnCreateMLContext!(gpuDevice);\n          } else {\n            wasm.currentContext = await wasm.webnnCreateMLContext!({ deviceType, powerPreference });\n          }\n        } else {\n          wasm.currentContext = await wasm.webnnCreateMLContext!();\n        }\n        break;\n      }\n    }\n\n    sessionHandle = await wasm._OrtCreateSession(modelDataOffset, modelDataLength, sessionOptionsHandle);\n    wasm.webgpuOnCreateSession?.(sessionHandle);\n    if (sessionHandle === 0) {\n      checkLastError(\"Can't create a session.\");\n    }\n\n    wasm.jsepOnCreateSession?.();\n\n    // clear current MLContext after session creation\n    if (wasm.currentContext) {\n      wasm.webnnRegisterMLContext!(sessionHandle, wasm.currentContext);\n      wasm.currentContext = undefined;\n      wasm.shouldTransferToMLTensor = true;\n    }\n\n    const [inputCount, outputCount] = getSessionInputOutputCount(sessionHandle);\n\n    const enableGraphCapture = !!options?.enableGraphCapture;\n\n    const inputNames = [];\n    const outputNames = [];\n    const inputMetadata: InferenceSession.ValueMetadata[] = [];\n    const outputMetadata: InferenceSession.ValueMetadata[] = [];\n    const outputPreferredLocations: SupportedTensorDataLocationForInputOutput[] = [];\n    for (let i = 0; i < inputCount; i++) {\n      const [nameOffset, elementType, shape] = getSessionInputOutputMetadata(sessionHandle, i);\n      if (nameOffset === 0) {\n        checkLastError(\"Can't get an input name.\");\n      }\n      inputNamesUTF8Encoded.push(nameOffset);\n      const name = wasm.UTF8ToString(nameOffset);\n      inputNames.push(name);\n      inputMetadata.push(\n        elementType === 0\n          ? { name, isTensor: false }\n          : { name, isTensor: true, type: tensorDataTypeEnumToString(elementType), shape: shape! },\n      );\n    }\n    for (let i = 0; i < outputCount; i++) {\n      const [nameOffset, elementType, shape] = getSessionInputOutputMetadata(sessionHandle, i + inputCount);\n      if (nameOffset === 0) {\n        checkLastError(\"Can't get an output name.\");\n      }\n      outputNamesUTF8Encoded.push(nameOffset);\n      const nameString = wasm.UTF8ToString(nameOffset);\n      outputNames.push(nameString);\n      outputMetadata.push(\n        elementType === 0\n          ? { name: nameString, isTensor: false }\n          : { name: nameString, isTensor: true, type: tensorDataTypeEnumToString(elementType), shape: shape! },\n      );\n\n      if (!BUILD_DEFS.DISABLE_JSEP || !BUILD_DEFS.DISABLE_WEBGPU) {\n        if (enableGraphCapture && options?.preferredOutputLocation === undefined) {\n          outputPreferredLocations.push('gpu-buffer');\n          continue;\n        }\n        const location =\n          typeof options?.preferredOutputLocation === 'string'\n            ? options.preferredOutputLocation\n            : (options?.preferredOutputLocation?.[nameString] ?? 'cpu');\n        const isGraphOutput = wasm.webnnIsGraphOutput;\n        if (location === 'cpu' && isGraphOutput && isGraphOutput(sessionHandle, nameString)) {\n          outputPreferredLocations.push('ml-tensor-cpu-output');\n          continue;\n        }\n        if (location !== 'cpu' && location !== 'cpu-pinned' && location !== 'gpu-buffer' && location !== 'ml-tensor') {\n          throw new Error(`Not supported preferred output location: ${location}.`);\n        }\n        if (enableGraphCapture && location !== 'gpu-buffer') {\n          throw new Error(\n            `Not supported preferred output location: ${location}. Only 'gpu-buffer' location is supported when enableGraphCapture is true.`,\n          );\n        }\n        outputPreferredLocations.push(location);\n      }\n    }\n\n    // use IO binding only when at least one output is preferred to be on GPU.\n    let bindingState: IOBindingState | null = null;\n    if (\n      (!BUILD_DEFS.DISABLE_JSEP || !BUILD_DEFS.DISABLE_WEBGPU) &&\n      outputPreferredLocations.some((l) => l === 'gpu-buffer' || l === 'ml-tensor' || l === 'ml-tensor-cpu-output')\n    ) {\n      ioBindingHandle = wasm._OrtCreateBinding(sessionHandle);\n      if (ioBindingHandle === 0) {\n        checkLastError(\"Can't create IO binding.\");\n      }\n\n      bindingState = {\n        handle: ioBindingHandle,\n        outputPreferredLocations,\n        outputPreferredLocationsEncoded: outputPreferredLocations\n          // 'ml-tensor-cpu-output' is treated as 'ml-tensor' for the purpose of IO binding.\n          .map((l) => (l === 'ml-tensor-cpu-output' ? 'ml-tensor' : l))\n          .map((l) => dataLocationStringToEnum(l)),\n      };\n    }\n\n    activeSessions.set(sessionHandle, [\n      sessionHandle,\n      inputNamesUTF8Encoded,\n      outputNamesUTF8Encoded,\n      bindingState,\n      enableGraphCapture,\n      false,\n    ]);\n    return [sessionHandle, inputNames, outputNames, inputMetadata, outputMetadata];\n  } catch (e) {\n    inputNamesUTF8Encoded.forEach((buf) => wasm._OrtFree(buf));\n    outputNamesUTF8Encoded.forEach((buf) => wasm._OrtFree(buf));\n\n    if (ioBindingHandle !== 0) {\n      if (wasm._OrtReleaseBinding(ioBindingHandle) !== 0) {\n        checkLastError(\"Can't release IO binding.\");\n      }\n    }\n\n    if (sessionHandle !== 0) {\n      if (wasm._OrtReleaseSession(sessionHandle) !== 0) {\n        checkLastError(\"Can't release session.\");\n      }\n    }\n    throw e;\n  } finally {\n    wasm._free(modelDataOffset);\n    if (sessionOptionsHandle !== 0) {\n      if (wasm._OrtReleaseSessionOptions(sessionOptionsHandle) !== 0) {\n        checkLastError(\"Can't release session options.\");\n      }\n    }\n    allocs.forEach((alloc) => wasm._free(alloc));\n\n    // unmount external data if necessary\n    wasm.unmountExternalData?.();\n  }\n};\n\nexport const releaseSession = (sessionId: number): void => {\n  const wasm = getInstance();\n  const session = activeSessions.get(sessionId);\n  if (!session) {\n    throw new Error(`cannot release session. invalid session id: ${sessionId}`);\n  }\n  const [sessionHandle, inputNamesUTF8Encoded, outputNamesUTF8Encoded, ioBindingState, enableGraphCapture] = session;\n\n  if (ioBindingState) {\n    if (enableGraphCapture) {\n      if (wasm._OrtClearBoundOutputs(ioBindingState.handle) !== 0) {\n        checkLastError(\"Can't clear bound outputs.\");\n      }\n    }\n    if (wasm._OrtReleaseBinding(ioBindingState.handle) !== 0) {\n      checkLastError(\"Can't release IO binding.\");\n    }\n  }\n\n  wasm.jsepOnReleaseSession?.(sessionId);\n  wasm.webnnOnReleaseSession?.(sessionId);\n  wasm.webgpuOnReleaseSession?.(sessionId);\n\n  inputNamesUTF8Encoded.forEach((buf) => wasm._OrtFree(buf));\n  outputNamesUTF8Encoded.forEach((buf) => wasm._OrtFree(buf));\n  if (wasm._OrtReleaseSession(sessionHandle) !== 0) {\n    checkLastError(\"Can't release session.\");\n  }\n  activeSessions.delete(sessionId);\n};\n\nexport const prepareInputOutputTensor = async (\n  tensor: TensorMetadata | null,\n  tensorHandles: number[],\n  allocs: number[],\n  sessionId: number,\n  tensorNameUTF8Encoded: number,\n  index: number,\n  enableGraphCapture = false,\n): Promise<void> => {\n  if (!tensor) {\n    tensorHandles.push(0);\n    return;\n  }\n\n  const wasm = getInstance();\n  const ptrSize = wasm.PTR_SIZE;\n\n  const dataType = tensor[0];\n  const dims = tensor[1];\n  const location = tensor[3];\n  let actualLocation = location;\n\n  let rawData: number;\n  let dataByteLength: number;\n\n  if (dataType === 'string' && (location === 'gpu-buffer' || location === 'ml-tensor')) {\n    throw new Error('String tensor is not supported on GPU.');\n  }\n\n  if (enableGraphCapture && location !== 'gpu-buffer') {\n    throw new Error(\n      `External buffer must be provided for input/output index ${index} when enableGraphCapture is true.`,\n    );\n  }\n\n  if (location === 'gpu-buffer') {\n    const gpuBuffer = tensor[2].gpuBuffer;\n    dataByteLength = calculateTensorSizeInBytes(tensorDataTypeStringToEnum(dataType), dims)!;\n\n    if (!BUILD_DEFS.DISABLE_WEBGPU) {\n      const registerBuffer = wasm.webgpuRegisterBuffer;\n      if (!registerBuffer) {\n        throw new Error('Tensor location \"gpu-buffer\" is not supported without using WebGPU.');\n      }\n\n      rawData = registerBuffer(gpuBuffer, sessionId);\n    } else {\n      const registerBuffer = wasm.jsepRegisterBuffer;\n      if (!registerBuffer) {\n        throw new Error('Tensor location \"gpu-buffer\" is not supported without using WebGPU.');\n      }\n      rawData = registerBuffer(sessionId, index, gpuBuffer, dataByteLength);\n    }\n  } else if (location === 'ml-tensor') {\n    const mlTensor = tensor[2].mlTensor;\n    dataByteLength = calculateTensorSizeInBytes(tensorDataTypeStringToEnum(dataType), dims)!;\n\n    const registerMLTensor = wasm.webnnRegisterMLTensor;\n    if (!registerMLTensor) {\n      throw new Error('Tensor location \"ml-tensor\" is not supported without using WebNN.');\n    }\n    rawData = registerMLTensor(sessionId, mlTensor, tensorDataTypeStringToEnum(dataType), dims);\n  } else {\n    const data = tensor[2];\n\n    if (Array.isArray(data)) {\n      // string tensor\n      dataByteLength = ptrSize * data.length;\n      rawData = wasm._malloc(dataByteLength);\n      allocs.push(rawData);\n      for (let i = 0; i < data.length; i++) {\n        if (typeof data[i] !== 'string') {\n          throw new TypeError(`tensor data at index ${i} is not a string`);\n        }\n        wasm.setValue(rawData + i * ptrSize, allocWasmString(data[i], allocs), '*');\n      }\n    } else {\n      const isGraphInput = wasm.webnnIsGraphInput;\n      const isGraphOutput = wasm.webnnIsGraphOutput;\n      if (dataType !== 'string' && isGraphInput && isGraphOutput) {\n        const tensorName = wasm.UTF8ToString(tensorNameUTF8Encoded);\n        // Promote the tensor to 'ml-tensor' if it is a graph input.\n        if (isGraphInput(sessionId, tensorName) || isGraphOutput(sessionId, tensorName)) {\n          const dataTypeEnum = tensorDataTypeStringToEnum(dataType);\n          dataByteLength = calculateTensorSizeInBytes(dataTypeEnum, dims)!;\n          actualLocation = 'ml-tensor';\n          const createTemporaryTensor = wasm.webnnCreateTemporaryTensor;\n          const uploadTensor = wasm.webnnUploadTensor;\n          if (!createTemporaryTensor || !uploadTensor) {\n            throw new Error('Tensor location \"ml-tensor\" is not supported without using WebNN.');\n          }\n          const tensorId = await createTemporaryTensor(sessionId, dataTypeEnum, dims);\n          uploadTensor(tensorId, new Uint8Array(data.buffer, data.byteOffset, data.byteLength));\n          rawData = tensorId;\n        } else {\n          dataByteLength = data.byteLength;\n          rawData = wasm._malloc(dataByteLength);\n          allocs.push(rawData);\n          wasm.HEAPU8.set(new Uint8Array(data.buffer, data.byteOffset, dataByteLength), rawData);\n        }\n      } else {\n        dataByteLength = data.byteLength;\n        rawData = wasm._malloc(dataByteLength);\n        allocs.push(rawData);\n        wasm.HEAPU8.set(new Uint8Array(data.buffer, data.byteOffset, dataByteLength), rawData);\n      }\n    }\n  }\n\n  const stack = wasm.stackSave();\n  const dimsOffset = wasm.stackAlloc(4 * dims.length);\n  try {\n    dims.forEach((d, index) => wasm.setValue(dimsOffset + index * ptrSize, d, ptrSize === 4 ? 'i32' : 'i64'));\n    const tensor = wasm._OrtCreateTensor(\n      tensorDataTypeStringToEnum(dataType),\n      rawData,\n      dataByteLength,\n      dimsOffset,\n      dims.length,\n      dataLocationStringToEnum(actualLocation),\n    );\n    if (tensor === 0) {\n      checkLastError(`Can't create tensor for input/output. session=${sessionId}, index=${index}.`);\n    }\n    tensorHandles.push(tensor);\n  } finally {\n    wasm.stackRestore(stack);\n  }\n};\n\n/**\n * perform inference run\n */\nexport const run = async (\n  sessionId: number,\n  inputIndices: number[],\n  inputTensors: TensorMetadata[],\n  outputIndices: number[],\n  outputTensors: Array<TensorMetadata | null>,\n  options: InferenceSession.RunOptions,\n): Promise<TensorMetadata[]> => {\n  const wasm = getInstance();\n  const ptrSize = wasm.PTR_SIZE;\n  const session = activeSessions.get(sessionId);\n  if (!session) {\n    throw new Error(`cannot run inference. invalid session id: ${sessionId}`);\n  }\n  const sessionHandle = session[0];\n  const inputNamesUTF8Encoded = session[1];\n  const outputNamesUTF8Encoded = session[2];\n  const ioBindingState = session[3];\n  const enableGraphCapture = session[4];\n  const inputOutputBound = session[5];\n\n  const inputCount = inputIndices.length;\n  const outputCount = outputIndices.length;\n\n  let runOptionsHandle = 0;\n  let runOptionsAllocs: number[] = [];\n\n  const inputTensorHandles: number[] = [];\n  const outputTensorHandles: number[] = [];\n  const inputOutputAllocs: number[] = [];\n  const preAllocatedOutputs: number[] = [];\n\n  const beforeRunStack = wasm.stackSave();\n  const inputValuesOffset = wasm.stackAlloc(inputCount * ptrSize);\n  const inputNamesOffset = wasm.stackAlloc(inputCount * ptrSize);\n  const outputValuesOffset = wasm.stackAlloc(outputCount * ptrSize);\n  const outputNamesOffset = wasm.stackAlloc(outputCount * ptrSize);\n\n  try {\n    [runOptionsHandle, runOptionsAllocs] = setRunOptions(options);\n\n    TRACE_EVENT_BEGIN('wasm prepareInputOutputTensor');\n    // create input tensors\n    for (let i = 0; i < inputCount; i++) {\n      await prepareInputOutputTensor(\n        inputTensors[i],\n        inputTensorHandles,\n        inputOutputAllocs,\n        sessionId,\n        inputNamesUTF8Encoded[inputIndices[i]],\n        inputIndices[i],\n        enableGraphCapture,\n      );\n    }\n\n    // create output tensors\n    for (let i = 0; i < outputCount; i++) {\n      await prepareInputOutputTensor(\n        outputTensors[i],\n        outputTensorHandles,\n        inputOutputAllocs,\n        sessionId,\n        outputNamesUTF8Encoded[outputIndices[i]],\n        inputCount + outputIndices[i],\n        enableGraphCapture,\n      );\n    }\n    TRACE_EVENT_END('wasm prepareInputOutputTensor');\n\n    for (let i = 0; i < inputCount; i++) {\n      wasm.setValue(inputValuesOffset + i * ptrSize, inputTensorHandles[i], '*');\n      wasm.setValue(inputNamesOffset + i * ptrSize, inputNamesUTF8Encoded[inputIndices[i]], '*');\n    }\n    for (let i = 0; i < outputCount; i++) {\n      wasm.setValue(outputValuesOffset + i * ptrSize, outputTensorHandles[i], '*');\n      wasm.setValue(outputNamesOffset + i * ptrSize, outputNamesUTF8Encoded[outputIndices[i]], '*');\n    }\n\n    if ((!BUILD_DEFS.DISABLE_JSEP || !BUILD_DEFS.DISABLE_WEBGPU) && ioBindingState && !inputOutputBound) {\n      const { handle, outputPreferredLocations, outputPreferredLocationsEncoded } = ioBindingState;\n\n      if (inputNamesUTF8Encoded.length !== inputCount) {\n        throw new Error(\n          `input count from feeds (${inputCount}) is expected to be always equal to model's input count (${inputNamesUTF8Encoded.length}).`,\n        );\n      }\n\n      TRACE_EVENT_BEGIN('wasm bindInputsOutputs');\n      // process inputs\n      for (let i = 0; i < inputCount; i++) {\n        const index = inputIndices[i];\n        const errorCode = await wasm._OrtBindInput(handle, inputNamesUTF8Encoded[index], inputTensorHandles[i]);\n        if (errorCode !== 0) {\n          checkLastError(`Can't bind input[${i}] for session=${sessionId}.`);\n        }\n      }\n\n      // process pre-allocated outputs\n      for (let i = 0; i < outputCount; i++) {\n        const index = outputIndices[i];\n        const location = outputTensors[i]?.[3]; // undefined means output is not pre-allocated.\n\n        if (location) {\n          // output is pre-allocated, store and bind the tensor.\n          preAllocatedOutputs.push(outputTensorHandles[i]);\n          const errorCode = wasm._OrtBindOutput(handle, outputNamesUTF8Encoded[index], outputTensorHandles[i], 0);\n          if (errorCode !== 0) {\n            checkLastError(`Can't bind pre-allocated output[${i}] for session=${sessionId}.`);\n          }\n        } else {\n          // output is not pre-allocated. reset preferred location.\n          const errorCode = wasm._OrtBindOutput(\n            handle,\n            outputNamesUTF8Encoded[index],\n            0,\n            outputPreferredLocationsEncoded[index],\n          );\n          if (errorCode !== 0) {\n            checkLastError(`Can't bind output[${i}] to ${outputPreferredLocations[i]} for session=${sessionId}.`);\n          }\n        }\n      }\n      TRACE_EVENT_END('wasm bindInputsOutputs');\n      activeSessions.set(sessionId, [\n        sessionHandle,\n        inputNamesUTF8Encoded,\n        outputNamesUTF8Encoded,\n        ioBindingState,\n        enableGraphCapture,\n        true,\n      ]);\n    }\n\n    wasm.jsepOnRunStart?.(sessionHandle);\n    wasm.webnnOnRunStart?.(sessionHandle);\n\n    let errorCode: number;\n    if ((!BUILD_DEFS.DISABLE_JSEP || !BUILD_DEFS.DISABLE_WEBGPU) && ioBindingState) {\n      errorCode = await wasm._OrtRunWithBinding(\n        sessionHandle,\n        ioBindingState.handle,\n        outputCount,\n        outputValuesOffset,\n        runOptionsHandle,\n      );\n    } else {\n      errorCode = await wasm._OrtRun(\n        sessionHandle,\n        inputNamesOffset,\n        inputValuesOffset,\n        inputCount,\n        outputNamesOffset,\n        outputCount,\n        outputValuesOffset,\n        runOptionsHandle,\n      );\n    }\n\n    if (errorCode !== 0) {\n      checkLastError('failed to call OrtRun().');\n    }\n\n    const output: TensorMetadata[] = [];\n    const outputPromises: Array<Promise<[number, Tensor.DataType]>> = [];\n\n    TRACE_EVENT_BEGIN('wasm ProcessOutputTensor');\n    for (let i = 0; i < outputCount; i++) {\n      const tensor = Number(wasm.getValue(outputValuesOffset + i * ptrSize, '*'));\n      // TODO: revisit this part to ensure it works for WebGPU when both pre-allocated outputs and\n      // preferred location are specified.\n      // Certain pre-allocated tensors may already be bound in the IO binding. e.g. the WebNN backend\n      // always binds its tensor to 'ml-tensor'. In such cases, the tensor ID might change after binding,\n      // but copying data for these tensors should still be avoided.\n      if (tensor === outputTensorHandles[i] || preAllocatedOutputs.includes(outputTensorHandles[i])) {\n        // output tensor is pre-allocated. no need to copy data.\n        output.push(outputTensors[i]!);\n        if (tensor !== outputTensorHandles[i]) {\n          // release redundant tensor earlier.\n          if (wasm._OrtReleaseTensor(tensor) !== 0) {\n            checkLastError(\"Can't release tensor.\");\n          }\n        }\n        continue;\n      }\n\n      const beforeGetTensorDataStack = wasm.stackSave();\n      // stack allocate 4 pointer value\n      const tensorDataOffset = wasm.stackAlloc(4 * ptrSize);\n\n      let keepOutputTensor = false;\n      let type: Tensor.Type | undefined,\n        dataOffset = 0;\n      try {\n        const errorCode = wasm._OrtGetTensorData(\n          tensor,\n          tensorDataOffset,\n          tensorDataOffset + ptrSize,\n          tensorDataOffset + 2 * ptrSize,\n\n          tensorDataOffset + 3 * ptrSize,\n        );\n        if (errorCode !== 0) {\n          checkLastError(`Can't access output tensor data on index ${i}.`);\n        }\n        const valueType = ptrSize === 4 ? 'i32' : 'i64';\n        const dataType = Number(wasm.getValue(tensorDataOffset, valueType));\n        dataOffset = wasm.getValue(tensorDataOffset + ptrSize, '*');\n        const dimsOffset = wasm.getValue(tensorDataOffset + ptrSize * 2, '*');\n        const dimsLength = Number(wasm.getValue(tensorDataOffset + ptrSize * 3, valueType));\n        const dims = [];\n        for (let i = 0; i < dimsLength; i++) {\n          dims.push(Number(wasm.getValue(dimsOffset + i * ptrSize, valueType)));\n        }\n        if (wasm._OrtFree(dimsOffset) !== 0) {\n          checkLastError(\"Can't free memory for tensor dims.\");\n        }\n        const size = dims.reduce((a, b) => a * b, 1);\n        type = tensorDataTypeEnumToString(dataType);\n\n        const preferredLocation = ioBindingState?.outputPreferredLocations[outputIndices[i]];\n\n        if (type === 'string') {\n          if (preferredLocation === 'gpu-buffer' || preferredLocation === 'ml-tensor') {\n            throw new Error('String tensor is not supported on GPU.');\n          }\n          const stringData: string[] = [];\n          for (let i = 0; i < size; i++) {\n            const offset = wasm.getValue(dataOffset + i * ptrSize, '*');\n            const nextOffset = wasm.getValue(dataOffset + (i + 1) * ptrSize, '*');\n            const maxBytesToRead = i === size - 1 ? undefined : nextOffset - offset;\n            stringData.push(wasm.UTF8ToString(offset, maxBytesToRead));\n          }\n          output.push([type, dims, stringData, 'cpu']);\n        } else {\n          // If a certain output's preferred location is GPU but the tensor is empty, we still need to create a CPU\n          // tensor for it. There is no mapping GPU buffer for an empty tensor.\n          if (preferredLocation === 'gpu-buffer' && size > 0) {\n            const getBuffer = !BUILD_DEFS.DISABLE_WEBGPU ? wasm.webgpuGetBuffer : wasm.jsepGetBuffer;\n            if (!getBuffer) {\n              throw new Error('preferredLocation \"gpu-buffer\" is not supported without using WebGPU.');\n            }\n            const gpuBuffer = getBuffer(dataOffset);\n            const bufferSize = calculateTensorSizeInBytes(dataType, size);\n            if (bufferSize === undefined || !isGpuBufferSupportedType(type)) {\n              throw new Error(`Unsupported data type: ${type}`);\n            }\n\n            // do not release the tensor right now. it will be released when user calls tensor.dispose().\n            keepOutputTensor = true;\n\n            if (!BUILD_DEFS.DISABLE_WEBGPU) {\n              wasm.webgpuRegisterBuffer!(gpuBuffer, sessionId, dataOffset);\n              const downloadDataFunction = wasm.webgpuCreateDownloader!(gpuBuffer, bufferSize, sessionId);\n              output.push([\n                type,\n                dims,\n                {\n                  gpuBuffer,\n                  download: async () => {\n                    const arrayBuffer = await downloadDataFunction();\n                    const data = new (tensorTypeToTypedArrayConstructor(type!))(arrayBuffer);\n                    return data as Tensor.DataTypeMap[Tensor.GpuBufferDataTypes];\n                  },\n                  dispose: () => {\n                    if (wasm._OrtReleaseTensor(tensor) !== 0) {\n                      checkLastError(\"Can't release tensor.\");\n                    }\n                  },\n                },\n                'gpu-buffer',\n              ]);\n            } else {\n              output.push([\n                type,\n                dims,\n                {\n                  gpuBuffer,\n                  download: wasm.jsepCreateDownloader!(gpuBuffer, bufferSize, type),\n                  dispose: () => {\n                    if (wasm._OrtReleaseTensor(tensor) !== 0) {\n                      checkLastError(\"Can't release tensor.\");\n                    }\n                  },\n                },\n                'gpu-buffer',\n              ]);\n            }\n          } else if (preferredLocation === 'ml-tensor' && size > 0) {\n            const ensureTensor = wasm.webnnEnsureTensor;\n            const isGraphInputOutputTypeSupported = wasm.webnnIsGraphInputOutputTypeSupported;\n            if (!ensureTensor || !isGraphInputOutputTypeSupported) {\n              throw new Error('preferredLocation \"ml-tensor\" is not supported without using WebNN.');\n            }\n            const tensorSize = calculateTensorSizeInBytes(dataType, size);\n            if (tensorSize === undefined || !isMLTensorSupportedType(type)) {\n              throw new Error(`Unsupported data type: ${type}`);\n            }\n            if (!isGraphInputOutputTypeSupported(sessionId, type, false)) {\n              throw new Error(\n                `preferredLocation \"ml-tensor\" for ${type} output is not supported by current WebNN Context.`,\n              );\n            }\n\n            // If the graph has been partitioned, the output tensor may have not been created. For this reason, we use\n            // ensureTensor to get/create the MLTensor. In which case, we don't need to copy the data if a new tensor\n            // has been created.\n            const mlTensor = await ensureTensor(sessionId, dataOffset, dataType, dims, false);\n\n            // do not release the tensor right now. it will be released when user calls tensor.dispose().\n            keepOutputTensor = true;\n\n            output.push([\n              type,\n              dims,\n              {\n                mlTensor,\n                download: wasm.webnnCreateMLTensorDownloader!(dataOffset, type),\n                dispose: () => {\n                  wasm.webnnReleaseTensorId!(dataOffset);\n                  wasm._OrtReleaseTensor(tensor);\n                },\n              },\n              'ml-tensor',\n            ]);\n          } else if (preferredLocation === 'ml-tensor-cpu-output' && size > 0) {\n            const data = wasm.webnnCreateMLTensorDownloader!(dataOffset, type as Tensor.MLTensorDataTypes)();\n            const index = output.length;\n            // Delay the data download and releasing the tensor until we can wait for all output tensors to be downloaded.\n            keepOutputTensor = true;\n            outputPromises.push(\n              (async () => {\n                const result: [number, Tensor.DataType] = [index, await data];\n                wasm.webnnReleaseTensorId!(dataOffset);\n                wasm._OrtReleaseTensor(tensor);\n                return result;\n              })(),\n            );\n            output.push([type, dims, [], 'cpu']);\n          } else {\n            const typedArrayConstructor = tensorTypeToTypedArrayConstructor(type);\n            const data = new typedArrayConstructor(size);\n            new Uint8Array(data.buffer, data.byteOffset, data.byteLength).set(\n              wasm.HEAPU8.subarray(dataOffset, dataOffset + data.byteLength),\n            );\n            output.push([type, dims, data, 'cpu']);\n          }\n        }\n      } finally {\n        wasm.stackRestore(beforeGetTensorDataStack);\n        if (type === 'string' && dataOffset) {\n          wasm._free(dataOffset);\n        }\n        if (!keepOutputTensor) {\n          wasm._OrtReleaseTensor(tensor);\n        }\n      }\n    }\n\n    if (ioBindingState && !enableGraphCapture) {\n      if (wasm._OrtClearBoundOutputs(ioBindingState.handle) !== 0) {\n        checkLastError(\"Can't clear bound outputs.\");\n      }\n      activeSessions.set(sessionId, [\n        sessionHandle,\n        inputNamesUTF8Encoded,\n        outputNamesUTF8Encoded,\n        ioBindingState,\n        enableGraphCapture,\n        false,\n      ]);\n    }\n    // Wait for all output tensor data to be downloaded.\n    for (const [index, data] of await Promise.all(outputPromises)) {\n      output[index][2] = data;\n    }\n    TRACE_EVENT_END('wasm ProcessOutputTensor');\n    return output;\n  } finally {\n    wasm.webnnOnRunEnd?.(sessionHandle);\n\n    wasm.stackRestore(beforeRunStack);\n\n    if (!BUILD_DEFS.DISABLE_WEBGPU) {\n      inputTensors.forEach((t) => {\n        if (t && t[3] === 'gpu-buffer') {\n          wasm.webgpuUnregisterBuffer!(t[2].gpuBuffer);\n        }\n      });\n      outputTensors.forEach((t) => {\n        if (t && t[3] === 'gpu-buffer') {\n          wasm.webgpuUnregisterBuffer!(t[2].gpuBuffer);\n        }\n      });\n    }\n    inputTensorHandles.forEach((v) => wasm._OrtReleaseTensor(v));\n    outputTensorHandles.forEach((v) => wasm._OrtReleaseTensor(v));\n    inputOutputAllocs.forEach((p) => wasm._free(p));\n\n    if (runOptionsHandle !== 0) {\n      wasm._OrtReleaseRunOptions(runOptionsHandle);\n    }\n    runOptionsAllocs.forEach((p) => wasm._free(p));\n  }\n};\n\n/**\n * end profiling\n */\nexport const endProfiling = (sessionId: number): void => {\n  const wasm = getInstance();\n  const session = activeSessions.get(sessionId);\n  if (!session) {\n    throw new Error('invalid session id');\n  }\n  const sessionHandle = session[0];\n\n  // profile file name is not used yet, but it must be freed.\n  const profileFileName = wasm._OrtEndProfiling(sessionHandle);\n  if (profileFileName === 0) {\n    checkLastError(\"Can't get an profile file name.\");\n  }\n  wasm._OrtFree(profileFileName);\n};\n\nexport const extractTransferableBuffers = (tensors: readonly SerializableTensorMetadata[]): ArrayBufferLike[] => {\n  const buffers: ArrayBufferLike[] = [];\n  for (const tensor of tensors) {\n    const data = tensor[2];\n    if (!Array.isArray(data) && 'buffer' in data) {\n      buffers.push(data.buffer);\n    }\n  }\n  return buffers;\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { env, InferenceSession } from 'onnxruntime-common';\n\nimport {\n  OrtWasmMessage,\n  SerializableInternalBuffer,\n  SerializableSessionMetadata,\n  SerializableTensorMetadata,\n  TensorMetadata,\n} from './proxy-messages';\nimport * as core from './wasm-core-impl';\nimport { initializeWebAssembly } from './wasm-factory';\nimport {\n  importProxyWorker,\n  inferWasmPathPrefixFromScriptSrc,\n  isEsmImportMetaUrlHardcodedAsFileUri,\n} from './wasm-utils-import';\n\nconst isProxy = (): boolean => !!env.wasm.proxy && typeof document !== 'undefined';\nlet proxyWorker: Worker | undefined;\nlet initializing = false;\nlet initialized = false;\nlet aborted = false;\nlet temporaryObjectUrl: string | undefined;\n\ntype PromiseCallbacks<T = void> = [resolve: (result: T) => void, reject: (reason: unknown) => void];\nlet initWasmCallbacks: PromiseCallbacks;\nconst queuedCallbacks: Map<OrtWasmMessage['type'], Array<PromiseCallbacks<unknown>>> = new Map();\n\nconst enqueueCallbacks = (type: OrtWasmMessage['type'], callbacks: PromiseCallbacks<unknown>): void => {\n  const queue = queuedCallbacks.get(type);\n  if (queue) {\n    queue.push(callbacks);\n  } else {\n    queuedCallbacks.set(type, [callbacks]);\n  }\n};\n\nconst ensureWorker = (): void => {\n  if (initializing || !initialized || aborted || !proxyWorker) {\n    throw new Error('worker not ready');\n  }\n};\n\nconst onProxyWorkerMessage = (ev: MessageEvent<OrtWasmMessage>): void => {\n  switch (ev.data.type) {\n    case 'init-wasm':\n      initializing = false;\n      if (ev.data.err) {\n        aborted = true;\n        initWasmCallbacks[1](ev.data.err);\n      } else {\n        initialized = true;\n        initWasmCallbacks[0]();\n      }\n      if (temporaryObjectUrl) {\n        URL.revokeObjectURL(temporaryObjectUrl);\n        temporaryObjectUrl = undefined;\n      }\n      break;\n    case 'init-ep':\n    case 'copy-from':\n    case 'create':\n    case 'release':\n    case 'run':\n    case 'end-profiling': {\n      const callbacks = queuedCallbacks.get(ev.data.type)!;\n      if (ev.data.err) {\n        callbacks.shift()![1](ev.data.err);\n      } else {\n        callbacks.shift()![0](ev.data.out!);\n      }\n      break;\n    }\n    default:\n  }\n};\n\nexport const initializeWebAssemblyAndOrtRuntime = async (): Promise<void> => {\n  if (initialized) {\n    return;\n  }\n  if (initializing) {\n    throw new Error(\"multiple calls to 'initWasm()' detected.\");\n  }\n  if (aborted) {\n    throw new Error(\"previous call to 'initWasm()' failed.\");\n  }\n\n  initializing = true;\n\n  if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n    return new Promise<void>((resolve, reject) => {\n      proxyWorker?.terminate();\n\n      void importProxyWorker().then(([objectUrl, worker]) => {\n        try {\n          proxyWorker = worker;\n          proxyWorker.onerror = (ev: ErrorEvent) => reject(ev);\n          proxyWorker.onmessage = onProxyWorkerMessage;\n          initWasmCallbacks = [resolve, reject];\n          const message: OrtWasmMessage = { type: 'init-wasm', in: env };\n\n          // if the proxy worker is loaded from a blob URL, we need to make sure the path information is not lost.\n          //\n          // when `env.wasm.wasmPaths` is not set, we need to pass the path information to the worker.\n          //\n          if (!BUILD_DEFS.ENABLE_BUNDLE_WASM_JS && !message.in!.wasm.wasmPaths && objectUrl) {\n            // for a build not bundled the wasm JS, we need to pass the path prefix to the worker.\n            // the path prefix will be used to resolve the path to both the wasm JS and the wasm file.\n            const inferredWasmPathPrefix = inferWasmPathPrefixFromScriptSrc();\n            if (inferredWasmPathPrefix) {\n              message.in!.wasm.wasmPaths = inferredWasmPathPrefix;\n            }\n          }\n\n          if (\n            BUILD_DEFS.IS_ESM &&\n            BUILD_DEFS.ENABLE_BUNDLE_WASM_JS &&\n            !message.in!.wasm.wasmPaths &&\n            (objectUrl || isEsmImportMetaUrlHardcodedAsFileUri)\n          ) {\n            // for a build bundled the wasm JS, if either of the following conditions is met:\n            // - the proxy worker is loaded from a blob URL\n            // - `import.meta.url` is a file URL, it means it is overwritten by the bundler.\n            //\n            // in either case, the path information is lost, we need to pass the path of the .wasm file to the worker.\n            // we need to use the bundler preferred URL format:\n            // new URL('filename', import.meta.url)\n            // so that the bundler can handle the file using corresponding loaders.\n            message.in!.wasm.wasmPaths = {\n              wasm: !BUILD_DEFS.DISABLE_JSEP\n                ? new URL('ort-wasm-simd-threaded.jsep.wasm', BUILD_DEFS.ESM_IMPORT_META_URL).href\n                : BUILD_DEFS.ENABLE_JSPI\n                  ? new URL('ort-wasm-simd-threaded.jspi.wasm', BUILD_DEFS.ESM_IMPORT_META_URL).href\n                  : !BUILD_DEFS.DISABLE_WEBGPU\n                    ? new URL('ort-wasm-simd-threaded.asyncify.wasm', BUILD_DEFS.ESM_IMPORT_META_URL).href\n                    : new URL('ort-wasm-simd-threaded.wasm', BUILD_DEFS.ESM_IMPORT_META_URL).href,\n            };\n          }\n          proxyWorker.postMessage(message);\n          temporaryObjectUrl = objectUrl;\n        } catch (e) {\n          reject(e);\n        }\n      }, reject);\n    });\n  } else {\n    try {\n      await initializeWebAssembly(env.wasm);\n      await core.initRuntime(env);\n      initialized = true;\n    } catch (e) {\n      aborted = true;\n      throw e;\n    } finally {\n      initializing = false;\n    }\n  }\n};\n\nexport const initializeOrtEp = async (epName: string): Promise<void> => {\n  if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n    ensureWorker();\n    return new Promise<void>((resolve, reject) => {\n      enqueueCallbacks('init-ep', [resolve, reject]);\n      const message: OrtWasmMessage = { type: 'init-ep', in: { epName, env } };\n      proxyWorker!.postMessage(message);\n    });\n  } else {\n    await core.initEp(env, epName);\n  }\n};\n\nexport const copyFromExternalBuffer = async (buffer: Uint8Array): Promise<SerializableInternalBuffer> => {\n  if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n    ensureWorker();\n    return new Promise<SerializableInternalBuffer>((resolve, reject) => {\n      enqueueCallbacks('copy-from', [resolve, reject]);\n      const message: OrtWasmMessage = { type: 'copy-from', in: { buffer } };\n      proxyWorker!.postMessage(message, [buffer.buffer]);\n    });\n  } else {\n    return core.copyFromExternalBuffer(buffer);\n  }\n};\n\nexport const createSession = async (\n  model: SerializableInternalBuffer | Uint8Array,\n  options?: InferenceSession.SessionOptions,\n): Promise<SerializableSessionMetadata> => {\n  if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n    // check unsupported options\n    if (options?.preferredOutputLocation) {\n      throw new Error('session option \"preferredOutputLocation\" is not supported for proxy.');\n    }\n    ensureWorker();\n    return new Promise<SerializableSessionMetadata>((resolve, reject) => {\n      enqueueCallbacks('create', [resolve, reject]);\n      const message: OrtWasmMessage = { type: 'create', in: { model, options: { ...options } } };\n      const transferable: Transferable[] = [];\n      if (model instanceof Uint8Array) {\n        transferable.push(model.buffer);\n      }\n      proxyWorker!.postMessage(message, transferable);\n    });\n  } else {\n    return core.createSession(model, options);\n  }\n};\n\nexport const releaseSession = async (sessionId: number): Promise<void> => {\n  if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n    ensureWorker();\n    return new Promise<void>((resolve, reject) => {\n      enqueueCallbacks('release', [resolve, reject]);\n      const message: OrtWasmMessage = { type: 'release', in: sessionId };\n      proxyWorker!.postMessage(message);\n    });\n  } else {\n    core.releaseSession(sessionId);\n  }\n};\n\nexport const run = async (\n  sessionId: number,\n  inputIndices: number[],\n  inputs: TensorMetadata[],\n  outputIndices: number[],\n  outputs: Array<TensorMetadata | null>,\n  options: InferenceSession.RunOptions,\n): Promise<TensorMetadata[]> => {\n  if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n    // check inputs location\n    if (inputs.some((t) => t[3] !== 'cpu')) {\n      throw new Error('input tensor on GPU is not supported for proxy.');\n    }\n    // check outputs location\n    if (outputs.some((t) => t)) {\n      throw new Error('pre-allocated output tensor is not supported for proxy.');\n    }\n    ensureWorker();\n    return new Promise<SerializableTensorMetadata[]>((resolve, reject) => {\n      enqueueCallbacks('run', [resolve, reject]);\n      const serializableInputs = inputs as SerializableTensorMetadata[]; // every input is on CPU.\n      const message: OrtWasmMessage = {\n        type: 'run',\n        in: { sessionId, inputIndices, inputs: serializableInputs, outputIndices, options },\n      };\n      proxyWorker!.postMessage(message, core.extractTransferableBuffers(serializableInputs));\n    });\n  } else {\n    return core.run(sessionId, inputIndices, inputs, outputIndices, outputs, options);\n  }\n};\n\nexport const endProfiling = async (sessionId: number): Promise<void> => {\n  if (!BUILD_DEFS.DISABLE_WASM_PROXY && isProxy()) {\n    ensureWorker();\n    return new Promise<void>((resolve, reject) => {\n      enqueueCallbacks('end-profiling', [resolve, reject]);\n      const message: OrtWasmMessage = { type: 'end-profiling', in: sessionId };\n      proxyWorker!.postMessage(message);\n    });\n  } else {\n    core.endProfiling(sessionId);\n  }\n};\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport {\n  InferenceSession,\n  InferenceSessionHandler,\n  SessionHandler,\n  Tensor,\n  TRACE_FUNC_BEGIN,\n  TRACE_FUNC_END,\n} from 'onnxruntime-common';\n\nimport { SerializableInternalBuffer, TensorMetadata } from './proxy-messages';\nimport { copyFromExternalBuffer, createSession, endProfiling, releaseSession, run } from './proxy-wrapper';\nimport { isGpuBufferSupportedType, isMLTensorSupportedType } from './wasm-common';\nimport { isNode } from './wasm-utils-env';\nimport { loadFile } from './wasm-utils-load-file';\n\nexport const encodeTensorMetadata = (tensor: Tensor, getName: () => string): TensorMetadata => {\n  switch (tensor.location) {\n    case 'cpu':\n      return [tensor.type, tensor.dims, tensor.data, 'cpu'];\n    case 'gpu-buffer':\n      return [tensor.type, tensor.dims, { gpuBuffer: tensor.gpuBuffer }, 'gpu-buffer'];\n    case 'ml-tensor':\n      return [tensor.type, tensor.dims, { mlTensor: tensor.mlTensor }, 'ml-tensor'];\n    default:\n      throw new Error(`invalid data location: ${tensor.location} for ${getName()}`);\n  }\n};\n\nexport const decodeTensorMetadata = (tensor: TensorMetadata): Tensor => {\n  switch (tensor[3]) {\n    case 'cpu':\n      return new Tensor(tensor[0], tensor[2], tensor[1]);\n    case 'gpu-buffer': {\n      const dataType = tensor[0];\n      if (!isGpuBufferSupportedType(dataType)) {\n        throw new Error(`not supported data type: ${dataType} for deserializing GPU tensor`);\n      }\n      const { gpuBuffer, download, dispose } = tensor[2];\n      return Tensor.fromGpuBuffer(gpuBuffer, { dataType, dims: tensor[1], download, dispose });\n    }\n    case 'ml-tensor': {\n      const dataType = tensor[0];\n      if (!isMLTensorSupportedType(dataType)) {\n        throw new Error(`not supported data type: ${dataType} for deserializing MLTensor tensor`);\n      }\n      const { mlTensor, download, dispose } = tensor[2];\n      return Tensor.fromMLTensor(mlTensor, { dataType, dims: tensor[1], download, dispose });\n    }\n    default:\n      throw new Error(`invalid data location: ${tensor[3]}`);\n  }\n};\n\nexport class OnnxruntimeWebAssemblySessionHandler implements InferenceSessionHandler {\n  private sessionId: number;\n\n  inputNames: readonly string[];\n  outputNames: readonly string[];\n  inputMetadata: readonly InferenceSession.ValueMetadata[];\n  outputMetadata: readonly InferenceSession.ValueMetadata[];\n\n  async fetchModelAndCopyToWasmMemory(path: string): Promise<SerializableInternalBuffer> {\n    // fetch model from url and move to wasm heap.\n    return copyFromExternalBuffer(await loadFile(path));\n  }\n\n  async loadModel(pathOrBuffer: string | Uint8Array, options?: InferenceSession.SessionOptions): Promise<void> {\n    TRACE_FUNC_BEGIN();\n    let model: Parameters<typeof createSession>[0];\n\n    if (typeof pathOrBuffer === 'string') {\n      if (isNode) {\n        // node\n        model = await loadFile(pathOrBuffer);\n      } else {\n        // browser\n        // fetch model and copy to wasm heap.\n        model = await this.fetchModelAndCopyToWasmMemory(pathOrBuffer);\n      }\n    } else {\n      model = pathOrBuffer;\n    }\n\n    [this.sessionId, this.inputNames, this.outputNames, this.inputMetadata, this.outputMetadata] = await createSession(\n      model,\n      options,\n    );\n    TRACE_FUNC_END();\n  }\n\n  async dispose(): Promise<void> {\n    return releaseSession(this.sessionId);\n  }\n\n  async run(\n    feeds: SessionHandler.FeedsType,\n    fetches: SessionHandler.FetchesType,\n    options: InferenceSession.RunOptions,\n  ): Promise<SessionHandler.ReturnType> {\n    TRACE_FUNC_BEGIN();\n    const inputArray: Tensor[] = [];\n    const inputIndices: number[] = [];\n    Object.entries(feeds).forEach((kvp) => {\n      const name = kvp[0];\n      const tensor = kvp[1];\n      const index = this.inputNames.indexOf(name);\n      if (index === -1) {\n        throw new Error(`invalid input '${name}'`);\n      }\n      inputArray.push(tensor);\n      inputIndices.push(index);\n    });\n\n    const outputArray: Array<Tensor | null> = [];\n    const outputIndices: number[] = [];\n    Object.entries(fetches).forEach((kvp) => {\n      const name = kvp[0];\n      const tensor = kvp[1];\n      const index = this.outputNames.indexOf(name);\n      if (index === -1) {\n        throw new Error(`invalid output '${name}'`);\n      }\n      outputArray.push(tensor);\n      outputIndices.push(index);\n    });\n\n    const inputs = inputArray.map((t, i) =>\n      encodeTensorMetadata(t, () => `input \"${this.inputNames[inputIndices[i]]}\"`),\n    );\n    const outputs = outputArray.map((t, i) =>\n      t ? encodeTensorMetadata(t, () => `output \"${this.outputNames[outputIndices[i]]}\"`) : null,\n    );\n\n    const results = await run(this.sessionId, inputIndices, inputs, outputIndices, outputs, options);\n\n    const resultMap: SessionHandler.ReturnType = {};\n    for (let i = 0; i < results.length; i++) {\n      resultMap[this.outputNames[outputIndices[i]]] = outputArray[i] ?? decodeTensorMetadata(results[i]);\n    }\n    TRACE_FUNC_END();\n    return resultMap;\n  }\n\n  startProfiling(): void {\n    // TODO: implement profiling\n  }\n\n  endProfiling(): void {\n    void endProfiling(this.sessionId);\n  }\n}\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\nimport { Backend, env, InferenceSession, InferenceSessionHandler } from 'onnxruntime-common';\n\nimport { initializeOrtEp, initializeWebAssemblyAndOrtRuntime } from './wasm/proxy-wrapper';\nimport { OnnxruntimeWebAssemblySessionHandler } from './wasm/session-handler-inference';\n\n/**\n * This function initializes all flags for WebAssembly.\n *\n * Those flags are accessible from `ort.env.wasm`. Users are allow to set those flags before the first inference session\n * being created, to override default value.\n */\nexport const initializeFlags = (): void => {\n  if (typeof env.wasm.initTimeout !== 'number' || env.wasm.initTimeout < 0) {\n    env.wasm.initTimeout = 0;\n  }\n\n  const simd = env.wasm.simd;\n  if (typeof simd !== 'boolean' && simd !== undefined && simd !== 'fixed' && simd !== 'relaxed') {\n    // eslint-disable-next-line no-console\n    console.warn(\n      `Property \"env.wasm.simd\" is set to unknown value \"${simd}\". Reset it to \\`false\\` and ignore SIMD feature checking.`,\n    );\n    env.wasm.simd = false;\n  }\n\n  if (typeof env.wasm.proxy !== 'boolean') {\n    env.wasm.proxy = false;\n  }\n\n  if (typeof env.wasm.trace !== 'boolean') {\n    env.wasm.trace = false;\n  }\n\n  if (typeof env.wasm.numThreads !== 'number' || !Number.isInteger(env.wasm.numThreads) || env.wasm.numThreads <= 0) {\n    // The following logic only applies when `ort.env.wasm.numThreads` is not set by user. We will always honor user's\n    // setting if it is provided.\n\n    // Browser: when crossOriginIsolated is false, SharedArrayBuffer is not available so WebAssembly threads will not\n    // work. In this case, we will set numThreads to 1.\n    //\n    // There is an exception: when the browser is configured to force-enable SharedArrayBuffer (e.g. Chromuim with\n    // --enable-features=SharedArrayBuffer), it is possible that `self.crossOriginIsolated` is false and\n    // SharedArrayBuffer is available at the same time. This is usually for testing. In this case,  we will still set\n    // numThreads to 1 here. If we want to enable multi-threading in test, we should set `ort.env.wasm.numThreads` to a\n    // value greater than 1.\n    if (typeof self !== 'undefined' && !self.crossOriginIsolated) {\n      env.wasm.numThreads = 1;\n    } else {\n      const numCpuLogicalCores =\n        typeof navigator === 'undefined' ? require('node:os').cpus().length : navigator.hardwareConcurrency;\n      env.wasm.numThreads = Math.min(4, Math.ceil((numCpuLogicalCores || 1) / 2));\n    }\n  }\n};\n\nexport class OnnxruntimeWebAssemblyBackend implements Backend {\n  /**\n   * This function initializes the WebAssembly backend.\n   *\n   * This function will be called only once for each backend name. It will be called the first time when\n   * `ort.InferenceSession.create()` is called with a registered backend name.\n   *\n   * @param backendName - the registered backend name.\n   */\n  async init(backendName: string): Promise<void> {\n    // populate wasm flags\n    initializeFlags();\n\n    // init wasm\n    await initializeWebAssemblyAndOrtRuntime();\n\n    // performe EP specific initialization\n    await initializeOrtEp(backendName);\n  }\n  createInferenceSessionHandler(\n    path: string,\n    options?: InferenceSession.SessionOptions,\n  ): Promise<InferenceSessionHandler>;\n  createInferenceSessionHandler(\n    buffer: Uint8Array,\n    options?: InferenceSession.SessionOptions,\n  ): Promise<InferenceSessionHandler>;\n  async createInferenceSessionHandler(\n    pathOrBuffer: string | Uint8Array,\n    options?: InferenceSession.SessionOptions,\n  ): Promise<InferenceSessionHandler> {\n    const handler = new OnnxruntimeWebAssemblySessionHandler();\n    await handler.loadModel(pathOrBuffer, options);\n    return handler;\n  }\n}\n\nexport const wasmBackend = new OnnxruntimeWebAssemblyBackend();\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports */\n\n// We use \"require\" instead of \"import\" here because import statement must be put in top level. Our current code does\n// not allow bundler to tree-shaking code as expected because some codes are treated as having side effects.\n// So we import code inside the if-clause to allow bundler remove the code safely.\n\nexport * from 'onnxruntime-common';\nimport * as ort from 'onnxruntime-common';\nexport default ort;\n\nimport { registerBackend, env } from 'onnxruntime-common';\nimport { version } from './version';\n\nif (!BUILD_DEFS.DISABLE_WEBGL) {\n  const onnxjsBackend = require('./backend-onnxjs').onnxjsBackend;\n  registerBackend('webgl', onnxjsBackend, -10);\n}\n\nif (!BUILD_DEFS.DISABLE_JSEP && !BUILD_DEFS.DISABLE_WEBGPU) {\n  throw new Error(\n    'The current build is specified to enable both JSEP and WebGPU EP. This is not a valid configuration. ' +\n      'JSEP and WebGPU EPs cannot be enabled at the same time.',\n  );\n}\n\nif (!BUILD_DEFS.DISABLE_WEBNN && BUILD_DEFS.DISABLE_JSEP && BUILD_DEFS.DISABLE_WEBGPU) {\n  throw new Error(\n    'The current build is specified to enable WebNN EP without JSEP or WebGPU EP. This is not a valid configuration. ' +\n      'WebNN EP requires either JSEP or WebGPU EP to be enabled.',\n  );\n}\n\nif (!BUILD_DEFS.DISABLE_WASM) {\n  const wasmBackend = require('./backend-wasm').wasmBackend;\n  if (!BUILD_DEFS.DISABLE_JSEP || !BUILD_DEFS.DISABLE_WEBGPU) {\n    registerBackend('webgpu', wasmBackend, 5);\n  }\n  if (!BUILD_DEFS.DISABLE_WEBNN) {\n    registerBackend('webnn', wasmBackend, 5);\n  }\n  registerBackend('cpu', wasmBackend, 10);\n  registerBackend('wasm', wasmBackend, 10);\n}\n\nObject.defineProperty(env.versions, 'web', { value: version, enumerable: true });\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n\n// This file is generated by /js/scripts/update-version.ts\n// Do not modify file content manually.\n\nexport const version = '1.27.0';\n"]}