// Compiles a dart2wasm-generated main module from `source` which can then
// instantiatable via the `instantiate` method.
//
// `source` needs to be a `Response` object (or promise thereof) e.g. created
// via the `fetch()` JS API.
export async function compileStreaming(source) {
  const builtins = {builtins: ['js-string']};
  return new CompiledApp(
      await WebAssembly.compileStreaming(source, builtins), builtins);
}

// Compiles a dart2wasm-generated wasm modules from `bytes` which is then
// instantiatable via the `instantiate` method.
export async function compile(bytes) {
  const builtins = {builtins: ['js-string']};
  return new CompiledApp(await WebAssembly.compile(bytes, builtins), builtins);
}

// DEPRECATED: Please use `compile` or `compileStreaming` to get a compiled app,
// use `instantiate` method to get an instantiated app and then call
// `invokeMain` to invoke the main function.
export async function instantiate(modulePromise, importObjectPromise) {
  var moduleOrCompiledApp = await modulePromise;
  if (!(moduleOrCompiledApp instanceof CompiledApp)) {
    moduleOrCompiledApp = new CompiledApp(moduleOrCompiledApp);
  }
  const instantiatedApp = await moduleOrCompiledApp.instantiate(await importObjectPromise);
  return instantiatedApp.instantiatedModule;
}

// DEPRECATED: Please use `compile` or `compileStreaming` to get a compiled app,
// use `instantiate` method to get an instantiated app and then call
// `invokeMain` to invoke the main function.
export const invoke = (moduleInstance, ...args) => {
  moduleInstance.exports.$invokeMain(args);
}

class CompiledApp {
  constructor(module, builtins) {
    this.module = module;
    this.builtins = builtins;
  }

