/**
 * Emit event to JavaScript using window.auroraview.trigger()
 *
 * This template is used by Rust to dispatch events from Python to JavaScript.
 * Generated by Askama template engine.
 *
 * @file emit_event.js
 * @generated
 *
 * Template variables:
 * @param {string} event_name - The name of the event to emit
 * @param {string} event_data - JSON-encoded event data payload
 *
 * @example
 * // In Python:
 * webview.emit("my_event", {"key": "value"})
 *
 * // In JavaScript:
 * window.auroraview.on("my_event", (data) => {
 *     console.log(data.key); // "value"
 * });
 */
(function() {
    'use strict';
    if (window.auroraview && window.auroraview.trigger) {
        /** @type {Object} */
        var eventData = JSON.parse('{{ event_data }}');
        window.auroraview.trigger('{{ event_name }}', eventData);
    } else {
        console.error('[AuroraView] Event bridge not ready, cannot emit event: {{ event_name }}');
    }
})();

