/** @type {import('./$types').PageLoad} */

import { browser } from '$app/environment';
import { events_func } from '$lib/ae_events/ae_events_functions';

export async function load({ parent }) {
    const parent_data = await parent();

    const account_id = parent_data.account_id;
    const ae_acct = parent_data[account_id];
    const event_id = ae_acct.slct.event_id;

    if (browser && event_id) {
        events_func.load_ae_obj_li__event_location({
            api_cfg: ae_acct.api,
            for_obj_type: 'event',
            for_obj_id: event_id,
            hidden: 'all'
        });
    }

    return parent_data;
}
