@nice2dev/events 1.0.29 → 1.1.5

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,149 @@
1
1
  # @nice2dev/events — Changelog
2
2
 
3
+ ## 1.1.5
4
+
5
+ No changes in this release.
6
+
7
+ ## 1.1.0
8
+
9
+ ### Minor Changes
10
+
11
+ - Eight new event controls, covering the gaps OmniVerk raised for 1.0.32.
12
+
13
+ **New in `@nice2dev/events`**
14
+
15
+ - `NiceSeatingChart` / `NiceSeatPicker` — pick seats from a venue plan. SVG with
16
+ three levels of detail chosen from how many seats are actually in view, so the
17
+ number of DOM nodes stays bounded whatever the venue size. Pan, pinch-zoom and
18
+ a roving keyboard cursor, plus an always-present section → row → seat list with
19
+ "best available" — the path that actually works with a screen reader. Built on
20
+ the `SeatingChart` types that already shipped in `venue/venue-spatial.ts`.
21
+ - `NiceGiftRegistry` — gift registry and wishlist in one control (`kind`), with
22
+ group gifting, progress to goal and a guest mode that works with no signed-in
23
+ user.
24
+ - `NiceParticipantList` — guest roster with RSVP, check-in, grouping, search and
25
+ a paste-a-list invite box. Fills in the React component that the Angular, Vue
26
+ and Web Component adapters have been exporting a name for.
27
+ - `NiceRsvpControl` — yes / maybe / no with plus-ones, for a public invitation page.
28
+ - `NiceExpenseSplit` — who owes whom, reduced to few transfers. Integer
29
+ minor-unit arithmetic, so balances sum to exactly zero; currencies are grouped
30
+ rather than converted.
31
+ - `NiceInvitationDesigner` — invitation editor on `NiceHtmlEditor` with
32
+ `{{token}}` substitution, live preview and bulk send guarded by `sending`.
33
+ - `NiceMediaCollage` — arrange media into an ordered collage and play it back.
34
+ Drag or keyboard reordering via Pointer Events, so it works on touch.
35
+
36
+ **Changed**
37
+
38
+ - `NiceEventMedia` gains `onReorder`, and `EventMediaItem` gains `order`. Items
39
+ sort by `order` (falling back to array position); the component never keeps its
40
+ own copy of the sequence, so the view cannot drift from what was saved.
41
+ - `SeatSelectionConfig`: every field is now optional, plus new `adjacentOnly`
42
+ (refuse selections that strand a single seat) and `allowedCategories`. Widening
43
+ a type is safe for anyone constructing one; anyone _reading_ a
44
+ `SeatSelectionConfig` value must now handle `undefined`. The type had no
45
+ consumers in this repo, but it is public API, so it is called out here.
46
+ - `Seat` gains `accessType`. `SeatStatus` folds `'wheelchair'`/`'companion'` into
47
+ the same union as `'sold'`, so an accessible seat lost that fact the moment it
48
+ was booked. `accessType` is independent of availability; the old status values
49
+ keep working as an alias for an available accessible seat. The union itself is
50
+ unchanged.
51
+ - `@nice2dev/ui` ships `styles/controls-events.css` with the styles for the above.
52
+
53
+ ### Patch Changes
54
+
55
+ - Round-24 showcase-feedback fixes.
56
+
57
+ **@nice2dev/ui**
58
+
59
+ - **NiceDateRangeBox / NiceDateTimePicker.** Fix a real day/month transposition: the
60
+ keyboard `t`/Today shortcut (`writeDate`) built digits in ISO order but they were
61
+ interpreted in display order, so for a localized mask (`dd.MM.yyyy`) Today produced a
62
+ transposed value that then drove the other picker's greyed range. `writeDate` now builds
63
+ an ISO string and routes through the ISO-safe `applyIso`. The popup **Today/Now** buttons
64
+ are also disabled when today is outside `[min, max]`, instead of silently clamping to `min`.
65
+ - **NiceDateTimePicker (clock mode).** The highlight now rides the selected **hour number**
66
+ on the ring (not the hand tip); **both** hands are always drawn (active in the accent
67
+ colour, the other muted); and `minuteStep` (5/10/15/20/30) draws snap markers + labels and
68
+ clicks snap to them.
69
+ - **NiceTreeView.** New optional `header` prop rendered above the search box / tree.
70
+ - **NiceKanbanBoard.** New `collapseDirection: 'vertical' | 'horizontal'` prop (a short
71
+ horizontal bar as an alternative to the slim vertical rail); the collapsed count renders as
72
+ a one-line diagonal fraction (`2/3`).
73
+ - **NicePivotGridFieldChooser.** Working HTML5 drag-and-drop, `name (type)` field bars (new
74
+ `NicePivotField.dataType`), the per-field area buttons replaced by a `NiceSelect` gated
75
+ behind a new `showAreaSelect` prop, and a single-column layout so Filters no longer wraps.
76
+ - **NiceTabs.** New `countLocation: 'right' | 'bottom'` prop — `'bottom'` stacks a tab's
77
+ badge/count under the icon as a heavily-rounded pill.
78
+
79
+ **@nice2dev/icons** — geometry fixes across all variants: NtdBank (roof/columns lowered ~20%
80
+ and centred), NtdMusic (note heads meet stems flush), NtdHome (square floor + lower walls),
81
+ NtdPlanet (ring uses the secondary colour in solid/outline), NtdPizza (arc crust, not a
82
+ triangle), NtdDroplet (slimmer profiled sides), NtdHexagon & NtdSend (sharp, not rounded).
83
+
84
+ **@nice2dev/events** — NiceEventPlanning grows from 6 to 10 tabs (Schedule, Tasks, Vendors,
85
+ Documents), each optional tab hideable via a `show*` boolean prop, plus a `countLocation`
86
+ prop (`'bottom'` default | `'right'`) forwarded to NiceTabs.
87
+
88
+ **@nice2dev/ui-api** — NiceAPIDesigner rebuilt on Nice controls with real, editable Paths /
89
+ Schemas / Security editors and a seeded Pet-Store example so it opens populated.
90
+
91
+ **@nice2dev/ui-graphics** — NicePixelEditor: the right settings panel folds into collapsible
92
+ NiceCollapse sections, the top menu into NiceMenu dropdowns, and the active tool now has a
93
+ clearly-visible highlight.
94
+
95
+ ## 1.0.30
96
+
97
+ ### Patch Changes
98
+
99
+ - 3e794cc: Round-15 showcase-feedback fixes across ~23 controls (several re-opens of round 14).
100
+
101
+ **Real bugs**
102
+ - **NicePixelEditor** — the work-area canvas mounted at 0px (`.canvasContainer flex:1`
103
+ is inert inside the block `.nice-app-shell__content`); `height:100%` gives it size so
104
+ tools + drawing work.
105
+ - **NiceKanbanBoard** — a collapsed column no longer rotates its title
106
+ (`writing-mode:vertical-rl` removed, title hidden); it just collapses to a 44px strip.
107
+ - **NiceUserMenu** — the body-portalled dropdown now carries the theme (`scopeThemeClass`)
108
+ instead of always rendering light.
109
+ - **NiceMenu** — `size` now scales the leading icon (svg `em`, like NiceButton); `loading`
110
+ implemented (dim + spinner + inert).
111
+ - **NiceLookup** — `readOnly` hides the chevron; loading / errorPlacement=right /
112
+ labelPlacement=left no longer squeeze the value — the field is `fit-content` with a
113
+ min-width on the value area so those extend it instead of subdividing a fixed 220px.
114
+ - **NiceTreeSelect** — clicking a branch drills in (expand/collapse) instead of committing
115
+ the parent + closing; the expand chevron lost its stray UA button border.
116
+ - **NiceTreeGrid** — STATE toggles no longer change the control width; the dead `compact`
117
+ (missing base `nice-table` class) works; new `size` density.
118
+ - **NiceDateTimePicker** — the popup's time `<select>`s are replaced by vertical typable
119
+ spinners (▲/input/▼, wrap + minuteStep + arrows); the popup portals into the theme host
120
+ (`portalTarget`) so **every** named theme renders (not just light/dark); the showcase
121
+ translator now chains to the library dictionary so the footer (and every library key)
122
+ translates.
123
+
124
+ **New / additive props**
125
+ - **NiceAutocomplete** — `showAll` (default true): focusing opens the dropdown with all
126
+ options sorted alphabetically.
127
+ - **NiceCard / NiceCardGroup / NiceSpreadsheet / NiceActionSheet / NiceBottomSheet** — gain
128
+ `disabled`/`readOnly`/`loading`/`error` STATE and a dimensional `size`. NiceCard's demo is
129
+ a single card with every prop on the bar; NiceCardGroup's radio mode is opt-in (default
130
+ plain cards).
131
+ - **NiceDataGrid** — top-level `disabled`/`readOnly`/`error`; the demo puts `size` on the
132
+ Size bar + adds the State bar (the Filter button was already icon-only).
133
+ - **NiceTabs** — `iconOnly` (labels → tooltip) and `centered` (`true`|`false`|`'auto'`).
134
+ **NiceEventPlanning** exposes `tabsIconOnly` (default true) + `tabsCentered`.
135
+ - **NiceKaraokeUploader** — rebuilt on **NiceUpload** (accept `.txt`, `maxFileSize`,
136
+ `validateFile` rejects non-.txt / empty); the UltraStar parse is unchanged.
137
+
138
+ **Demo / config**
139
+ - NiceForm (seeded fields + right-aligned Age stepper), NiceTopNav (seeded theme picker),
140
+ NiceTable (Role column sortable), NiceDateRangeBox (errorPlacement moved to the ⚙ panel),
141
+ NiceUpload (empty-label dropzone is a deterministic square). **NiceDropDownBox** kept — its
142
+ demo now explains it vs NiceSelect / NiceLookup.
143
+
144
+ (NiceCardView removal + NiceColorPalette redesign + NiceKaraokeSongBrowser navigation are in
145
+ `fb-round15-big3.md`.)
146
+
3
147
  ## 1.0.29
4
148
 
5
149
  ### Patch Changes
package/README.md CHANGED
@@ -18,16 +18,38 @@ npm install @nice2dev/events
18
18
 
19
19
  ## Components
20
20
 
21
- | Component | Category | Description |
22
- | ---------------------- | ----------- | ----------------------------------------------------- |
23
- | `NiceEventMedia` | Content | Media gallery with upload, photos, and collages |
24
- | `NiceEventPlanning` | Planning | Event planning with dates, location, surveys, billing |
25
- | `NiceRoundList` | Rounds | Round system list with status and scoring |
26
- | `NiceRoundCard` | Rounds | Individual round card with actions, timer, scoreboard |
27
- | `NiceSongPicker` | Music | Song selection for music events |
28
- | `NiceKaraokePicker` | Music | Karaoke song picker with queue management |
29
- | `NiceAttractionPicker` | Attractions | Attraction selection grid with categories |
30
- | `NiceAttractionVoting` | Attractions | Anonymous voting on attractions |
21
+ | Component | Category | Description |
22
+ | ------------------------ | ----------- | ----------------------------------------------------- |
23
+ | `NiceEventMedia` | Content | Media gallery with upload, photos, and collages |
24
+ | `NiceEventPlanning` | Planning | Event planning with dates, location, surveys, billing |
25
+ | `NiceRoundList` | Rounds | Round system list with status and scoring |
26
+ | `NiceRoundCard` | Rounds | Individual round card with actions, timer, scoreboard |
27
+ | `NiceSongPicker` | Music | Song selection for music events |
28
+ | `NiceKaraokePicker` | Music | Karaoke song picker with queue management |
29
+ | `NiceAttractionPicker` | Attractions | Attraction selection grid with categories |
30
+ | `NiceAttractionVoting` | Attractions | Anonymous voting on attractions |
31
+ | `NiceMediaCollage` | Content | Ordered photo/video collage with slideshow playback |
32
+ | `NiceParticipantList` | Guests | Guest roster with RSVP, check-in, grouping and search |
33
+ | `NiceRsvpControl` | Guests | Yes/maybe/no reply with plus-ones, for a public page |
34
+ | `NiceSeatingChart` | Seating | Venue seating plan with level-of-detail rendering |
35
+ | `NiceSeatPicker` | Seating | Buy-a-ticket seat selection with an accessible list |
36
+ | `NiceExpenseSplit` | Money | Shared expenses, balances and a settlement plan |
37
+ | `NiceGiftRegistry` | Gifts | Gift registry / wishlist with group gifting |
38
+ | `NiceInvitationDesigner` | Invitations | Invitation editor with token preview and bulk send |
39
+
40
+ ### Notes on a few of these
41
+
42
+ - **`NiceSeatingChart`** picks its detail level from how many seats are actually in view —
43
+ sections when zoomed out, row strips in between, individual seats up close — so the number of
44
+ rendered nodes stays bounded whatever the venue size. Keep `showList` on for ticket sales: the
45
+ non-visual section → row → seat picker is the only workable path with a screen reader.
46
+ - **`NiceGiftRegistry`** covers both a registry and a wishlist via `kind`. The prop is `kind`, not
47
+ `variant`, because `variant` already means colour intent across the library.
48
+ - **`NiceExpenseSplit`** runs on integer minor units, so balances sum to exactly zero. Different
49
+ currencies are grouped and settled separately, never converted. `BillingItem.isPaid` means the
50
+ vendor was paid — not that the group settled up — so it does not affect balances.
51
+ - **Public pages:** `NiceGiftRegistry`, `NiceParticipantList` and `NiceRsvpControl` all work with no
52
+ signed-in user. An anonymous guest types a name, which arrives as `userName` with no `userId`.
31
53
 
32
54
  ## Types & Interfaces
33
55
 
@@ -37,6 +59,15 @@ npm install @nice2dev/events
37
59
  - `EventAttraction` — Attraction with voting
38
60
  - `EventService` — Abstract API interface for backend integration
39
61
  - `ChatMessage`, `SongEntry`, `KaraokeSong`, `BillingItem`, `EventSurvey`, `EventMediaItem`
62
+ - `NiceGiftRegistryItem`, `NiceGiftContribution` — gift registry / wishlist entries
63
+ - `NiceSettlementTransfer`, `NiceParticipantBalance`, `NiceExpenseIssue` — expense settlement
64
+ - `NiceRsvpAnswer`, `NiceRsvpSelection` — RSVP replies
65
+ - `NiceCollageItem`, `NiceMediaCollageLayout` — collage tiles
66
+ - `SeatingChart`, `SeatingSection`, `Seat`, `SeatStatus`, `SeatSelectionConfig` — venue seating
67
+ (re-exported from `venue/venue-spatial`)
68
+
69
+ > ⚠ `ZoneOccupancy` is exported by both this package and `@nice2dev/ui-buildings`, with different
70
+ > shapes. If you import both, use a namespace import to disambiguate.
40
71
 
41
72
  ## Usage
