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

// import { get } from 'svelte/store';

// import { api } from '$lib/api';
// import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
// import { ae_events_loc, ae_events_sess, ae_events_triggers, ae_events_badges_loc, ae_events_badges_sess, ae_events_badges_triggers } from '$lib/ae_events_stores';
// import { ae_events_loc, ae_events_slct, ae_events_trigger } from '$lib/ae_events_stores';
// import type { key_val } from '$lib/ae_stores';


export async function load({ params, parent, url }) { // route
    // console.log(`ae_events_badges +layout.ts data.params:`, params);
    // console.log(`ae_events_badges +layout.ts data.route:`, route);
    // console.log(`ae_events_badges +layout.ts data.url:`, url);

    // const { ae_init, root_layout_ts } = await parent();
    let data = await parent();
    console.log(`ae_events_badges +layout.ts data:`, data);

    if (data.ae_loc.account_id) {
        console.log(`ae_events_badges +layout.ts data = data.ae_loc:`, data.ae_loc);
    } else {
        console.log(`ae_events_badges +layout.ts data = data.ae_loc:`, data.ae_loc);
    }


    data.ae_events_badges_layout_ts = true;

    let submenu = {
        main: {name: 'Main', href: '/events_badges', access: false},
        manage: {name: 'Manage', href: '/events_badges/manage', access: 'administrator', disable: true, hide: true},
        review: {name: 'Review', href: '/events_badges/review', access: false, disable: true, hide: false},
        print: {name: 'Print', href: '/events_badges/print', access: 'trusted', disable: true, hide: false},
        view: {name: 'View', href: '/events_badges/view', access: 'trusted', hide: true}, // event_badge_id
        // new: {name: 'New', href: '/events_badges/new'},
        // sponsorships: {name: 'Sponsorships', href: '/sponsorships', disable: true, hide: true},
        };
    data.submenu = submenu

    return data;
}
