/* eslint-disable */
/* @ts-self-types="./xcu_wasm_sdk.d.ts" */

/**
 * X-RAY Pulsar Matrix (Neuromorphic Frameless Codec)
 * Meniadakan H.264/VP8. Hanya menghitung piksel yang bergerak di level Kuantum.
 */
export class PulsarCodec {
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        PulsarCodecFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_pulsarcodec_free(ptr, 0);
    }
    /**
     * Melakukan eksekusi Dekode "X-Ray Vision" di sisi penerima (JUMPA.ID)
     * Mewarnai hitam latar belakang, dan melukis piksel hijau pada pergerakan.
     * @param {Uint8Array} payload
     * @param {Uint8Array} canvas_buffer
     */
    decode_xray(payload, canvas_buffer) {
        const ptr0 = passArray8ToWasm0(payload, wasm.__wbindgen_export);
        const len0 = WASM_VECTOR_LEN;
        var ptr1 = passArray8ToWasm0(canvas_buffer, wasm.__wbindgen_export);
        var len1 = WASM_VECTOR_LEN;
        wasm.pulsarcodec_decode_xray(this.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(canvas_buffer));
    }
    /**
     * Melakukan eksekusi "X-Ray Movement Delta" (Pulsar Compression)
     * Menerima RGBA mentah, mengembalikan Byte Array murni yang siap disuntikkan ke Trinity Pipe.
     * @param {Uint8Array} current_frame
     * @returns {Uint8Array}
     */
    encode_delta(current_frame) {
        try {
            const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
            const ptr0 = passArray8ToWasm0(current_frame, wasm.__wbindgen_export);
            const len0 = WASM_VECTOR_LEN;
            wasm.pulsarcodec_encode_delta(retptr, this.__wbg_ptr, ptr0, len0);
            var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
            var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
            var v2 = getArrayU8FromWasm0(r0, r1).slice();
            wasm.__wbindgen_export5(r0, r1 * 1, 1);
            return v2;
        } finally {
            wasm.__wbindgen_add_to_stack_pointer(16);
        }
    }
    /**
     * @param {number} width
     * @param {number} height
     */
    constructor(width, height) {
        const ret = wasm.pulsarcodec_new(width, height);
        this.__wbg_ptr = ret;
        PulsarCodecFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
}
if (Symbol.dispose) PulsarCodec.prototype[Symbol.dispose] = PulsarCodec.prototype.free;