42
73
 
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("@nice2dev/icons"),o=require("@nice2dev/ui"),i=require("react"),A=require("@nice2dev/ui-core"),Pe=({item:w})=>{const[_,C]=i.useState(!1),t=w.thumbnailUrl??w.url;return w.type==="video"?e.jsx("div",{className:"nice-event-media__video-thumb",children:e.jsx(y.NtdPlay,{size:26})}):_||!t?e.jsx("div",{className:"nice-event-media__broken",title:"Image unavailable",children:e.jsx(y.NtdImage,{size:24})}):e.jsx("img",{src:t,alt:w.caption??"",className:"nice-event-media__thumb",loading:"lazy",onError:()=>C(!0)})},Ee=i.forwardRef(function(_,C){const{items:t,onUpload:p,onDelete:h,onLike:m,onItemClick:v,layout:j="grid",uploadEnabled:b=!0,typeFilter:N="all",className:x,style:f}=_,[r,d]=i.useState(""),k=i.useMemo(()=>N==="all"?t:t.filter(u=>u.type===N),[t,N]),g=u=>{const n=u[0];!n||!p||(p(n,r.trim()||void 0),d(""))},S=j==="list";return e.jsxs("div",{ref:C,className:`nice-event-media nice-event-media--${j} ${x??""}`,style:f,children:[e.jsx("div",{className:"nice-event-media__header",children:e.jsxs("h3",{children:["Media (",k.length,")"]})}),b&&p&&e.jsxs("div",{className:"nice-event-media__upload",children:[e.jsx(o.NiceUpload,{accept:"image/*,video/*",multiple:!1,imagePreview:!1,onFilesSelected:g}),e.jsx(o.NiceTextInput,{value:r,onChange:d,placeholder:"Add a caption…"})]}),k.length===0?e.jsx("p",{className:"nice-event-media__empty",children:"No media yet."}):e.jsx(o.NiceCardGroup,{columns:S?1:void 0,minColumnWidth:200,gap:12,align:"stretch",children:k.map(u=>e.jsxs("div",{className:`nice-event-media__card${S?" nice-event-media__card--row":""}`,onClick:()=>v==null?void 0:v(u),role:v?"button":void 0,tabIndex:v?0:void 0,children:[e.jsx(Pe,{item:u}),e.jsxs("div",{className:"nice-event-media__body",children:[u.caption&&e.jsx("span",{className:"nice-event-media__caption",children:u.caption}),u.uploadedByName&&e.jsx("span",{className:"nice-event-media__uploader",children:u.uploadedByName}),e.jsxs("div",{className:"nice-event-media__actions",children:[m&&e.jsxs("button",{type:"button",className:"nice-event-media__action",onClick:n=>{n.stopPropagation(),m(u.id)},"aria-label":"Like",children:[e.jsx(y.NtdHeart,{size:15})," ",u.likes??0]}),h&&e.jsx("button",{type:"button",className:"nice-event-media__action nice-event-media__action--danger",onClick:n=>{n.stopPropagation(),h(u.id)},"aria-label":"Delete",children:e.jsx(y.NtdTrash,{size:15})})]})]})]},u.id))})]})});function Q(w){const _=w.toLowerCase();return["active","live","published","completed","confirmed"].includes(_)?"success":["cancelled","canceled","rejected","failed"].includes(_)?"error":["scheduled","pending","planning"].includes(_)?"info":["draft","archived"].includes(_)?"secondary":"warning"}const $e={micro:[],compact:["details","location","budget"],normal:["details","location","participants","surveys","budget"],full:["details","location","participants","surveys","budget","settings"]},Oe=i.forwardRef(function(_,C){var X,Z,ee,ne,te,se;const{event:t,participants:p=[],surveys:h=[],billing:m=[],displayMode:v="normal",tabs:j,activeTab:b,onTabChange:N,editable:x=!1,onSave:f,onPublish:r,onShare:d,onExport:k,onUpdateEvent:g,onUpdateLocation:S,onAddSurvey:u,onSurveyRespond:n,onAddBilling:l,className:s,style:I}=_,[c,z]=i.useState(t.title),[T,M]=i.useState(t.description??""),[E,ae]=i.useState(t.startDate??""),[$,ce]=i.useState(t.endDate??""),[O,re]=i.useState(((X=t.location)==null?void 0:X.name)??""),[V,le]=i.useState(((Z=t.location)==null?void 0:Z.address)??""),[D,oe]=i.useState(((ee=t.location)==null?void 0:ee.virtualUrl)??""),[P,de]=i.useState(((ne=t.location)==null?void 0:ne.isVirtual)??!1),[B,G]=i.useState(""),[q,ue]=i.useState("single"),[U,H]=i.useState(""),[L,K]=i.useState(""),[W,Y]=i.useState(""),[F,me]=i.useState("PLN"),J=j??$e[v],[pe,he]=i.useState(J[0]??"details"),xe=b??pe,ve=i.useCallback(a=>{const R=a;b===void 0&&he(R),N==null||N(R)},[b,N]),ge=i.useCallback(()=>{g==null||g({title:c,description:T||void 0,startDate:E||void 0,endDate:$||void 0})},[c,T,E,$,g]),je=i.useCallback(()=>{S==null||S({name:O,address:V||void 0,virtualUrl:D||void 0,isVirtual:P})},[O,V,D,P,S]),Ne=i.useCallback(()=>{if(!B.trim()||!u)return;const a=U.split(",").map(R=>R.trim()).filter(Boolean);u(B.trim(),q,a.length>0?a:void 0),G(""),H("")},[B,q,U,u]),fe=i.useCallback(()=>{!L.trim()||!l||(l({label:L.trim(),amount:parseFloat(W)||0,currency:F}),K(""),Y(""))},[L,W,F,l]),ye=i.useMemo(()=>m.map(a=>({label:a.label,amount:a.amount})),[m]),_e=i.useMemo(()=>m.reduce((a,R)=>a+R.amount,0),[m]),be=((te=m[0])==null?void 0:te.currency)??"PLN",ke=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(o.NiceTextInput,{label:"Title",value:c,onChange:z,readOnly:!x}),e.jsx(o.NiceTextArea,{label:"Description",value:T,onChange:M,readOnly:!x,rows:3}),e.jsxs("div",{className:"nice-event-planning__row",children:[e.jsxs("label",{className:"nice-field",children:[e.jsx("span",{className:"nice-field__label",children:"Start"}),e.jsx("input",{className:"nice-input",type:"datetime-local",value:E,onChange:a=>ae(a.target.value),readOnly:!x})]}),e.jsxs("label",{className:"nice-field",children:[e.jsx("span",{className:"nice-field__label",children:"End"}),e.jsx("input",{className:"nice-input",type:"datetime-local",value:$,onChange:a=>ce(a.target.value),readOnly:!x})]})]}),x&&e.jsx(o.NiceButton,{variant:"primary",leftIcon:e.jsx(A.NiceIcon,{name:"check",size:"sm"}),onClick:ge,children:"Save details"})]}),Se=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(o.NiceToggle,{label:"Virtual event",checked:P,onChange:de,disabled:!x}),e.jsx(o.NiceTextInput,{label:"Venue name",value:O,onChange:re,readOnly:!x}),P?e.jsx(o.NiceTextInput,{label:"Virtual URL",value:D,onChange:oe,readOnly:!x}):e.jsx(o.NiceTextInput,{label:"Address",value:V,onChange:le,readOnly:!x}),x&&e.jsx(o.NiceButton,{variant:"primary",leftIcon:e.jsx(A.NiceIcon,{name:"check",size:"sm"}),onClick:je,children:"Save location"})]}),Ce=e.jsx("div",{className:"nice-event-planning__participants",children:p.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No participants yet."}):e.jsxs(e.Fragment,{children:[e.jsx(o.NiceAvatarGroup,{max:8,children:p.map(a=>e.jsx(o.NiceAvatar,{name:a.name,src:a.avatarUrl},a.id))}),e.jsx("ul",{className:"nice-event-planning__participant-list",children:p.map(a=>e.jsxs("li",{className:"nice-event-planning__participant",children:[e.jsx(o.NiceAvatar,{name:a.name,src:a.avatarUrl,size:"sm"}),e.jsx("span",{className:"nice-event-planning__participant-name",children:a.name}),e.jsx(o.NiceBadge,{size:"xs",subtle:!0,variant:Q(a.status),children:a.status})]},a.id))})]})}),we=e.jsxs("div",{className:"nice-event-planning__form",children:[h.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No surveys yet."}):h.map(a=>e.jsxs("div",{className:"nice-event-planning__survey",children:[e.jsx("strong",{children:a.question})," ",e.jsx(o.NiceBadge,{size:"xs",outline:!0,variant:"info",children:a.type}),a.options&&e.jsx("div",{className:"nice-event-planning__survey-options",children:a.options.map((R,Me)=>e.jsx(o.NiceButton,{size:"sm",variant:"outline",onClick:()=>n==null?void 0:n(a.id,R),children:R},Me))}),a.responses&&e.jsxs("span",{className:"nice-event-planning__muted",children:[a.responses.length," responses"]})]},a.id)),x&&u&&e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(o.NiceTextInput,{label:"New survey question",value:B,onChange:G,placeholder:"Question"}),e.jsx(o.NiceSelect,{label:"Type",value:q,onChange:a=>ue(a),options:[{value:"single",label:"Single choice"},{value:"multiple",label:"Multiple choice"},{value:"text",label:"Free text"},{value:"rating",label:"Rating"}]}),e.jsx(o.NiceTextInput,{label:"Options (comma-separated)",value:U,onChange:H,placeholder:"Yes, No, Maybe"}),e.jsx(o.NiceButton,{variant:"primary",leftIcon:e.jsx(A.NiceIcon,{name:"plus",size:"sm"}),onClick:Ne,disabled:!B.trim(),children:"Add survey"})]})]}),Ie=e.jsxs("div",{className:"nice-event-planning__form",children:[m.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No billing items yet."}):e.jsx(o.NiceAmountBreakdown,{lines:[...ye,{label:"Total",amount:_e,isSummary:!0}],currency:be}),x&&l&&e.jsxs("div",{className:"nice-event-planning__row",children:[e.jsx(o.NiceTextInput,{label:"Item",value:L,onChange:K,placeholder:"Catering"}),e.jsx(o.NiceTextInput,{label:"Amount",value:W,onChange:Y,placeholder:"0.00"}),e.jsx(o.NiceSelect,{label:"Currency",value:F,onChange:a=>me(a),options:["PLN","EUR","USD","GBP"]}),e.jsx(o.NiceButton,{variant:"primary",leftIcon:e.jsx(A.NiceIcon,{name:"plus",size:"sm"}),onClick:fe,disabled:!L.trim(),children:"Add"})]})]}),ze=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(o.NiceToggle,{label:"Public event",checked:t.isPublic??!1,disabled:!x}),e.jsx(o.NiceTextInput,{label:"Max participants",value:t.maxParticipants!=null?String(t.maxParticipants):"",onChange:()=>{},readOnly:!x}),e.jsxs("div",{className:"nice-event-planning__muted",children:["Host: ",t.hostName," · Created ",new Date(t.createdAt).toLocaleDateString()]})]}),Ae={details:ke,location:Se,participants:Ce,surveys:we,budget:Ie,settings:ze},Te={details:"file",location:"home",participants:"users",surveys:"clipboard",budget:"file",settings:"settings"},Re={participants:p.length||void 0,surveys:h.length||void 0,budget:m.length||void 0},Be=J.map(a=>({id:a,label:a.charAt(0).toUpperCase()+a.slice(1),icon:e.jsx(A.NiceIcon,{name:Te[a],size:"sm"}),badge:Re[a],content:Ae[a]})),Le=e.jsxs("div",{className:"nice-event-planning__toolbar",children:[e.jsxs("div",{className:"nice-event-planning__toolbar-title",children:[e.jsx(A.NiceIcon,{name:"calendar",size:"md"}),e.jsx("span",{className:"nice-event-planning__title",children:t.title}),e.jsx(o.NiceBadge,{size:"sm",variant:Q(t.status),children:t.status})]}),e.jsx("span",{className:"nice-event-planning__toolbar-spacer"}),e.jsxs("div",{className:"nice-event-planning__toolbar-actions",children:[f&&e.jsx(o.NiceButton,{size:"sm",variant:"primary",leftIcon:e.jsx(A.NiceIcon,{name:"check",size:"sm"}),onClick:()=>f({title:c,description:T}),children:"Save"}),r&&e.jsx(o.NiceButton,{size:"sm",variant:"success",leftIcon:e.jsx(A.NiceIcon,{name:"upload",size:"sm"}),onClick:r,children:"Publish"}),d&&e.jsx(o.NiceButton,{size:"sm",variant:"ghost",leftIcon:e.jsx(A.NiceIcon,{name:"link",size:"sm"}),onClick:d,children:"Share"}),k&&e.jsx(o.NiceButton,{size:"sm",variant:"ghost",leftIcon:e.jsx(A.NiceIcon,{name:"download",size:"sm"}),onClick:k,children:"Export"})]})]});return v==="micro"?e.jsx("div",{ref:C,className:`nice-event-planning nice-event-planning--micro ${s??""}`,style:I,children:e.jsxs("div",{className:"nice-event-planning__micro",children:[e.jsx(A.NiceIcon,{name:"calendar",size:"md"}),e.jsxs("div",{className:"nice-event-planning__micro-body",children:[e.jsx("span",{className:"nice-event-planning__title",children:t.title}),e.jsxs("span",{className:"nice-event-planning__muted",children:[t.startDate?new Date(t.startDate).toLocaleString():"No date",(se=t.location)!=null&&se.name?` · ${t.location.name}`:""]})]}),e.jsx(o.NiceBadge,{size:"sm",variant:Q(t.status),children:t.status}),p.length>0&&e.jsx(o.NiceAvatarGroup,{max:4,size:"sm",children:p.map(a=>e.jsx(o.NiceAvatar,{name:a.name,src:a.avatarUrl,size:"sm"},a.id))})]})}):e.jsxs("div",{ref:C,className:`nice-event-planning nice-event-planning--${v} ${s??""}`,style:I,children:[Le,e.jsx(o.NiceTabs,{tabs:Be,activeTab:xe,onChange:ve})]})}),Ve={upcoming:"⏳",active:"▶️",voting:"🗳️",scored:"📊",completed:"✅",skipped:"⏭️"},De={upcoming:"#9ca3af",active:"#22c55e",voting:"#eab308",scored:"#3b82f6",completed:"#6b7280",skipped:"#d1d5db"},qe=i.forwardRef(function(_,C){const{rounds:t,activeRoundId:p,onSelect:h,onStart:m,onEnd:v,onCreate:j,editable:b=!1,className:N,style:x}=_,f=[...t].sort((r,d)=>r.order-d.order);return e.jsxs("div",{ref:C,className:`nice-round-list ${N??""}`,style:x,children:[e.jsxs("div",{className:"nice-round-list__header",children:[e.jsxs("h3",{children:["Rounds (",t.length,")"]}),b&&j&&e.jsx("button",{onClick:j,children:"+ Add Round"})]}),f.length===0?e.jsx("p",{className:"nice-round-list__empty",children:"No rounds yet."}):e.jsx("div",{className:"nice-round-list__items",children:f.map(r=>{const d=r.id===p;return e.jsxs("div",{className:`nice-round-list__item ${d?"nice-round-list__item--active":""}`,onClick:()=>h==null?void 0:h(r),role:h?"button":void 0,tabIndex:h?0:void 0,children:[e.jsxs("span",{className:"nice-round-list__order",children:["#",r.order]}),e.jsx("span",{className:"nice-round-list__icon",children:Ve[r.status]}),e.jsxs("div",{className:"nice-round-list__info",children:[e.jsx("strong",{className:"nice-round-list__name",children:r.name}),r.description&&e.jsx("small",{children:r.description}),r.type&&e.jsx("span",{className:"nice-round-list__type",children:r.type})]}),e.jsx("span",{className:"nice-round-list__status",style:{color:De[r.status]},children:r.status}),r.durationMinutes&&e.jsxs("span",{className:"nice-round-list__duration",children:[r.durationMinutes,"m"]}),r.winnerIds&&r.winnerIds.length>0&&e.jsxs("span",{className:"nice-round-list__winners",children:["🏆 ",r.winnerIds.length]}),b&&e.jsxs("div",{className:"nice-round-list__actions",onClick:k=>k.stopPropagation(),children:[r.status==="upcoming"&&m&&e.jsx("button",{onClick:()=>m(r.id),children:"Start"}),(r.status==="active"||r.status==="voting")&&v&&e.jsx("button",{onClick:()=>v(r.id),children:"End"})]})]},r.id)})})]})}),Ue=i.forwardRef(function(_,C){const{round:t,timerRunning:p=!1,remainingSeconds:h,onSubmitScore:m,onStart:v,onEnd:j,onSkip:b,editable:N=!1,footerActions:x,className:f,style:r}=_,[d,k]=i.useState({}),g=i.useCallback(n=>{const l=parseFloat(d[n]??"");isNaN(l)||!m||(m(n,l),k(s=>({...s,[n]:""})))},[d,m]),S=n=>{const l=Math.floor(n/60),s=n%60;return`${l}:${s.toString().padStart(2,"0")}`},u=t.scores?[...t.scores].sort((n,l)=>l.score-n.score):[];return e.jsxs("div",{ref:C,className:`nice-round-card nice-round-card--${t.status} ${f??""}`,style:r,children:[e.jsxs("div",{className:"nice-round-card__header",children:[e.jsxs("span",{className:"nice-round-card__order",children:["Round #",t.order]}),e.jsx("h3",{className:"nice-round-card__name",children:t.name}),e.jsx("span",{className:"nice-round-card__status",children:t.status})]}),t.description&&e.jsx("p",{className:"nice-round-card__description",children:t.description}),(p||h!=null)&&e.jsxs("div",{className:`nice-round-card__timer ${p?"nice-round-card__timer--running":""}`,children:["⏱️ ",h!=null?S(h):"—"]}),u.length>0&&e.jsxs("div",{className:"nice-round-card__scoreboard",children:[e.jsx("h4",{children:"Scoreboard"}),e.jsxs("table",{className:"nice-round-card__scores-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Participant"}),e.jsx("th",{children:"Score"})]})}),e.jsx("tbody",{children:u.map((n,l)=>e.jsxs("tr",{className:l<3?`nice-round-card__top-${l+1}`:"",children:[e.jsxs("td",{children:[n.rank??l+1,l===0?" 🥇":l===1?" 🥈":l===2?" 🥉":""]}),e.jsx("td",{children:n.participantName}),e.jsx("td",{children:n.score})]},n.participantId))})]})]}),m&&(t.status==="active"||t.status==="voting")&&u.length>0&&e.jsxs("div",{className:"nice-round-card__score-input",children:[e.jsx("h4",{children:"Submit Scores"}),u.map(n=>e.jsxs("div",{className:"nice-round-card__score-row",children:[e.jsx("span",{children:n.participantName}),e.jsx("input",{type:"number",value:d[n.participantId]??"",onChange:l=>k(s=>({...s,[n.participantId]:l.target.value})),min:0,step:1,placeholder:"Score"}),e.jsx("button",{onClick:()=>g(n.participantId),children:"Submit"})]},n.participantId))]}),e.jsxs("div",{className:"nice-round-card__footer",children:[N&&e.jsxs("div",{className:"nice-round-card__actions",children:[t.status==="upcoming"&&v&&e.jsx("button",{onClick:v,children:"▶ Start Round"}),(t.status==="active"||t.status==="voting")&&j&&e.jsx("button",{onClick:j,children:"⏹ End Round"}),t.status==="upcoming"&&b&&e.jsx("button",{onClick:b,children:"⏭ Skip"})]}),x]}),t.winnerIds&&t.winnerIds.length>0&&e.jsxs("div",{className:"nice-round-card__winners",children:["🏆 Winners: ",t.winnerIds.length]})]})}),We=i.forwardRef(function(_,C){const{songs:t,onAdd:p,onRemove:h,onVote:m,onSearch:v,showQueue:j=!0,readOnly:b=!1,className:N,style:x}=_,[f,r]=i.useState(""),d=i.useMemo(()=>{if(!f.trim())return t;const n=f.toLowerCase();return t.filter(l=>l.title.toLowerCase().includes(n)||l.artist.toLowerCase().includes(n))},[t,f]),k=i.useMemo(()=>t.filter(n=>n.isQueued),[t]),g=t.find(n=>n.isPlaying),S=n=>{r(n),v==null||v(n)},u=n=>{if(!n)return"";const l=Math.floor(n/60),s=n%60;return`${l}:${s.toString().padStart(2,"0")}`};return e.jsxs("div",{ref:C,className:`nice-song-picker ${N??""}`,style:x,children:[g&&e.jsxs("div",{className:"nice-song-picker__now-playing",children:[e.jsx("span",{className:"nice-song-picker__np-label",children:"🎵 Now Playing"}),g.albumArt&&e.jsx("img",{src:g.albumArt,alt:"",className:"nice-song-picker__album-art"}),e.jsx("strong",{children:g.title}),e.jsx("span",{children:g.artist})]}),e.jsx("input",{type:"text",value:f,onChange:n=>S(n.target.value),placeholder:"Search songs…",className:"nice-song-picker__search"}),e.jsx("div",{className:"nice-song-picker__list",children:d.length===0?e.jsx("p",{className:"nice-song-picker__empty",children:"No songs found."}):d.map(n=>e.jsxs("div",{className:`nice-song-picker__item ${n.isPlaying?"nice-song-picker__item--playing":""}`,children:[n.albumArt&&e.jsx("img",{src:n.albumArt,alt:"",className:"nice-song-picker__thumb"}),e.jsxs("div",{className:"nice-song-picker__info",children:[e.jsx("strong",{children:n.title}),e.jsx("span",{children:n.artist}),n.duration&&e.jsx("span",{className:"nice-song-picker__duration",children:u(n.duration)}),n.addedByName&&e.jsxs("small",{children:["Added by ",n.addedByName]})]}),!b&&e.jsxs("div",{className:"nice-song-picker__actions",children:[m&&e.jsxs("button",{onClick:()=>m(n.id),children:["👍 ",n.votes??0]}),p&&!n.isQueued&&e.jsx("button",{onClick:()=>p(n.id),children:"+ Queue"}),h&&n.isQueued&&e.jsx("button",{onClick:()=>h(n.id),children:"Remove"})]})]},n.id))}),j&&k.length>0&&e.jsxs("div",{className:"nice-song-picker__queue",children:[e.jsxs("h4",{children:["Queue (",k.length,")"]}),k.map((n,l)=>e.jsxs("div",{className:"nice-song-picker__queue-item",children:[e.jsxs("span",{className:"nice-song-picker__queue-pos",children:[l+1,"."]}),e.jsxs("span",{children:[n.title," — ",n.artist]})]},n.id))]})]})}),Fe=i.forwardRef(function(_,C){const{songs:t,queue:p=[],onEnqueue:h,onDequeue:m,onNext:v,nowPlayingId:j,readOnly:b=!1,className:N,style:x}=_,[f,r]=i.useState(""),[d,k]=i.useState(""),g=t.find(s=>s.id===j),S=i.useMemo(()=>{let s=t;if(f.trim()){const I=f.toLowerCase();s=s.filter(c=>c.title.toLowerCase().includes(I)||c.artist.toLowerCase().includes(I))}return d&&(s=s.filter(I=>I.difficulty===d)),s},[t,f,d]),u=i.useMemo(()=>new Set(p.map(s=>s.id)),[p]),n=["easy","medium","hard","expert"],l=s=>{switch(s){case"easy":return"#4caf50";case"medium":return"#ff9800";case"hard":return"#f44336";case"expert":return"#9c27b0";default:return"#999"}};return e.jsxs("div",{ref:C,className:`nice-karaoke-picker ${N??""}`,style:x,children:[g&&e.jsxs("div",{className:"nice-karaoke-picker__now-singing",style:{borderLeft:"4px solid #e91e63",padding:"12px",marginBottom:12,background:"#fce4ec"},children:[e.jsx("span",{style:{fontWeight:600},children:"🎤 Now Singing"}),e.jsxs("div",{children:[e.jsx("strong",{children:g.title})," — ",g.artist,g.performerName&&e.jsxs("span",{children:[" (by ",g.performerName,")"]})]}),!b&&v&&e.jsx("button",{onClick:v,style:{marginTop:8},children:"Skip / Next ⏭"})]}),e.jsxs("div",{className:"nice-karaoke-picker__filters",style:{display:"flex",gap:8,marginBottom:12},children:[e.jsx("input",{type:"text",value:f,onChange:s=>r(s.target.value),placeholder:"Search songs or artists…",style:{flex:1}}),e.jsxs("select",{value:d,onChange:s=>k(s.target.value),children:[e.jsx("option",{value:"",children:"All Difficulties"}),n.map(s=>e.jsx("option",{value:s,children:s},s))]})]}),e.jsx("div",{className:"nice-karaoke-picker__catalog",children:S.length===0?e.jsx("p",{children:"No songs match your search."}):S.map(s=>e.jsxs("div",{className:"nice-karaoke-picker__song",style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #eee"},children:[e.jsxs("div",{children:[e.jsx("strong",{children:s.title})," — ",s.artist,s.difficulty&&e.jsxs("span",{style:{marginLeft:8,fontSize:12,color:l(s.difficulty),fontWeight:600},children:["[",s.difficulty,"]"]}),s.hasLyrics&&e.jsx("span",{style:{marginLeft:6,fontSize:12},title:"Lyrics available",children:"📝"}),s.language&&e.jsxs("span",{style:{marginLeft:6,fontSize:12,color:"#666"},children:["(",s.language,")"]})]}),!b&&e.jsx("div",{children:u.has(s.id)?e.jsx("button",{onClick:()=>m==null?void 0:m(s.id),style:{color:"#f44336"},children:"Remove"}):e.jsx("button",{onClick:()=>h==null?void 0:h(s.id),children:"🎤 Sing"})})]},s.id))}),p.length>0&&e.jsxs("div",{className:"nice-karaoke-picker__queue",style:{marginTop:16},children:[e.jsxs("h4",{children:["🎶 Queue (",p.length,")"]}),p.map((s,I)=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"4px 0"},children:[e.jsxs("span",{children:[e.jsxs("strong",{children:[I+1,"."]})," ",s.title," — ",s.artist,s.performerName&&e.jsxs("em",{children:[" (",s.performerName,")"]})]}),!b&&m&&e.jsx("button",{onClick:()=>m(s.id),style:{fontSize:12},children:"✕"})]},s.id))]})]})}),ie={game:y.NtdGamepad,music:y.NtdMusic,dance:y.NtdMusic,quiz:y.NtdHelp,karaoke:y.NtdMicrophone,photo:y.NtdCamera,custom:y.NtdSparkle},Qe={game:"Games",music:"Music",dance:"Dance",quiz:"Quiz",karaoke:"Karaoke",photo:"Photo",custom:"Custom"},Ge=i.forwardRef(function(_,C){const{attractions:t,onSelect:p,onDeselect:h,onVote:m,selectedIds:v=[],maxSelections:j,showVotes:b=!0,readOnly:N=!1,layout:x="grid",className:f,style:r}=_,[d,k]=i.useState(""),[g,S]=i.useState(""),u=i.useMemo(()=>new Set(v),[v]),n=i.useMemo(()=>{const c=new Set(t.map(z=>z.category));return Array.from(c)},[t]),l=i.useMemo(()=>{let c=t;if(d&&(c=c.filter(z=>z.category===d)),g.trim()){const z=g.toLowerCase();c=c.filter(T=>{var M;return T.name.toLowerCase().includes(z)||((M=T.description)==null?void 0:M.toLowerCase().includes(z))})}return c},[t,d,g]),s=!j||u.size<j,I=c=>{N||(u.has(c)?h==null||h(c):s&&(p==null||p(c)))};return e.jsxs("div",{ref:C,className:`nice-attraction-picker ${f??""}`,style:{color:"var(--text-primary)",...r},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[e.jsx("h3",{style:{margin:0},children:"Attractions"}),j&&e.jsxs("span",{style:{color:"var(--text-secondary, #64748b)",fontSize:14},children:[u.size,"/",j," selected"]})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12,flexWrap:"wrap"},children:[e.jsx("input",{type:"text",value:g,onChange:c=>S(c.target.value),placeholder:"Search attractions…",style:{flex:1,minWidth:150}}),e.jsx("button",{onClick:()=>k(""),style:{fontWeight:d?400:700},children:"All"}),n.map(c=>e.jsxs("button",{onClick:()=>k(c===d?"":c),style:{fontWeight:c===d?700:400,display:"inline-flex",alignItems:"center",gap:4},children:[i.createElement(ie[c],{size:14})," ",Qe[c]]},c))]}),e.jsx("div",{style:{display:x==="grid"?"grid":"flex",gridTemplateColumns:x==="grid"?"repeat(auto-fill, minmax(200px, 1fr))":void 0,gap:12,flexDirection:x==="list"?"column":void 0},children:l.length===0?e.jsx("p",{children:"No attractions found."}):l.map(c=>{const z=u.has(c.id);return e.jsxs("div",{className:"nice-attraction-picker__card",style:{border:z?"2px solid var(--color-primary, #6366f1)":"1px solid var(--border-color, #cbd5e1)",borderRadius:8,padding:12,cursor:N?"default":"pointer",background:z?"color-mix(in srgb, var(--color-primary) 12%, transparent)":"var(--bg-elevated, var(--bg-primary))",transition:"all 0.2s"},onClick:()=>I(c.id),children:[c.imageUrl&&e.jsx("img",{src:c.imageUrl,alt:c.name,style:{width:"100%",borderRadius:6,marginBottom:8,objectFit:"cover",maxHeight:120}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{display:"inline-flex"},children:i.createElement(ie[c.category],{size:16})}),e.jsx("strong",{children:c.name})]}),c.description&&e.jsx("p",{style:{fontSize:13,color:"var(--text-secondary, #64748b)",margin:"6px 0"},children:c.description}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:8},children:[b&&e.jsxs("span",{style:{fontSize:13,display:"inline-flex",alignItems:"center",gap:4},children:[e.jsx(y.NtdThumbsUp,{size:14})," ",c.votes??0]}),!N&&m&&e.jsx("button",{onClick:T=>{T.stopPropagation(),m(c.id)},style:{fontSize:12},children:"Vote"})]})]},c.id)})})]})}),He={game:y.NtdGamepad,music:y.NtdMusic,dance:y.NtdMusic,quiz:y.NtdHelp,karaoke:y.NtdMicrophone,photo:y.NtdCamera,custom:y.NtdSparkle},Ke=i.forwardRef(function(_,C){const{attractions:t,onVote:p,onUnvote:h,votedIds:m=[],maxVotes:v,closed:j=!1,sortBy:b="votes",showResults:N=!0,className:x,style:f}=_,r=i.useMemo(()=>new Set(m),[m]),d=v?v-r.size:void 0,k=i.useMemo(()=>{const n=[...t];switch(b){case"votes":n.sort((l,s)=>(s.votes??0)-(l.votes??0));break;case"name":n.sort((l,s)=>l.name.localeCompare(s.name));break;case"category":n.sort((l,s)=>l.category.localeCompare(s.category));break}return n},[t,b]),g=i.useMemo(()=>Math.max(...t.map(n=>n.votes??0),1),[t]),S=n=>{j||(r.has(n)?h==null||h(n):(!d||d>0)&&(p==null||p(n)))},u=n=>{switch(n){case 0:return e.jsx(y.NtdTrophy,{size:18,primaryColor:"#f59e0b",title:"1st place"});case 1:return e.jsx(y.NtdMedal,{size:18,primaryColor:"#94a3b8",title:"2nd place"});case 2:return e.jsx(y.NtdMedal,{size:18,primaryColor:"#b45309",title:"3rd place"});default:return`${n+1}.`}};return e.jsxs("div",{ref:C,className:`nice-attraction-voting ${x??""}`,style:{color:"var(--text-primary)",...f},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[e.jsxs("h3",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[e.jsx(y.NtdClipboardCheck,{size:20}),j?"Voting Results":"Vote for Attractions"]}),!j&&d!==void 0&&e.jsxs("span",{style:{fontSize:14,color:d>0?"var(--color-primary, #6366f1)":"var(--color-error, #ef4444)"},children:[d," vote",d!==1?"s":""," remaining"]})]}),j&&e.jsx("p",{style:{color:"var(--text-secondary, #64748b)",marginBottom:12},children:"Voting is closed. Final results:"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:k.map((n,l)=>{const s=r.has(n.id),I=n.votes??0,c=N?`${Math.round(I/g*100)}%`:"0%";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",borderRadius:8,border:s?"2px solid var(--color-primary, #6366f1)":"1px solid var(--border-color, #cbd5e1)",background:s?"color-mix(in srgb, var(--color-primary) 12%, transparent)":"var(--bg-elevated, var(--bg-primary))",cursor:j?"default":"pointer",transition:"all 0.2s"},onClick:()=>S(n.id),children:[N&&e.jsx("span",{style:{fontSize:18,minWidth:32,textAlign:"center"},children:u(l)}),e.jsx("span",{style:{display:"inline-flex",fontSize:20},children:i.createElement(He[n.category],{size:20})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontWeight:600},children:n.name}),n.description&&e.jsx("div",{style:{fontSize:13,color:"var(--text-secondary, #64748b)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.description}),N&&e.jsx("div",{style:{marginTop:4,height:6,borderRadius:3,background:"var(--bg-tertiary, #e2e8f0)",overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:c,background:"var(--color-primary, #6366f1)",borderRadius:3,transition:"width 0.3s"}})})]}),N&&e.jsx("span",{style:{fontWeight:600,fontSize:16,minWidth:40,textAlign:"right"},children:I}),!j&&e.jsx("button",{onClick:z=>{z.stopPropagation(),S(n.id)},style:{padding:"4px 12px",borderRadius:4,border:"none",background:s?"var(--color-error, #ef4444)":"var(--color-primary, #6366f1)",color:"#fff",cursor:"pointer",fontSize:13},children:s?"Unvote":"Vote"})]},n.id)})}),N&&e.jsxs("div",{style:{marginTop:12,textAlign:"right",fontSize:13,color:"var(--text-secondary, #64748b)"},children:["Total votes: ",t.reduce((n,l)=>n+(l.votes??0),0)]})]})});exports.NiceAttractionPicker=Ge;exports.NiceAttractionVoting=Ke;exports.NiceEventMedia=Ee;exports.NiceEventPlanning=Oe;exports.NiceKaraokePicker=Fe;exports.NiceRoundCard=Ue;exports.NiceRoundList=qe;exports.NiceSongPicker=We;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),B=require("@nice2dev/icons"),f=require("@nice2dev/ui"),o=require("react"),Z=require("@nice2dev/ui-core");function An(i){return i.map((s,a)=>({item:s,index:a,key:s.order??a})).sort((s,a)=>s.key-a.key||s.index-a.index).map(s=>s.item)}function Ve(i,s,a){if(s===a)return[...i];if(s<0||s>=i.length)return[...i];if(a<0||a>=i.length)return[...i];const n=[...i],[r]=n.splice(s,1);return n.splice(a,0,r),n}function Je(i){const{items:s,onReorder:a,disabled:n=!1}=i,[r,l]=o.useState(null),[d,m]=o.useState(null),[h,t]=o.useState(!1),u=o.useRef(null),p=o.useCallback(b=>s.findIndex(k=>k.id===b),[s]),_=o.useCallback((b,k)=>{const j=p(b),M=p(k);j<0||M<0||j===M||a==null||a(Ve([...s],j,M).map(c=>c.id))},[s,p,a]),g=o.useCallback(()=>{l(null),m(null),t(!1),u.current=null},[]),x=o.useCallback((b,k)=>({role:"button",draggable:!1,tabIndex:n?-1:0,"aria-grabbed":r===b,onPointerDown:j=>{var N,v;if(n||j.button!==0&&j.pointerType==="mouse")return;(v=(N=j.currentTarget).setPointerCapture)==null||v.call(N,j.pointerId),l(b),t(!0),u.current=s.map(T=>T.id);const M=()=>{window.removeEventListener("pointerup",M),window.removeEventListener("pointercancel",c),t(!1),l(null),m(null)},c=()=>{window.removeEventListener("pointerup",M),window.removeEventListener("pointercancel",c),u.current&&(a==null||a(u.current)),g()};window.addEventListener("pointerup",M),window.addEventListener("pointercancel",c)},onPointerEnter:()=>{n||!r||r===b||(m(b),_(r,b))},onKeyDown:j=>{if(n)return;if(j.key===" "||j.key==="Enter"){j.preventDefault(),r===b?g():(l(b),u.current=s.map(T=>T.id));return}if(j.key==="Escape"&&r===b){j.preventDefault(),u.current&&(a==null||a(u.current)),g();return}if(r!==b)return;const c=j.key==="ArrowLeft"||j.key==="ArrowUp"?-1:j.key==="ArrowRight"||j.key==="ArrowDown"?1:0;if(c===0)return;j.preventDefault();const N=p(b),v=N+c;v<0||v>=s.length||a==null||a(Ve([...s],N,v).map(T=>T.id))},...k?{"aria-label":k}:{}}),[r,_,n,g,p,s,a]);return{activeId:r,overId:d,getHandleProps:x,dragging:h}}const $n=({item:i})=>{const[s,a]=o.useState(!1),n=i.thumbnailUrl??i.url;return i.type==="video"?e.jsx("div",{className:"nice-event-media__video-thumb",children:e.jsx(B.NtdPlay,{size:26})}):s||!n?e.jsx("div",{className:"nice-event-media__broken",title:"Image unavailable",children:e.jsx(B.NtdImage,{size:24})}):e.jsx("img",{src:n,alt:i.caption??"",className:"nice-event-media__thumb",loading:"lazy",onError:()=>a(!0)})},Pn=o.forwardRef(function(s,a){const{items:n,onUpload:r,onDelete:l,onLike:d,onItemClick:m,layout:h="grid",uploadEnabled:t=!0,typeFilter:u="all",onReorder:p,className:_,style:g}=s,[x,b]=o.useState(""),k=o.useMemo(()=>An(n),[n]),j=o.useMemo(()=>u==="all"?k:k.filter(T=>T.type===u),[k,u]),M=!!p&&u==="all",c=Je({items:k,onReorder:p,disabled:!M}),N=T=>{const S=T[0];!S||!r||(r(S,x.trim()||void 0),b(""))},v=h==="list";return e.jsxs("div",{ref:a,className:`nice-event-media nice-event-media--${h} ${_??""}`,style:g,children:[e.jsx("div",{className:"nice-event-media__header",children:e.jsxs("h3",{children:["Media (",j.length,")"]})}),t&&r&&e.jsxs("div",{className:"nice-event-media__upload",children:[e.jsx(f.NiceUpload,{accept:"image/*,video/*",multiple:!1,imagePreview:!1,onFilesSelected:N}),e.jsx(f.NiceTextInput,{value:x,onChange:b,placeholder:"Add a caption…"})]}),j.length===0?e.jsx("p",{className:"nice-event-media__empty",children:"No media yet."}):e.jsx(f.NiceCardGroup,{columns:v?1:void 0,minColumnWidth:200,gap:12,align:"stretch",children:j.map((T,S)=>{const R=M?c.getHandleProps(T.id,`Move ${T.caption??`item ${S+1}`}`):null;return e.jsxs("div",{className:`nice-event-media__card${v?" nice-event-media__card--row":""}${c.activeId===T.id?" nice-event-media__card--dragging":""}`,onClick:()=>m==null?void 0:m(T),onPointerEnter:R==null?void 0:R.onPointerEnter,role:m?"button":void 0,tabIndex:m?0:void 0,children:[R&&e.jsx("span",{className:"nice-event-media__grip",role:R.role,tabIndex:R.tabIndex,"aria-grabbed":R["aria-grabbed"],"aria-label":R["aria-label"],draggable:R.draggable,onPointerDown:R.onPointerDown,onKeyDown:R.onKeyDown,onClick:y=>y.stopPropagation(),children:e.jsx(B.NtdMove,{size:14})}),e.jsx($n,{item:T}),e.jsxs("div",{className:"nice-event-media__body",children:[T.caption&&e.jsx("span",{className:"nice-event-media__caption",children:T.caption}),T.uploadedByName&&e.jsx("span",{className:"nice-event-media__uploader",children:T.uploadedByName}),e.jsxs("div",{className:"nice-event-media__actions",children:[d&&e.jsxs("button",{type:"button",className:"nice-event-media__action",onClick:y=>{y.stopPropagation(),d(T.id)},"aria-label":"Like",children:[e.jsx(B.NtdHeart,{size:15})," ",T.likes??0]}),l&&e.jsx("button",{type:"button",className:"nice-event-media__action nice-event-media__action--danger",onClick:y=>{y.stopPropagation(),l(T.id)},"aria-label":"Delete",children:e.jsx(B.NtdTrash,{size:15})})]})]})]},T.id)})})]})}),me=({title:i,description:s,icon:a,action:n,className:r})=>e.jsx(f.NiceEmpty,{size:"sm",title:i,description:s,icon:a,action:n,className:r}),Bn=o.forwardRef(function(s,a){const{items:n,layout:r="grid",onReorder:l,onItemAdd:d,onItemRemove:m,onCaptionChange:h,onItemClick:t,previewMode:u=!1,transition:p="fade",defaultDurationMs:_=3e3,autoPlay:g=!0,disabled:x=!1,readOnly:b=!1,size:k="md",className:j,style:M}=s,[c,N]=o.useState(0),[v,T]=o.useState(null),[S,R]=o.useState(""),y=x||b,E=!!l&&!y,X=Je({items:n,onReorder:l,disabled:!E}),D=n.length>0?Math.min(c,n.length-1):0,I=n[D],L=(I==null?void 0:I.durationMs)??_;o.useEffect(()=>{if(!u||!g||n.length<2)return;const P=window.setTimeout(()=>N(q=>(q+1)%n.length),Math.max(250,L));return()=>window.clearTimeout(P)},[u,g,n.length,D,L]);const z=o.useMemo(()=>n.reduce((P,q)=>P+(q.durationMs??_),0),[n,_]),A=P=>{h==null||h(P,S),T(null),R("")};return n.length===0?e.jsx("div",{ref:a,className:`nice-media-collage ${j??""}`,style:M,children:e.jsx(me,{icon:e.jsx(B.NtdImage,{size:28}),title:"Nothing in the collage yet",description:"Add photos or video to start arranging them.",action:d&&!y?e.jsx(f.NiceUpload,{accept:"image/*,video/*",multiple:!0,onFilesSelected:d}):void 0})}):u?e.jsxs("div",{ref:a,className:`nice-media-collage nice-media-collage--preview nice-media-collage--${p} ${j??""}`,style:M,children:[e.jsxs("div",{className:"nice-media-collage__stage","aria-live":"polite",children:[(I==null?void 0:I.type)==="video"?e.jsx("video",{className:"nice-media-collage__slide",src:I.mediaUrl,controls:!0},I.id):e.jsx("img",{className:"nice-media-collage__slide",src:I==null?void 0:I.mediaUrl,alt:(I==null?void 0:I.caption)??""},I==null?void 0:I.id),(I==null?void 0:I.caption)&&e.jsx("p",{className:"nice-media-collage__slide-caption",children:I.caption})]}),e.jsxs("div",{className:"nice-media-collage__playbar",children:[e.jsx(f.NiceButton,{size:"sm",variant:"ghost",onClick:()=>N(P=>(P-1+n.length)%n.length),children:"Previous"}),e.jsxs("span",{className:"nice-media-collage__counter",children:[D+1," / ",n.length]}),e.jsx(f.NiceButton,{size:"sm",variant:"ghost",onClick:()=>N(P=>(P+1)%n.length),children:"Next"})]})]}):e.jsxs("div",{ref:a,className:`nice-media-collage nice-media-collage--${r} nice-media-collage--${k} ${j??""}`,style:M,children:[e.jsxs("div",{className:"nice-media-collage__toolbar",children:[e.jsx(f.NiceSegmentedControl,{size:"sm",value:r,readOnly:!0,options:[{value:"sequence",label:"Sequence"},{value:"grid",label:"Grid"},{value:"mosaic",label:"Mosaic"}]}),e.jsxs("span",{className:"nice-media-collage__duration",children:[n.length," item",n.length===1?"":"s"," · ",Math.round(z/1e3),"s"]}),d&&!y&&e.jsx(f.NiceUpload,{accept:"image/*,video/*",multiple:!0,imagePreview:!1,onFilesSelected:d})]}),e.jsx("ol",{className:"nice-media-collage__tiles","aria-label":"Collage order","aria-busy":X.dragging,children:n.map((P,q)=>{const F=E?X.getHandleProps(P.id,`Move ${P.caption??`item ${q+1}`}`):null;return e.jsxs("li",{className:`nice-media-collage__tile${X.activeId===P.id?" nice-media-collage__tile--active":""}${X.overId===P.id?" nice-media-collage__tile--over":""}`,onPointerEnter:F==null?void 0:F.onPointerEnter,children:[e.jsx("span",{className:"nice-media-collage__index","aria-hidden":"true",children:q+1}),e.jsx("button",{type:"button",className:"nice-media-collage__thumb-button",onClick:()=>t==null?void 0:t(P),disabled:!t,children:P.type==="video"?e.jsx("span",{className:"nice-media-collage__video-thumb",children:e.jsx(B.NtdPlay,{size:22})}):e.jsx("img",{className:"nice-media-collage__thumb",src:P.mediaUrl,alt:P.caption??"",loading:"lazy"})}),v===P.id?e.jsx(f.NiceTextInput,{value:S,onChange:R,placeholder:"Caption",autoFocus:!0,size:"sm",onBlur:()=>A(P.id),onKeyDown:C=>{C.key==="Enter"&&A(P.id),C.key==="Escape"&&T(null)}}):e.jsx("button",{type:"button",className:"nice-media-collage__caption",disabled:!h||y,onClick:()=>{T(P.id),R(P.caption??"")},children:P.caption||e.jsx("em",{children:"Add a caption"})}),e.jsxs("div",{className:"nice-media-collage__tile-actions",children:[F&&e.jsx("span",{className:"nice-media-collage__grip",role:F.role,tabIndex:F.tabIndex,"aria-grabbed":F["aria-grabbed"],"aria-label":F["aria-label"],draggable:F.draggable,onPointerDown:F.onPointerDown,onKeyDown:F.onKeyDown,children:e.jsx(B.NtdMove,{size:14})}),m&&!b&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:`Remove ${P.caption??`item ${q+1}`}`,disabled:x,onClick:()=>m(P.id),children:e.jsx(B.NtdTrash,{size:14})})]})]},P.id)})}),d&&!y&&n.length>0&&e.jsxs("p",{className:"nice-media-collage__hint",children:[e.jsx(B.NtdPlus,{size:12})," Drag a tile, or focus one and press Space then the arrow keys."]})]})});function Ie(i){const s=i.toLowerCase();return["active","live","published","completed","confirmed"].includes(s)?"success":["cancelled","canceled","rejected","failed"].includes(s)?"error":["scheduled","pending","planning"].includes(s)?"info":["draft","archived"].includes(s)?"secondary":"warning"}const Rn={micro:[],compact:["details","location","budget"],normal:["details","location","schedule","participants","tasks","surveys","budget"],full:["details","location","schedule","participants","tasks","surveys","vendors","budget","documents","settings"]},En=o.forwardRef(function(s,a){var Le,Oe,Ue,Ye,Xe,Fe;const{event:n,participants:r=[],surveys:l=[],billing:d=[],scheduleItems:m=[],tasks:h=[],vendors:t=[],documents:u=[],displayMode:p="normal",tabs:_,activeTab:g,onTabChange:x,tabsIconOnly:b=!0,tabsCentered:k="auto",countLocation:j="bottom",showDetails:M=!0,showLocation:c=!0,showSchedule:N=!0,showParticipants:v=!0,showTasks:T=!0,showSurveys:S=!0,showVendors:R=!0,showBudget:y=!0,showDocuments:E=!0,showSettings:X=!0,editable:D=!1,onSave:I,onPublish:L,onShare:z,onExport:A,onUpdateEvent:P,onUpdateLocation:q,onAddSurvey:F,onSurveyRespond:C,onAddBilling:Y,className:V,style:K}=s,[O,Q]=o.useState(n.title),[G,he]=o.useState(n.description??""),[se,re]=o.useState(n.startDate??""),[pe,ke]=o.useState(n.endDate??""),[xe,le]=o.useState(((Le=n.location)==null?void 0:Le.name)??""),[ge,Te]=o.useState(((Oe=n.location)==null?void 0:Oe.address)??""),[oe,ie]=o.useState(((Ue=n.location)==null?void 0:Ue.virtualUrl)??""),[ne,Ne]=o.useState(((Ye=n.location)==null?void 0:Ye.isVirtual)??!1),[de,je]=o.useState(""),[ue,Ae]=o.useState("single"),[ye,_e]=o.useState(""),[ae,be]=o.useState(""),[fe,$]=o.useState(""),[U,W]=o.useState("PLN"),H={details:M,location:c,schedule:N,participants:v,tasks:T,surveys:S,vendors:R,budget:y,documents:E,settings:X},ce=(_??Rn[p]).filter(w=>H[w]!==!1),[Se,cn]=o.useState(ce[0]??"details"),rn=g??Se,ln=o.useCallback(w=>{const te=w;g===void 0&&cn(te),x==null||x(te)},[g,x]),on=o.useCallback(()=>{P==null||P({title:O,description:G||void 0,startDate:se||void 0,endDate:pe||void 0})},[O,G,se,pe,P]),dn=o.useCallback(()=>{q==null||q({name:xe,address:ge||void 0,virtualUrl:oe||void 0,isVirtual:ne})},[xe,ge,oe,ne,q]),un=o.useCallback(()=>{if(!de.trim()||!F)return;const w=ye.split(",").map(te=>te.trim()).filter(Boolean);F(de.trim(),ue,w.length>0?w:void 0),je(""),_e("")},[de,ue,ye,F]),mn=o.useCallback(()=>{!ae.trim()||!Y||(Y({label:ae.trim(),amount:parseFloat(fe)||0,currency:U}),be(""),$(""))},[ae,fe,U,Y]),hn=o.useMemo(()=>d.map(w=>({label:w.label,amount:w.amount})),[d]),pn=o.useMemo(()=>d.reduce((w,te)=>w+te.amount,0),[d]),xn=((Xe=d[0])==null?void 0:Xe.currency)??"PLN",gn=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(f.NiceTextInput,{label:"Title",value:O,onChange:Q,readOnly:!D}),e.jsx(f.NiceTextArea,{label:"Description",value:G,onChange:he,readOnly:!D,rows:3}),e.jsxs("div",{className:"nice-event-planning__row",children:[e.jsxs("label",{className:"nice-field",children:[e.jsx("span",{className:"nice-field__label",children:"Start"}),e.jsx("input",{className:"nice-input",type:"datetime-local",value:se,onChange:w=>re(w.target.value),readOnly:!D})]}),e.jsxs("label",{className:"nice-field",children:[e.jsx("span",{className:"nice-field__label",children:"End"}),e.jsx("input",{className:"nice-input",type:"datetime-local",value:pe,onChange:w=>ke(w.target.value),readOnly:!D})]})]}),D&&e.jsx(f.NiceButton,{variant:"primary",leftIcon:e.jsx(Z.NiceIcon,{name:"check",size:"sm"}),onClick:on,children:"Save details"})]}),fn=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(f.NiceToggle,{label:"Virtual event",checked:ne,onChange:Ne,disabled:!D}),e.jsx(f.NiceTextInput,{label:"Venue name",value:xe,onChange:le,readOnly:!D}),ne?e.jsx(f.NiceTextInput,{label:"Virtual URL",value:oe,onChange:ie,readOnly:!D}):e.jsx(f.NiceTextInput,{label:"Address",value:ge,onChange:Te,readOnly:!D}),D&&e.jsx(f.NiceButton,{variant:"primary",leftIcon:e.jsx(Z.NiceIcon,{name:"check",size:"sm"}),onClick:dn,children:"Save location"})]}),vn=e.jsx("div",{className:"nice-event-planning__participants",children:r.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No participants yet."}):e.jsxs(e.Fragment,{children:[e.jsx(f.NiceAvatarGroup,{max:8,children:r.map(w=>e.jsx(f.NiceAvatar,{name:w.name,src:w.avatarUrl},w.id))}),e.jsx("ul",{className:"nice-event-planning__participant-list",children:r.map(w=>e.jsxs("li",{className:"nice-event-planning__participant",children:[e.jsx(f.NiceAvatar,{name:w.name,src:w.avatarUrl,size:"sm"}),e.jsx("span",{className:"nice-event-planning__participant-name",children:w.name}),e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:Ie(w.status),children:w.status})]},w.id))})]})}),Nn=e.jsxs("div",{className:"nice-event-planning__form",children:[l.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No surveys yet."}):l.map(w=>e.jsxs("div",{className:"nice-event-planning__survey",children:[e.jsx("strong",{children:w.question})," ",e.jsx(f.NiceBadge,{size:"xs",outline:!0,variant:"info",children:w.type}),w.options&&e.jsx("div",{className:"nice-event-planning__survey-options",children:w.options.map((te,Tn)=>e.jsx(f.NiceButton,{size:"sm",variant:"outline",onClick:()=>C==null?void 0:C(w.id,te),children:te},Tn))}),w.responses&&e.jsxs("span",{className:"nice-event-planning__muted",children:[w.responses.length," responses"]})]},w.id)),D&&F&&e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(f.NiceTextInput,{label:"New survey question",value:de,onChange:je,placeholder:"Question"}),e.jsx(f.NiceSelect,{label:"Type",value:ue,onChange:w=>Ae(w),options:[{value:"single",label:"Single choice"},{value:"multiple",label:"Multiple choice"},{value:"text",label:"Free text"},{value:"rating",label:"Rating"}]}),e.jsx(f.NiceTextInput,{label:"Options (comma-separated)",value:ye,onChange:_e,placeholder:"Yes, No, Maybe"}),e.jsx(f.NiceButton,{variant:"primary",leftIcon:e.jsx(Z.NiceIcon,{name:"plus",size:"sm"}),onClick:un,disabled:!de.trim(),children:"Add survey"})]})]}),jn=e.jsxs("div",{className:"nice-event-planning__form",children:[d.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No billing items yet."}):e.jsx(f.NiceAmountBreakdown,{lines:[...hn,{label:"Total",amount:pn,isSummary:!0}],currency:xn}),D&&Y&&e.jsxs("div",{className:"nice-event-planning__row",children:[e.jsx(f.NiceTextInput,{label:"Item",value:ae,onChange:be,placeholder:"Catering"}),e.jsx(f.NiceTextInput,{label:"Amount",value:fe,onChange:$,placeholder:"0.00"}),e.jsx(f.NiceSelect,{label:"Currency",value:U,onChange:w=>W(w),options:["PLN","EUR","USD","GBP"]}),e.jsx(f.NiceButton,{variant:"primary",leftIcon:e.jsx(Z.NiceIcon,{name:"plus",size:"sm"}),onClick:mn,disabled:!ae.trim(),children:"Add"})]})]}),yn=e.jsxs("div",{className:"nice-event-planning__form",children:[e.jsx(f.NiceToggle,{label:"Public event",checked:n.isPublic??!1,disabled:!D}),e.jsx(f.NiceTextInput,{label:"Max participants",value:n.maxParticipants!=null?String(n.maxParticipants):"",onChange:()=>{},readOnly:!D}),e.jsxs("div",{className:"nice-event-planning__muted",children:["Host: ",n.hostName," · Created ",new Date(n.createdAt).toLocaleDateString()]})]}),_n=e.jsx("div",{className:"nice-event-planning__list",children:m.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No agenda items yet."}):e.jsx("ul",{className:"nice-event-planning__schedule",children:m.map(w=>e.jsxs("li",{className:"nice-event-planning__schedule-item",children:[e.jsxs("span",{className:"nice-event-planning__schedule-time",children:[e.jsx(Z.NiceIcon,{name:"clock",size:"sm"}),w.startTime??"",w.endTime?`–${w.endTime}`:""]}),e.jsx("span",{className:"nice-event-planning__schedule-title",children:w.title}),w.location&&e.jsx("span",{className:"nice-event-planning__muted",children:w.location})]},w.id))})}),bn=e.jsx("div",{className:"nice-event-planning__list",children:h.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No tasks yet."}):e.jsx("ul",{className:"nice-event-planning__tasks",children:h.map(w=>e.jsxs("li",{className:"nice-event-planning__task",children:[e.jsx(f.NiceToggle,{label:w.title,checked:w.done??!1,disabled:!D}),w.assigneeName&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:"info",children:w.assigneeName}),w.dueDate&&e.jsx("span",{className:"nice-event-planning__muted",children:w.dueDate})]},w.id))})}),wn=e.jsx("div",{className:"nice-event-planning__list",children:t.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No vendors yet."}):e.jsx("ul",{className:"nice-event-planning__vendors",children:t.map(w=>e.jsxs("li",{className:"nice-event-planning__vendor",children:[e.jsx(Z.NiceIcon,{name:"briefcase",size:"sm"}),e.jsx("span",{className:"nice-event-planning__vendor-name",children:w.name}),w.category&&e.jsx("span",{className:"nice-event-planning__muted",children:w.category}),w.status&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:Ie(w.status),children:w.status}),w.cost!=null&&e.jsxs("span",{className:"nice-event-planning__vendor-cost",children:[w.cost," ",w.currency??""]})]},w.id))})}),kn=e.jsx("div",{className:"nice-event-planning__list",children:u.length===0?e.jsx("p",{className:"nice-event-planning__empty",children:"No documents yet."}):e.jsx("ul",{className:"nice-event-planning__documents",children:u.map(w=>e.jsxs("li",{className:"nice-event-planning__document",children:[e.jsx(Z.NiceIcon,{name:"file",size:"sm"}),e.jsx("span",{className:"nice-event-planning__document-name",children:w.name}),w.fileType&&e.jsx(f.NiceBadge,{size:"xs",outline:!0,variant:"secondary",children:w.fileType}),w.sizeKb!=null&&e.jsxs("span",{className:"nice-event-planning__muted",children:[w.sizeKb," KB"]})]},w.id))})}),Sn={details:gn,location:fn,schedule:_n,participants:vn,tasks:bn,surveys:Nn,vendors:wn,budget:jn,documents:kn,settings:yn},In={details:"file",location:"home",schedule:"clock",participants:"users",tasks:"list",surveys:"clipboard",vendors:"briefcase",budget:"dollar",documents:"folder",settings:"settings"},Cn={schedule:m.length||void 0,participants:r.length||void 0,tasks:h.length||void 0,surveys:l.length||void 0,vendors:t.length||void 0,budget:d.length||void 0,documents:u.length||void 0},zn=ce.map(w=>({id:w,label:w.charAt(0).toUpperCase()+w.slice(1),icon:e.jsx(Z.NiceIcon,{name:In[w],size:"sm"}),badge:Cn[w],content:Sn[w]})),Mn=e.jsxs("div",{className:"nice-event-planning__toolbar",children:[e.jsxs("div",{className:"nice-event-planning__toolbar-title",children:[e.jsx(Z.NiceIcon,{name:"calendar",size:"md"}),e.jsx("span",{className:"nice-event-planning__title",children:n.title}),e.jsx(f.NiceBadge,{size:"sm",variant:Ie(n.status),children:n.status})]}),e.jsx("span",{className:"nice-event-planning__toolbar-spacer"}),e.jsxs("div",{className:"nice-event-planning__toolbar-actions",children:[I&&e.jsx(f.NiceButton,{size:"sm",variant:"primary",leftIcon:e.jsx(Z.NiceIcon,{name:"check",size:"sm"}),onClick:()=>I({title:O,description:G}),children:"Save"}),L&&e.jsx(f.NiceButton,{size:"sm",variant:"success",leftIcon:e.jsx(Z.NiceIcon,{name:"upload",size:"sm"}),onClick:L,children:"Publish"}),z&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",leftIcon:e.jsx(Z.NiceIcon,{name:"link",size:"sm"}),onClick:z,children:"Share"}),A&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",leftIcon:e.jsx(Z.NiceIcon,{name:"download",size:"sm"}),onClick:A,children:"Export"})]})]});return p==="micro"?e.jsx("div",{ref:a,className:`nice-event-planning nice-event-planning--micro ${V??""}`,style:K,children:e.jsxs("div",{className:"nice-event-planning__micro",children:[e.jsx(Z.NiceIcon,{name:"calendar",size:"md"}),e.jsxs("div",{className:"nice-event-planning__micro-body",children:[e.jsx("span",{className:"nice-event-planning__title",children:n.title}),e.jsxs("span",{className:"nice-event-planning__muted",children:[n.startDate?new Date(n.startDate).toLocaleString():"No date",(Fe=n.location)!=null&&Fe.name?` · ${n.location.name}`:""]})]}),e.jsx(f.NiceBadge,{size:"sm",variant:Ie(n.status),children:n.status}),r.length>0&&e.jsx(f.NiceAvatarGroup,{max:4,size:"sm",children:r.map(w=>e.jsx(f.NiceAvatar,{name:w.name,src:w.avatarUrl,size:"sm"},w.id))})]})}):e.jsxs("div",{ref:a,className:`nice-event-planning nice-event-planning--${p} ${V??""}`,style:K,children:[Mn,e.jsx(f.NiceTabs,{tabs:zn,activeTab:rn,onChange:ln,iconOnly:b,centered:k,countLocation:j})]})});function Dn(i){switch(i){case"confirmed":return"success";case"checked-in":return"info";case"declined":return"error";case"no-show":return"warning";default:return"secondary"}}const $e=({participant:i,showRole:s=!0,showStatus:a=!0,meta:n,children:r,size:l="md",className:d})=>e.jsxs("li",{className:`nice-participant-row nice-participant-row--${l} ${d??""}`,children:[e.jsx(f.NiceAvatar,{name:i.name,src:i.avatarUrl,size:l}),e.jsx("span",{className:"nice-participant-row__name",children:i.name}),s&&i.role&&e.jsx(f.NiceBadge,{size:"xs",outline:!0,variant:"info",children:i.role}),a&&i.status&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:Dn(i.status),children:i.status}),n&&e.jsx("span",{className:"nice-participant-row__meta",children:n}),r&&e.jsx("span",{className:"nice-participant-row__trailing",children:r})]}),Ln=/^[^\s@,;]+@[^\s@,;]+\.[^\s@,;]{2,}$/,qe=/^.*<\s*([^<>\s]+)\s*>$/;function en(i){var l,d;const s=[],a=[],n=new Set;let r=0;if(!i)return{valid:s,invalid:a,duplicates:r};for(const m of i.split(/[,;\r\n\t]+/)){const h=m.trim();if(!h)continue;const t=((d=(l=qe.exec(h))==null?void 0:l[1])==null?void 0:d.trim())??h,u=qe.test(h)?[t]:t.split(/\s+/);for(const p of u){if(!p)continue;if(!Ln.test(p)){a.push(p);continue}const _=p.toLowerCase();if(n.has(_)){r+=1;continue}n.add(_),s.push(p)}}return{valid:s,invalid:a,duplicates:r}}function On(i,s){const a=new Set(i.map(r=>r.toLowerCase())),n=[...i];for(const r of s){const l=r.toLowerCase();a.has(l)||(a.add(l),n.push(r))}return n}function nn(i={}){const{currentUserId:s,currentUserName:a,requireIdentity:n=!0}=i,[r,l]=o.useState(""),d=!s,m=a??r,h=!n||m.trim().length>0;return{isAnonymous:d,name:m,setName:l,canAct:h,actor:{userId:s,userName:m.trim()}}}const Un=[{answer:"yes",label:"Yes",variant:"success",Icon:B.NtdCheck},{answer:"maybe",label:"Maybe",variant:"warning",Icon:B.NtdHelp},{answer:"no",label:"No",variant:"error",Icon:B.NtdClose}],Pe=o.forwardRef(function(s,a){const{value:n,onRespond:r,allowPlusOnes:l=!1,maxPlusOnes:d=5,plusOnes:m=0,allowNote:h=!1,currentUserId:t,currentUserName:u,compact:p=!1,disabled:_=!1,readOnly:g=!1,size:x="md",className:b,style:k}=s,j=nn({currentUserId:t,currentUserName:u}),[M,c]=o.useState(m),[N,v]=o.useState(""),T=!p&&j.isAnonymous&&!j.canAct,S=_||g,R=y=>{S||!r||r({answer:y,plusOnes:l&&y!=="no"?M:void 0,note:h&&N.trim()?N.trim():void 0,userId:j.actor.userId,userName:j.actor.userName||void 0})};return e.jsxs("div",{ref:a,className:`nice-rsvp-control nice-rsvp-control--${x}${p?" nice-rsvp-control--compact":""} ${b??""}`,style:k,children:[!p&&j.isAnonymous&&e.jsx(f.NiceTextInput,{label:"Your name",value:j.name,onChange:j.setName,placeholder:"Who is replying?",required:!0,disabled:S,size:x}),e.jsx("div",{className:"nice-rsvp-control__answers",role:"group","aria-label":"Your reply",children:Un.map(({answer:y,label:E,variant:X,Icon:D})=>e.jsx(f.NiceButton,{size:x,variant:n===y?X:"outline",leftIcon:e.jsx(D,{size:16}),disabled:S||T,"aria-pressed":n===y,onClick:()=>R(y),children:E},y))}),!p&&l&&n!=="no"&&e.jsxs("label",{className:"nice-rsvp-control__field",children:[e.jsx("span",{className:"nice-rsvp-control__field-label",children:"Additional guests"}),e.jsx(f.NiceNumericInput,{value:M,onChange:y=>c(Math.max(0,Math.min(d,y??0))),min:0,max:d,step:1,size:"xs",disabled:S})]}),!p&&h&&e.jsx(f.NiceTextInput,{label:"Note",value:N,onChange:v,placeholder:"Anything we should know?",disabled:S,size:x}),T&&e.jsx("p",{className:"nice-rsvp-control__hint",children:"Enter your name to reply."})]})}),Yn={yes:"confirmed",maybe:"invited",no:"declined"},We={confirmed:"yes","checked-in":"yes",declined:"no"},Ce=["confirmed","checked-in","invited","declined","no-show"],Xn=o.forwardRef(function(s,a){const{participants:n,mode:r="organizer",currentUserId:l,currentUserName:d,onRsvpChange:m,onCheckIn:h,onScan:t,checkInSlot:u,onInvite:p,extraFields:_,groupBy:g="none",showSummary:x=!0,showSearch:b=!0,allowPlusOnes:k=!1,disabled:j=!1,readOnly:M=!1,size:c="md",className:N,style:v}=s,[T,S]=o.useState(""),[R,y]=o.useState("all"),[E,X]=o.useState(""),D=j||M,I=r==="guest",L=o.useMemo(()=>{const C={total:n.length};for(const Y of Ce)C[Y]=0;for(const Y of n)C[Y.status]=(C[Y.status]??0)+1;return C},[n]),z=o.useMemo(()=>{if(I)return n.filter(Y=>Y.userId===l||Y.id===l);const C=T.trim().toLowerCase();return n.filter(Y=>R!=="all"&&Y.status!==R?!1:!C||Y.name.toLowerCase().includes(C))},[n,I,l,T,R]),A=o.useMemo(()=>{if(g==="none"||I)return[{key:"all",label:"",items:z}];const C=new Map;for(const V of z){const K=g==="status"?V.status:V.role,O=C.get(K);O?O.push(V):C.set(K,[V])}return[...C.keys()].sort((V,K)=>g!=="status"?V.localeCompare(K):Ce.indexOf(V)-Ce.indexOf(K)).map(V=>({key:V,label:V,items:C.get(V)??[]}))},[z,g,I]),P=o.useMemo(()=>en(E),[E]),q=C=>Y=>{m==null||m(C,Yn[Y.answer],Y)},F=()=>{!p||P.valid.length===0||(p(P.valid),X(""))};if(I){const C=z[0];return C?e.jsxs("div",{ref:a,className:`nice-participant-list nice-participant-list--guest ${N??""}`,style:v,children:[e.jsx("ul",{className:"nice-participant-list__rows",children:e.jsx($e,{participant:C,size:c})}),e.jsx(Pe,{value:We[C.status],onRespond:q(C.id),allowPlusOnes:k,currentUserId:l??C.userId,currentUserName:d??C.name,disabled:j,readOnly:M,size:c})]}):e.jsx("div",{ref:a,className:`nice-participant-list ${N??""}`,style:v,children:e.jsx(me,{title:"You are not on this guest list",description:"Ask the host for an invitation link."})})}return e.jsxs("div",{ref:a,className:`nice-participant-list ${N??""}`,style:v,children:[x&&e.jsxs("div",{className:"nice-participant-list__summary",children:[e.jsxs("span",{className:"nice-participant-list__stat",children:[e.jsx("strong",{children:L.confirmed})," confirmed"]}),e.jsxs("span",{className:"nice-participant-list__stat",children:[e.jsx("strong",{children:L.invited})," awaiting reply"]}),e.jsxs("span",{className:"nice-participant-list__stat",children:[e.jsx("strong",{children:L.declined})," declined"]}),e.jsxs("span",{className:"nice-participant-list__stat",children:[e.jsx("strong",{children:L["checked-in"]})," checked in"]}),e.jsxs("span",{className:"nice-participant-list__stat nice-participant-list__stat--total",children:[e.jsx("strong",{children:L.total})," total"]})]}),(b||u||t)&&e.jsxs("div",{className:"nice-participant-list__toolbar",children:[b&&e.jsxs(e.Fragment,{children:[e.jsx(f.NiceTextInput,{value:T,onChange:S,placeholder:"Search guests…",prefix:e.jsx(B.NtdSearch,{size:15}),size:c}),e.jsx(f.NiceSelect,{value:R,onChange:C=>y(C),size:c,options:[{value:"all",label:"All statuses"},...Ce.map(C=>({value:C,label:C}))]})]}),u,t&&!u&&e.jsxs("span",{className:"nice-participant-list__scan-hint",children:[e.jsx(B.NtdQrCode,{size:15})," Scanner ready"]})]}),z.length===0?e.jsx(me,{title:"No guests yet",description:n.length>0?"No one matches the current filter.":"Invite people to see them here."}):A.map(C=>e.jsxs("section",{className:"nice-participant-list__group",children:[C.label&&e.jsxs("h4",{className:"nice-participant-list__group-title",children:[C.label," ",e.jsxs("span",{children:["(",C.items.length,")"]})]}),e.jsx("ul",{className:"nice-participant-list__rows",children:C.items.map(Y=>e.jsxs($e,{participant:Y,size:c,meta:_==null?void 0:_.map(V=>e.jsx("span",{className:"nice-participant-list__extra",children:V.render?V.render(Y):String(Y[V.key]??"")},V.key)),children:[m&&e.jsx(Pe,{compact:!0,value:We[Y.status],onRespond:q(Y.id),currentUserId:Y.userId,currentUserName:Y.name,disabled:D,size:"sm"}),h&&Y.status!=="checked-in"&&e.jsx(f.NiceButton,{size:"sm",variant:"outline",leftIcon:e.jsx(B.NtdCheck,{size:14}),disabled:D,onClick:()=>h(Y.id),children:"Check in"})]},Y.id))})]},C.key)),p&&!M&&e.jsxs("div",{className:"nice-participant-list__invite",children:[e.jsx(f.NiceTextArea,{label:"Invite by email",value:E,onChange:X,placeholder:"Paste addresses — commas, semicolons or new lines",rows:3,disabled:j,size:c}),e.jsxs(f.NiceButton,{variant:"primary",size:c,leftIcon:e.jsx(B.NtdMail,{size:15}),disabled:j||P.valid.length===0,onClick:F,children:["Invite ",P.valid.length>0?`(${P.valid.length})`:""]}),(P.invalid.length>0||P.duplicates>0)&&e.jsxs("p",{className:"nice-participant-list__invite-hint",children:[P.duplicates>0&&`${P.duplicates} duplicate(s) removed. `,P.invalid.length>0&&`${P.invalid.length} entry(ies) not recognised.`]})]})]})}),Fn={BIF:0,CLP:0,DJF:0,GNF:0,ISK:0,JPY:0,KMF:0,KRW:0,PYG:0,RWF:0,UGX:0,UYI:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,BHD:3,IQD:3,JOD:3,KWD:3,LYD:3,OMR:3,TND:3};function Re(i){return Fn[i==null?void 0:i.toUpperCase()]??2}function Ee(i,s){return Number.isFinite(i)?Math.round(i*10**Re(s)):0}function ze(i,s){const a=Re(s);return a===0?i:i/10**a}function Vn(i,s,a){const n=Re(s),r=ze(i,s);try{return new Intl.NumberFormat(a,{style:"currency",currency:s.toUpperCase(),minimumFractionDigits:n,maximumFractionDigits:n}).format(r)}catch{return`${r.toFixed(n)} ${s}`}}function ee(i,s,a){return Vn(Ee(i,s),s,a)}const Be={minX:0,minY:0,maxX:0,maxY:0};function qn(i,s=0){if(i.length===0)return{...Be};let a=1/0,n=1/0,r=-1/0,l=-1/0;for(const d of i)d.x<a&&(a=d.x),d.y<n&&(n=d.y),d.x>r&&(r=d.x),d.y>l&&(l=d.y);return{minX:a-s,minY:n-s,maxX:r+s,maxY:l+s}}function Ge(i,s){return{minX:Math.min(i.minX,s.minX),minY:Math.min(i.minY,s.minY),maxX:Math.max(i.maxX,s.maxX),maxY:Math.max(i.maxY,s.maxY)}}function Ke(i,s){return i.minX<=s.maxX&&i.maxX>=s.minX&&i.minY<=s.maxY&&i.maxY>=s.minY}function Wn(i,s,a=0){const n=i.zoom||1,r=-i.pan.x/n-a,l=-i.pan.y/n-a;return{minX:r,minY:l,maxX:r+s.width/n+a*2,maxY:l+s.height/n+a*2}}function Gn(i,s=12){const a=[],n=[],r=new Map,l=new Map;let d=null,m=0;for(const h of i.sections??[]){let t=null,u=0;(h.rows??[]).forEach((_,g)=>{const x=Kn(_.seats??[]);if(x.length===0)return;const b=qn(x,s);n.push({sectionId:h.id,rowIndex:g,label:_.label,seats:x,bounds:b}),x.forEach((k,j)=>{r.set(k.id,k),l.set(k.id,{sectionId:h.id,rowIndex:g,seatIndex:j})}),u+=x.length,t=t?Ge(t,b):b});const p=t??{...Be};a.push({section:h,bounds:p,seatCount:u}),m+=u,u>0&&(d=d?Ge(d,p):p)}return{sections:a,rows:n,bounds:d??{...Be},totalSeats:m,seatById:r,locationById:l}}function Kn(i){return[...i].sort((s,a)=>s.number-a.number||s.x-a.x)}function Hn(i,s){return i>s*4?"section":i>s?"row":"seat"}function Qn(i,s,a=2500,n){const r=i.sections.filter(u=>Ke(u.bounds,s)),l=new Set(r.map(u=>u.section.id)),d=i.rows.filter(u=>l.has(u.sectionId)&&Ke(u.bounds,s));let m=0;for(const u of d)for(const p of u.seats)p.x>=s.minX&&p.x<=s.maxX&&p.y>=s.minY&&p.y<=s.maxY&&(m+=1);const h=n??Hn(m,a);let t=[];if(h==="seat"){t=[];for(const u of d)for(const p of u.seats)p.x>=s.minX&&p.x<=s.maxX&&p.y>=s.minY&&p.y<=s.maxY&&t.push(p)}return{tier:h,sections:r,rows:h==="section"?[]:d,seats:t,visibleSeatCount:m}}function De(i){if(i.accessType)return i.accessType;if(i.status==="wheelchair"||i.status==="companion")return i.status}function ve(i,s){const a=(s==null?void 0:s[i.id])??i.status;return a==="wheelchair"||a==="companion"?"available":a}function He(i,s,a){var r;const n=(r=s.priceCategories)==null?void 0:r.find(l=>l.id===i.priceCategoryId);return{amount:(n==null?void 0:n.price)??a.basePrice,currency:a.currency}}function Zn(i,s={},a){return!(ve(i,a)!=="available"||s.allowedCategories&&!s.allowedCategories.includes(i.priceCategoryId))}function sn(i,s={},a){const n=[];let r=null;return i.forEach((l,d)=>{Zn(l,s,a)?r?r.seats.push(l):r={start:d,seats:[l]}:r&&(n.push(r),r=null)}),r&&n.push(r),n}function Jn(i,s,a={},n){const r=a.maxSeats??8;if(i.length>r)return{ok:!1,reason:"max-seats"};for(const d of i){const m=s.seatById.get(d);if(m){if(ve(m,n)!=="available")return{ok:!1,reason:"unavailable",seatId:d};if(a.allowedCategories&&!a.allowedCategories.includes(m.priceCategoryId))return{ok:!1,reason:"category-not-allowed",seatId:d}}}if(!a.adjacentOnly||i.length===0)return{ok:!0};const l=new Map;for(const d of i){const m=s.locationById.get(d);if(!m)continue;const h=`${m.sectionId}::${m.rowIndex}`,t=l.get(h);t?t.push(d):l.set(h,[d])}for(const[d,m]of l){const[h,t]=d.split("::"),u=Number(t),p=s.rows.find(c=>c.sectionId===h&&c.rowIndex===u);if(!p)continue;const _=sn(p.seats,a,n),g=new Set(m);let x=null;for(const c of _)if(c.seats.some(N=>g.has(N.id))){if(x)return{ok:!1,reason:"not-adjacent",seatId:m[0]};x=c}if(!x)continue;const b=x.seats.map((c,N)=>g.has(c.id)?N:-1).filter(c=>c>=0);if(b.length===0)continue;const k=b[0],j=b[b.length-1];if(j-k+1!==b.length)return{ok:!1,reason:"not-adjacent",seatId:m[0]};const M=x.seats.length;if(M>1&&(k===1||M-1-j===1))return{ok:!1,reason:"orphan-seat",seatId:m[0]}}return{ok:!0}}function es(i,s,a,n={},r){if(i.includes(s))return{selected:i.filter(m=>m!==s)};const l=[...i,s],d=Jn(l,a,n,r);return d.ok?{selected:l}:{rejected:d.reason??"not-adjacent"}}function ns(i,s,a={},n={},r){if(s<=0)return[];const l=n.categoryId?{...a,allowedCategories:[n.categoryId]}:a;let d=null;for(const m of i.rows)if(!(n.sectionId&&m.sectionId!==n.sectionId))for(const h of sn(m.seats,l,r)){const t=h.seats.length;if(!(t<s))for(let u=0;u+s<=t;u+=1){const p=u+s-1;if(t>s&&(u===1||t-1-p===1))continue;const _=h.seats.slice(u,p+1),g=_.reduce((x,b)=>x+(b.viewScore??50),0)/s;(!d||g>d.score)&&(d={ids:_.map(x=>x.id),score:g})}}return(d==null?void 0:d.ids)??[]}function ss(i,s,a){var u,p,_,g;const n=i.locationById.get(s);if(!n)return null;const r=i.rows.findIndex(x=>x.sectionId===n.sectionId&&x.rowIndex===n.rowIndex);if(r<0)return null;const l=i.rows[r];if(a==="left")return((u=l.seats[n.seatIndex-1])==null?void 0:u.id)??null;if(a==="right")return((p=l.seats[n.seatIndex+1])==null?void 0:p.id)??null;if(a==="row-start")return((_=l.seats[0])==null?void 0:_.id)??null;if(a==="row-end")return((g=l.seats[l.seats.length-1])==null?void 0:g.id)??null;const d=i.rows[a==="up"?r-1:r+1];if(!d)return null;const m=l.seats[n.seatIndex].x;let h=null,t=1/0;for(const x of d.seats){const b=Math.abs(x.x-m);b<t&&(t=b,h=x)}return(h==null?void 0:h.id)??null}function ts(i,s,a){var h,t,u;const n=i.sections.filter(p=>p.seatCount>0);if(n.length===0)return null;const r=s?(h=i.locationById.get(s))==null?void 0:h.sectionId:void 0,l=n.findIndex(p=>p.section.id===r),d=l<0?0:a==="next"?l+1:l-1,m=n[d];return m?((u=(t=i.rows.find(p=>p.sectionId===m.section.id))==null?void 0:t.seats[0])==null?void 0:u.id)??null:null}const we=8;function is(i,s){return i.seats.length===0?0:i.seats.filter(n=>ve(n,s)==="available").length/i.seats.length}const as=({cull:i,selectedIds:s,cursorId:a,statusOverrides:n,sectionColorById:r,interactive:l,onSeatClick:d,onSectionClick:m,describeSeat:h})=>i.tier==="section"?e.jsx("g",{className:"nice-seating-chart__sections",children:i.sections.map(({section:t,bounds:u,seatCount:p})=>e.jsxs("g",{className:"nice-seating-chart__section",children:[e.jsx("rect",{x:u.minX,y:u.minY,width:u.maxX-u.minX,height:u.maxY-u.minY,rx:12,className:"nice-seating-chart__section-shape",style:{fill:r.get(t.id)},role:m?"button":"img","aria-label":`${t.name}, ${p} seats`,tabIndex:m?0:void 0,onClick:m?()=>m(t.id):void 0}),e.jsx("text",{x:(u.minX+u.maxX)/2,y:(u.minY+u.maxY)/2,className:"nice-seating-chart__section-label",textAnchor:"middle",dominantBaseline:"middle","aria-hidden":"true",children:t.name})]},t.id))}):i.tier==="row"?e.jsx("g",{className:"nice-seating-chart__rows",children:i.rows.map(t=>{const u=is(t,n);return e.jsxs("g",{children:[e.jsx("rect",{x:t.bounds.minX,y:t.bounds.minY,width:t.bounds.maxX-t.bounds.minX,height:t.bounds.maxY-t.bounds.minY,rx:8,className:"nice-seating-chart__row-shape",style:{fill:r.get(t.sectionId),fillOpacity:.25+u*.65},role:"img","aria-label":`Row ${t.label}, ${t.seats.length} seats, ${Math.round(u*t.seats.length)} available`}),e.jsx("text",{x:t.bounds.minX-6,y:(t.bounds.minY+t.bounds.maxY)/2,className:"nice-seating-chart__row-label",textAnchor:"end",dominantBaseline:"middle","aria-hidden":"true",children:t.label})]},`${t.sectionId}-${t.rowIndex}`)})}):e.jsx("g",{className:"nice-seating-chart__seats",children:i.seats.map(t=>{const u=ve(t,n),p=De(t),_=s.has(t.id),g=a===t.id,x={row:t.row,number:t.number},b=["nice-seating-chart__seat",`nice-seating-chart__seat--${u}`,_?"nice-seating-chart__seat--selected":"",p?`nice-seating-chart__seat--${p}`:"",g?"nice-seating-chart__seat--cursor":""].filter(Boolean).join(" ");return e.jsxs("g",{className:b,"data-seat-id":t.id,role:"gridcell","aria-selected":_,"aria-disabled":u!=="available","aria-label":h(t),tabIndex:g?0:-1,onClick:l&&d?()=>d(t):void 0,children:[p?e.jsx("rect",{x:t.x-we,y:t.y-we,width:we*2,height:we*2,rx:3,className:"nice-seating-chart__seat-shape",fill:p==="companion"?"url(#nice-seat-companion-hatch)":void 0}):e.jsx("circle",{cx:t.x,cy:t.y,r:we,className:"nice-seating-chart__seat-shape"}),p==="wheelchair"&&e.jsx(B.NtdWheelchair,{size:10,x:t.x-5,y:t.y-5,className:"nice-seating-chart__seat-glyph"}),e.jsx("title",{children:h(t)}),e.jsx("text",{x:t.x,y:t.y,className:"nice-seating-chart__seat-number",textAnchor:"middle",dominantBaseline:"middle","aria-hidden":"true",children:x.number})]},t.id)})}),cs=({index:i,selectedIds:s,statusOverrides:a,maxSeats:n,onSeatToggle:r,onBestAvailable:l,describeSeat:d,disabled:m=!1,defaultOpen:h=!1})=>{var M;const t=o.useMemo(()=>i.sections.filter(c=>c.seatCount>0),[i.sections]),[u,p]=o.useState(((M=t[0])==null?void 0:M.section.id)??""),[_,g]=o.useState(0),[x,b]=o.useState(2),k=o.useMemo(()=>i.rows.filter(c=>c.sectionId===u),[i.rows,u]),j=k.find(c=>c.rowIndex===_)??k[0];return e.jsxs(f.NiceCollapse,{trigger:"Choose seats without the map",defaultExpanded:h,className:"nice-seating-chart__list-panel",children:[l&&e.jsxs("div",{className:"nice-seating-chart__best",children:[e.jsxs("label",{className:"nice-seating-chart__field",children:[e.jsx("span",{children:"How many seats?"}),e.jsx(f.NiceNumericInput,{value:x,onChange:c=>b(Math.max(1,Math.min(n,c??1))),min:1,max:n,size:"xs",disabled:m})]}),e.jsx(f.NiceButton,{size:"sm",variant:"primary",disabled:m,onClick:()=>l(x,{sectionId:u||void 0}),children:"Best available"})]}),e.jsxs("div",{className:"nice-seating-chart__pickers",children:[e.jsxs("label",{className:"nice-seating-chart__field",children:[e.jsx("span",{children:"Section"}),e.jsx(f.NiceSelect,{size:"sm",value:u,disabled:m,onChange:c=>{p(c),g(0)},options:t.map(c=>({value:c.section.id,label:`${c.section.name} (${c.seatCount})`}))})]}),e.jsxs("label",{className:"nice-seating-chart__field",children:[e.jsx("span",{children:"Row"}),e.jsx(f.NiceSelect,{size:"sm",value:String((j==null?void 0:j.rowIndex)??0),disabled:m||k.length===0,onChange:c=>g(Number(c)),options:k.map(c=>({value:String(c.rowIndex),label:`${c.label} (${c.seats.length})`}))})]})]}),j&&e.jsx("ul",{className:"nice-seating-chart__seat-list",children:j.seats.map(c=>{const N=ve(c,a),v=De(c),T=s.has(c.id);return e.jsx("li",{children:e.jsxs(f.NiceButton,{size:"sm",variant:T?"primary":"outline",disabled:m||N!=="available",ariaLabel:d(c),"aria-pressed":T,onClick:()=>r(c),children:[c.number,v&&e.jsx(B.NtdWheelchair,{size:11})]})},c.id)})})]})},rs={zoom:1,pan:{x:0,y:0}};function ls(i={}){const{minZoom:s=.1,maxZoom:a=10,initial:n=rs,viewport:r,onViewportChange:l,disabled:d=!1}=i,[m,h]=o.useState(n),t=r??m,[u,p]=o.useState(!1),_=o.useRef(new Map),g=o.useRef(null),x=o.useRef(null),b=o.useCallback(y=>{r===void 0&&h(y),l==null||l(y)},[r,l]),k=o.useCallback(y=>Math.min(a,Math.max(s,y)),[s,a]),j=o.useCallback((y,E)=>{const X=k(t.zoom*y);if(X===t.zoom)return;const D=X/t.zoom;b({zoom:X,pan:{x:E.x-(E.x-t.pan.x)*D,y:E.y-(E.y-t.pan.y)*D}})},[b,k,t]),M=o.useCallback((y,E,X)=>{const D=E??(X?{x:X.width/2,y:X.height/2}:{x:0,y:0});j(y,D)},[j]),c=o.useCallback((y,E,X=24)=>{const D=Math.max(1,y.maxX-y.minX),I=Math.max(1,y.maxY-y.minY),L=k(Math.min((E.width-X*2)/D,(E.height-X*2)/I));b({zoom:L,pan:{x:(E.width-D*L)/2-y.minX*L,y:(E.height-I*L)/2-y.minY*L}})},[b,k]),N=o.useCallback(()=>b(n),[b,n]),v=o.useCallback(y=>({x:(y.x-t.pan.x)/t.zoom,y:(y.y-t.pan.y)/t.zoom}),[t]),T=o.useCallback(y=>({x:y.x*t.zoom+t.pan.x,y:y.y*t.zoom+t.pan.y}),[t]),S=y=>{const E=y.currentTarget.getBoundingClientRect();return{x:y.clientX-E.left,y:y.clientY-E.top}};return{viewport:t,setViewport:b,containerProps:d?{}:{onWheel:y=>{y.preventDefault();const E=Math.exp(-y.deltaY*.002);j(Math.min(2,Math.max(.5,E)),S(y))},onPointerDown:y=>{var X,D;const E=S(y);if(_.current.set(y.pointerId,E),(D=(X=y.currentTarget).setPointerCapture)==null||D.call(X,y.pointerId),_.current.size===2){const[I,L]=[..._.current.values()];g.current={distance:Math.hypot(I.x-L.x,I.y-L.y)||1,zoom:t.zoom}}else x.current=E,p(!0)},onPointerMove:y=>{if(!_.current.has(y.pointerId))return;const E=S(y);if(_.current.set(y.pointerId,E),_.current.size===2&&g.current){const[I,L]=[..._.current.values()],z=Math.hypot(I.x-L.x,I.y-L.y)||1,A=k(g.current.zoom*(z/g.current.distance)),P={x:(I.x+L.x)/2,y:(I.y+L.y)/2};A!==t.zoom&&j(A/t.zoom,P);return}if(!x.current)return;const X=E.x-x.current.x,D=E.y-x.current.y;x.current=E,b({zoom:t.zoom,pan:{x:t.pan.x+X,y:t.pan.y+D}})},onPointerUp:y=>{_.current.delete(y.pointerId),_.current.size<2&&(g.current=null),_.current.size===0&&(x.current=null,p(!1))},onPointerCancel:y=>{_.current.delete(y.pointerId),g.current=null,x.current=null,p(!1)}},zoomBy:M,fitTo:c,reset:N,screenToWorld:v,worldToScreen:T,panning:u}}const os={"orphan-seat":"That would leave a single empty seat. Pick a different seat.","not-adjacent":"Seats must be next to each other.","max-seats":"You have selected as many seats as this order allows.","category-not-allowed":"That seat is not part of the selected ticket type.",unavailable:"That seat is not available."},tn=o.forwardRef(function(s,a){var ae,be,fe;const{chart:n,mode:r="select",selection:l={},selectedSeatIds:d,defaultSelectedSeatIds:m=[],onSelectionChange:h,onSelectionRejected:t,seatStatusOverrides:u,onSeatClick:p,onBestAvailable:_,lod:g="auto",onLodChange:x,maxRenderedSeats:b=2500,containerSize:k,showLegend:j=!0,showList:M=!1,zoomable:c=!0,locale:N,disabled:v=!1,readOnly:T=!1,className:S,style:R}=s,y=o.useRef(null),[E,X]=o.useState({width:800,height:500}),[D,I]=o.useState(!1),[L,z]=o.useState(m),[A,P]=o.useState(null),[q,F]=o.useState(""),C=d??L,Y=o.useMemo(()=>new Set(C),[C]),V=r==="select"&&!v&&!T&&l.interactive!==!1,K=l.maxSeats??8,O=o.useMemo(()=>Gn(n),[n]),Q=k??E,G=!!k||D;o.useEffect(()=>{if(k||!y.current||typeof ResizeObserver>"u")return;const $=y.current,U=new ResizeObserver(([W])=>{const{width:H,height:J}=W.contentRect;H>0&&J>0&&(X({width:H,height:J}),I(!0))});return U.observe($),()=>U.disconnect()},[k]);const he=ls({disabled:!c||v}),{fitTo:se,viewport:re}=he,pe=o.useRef(!1);o.useEffect(()=>{pe.current||!G||O.totalSeats===0||Q.width<=0||(pe.current=!0,se(O.bounds,Q))},[se,O,Q,G]);const ke=o.useMemo(()=>Wn(re,Q,40),[re,Q]),xe=g!=="auto"?g:A?"seat":void 0,le=o.useMemo(()=>Qn(O,ke,b,xe),[O,ke,b,xe]),ge=o.useRef(null);o.useEffect(()=>{ge.current!==le.tier&&(ge.current=le.tier,x==null||x(le.tier))},[le.tier,x]);const Te=o.useMemo(()=>{var $;return new Map((($=n.sections)==null?void 0:$.map(U=>[U.id,U.color]))??[])},[n.sections]),oe=o.useMemo(()=>{var $;return new Map((($=n.sections)==null?void 0:$.map(U=>[U.id,U]))??[])},[n.sections]),ie=o.useCallback($=>{const U=oe.get($.sectorId),W=ve($,u),H=De($),J=[U?U.name:"",`row ${$.row}`,`seat ${$.number}`].filter(Boolean);if(U&&l.showPrices!==!1){const ce=He($,n,U);J.push(ee(ce.amount,ce.currency,N))}return J.push(W),H==="wheelchair"&&J.push("wheelchair accessible"),H==="companion"&&J.push("companion seat"),J.join(", ")},[n,oe,u,l.showPrices,N]),ne=o.useCallback($=>{d===void 0&&z($),h==null||h($)},[d,h]),Ne=o.useCallback($=>{if(p==null||p($),!V)return;const U=es(C,$.id,O,l,u);if("rejected"in U){t==null||t({reason:U.rejected,seatId:$.id}),F(os[U.rejected]);return}ne(U.selected),F(`${ie($)}. ${U.selected.length} of ${K} selected.`)},[ne,ie,O,V,K,p,t,u,C,l]),de=o.useCallback(($,U)=>{if(_){_($,U);return}const W=ns(O,$,l,U,u);if(W.length===0){F(`No block of ${$} seats together is available.`);return}ne(W),P(W[0]),F(`Selected ${W.length} seats together.`)},[ne,O,_,u,l]),je=o.useCallback($=>{const U=O.locationById.get($);if(!U)return;const W=O.rows.find(H=>H.sectionId===U.sectionId&&H.rowIndex===U.rowIndex);W&&se(W.bounds,Q,80)},[se,O,Q]),ue=o.useCallback($=>{if(!$)return;P($),je($);const U=O.seatById.get($);U&&F(ie(U))},[ie,O.seatById,je]),Ae=$=>{var J,ce;const U=A??((ce=(J=O.rows[0])==null?void 0:J.seats[0])==null?void 0:ce.id)??null;if(!U)return;const H={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Home:"row-start",End:"row-end"}[$.key];if(H){$.preventDefault(),ue(A?ss(O,U,H):U);return}if($.key==="PageDown"||$.key==="PageUp"){$.preventDefault(),ue(ts(O,A,$.key==="PageDown"?"next":"prev"));return}if($.key==="Enter"||$.key===" "){$.preventDefault();const Se=O.seatById.get(U);Se&&Ne(Se);return}$.key==="Escape"&&C.length>0&&($.preventDefault(),ne([]),F("Selection cleared."))};if(O.totalSeats===0)return e.jsx("div",{ref:a,className:`nice-seating-chart ${S??""}`,style:R,children:e.jsx(me,{title:"This chart has no seats",description:"Add sections and rows to the seating chart to see it here."})});const ye=C.reduce(($,U)=>{const W=O.seatById.get(U),H=W?oe.get(W.sectorId):void 0;return!W||!H?$:$+He(W,n,H).amount},0),_e=((be=(ae=n.sections)==null?void 0:ae[0])==null?void 0:be.currency)??"PLN";return e.jsxs("div",{ref:a,className:`nice-seating-chart nice-seating-chart--${r} ${S??""}`,style:R,children:[e.jsxs("div",{ref:y,className:"nice-seating-chart__canvas-host",role:"grid","aria-label":`${n.name} seating chart`,"aria-rowcount":O.rows.length,"aria-colcount":O.totalSeats,tabIndex:A?-1:0,onKeyDown:Ae,...he.containerProps,children:[e.jsxs("svg",{className:"nice-seating-chart__canvas",width:"100%",height:"100%",role:"presentation",children:[e.jsx("defs",{children:e.jsx("pattern",{id:"nice-seat-companion-hatch",width:4,height:4,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)",children:e.jsx("line",{x1:0,y1:0,x2:0,y2:4,className:"nice-seating-chart__hatch"})})}),e.jsx("g",{transform:`translate(${re.pan.x} ${re.pan.y}) scale(${re.zoom})`,children:e.jsx(as,{cull:le,selectedIds:Y,cursorId:A,statusOverrides:u,sectionColorById:Te,interactive:V,onSeatClick:Ne,onSectionClick:l.sectionSelect?$=>{var W;const U=(W=O.rows.find(H=>H.sectionId===$))==null?void 0:W.seats[0];U&&ue(U.id)}:void 0,describeSeat:ie})})]}),c&&e.jsxs("div",{className:"nice-seating-chart__zoom",children:[e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:"Zoom in",onClick:()=>he.zoomBy(1.25,void 0,Q),children:"+"}),e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:"Zoom out",onClick:()=>he.zoomBy(.8,void 0,Q),children:"−"}),e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:"Fit to view",onClick:()=>se(O.bounds,Q),children:"Fit"})]})]}),e.jsx("p",{className:"nice-seating-chart__status",role:"status","aria-live":"polite",children:q}),j&&e.jsxs("ul",{className:"nice-seating-chart__legend",children:[(fe=n.priceCategories)==null?void 0:fe.map($=>e.jsxs("li",{className:"nice-seating-chart__legend-item",children:[e.jsx("span",{className:"nice-seating-chart__legend-swatch",style:{background:$.color},"aria-hidden":"true"}),$.name," · ",ee($.price,_e,N)]},$.id)),e.jsxs("li",{className:"nice-seating-chart__legend-item nice-seating-chart__legend-item--sold",children:[e.jsx("span",{className:"nice-seating-chart__legend-swatch","aria-hidden":"true"})," Sold"]})]}),r==="select"&&C.length>0&&e.jsxs("p",{className:"nice-seating-chart__total",children:[C.length," seat",C.length===1?"":"s"," ·"," ",ee(ye,_e,N)]}),M&&e.jsx(cs,{index:O,selectedIds:Y,statusOverrides:u,maxSeats:K,onSeatToggle:Ne,onBestAvailable:de,describeSeat:ie,disabled:!V,defaultOpen:r==="select"&&M})]})}),ds=o.forwardRef(function({showList:s=!0,className:a,...n},r){return e.jsx(tn,{ref:r,mode:"select",showList:s,className:`nice-seat-picker ${a??""}`,...n})}),an=/\{\{\s*([\w.-]+)\s*\}\}/g,us={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function ms(i){return i.replace(/[&<>"']/g,s=>us[s]??s)}function hs(i){const s=[],a=new Set;for(const n of i.matchAll(an)){const r=n[1];a.has(r)||(a.add(r),s.push(r))}return s}function ps(i,s={},a={}){const{escape:n=!0,missing:r="keep"}=a;return i.replace(an,(l,d)=>{const m=s[d];return m==null?r==="blank"?"":l:n?ms(String(m)):String(m)})}function Qe(i){return`{{${i}}}`}function xs(i,s={}){return hs(i).filter(a=>s[a]===void 0||s[a]===null)}const gs=["bold","italic","underline","h1","h2","ul","ol","link","image","alignLeft","alignCenter","undo","redo"],fs=o.forwardRef(function(s,a){const{template:n,onTemplateChange:r,tokens:l=[],previewData:d={},recipients:m=[],onRecipientsChange:h,onSend:t,sending:u=!1,toolbar:p=gs,disabled:_=!1,readOnly:g=!1,size:x="md",className:b,style:k}=s,[j,M]=o.useState(""),c=_||g||u,N=o.useMemo(()=>en(j),[j]),v=o.useMemo(()=>{const I={};for(const L of l)L.sample!==void 0&&(I[L.key]=L.sample);return{...I,...d}},[l,d]),T=o.useMemo(()=>ps(n.body??"",v),[n.body,v]),S=o.useMemo(()=>xs(n.body??"",v),[n.body,v]),R=m.map(I=>I.email),y=I=>r==null?void 0:r({...n,...I}),E=I=>{y({body:`${n.body??""}${Qe(I)}`})},X=()=>{!h||N.valid.length===0||(h(On(R,N.valid)),M(""))},D=I=>{h==null||h(R.filter(L=>L!==I))};return e.jsxs("div",{ref:a,className:`nice-invitation-designer nice-invitation-designer--${x} ${b??""}`,style:k,children:[e.jsxs("section",{className:"nice-invitation-designer__editor",children:[e.jsx(f.NiceTextInput,{label:"Template name",value:n.name,onChange:I=>y({name:I}),placeholder:"Birthday invitation",disabled:c,size:x}),l.length>0&&!g&&e.jsxs("div",{className:"nice-invitation-designer__tokens",children:[e.jsx("span",{className:"nice-invitation-designer__tokens-label",children:"Insert:"}),l.map(I=>e.jsx(f.NiceButton,{size:"sm",variant:"outline",disabled:c,onClick:()=>E(I.key),children:I.label},I.key))]}),e.jsx(f.NiceHtmlEditor,{value:n.body??"",onChange:I=>y({body:I}),toolbar:p,height:280,readOnly:g||u,disabled:_})]}),e.jsxs("section",{className:"nice-invitation-designer__preview","aria-label":"Invitation preview",children:[e.jsxs("header",{className:"nice-invitation-designer__preview-header",children:[e.jsx("h4",{children:"Preview"}),S.length>0&&e.jsxs(f.NiceBadge,{size:"xs",subtle:!0,variant:"warning",children:[S.length," unresolved"]})]}),n.coverImageUrl&&e.jsx("img",{className:"nice-invitation-designer__cover",src:n.coverImageUrl,alt:""}),e.jsx("div",{className:"nice-invitation-designer__preview-body",dangerouslySetInnerHTML:{__html:T}}),S.length>0&&e.jsxs("p",{className:"nice-invitation-designer__unresolved",children:["No preview value for: ",S.map(I=>Qe(I)).join(", ")]})]}),e.jsxs("section",{className:"nice-invitation-designer__recipients",children:[e.jsx("header",{className:"nice-invitation-designer__recipients-header",children:e.jsxs("h4",{children:["Recipients ",e.jsxs("span",{children:["(",m.length,")"]})]})}),h&&!g&&e.jsxs(e.Fragment,{children:[e.jsx(f.NiceTextArea,{label:"Add addresses",value:j,onChange:M,placeholder:"Paste a list — commas, semicolons or new lines",rows:3,disabled:c,size:x}),e.jsxs("div",{className:"nice-invitation-designer__paste-actions",children:[e.jsxs(f.NiceButton,{size:x,variant:"outline",leftIcon:e.jsx(B.NtdMail,{size:15}),disabled:c||N.valid.length===0,onClick:X,children:["Add ",N.valid.length>0?`(${N.valid.length})`:""]}),(N.invalid.length>0||N.duplicates>0)&&e.jsxs("span",{className:"nice-invitation-designer__paste-hint",children:[N.duplicates>0&&`${N.duplicates} duplicate(s). `,N.invalid.length>0&&`${N.invalid.length} not recognised: ${N.invalid.slice(0,3).join(", ")}`]})]})]}),m.length>0&&e.jsx("ul",{className:"nice-invitation-designer__recipient-list",children:m.map(I=>e.jsxs("li",{className:"nice-invitation-designer__recipient",children:[e.jsx("span",{children:I.name?`${I.name} <${I.email}>`:I.email}),I.status&&I.status!=="pending"&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:I.status==="sent"?"success":"error",children:I.status}),h&&!g&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:`Remove ${I.email}`,disabled:c,onClick:()=>D(I.email),children:e.jsx(B.NtdTrash,{size:13})})]},I.email))}),t&&!g&&e.jsx(f.NiceButton,{variant:"primary",size:x,leftIcon:e.jsx(B.NtdSend,{size:15}),loading:u,ariaLabel:"Send invitations",disabled:_||u||m.length===0,onClick:()=>t({templateId:n.id,emails:R}),children:u?"Sending…":`Send to ${m.length}`})]})]})}),vs=({value:i,max:s,currency:a,locale:n,label:r,className:l})=>{const d=s>0?s:1,m=i>=s&&s>0,h=(t,u)=>a?`${ee(t,a,n)} / ${ee(u,a,n)}`:`${t} / ${u}`;return e.jsx(f.NiceProgress,{className:l,value:Math.min(i,d),max:d,variant:m?"success":"primary",size:"sm",showValue:!0,formatValue:()=>h(i,s),"aria-label":r})};function Ns(i,s){if(s==="wishlist")return{value:i.isPurchased?1:0,max:1,complete:!!i.isPurchased};const a=i.quantityNeeded??1,n=i.quantityContributed??0;return{value:n,max:a,complete:a>0&&n>=a}}const js=o.forwardRef(function(s,a){const{items:n,kind:r="registry",mode:l="owner",currency:d="PLN",locale:m,hideContributors:h=!1,currentUserId:t,currentUserName:u,onContribute:p,onClaim:_,onUnclaim:g,onItemAdd:x,onItemDelete:b,onItemClick:k,layout:j="grid",disabled:M=!1,readOnly:c=!1,size:N="md",className:v,style:T}=s,S=nn({currentUserId:t,currentUserName:u}),[R,y]=o.useState(null),[E,X]=o.useState(0),[D,I]=o.useState(""),L=l==="owner",z=M||c,A=r==="wishlist",P=o.useMemo(()=>A?[...n].sort((C,Y)=>Number(C.isPurchased??!1)-Number(Y.isPurchased??!1)||(Y.priority??0)-(C.priority??0)):n,[n,A]),q=()=>{y(null),X(0)},F=C=>{!p||!S.canAct||(p(C.id,{amount:E>0?E:void 0,quantity:E>0?void 0:1,userName:S.actor.userName,userId:S.actor.userId}),q())};return n.length===0?e.jsx("div",{ref:a,className:`nice-gift-registry ${v??""}`,style:T,children:e.jsx(me,{icon:e.jsx(B.NtdGiftCard,{size:28}),title:A?"Nothing on the wishlist yet":"No gifts on the registry yet",description:L?"Add what you would like and share the link.":"The host has not added anything yet."})}):e.jsxs("div",{ref:a,className:`nice-gift-registry nice-gift-registry--${r} nice-gift-registry--${j} nice-gift-registry--${N} ${v??""}`,style:T,children:[!L&&S.isAnonymous&&(p||_)&&e.jsx(f.NiceTextInput,{label:"Your name",value:S.name,onChange:S.setName,placeholder:"So the host knows who to thank",required:!0,disabled:z,size:N}),e.jsx(f.NiceCardGroup,{columns:j==="list"?1:void 0,minColumnWidth:240,gap:12,children:P.map(C=>{const{value:Y,max:V,complete:K}=Ns(C,r),O=C.price,Q=C.contributions??[];return e.jsxs("div",{className:`nice-gift-registry__item${K?" nice-gift-registry__item--complete":""}`,children:[C.imageUrl&&e.jsx("img",{src:C.imageUrl,alt:"",className:"nice-gift-registry__image",loading:"lazy"}),e.jsxs("div",{className:"nice-gift-registry__body",children:[e.jsx("button",{type:"button",className:"nice-gift-registry__title",onClick:()=>k==null?void 0:k(C),disabled:!k,children:C.title}),C.description&&e.jsx("p",{className:"nice-gift-registry__description",children:C.description}),e.jsxs("div",{className:"nice-gift-registry__facts",children:[O&&e.jsx("span",{className:"nice-gift-registry__price",children:ee(O.amount,O.currency||d,m)}),A&&(C.priority??0)>0&&e.jsxs(f.NiceBadge,{size:"xs",subtle:!0,variant:"warning",children:[e.jsx(B.NtdStar,{size:11})," ",C.priority]}),K&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:"success",children:A?"bought":"fully covered"}),C.url&&e.jsxs("a",{className:"nice-gift-registry__link",href:C.url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(B.NtdLink,{size:13})," Shop"]})]}),!A&&e.jsx(vs,{value:Y,max:V,label:`${C.title}: ${Y} of ${V} covered`}),!h&&Q.length>0&&e.jsx("ul",{className:"nice-gift-registry__contributors",children:Q.map(G=>e.jsxs("li",{className:"nice-gift-registry__contributor",children:[e.jsx("strong",{children:G.contributorName}),G.amount!==void 0&&` — ${ee(G.amount,(O==null?void 0:O.currency)||d,m)}`,G.amount===void 0&&G.quantity?` — ${G.quantity}×`:"",G.message&&e.jsxs("em",{children:[" “",G.message,"”"]})]},G.id))}),e.jsxs("div",{className:"nice-gift-registry__actions",children:[!L&&!K&&_&&e.jsx(f.NiceButton,{size:"sm",variant:"primary",disabled:z||!S.canAct,leftIcon:e.jsx(B.NtdCheck,{size:14}),onClick:()=>_(C.id,{...S.actor,quantity:1}),children:"I'll take this"}),!L&&K&&g&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",disabled:z,onClick:()=>g(C.id),children:"Release"}),!L&&!K&&!A&&p&&e.jsx(f.NiceButton,{size:"sm",variant:"outline",disabled:z||!S.canAct,onClick:()=>y(R===C.id?null:C.id),children:"Chip in"}),L&&b&&!c&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:`Delete ${C.title}`,disabled:M,onClick:()=>b(C.id),children:e.jsx(B.NtdTrash,{size:14})})]}),R===C.id&&e.jsxs("div",{className:"nice-gift-registry__pledge",children:[e.jsxs("label",{className:"nice-gift-registry__pledge-field",children:[e.jsxs("span",{children:["Amount (",(O==null?void 0:O.currency)||d,")"]}),e.jsx(f.NiceNumericInput,{value:E,onChange:G=>X(Math.max(0,G??0)),min:0,size:"xs",disabled:z})]}),e.jsx(f.NiceButton,{size:"sm",variant:"primary",disabled:z||!S.canAct,onClick:()=>F(C),children:"Confirm"}),e.jsx(f.NiceButton,{size:"sm",variant:"ghost",onClick:q,children:"Cancel"})]})]})]},C.id)})}),L&&x&&!c&&e.jsxs("div",{className:"nice-gift-registry__add",children:[e.jsx(f.NiceTextInput,{label:A?"Add a wish":"Add a gift",value:D,onChange:I,placeholder:"What would you like?",disabled:M,size:N}),e.jsx(f.NiceButton,{variant:"primary",size:N,leftIcon:e.jsx(B.NtdPlus,{size:15}),disabled:M||!D.trim(),onClick:()=>{x({title:D.trim(),quantityNeeded:1}),I("")},children:"Add"})]})]})});function ys(i){const s=new Map;for(const a of i){const n=(a.currency||"").toUpperCase(),r=s.get(n);r?r.push(a):s.set(n,[a])}return s}function _s(i,s,a){var h;const n=new Set(s.map(t=>t.id)),r=s.map(t=>t.id),l=new Map(r.map(t=>[t,0])),d=[];let m=0;if(r.length===0)return{balances:l,issues:i.map(t=>({itemId:t.id,reason:"no-participants"})),totalMinor:0};for(const t of i){const u=t.paidById;if(!u){d.push({itemId:t.id,reason:"no-payer"});continue}if(!n.has(u)){d.push({itemId:t.id,reason:"unknown-payer"});continue}let p=(h=t.splitAmong)!=null&&h.length?t.splitAmong.filter(j=>n.has(j)):r;p.length===0&&(p=r);const _=Ee(t.amount,a);m+=_;const g=p.length,x=Math.floor(_/g),b=_-x*g,k=new Map(p.map(j=>[j,x]));if(b!==0)if(k.has(u))k.set(u,(k.get(u)??0)+b);else{const j=[...p].sort(Me),M=b>0?1:-1;for(let c=0;c<Math.abs(b);c+=1){const N=j[c%j.length];k.set(N,(k.get(N)??0)+M)}}l.set(u,(l.get(u)??0)+_);for(const[j,M]of k)l.set(j,(l.get(j)??0)-M)}return{balances:l,issues:d,totalMinor:m}}function bs(i,s,a){for(const n of s){if((n.currency||"").toUpperCase()!==a||!i.has(n.fromId)||!i.has(n.toId))continue;const r=Ee(n.amount,a);i.set(n.fromId,(i.get(n.fromId)??0)+r),i.set(n.toId,(i.get(n.toId)??0)-r)}}function ws(i,s,a){const n=new Map(s.map(t=>[t.id,t.name])),r=[...i.entries()].filter(([,t])=>t>0).map(([t,u])=>({id:t,v:u})).sort((t,u)=>u.v-t.v||Me(t.id,u.id)),l=[...i.entries()].filter(([,t])=>t<0).map(([t,u])=>({id:t,v:u})).sort((t,u)=>t.v-u.v||Me(t.id,u.id)),d=[];let m=0,h=0;for(;m<l.length&&h<r.length;){const t=Math.min(-l[m].v,r[h].v);t>0&&d.push({fromId:l[m].id,fromName:n.get(l[m].id)??l[m].id,toId:r[h].id,toName:n.get(r[h].id)??r[h].id,amount:ze(t,a),currency:a}),l[m].v+=t,r[h].v-=t,l[m].v===0&&(m+=1),r[h].v===0&&(h+=1)}return d}function ks(i,s,a=[]){const n=[],r=[],l=[...ys(i).entries()].sort(([d],[m])=>Me(d,m));for(const[d,m]of l){const h=_s(m,s,d);r.push(...h.issues),bs(h.balances,a,d),n.push({currency:d,total:ze(h.totalMinor,d),balances:s.map(t=>({participantId:t.id,participantName:t.name,amount:ze(h.balances.get(t.id)??0,d),currency:d})),transfers:ws(h.balances,s,d)})}return{groups:n,issues:r}}function Me(i,s){return i<s?-1:i>s?1:0}const Ss=o.forwardRef(function(s,a){const{items:n,participants:r,settlements:l=[],view:d,defaultView:m="expenses",onViewChange:h,onSettle:t,onItemDelete:u,onItemClick:p,onValidationChange:_,sortBy:g="date",locale:x,disabled:b=!1,readOnly:k=!1,size:j="md",className:M,style:c}=s,[N,v]=o.useState(m),T=d??N,S=b||k,R=o.useMemo(()=>r.map(z=>({id:z.id,name:z.name})),[r]),y=o.useMemo(()=>ks(n,R,l),[n,R,l]),E=o.useMemo(()=>g==="none"?n:n.map((z,A)=>({item:z,index:A})).sort((z,A)=>{if(g==="amount")return A.item.amount-z.item.amount||z.index-A.index;const P=z.item.incurredAt,q=A.item.incurredAt;return P&&q?P.localeCompare(q)||z.index-A.index:P?-1:q?1:z.index-A.index}).map(z=>z.item),[n,g]),X=y.issues.map(z=>`${z.itemId}:${z.reason}`).join("|");o.useEffect(()=>{_==null||_(y.issues)},[X]);const D=o.useMemo(()=>new Map(r.map(z=>[z.id,z.avatarUrl])),[r]),I=o.useMemo(()=>new Map(y.issues.map(z=>[z.itemId,z.reason])),[y.issues]),L=z=>{d===void 0&&v(z),h==null||h(z)};return n.length===0?e.jsx("div",{ref:a,className:`nice-expense-split ${M??""}`,style:c,children:e.jsx(me,{icon:e.jsx(B.NtdReceipt,{size:28}),title:"No expenses yet",description:"Add what people paid for and this will work out who owes whom."})}):e.jsxs("div",{ref:a,className:`nice-expense-split nice-expense-split--${j} ${M??""}`,style:c,children:[e.jsx(f.NiceSegmentedControl,{size:j,value:T,onChange:z=>L(z),options:[{value:"expenses",label:"Expenses"},{value:"balances",label:"Balances"},{value:"settlement",label:"Settle up"}]}),T==="expenses"&&e.jsx("ul",{className:"nice-expense-split__items",children:E.map(z=>{const A=I.get(z.id);return e.jsxs("li",{className:`nice-expense-split__item${A?" nice-expense-split__item--excluded":""}`,children:[e.jsxs("button",{type:"button",className:"nice-expense-split__item-main",onClick:()=>p==null?void 0:p(z),disabled:!p,children:[e.jsx("span",{className:"nice-expense-split__item-label",children:z.label}),e.jsxs("span",{className:"nice-expense-split__item-payer",children:[z.paidByName??z.paidById??"nobody"," paid"]})]}),e.jsx("span",{className:"nice-expense-split__item-amount",children:ee(z.amount,z.currency,x)}),z.isPaid&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:"success",children:"paid"}),A&&e.jsx(f.NiceBadge,{size:"xs",subtle:!0,variant:"warning",children:A==="no-payer"?"no payer":"unknown payer"}),u&&!k&&e.jsx(f.NiceButton,{size:"sm",variant:"ghost",ariaLabel:`Delete ${z.label}`,disabled:b,onClick:()=>u(z.id),children:e.jsx(B.NtdTrash,{size:14})})]},z.id)})}),T==="balances"&&y.groups.map(z=>e.jsxs("section",{className:"nice-expense-split__group",children:[e.jsxs("h4",{className:"nice-expense-split__group-title",children:[z.currency,e.jsxs("span",{className:"nice-expense-split__group-total",children:[ee(z.total,z.currency,x)," total"]})]}),e.jsx("ul",{className:"nice-participant-list__rows",children:z.balances.map(A=>e.jsx($e,{participant:{id:A.participantId,name:A.participantName,avatarUrl:D.get(A.participantId)},showRole:!1,showStatus:!1,size:j,children:e.jsxs("span",{className:`nice-expense-split__balance nice-expense-split__balance--${A.amount>0?"owed":A.amount<0?"owes":"settled"}`,children:[A.amount===0?"settled up":ee(Math.abs(A.amount),A.currency,x),A.amount>0&&e.jsx("em",{children:" is owed"}),A.amount<0&&e.jsx("em",{children:" owes"})]})},A.participantId))})]},z.currency)),T==="settlement"&&(y.groups.every(z=>z.transfers.length===0)?e.jsx(me,{icon:e.jsx(B.NtdCoins,{size:28}),title:"All settled up",description:"Nobody owes anybody anything."}):y.groups.filter(z=>z.transfers.length>0).map(z=>e.jsxs("section",{className:"nice-expense-split__group",children:[e.jsxs("h4",{className:"nice-expense-split__group-title",children:[z.currency,e.jsxs("span",{className:"nice-expense-split__group-total",children:[z.transfers.length," transfer",z.transfers.length===1?"":"s"]})]}),e.jsx("ul",{className:"nice-expense-split__transfers",children:z.transfers.map(A=>e.jsxs("li",{className:"nice-expense-split__transfer",children:[e.jsx("span",{className:"nice-expense-split__transfer-from",children:A.fromName}),e.jsx(B.NtdArrowRight,{size:15}),e.jsx("span",{className:"nice-expense-split__transfer-to",children:A.toName}),e.jsx("span",{className:"nice-expense-split__transfer-amount",children:ee(A.amount,A.currency,x)}),t&&!k&&e.jsx(f.NiceButton,{size:"sm",variant:"outline",disabled:S,onClick:()=>t(A),children:"Mark paid"})]},`${A.fromId}-${A.toId}-${A.amount}`))})]},z.currency)))]})}),Is={upcoming:"⏳",active:"▶️",voting:"🗳️",scored:"📊",completed:"✅",skipped:"⏭️"},Cs={upcoming:"#9ca3af",active:"#22c55e",voting:"#eab308",scored:"#3b82f6",completed:"#6b7280",skipped:"#d1d5db"},zs=o.forwardRef(function(s,a){const{rounds:n,activeRoundId:r,onSelect:l,onStart:d,onEnd:m,onCreate:h,editable:t=!1,className:u,style:p}=s,_=[...n].sort((g,x)=>g.order-x.order);return e.jsxs("div",{ref:a,className:`nice-round-list ${u??""}`,style:p,children:[e.jsxs("div",{className:"nice-round-list__header",children:[e.jsxs("h3",{children:["Rounds (",n.length,")"]}),t&&h&&e.jsx("button",{onClick:h,children:"+ Add Round"})]}),_.length===0?e.jsx("p",{className:"nice-round-list__empty",children:"No rounds yet."}):e.jsx("div",{className:"nice-round-list__items",children:_.map(g=>{const x=g.id===r;return e.jsxs("div",{className:`nice-round-list__item ${x?"nice-round-list__item--active":""}`,onClick:()=>l==null?void 0:l(g),role:l?"button":void 0,tabIndex:l?0:void 0,children:[e.jsxs("span",{className:"nice-round-list__order",children:["#",g.order]}),e.jsx("span",{className:"nice-round-list__icon",children:Is[g.status]}),e.jsxs("div",{className:"nice-round-list__info",children:[e.jsx("strong",{className:"nice-round-list__name",children:g.name}),g.description&&e.jsx("small",{children:g.description}),g.type&&e.jsx("span",{className:"nice-round-list__type",children:g.type})]}),e.jsx("span",{className:"nice-round-list__status",style:{color:Cs[g.status]},children:g.status}),g.durationMinutes&&e.jsxs("span",{className:"nice-round-list__duration",children:[g.durationMinutes,"m"]}),g.winnerIds&&g.winnerIds.length>0&&e.jsxs("span",{className:"nice-round-list__winners",children:["🏆 ",g.winnerIds.length]}),t&&e.jsxs("div",{className:"nice-round-list__actions",onClick:b=>b.stopPropagation(),children:[g.status==="upcoming"&&d&&e.jsx("button",{onClick:()=>d(g.id),children:"Start"}),(g.status==="active"||g.status==="voting")&&m&&e.jsx("button",{onClick:()=>m(g.id),children:"End"})]})]},g.id)})})]})}),Ms=o.forwardRef(function(s,a){const{round:n,timerRunning:r=!1,remainingSeconds:l,onSubmitScore:d,onStart:m,onEnd:h,onSkip:t,editable:u=!1,footerActions:p,className:_,style:g}=s,[x,b]=o.useState({}),k=o.useCallback(c=>{const N=parseFloat(x[c]??"");isNaN(N)||!d||(d(c,N),b(v=>({...v,[c]:""})))},[x,d]),j=c=>{const N=Math.floor(c/60),v=c%60;return`${N}:${v.toString().padStart(2,"0")}`},M=n.scores?[...n.scores].sort((c,N)=>N.score-c.score):[];return e.jsxs("div",{ref:a,className:`nice-round-card nice-round-card--${n.status} ${_??""}`,style:g,children:[e.jsxs("div",{className:"nice-round-card__header",children:[e.jsxs("span",{className:"nice-round-card__order",children:["Round #",n.order]}),e.jsx("h3",{className:"nice-round-card__name",children:n.name}),e.jsx("span",{className:"nice-round-card__status",children:n.status})]}),n.description&&e.jsx("p",{className:"nice-round-card__description",children:n.description}),(r||l!=null)&&e.jsxs("div",{className:`nice-round-card__timer ${r?"nice-round-card__timer--running":""}`,children:["⏱️ ",l!=null?j(l):"—"]}),M.length>0&&e.jsxs("div",{className:"nice-round-card__scoreboard",children:[e.jsx("h4",{children:"Scoreboard"}),e.jsxs("table",{className:"nice-round-card__scores-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Rank"}),e.jsx("th",{children:"Participant"}),e.jsx("th",{children:"Score"})]})}),e.jsx("tbody",{children:M.map((c,N)=>e.jsxs("tr",{className:N<3?`nice-round-card__top-${N+1}`:"",children:[e.jsxs("td",{children:[c.rank??N+1,N===0?" 🥇":N===1?" 🥈":N===2?" 🥉":""]}),e.jsx("td",{children:c.participantName}),e.jsx("td",{children:c.score})]},c.participantId))})]})]}),d&&(n.status==="active"||n.status==="voting")&&M.length>0&&e.jsxs("div",{className:"nice-round-card__score-input",children:[e.jsx("h4",{children:"Submit Scores"}),M.map(c=>e.jsxs("div",{className:"nice-round-card__score-row",children:[e.jsx("span",{children:c.participantName}),e.jsx("input",{type:"number",value:x[c.participantId]??"",onChange:N=>b(v=>({...v,[c.participantId]:N.target.value})),min:0,step:1,placeholder:"Score"}),e.jsx("button",{onClick:()=>k(c.participantId),children:"Submit"})]},c.participantId))]}),e.jsxs("div",{className:"nice-round-card__footer",children:[u&&e.jsxs("div",{className:"nice-round-card__actions",children:[n.status==="upcoming"&&m&&e.jsx("button",{onClick:m,children:"▶ Start Round"}),(n.status==="active"||n.status==="voting")&&h&&e.jsx("button",{onClick:h,children:"⏹ End Round"}),n.status==="upcoming"&&t&&e.jsx("button",{onClick:t,children:"⏭ Skip"})]}),p]}),n.winnerIds&&n.winnerIds.length>0&&e.jsxs("div",{className:"nice-round-card__winners",children:["🏆 Winners: ",n.winnerIds.length]})]})}),Ts=o.forwardRef(function(s,a){const{songs:n,onAdd:r,onRemove:l,onVote:d,onSearch:m,showQueue:h=!0,readOnly:t=!1,className:u,style:p}=s,[_,g]=o.useState(""),x=o.useMemo(()=>{if(!_.trim())return n;const c=_.toLowerCase();return n.filter(N=>N.title.toLowerCase().includes(c)||N.artist.toLowerCase().includes(c))},[n,_]),b=o.useMemo(()=>n.filter(c=>c.isQueued),[n]),k=n.find(c=>c.isPlaying),j=c=>{g(c),m==null||m(c)},M=c=>{if(!c)return"";const N=Math.floor(c/60),v=c%60;return`${N}:${v.toString().padStart(2,"0")}`};return e.jsxs("div",{ref:a,className:`nice-song-picker ${u??""}`,style:p,children:[k&&e.jsxs("div",{className:"nice-song-picker__now-playing",children:[e.jsx("span",{className:"nice-song-picker__np-label",children:"🎵 Now Playing"}),k.albumArt&&e.jsx("img",{src:k.albumArt,alt:"",className:"nice-song-picker__album-art"}),e.jsx("strong",{children:k.title}),e.jsx("span",{children:k.artist})]}),e.jsx("input",{type:"text",value:_,onChange:c=>j(c.target.value),placeholder:"Search songs…",className:"nice-song-picker__search"}),e.jsx("div",{className:"nice-song-picker__list",children:x.length===0?e.jsx("p",{className:"nice-song-picker__empty",children:"No songs found."}):x.map(c=>e.jsxs("div",{className:`nice-song-picker__item ${c.isPlaying?"nice-song-picker__item--playing":""}`,children:[c.albumArt&&e.jsx("img",{src:c.albumArt,alt:"",className:"nice-song-picker__thumb"}),e.jsxs("div",{className:"nice-song-picker__info",children:[e.jsx("strong",{children:c.title}),e.jsx("span",{children:c.artist}),c.duration&&e.jsx("span",{className:"nice-song-picker__duration",children:M(c.duration)}),c.addedByName&&e.jsxs("small",{children:["Added by ",c.addedByName]})]}),!t&&e.jsxs("div",{className:"nice-song-picker__actions",children:[d&&e.jsxs("button",{onClick:()=>d(c.id),children:["👍 ",c.votes??0]}),r&&!c.isQueued&&e.jsx("button",{onClick:()=>r(c.id),children:"+ Queue"}),l&&c.isQueued&&e.jsx("button",{onClick:()=>l(c.id),children:"Remove"})]})]},c.id))}),h&&b.length>0&&e.jsxs("div",{className:"nice-song-picker__queue",children:[e.jsxs("h4",{children:["Queue (",b.length,")"]}),b.map((c,N)=>e.jsxs("div",{className:"nice-song-picker__queue-item",children:[e.jsxs("span",{className:"nice-song-picker__queue-pos",children:[N+1,"."]}),e.jsxs("span",{children:[c.title," — ",c.artist]})]},c.id))]})]})}),As=o.forwardRef(function(s,a){const{songs:n,queue:r=[],onEnqueue:l,onDequeue:d,onNext:m,nowPlayingId:h,readOnly:t=!1,className:u,style:p}=s,[_,g]=o.useState(""),[x,b]=o.useState(""),k=n.find(v=>v.id===h),j=o.useMemo(()=>{let v=n;if(_.trim()){const T=_.toLowerCase();v=v.filter(S=>S.title.toLowerCase().includes(T)||S.artist.toLowerCase().includes(T))}return x&&(v=v.filter(T=>T.difficulty===x)),v},[n,_,x]),M=o.useMemo(()=>new Set(r.map(v=>v.id)),[r]),c=["easy","medium","hard","expert"],N=v=>{switch(v){case"easy":return"#4caf50";case"medium":return"#ff9800";case"hard":return"#f44336";case"expert":return"#9c27b0";default:return"#999"}};return e.jsxs("div",{ref:a,className:`nice-karaoke-picker ${u??""}`,style:p,children:[k&&e.jsxs("div",{className:"nice-karaoke-picker__now-singing",style:{borderLeft:"4px solid #e91e63",padding:"12px",marginBottom:12,background:"#fce4ec"},children:[e.jsx("span",{style:{fontWeight:600},children:"🎤 Now Singing"}),e.jsxs("div",{children:[e.jsx("strong",{children:k.title})," — ",k.artist,k.performerName&&e.jsxs("span",{children:[" (by ",k.performerName,")"]})]}),!t&&m&&e.jsx("button",{onClick:m,style:{marginTop:8},children:"Skip / Next ⏭"})]}),e.jsxs("div",{className:"nice-karaoke-picker__filters",style:{display:"flex",gap:8,marginBottom:12},children:[e.jsx("input",{type:"text",value:_,onChange:v=>g(v.target.value),placeholder:"Search songs or artists…",style:{flex:1}}),e.jsxs("select",{value:x,onChange:v=>b(v.target.value),children:[e.jsx("option",{value:"",children:"All Difficulties"}),c.map(v=>e.jsx("option",{value:v,children:v},v))]})]}),e.jsx("div",{className:"nice-karaoke-picker__catalog",children:j.length===0?e.jsx("p",{children:"No songs match your search."}):j.map(v=>e.jsxs("div",{className:"nice-karaoke-picker__song",style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #eee"},children:[e.jsxs("div",{children:[e.jsx("strong",{children:v.title})," — ",v.artist,v.difficulty&&e.jsxs("span",{style:{marginLeft:8,fontSize:12,color:N(v.difficulty),fontWeight:600},children:["[",v.difficulty,"]"]}),v.hasLyrics&&e.jsx("span",{style:{marginLeft:6,fontSize:12},title:"Lyrics available",children:"📝"}),v.language&&e.jsxs("span",{style:{marginLeft:6,fontSize:12,color:"#666"},children:["(",v.language,")"]})]}),!t&&e.jsx("div",{children:M.has(v.id)?e.jsx("button",{onClick:()=>d==null?void 0:d(v.id),style:{color:"#f44336"},children:"Remove"}):e.jsx("button",{onClick:()=>l==null?void 0:l(v.id),children:"🎤 Sing"})})]},v.id))}),r.length>0&&e.jsxs("div",{className:"nice-karaoke-picker__queue",style:{marginTop:16},children:[e.jsxs("h4",{children:["🎶 Queue (",r.length,")"]}),r.map((v,T)=>e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"4px 0"},children:[e.jsxs("span",{children:[e.jsxs("strong",{children:[T+1,"."]})," ",v.title," — ",v.artist,v.performerName&&e.jsxs("em",{children:[" (",v.performerName,")"]})]}),!t&&d&&e.jsx("button",{onClick:()=>d(v.id),style:{fontSize:12},children:"✕"})]},v.id))]})]})}),Ze={game:B.NtdGamepad,music:B.NtdMusic,dance:B.NtdMusic,quiz:B.NtdHelp,karaoke:B.NtdMicrophone,photo:B.NtdCamera,custom:B.NtdSparkle},$s={game:"Games",music:"Music",dance:"Dance",quiz:"Quiz",karaoke:"Karaoke",photo:"Photo",custom:"Custom"},Ps=o.forwardRef(function(s,a){const{attractions:n,onSelect:r,onDeselect:l,onVote:d,selectedIds:m=[],maxSelections:h,showVotes:t=!0,readOnly:u=!1,layout:p="grid",className:_,style:g}=s,[x,b]=o.useState(""),[k,j]=o.useState(""),M=o.useMemo(()=>new Set(m),[m]),c=o.useMemo(()=>{const S=new Set(n.map(R=>R.category));return Array.from(S)},[n]),N=o.useMemo(()=>{let S=n;if(x&&(S=S.filter(R=>R.category===x)),k.trim()){const R=k.toLowerCase();S=S.filter(y=>{var E;return y.name.toLowerCase().includes(R)||((E=y.description)==null?void 0:E.toLowerCase().includes(R))})}return S},[n,x,k]),v=!h||M.size<h,T=S=>{u||(M.has(S)?l==null||l(S):v&&(r==null||r(S)))};return e.jsxs("div",{ref:a,className:`nice-attraction-picker ${_??""}`,style:{color:"var(--text-primary)",...g},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:12},children:[e.jsx("h3",{style:{margin:0},children:"Attractions"}),h&&e.jsxs("span",{style:{color:"var(--text-secondary, #64748b)",fontSize:14},children:[M.size,"/",h," selected"]})]}),e.jsxs("div",{style:{display:"flex",gap:8,marginBottom:12,flexWrap:"wrap"},children:[e.jsx("input",{type:"text",value:k,onChange:S=>j(S.target.value),placeholder:"Search attractions…",style:{flex:1,minWidth:150}}),e.jsx("button",{onClick:()=>b(""),style:{fontWeight:x?400:700},children:"All"}),c.map(S=>e.jsxs("button",{onClick:()=>b(S===x?"":S),style:{fontWeight:S===x?700:400,display:"inline-flex",alignItems:"center",gap:4},children:[o.createElement(Ze[S],{size:14})," ",$s[S]]},S))]}),e.jsx("div",{style:{display:p==="grid"?"grid":"flex",gridTemplateColumns:p==="grid"?"repeat(auto-fill, minmax(200px, 1fr))":void 0,gap:12,flexDirection:p==="list"?"column":void 0},children:N.length===0?e.jsx("p",{children:"No attractions found."}):N.map(S=>{const R=M.has(S.id);return e.jsxs("div",{className:"nice-attraction-picker__card",style:{border:R?"2px solid var(--color-primary, #6366f1)":"1px solid var(--border-color, #cbd5e1)",borderRadius:8,padding:12,cursor:u?"default":"pointer",background:R?"color-mix(in srgb, var(--color-primary) 12%, transparent)":"var(--bg-elevated, var(--bg-primary))",transition:"all 0.2s"},onClick:()=>T(S.id),children:[S.imageUrl&&e.jsx("img",{src:S.imageUrl,alt:S.name,style:{width:"100%",borderRadius:6,marginBottom:8,objectFit:"cover",maxHeight:120}}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{display:"inline-flex"},children:o.createElement(Ze[S.category],{size:16})}),e.jsx("strong",{children:S.name})]}),S.description&&e.jsx("p",{style:{fontSize:13,color:"var(--text-secondary, #64748b)",margin:"6px 0"},children:S.description}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:8},children:[t&&e.jsxs("span",{style:{fontSize:13,display:"inline-flex",alignItems:"center",gap:4},children:[e.jsx(B.NtdThumbsUp,{size:14})," ",S.votes??0]}),!u&&d&&e.jsx("button",{onClick:y=>{y.stopPropagation(),d(S.id)},style:{fontSize:12},children:"Vote"})]})]},S.id)})})]})}),Bs={game:B.NtdGamepad,music:B.NtdMusic,dance:B.NtdMusic,quiz:B.NtdHelp,karaoke:B.NtdMicrophone,photo:B.NtdCamera,custom:B.NtdSparkle},Rs=o.forwardRef(function(s,a){const{attractions:n,onVote:r,onUnvote:l,votedIds:d=[],maxVotes:m,closed:h=!1,sortBy:t="votes",showResults:u=!0,className:p,style:_}=s,g=o.useMemo(()=>new Set(d),[d]),x=m?m-g.size:void 0,b=o.useMemo(()=>{const c=[...n];switch(t){case"votes":c.sort((N,v)=>(v.votes??0)-(N.votes??0));break;case"name":c.sort((N,v)=>N.name.localeCompare(v.name));break;case"category":c.sort((N,v)=>N.category.localeCompare(v.category));break}return c},[n,t]),k=o.useMemo(()=>Math.max(...n.map(c=>c.votes??0),1),[n]),j=c=>{h||(g.has(c)?l==null||l(c):(!x||x>0)&&(r==null||r(c)))},M=c=>{switch(c){case 0:return e.jsx(B.NtdTrophy,{size:18,primaryColor:"#f59e0b",title:"1st place"});case 1:return e.jsx(B.NtdMedal,{size:18,primaryColor:"#94a3b8",title:"2nd place"});case 2:return e.jsx(B.NtdMedal,{size:18,primaryColor:"#b45309",title:"3rd place"});default:return`${c+1}.`}};return e.jsxs("div",{ref:a,className:`nice-attraction-voting ${p??""}`,style:{color:"var(--text-primary)",..._},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[e.jsxs("h3",{style:{margin:0,display:"inline-flex",alignItems:"center",gap:8},children:[e.jsx(B.NtdClipboardCheck,{size:20}),h?"Voting Results":"Vote for Attractions"]}),!h&&x!==void 0&&e.jsxs("span",{style:{fontSize:14,color:x>0?"var(--color-primary, #6366f1)":"var(--color-error, #ef4444)"},children:[x," vote",x!==1?"s":""," remaining"]})]}),h&&e.jsx("p",{style:{color:"var(--text-secondary, #64748b)",marginBottom:12},children:"Voting is closed. Final results:"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8},children:b.map((c,N)=>{const v=g.has(c.id),T=c.votes??0,S=u?`${Math.round(T/k*100)}%`:"0%";return e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"10px 14px",borderRadius:8,border:v?"2px solid var(--color-primary, #6366f1)":"1px solid var(--border-color, #cbd5e1)",background:v?"color-mix(in srgb, var(--color-primary) 12%, transparent)":"var(--bg-elevated, var(--bg-primary))",cursor:h?"default":"pointer",transition:"all 0.2s"},onClick:()=>j(c.id),children:[u&&e.jsx("span",{style:{fontSize:18,minWidth:32,textAlign:"center"},children:M(N)}),e.jsx("span",{style:{display:"inline-flex",fontSize:20},children:o.createElement(Bs[c.category],{size:20})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontWeight:600},children:c.name}),c.description&&e.jsx("div",{style:{fontSize:13,color:"var(--text-secondary, #64748b)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.description}),u&&e.jsx("div",{style:{marginTop:4,height:6,borderRadius:3,background:"var(--bg-tertiary, #e2e8f0)",overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:S,background:"var(--color-primary, #6366f1)",borderRadius:3,transition:"width 0.3s"}})})]}),u&&e.jsx("span",{style:{fontWeight:600,fontSize:16,minWidth:40,textAlign:"right"},children:T}),!h&&e.jsx("button",{onClick:R=>{R.stopPropagation(),j(c.id)},style:{padding:"4px 12px",borderRadius:4,border:"none",background:v?"var(--color-error, #ef4444)":"var(--color-primary, #6366f1)",color:"#fff",cursor:"pointer",fontSize:13},children:v?"Unvote":"Vote"})]},c.id)})}),u&&e.jsxs("div",{style:{marginTop:12,textAlign:"right",fontSize:13,color:"var(--text-secondary, #64748b)"},children:["Total votes: ",n.reduce((c,N)=>c+(N.votes??0),0)]})]})});exports.NiceAttractionPicker=Ps;exports.NiceAttractionVoting=Rs;exports.NiceEventMedia=Pn;exports.NiceEventPlanning=En;exports.NiceExpenseSplit=Ss;exports.NiceGiftRegistry=js;exports.NiceInvitationDesigner=fs;exports.NiceKaraokePicker=As;exports.NiceMediaCollage=Bn;exports.NiceParticipantList=Xn;exports.NiceRoundCard=Ms;exports.NiceRoundList=zs;exports.NiceRsvpControl=Pe;exports.NiceSeatPicker=ds;exports.NiceSeatingChart=tn;exports.NiceSongPicker=Ts;