  // The second argument is an options object containing:
  // `loadDeferredModule` is a JS function that takes a module name matching a
  //   wasm file produced by the dart2wasm compiler and returns the bytes to
  //   load the module. These bytes can be in either a format supported by
  //   `WebAssembly.compile` or `WebAssembly.compileStreaming`.
  // `loadDynamicModule` is a JS function that takes two string names matching,
  //   in order, a wasm file produced by the dart2wasm compiler during dynamic
  //   module compilation and a corresponding js file produced by the same
  //   compilation. It should return a JS Array containing 2 elements. The first
  //   should be the bytes for the wasm module in a format supported by
  //   `WebAssembly.compile` or `WebAssembly.compileStreaming`. The second
  //   should be the result of using the JS 'import' API on the js file path.
  // `loadDeferredId` is a JS function that takes a string corresponding to a load
  //   ID generated by the compiler when 'load-ids' option is passed. Each load
  //   ID maps to one or more WASM modules produced by the compiler. This
  //   function should return an array of byte arrays corresponding to all the
  //   modules specified by that load ID. The arrays should be in a format
  //   supported by `WebAssembly.compile` or `WebAssembly.compileStreaming`.
  async instantiate(additionalImports,
      {loadDeferredModule, loadDynamicModule, loadDeferredId} = {}) {
    let dartInstance;

    // Prints to the console
    function printToConsole(value) {
      if (typeof dartPrint == "function") {
        dartPrint(value);
        return;
      }
      if (typeof console == "object" && typeof console.log != "undefined") {
        console.log(value);
        return;
      }
      if (typeof print == "function") {
        print(value);
        return;
      }

      throw "Unable to print message: " + value;
    }

    // A special symbol attached to functions that wrap Dart functions.
    const jsWrappedDartFunctionSymbol = Symbol("JSWrappedDartFunction");

    function finalizeWrapper(dartFunction, wrapped) {
      wrapped.dartFunction = dartFunction;
      wrapped[jsWrappedDartFunctionSymbol] = true;
      return wrapped;
    }

    // Imports
    const dart2wasm = {
            _1: (decoder, codeUnits) => decoder.decode(codeUnits),
      _2: () => new TextDecoder("utf-8", {fatal: true}),
      _3: () => new TextDecoder("utf-8", {fatal: false}),
      _4: (s) => +s,
      _5: x0 => new Uint8Array(x0),
      _6: (x0,x1,x2) => x0.set(x1,x2),
      _7: (x0,x1) => x0.transferFromImageBitmap(x1),
      _9: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._9(f,arguments.length,x0) }),
      _10: x0 => new window.FinalizationRegistry(x0),
      _11: (x0,x1,x2,x3) => x0.register(x1,x2,x3),
      _12: (x0,x1) => x0.unregister(x1),
      _13: (x0,x1,x2) => x0.slice(x1,x2),
      _14: (x0,x1) => x0.decode(x1),
      _15: (x0,x1) => x0.segment(x1),
      _16: () => new TextDecoder(),
      _18: x0 => x0.buffer,
      _19: x0 => x0.wasmMemory,
      _20: () => globalThis.window._flutter_skwasmInstance,
      _21: x0 => x0.rasterStartMilliseconds,
      _22: x0 => x0.rasterEndMilliseconds,
      _23: x0 => x0.imageBitmaps,
      _139: (x0,x1) => x0.appendChild(x1),
      _170: (x0,x1,x2) => x0.addEventListener(x1,x2),
      _171: (x0,x1,x2) => x0.removeEventListener(x1,x2),
      _172: (x0,x1) => new OffscreenCanvas(x0,x1),
      _173: x0 => x0.remove(),
      _174: (x0,x1) => x0.append(x1),
      _176: x0 => x0.unlock(),
      _177: x0 => x0.getReader(),
      _178: (x0,x1) => x0.item(x1),
      _179: x0 => x0.next(),
      _180: x0 => x0.now(),
      _181: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._181(f,arguments.length,x0) }),
      _182: (x0,x1) => x0.addListener(x1),
      _183: (x0,x1) => x0.removeListener(x1),
      _184: (x0,x1) => x0.matchMedia(x1),
      _185: (x0,x1) => x0.revokeObjectURL(x1),
      _186: x0 => x0.close(),
      _187: (x0,x1,x2,x3,x4) => ({type: x0,data: x1,premultiplyAlpha: x2,colorSpaceConversion: x3,preferAnimation: x4}),
      _188: x0 => new window.ImageDecoder(x0),
      _189: (x0,x1) => ({frameIndex: x0,completeFramesOnly: x1}),
      _190: (x0,x1) => x0.decode(x1),
      _191: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._191(f,arguments.length,x0) }),
      _192: (x0,x1,x2,x3) => x0.addEventListener(x1,x2,x3),
      _194: (x0,x1) => x0.getModifierState(x1),
      _195: x0 => x0.preventDefault(),
      _196: x0 => x0.stopPropagation(),
      _197: (x0,x1) => x0.removeProperty(x1),
      _198: (x0,x1) => x0.prepend(x1),
      _199: x0 => new Intl.Locale(x0),
      _200: (x0,x1) => x0.observe(x1),
      _201: x0 => x0.disconnect(),
      _202: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._202(f,arguments.length,x0) }),
      _203: (x0,x1) => x0.getAttribute(x1),
      _204: (x0,x1) => x0.contains(x1),
      _205: (x0,x1) => x0.querySelector(x1),
      _206: x0 => x0.blur(),
      _207: x0 => x0.hasFocus(),
      _208: (x0,x1) => x0.removeAttribute(x1),
      _209: (x0,x1,x2) => x0.insertBefore(x1,x2),
      _210: (x0,x1) => x0.hasAttribute(x1),
      _211: (x0,x1) => x0.getModifierState(x1),
      _212: (x0,x1) => x0.createTextNode(x1),
      _213: x0 => x0.getBoundingClientRect(),
      _214: (x0,x1) => x0.closest(x1),
      _215: () => new Array(),
      _651: x0 => new Uint8Array(x0),
      _655: () => globalThis.window.flutterConfiguration,
      _657: x0 => x0.assetBase,
      _662: x0 => x0.canvasKitMaximumSurfaces,
      _663: x0 => x0.debugShowSemanticsNodes,
      _664: x0 => x0.hostElement,
      _665: x0 => x0.multiViewEnabled,
      _666: x0 => x0.nonce,
      _668: x0 => x0.fontFallbackBaseUrl,
      _678: x0 => x0.console,
      _679: x0 => x0.devicePixelRatio,
      _680: x0 => x0.document,
      _681: x0 => x0.history,
      _682: x0 => x0.innerHeight,
      _683: x0 => x0.innerWidth,
      _684: x0 => x0.location,
      _685: x0 => x0.navigator,
      _686: x0 => x0.visualViewport,
      _687: x0 => x0.performance,
      _689: x0 => x0.URL,
      _691: (x0,x1) => x0.getComputedStyle(x1),
      _692: x0 => x0.screen,
      _693: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._693(f,arguments.length,x0) }),
      _694: (x0,x1) => x0.requestAnimationFrame(x1),
      _698: (x0,x1) => x0.warn(x1),
      _700: (x0,x1) => x0.debug(x1),
      _701: x0 => globalThis.parseFloat(x0),
      _702: () => globalThis.window,
      _703: () => globalThis.Intl,
      _704: () => globalThis.Symbol,
      _705: (x0,x1,x2,x3,x4) => globalThis.createImageBitmap(x0,x1,x2,x3,x4),
      _707: x0 => x0.clipboard,
      _708: x0 => x0.maxTouchPoints,
      _709: x0 => x0.vendor,
      _710: x0 => x0.language,
      _711: x0 => x0.platform,
      _712: x0 => x0.userAgent,
      _713: (x0,x1) => x0.vibrate(x1),
      _714: x0 => x0.languages,
      _715: x0 => x0.documentElement,
      _716: (x0,x1) => x0.querySelector(x1),
      _717: (x0,x1) => x0.querySelectorAll(x1),
      _719: (x0,x1) => x0.createElement(x1),
      _722: (x0,x1) => x0.createEvent(x1),
      _723: x0 => x0.activeElement,
      _726: x0 => x0.head,
      _727: x0 => x0.body,
      _728: (x0,x1) => { x0.title = x1 },
      _732: x0 => x0.visibilityState,
      _733: () => globalThis.document,
      _734: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._734(f,arguments.length,x0) }),
      _735: (x0,x1) => x0.dispatchEvent(x1),
      _743: x0 => x0.target,
      _745: x0 => x0.timeStamp,
      _746: x0 => x0.type,
      _748: (x0,x1,x2,x3) => x0.initEvent(x1,x2,x3),
      _754: x0 => x0.baseURI,
      _755: x0 => x0.firstChild,
      _759: x0 => x0.parentElement,
      _761: (x0,x1) => { x0.textContent = x1 },
      _762: x0 => x0.parentNode,
      _763: x0 => x0.nextSibling,
      _764: (x0,x1) => x0.removeChild(x1),
      _765: x0 => x0.isConnected,
      _770: x0 => x0.firstElementChild,
      _773: x0 => x0.clientHeight,
      _774: x0 => x0.clientWidth,
      _775: x0 => x0.offsetHeight,
      _776: x0 => x0.offsetWidth,
      _777: x0 => x0.id,
      _778: (x0,x1) => { x0.id = x1 },
      _781: (x0,x1) => { x0.spellcheck = x1 },
      _782: x0 => x0.tagName,
      _783: x0 => x0.style,
      _786: (x0,x1) => x0.querySelectorAll(x1),
      _787: (x0,x1,x2) => x0.setAttribute(x1,x2),
      _788: (x0,x1) => { x0.tabIndex = x1 },
      _789: x0 => x0.tabIndex,
      _790: (x0,x1) => x0.focus(x1),
      _791: x0 => x0.scrollTop,
      _792: (x0,x1) => { x0.scrollTop = x1 },
      _793: x0 => x0.scrollLeft,
      _794: (x0,x1) => { x0.scrollLeft = x1 },
      _795: x0 => x0.classList,
      _797: (x0,x1) => { x0.className = x1 },
      _799: (x0,x1) => x0.getElementsByClassName(x1),
      _800: x0 => x0.click(),
      _801: (x0,x1) => x0.attachShadow(x1),
      _804: x0 => x0.computedStyleMap(),
      _805: (x0,x1) => x0.get(x1),
      _811: (x0,x1) => x0.getPropertyValue(x1),
      _812: (x0,x1,x2,x3) => x0.setProperty(x1,x2,x3),
      _813: x0 => x0.offsetLeft,
      _814: x0 => x0.offsetTop,
      _815: x0 => x0.offsetParent,
      _817: (x0,x1) => { x0.name = x1 },
      _818: x0 => x0.content,
      _819: (x0,x1) => { x0.content = x1 },
      _823: (x0,x1) => { x0.src = x1 },
      _824: x0 => x0.naturalWidth,
      _825: x0 => x0.naturalHeight,
      _829: (x0,x1) => { x0.crossOrigin = x1 },
      _831: (x0,x1) => { x0.decoding = x1 },
      _832: x0 => x0.decode(),
      _837: (x0,x1) => { x0.nonce = x1 },
      _841: (x0,x1) => { x0.width = x1 },
      _844: (x0,x1) => { x0.height = x1 },
      _847: (x0,x1) => x0.getContext(x1),
      _914: x0 => x0.width,
      _915: x0 => x0.height,
      _917: (x0,x1) => x0.fetch(x1),
      _918: x0 => x0.status,
      _920: x0 => x0.body,
      _921: x0 => x0.arrayBuffer(),
      _924: x0 => x0.read(),
      _925: x0 => x0.value,
      _926: x0 => x0.done,
      _933: x0 => x0.name,
      _934: x0 => x0.x,
      _935: x0 => x0.y,
      _938: x0 => x0.top,
      _939: x0 => x0.right,
      _940: x0 => x0.bottom,
      _941: x0 => x0.left,
      _951: x0 => x0.height,
      _952: x0 => x0.width,
      _953: x0 => x0.scale,
      _954: (x0,x1) => { x0.value = x1 },
      _957: (x0,x1) => { x0.placeholder = x1 },
      _959: (x0,x1) => { x0.name = x1 },
      _960: x0 => x0.selectionDirection,
      _961: x0 => x0.selectionStart,
      _962: x0 => x0.selectionEnd,
      _965: x0 => x0.value,
      _967: (x0,x1,x2) => x0.setSelectionRange(x1,x2),
      _968: x0 => x0.readText(),
      _969: (x0,x1) => x0.writeText(x1),
      _971: x0 => x0.altKey,
      _972: x0 => x0.code,
      _973: x0 => x0.ctrlKey,
      _974: x0 => x0.key,
      _975: x0 => x0.keyCode,
      _976: x0 => x0.location,
      _977: x0 => x0.metaKey,
      _978: x0 => x0.repeat,
      _979: x0 => x0.shiftKey,
      _980: x0 => x0.isComposing,
      _982: x0 => x0.state,
      _983: (x0,x1) => x0.go(x1),
      _985: (x0,x1,x2,x3) => x0.pushState(x1,x2,x3),
      _986: (x0,x1,x2,x3) => x0.replaceState(x1,x2,x3),
      _987: x0 => x0.pathname,
      _988: x0 => x0.search,
      _989: x0 => x0.hash,
      _993: x0 => x0.state,
      _996: (x0,x1) => x0.createObjectURL(x1),
      _998: x0 => new Blob(x0),
      _1008: x0 => x0.matches,
      _1009: x0 => x0.matches,
      _1013: x0 => x0.relatedTarget,
      _1015: x0 => x0.clientX,
      _1016: x0 => x0.clientY,
      _1017: x0 => x0.offsetX,
      _1018: x0 => x0.offsetY,
      _1021: x0 => x0.button,
      _1022: x0 => x0.buttons,
      _1023: x0 => x0.ctrlKey,
      _1027: x0 => x0.pointerId,
      _1028: x0 => x0.pointerType,
      _1029: x0 => x0.pressure,
      _1030: x0 => x0.tiltX,
      _1031: x0 => x0.tiltY,
      _1032: x0 => x0.getCoalescedEvents(),
      _1035: x0 => x0.deltaX,
      _1036: x0 => x0.deltaY,
      _1037: x0 => x0.wheelDeltaX,
      _1038: x0 => x0.wheelDeltaY,
      _1039: x0 => x0.deltaMode,
      _1046: x0 => x0.changedTouches,
      _1049: x0 => x0.clientX,
      _1050: x0 => x0.clientY,
      _1053: x0 => x0.data,
      _1056: (x0,x1) => { x0.disabled = x1 },
      _1058: (x0,x1) => { x0.type = x1 },
      _1059: (x0,x1) => { x0.max = x1 },
      _1060: (x0,x1) => { x0.min = x1 },
      _1061: (x0,x1) => { x0.value = x1 },
      _1062: x0 => x0.value,
      _1063: x0 => x0.disabled,
      _1064: (x0,x1) => { x0.disabled = x1 },
      _1066: (x0,x1) => { x0.placeholder = x1 },
      _1068: (x0,x1) => { x0.name = x1 },
      _1069: (x0,x1) => { x0.autocomplete = x1 },
      _1071: x0 => x0.selectionDirection,
      _1072: x0 => x0.selectionStart,
      _1074: x0 => x0.selectionEnd,
      _1077: (x0,x1,x2) => x0.setSelectionRange(x1,x2),
      _1078: (x0,x1) => x0.add(x1),
      _1081: (x0,x1) => { x0.noValidate = x1 },
      _1082: (x0,x1) => { x0.method = x1 },
      _1083: (x0,x1) => { x0.action = x1 },
      _1108: x0 => x0.orientation,
      _1109: x0 => x0.width,
      _1110: x0 => x0.height,
      _1111: (x0,x1) => x0.lock(x1),
      _1130: x0 => new ResizeObserver(x0),
      _1133: (module,f) => finalizeWrapper(f, function(x0,x1) { return module.exports._1133(f,arguments.length,x0,x1) }),
      _1141: x0 => x0.length,
      _1142: x0 => x0.iterator,
      _1143: x0 => x0.Segmenter,
      _1144: x0 => x0.v8BreakIterator,
      _1145: (x0,x1) => new Intl.Segmenter(x0,x1),
      _1148: x0 => x0.language,
      _1149: x0 => x0.script,
      _1150: x0 => x0.region,
      _1168: x0 => x0.done,
      _1169: x0 => x0.value,
      _1170: x0 => x0.index,
      _1174: (x0,x1) => new Intl.v8BreakIterator(x0,x1),
      _1175: (x0,x1) => x0.adoptText(x1),
      _1176: x0 => x0.first(),
      _1177: x0 => x0.next(),
      _1178: x0 => x0.current(),
      _1191: x0 => x0.hostElement,
      _1192: x0 => x0.viewConstraints,
      _1195: x0 => x0.maxHeight,
      _1196: x0 => x0.maxWidth,
      _1197: x0 => x0.minHeight,
      _1198: x0 => x0.minWidth,
      _1199: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1199(f,arguments.length,x0) }),
      _1200: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1200(f,arguments.length,x0) }),
      _1201: (x0,x1) => ({addView: x0,removeView: x1}),
      _1204: x0 => x0.loader,
      _1205: () => globalThis._flutter,
      _1206: (x0,x1) => x0.didCreateEngineInitializer(x1),
      _1207: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1207(f,arguments.length,x0) }),
      _1208: (module,f) => finalizeWrapper(f, function() { return module.exports._1208(f,arguments.length) }),
      _1209: (x0,x1) => ({initializeEngine: x0,autoStart: x1}),
      _1212: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1212(f,arguments.length,x0) }),
      _1213: x0 => ({runApp: x0}),
      _1215: (x0,x1,x2) => x0.call(x1,x2),
      _1216: (module,f) => finalizeWrapper(f, function(x0,x1) { return module.exports._1216(f,arguments.length,x0,x1) }),
      _1217: x0 => new Promise(x0),
      _1218: x0 => x0.length,
      _1219: () => globalThis.window.ImageDecoder,
      _1220: x0 => x0.tracks,
      _1222: x0 => x0.completed,
      _1224: x0 => x0.image,
      _1230: x0 => x0.displayWidth,
      _1231: x0 => x0.displayHeight,
      _1232: x0 => x0.duration,
      _1235: x0 => x0.ready,
      _1236: x0 => x0.selectedTrack,
      _1237: x0 => x0.repetitionCount,
      _1238: x0 => x0.frameCount,
      _1281: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1281(f,arguments.length,x0) }),
      _1282: (x0,x1,x2) => x0.addEventListener(x1,x2),
      _1283: (x0,x1,x2) => x0.postMessage(x1,x2),
      _1284: (x0,x1,x2) => x0.removeEventListener(x1,x2),
      _1285: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1285(f,arguments.length,x0) }),
      _1286: () => globalThis.initializeGA(),
      _1288: (x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29,x30,x31,x32,x33) => ({screen: x0,event_category: x1,event_label: x2,send_to: x3,value: x4,non_interaction: x5,user_app: x6,user_build: x7,user_platform: x8,devtools_platform: x9,devtools_chrome: x10,devtools_version: x11,ide_launched: x12,flutter_client_id: x13,is_external_build: x14,is_embedded: x15,g3_username: x16,ide_launched_feature: x17,is_wasm: x18,ui_duration_micros: x19,raster_duration_micros: x20,shader_compilation_duration_micros: x21,cpu_sample_count: x22,cpu_stack_depth: x23,trace_event_count: x24,heap_diff_objects_before: x25,heap_diff_objects_after: x26,heap_objects_total: x27,root_set_count: x28,row_count: x29,inspector_tree_controller_id: x30,android_app_id: x31,ios_bundle_id: x32,is_v2_inspector: x33}),
      _1289: x0 => x0.screen,
      _1290: x0 => x0.user_app,
      _1291: x0 => x0.user_build,
      _1292: x0 => x0.user_platform,
      _1293: x0 => x0.devtools_platform,
      _1294: x0 => x0.devtools_chrome,
      _1295: x0 => x0.devtools_version,
      _1296: x0 => x0.ide_launched,
      _1298: x0 => x0.is_external_build,
      _1299: x0 => x0.is_embedded,
      _1300: x0 => x0.g3_username,
      _1301: x0 => x0.ide_launched_feature,
      _1302: x0 => x0.is_wasm,
      _1303: x0 => x0.ui_duration_micros,
      _1304: x0 => x0.raster_duration_micros,
      _1305: x0 => x0.shader_compilation_duration_micros,
      _1306: x0 => x0.cpu_sample_count,
      _1307: x0 => x0.cpu_stack_depth,
      _1308: x0 => x0.trace_event_count,
      _1309: x0 => x0.heap_diff_objects_before,
      _1310: x0 => x0.heap_diff_objects_after,
      _1311: x0 => x0.heap_objects_total,
      _1312: x0 => x0.root_set_count,
      _1313: x0 => x0.row_count,
      _1314: x0 => x0.inspector_tree_controller_id,
      _1315: x0 => x0.android_app_id,
      _1316: x0 => x0.ios_bundle_id,
      _1317: x0 => x0.is_v2_inspector,
      _1319: (x0,x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23,x24,x25,x26,x27,x28,x29) => ({description: x0,fatal: x1,user_app: x2,user_build: x3,user_platform: x4,devtools_platform: x5,devtools_chrome: x6,devtools_version: x7,ide_launched: x8,flutter_client_id: x9,is_external_build: x10,is_embedded: x11,g3_username: x12,ide_launched_feature: x13,is_wasm: x14,ui_duration_micros: x15,raster_duration_micros: x16,shader_compilation_duration_micros: x17,cpu_sample_count: x18,cpu_stack_depth: x19,trace_event_count: x20,heap_diff_objects_before: x21,heap_diff_objects_after: x22,heap_objects_total: x23,root_set_count: x24,row_count: x25,inspector_tree_controller_id: x26,android_app_id: x27,ios_bundle_id: x28,is_v2_inspector: x29}),
      _1320: x0 => x0.user_app,
      _1321: x0 => x0.user_build,
      _1322: x0 => x0.user_platform,
      _1323: x0 => x0.devtools_platform,
      _1324: x0 => x0.devtools_chrome,
      _1325: x0 => x0.devtools_version,
      _1326: x0 => x0.ide_launched,
      _1328: x0 => x0.is_external_build,
      _1329: x0 => x0.is_embedded,
      _1330: x0 => x0.g3_username,
      _1331: x0 => x0.ide_launched_feature,
      _1332: x0 => x0.is_wasm,
      _1348: () => globalThis.getDevToolsPropertyID(),
      _1349: () => globalThis.hookupListenerForGA(),
      _1350: (x0,x1,x2) => globalThis.gtag(x0,x1,x2),
      _1352: x0 => x0.event_category,
      _1353: x0 => x0.event_label,
      _1355: x0 => x0.value,
      _1356: x0 => x0.non_interaction,
      _1359: x0 => x0.description,
      _1360: x0 => x0.fatal,
      _1361: (x0,x1) => x0.getItem(x1),
      _1362: (x0,x1,x2) => x0.setItem(x1,x2),
      _1363: (x0,x1) => x0.querySelectorAll(x1),
      _1364: (x0,x1) => x0.removeChild(x1),
      _1365: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1365(f,arguments.length,x0) }),
      _1366: (x0,x1) => x0.forEach(x1),
      _1367: x0 => x0.preventDefault(),
      _1368: (x0,x1) => x0.execCommand(x1),
      _1369: (x0,x1) => x0.item(x1),
      _1370: () => new FileReader(),
      _1371: (x0,x1) => x0.readAsText(x1),
      _1372: (x0,x1) => x0.createElement(x1),
      _1373: x0 => new Blob(x0),
      _1374: x0 => globalThis.URL.createObjectURL(x0),
      _1375: (x0,x1,x2) => x0.setAttribute(x1,x2),
      _1376: (x0,x1) => x0.append(x1),
      _1377: x0 => x0.click(),
      _1378: x0 => x0.remove(),
      _1379: x0 => x0.createRange(),
      _1380: (x0,x1) => x0.selectNode(x1),
      _1381: x0 => x0.getSelection(),
      _1382: x0 => x0.removeAllRanges(),
      _1383: (x0,x1) => x0.addRange(x1),
      _1384: (x0,x1) => x0.createElement(x1),
      _1385: (x0,x1) => x0.append(x1),
      _1386: (x0,x1,x2) => x0.insertRule(x1,x2),
      _1387: (x0,x1) => x0.add(x1),
      _1388: x0 => x0.preventDefault(),
      _1389: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1389(f,arguments.length,x0) }),
      _1390: (x0,x1,x2) => x0.addEventListener(x1,x2),
      _1391: () => globalThis.window.navigator.userAgent,
      _1392: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1392(f,arguments.length,x0) }),
      _1393: (x0,x1,x2,x3) => x0.addEventListener(x1,x2,x3),
      _1394: (x0,x1,x2,x3) => x0.removeEventListener(x1,x2,x3),
      _1399: (x0,x1) => x0.closest(x1),
      _1400: (x0,x1,x2,x3) => x0.open(x1,x2,x3),
      _1401: x0 => x0.decode(),
      _1402: (x0,x1,x2,x3) => x0.open(x1,x2,x3),
      _1403: (x0,x1,x2) => x0.setRequestHeader(x1,x2),
      _1404: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1404(f,arguments.length,x0) }),
      _1405: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1405(f,arguments.length,x0) }),
      _1406: x0 => x0.send(),
      _1407: () => new XMLHttpRequest(),
      _1408: (x0,x1) => x0.querySelector(x1),
      _1409: (x0,x1) => x0.appendChild(x1),
      _1410: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1410(f,arguments.length,x0) }),
      _1411: Date.now,
      _1413: s => new Date(s * 1000).getTimezoneOffset() * 60,
      _1414: s => {
        if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s*$/.test(s)) {
          return NaN;
        }
        return parseFloat(s);
      },
      _1415: () => new Error().stack,
      _1416: () => typeof dartUseDateNowForTicks !== "undefined",
      _1417: () => 1000 * performance.now(),
      _1418: () => Date.now(),
      _1419: () => {
        // On browsers return `globalThis.location.href`
        if (globalThis.location != null) {
          return globalThis.location.href;
        }
        return null;
      },
      _1420: () => {
        return typeof process != "undefined" &&
               Object.prototype.toString.call(process) == "[object process]" &&
               process.platform == "win32"
      },
      _1421: () => new WeakMap(),
      _1422: (map, o) => map.get(o),
      _1423: (map, o, v) => map.set(o, v),
      _1424: (exn) => exn.toString(),
      _1425: (exn) => exn.stack,
      _1426: (exn) => {
        let stackString = exn.toString();
        let frames = stackString.split('\n');
        let drop = 2;
        if (frames[0] === 'Error') {
            drop += 1;
        }
        return frames.slice(drop).join('\n');
      },
      _1427: x0 => new WeakRef(x0),
      _1428: x0 => x0.deref(),
      _1435: () => globalThis.WeakRef,
      _1439: s => JSON.stringify(s),
      _1440: s => printToConsole(s),
      _1441: (o, p, r) => o.replaceAll(p, () => r),
      _1442: (o, p, r) => o.replace(p, () => r),
      _1443: Function.prototype.call.bind(String.prototype.toLowerCase),
      _1444: s => s.toUpperCase(),
      _1445: s => s.trim(),
      _1446: s => s.trimLeft(),
      _1447: s => s.trimRight(),
      _1448: (string, times) => string.repeat(times),
      _1449: Function.prototype.call.bind(String.prototype.indexOf),
      _1450: (s, p, i) => s.lastIndexOf(p, i),
      _1451: (string, token) => string.split(token),
      _1452: Object.is,
      _1455: (o, t) => typeof o === t,
      _1456: (o, c) => o instanceof c,
      _1457: o => Object.keys(o),
      _1487: x0 => new Array(x0),
      _1489: x0 => x0.length,
      _1491: (x0,x1) => x0[x1],
      _1492: (x0,x1,x2) => { x0[x1] = x2 },
      _1495: (x0,x1,x2) => new DataView(x0,x1,x2),
      _1497: x0 => new Int8Array(x0),
      _1498: (x0,x1,x2) => new Uint8Array(x0,x1,x2),
      _1500: x0 => new Uint8ClampedArray(x0),
      _1502: x0 => new Int16Array(x0),
      _1504: x0 => new Uint16Array(x0),
      _1506: x0 => new Int32Array(x0),
      _1508: x0 => new Uint32Array(x0),
      _1510: x0 => new Float32Array(x0),
      _1512: x0 => new Float64Array(x0),
      _1536: x0 => x0.random(),
      _1539: () => globalThis.Math,
      _1552: (ms, c) =>
      setTimeout(() => dartInstance.exports.$invokeCallback(c),ms),
      _1553: (handle) => clearTimeout(handle),
      _1554: (ms, c) =>
      setInterval(() => dartInstance.exports.$invokeCallback(c), ms),
      _1555: (handle) => clearInterval(handle),
      _1556: (c) =>
      queueMicrotask(() => dartInstance.exports.$invokeCallback(c)),
      _1557: () => Date.now(),
      _1558: (s, m) => {
        try {
          return new RegExp(s, m);
        } catch (e) {
          return String(e);
        }
      },
      _1559: (x0,x1) => x0.exec(x1),
      _1560: (x0,x1) => x0.test(x1),
      _1561: x0 => x0.pop(),
      _1563: o => o === undefined,
      _1565: o => typeof o === 'function' && o[jsWrappedDartFunctionSymbol] === true,
      _1567: o => {
        const proto = Object.getPrototypeOf(o);
        return proto === Object.prototype || proto === null;
      },
      _1568: o => o instanceof RegExp,
      _1569: (l, r) => l === r,
      _1570: o => o,
      _1571: o => o,
      _1572: o => o,
      _1573: b => !!b,
      _1574: o => o.length,
      _1576: (o, i) => o[i],
      _1577: f => f.dartFunction,
      _1578: () => ({}),
      _1579: () => [],
      _1581: () => globalThis,
      _1582: (constructor, args) => {
        const factoryFunction = constructor.bind.apply(
            constructor, [null, ...args]);
        return new factoryFunction();
      },
      _1583: (o, p) => p in o,
      _1584: (o, p) => o[p],
      _1585: (o, p, v) => o[p] = v,
      _1586: (o, m, a) => o[m].apply(o, a),
      _1588: o => String(o),
      _1589: (p, s, f) => p.then(s, (e) => f(e, e === undefined)),
      _1590: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1590(f,arguments.length,x0) }),
      _1591: (module,f) => finalizeWrapper(f, function(x0,x1) { return module.exports._1591(f,arguments.length,x0,x1) }),
      _1592: o => {
        if (o === undefined) return 1;
        var type = typeof o;
        if (type === 'boolean') return 2;
        if (type === 'number') return 3;
        if (type === 'string') return 4;
        if (o instanceof Array) return 5;
        if (ArrayBuffer.isView(o)) {
          if (o instanceof Int8Array) return 6;
          if (o instanceof Uint8Array) return 7;
          if (o instanceof Uint8ClampedArray) return 8;
          if (o instanceof Int16Array) return 9;
          if (o instanceof Uint16Array) return 10;
          if (o instanceof Int32Array) return 11;
          if (o instanceof Uint32Array) return 12;
          if (o instanceof Float32Array) return 13;
          if (o instanceof Float64Array) return 14;
          if (o instanceof DataView) return 15;
        }
        if (o instanceof ArrayBuffer) return 16;
        // Feature check for `SharedArrayBuffer` before doing a type-check.
        if (globalThis.SharedArrayBuffer !== undefined &&
            o instanceof SharedArrayBuffer) {
            return 17;
        }
        if (o instanceof Promise) return 18;
        return 19;
      },
      _1593: o => [o],
      _1594: (o0, o1) => [o0, o1],
      _1595: (o0, o1, o2) => [o0, o1, o2],
      _1596: (o0, o1, o2, o3) => [o0, o1, o2, o3],
      _1597: (jsArray, jsArrayOffset, wasmArray, wasmArrayOffset, length) => {
        const getValue = dartInstance.exports.$wasmI8ArrayGet;
        for (let i = 0; i < length; i++) {
          jsArray[jsArrayOffset + i] = getValue(wasmArray, wasmArrayOffset + i);
        }
      },
      _1598: (jsArray, jsArrayOffset, wasmArray, wasmArrayOffset, length) => {
        const setValue = dartInstance.exports.$wasmI8ArraySet;
        for (let i = 0; i < length; i++) {
          setValue(wasmArray, wasmArrayOffset + i, jsArray[jsArrayOffset + i]);
        }
      },
      _1599: (jsArray, jsArrayOffset, wasmArray, wasmArrayOffset, length) => {
        const getValue = dartInstance.exports.$wasmI16ArrayGet;
        for (let i = 0; i < length; i++) {
          jsArray[jsArrayOffset + i] = getValue(wasmArray, wasmArrayOffset + i);
        }
      },
      _1600: (jsArray, jsArrayOffset, wasmArray, wasmArrayOffset, length) => {
        const setValue = dartInstance.exports.$wasmI16ArraySet;
        for (let i = 0; i < length; i++) {
          setValue(wasmArray, wasmArrayOffset + i, jsArray[jsArrayOffset + i]);
        }
      },
      _1601: (jsArray, jsArrayOffset, wasmArray, wasmArrayOffset, length) => {
        const getValue = dartInstance.exports.$wasmI32ArrayGet;
        for (let i = 0; i < length; i++) {
          jsArray[jsArrayOffset + i] = getValue(wasmArray, wasmArrayOffset + i);
        }
      },
      _1602: (jsArray, jsArrayOffset, wasmArray, wasmArrayOffset, length) => {
        const setValue = dartInstance.exports.$wasmI32ArraySet;
        for (let i = 0; i < length; i++) {
          setValue(wasmArray, wasmArrayOffset + i, jsArray[jsArrayOffset + i]);
        }
      },
      _1603: (jsArray, jsArrayOffset, wasmArray, wasmArrayOffset, length) => {
        const getValue = dartInstance.exports.$wasmF32ArrayGet;
        for (let i = 0; i < length; i++) {
          jsArray[jsArrayOffset + i] = getValue(wasmArray, wasmArrayOffset + i);
        }
      },
      _1604: (jsArray, jsArrayOffset, wasmArray, wasmArrayOffset, length) => {
        const setValue = dartInstance.exports.$wasmF32ArraySet;
        for (let i = 0; i < length; i++) {
          setValue(wasmArray, wasmArrayOffset + i, jsArray[jsArrayOffset + i]);
        }
      },
      _1605: (jsArray, jsArrayOffset, wasmArray, wasmArrayOffset, length) => {
        const getValue = dartInstance.exports.$wasmF64ArrayGet;
        for (let i = 0; i < length; i++) {
          jsArray[jsArrayOffset + i] = getValue(wasmArray, wasmArrayOffset + i);
        }
      },
      _1606: (jsArray, jsArrayOffset, wasmArray, wasmArrayOffset, length) => {
        const setValue = dartInstance.exports.$wasmF64ArraySet;
        for (let i = 0; i < length; i++) {
          setValue(wasmArray, wasmArrayOffset + i, jsArray[jsArrayOffset + i]);
        }
      },
      _1607: x0 => new ArrayBuffer(x0),
      _1608: s => {
        if (/[[\]{}()*+?.\\^$|]/.test(s)) {
            s = s.replace(/[[\]{}()*+?.\\^$|]/g, '\\$&');
        }
        return s;
      },
      _1609: x0 => x0.input,
      _1610: x0 => x0.index,
      _1611: x0 => x0.groups,
      _1612: x0 => x0.flags,
      _1613: x0 => x0.multiline,
      _1614: x0 => x0.ignoreCase,
      _1615: x0 => x0.unicode,
      _1616: x0 => x0.dotAll,
      _1617: (x0,x1) => { x0.lastIndex = x1 },
      _1618: (o, p) => p in o,
      _1619: (o, p) => o[p],
      _1622: () => new XMLHttpRequest(),
      _1623: (x0,x1,x2,x3) => x0.open(x1,x2,x3),
      _1627: x0 => x0.send(),
      _1629: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1629(f,arguments.length,x0) }),
      _1630: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1630(f,arguments.length,x0) }),
      _1635: (x0,x1) => new WebSocket(x0,x1),
      _1636: (x0,x1) => x0.send(x1),
      _1637: (x0,x1,x2) => x0.close(x1,x2),
      _1639: x0 => x0.close(),
      _1643: (x0,x1) => x0.readAsArrayBuffer(x1),
      _1645: x0 => ({body: x0}),
      _1646: (x0,x1) => new Notification(x0,x1),
      _1647: () => globalThis.Notification.requestPermission(),
      _1648: x0 => x0.close(),
      _1649: () => new AbortController(),
      _1650: x0 => x0.abort(),
      _1651: (x0,x1,x2,x3,x4,x5) => ({method: x0,headers: x1,body: x2,credentials: x3,redirect: x4,signal: x5}),
      _1652: (x0,x1) => globalThis.fetch(x0,x1),
      _1653: (x0,x1) => x0.get(x1),
      _1654: (module,f) => finalizeWrapper(f, function(x0,x1,x2) { return module.exports._1654(f,arguments.length,x0,x1,x2) }),
      _1655: (x0,x1) => x0.forEach(x1),
      _1656: x0 => x0.getReader(),
      _1657: x0 => x0.cancel(),
      _1658: x0 => x0.read(),
      _1659: x0 => ({withCredentials: x0}),
      _1660: (x0,x1) => new EventSource(x0,x1),
      _1661: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1661(f,arguments.length,x0) }),
      _1662: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1662(f,arguments.length,x0) }),
      _1663: x0 => x0.close(),
      _1664: (x0,x1,x2) => ({method: x0,body: x1,credentials: x2}),
      _1665: (x0,x1,x2) => x0.fetch(x1,x2),
      _1666: (x0,x1) => x0.groupCollapsed(x1),
      _1667: (x0,x1) => x0.log(x1),
      _1668: x0 => x0.groupEnd(),
      _1669: (x0,x1) => x0.warn(x1),
      _1670: (x0,x1) => x0.error(x1),
      _1671: x0 => x0.measureUserAgentSpecificMemory(),
      _1672: x0 => x0.bytes,
      _1682: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1682(f,arguments.length,x0) }),
      _1683: (module,f) => finalizeWrapper(f, function(x0) { return module.exports._1683(f,arguments.length,x0) }),
      _1684: x0 => x0.blur(),
      _1685: (x0,x1) => x0.replace(x1),
      _1686: x0 => x0.reload(),
      _1687: (x0,x1,x2,x3) => x0.replaceState(x1,x2,x3),
      _1688: o => o instanceof Array,
      _1689: (a, i) => a.push(i),
      _1690: (a, i) => a.splice(i, 1)[0],
      _1692: (a, l) => a.length = l,
      _1693: a => a.pop(),
      _1694: (a, i) => a.splice(i, 1),
      _1695: (a, s) => a.join(s),
      _1696: (a, s, e) => a.slice(s, e),
      _1698: (a, b) => a == b ? 0 : (a > b ? 1 : -1),
      _1699: a => a.length,
      _1700: (a, l) => a.length = l,
      _1701: (a, i) => a[i],
      _1702: (a, i, v) => a[i] = v,
      _1704: o => {
        if (o instanceof ArrayBuffer) return 0;
        if (globalThis.SharedArrayBuffer !== undefined &&
            o instanceof SharedArrayBuffer) {
          return 1;
        }
        return 2;
      },
      _1705: (o, offsetInBytes, lengthInBytes) => {
        var dst = new ArrayBuffer(lengthInBytes);
        new Uint8Array(dst).set(new Uint8Array(o, offsetInBytes, lengthInBytes));
        return new DataView(dst);
      },
      _1707: o => o instanceof Uint8Array,
      _1708: (o, start, length) => new Uint8Array(o.buffer, o.byteOffset + start, length),
      _1709: o => o instanceof Int8Array,
      _1710: (o, start, length) => new Int8Array(o.buffer, o.byteOffset + start, length),
      _1711: o => o instanceof Uint8ClampedArray,
      _1712: (o, start, length) => new Uint8ClampedArray(o.buffer, o.byteOffset + start, length),
      _1713: o => o instanceof Uint16Array,
      _1714: (o, start, length) => new Uint16Array(o.buffer, o.byteOffset + start, length),
      _1715: o => o instanceof Int16Array,
      _1716: (o, start, length) => new Int16Array(o.buffer, o.byteOffset + start, length),
      _1717: o => o instanceof Uint32Array,
      _1718: (o, start, length) => new Uint32Array(o.buffer, o.byteOffset + start, length),
      _1719: o => o instanceof Int32Array,
      _1720: (o, start, length) => new Int32Array(o.buffer, o.byteOffset + start, length),
      _1721: (o, start, length) => new BigUint64Array(o.buffer, o.byteOffset + start, length),
      _1722: (o, start, length) => new BigInt64Array(o.buffer, o.byteOffset + start, length),
      _1723: o => o instanceof Float32Array,
      _1724: (o, start, length) => new Float32Array(o.buffer, o.byteOffset + start, length),
      _1725: o => o instanceof Float64Array,
      _1726: (o, start, length) => new Float64Array(o.buffer, o.byteOffset + start, length),
      _1727: (t, s) => t.set(s),
      _1729: (o) => new DataView(o.buffer, o.byteOffset, o.byteLength),
      _1730: o => o.byteLength,
      _1731: o => o.buffer,
      _1732: o => o.byteOffset,
      _1733: Function.prototype.call.bind(Object.getOwnPropertyDescriptor(DataView.prototype, 'byteLength').get),
      _1734: (b, o) => new DataView(b, o),
      _1735: (b, o, l) => new DataView(b, o, l),
      _1736: Function.prototype.call.bind(DataView.prototype.getUint8),
      _1737: Function.prototype.call.bind(DataView.prototype.setUint8),
      _1738: Function.prototype.call.bind(DataView.prototype.getInt8),
      _1739: Function.prototype.call.bind(DataView.prototype.setInt8),
      _1740: Function.prototype.call.bind(DataView.prototype.getUint16),
      _1741: Function.prototype.call.bind(DataView.prototype.setUint16),
      _1742: Function.prototype.call.bind(DataView.prototype.getInt16),
      _1743: Function.prototype.call.bind(DataView.prototype.setInt16),
      _1744: Function.prototype.call.bind(DataView.prototype.getUint32),
      _1745: Function.prototype.call.bind(DataView.prototype.setUint32),
      _1746: Function.prototype.call.bind(DataView.prototype.getInt32),
      _1747: Function.prototype.call.bind(DataView.prototype.setInt32),
      _1748: Function.prototype.call.bind(DataView.prototype.getBigUint64),
      _1749: Function.prototype.call.bind(DataView.prototype.setBigUint64),
      _1750: Function.prototype.call.bind(DataView.prototype.getBigInt64),
      _1751: Function.prototype.call.bind(DataView.prototype.setBigInt64),
      _1752: Function.prototype.call.bind(DataView.prototype.getFloat32),
      _1753: Function.prototype.call.bind(DataView.prototype.setFloat32),
      _1754: Function.prototype.call.bind(DataView.prototype.getFloat64),
      _1755: Function.prototype.call.bind(DataView.prototype.setFloat64),
      _1756: Function.prototype.call.bind(Number.prototype.toString),
      _1757: Function.prototype.call.bind(BigInt.prototype.toString),
      _1758: Function.prototype.call.bind(Number.prototype.toString),
      _1759: (d, digits) => d.toFixed(digits),
      _1762: (d, precision) => d.toPrecision(precision),
      _1772: () => globalThis.document,
      _1773: () => globalThis.window,
      _1778: (x0,x1) => { x0.height = x1 },
      _1780: (x0,x1) => { x0.width = x1 },
      _1782: (x0,x1) => { x0.pointerEvents = x1 },
      _1785: x0 => x0.head,
      _1786: x0 => x0.classList,
      _1790: (x0,x1) => { x0.innerText = x1 },
      _1791: x0 => x0.style,
      _1793: x0 => x0.sheet,
      _1794: x0 => x0.src,
      _1795: (x0,x1) => { x0.src = x1 },
      _1796: x0 => x0.naturalWidth,
      _1797: x0 => x0.naturalHeight,
      _1804: x0 => x0.offsetX,
      _1805: x0 => x0.offsetY,
      _1806: x0 => x0.button,
      _1813: x0 => x0.status,
      _1814: (x0,x1) => { x0.responseType = x1 },
      _1816: x0 => x0.response,
      _1865: (x0,x1) => { x0.responseType = x1 },
      _1866: x0 => x0.response,
      _1941: x0 => x0.style,
      _2418: (x0,x1) => { x0.src = x1 },
      _2425: (x0,x1) => { x0.allow = x1 },
      _2437: x0 => x0.contentWindow,
      _2870: (x0,x1) => { x0.accept = x1 },
      _2884: x0 => x0.files,
      _2910: (x0,x1) => { x0.multiple = x1 },
      _2928: (x0,x1) => { x0.type = x1 },
      _3626: (x0,x1) => { x0.dropEffect = x1 },
      _3631: x0 => x0.files,
      _3643: x0 => x0.dataTransfer,
      _3647: () => globalThis.window,
      _3689: x0 => x0.location,
      _3690: x0 => x0.history,
      _3706: x0 => x0.parent,
      _3708: x0 => x0.navigator,
      _3963: x0 => x0.isSecureContext,
      _3964: x0 => x0.crossOriginIsolated,
      _3967: x0 => x0.performance,
      _3972: x0 => x0.localStorage,
      _3980: x0 => x0.origin,
      _3989: x0 => x0.pathname,
      _4003: x0 => x0.state,
      _4028: x0 => x0.message,
      _4090: x0 => x0.appVersion,
      _4091: x0 => x0.platform,
      _4094: x0 => x0.userAgent,
      _4095: x0 => x0.vendor,
      _4145: x0 => x0.data,
      _4146: x0 => x0.origin,
      _4518: x0 => x0.readyState,
      _4527: x0 => x0.protocol,
      _4531: (x0,x1) => { x0.binaryType = x1 },
      _4534: x0 => x0.code,
      _4535: x0 => x0.reason,
      _6202: x0 => x0.type,
      _6243: x0 => x0.signal,
      _6301: x0 => x0.parentNode,
      _6315: () => globalThis.document,
      _6397: x0 => x0.body,
      _6440: x0 => x0.activeElement,
      _7074: x0 => x0.offsetX,
      _7075: x0 => x0.offsetY,
      _7160: x0 => x0.key,
      _7161: x0 => x0.code,
      _7162: x0 => x0.location,
      _7163: x0 => x0.ctrlKey,
      _7164: x0 => x0.shiftKey,
      _7165: x0 => x0.altKey,
      _7166: x0 => x0.metaKey,
      _7167: x0 => x0.repeat,
      _7168: x0 => x0.isComposing,
      _7170: x0 => x0.keyCode,
      _8074: x0 => x0.value,
      _8076: x0 => x0.done,
      _8256: x0 => x0.size,
      _8257: x0 => x0.type,
      _8264: x0 => x0.name,
      _8265: x0 => x0.lastModified,
      _8270: x0 => x0.length,
      _8276: x0 => x0.result,
      _8771: x0 => x0.url,
      _8773: x0 => x0.status,
      _8775: x0 => x0.statusText,
      _8776: x0 => x0.headers,
      _8777: x0 => x0.body,
      _10859: (x0,x1) => { x0.backgroundColor = x1 },
      _10905: (x0,x1) => { x0.border = x1 },
      _11183: (x0,x1) => { x0.display = x1 },
      _11347: (x0,x1) => { x0.height = x1 },
      _12037: (x0,x1) => { x0.width = x1 },
      _12405: x0 => x0.name,
      _13124: () => globalThis.console,

    };

    const baseImports = {
      dart2wasm: dart2wasm,
      Math: Math,
      Date: Date,
      Object: Object,
      Array: Array,
      Reflect: Reflect,
      WebAssembly: {
        JSTag: WebAssembly.JSTag,
      },
      "": new Proxy({}, { get(_, prop) { return prop; } }),

    };

    const jsStringPolyfill = {
      "charCodeAt": (s, i) => s.charCodeAt(i),
      "compare": (s1, s2) => {
        if (s1 < s2) return -1;
        if (s1 > s2) return 1;
        return 0;
      },
      "concat": (s1, s2) => s1 + s2,
      "equals": (s1, s2) => s1 === s2,
      "fromCharCode": (i) => String.fromCharCode(i),
      "length": (s) => s.length,
      "substring": (s, a, b) => s.substring(a, b),
      "fromCharCodeArray": (a, start, end) => {
        if (end <= start) return '';

        const read = dartInstance.exports.$wasmI16ArrayGet;
        let result = '';
        let index = start;
        const chunkLength = Math.min(end - index, 500);
        let array = new Array(chunkLength);
        while (index < end) {
          const newChunkLength = Math.min(end - index, 500);
          for (let i = 0; i < newChunkLength; i++) {
            array[i] = read(a, index++);
          }
          if (newChunkLength < chunkLength) {
            array = array.slice(0, newChunkLength);
          }
          result += String.fromCharCode(...array);
        }
        return result;
      },
      "intoCharCodeArray": (s, a, start) => {
        if (s === '') return 0;

        const write = dartInstance.exports.$wasmI16ArraySet;
        for (var i = 0; i < s.length; ++i) {
          write(a, start++, s.charCodeAt(i));
        }
        return s.length;
      },
      "test": (s) => typeof s == "string",
    };


    

    dartInstance = await WebAssembly.instantiate(this.module, {
      ...baseImports,
      ...additionalImports,
      
      "wasm:js-string": jsStringPolyfill,
    });
    dartInstance.exports.$setThisModule(dartInstance);

    return new InstantiatedApp(this, dartInstance);
  }
}

class InstantiatedApp {
  constructor(compiledApp, instantiatedModule) {
    this.compiledApp = compiledApp;
    this.instantiatedModule = instantiatedModule;
  }

  // Call the main function with the given arguments.
  invokeMain(...args) {
    this.instantiatedModule.exports.$invokeMain(args);
  }
}