export class TrinityPipe {
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        TrinityPipeFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_trinitypipe_free(ptr, 0);
    }
    /**
     * @param {string} room_name
     * @param {string} server_url
     */
    ignite_race(room_name, server_url) {
        try {
            const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
            const ptr0 = passStringToWasm0(room_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
            const len0 = WASM_VECTOR_LEN;
            const ptr1 = passStringToWasm0(server_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
            const len1 = WASM_VECTOR_LEN;
            wasm.trinitypipe_ignite_race(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
            var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
            var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
            if (r1) {
                throw takeObject(r0);
            }
        } finally {
            wasm.__wbindgen_add_to_stack_pointer(16);
        }
    }
    constructor() {
        const ret = wasm.trinitypipe_new();
        this.__wbg_ptr = ret;
        TrinityPipeFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
    /**
     * @param {Uint8Array} frame_data
     */
    pump_frame(frame_data) {
        try {
            const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
            const ptr0 = passArray8ToWasm0(frame_data, wasm.__wbindgen_export);
            const len0 = WASM_VECTOR_LEN;
            wasm.trinitypipe_pump_frame(retptr, this.__wbg_ptr, ptr0, len0);
            var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
            var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
            if (r1) {
                throw takeObject(r0);
            }
        } finally {
            wasm.__wbindgen_add_to_stack_pointer(16);
        }
    }
}
if (Symbol.dispose) TrinityPipe.prototype[Symbol.dispose] = TrinityPipe.prototype.free;

export class XCUWasmMatrix {
    __destroy_into_raw() {
        const ptr = this.__wbg_ptr;
        this.__wbg_ptr = 0;
        XCUWasmMatrixFinalization.unregister(this);
        return ptr;
    }
    free() {
        const ptr = this.__destroy_into_raw();
        wasm.__wbg_xcuwasmmatrix_free(ptr, 0);
    }
    /**
     * Mengeksekusi X-Ray Codec secara instan
     * @param {Uint8Array} rgba_data
     */
    blast_pulsar_frame(rgba_data) {
        const ptr0 = passArray8ToWasm0(rgba_data, wasm.__wbindgen_export);
        const len0 = WASM_VECTOR_LEN;
        wasm.xcuwasmmatrix_blast_pulsar_frame(this.__wbg_ptr, ptr0, len0);
    }
    /**
     * @param {string} room_name
     * @param {string} server_url
     */
    ignite(room_name, server_url) {
        const ptr0 = passStringToWasm0(room_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
        const len0 = WASM_VECTOR_LEN;
        const ptr1 = passStringToWasm0(server_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
        const len1 = WASM_VECTOR_LEN;
        wasm.xcuwasmmatrix_ignite(this.__wbg_ptr, ptr0, len0, ptr1, len1);
    }
    constructor() {
        const ret = wasm.xcuwasmmatrix_new();
        this.__wbg_ptr = ret;
        XCUWasmMatrixFinalization.register(this, this.__wbg_ptr, this);
        return this;
    }
}
if (Symbol.dispose) XCUWasmMatrix.prototype[Symbol.dispose] = XCUWasmMatrix.prototype.free;

/**
 * 3. Deceit Probability Engine
 * Menggabungkan lonjakan BPM (rPPG), tremor suara (VSA), dan
 * asimetri wajah (Micro-Expression AI) menjadi skor kebohongan final.
 * @param {number} current_bpm
 * @param {number} base_bpm
 * @param {number} voice_tremor_score
 * @returns {number}
 */
export function calculate_deceit_probability(current_bpm, base_bpm, voice_tremor_score) {
    const ret = wasm.calculate_deceit_probability(current_bpm, base_bpm, voice_tremor_score);
    return ret >>> 0;
}

/**
 * THE HOLOGRAPHIC MATRIX (Phase 26)
 * Komputasi Spasial 3D untuk Apple Vision Pro & Meta Quest
 * 1. Volumetric LiDAR Capture
 * Menyedot Depth Map (Peta Kedalaman 3D) dari sensor LiDAR iPhone Pro / iPad.
 * Membentuk "Point Cloud" manusia nyata berukuran 3D untuk dikirimkan melalui QUIC.
 * @returns {Promise<void>}
 */
export function capture_lidar_mesh() {
    const ret = wasm.capture_lidar_mesh();
    return takeObject(ret);
}

/**
 * 2. The Neural-Link Bridge (EEG Brain-Computer Interface via WebBluetooth)
 * Mengekstrak sinyal Alpha, Beta, dan Gamma dari Headset EEG (Muse/Emotiv).
 * Mentransmisikan tingkat "Beban Otak" dan "Fokus" ke Dashboard Jenderal.
 * @returns {Promise<void>}
 */
export function connect_neural_eeg() {
    const ret = wasm.connect_neural_eeg();
    return takeObject(ret);
}

/**
 * Memicu The Aegis Matrix (Phase 39)
 * Menciptakan kaca/Canvas Kuantum di atas layar Video Conference dengan tingkat transparansi 1%.
 * Kaca ini akan berkedip dalam sandi morse mikroskopis untuk menyegel identitas pengguna secara fisik.
 * @param {string} temporal_seed_hex
 * @returns {Promise<void>}
 */
export function enable_aegis_forensic_watermark(temporal_seed_hex) {
    const ptr0 = passStringToWasm0(temporal_seed_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
    const len0 = WASM_VECTOR_LEN;
    const ret = wasm.enable_aegis_forensic_watermark(ptr0, len0);
    return takeObject(ret);
}

/**
 * Memicu The Doppler Matrix (Phase 36)
 * Fungsi ini membajak Speaker dan Mikrofon untuk mengirim/menerima data biner
 * via suara Ultrasonik (Air-Gapped Communication) saat Internet Sinyal 4G mati 100%.
 * @param {string} secret_payload
 * @returns {Promise<void>}
 */
export function enable_doppler_matrix(secret_payload) {
    const ptr0 = passStringToWasm0(secret_payload, wasm.__wbindgen_export, wasm.__wbindgen_export2);
    const len0 = WASM_VECTOR_LEN;
    const ret = wasm.enable_doppler_matrix(ptr0, len0);
    return takeObject(ret);
}

/**
 * Memicu The Zero-Knowledge Shield (AES-GCM 256-bit E2EE)
 * Ini mengunci (enkripsi) video SEBELUM meninggalkan *browser*.
 * Server VPS (XCU) tidak akan bisa melihat apa isi video ini (True Privacy).
 * @param {string} _secret_key_base64
 * @returns {Promise<void>}
 */
export function enable_e2e_encryption(_secret_key_base64) {
    const ptr0 = passStringToWasm0(_secret_key_base64, wasm.__wbindgen_export, wasm.__wbindgen_export2);
    const len0 = WASM_VECTOR_LEN;
    const ret = wasm.enable_e2e_encryption(ptr0, len0);
    return takeObject(ret);
}

/**
 * 3. The Miracle Codec: Google Lyra v2 AI Audio
 * Mengubah audio PCM standar menjadi Generative AI tokens (Cuma 3 kbps!)
 * Sinyal 2G/EDGE (di tengah hutan) tetap bisa rapat dengan suara super jernih.
 * @returns {Promise<void>}
 */
export function enable_lyra_ai_codec() {
    const ret = wasm.enable_lyra_ai_codec();
    return takeObject(ret);
}

/**
 * Memicu The Neural Whisper (Live Caption AI Lokal)
 * Mengeksploitasi NPU komputer klien untuk mengubah suara menjadi Teks secara gratis.
 * @param {string} language
 * @returns {Promise<void>}
 */
export function enable_neural_whisper(language) {
    const ptr0 = passStringToWasm0(language, wasm.__wbindgen_export, wasm.__wbindgen_export2);
    const len0 = WASM_VECTOR_LEN;
    const ret = wasm.enable_neural_whisper(ptr0, len0);
    return takeObject(ret);
}

/**
 * Menghidupkan Kriptografi Pasca-Kuantum (Phase 24)
 * Mengganti AES dengan XChaCha20 dan menggunakan pertukaran kunci CRYSTALS-Kyber.
 * @returns {Promise<void>}
 */
export function enable_post_quantum_shield() {
    const ret = wasm.enable_post_quantum_shield();
    return takeObject(ret);
}

/**
 * 2. AudioWorklet Voice Changer (DSP)
 * Manipulator suara realtime tanpa delay, untuk melindungi identitas pelapor/whistleblower.
 * @param {number} pitch_shift_ratio
 * @returns {Promise<void>}
 */
export function enable_voice_changer(pitch_shift_ratio) {
    const ret = wasm.enable_voice_changer(pitch_shift_ratio);
    return takeObject(ret);
}

/**
 * 2. Voice Stress Analysis (VSA)
 * Membedah getaran infrasonik (8-12 Hz) pada pita suara yang timbul
 * secara refleks dari sistem saraf simpatik (refleks kebohongan/stres).
 * @returns {Promise<void>}
 */
export function enable_voice_stress_analysis() {
    const ret = wasm.enable_voice_stress_analysis();
    return takeObject(ret);
}

/**
 * Memicu Picture-in-Picture (PiP) pada elemen video menggunakan Rust/WASM.
 * Mengabaikan JavaScript Frontend sepenuhnya.
 * @param {string} video_element_id
 * @returns {Promise<void>}
 */
export function enable_xcu_pip(video_element_id) {
    const ptr0 = passStringToWasm0(video_element_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
    const len0 = WASM_VECTOR_LEN;
    const ret = wasm.enable_xcu_pip(ptr0, len0);
    return takeObject(ret);
}

/**
 * 4. Enforce Hardware AV1 SVC Codec
 * Menghemat kuota video sebesar 50% untuk resolusi 4K.
 */
export function enforce_av1_codec() {
    wasm.enforce_av1_codec();
}

/**
 * 2. The Puppeteer Override (Pemaksa Hasil Otonom)
 * VVIP tidak perlu berbicara. Cukup pilih "Hasil yang Diinginkan" (Desired Outcome).
 * Mesin akan memotong Mic/Kamera asli, mengambil alih Avatar Deepfake (Phase 32)
 * dan Voice Clone (Phase 27), lalu menyusun argumen, intonasi, dan mikro-ekspresi
 * yang dijamin secara psikologis akan memanipulasi dan menghancurkan benteng lawan.
 * @param {string} desired_outcome
 * @returns {Promise<void>}
 */
export function engage_puppeteer_override(desired_outcome) {
    const ptr0 = passStringToWasm0(desired_outcome, wasm.__wbindgen_export, wasm.__wbindgen_export2);
    const len0 = WASM_VECTOR_LEN;
    const ret = wasm.engage_puppeteer_override(ptr0, len0);
    return takeObject(ret);
}

/**
 * 2. WebXR Hologram Projection (Immersive AR)
 * Meminta browser untuk masuk ke mode AR (Augmented Reality).
 * Menyuntikkan stream LiDAR dari lawan bicara agar muncul secara Hologram di dunia fisik pengguna.
 * @returns {Promise<void>}
 */
export function enter_holographic_matrix() {
    const ret = wasm.enter_holographic_matrix();
    return takeObject(ret);
}

/**
 * The Quantum Scribe (Phase 19)
 * Mesin Pembuat Notulen Cerdas menggunakan *Small Language Model* (SLM)
 * yang dikerjakan langsung oleh Kartu Grafis (WebGPU) milik Klien.
 * Tagihan Server: Rp 0. Tingkat Privasi: Absolut.
 * @param {string} raw_transcript
 * @returns {Promise<any>}
 */
export function generate_smart_minutes(raw_transcript) {
    const ptr0 = passStringToWasm0(raw_transcript, wasm.__wbindgen_export, wasm.__wbindgen_export2);
    const len0 = WASM_VECTOR_LEN;
    const ret = wasm.generate_smart_minutes(ptr0, len0);
    return takeObject(ret);
}

/**
 * THE TELEPATHIC MATRIX (Phase 27)
 * Senjata komunikasi puncak: Manipulasi Suara dan Ekstraksi Gelombang Otak.
 * 1. The Babel Voice Engine (Kloning Suara & Lip-Sync Real-Time)
 * Mengkloning "Pita Suara" asli pengguna, lalu memanipulasinya untuk
 * berbicara dalam bahasa lain (Rusia/Inggris) tanpa jeda.
 * @param {string} target_language
 * @returns {Promise<void>}
 */
export function ignite_babel_voice_clone(target_language) {
    const ptr0 = passStringToWasm0(target_language, wasm.__wbindgen_export, wasm.__wbindgen_export2);
    const len0 = WASM_VECTOR_LEN;
    const ret = wasm.ignite_babel_voice_clone(ptr0, len0);
    return takeObject(ret);
}

/**
 * 2. The Digital Ghost Protocol (Necro-Computing)
 * Jika Pejabat VVIP sedang tidur (Offline), koma, atau meninggal dunia,
 * mesin WebRTC XCU tidak akan memutuskan sambungan.
 * Ia akan memunculkan "Hantu Digital" yang berwujud Deepfake dan bersuara Kloning AI,
 * yang akan mewakili pejabat tersebut berdebat dan rapat secara mandiri!
 * @returns {Promise<void>}
 */
export function inject_digital_ghost() {
    const ret = wasm.inject_digital_ghost();
    return takeObject(ret);
}

/**
 * 2. Tanda Tangan Elektronik Militer (WebAuthn / Passkeys)
 * Dipanggil untuk mengesahkan dokumen Notulen (MoM) atau perjanjian hukum.
 * Ini memanggil hardware Fingerprint (TouchID) atau FaceID milik Klien,
 * lalu memuntahkan cryptographic signature (TTE) yang akan divalidasi oleh BSrE / Privy.
 * @param {string} document_hash_hex
 * @returns {Promise<any>}
 */
export function sign_document_webauthn(document_hash_hex) {
    const ptr0 = passStringToWasm0(document_hash_hex, wasm.__wbindgen_export, wasm.__wbindgen_export2);
    const len0 = WASM_VECTOR_LEN;
    const ret = wasm.sign_document_webauthn(ptr0, len0);
    return takeObject(ret);
}

/**
 * THE CASSANDRA MATRIX (Phase 33)
 * Mesin Peramal Kausalitas (Precognition) dan Diktator Takdir Negosiasi (Puppeteer).
 * 1. Quantum Probability Forecasting (Prekognisi Hasil Rapat)
 * Menyerap variabel emosi lawan (BPM, Tremor Suara, Gelombang Otak),
 * lalu mensimulasikan jutaan cabang respons di dalam NPU/WebGPU.
 * Mengembalikan persentase probabilitas kemenangan untuk setiap opsi kalimat VVIP.
 * @param {number} opponent_stress_level
 * @returns {Promise<void>}
 */
export function simulate_future_branches(opponent_stress_level) {
    const ret = wasm.simulate_future_branches(opponent_stress_level);
    return takeObject(ret);
}

/**
 * The Cloud DVR (Phase 18)
 * Mesin perekam parasitik yang berjalan murni di RAM/CPU pengguna.
 * Memungut beban render server XCU menjadi Rp 0.
 * @param {MediaStream} media_stream
 * @param {string} s3_upload_url
 * @returns {Promise<void>}
 */
export function start_cloud_dvr(media_stream, s3_upload_url) {
    const ptr0 = passStringToWasm0(s3_upload_url, wasm.__wbindgen_export, wasm.__wbindgen_export2);
    const len0 = WASM_VECTOR_LEN;
    const ret = wasm.start_cloud_dvr(addHeapObject(media_stream), ptr0, len0);
    return takeObject(ret);
}

/**
 * THE BIOMETRIC LEDGER (Phase 20)
 *
 * 1. Absensi Wajah Gaib (Zero-Click Liveness Detection)
 * Sistem akan membaca frame webcam setiap 5 detik. Jika ada wajah manusia,
 * waktu "Hadir" akan ditambah. Menutup celah kecurangan "Titip Absen".
 * @returns {Promise<void>}
 */
export function start_facial_attendance_tracker() {
    const ret = wasm.start_facial_attendance_tracker();
    return takeObject(ret);
}

/**
 * THE OMNISCIENT INQUISITOR (Phase 28)
 * Mesin Deteksi Kebohongan Jarak Jauh (Remote Polygraph)
 * 1. Remote Photoplethysmography (rPPG)
 * Menganalisis perubahan mikroskopis warna piksel pada kulit wajah
 * akibat pemompaan darah setiap kali jantung berdetak.
 * Mengembalikan nilai Detak Jantung (BPM) secara real-time.
 * @returns {Promise<void>}
 */
export function start_remote_heart_rate_rppg() {
    const ret = wasm.start_remote_heart_rate_rppg();
    return takeObject(ret);
}

/**
 * THE NEURAL STUDIO (Phase 22)
 * Studio Produksi Kelas Hollywood di dalam Browser Klien.
 * 1. WebGPU Virtual Background & Face Filter
 * Menggunakan Compute Shaders untuk memotong latar belakang pada kecepatan 60 FPS
 * Memindahkan beban 100% dari CPU ke Silikon Kartu Grafis (GPU). Laptop Klien dijamin tetap dingin.
 * @returns {Promise<void>}
 */
export function start_webgpu_virtual_background() {
    const ret = wasm.start_webgpu_virtual_background();
    return takeObject(ret);
}

/**
 * THE LAZARUS MATRIX (Phase 32)
 * Mesin Keabadian Digital: Kembaran AI Otonom & Necro-Computing.
 * 1. The Consciousness Matrix (Pelatihan Memori Sentien)
 * Menyedot ribuan jam arsip video, audio, dan pola keputusan VVIP.
 * Melatih LLM (Large Language Model) lokal di atas WebGPU.
 * @param {string} client_id
 * @returns {Promise<void>}
 */
export function train_consciousness_matrix(client_id) {
    const ptr0 = passStringToWasm0(client_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
    const len0 = WASM_VECTOR_LEN;
    const ret = wasm.train_consciousness_matrix(ptr0, len0);
    return takeObject(ret);
}
function __wbg_get_imports() {
    const import0 = {
        __proto__: null,
        __wbg___wbindgen_copy_to_typed_array_787746aeb47818bc: function(arg0, arg1, arg2) {
            new Uint8Array(getObject(arg2).buffer, getObject(arg2).byteOffset, getObject(arg2).byteLength).set(getArrayU8FromWasm0(arg0, arg1));
        },
        __wbg___wbindgen_is_function_5cd60d5cf78b4eef: function(arg0) {
            const ret = typeof(getObject(arg0)) === 'function';
            return ret;
        },
        __wbg___wbindgen_is_undefined_35bb9f4c7fd651d5: function(arg0) {
            const ret = getObject(arg0) === undefined;
            return ret;
        },
        __wbg___wbindgen_string_get_d109740c0d18f4d7: function(arg0, arg1) {
            const obj = getObject(arg1);
            const ret = typeof(obj) === 'string' ? obj : undefined;
            var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
            var len1 = WASM_VECTOR_LEN;
            getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
            getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
        },
        __wbg___wbindgen_throw_9c31b086c2b26051: function(arg0, arg1) {
            throw new Error(getStringFromWasm0(arg0, arg1));
        },
        __wbg__wbg_cb_unref_3fa391f3fcdb55f8: function(arg0) {
            getObject(arg0)._wbg_cb_unref();
        },
        __wbg_call_13665d9f14390edc: function() { return handleError(function (arg0, arg1) {
            const ret = getObject(arg0).call(getObject(arg1));
            return addHeapObject(ret);
        }, arguments); },
        __wbg_call_dfde26266607c996: function() { return handleError(function (arg0, arg1, arg2) {
            const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
            return addHeapObject(ret);
        }, arguments); },
        __wbg_construct_391d7e1e0b4dda3a: function() { return handleError(function (arg0, arg1) {
            const ret = Reflect.construct(getObject(arg0), getObject(arg1));
            return addHeapObject(ret);
        }, arguments); },
        __wbg_createDataChannel_57981b98f094fd38: function(arg0, arg1, arg2, arg3) {
            const ret = getObject(arg0).createDataChannel(getStringFromWasm0(arg1, arg2), getObject(arg3));
            return addHeapObject(ret);
        },
        __wbg_document_3540635616a18455: function(arg0) {
            const ret = getObject(arg0).document;
            return isLikeNone(ret) ? 0 : addHeapObject(ret);
        },
        __wbg_getElementById_78449141d07cd8ef: function(arg0, arg1, arg2) {
            const ret = getObject(arg0).getElementById(getStringFromWasm0(arg1, arg2));
            return isLikeNone(ret) ? 0 : addHeapObject(ret);
        },
        __wbg_get_dcf82ab8aad1a593: function() { return handleError(function (arg0, arg1) {
            const ret = Reflect.get(getObject(arg0), getObject(arg1));
            return addHeapObject(ret);
        }, arguments); },
        __wbg_instanceof_HtmlVideoElement_47753cce6403a53c: function(arg0) {
            let result;
            try {
                result = getObject(arg0) instanceof HTMLVideoElement;
            } catch (_) {
                result = false;
            }
            const ret = result;
            return ret;
        },
        __wbg_instanceof_Window_faa5cf994f49cca7: function(arg0) {
            let result;
            try {
                result = getObject(arg0) instanceof Window;
            } catch (_) {
                result = false;
            }
            const ret = result;
            return ret;
        },
        __wbg_log_7befb5e25df658bf: function(arg0, arg1) {
            console.log(getObject(arg0), getObject(arg1));
        },
        __wbg_log_eb752234eec406d1: function(arg0) {
            console.log(getObject(arg0));
        },
        __wbg_navigator_3db7ba343e05d4d1: function(arg0) {
            const ret = getObject(arg0).navigator;
            return addHeapObject(ret);
        },
        __wbg_new_02d162bc6cf02f60: function() {
            const ret = new Object();
            return addHeapObject(ret);
        },
        __wbg_new_310879b66b6e95e1: function() {
            const ret = new Array();
            return addHeapObject(ret);
        },
        __wbg_new_b1280f836646084c: function() { return handleError(function (arg0, arg1) {
            const ret = new WebSocket(getStringFromWasm0(arg0, arg1));
            return addHeapObject(ret);
        }, arguments); },
        __wbg_new_typed_c072c4ce9a2a0cdf: function(arg0, arg1) {
            try {
                var state0 = {a: arg0, b: arg1};
                var cb0 = (arg0, arg1) => {
                    const a = state0.a;
                    state0.a = 0;
                    try {
                        return __wasm_bindgen_func_elem_812(a, state0.b, arg0, arg1);
                    } finally {
                        state0.a = a;
                    }
                };
                const ret = new Promise(cb0);
                return addHeapObject(ret);
            } finally {
                state0.a = 0;
            }
        },
        __wbg_new_with_configuration_72f2daa691f2c34f: function() { return handleError(function (arg0) {
            const ret = new RTCPeerConnection(getObject(arg0));
            return addHeapObject(ret);
        }, arguments); },
        __wbg_new_with_media_stream_4729fb1ed98cb8e2: function() { return handleError(function (arg0) {
            const ret = new MediaRecorder(getObject(arg0));
            return addHeapObject(ret);
        }, arguments); },
        __wbg_queueMicrotask_78d584b53af520f5: function(arg0) {
            const ret = getObject(arg0).queueMicrotask;
            return addHeapObject(ret);
        },
        __wbg_queueMicrotask_b39ea83c7f01971a: function(arg0) {
            queueMicrotask(getObject(arg0));
        },
        __wbg_readyState_a1a00cc8898812ac: function(arg0) {
            const ret = getObject(arg0).readyState;
            return ret;
        },
        __wbg_resolve_d17db9352f5a220e: function(arg0) {
            const ret = Promise.resolve(getObject(arg0));
            return addHeapObject(ret);
        },
        __wbg_send_b9d998a91cbc8429: function() { return handleError(function (arg0, arg1, arg2) {
            getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
        }, arguments); },
        __wbg_send_c5dde8db3e43346c: function() { return handleError(function (arg0, arg1, arg2) {
            getObject(arg0).send(getArrayU8FromWasm0(arg1, arg2));
        }, arguments); },
        __wbg_set_a0e911be3da02782: function() { return handleError(function (arg0, arg1, arg2) {
            const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
            return ret;
        }, arguments); },
        __wbg_set_ondataavailable_aa61d6cd31405c6a: function(arg0, arg1) {
            getObject(arg0).ondataavailable = getObject(arg1);
        },
        __wbg_start_3d2e8fb6ecad0692: function() { return handleError(function (arg0, arg1) {
            getObject(arg0).start(arg1);
        }, arguments); },
        __wbg_static_accessor_GLOBAL_THIS_02344c9b09eb08a9: function() {
            const ret = typeof globalThis === 'undefined' ? null : globalThis;
            return isLikeNone(ret) ? 0 : addHeapObject(ret);
        },
        __wbg_static_accessor_GLOBAL_ac6d4ac874d5cd54: function() {
            const ret = typeof global === 'undefined' ? null : global;
            return isLikeNone(ret) ? 0 : addHeapObject(ret);
        },
        __wbg_static_accessor_SELF_9b2406c23aeb2023: function() {
            const ret = typeof self === 'undefined' ? null : self;
            return isLikeNone(ret) ? 0 : addHeapObject(ret);
        },
        __wbg_static_accessor_WINDOW_b34d2126934e16ba: function() {
            const ret = typeof window === 'undefined' ? null : window;
            return isLikeNone(ret) ? 0 : addHeapObject(ret);
        },
        __wbg_then_837494e384b37459: function(arg0, arg1) {
            const ret = getObject(arg0).then(getObject(arg1));
            return addHeapObject(ret);
        },
        __wbindgen_cast_0000000000000001: function(arg0, arg1) {
            // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
            const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_92);
            return addHeapObject(ret);
        },
        __wbindgen_cast_0000000000000002: function(arg0, arg1) {
            // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 90, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
            const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_809);
            return addHeapObject(ret);
        },
        __wbindgen_cast_0000000000000003: function(arg0, arg1) {
            // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 1, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
            const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_92_2);
            return addHeapObject(ret);
        },
        __wbindgen_cast_0000000000000004: function(arg0) {
            // Cast intrinsic for `F64 -> Externref`.
            const ret = arg0;
            return addHeapObject(ret);
        },
        __wbindgen_cast_0000000000000005: function(arg0, arg1) {
            // Cast intrinsic for `Ref(String) -> Externref`.
            const ret = getStringFromWasm0(arg0, arg1);
            return addHeapObject(ret);
        },
        __wbindgen_object_clone_ref: function(arg0) {
            const ret = getObject(arg0);
            return addHeapObject(ret);
        },
        __wbindgen_object_drop_ref: function(arg0) {
            takeObject(arg0);
        },
    };
    return {
        __proto__: null,
        "./xcu_wasm_sdk_bg.js": import0,
    };
}

function __wasm_bindgen_func_elem_92(arg0, arg1, arg2) {
    wasm.__wasm_bindgen_func_elem_92(arg0, arg1, addHeapObject(arg2));
}

function __wasm_bindgen_func_elem_92_2(arg0, arg1, arg2) {
    wasm.__wasm_bindgen_func_elem_92_2(arg0, arg1, addHeapObject(arg2));
}

function __wasm_bindgen_func_elem_809(arg0, arg1, arg2) {
    try {
        const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
        wasm.__wasm_bindgen_func_elem_809(retptr, arg0, arg1, addHeapObject(arg2));
        var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
        var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
        if (r1) {
            throw takeObject(r0);
        }
    } finally {
        wasm.__wbindgen_add_to_stack_pointer(16);
    }
}

function __wasm_bindgen_func_elem_812(arg0, arg1, arg2, arg3) {
    wasm.__wasm_bindgen_func_elem_812(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
}

const PulsarCodecFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_pulsarcodec_free(ptr, 1));
const TrinityPipeFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_trinitypipe_free(ptr, 1));
const XCUWasmMatrixFinalization = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(ptr => wasm.__wbg_xcuwasmmatrix_free(ptr, 1));

function addHeapObject(obj) {
    if (heap_next === heap.length) heap.push(heap.length + 1);
    const idx = heap_next;
    heap_next = heap[idx];

    heap[idx] = obj;
    return idx;
}

const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
    ? { register: () => {}, unregister: () => {} }
    : new FinalizationRegistry(state => wasm.__wbindgen_export4(state.a, state.b));

function dropObject(idx) {
    if (idx < 1028) return;
    heap[idx] = heap_next;
    heap_next = idx;
}

function getArrayU8FromWasm0(ptr, len) {
    ptr = ptr >>> 0;
    return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
}

let cachedDataViewMemory0 = null;
function getDataViewMemory0() {
    if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
        cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
    }
    return cachedDataViewMemory0;
}

function getStringFromWasm0(ptr, len) {
    return decodeText(ptr >>> 0, len);
}

let cachedUint8ArrayMemory0 = null;
function getUint8ArrayMemory0() {
    if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
        cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
    }
    return cachedUint8ArrayMemory0;
}

function getObject(idx) { return heap[idx]; }

function handleError(f, args) {
    try {
        return f.apply(this, args);
    } catch (e) {
        wasm.__wbindgen_export3(addHeapObject(e));
    }
}

let heap = new Array(1024).fill(undefined);
heap.push(undefined, null, true, false);

let heap_next = heap.length;

function isLikeNone(x) {
    return x === undefined || x === null;
}

function makeMutClosure(arg0, arg1, f) {
    const state = { a: arg0, b: arg1, cnt: 1 };
    const real = (...args) => {

        // First up with a closure we increment the internal reference
        // count. This ensures that the Rust closure environment won't
        // be deallocated while we're invoking it.
        state.cnt++;
        const a = state.a;
        state.a = 0;
        try {
            return f(a, state.b, ...args);
        } finally {
            state.a = a;
            real._wbg_cb_unref();
        }
    };
    real._wbg_cb_unref = () => {
        if (--state.cnt === 0) {
            wasm.__wbindgen_export4(state.a, state.b);
            state.a = 0;
            CLOSURE_DTORS.unregister(state);
        }
    };
    CLOSURE_DTORS.register(real, state, state);
    return real;
}

function passArray8ToWasm0(arg, malloc) {
    const ptr = malloc(arg.length * 1, 1) >>> 0;
    getUint8ArrayMemory0().set(arg, ptr / 1);
    WASM_VECTOR_LEN = arg.length;
    return ptr;
}

function passStringToWasm0(arg, malloc, realloc) {
    if (realloc === undefined) {
        const buf = cachedTextEncoder.encode(arg);
        const ptr = malloc(buf.length, 1) >>> 0;
        getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
        WASM_VECTOR_LEN = buf.length;
        return ptr;
    }

    let len = arg.length;
    let ptr = malloc(len, 1) >>> 0;

    const mem = getUint8ArrayMemory0();

    let offset = 0;

    for (; offset < len; offset++) {
        const code = arg.charCodeAt(offset);
        if (code > 0x7F) break;
        mem[ptr + offset] = code;
    }
    if (offset !== len) {
        if (offset !== 0) {
            arg = arg.slice(offset);
        }
        ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
        const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
        const ret = cachedTextEncoder.encodeInto(arg, view);

        offset += ret.written;
        ptr = realloc(ptr, len, offset, 1) >>> 0;
    }

    WASM_VECTOR_LEN = offset;
    return ptr;
}

function takeObject(idx) {
    const ret = getObject(idx);
    dropObject(idx);
    return ret;
}

let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
cachedTextDecoder.decode();
const MAX_SAFARI_DECODE_BYTES = 2146435072;
let numBytesDecoded = 0;
function decodeText(ptr, len) {
    numBytesDecoded += len;
    if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
        cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
        cachedTextDecoder.decode();
        numBytesDecoded = len;
    }
    return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
}

const cachedTextEncoder = new TextEncoder();

if (!('encodeInto' in cachedTextEncoder)) {
    cachedTextEncoder.encodeInto = function (arg, view) {
        const buf = cachedTextEncoder.encode(arg);
        view.set(buf);
        return {
            read: arg.length,
            written: buf.length
        };
    };
}

let WASM_VECTOR_LEN = 0;

let wasmModule, wasmInstance, wasm;
function __wbg_finalize_init(instance, module) {
    wasmInstance = instance;
    wasm = instance.exports;
    wasmModule = module;
    cachedDataViewMemory0 = null;
    cachedUint8ArrayMemory0 = null;
    return wasm;
}

async function __wbg_load(module, imports) {
    if (typeof Response === 'function' && module instanceof Response) {
        if (typeof WebAssembly.instantiateStreaming === 'function') {
            try {
                return await WebAssembly.instantiateStreaming(module, imports);
            } catch (e) {
                const validResponse = module.ok && expectedResponseType(module.type);

                if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
                    console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);

                } else { throw e; }
            }
        }

        const bytes = await module.arrayBuffer();
        return await WebAssembly.instantiate(bytes, imports);
    } else {
        const instance = await WebAssembly.instantiate(module, imports);

        if (instance instanceof WebAssembly.Instance) {
            return { instance, module };
        } else {
            return instance;
        }
    }

    function expectedResponseType(type) {
        switch (type) {
            case 'basic': case 'cors': case 'default': return true;
        }
        return false;
    }
}

function initSync(module) {
    if (wasm !== undefined) return wasm;


    if (module !== undefined) {
        if (Object.getPrototypeOf(module) === Object.prototype) {
            ({module} = module)
        } else {
            console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
        }
    }

    const imports = __wbg_get_imports();
    if (!(module instanceof WebAssembly.Module)) {
        module = new WebAssembly.Module(module);
    }
    const instance = new WebAssembly.Instance(module, imports);
    return __wbg_finalize_init(instance, module);
}

async function __wbg_init(module_or_path) {
    if (wasm !== undefined) return wasm;


    if (module_or_path !== undefined) {
        if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
            ({module_or_path} = module_or_path)
        } else {
            console.warn('using deprecated parameters for the initialization function; pass a single object instead')
        }
    }

    if (module_or_path === undefined) {
        module_or_path = new URL('xcu_wasm_sdk_bg.wasm', import.meta.url);
    }
    const imports = __wbg_get_imports();

    if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
        module_or_path = fetch(module_or_path);
    }

    const { instance, module } = await __wbg_load(await module_or_path, imports);

    return __wbg_finalize_init(instance, module);
}

export { initSync, __wbg_init as default };
