@bjj/nuxt-layer-shadcn-ui 0.14.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,141 @@
1
+ <script setup lang="ts">
2
+ import type { SidebarLayoutMenuItem, SidebarLayoutProps } from './types'
3
+ import SidebarMenus from './SidebarMenus.vue'
4
+ import { sidebarMenuItemKey } from './utils'
5
+ import {
6
+ Sidebar,
7
+ SidebarContent,
8
+ SidebarFooter,
9
+ SidebarHeader,
10
+ SidebarInset,
11
+ SidebarProvider,
12
+ SidebarRail,
13
+ SidebarTrigger,
14
+ } from '../../shadcn/sidebar'
15
+ import { provideSidebarContext, SIDEBAR_WIDTH } from '../../shadcn/sidebar/utils'
16
+ import { TooltipProvider } from '../../shadcn/tooltip'
17
+
18
+ const props = withDefaults(defineProps<SidebarLayoutProps>(), {
19
+ active: undefined,
20
+ emptyText: undefined,
21
+ variant: 'sidebar',
22
+ collapsible: 'icon',
23
+ sidebarWidth: SIDEBAR_WIDTH,
24
+ contentClass: undefined,
25
+ class: undefined,
26
+ })
27
+
28
+ const emit = defineEmits<{
29
+ 'update:active': [key: string]
30
+ 'select': [item: SidebarLayoutMenuItem]
31
+ }>()
32
+
33
+ defineSlots<{
34
+ default?: () => any
35
+ header?: () => any
36
+ footer?: () => any
37
+ }>()
38
+
39
+ // The context `Sidebar` requires, without nesting `SidebarProvider` — whose
40
+ // viewport wrapper, state cookie and Cmd/Ctrl+B toggle are page-level behaviour.
41
+ // In page mode the provider mounts anyway and shadows this.
42
+ const noop = () => {}
43
+ provideSidebarContext({
44
+ state: computed(() => 'expanded' as const),
45
+ open: ref(true),
46
+ setOpen: noop,
47
+ isMobile: ref(false),
48
+ openMobile: ref(false),
49
+ setOpenMobile: noop,
50
+ toggleSidebar: noop,
51
+ })
52
+
53
+ const rootComponent = computed(() => props.embedded ? 'div' : SidebarProvider)
54
+
55
+ const rootStyle = computed(() => ({ '--sidebar-width': props.sidebarWidth }))
56
+
57
+ const rootClass = computed(() =>
58
+ cn(props.embedded && 'min-h-0 flex size-full overflow-hidden', props.class),
59
+ )
60
+
61
+ function onSelect (item: SidebarLayoutMenuItem) {
62
+ emit('select', item)
63
+ emit('update:active', sidebarMenuItemKey(item))
64
+ }
65
+ </script>
66
+
67
+ <template>
68
+ <component
69
+ :is="rootComponent"
70
+ :style="rootStyle"
71
+ :class="rootClass"
72
+ >
73
+ <!-- Menu-button tooltips need a provider, which embedded mode has none of. -->
74
+ <TooltipProvider>
75
+ <!-- `shrink-0`: wide pane content scrolls instead of squeezing the menu. -->
76
+ <Sidebar
77
+ :variant="variant"
78
+ :collapsible="embedded ? 'none' : collapsible"
79
+ :class="embedded ? 'shrink-0 border-r' : undefined"
80
+ >
81
+ <SidebarHeader v-if="$slots.header">
82
+ <slot name="header" />
83
+ </SidebarHeader>
84
+
85
+ <SidebarContent class="overflow-hidden">
86
+ <ScrollArea
87
+ fadeMask
88
+ class="min-h-0 flex-1"
89
+ >
90
+ <SidebarMenus
91
+ :menus="menus"
92
+ :active="active"
93
+ :emptyText="emptyText"
94
+ @select="onSelect"
95
+ />
96
+ </ScrollArea>
97
+ </SidebarContent>
98
+
99
+ <SidebarFooter v-if="$slots.footer">
100
+ <slot name="footer" />
101
+ </SidebarFooter>
102
+
103
+ <SidebarRail v-if="!embedded" />
104
+ </Sidebar>
105
+
106
+ <!-- The nav keeps the page ground, so the content takes the raised surface —
107
+ embedded, the container owns it (a modal is `bg-popover`).
108
+ Top padding on mobile reserves a safe area for the floating trigger. -->
109
+ <SidebarInset
110
+ :class="[
111
+ 'min-w-0',
112
+ embedded ? 'bg-transparent' : 'bg-card',
113
+ !embedded && `
114
+ pt-14
115
+ md:pt-0
116
+ `,
117
+ ]"
118
+ >
119
+ <!-- Mobile-only trigger: the desktop toggle lives in the sidebar header. -->
120
+ <SidebarTrigger
121
+ v-if="!embedded"
122
+ class="
123
+ left-3 top-3 size-9 rounded-md bg-background/80 shadow-sm
124
+ backdrop-blur-sm
125
+ md:hidden
126
+ absolute z-30 cursor-pointer border
127
+ "
128
+ />
129
+
130
+ <ScrollArea
131
+ fadeMask
132
+ class="min-h-0 flex-1"
133
+ >
134
+ <div :class="contentClass">
135
+ <slot />
136
+ </div>
137
+ </ScrollArea>
138
+ </SidebarInset>
139
+ </TooltipProvider>
140
+ </component>
141
+ </template>
@@ -0,0 +1,31 @@
1
+ import type { Component } from 'vue'
2
+
3
+ export interface SidebarLayoutMenuItem {
4
+ label: string
5
+ /** Identity used for key-based selection. Falls back to `href`, then `label`. */
6
+ key?: string
7
+ icon?: string | Component
8
+ href?: string
9
+ command?: () => void
10
+ group?: string
11
+ expanded?: boolean
12
+ children?: SidebarLayoutMenuItem[]
13
+ actions?: SidebarLayoutMenuItem[]
14
+ }
15
+
16
+ export interface SidebarLayoutProps {
17
+ menus: SidebarLayoutMenuItem[]
18
+ /** Key of the selected item. Omitted → the active item is matched by route. */
19
+ active?: string
20
+ /** Placeholder shown when `menus` is empty. */
21
+ emptyText?: string
22
+ /** Fill the parent instead of the viewport: never collapses, no rail or mobile trigger. */
23
+ embedded?: boolean
24
+ variant?: 'sidebar' | 'floating' | 'inset'
25
+ /** Collapse behaviour of the sidebar. Ignored while `embedded`. */
26
+ collapsible?: 'offcanvas' | 'icon' | 'none'
27
+ /** Width of the sidebar, as a CSS length. */
28
+ sidebarWidth?: string
29
+ contentClass?: ClassValue
30
+ class?: ClassValue
31
+ }
@@ -0,0 +1,29 @@
1
+ import type { SidebarLayoutMenuItem } from './types'
2
+
3
+ /** Identity for key-based selection; an explicit `key` is only needed when neither fallback is unique. */
4
+ export function sidebarMenuItemKey (item: SidebarLayoutMenuItem): string {
5
+ return item.key ?? item.href ?? item.label
6
+ }
7
+
8
+ export function findSidebarMenuItem (
9
+ menus: SidebarLayoutMenuItem[],
10
+ key: string,
11
+ ): SidebarLayoutMenuItem | undefined {
12
+ for (const item of menus) {
13
+ if (sidebarMenuItemKey(item) === key) return item
14
+ const child = item.children && findSidebarMenuItem(item.children, key)
15
+ if (child) return child
16
+ }
17
+ return undefined
18
+ }
19
+
20
+ export function firstSidebarMenuItemKey (
21
+ menus: SidebarLayoutMenuItem[],
22
+ ): string | undefined {
23
+ for (const item of menus) {
24
+ if (!item.children?.length) return sidebarMenuItemKey(item)
25
+ const key = firstSidebarMenuItemKey(item.children)
26
+ if (key) return key
27
+ }
28
+ return undefined
29
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "noResults": "No results",
3
+ "searchPlaceholder": "Search"
4
+ }
@@ -0,0 +1,479 @@
1
+ import type { Meta, StoryObj } from '@storybook/vue3'
2
+ import type { SidebarLayoutMenuItem } from '../SidebarLayout/types'
3
+ import type { SidebarModalFilter } from './types'
4
+ import EventLog from '#storybook/EventLog.vue'
5
+ import { useArgsModel } from '#storybook/argsModel'
6
+ import Button from '../Button/index.vue'
7
+ import Icon from '../Icon/index.vue'
8
+ import Input from '../Input/index.vue'
9
+ import Switch from '../Switch/index.vue'
10
+ import SidebarModal from './index.vue'
11
+
12
+ const menus: SidebarLayoutMenuItem[] = [
13
+ { key: 'general', label: 'General', icon: 'settings', group: 'Settings' },
14
+ { key: 'account', label: 'Account', icon: 'circle-user', group: 'Settings' },
15
+ { key: 'usage', label: 'Usage', icon: 'chart-column', group: 'Settings' },
16
+ { key: 'capabilities', label: 'Capabilities', icon: 'briefcase-business', group: 'Settings' },
17
+ { key: 'appearance', label: 'Appearance', icon: 'monitor', group: 'Desktop app' },
18
+ { key: 'extensions', label: 'Extensions', icon: 'blocks', group: 'Desktop app' },
19
+ { key: 'developer', label: 'Developer', icon: 'wrench', group: 'Desktop app' },
20
+ { key: 'skills', label: 'Skills', icon: 'scroll-text', group: 'Customize' },
21
+ { key: 'connectors', label: 'Connectors', icon: 'plug', group: 'Customize' },
22
+ ]
23
+
24
+ const nestedMenus: SidebarLayoutMenuItem[] = [
25
+ { key: 'general', label: 'General', icon: 'settings' },
26
+ {
27
+ label: 'Workspace',
28
+ icon: 'building-2',
29
+ expanded: true,
30
+ children: [
31
+ { key: 'members', label: 'Members' },
32
+ { key: 'billing', label: 'Billing' },
33
+ ],
34
+ },
35
+ ]
36
+
37
+ const scrollingMenus: SidebarLayoutMenuItem[] = [
38
+ ...menus,
39
+ ...Array.from({ length: 12 }, (_, index) => ({
40
+ key: `plugin-${index + 1}`,
41
+ label: `Plugin ${index + 1}`,
42
+ icon: 'puzzle',
43
+ group: 'Plugins',
44
+ })),
45
+ ]
46
+
47
+ // The rows each pane renders, doubling as the index a business search would hit.
48
+ const paneContent: Record<string, string[]> = {
49
+ general: [ 'full name', 'email', 'notifications' ],
50
+ account: [ 'password', 'two-factor', 'sessions' ],
51
+ usage: [ 'quota', 'billing period' ],
52
+ capabilities: [ 'beta features' ],
53
+ appearance: [ 'theme', 'dark mode', 'font size' ],
54
+ extensions: [ 'browser extension' ],
55
+ developer: [ 'api key', 'webhooks' ],
56
+ skills: [ 'custom instructions' ],
57
+ connectors: [ 'google drive', 'slack' ],
58
+ }
59
+
60
+ const searchByContent: SidebarModalFilter = (items, keyword) => {
61
+ if (!keyword) return items
62
+ const needle = keyword.toLowerCase()
63
+ return items.filter(item => {
64
+ const key = item.key ?? item.label
65
+ return [ item.label, item.group, ...(paneContent[key] ?? []) ]
66
+ .join(' ')
67
+ .toLowerCase()
68
+ .includes(needle)
69
+ })
70
+ }
71
+
72
+ const generalPane = `
73
+ <template #general>
74
+ <div class="space-y-4">
75
+ <h2 class="text-lg font-semibold">Profile</h2>
76
+ <div class="divide-y divide-border">
77
+ <div class="flex items-center justify-between gap-4 py-4">
78
+ <span class="text-sm">Full name</span>
79
+ <Input class="max-w-64" modelValue="b.jj" />
80
+ </div>
81
+ <div class="flex items-center justify-between gap-4 py-4">
82
+ <span class="text-sm">Email</span>
83
+ <Input class="max-w-64" modelValue="b.jj@example.com" />
84
+ </div>
85
+ <div class="flex items-center justify-between gap-4 py-4">
86
+ <span class="text-sm">Email notifications</span>
87
+ <Switch :modelValue="true" />
88
+ </div>
89
+ </div>
90
+ </div>
91
+ </template>
92
+ `
93
+
94
+ const accountPane = `
95
+ <template #account>
96
+ <div class="space-y-4">
97
+ <h2 class="text-lg font-semibold">Account</h2>
98
+ <p class="text-sm text-muted-foreground">Manage the credentials used to sign in.</p>
99
+ <Button variant="outline" icon="lock-keyhole">Change password</Button>
100
+ </div>
101
+ </template>
102
+ `
103
+
104
+ const fallbackPane = `
105
+ <template #default="{ active, item }">
106
+ <div class="space-y-2">
107
+ <h2 class="text-lg font-semibold">{{ item?.label }}</h2>
108
+ <p class="text-sm text-muted-foreground">No pane is declared for "{{ active }}" yet.</p>
109
+ </div>
110
+ </template>
111
+ `
112
+
113
+ const scrollingPane = `
114
+ <template #general>
115
+ <div class="space-y-4">
116
+ <h2 class="text-lg font-semibold">Preferences</h2>
117
+ <div class="divide-y divide-border">
118
+ <div
119
+ v-for="i in 20"
120
+ :key="i"
121
+ class="flex items-center justify-between gap-4 py-4"
122
+ >
123
+ <span class="text-sm">Preference {{ i }}</span>
124
+ <Switch :modelValue="i % 2 === 0" />
125
+ </div>
126
+ </div>
127
+ </div>
128
+ </template>
129
+ `
130
+
131
+ const meta = {
132
+ title: 'UI/SidebarModal',
133
+ component: SidebarModal,
134
+ argTypes: {
135
+ menus: { control: 'object' },
136
+ visible: { control: 'boolean' },
137
+ active: { control: 'text' },
138
+ searchable: { control: 'boolean' },
139
+ search: { control: 'text' },
140
+ searchPlaceholder: { control: 'text' },
141
+ title: { control: 'text' },
142
+ modal: { control: 'boolean' },
143
+ showClose: { control: 'boolean' },
144
+ closeOnClickOutside: { control: 'boolean' },
145
+ sidebarWidth: { control: 'text' },
146
+ contentClass: { control: 'text' },
147
+ },
148
+ args: {
149
+ menus,
150
+ visible: false,
151
+ active: 'general',
152
+ searchable: true,
153
+ search: '',
154
+ searchPlaceholder: '',
155
+ title: 'Settings',
156
+ modal: true,
157
+ showClose: true,
158
+ closeOnClickOutside: false,
159
+ sidebarWidth: '',
160
+ contentClass: '',
161
+ },
162
+ render: args => {
163
+ const onUpdateVisible = useArgsModel('visible')
164
+ const onUpdateActive = useArgsModel('active')
165
+ const onUpdateSearch = useArgsModel('search')
166
+ return {
167
+ components: { SidebarModal, Button, Input, Switch },
168
+ setup: () => ({ args, onUpdateVisible, onUpdateActive, onUpdateSearch }),
169
+ // Opening through `#trigger` keeps the demo alive on the Docs page, where
170
+ // only the primary story's args round-trip; the emits still sync Controls.
171
+ template: `
172
+ <SidebarModal
173
+ v-bind="args"
174
+ @update:visible="onUpdateVisible"
175
+ @update:active="onUpdateActive"
176
+ @update:search="onUpdateSearch"
177
+ >
178
+ <template #trigger>
179
+ <Button>Open Settings</Button>
180
+ </template>
181
+
182
+ ${generalPane}
183
+ ${accountPane}
184
+ ${fallbackPane}
185
+ </SidebarModal>
186
+ `,
187
+ }
188
+ },
189
+ } satisfies Meta<typeof SidebarModal>
190
+
191
+ export default meta
192
+ type Story = StoryObj<typeof meta>
193
+
194
+ const noControls = { controls: { disable: true }} satisfies Story['parameters']
195
+
196
+ export const Default: Story = {}
197
+
198
+ export const WithoutSearch: Story = {
199
+ parameters: noControls,
200
+ args: {
201
+ searchable: false,
202
+ },
203
+ }
204
+
205
+ export const SearchPlaceholder: Story = {
206
+ parameters: noControls,
207
+ args: {
208
+ searchPlaceholder: 'Find a setting',
209
+ },
210
+ }
211
+
212
+ // A search flattens matched children so none stays hidden behind a closed parent.
213
+ // A `searchable` function owns the listing, so the keyword can be matched against
214
+ // pane content: "dark" surfaces Appearance even though no label contains it.
215
+ export const CustomSearch: Story = {
216
+ parameters: {
217
+ ...noControls,
218
+ docs: {
219
+ source: {
220
+ code: `
221
+ <template>
222
+ <SidebarModal
223
+ :menus="menus"
224
+ :searchable="searchByContent"
225
+ title="Settings"
226
+ >
227
+ <template #trigger>
228
+ <Button>Open Settings</Button>
229
+ </template>
230
+
231
+ <template #default="{ active, item }">
232
+ <h2 class="text-lg font-semibold">{{ item?.label }}</h2>
233
+ <div
234
+ v-for="row in paneContent[active]"
235
+ :key="row"
236
+ class="py-3 text-sm"
237
+ >
238
+ {{ row }}
239
+ </div>
240
+ </template>
241
+ </SidebarModal>
242
+ </template>
243
+
244
+ <script setup lang="ts">
245
+ // One source of truth: the rows a pane renders are the rows search matches.
246
+ const searchByContent: SidebarModalFilter = (items, keyword) => {
247
+ if (!keyword) return items
248
+ const needle = keyword.toLowerCase()
249
+ return items.filter(item => [ item.label, item.group, ...paneContent[item.key] ?? [] ]
250
+ .join(' ')
251
+ .toLowerCase()
252
+ .includes(needle))
253
+ }
254
+ </script>
255
+ `.trim(),
256
+ },
257
+ },
258
+ },
259
+ render: () => ({
260
+ components: { SidebarModal, Button },
261
+ setup: () => ({ menus, searchByContent, paneContent }),
262
+ template: `
263
+ <SidebarModal
264
+ :menus="menus"
265
+ :searchable="searchByContent"
266
+ title="Settings"
267
+ searchPlaceholder="Search settings or content"
268
+ >
269
+ <template #trigger>
270
+ <Button>Open Settings</Button>
271
+ </template>
272
+
273
+ <template #default="{ active, item }">
274
+ <div class="space-y-4">
275
+ <h2 class="text-lg font-semibold">{{ item?.label }}</h2>
276
+ <div class="divide-y divide-border">
277
+ <div
278
+ v-for="row in paneContent[active] || []"
279
+ :key="row"
280
+ class="py-3 text-sm capitalize"
281
+ >
282
+ {{ row }}
283
+ </div>
284
+ </div>
285
+ </div>
286
+ </template>
287
+ </SidebarModal>
288
+ `,
289
+ }),
290
+ }
291
+
292
+ export const NestedMenus: Story = {
293
+ parameters: noControls,
294
+ args: {
295
+ menus: nestedMenus,
296
+ active: 'members',
297
+ },
298
+ }
299
+
300
+ export const Sizing: Story = {
301
+ parameters: noControls,
302
+ args: {
303
+ sidebarWidth: '12rem',
304
+ contentClass: 'px-8 py-6',
305
+ class: 'sm:max-w-2xl h-[560px]',
306
+ },
307
+ }
308
+
309
+ // Both columns outgrow the dialog: the height stays capped and each side
310
+ // scrolls on its own, with the search field and the pane header staying put.
311
+ export const Scrolling: Story = {
312
+ parameters: {
313
+ ...noControls,
314
+ docs: {
315
+ source: {
316
+ code: `
317
+ <template>
318
+ <SidebarModal
319
+ :menus="menus"
320
+ title="Settings"
321
+ searchable
322
+ >
323
+ <template #trigger>
324
+ <Button>Open Settings</Button>
325
+ </template>
326
+
327
+ <template #general>
328
+ <div class="divide-y divide-border">
329
+ <div
330
+ v-for="i in 20"
331
+ :key="i"
332
+ class="flex items-center justify-between gap-4 py-4"
333
+ >
334
+ <span class="text-sm">Preference {{ i }}</span>
335
+ <Switch :modelValue="i % 2 === 0" />
336
+ </div>
337
+ </div>
338
+ </template>
339
+ </SidebarModal>
340
+ </template>
341
+ `.trim(),
342
+ },
343
+ },
344
+ },
345
+ render: () => ({
346
+ components: { SidebarModal, Button, Switch },
347
+ setup: () => ({ menus: scrollingMenus }),
348
+ template: `
349
+ <SidebarModal :menus="menus" title="Settings" searchable>
350
+ <template #trigger>
351
+ <Button>Open Settings</Button>
352
+ </template>
353
+
354
+ ${scrollingPane}
355
+
356
+ <template #default="{ item }">
357
+ <h2 class="text-lg font-semibold">{{ item?.label }}</h2>
358
+ </template>
359
+ </SidebarModal>
360
+ `,
361
+ }),
362
+ }
363
+
364
+ export const ClickOutsideToClose: Story = {
365
+ parameters: noControls,
366
+ args: {
367
+ showClose: false,
368
+ closeOnClickOutside: true,
369
+ },
370
+ }
371
+
372
+ export const NonModal: Story = {
373
+ parameters: noControls,
374
+ args: {
375
+ modal: false,
376
+ },
377
+ }
378
+
379
+ // The `#header` slot sits above the built-in search field rather than replacing it.
380
+ export const CustomHeader: Story = {
381
+ parameters: {
382
+ ...noControls,
383
+ docs: {
384
+ source: {
385
+ code: `
386
+ <template>
387
+ <SidebarModal
388
+ v-model:visible="visible"
389
+ :menus="menus"
390
+ title="Settings"
391
+ searchable
392
+ >
393
+ <template #header>
394
+ <div class="flex items-center gap-2 px-2 py-1">
395
+ <Icon name="building-2" />
396
+ <span class="text-base font-semibold">Acme Inc.</span>
397
+ </div>
398
+ </template>
399
+
400
+ <template #footer>
401
+ <Button
402
+ variant="ghost"
403
+ icon="log-out"
404
+ class="justify-start"
405
+ >
406
+ Sign out
407
+ </Button>
408
+ </template>
409
+
410
+ <template #default="{ item }">
411
+ <h2 class="text-lg font-semibold">{{ item?.label }}</h2>
412
+ </template>
413
+ </SidebarModal>
414
+ </template>
415
+ `.trim(),
416
+ },
417
+ },
418
+ },
419
+ render: () => ({
420
+ components: { SidebarModal, Button, Icon },
421
+ setup () {
422
+ const visible = ref(false)
423
+ return { visible, menus }
424
+ },
425
+ template: `
426
+ <div>
427
+ <Button @click="visible = true">Open Settings</Button>
428
+ <SidebarModal v-model:visible="visible" :menus="menus" title="Settings" searchable>
429
+ <template #header>
430
+ <div class="flex items-center gap-2 px-2 py-1">
431
+ <Icon name="building-2" />
432
+ <span class="text-base font-semibold">Acme Inc.</span>
433
+ </div>
434
+ </template>
435
+
436
+ <template #footer>
437
+ <Button variant="ghost" icon="log-out" class="justify-start">Sign out</Button>
438
+ </template>
439
+
440
+ <template #default="{ item }">
441
+ <h2 class="text-lg font-semibold">{{ item?.label }}</h2>
442
+ </template>
443
+ </SidebarModal>
444
+ </div>
445
+ `,
446
+ }),
447
+ }
448
+
449
+ export const EventHandling: Story = {
450
+ parameters: noControls,
451
+ render: () => ({
452
+ components: { SidebarModal, Button, EventLog },
453
+ setup () {
454
+ const visible = ref(false)
455
+ return { visible, menus }
456
+ },
457
+ template: `
458
+ <EventLog v-slot="{ record }">
459
+ <Button @click="visible = true">Open Settings</Button>
460
+ <SidebarModal
461
+ v-model:visible="visible"
462
+ :menus="menus"
463
+ title="Settings"
464
+ searchable
465
+ @open="record('open')"
466
+ @close="record('close')"
467
+ @closed="record('closed')"
468
+ @select="(item) => record('select', item.label)"
469
+ @update:active="(key) => record('update:active', key)"
470
+ @update:visible="(value) => record('update:visible', value)"
471
+ >
472
+ <template #default="{ item }">
473
+ <h2 class="text-lg font-semibold">{{ item?.label }}</h2>
474
+ </template>
475
+ </SidebarModal>
476
+ </EventLog>
477
+ `,
478
+ }),
479
+ }