async function add_marketplace_starter_to_library(starter, preview) {
	const new_starter_id = uuidv4()
	remap_entry_and_field_items({ entries: starter.entries, fields: starter.fields })

	const symbol_res = await supabase.from('library_symbols').insert({ id: new_starter_id, name: starter.name, code: starter.code, index: 0, owner: get(page).data.user.id })
	if (symbol_res.error) {
		console.log('Failed to insert site', { symbol_res, starter })
		throw new Error('Failed to insert site')
	}

	const fields_res = await supabase.from('fields').insert(starter.fields.map(f => ({ ...f, library_symbol: new_starter_id })))
	if (fields_res.error) {
		console.log('Failed to insert fields', { fields_res, fields: starter.fields })
		throw new Error('Failed to insert fields')
	}

	const entries_res = await supabase.from('entries').insert(starter.entries.map(f => ({ ...f, library_symbol: new_starter_id })))
	if (entries_res.error) {
		console.log('Failed to insert entries', { entries_res, entries: starter.entries })
		throw new Error('Failed to insert entries')
	}

	const storage_res = await supabase.storage.from('sites').upload(`${new_starter_id}/preview.html`, preview)
}
Adds a marketplace starter to the user's library
@param {Object} starter - The starter object containing name, code, entries, and fields
@param {string} starter.name - The name of the starter
@param {string} starter.code - The code for the starter
@param {Array<import('$lib').Entry>} starter.entries - The entries data for the starter
@param {Array<import('$lib').Field>} starter.fields - The fields data for the starter
@param {string} preview - The HTML preview content for the starter
@returns {Promise<void>}