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

import { get } from 'svelte/store';

import type { key_val } from '$lib/stores/ae_stores';
// import { ae_util } from '$lib/ae_utils/ae_utils';
// import { api } from '$lib/api';
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/stores/ae_stores';
// import { events_loc, events_slct, events_trigger } from '$lib/stores/ae_events_stores';

export async function load({ params, parent, url }) {
	// route
	const log_lvl: number = 0;

	const data = await parent();
	console.log(`Svelte Events Badges [slug] +layout.ts data = data:`, data);

	const ae_loc_tmp = get(ae_loc);
	console.log(`ae_loc = `, ae_loc_tmp);

	const ds_code_li: null | key_val = ae_loc_tmp.ds;
	console.log(`ae_ ds_code_li = `, ds_code_li);
	let ds_code: null | string = null;
	let ds_type: null | string = null;

	const data_struct = {
		ae_init: ae_loc_tmp,
		params: params,
		sections: [
			{ slug: 'new', title: 'New Event Badge' },
			{ slug: 'manage', title: 'Manage' },
			{ slug: 'test', title: 'Test' }
		],
		url: url
	};

	const loading_results = null;

	ds_code = 'hub__page__events_badges__create_info';
	ds_type = 'text';

	return data_struct;
}
