<script>
import {ssrAttributes as __AgnosUISveltePreprocess__ssrAttributes} from '@agnos-ui/svelte-headless/utils/directive';
import {BROWSER as __AgnosUISveltePreprocess__BROWSER} from 'esm-env';

	const directive1 = () => {};
	const directive2 = () => {};
	const directive3 = () => {};

	/**
	 * @typedef {Object} Props
	 * @property {number} [b]
	 * @property {any} [array]
	 * @property {any} [promise]
	 * @property {any} [myAttr]
	 */

	/** @type {Props} */
	let {b = 1, array = [], promise = new Promise(() => {}), myAttr = {a: 1, b: 2}} = $props();
</script>

<div use:directive1 {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directive1)}>
	<div use:directive2={2} use:directive3 {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes([directive2, 2], directive3)}></div>
	{#if b === 1}
		<div use:directive1 {...myAttr} {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directive1)}>b is 1</div>
	{:else if b === 2}
		<div use:directive1 {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directive1)}>b is 2</div>
	{:else}
		<div use:directive1 {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directive1)}>b is something else than 1 or 2</div>
	{/if}
	{#each array as item}
		<div use:directive1 {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directive1)}>item {item}</div>
	{/each}
	{#await promise}
		<div use:directive1 {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directive1)}>promise is loading</div>
	{:then _value}
		<div use:directive1 {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directive1)}>promise is resolved</div>
	{:catch _error}
		<div use:directive1 {...__AgnosUISveltePreprocess__BROWSER ? {} : __AgnosUISveltePreprocess__ssrAttributes(directive1)}>promise is in error</div>
	{/await}
</div>
